[PINT-2637] - Several new features#3826
Conversation
| this.log( | ||
| chalk.greenBright`Visit https://app.segment.com/dev-center/actions-tester to preview your integration.` | ||
| ) | ||
| void open('https://app.segment.com/dev-center/actions-tester') |
There was a problem hiding this comment.
hi @jumpingGrendel - please remove the change to this file, as it's not part of the airship integration.
| description: 'Create in the Airship Go dashboard in Settings->Partner Integrations->Segment', | ||
| type: 'password', | ||
| // default: process.env.DEFAULT_ACCESS_TOKEN, | ||
| default: process.env.DEFAULT_ACCESS_TOKEN, |
There was a problem hiding this comment.
Hi @jumpingGrendel I think you left this in by mistake. Can you remove please?
| description: 'The App Key identifies the Airship Project to which API requests are made.', | ||
| type: 'password', | ||
| // default: process.env.DEFAULT_APP_KEY, | ||
| default: process.env.DEFAULT_APP_KEY, |
There was a problem hiding this comment.
Hi @jumpingGrendel I think you left this in by mistake. Can you remove please?
| }, | ||
| channel_type: { | ||
| label: 'Channel Type', | ||
| description: 'The Airship audience key for the channel type (e.g. android_channel, ios_channel, amazon_channel, web_channel). If omitted, the generic channel key is used and Airship will resolve the type, which may introduce a slight delay.', |
There was a problem hiding this comment.
Hi @jumpingGrendel we can turn this into an enum if you like?
Just add:
choices: [
{ label: 'Android Channel', value: 'android_channel' },
{ label: 'iOS Channel', value: 'ios_channel' },
{ label: 'Amazon Channel', value: 'amazon_channel' },
{ label: 'Web Channel', value: 'web_channel' }
]
This will only allow one of those 4 values to be passed. If the user passes something else it will throw a PayloadValidationError.
| channel_type: { | ||
| label: 'Channel Type', | ||
| description: 'The Airship audience key for the channel type (e.g. android_channel, ios_channel, amazon_channel). If omitted, the generic channel key is used and Airship will resolve the type, which may introduce a slight delay.', | ||
| type: 'string', | ||
| required: false | ||
| }, |
There was a problem hiding this comment.
Hi @jumpingGrendel we can turn this into an enum if you like?
Just add:
choices: [
{ label: 'Android Channel', value: 'android_channel' },
{ label: 'iOS Channel', value: 'ios_channel' },
{ label: 'Amazon Channel', value: 'amazon_channel' }
]
This will only allow one of those 4 values to be passed. If the user passes something else it will throw a PayloadValidationError.
| channel_type: { | ||
| label: 'Channel Type', | ||
| description: 'The Airship audience key for the channel type (e.g. android_channel, ios_channel, amazon_channel, web_channel). If omitted, the generic channel key is used and Airship will resolve the type, which may introduce a slight delay.', | ||
| type: 'string', | ||
| required: false | ||
| }, |
There was a problem hiding this comment.
Hi @jumpingGrendel we can turn this into an enum if you like?
Just add:
choices: [
{ label: 'Android Channel', value: 'android_channel' },
{ label: 'iOS Channel', value: 'ios_channel' },
{ label: 'Amazon Channel', value: 'amazon_channel' },
{ label: 'Web Channel', value: 'web_channel' }
]
This will only allow one of those 4 values to be passed. If the user passes something else it will throw a PayloadValidationError.
| Accept: 'application/vnd.urbanairship+json; version=3', | ||
| 'Content-Type': 'application/json' | ||
| 'Content-Type': 'application/json', | ||
| 'User-Agent': `PartnerIntegrations/Segment (${settings.app_key})` |
There was a problem hiding this comment.
Hi @jumpingGrendel can you include this new header in a unit test please? Just want to make sure it's completely deliberate.
|
Hi @jumpingGrendel |
…tently — maps ios/android/amazon/web → *_channel, falls back to generic channel when omitted/unrecognized * gave channel_type a default: $.context.device.type and kept it a free string * added a User-Agent header unit test * added batch test for customEvents (was missing) * dropped the BROWSER/serve.ts commit * commented index.ts env-var defaults
b7ab09d to
009164e
Compare
Hello @joe-ayoub-segment thanks for the review. I removed the change to serve (I hope Segment will consider adding this!) as well as the default env-vars as per your requests. I don't want to make channel_type an enum because
I added a unit test for the userAgent change, as well as a couple other test updates, as well as a bit of refactoring to make it make a bit more sense. Also, bunch of screenshots of the testing. I hope that covers it! |
Testing
Security Review
Please ensure sensitive data is properly protected in your integration.
type: 'password'New Destination Checklist
verioning-info.tsfile. example