Skip to content

Commit

Permalink
fix(subaccounts): correct type on SubAccountCreateParameters (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
froggy1014 authored Jun 20, 2024
1 parent f98252f commit f7e7531
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 5 additions & 6 deletions packages/subaccounts/__tests__/__dataSets__/subAccounts.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Client } from '@vonage/server-client';
import {
Account,
SubAccountResponsePage,
SubAccountResponse,
SubAccountCreateParameters,
SubAccount,
SubAccountCreateParameters,
SubAccountCreateRequest,
SubAccountModifyParameters,
SubAccountResponse,
SubAccountResponsePage,
} from '../../lib/types';
import { BASE_URL } from '../common';

const primaryAccount = {
apiKey: '12345',
Expand Down Expand Up @@ -110,7 +109,7 @@ export default [
'POST',
{
name: subAccountOne.name,
secret: 'the new secret',
secret: 'The new secret1',
use_primary_account_balance: true,
} as SubAccountCreateRequest,
],
Expand All @@ -127,7 +126,7 @@ export default [
parameters: [
{
name: subAccountOne.name,
secret: 'the new secret',
secret: 'The new secret1',
usePrimaryAccountBalance: true,
} as SubAccountCreateParameters,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ export type SubAccountCreateParameters = {

/**
* API secret of the subaccount.
* - At least 8 characters and no more than 25 characters
* - Contains at least 1 lower-case letter
* - Contains at least 1 capital letter
* - Contains at least 1 digit
* - Must be unique
*
* If this parameter is not provided, a secret will be automatically generated and you can check it on the dashboard.
*/
secret: string;
secret?: string;

/**
* Flag indicating whether to use the primary account balance (true) or not (false).
* Default value is true.
*/
usePrimaryAccountBalance: boolean;
usePrimaryAccountBalance?: boolean;
};

0 comments on commit f7e7531

Please sign in to comment.