diff --git a/src/resources/builds.ts b/src/resources/builds.ts index 3cd01c0..8fda8e2 100644 --- a/src/resources/builds.ts +++ b/src/resources/builds.ts @@ -48,7 +48,20 @@ export interface CreateBuildOptions { appBuildSourceId?: string; appCertificateId?: string; appCertificateName?: string; + /** + * @deprecated Use {@link CreateBuildOptions.appChannelIds} instead. + */ appChannelId?: string; + /** + * The ids of the channels the build is deployed to after it succeeds. Web + * only. + */ + appChannelIds?: string[]; + /** + * The names of the channels the build is deployed to after it succeeds. + * Web only. + */ + appChannelNames?: string[]; /** * The id of the configuration to overwrite the native app configuration with. */ diff --git a/test/resources.test.ts b/test/resources.test.ts index 6106196..eee098c 100644 --- a/test/resources.test.ts +++ b/test/resources.test.ts @@ -46,6 +46,20 @@ describe('resources', () => { }); }); + it('creates a build with channel ids', async () => { + const { getLastRequest } = mockFetchJson({ id: 'build-1' }); + const client = new CapawesomeCloud({ token: 't' }); + + await client.apps.builds.create({ + appId: 'app-1', + appChannelIds: ['channel-1', 'channel-2'], + }); + + expect(JSON.parse(getLastRequest().init.body as string)).toEqual({ + appChannelIds: ['channel-1', 'channel-2'], + }); + }); + it('filters environments by name', async () => { const { getLastRequest } = mockFetchJson([]); const client = new CapawesomeCloud({ token: 't' });