Skip to content

Commit f7e7531

Browse files
authored
fix(subaccounts): correct type on SubAccountCreateParameters (#940)
1 parent f98252f commit f7e7531

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

packages/subaccounts/__tests__/__dataSets__/subAccounts.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { Client } from '@vonage/server-client';
22
import {
33
Account,
4-
SubAccountResponsePage,
5-
SubAccountResponse,
6-
SubAccountCreateParameters,
74
SubAccount,
5+
SubAccountCreateParameters,
86
SubAccountCreateRequest,
97
SubAccountModifyParameters,
8+
SubAccountResponse,
9+
SubAccountResponsePage,
1010
} from '../../lib/types';
11-
import { BASE_URL } from '../common';
1211

1312
const primaryAccount = {
1413
apiKey: '12345',
@@ -110,7 +109,7 @@ export default [
110109
'POST',
111110
{
112111
name: subAccountOne.name,
113-
secret: 'the new secret',
112+
secret: 'The new secret1',
114113
use_primary_account_balance: true,
115114
} as SubAccountCreateRequest,
116115
],
@@ -127,7 +126,7 @@ export default [
127126
parameters: [
128127
{
129128
name: subAccountOne.name,
130-
secret: 'the new secret',
129+
secret: 'The new secret1',
131130
usePrimaryAccountBalance: true,
132131
} as SubAccountCreateParameters,
133132
],

packages/subaccounts/lib/types/parameters/subAccountCreateParameters.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ export type SubAccountCreateParameters = {
99

1010
/**
1111
* API secret of the subaccount.
12+
* - At least 8 characters and no more than 25 characters
13+
* - Contains at least 1 lower-case letter
14+
* - Contains at least 1 capital letter
15+
* - Contains at least 1 digit
16+
* - Must be unique
17+
*
18+
* If this parameter is not provided, a secret will be automatically generated and you can check it on the dashboard.
1219
*/
13-
secret: string;
20+
secret?: string;
1421

1522
/**
1623
* Flag indicating whether to use the primary account balance (true) or not (false).
24+
* Default value is true.
1725
*/
18-
usePrimaryAccountBalance: boolean;
26+
usePrimaryAccountBalance?: boolean;
1927
};

0 commit comments

Comments
 (0)