Skip to content

Commit ba24a07

Browse files
authored
Outbound app enhancement (#537)
* Allow to set outbound app clientSecret in app creation * lint fix * add clientSecret to outbound app object * Allow to set outbound app clientSecret in app creation and update * revert adding clientSecret to main object * fix format
1 parent 619c5ae commit ba24a07

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/management/outboundapplication.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ describe('Management OutboundApplication', () => {
5555
await management.outboundApplication.createApplication({
5656
name: 'name',
5757
description: 'test',
58+
clientSecret: 'shhh..',
5859
});
5960

6061
expect(mockHttpClient.post).toHaveBeenCalledWith(
6162
apiPaths.outboundApplication.create,
6263
{
6364
name: 'name',
6465
description: 'test',
66+
clientSecret: 'shhh..',
6567
},
6668
{ token: 'key' },
6769
);
@@ -92,6 +94,7 @@ describe('Management OutboundApplication', () => {
9294
name: 'name',
9395
logo: 'logo',
9496
description: 'desc',
97+
clientSecret: 'shhh..',
9598
});
9699

97100
expect(mockHttpClient.post).toHaveBeenCalledWith(
@@ -102,6 +105,7 @@ describe('Management OutboundApplication', () => {
102105
name: 'name',
103106
logo: 'logo',
104107
description: 'desc',
108+
clientSecret: 'shhh..',
105109
},
106110
},
107111
{ token: 'key' },

lib/management/outboundapplication.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
1515

1616
const withOutboundApplication = (sdk: CoreSdk, managementKey?: string) => ({
1717
createApplication: (
18-
app: WithOptional<OutboundApplication, 'id'>,
18+
app: WithOptional<OutboundApplication, 'id'> & { clientSecret?: string },
1919
): Promise<SdkResponse<OutboundApplication>> =>
2020
transformResponse<OutboundApplicationResponse, OutboundApplication>(
2121
sdk.httpClient.post(
@@ -27,7 +27,9 @@ const withOutboundApplication = (sdk: CoreSdk, managementKey?: string) => ({
2727
),
2828
(data) => data.app,
2929
),
30-
updateApplication: (app: OutboundApplication): Promise<SdkResponse<OutboundApplication>> =>
30+
updateApplication: (
31+
app: OutboundApplication & { clientSecret?: string },
32+
): Promise<SdkResponse<OutboundApplication>> =>
3133
transformResponse<OutboundApplicationResponse, OutboundApplication>(
3234
sdk.httpClient.post(
3335
apiPaths.outboundApplication.update,

0 commit comments

Comments
 (0)