@vonage/subaccounts
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -19,2 +19,1 @@ "use strict"; | ||
__exportStar(require("./subaccount"), exports); | ||
//# sourceMappingURL=index.js.map |
import { AuthenticationType, Client } from '@vonage/server-client'; | ||
import { SubAccount, SubAccountResponsePage, Account, SubAccountCreateParameters, SubAccountModifyParameters, CreditTransferListParameters, CreditTransfer, CreditTransferParameters, BalanceTransferListParameters, BalanceTransfer, BalanceTransferParameters, NumberTransfer } from './types'; | ||
/** | ||
* Represents a client for interacting with Vonage Subaccounts API. This class provides methods | ||
* for managing subaccounts, credit transfers, balance transfers, and number transfers. | ||
*/ | ||
export declare class SubAccounts extends Client { | ||
protected authType: AuthenticationType; | ||
/** | ||
* Retrieves a page of subaccounts associated with the primary account. | ||
* | ||
* @return {Promise<SubAccountResponsePage>} A promise that resolves to a page of subaccount information. | ||
*/ | ||
getSubAccountPage(): Promise<SubAccountResponsePage>; | ||
/** | ||
* Retrieves a list of subaccounts associated with the primary account. | ||
* | ||
* @return {Promise<Array<SubAccount>>} A promise that resolves to an array of subaccount information. | ||
*/ | ||
listSubAccounts(): Promise<Array<SubAccount>>; | ||
/** | ||
* Retrieves information about the primary account associated with the subaccounts. | ||
* | ||
* @return {Promise<Account>} A promise that resolves to information about the primary account. | ||
*/ | ||
getPrimaryAccount(): Promise<Account>; | ||
/** | ||
* Creates a new subaccount under the primary account. | ||
* | ||
* @param {SubAccountCreateParameters} subAccount - The parameters for creating the subaccount. | ||
* @return {Promise<SubAccount>} A promise that resolves to the created subaccount information. | ||
*/ | ||
createSubAccount(subAccount: SubAccountCreateParameters): Promise<SubAccount>; | ||
/** | ||
* Retrieves information about a specific subaccount by its ID. | ||
* | ||
* @param {string} subAccountId - The ID of the subaccount to retrieve. | ||
* @return {Promise<SubAccount>} A promise that resolves to the subaccount information. | ||
*/ | ||
getSubAccount(subAccountId: string): Promise<SubAccount>; | ||
/** | ||
* Modifies one or more properties of a specific subaccount. | ||
* | ||
* @param {string} subAccountId - The ID of the subaccount to modify. | ||
* @param {SubAccountModifyParameters} params - The parameters for modifying the subaccount. | ||
* @return {Promise<SubAccount>} A promise that resolves to the modified subaccount information. | ||
*/ | ||
updateSubAccount(subAccountId: string, params: SubAccountModifyParameters): Promise<SubAccount>; | ||
/** | ||
* Retrieves a list of credit transfers that have taken place for a primary account within a specified time period. | ||
* | ||
* @param {CreditTransferListParameters} params - The parameters for filtering the list of credit transfers. | ||
* @return {Promise<Array<CreditTransfer>>} A promise that resolves to an array of credit transfer information. | ||
*/ | ||
listCreditTransfers(params: CreditTransferListParameters): Promise<Array<CreditTransfer>>; | ||
/** | ||
* Transfers credit limit between a primary account and one of its subaccounts. | ||
* | ||
* @param {CreditTransferParameters} params - The parameters for transferring credit. | ||
* @return {Promise<CreditTransfer>} A promise that resolves to information about the credit transfer. | ||
*/ | ||
transferCredit(params: CreditTransferParameters): Promise<CreditTransfer>; | ||
/** | ||
* Retrieves a list of balance transfers that have taken place for a primary account within a specified time period. | ||
* | ||
* @param {BalanceTransferListParameters} params - The parameters for filtering balance transfers. | ||
* @return {Promise<Array<BalanceTransfer>>} A promise that resolves to an array of balance transfer information. | ||
*/ | ||
listBalanceTransfers(params: BalanceTransferListParameters): Promise<Array<BalanceTransfer>>; | ||
/** | ||
* Transfers balance between a primary account and one of its subaccounts. | ||
* | ||
* @param {BalanceTransferParameters} params - The parameters for the balance transfer. | ||
* @return {Promise<BalanceTransfer>} A promise that resolves to the details of the balance transfer. | ||
*/ | ||
transferBalance(params: BalanceTransferParameters): Promise<BalanceTransfer>; | ||
/** | ||
* Transfers a phone number from one account to another. | ||
* | ||
* @param {NumberTransfer} params - The parameters for the number transfer. | ||
* @return {Promise<NumberTransfer>} A promise that resolves to the details of the number transfer. | ||
*/ | ||
transferNumber(params: NumberTransfer): Promise<NumberTransfer>; | ||
} |
@@ -6,4 +6,16 @@ "use strict"; | ||
const apiToSubAccount = (subAccount) => server_client_1.Client.transformers.camelCaseObjectKeys(subAccount, true); | ||
/** | ||
* Represents a client for interacting with Vonage Subaccounts API. This class provides methods | ||
* for managing subaccounts, credit transfers, balance transfers, and number transfers. | ||
*/ | ||
class SubAccounts extends server_client_1.Client { | ||
authType = server_client_1.AuthenticationType.BASIC; | ||
constructor() { | ||
super(...arguments); | ||
this.authType = server_client_1.AuthenticationType.BASIC; | ||
} | ||
/** | ||
* Retrieves a page of subaccounts associated with the primary account. | ||
* | ||
* @return {Promise<SubAccountResponsePage>} A promise that resolves to a page of subaccount information. | ||
*/ | ||
async getSubAccountPage() { | ||
@@ -13,2 +25,7 @@ const resp = await this.sendGetRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/subaccounts`); | ||
} | ||
/** | ||
* Retrieves a list of subaccounts associated with the primary account. | ||
* | ||
* @return {Promise<Array<SubAccount>>} A promise that resolves to an array of subaccount information. | ||
*/ | ||
async listSubAccounts() { | ||
@@ -18,2 +35,7 @@ const resp = await this.getSubAccountPage(); | ||
} | ||
/** | ||
* Retrieves information about the primary account associated with the subaccounts. | ||
* | ||
* @return {Promise<Account>} A promise that resolves to information about the primary account. | ||
*/ | ||
async getPrimaryAccount() { | ||
@@ -23,2 +45,8 @@ const resp = await this.getSubAccountPage(); | ||
} | ||
/** | ||
* Creates a new subaccount under the primary account. | ||
* | ||
* @param {SubAccountCreateParameters} subAccount - The parameters for creating the subaccount. | ||
* @return {Promise<SubAccount>} A promise that resolves to the created subaccount information. | ||
*/ | ||
async createSubAccount(subAccount) { | ||
@@ -28,2 +56,8 @@ const resp = await this.sendPostRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/subaccounts`, server_client_1.Client.transformers.snakeCaseObjectKeys(subAccount)); | ||
} | ||
/** | ||
* Retrieves information about a specific subaccount by its ID. | ||
* | ||
* @param {string} subAccountId - The ID of the subaccount to retrieve. | ||
* @return {Promise<SubAccount>} A promise that resolves to the subaccount information. | ||
*/ | ||
async getSubAccount(subAccountId) { | ||
@@ -33,2 +67,9 @@ const resp = await this.sendGetRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/subaccounts/${subAccountId}`); | ||
} | ||
/** | ||
* Modifies one or more properties of a specific subaccount. | ||
* | ||
* @param {string} subAccountId - The ID of the subaccount to modify. | ||
* @param {SubAccountModifyParameters} params - The parameters for modifying the subaccount. | ||
* @return {Promise<SubAccount>} A promise that resolves to the modified subaccount information. | ||
*/ | ||
async updateSubAccount(subAccountId, params) { | ||
@@ -38,2 +79,8 @@ const resp = await this.sendPatchRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/subaccounts/${subAccountId}`, server_client_1.Client.transformers.snakeCaseObjectKeys(params)); | ||
} | ||
/** | ||
* Retrieves a list of credit transfers that have taken place for a primary account within a specified time period. | ||
* | ||
* @param {CreditTransferListParameters} params - The parameters for filtering the list of credit transfers. | ||
* @return {Promise<Array<CreditTransfer>>} A promise that resolves to an array of credit transfer information. | ||
*/ | ||
async listCreditTransfers(params) { | ||
@@ -43,2 +90,8 @@ const resp = await this.sendGetRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/credit-transfers`, server_client_1.Client.transformers.snakeCaseObjectKeys(params)); | ||
} | ||
/** | ||
* Transfers credit limit between a primary account and one of its subaccounts. | ||
* | ||
* @param {CreditTransferParameters} params - The parameters for transferring credit. | ||
* @return {Promise<CreditTransfer>} A promise that resolves to information about the credit transfer. | ||
*/ | ||
async transferCredit(params) { | ||
@@ -48,2 +101,8 @@ const resp = await this.sendPostRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/credit-transfers`, server_client_1.Client.transformers.snakeCaseObjectKeys(params)); | ||
} | ||
/** | ||
* Retrieves a list of balance transfers that have taken place for a primary account within a specified time period. | ||
* | ||
* @param {BalanceTransferListParameters} params - The parameters for filtering balance transfers. | ||
* @return {Promise<Array<BalanceTransfer>>} A promise that resolves to an array of balance transfer information. | ||
*/ | ||
async listBalanceTransfers(params) { | ||
@@ -53,2 +112,8 @@ const resp = await this.sendGetRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/balance-transfers`, server_client_1.Client.transformers.snakeCaseObjectKeys(params)); | ||
} | ||
/** | ||
* Transfers balance between a primary account and one of its subaccounts. | ||
* | ||
* @param {BalanceTransferParameters} params - The parameters for the balance transfer. | ||
* @return {Promise<BalanceTransfer>} A promise that resolves to the details of the balance transfer. | ||
*/ | ||
async transferBalance(params) { | ||
@@ -58,2 +123,8 @@ const resp = await this.sendPostRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/balance-transfers`, server_client_1.Client.transformers.snakeCaseObjectKeys(params)); | ||
} | ||
/** | ||
* Transfers a phone number from one account to another. | ||
* | ||
* @param {NumberTransfer} params - The parameters for the number transfer. | ||
* @return {Promise<NumberTransfer>} A promise that resolves to the details of the number transfer. | ||
*/ | ||
async transferNumber(params) { | ||
@@ -65,2 +136,1 @@ const resp = await this.sendPostRequest(`${this.config.apiHost}/accounts/${this.auth.apiKey}/transfer-number`, server_client_1.Client.transformers.snakeCaseObjectKeys(params)); | ||
exports.SubAccounts = SubAccounts; | ||
//# sourceMappingURL=subaccount.js.map |
@@ -0,8 +1,30 @@ | ||
/** | ||
* Type definition representing an account, which includes properties such as | ||
* `apiKey`, `name`, `createdAt`, `suspended`, `balance`, and `creditLimit`. | ||
*/ | ||
export type Account = { | ||
/** | ||
* The API key associated with the account. | ||
*/ | ||
apiKey: string; | ||
/** | ||
* The name of the account. | ||
*/ | ||
name: string; | ||
/** | ||
* The creation date and time of the account. | ||
*/ | ||
createdAt: string; | ||
/** | ||
* The suspension status of the account. | ||
*/ | ||
suspended: boolean; | ||
/** | ||
* The balance of the account. | ||
*/ | ||
balance: number; | ||
/** | ||
* The credit limit of the account. | ||
*/ | ||
creditLimit: number; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=account.js.map |
@@ -0,8 +1,30 @@ | ||
/** | ||
* Type definition representing a balance transfer, which includes properties | ||
* such as `balanceTransferId`, `amount`, `from`, `to`, `reference`, and `createdAt`. | ||
*/ | ||
export type BalanceTransfer = { | ||
/** | ||
* The unique identifier for the balance transfer. | ||
*/ | ||
balanceTransferId: string; | ||
/** | ||
* The amount of the balance transfer. | ||
*/ | ||
amount: number; | ||
/** | ||
* The source account from which the balance is transferred. | ||
*/ | ||
from: string; | ||
/** | ||
* The destination account to which the balance is transferred. | ||
*/ | ||
to: string; | ||
/** | ||
* A reference for the balance transfer. | ||
*/ | ||
reference: string; | ||
/** | ||
* The date and time when the balance transfer was executed. | ||
*/ | ||
createdAt: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=balanceTransfer.js.map |
@@ -0,8 +1,30 @@ | ||
/** | ||
* Type definition representing a credit transfer, which includes properties such as `creditTransferId`, `amount`, | ||
* `from`, `to`, `reference`, and `createdAt`. | ||
*/ | ||
export type CreditTransfer = { | ||
/** | ||
* The unique identifier for the credit transfer. | ||
*/ | ||
creditTransferId: string; | ||
/** | ||
* The amount of the credit transfer. | ||
*/ | ||
amount: number; | ||
/** | ||
* The source account from which the credit is transferred. | ||
*/ | ||
from: string; | ||
/** | ||
* The destination account to which the credit is transferred. | ||
*/ | ||
to: string; | ||
/** | ||
* A reference for the credit transfer. | ||
*/ | ||
reference: string; | ||
/** | ||
* The date and time when the credit transfer was executed. | ||
*/ | ||
createdAt: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=creditTransfer.js.map |
@@ -25,2 +25,1 @@ "use strict"; | ||
__exportStar(require("./subAccount"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,6 +1,22 @@ | ||
/** | ||
* Type definition representing a number transfer, which includes properties such as `number`, `country`, `from`, and | ||
* `to`. | ||
*/ | ||
export type NumberTransfer = { | ||
/** | ||
* The number being transferred. | ||
*/ | ||
number: string; | ||
/** | ||
* The two-character country code in ISO 3166-1 alpha-2 format. | ||
*/ | ||
country: string; | ||
/** | ||
* The source account from which the number is transferred. | ||
*/ | ||
from: string; | ||
/** | ||
* The destination account to which the number is transferred. | ||
*/ | ||
to: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=numberTransfer.js.map |
@@ -0,5 +1,17 @@ | ||
/** | ||
* Type definition for parameters used to retrieve a list of balance transfers for a primary account. | ||
*/ | ||
export type BalanceTransferListParameters = { | ||
/** | ||
* The start date of the retrieval period. | ||
*/ | ||
startDate: string; | ||
/** | ||
* The end date of the retrieval period. If absent, all transfers until now are returned. | ||
*/ | ||
endDate?: string; | ||
/** | ||
* Subaccount to filter by. You may send this multiple times to filter on multiple subaccounts. | ||
*/ | ||
subaccount?: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=balanceTransferListParameters.js.map |
@@ -0,6 +1,21 @@ | ||
/** | ||
* Type definition for parameters used to transfer balance between accounts. | ||
*/ | ||
export type BalanceTransferParameters = { | ||
/** | ||
* The account ID from which the balance is transferred. | ||
*/ | ||
from: string; | ||
/** | ||
* The account ID to which the balance is transferred. | ||
*/ | ||
to: string; | ||
/** | ||
* The amount of balance to transfer. | ||
*/ | ||
amount: string; | ||
/** | ||
* (Optional) A reference for the balance transfer. | ||
*/ | ||
reference?: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=balanceTransferParameters.js.map |
@@ -0,5 +1,17 @@ | ||
/** | ||
* Type definition for parameters used to retrieve a list of credit transfers for a primary account. | ||
*/ | ||
export type CreditTransferListParameters = { | ||
/** | ||
* The start date of the retrieval period. | ||
*/ | ||
startDate: string; | ||
/** | ||
* (Optional) The end date of the retrieval period. If absent, all transfers until now are returned. | ||
*/ | ||
endDate?: string; | ||
/** | ||
* (Optional) Subaccount to filter by. You may send this multiple times to filter on multiple subaccounts. | ||
*/ | ||
sub?: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=creditTransferListParameters.js.map |
@@ -0,6 +1,21 @@ | ||
/** | ||
* Type definition for parameters used to perform a credit transfer between accounts. | ||
*/ | ||
export type CreditTransferParameters = { | ||
/** | ||
* The account ID from which the credit is transferred. | ||
*/ | ||
from: string; | ||
/** | ||
* The account ID to which the credit is transferred. | ||
*/ | ||
to: string; | ||
/** | ||
* The amount of credit to transfer. | ||
*/ | ||
amount: string; | ||
/** | ||
* (Optional) A reference for the credit transfer. | ||
*/ | ||
reference?: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=creditTransferParameters.js.map |
@@ -24,2 +24,1 @@ "use strict"; | ||
__exportStar(require("./transferListParameters"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,5 +1,17 @@ | ||
/** | ||
* Type definition for parameters used to create a subaccount for a primary account. | ||
*/ | ||
export type SubAccountCreateParameters = { | ||
/** | ||
* Name of the subaccount. | ||
*/ | ||
name: string; | ||
/** | ||
* API secret of the subaccount. | ||
*/ | ||
secret: string; | ||
/** | ||
* Flag indicating whether to use the primary account balance (true) or not (false). | ||
*/ | ||
usePrimaryAccountBalance: boolean; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=subAccountCreateParameters.js.map |
@@ -0,4 +1,13 @@ | ||
/** | ||
* Type definition for parameters used to modify a subaccount's properties. | ||
*/ | ||
export type SubAccountModifyParameters = { | ||
/** | ||
* (Optional) Indicates whether the subaccount should be suspended (true) or not (false). | ||
*/ | ||
suspended?: boolean; | ||
/** | ||
* (Optional) New name for the subaccount. | ||
*/ | ||
name?: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=subAccountModifyParameters.js.map |
@@ -0,5 +1,17 @@ | ||
/** | ||
* Type definition for parameters used to retrieve a list of transfers for a primary account. | ||
*/ | ||
export type TransferListParameters = { | ||
/** | ||
* The start date of the retrieval period. | ||
*/ | ||
startDate: string; | ||
/** | ||
* (Optional) The end date of the retrieval period. If absent, all transfers until now are returned. | ||
*/ | ||
endDate?: string; | ||
/** | ||
* (Optional) Subaccount to filter by. You may send this multiple times to filter on multiple subaccounts. | ||
*/ | ||
subAccount?: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=transferListParameters.js.map |
@@ -18,2 +18,1 @@ "use strict"; | ||
__exportStar(require("./subAccountCreateRequest"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,12 @@ | ||
import { SubAccountCreateParameters } from '../parameters/subAccountCreateParameters'; | ||
import { SubAccountCreateParameters } from '../parameters'; | ||
/** | ||
* Type definition for the request used to create a subaccount for a primary account. | ||
* It combines the `use_primary_account_balance` property with the properties from `SubAccountCreateParameters` | ||
* while omitting the `usePrimaryAccountBalance` property. | ||
*/ | ||
export type SubAccountCreateRequest = { | ||
/** | ||
* Flag indicating whether to use the primary account balance (true) or not (false). | ||
*/ | ||
use_primary_account_balance: boolean; | ||
} & Omit<SubAccountCreateParameters, 'usePrimaryAccountBalance'>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=subAccountCreateRequest.js.map |
import { SubAccount } from '../subAccount'; | ||
/** | ||
* Type definition for the response representing an account, which includes | ||
* properties such as `api_key`, `created_at`, `balance`, and `credit_limit`. | ||
* This type combines properties from the account response with the properties | ||
* of a subaccount (excluding specific subaccount-related properties). | ||
* | ||
* @remarks | ||
* Vonage API's will return information using `snake_case`. This represents the | ||
* pure response before the client will transform the keys into `camelCase`. | ||
*/ | ||
export type AccountResponse = { | ||
/** | ||
* The API key associated with the account. | ||
*/ | ||
api_key: string; | ||
/** | ||
* The creation date and time of the account. | ||
*/ | ||
created_at: string; | ||
/** | ||
* The balance of the account. | ||
*/ | ||
balance: number; | ||
/** | ||
* The credit limit of the account. | ||
*/ | ||
credit_limit: number; | ||
} & Omit<SubAccount, 'apiKey' | 'primaryAccountApiKey' | 'usePrimaryAccountBalance' | 'createdAt' | 'creditLimit'>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=accountResponse.js.map |
import { APILinks } from '@vonage/server-client'; | ||
import { BalanceTransferResponse } from './balanceTransferResponse'; | ||
/** | ||
* Type definition for the response representing a page of balance transfers, | ||
* which includes an array of `balance_transfers` and APILinks. | ||
* | ||
* @remarks | ||
* Vonage API's will return information using `snake_case`. This represents the | ||
* pure response before the client will transform the keys into `camelCase`. | ||
*/ | ||
export type BalanceTransferPageResponse = { | ||
/** | ||
* An object containing an array of `balance_transfers`. | ||
*/ | ||
_embedded: { | ||
@@ -5,0 +16,0 @@ balance_transfers: Array<BalanceTransferResponse>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=balanceTransferPageResponse.js.map |
import { BalanceTransfer } from '../balanceTransfer'; | ||
/** | ||
* Type definition for the response representing a balance transfer, which includes properties such as | ||
* `balance_transfer_id` and `created_at`. This type combines properties from the balance transfer response with the | ||
* properties of a `BalanceTransfer` (excluding specific properties). | ||
* | ||
* @remarks | ||
* Vonage API's will return information using `snake_case`. This represents the pure response before the client will | ||
* transform the keys into `camelCase`. | ||
*/ | ||
export type BalanceTransferResponse = { | ||
/** | ||
* The unique identifier for the balance transfer. | ||
*/ | ||
balance_transfer_id: string; | ||
/** | ||
* The date and time when the balance transfer was executed. | ||
*/ | ||
created_at: string; | ||
} & Omit<BalanceTransfer, 'balanceTransferId' | 'createdAt'>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=balanceTransferResponse.js.map |
import { CreditTransfer } from '../creditTransfer'; | ||
/** | ||
* Type definition for the response representing a credit transfer, which | ||
* includes properties such as `credit_transfer_id` and `created_at`. This type | ||
* combines properties from the credit transfer response with the properties of | ||
* a `CreditTransfer` (excluding specific properties). | ||
* | ||
* @remarks | ||
* Vonage API's will return information using `snake_case`. This represents the | ||
* pure response before the client will transform the keys into `camelCase`. | ||
*/ | ||
export type CreditTransferResponse = { | ||
/** | ||
* The unique identifier for the credit transfer. | ||
*/ | ||
credit_transfer_id: string; | ||
/** | ||
* The date and time when the credit transfer was executed. | ||
*/ | ||
created_at: string; | ||
} & Omit<CreditTransfer, 'creditTransferId' | 'createdAt'>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=creditTransferResponse.js.map |
import { CreditTransferResponse } from './creditTransferResponse'; | ||
/** | ||
* Type definition for the response representing a page of credit transfers, | ||
* which includes an array of `credit_transfers`. | ||
* | ||
* @remarks | ||
* Vonage API's will return information using `snake_case`. This represents the | ||
* pure response before the client will transform the keys into `camelCase`. | ||
*/ | ||
export type CreditTransferResponsePage = { | ||
/** | ||
* An object containing an array of `credit_transfers`. | ||
*/ | ||
_embedded: { | ||
@@ -4,0 +15,0 @@ credit_transfers: Array<CreditTransferResponse>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=creditTransferResponsePage.js.map |
@@ -24,2 +24,1 @@ "use strict"; | ||
__exportStar(require("./subAccountResponsePage"), exports); | ||
//# sourceMappingURL=index.js.map |
import { AccountResponse } from './accountResponse'; | ||
/** | ||
* Type definition for the response representing a subaccount, which includes | ||
* properties such as `primary_account_api_key` and | ||
* `use_primary_account_balance`. This type combines properties from the | ||
* subaccount response with the properties of an `AccountResponse`. | ||
* | ||
* @remarks | ||
* Vonage API's will return information using `snake_case`. This represents the | ||
* pure response before the client will transform the keys into `camelCase`. | ||
*/ | ||
export type SubAccountResponse = { | ||
/** | ||
* The API key associated with the primary account. | ||
*/ | ||
primary_account_api_key: string; | ||
/** | ||
* Flag indicating whether to use the primary account balance (true) or not (false). | ||
*/ | ||
use_primary_account_balance: boolean; | ||
} & AccountResponse; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=subAccountResponse.js.map |
import { SubAccountResponse } from './subAccountResponse'; | ||
import { AccountResponse } from './accountResponse'; | ||
import { APILinks } from '@vonage/server-client'; | ||
/** | ||
* Type definition for the response representing a page of subaccounts, which | ||
* includes properties such as `total_balance`, `total_credit_limit`, | ||
* `_embedded` with `primary_account`, `subaccounts`, and APILinks. | ||
* | ||
* @remarks | ||
* Vonage API's will return information using `snake_case`. This represents the | ||
* pure response before the client will transform the keys into `camelCase`. | ||
*/ | ||
export type SubAccountResponsePage = { | ||
/** | ||
* The total balance of the subaccounts. | ||
*/ | ||
total_balance: number; | ||
/** | ||
* The total credit limit of the subaccounts. | ||
*/ | ||
total_credit_limit: number; | ||
/** | ||
* An object containing the primary account information and an array of `subaccounts`. | ||
*/ | ||
_embedded: { | ||
@@ -8,0 +26,0 @@ primary_account: AccountResponse; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=subAccountResponsePage.js.map |
import { Account } from './account'; | ||
/** | ||
* Type definition representing a subaccount, which includes properties such | ||
* as `primaryAccountApiKey` and `usePrimaryAccountBalance`, in addition to | ||
* properties from the `Account` type. | ||
*/ | ||
export type SubAccount = { | ||
/** | ||
* The API key associated with the primary account. | ||
*/ | ||
primaryAccountApiKey: string; | ||
/** | ||
* Flag indicating whether to use the primary account balance (true) or not (false). | ||
*/ | ||
usePrimaryAccountBalance: boolean; | ||
} & Account; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=subAccount.js.map |
{ | ||
"$schema": "https://json.schemastore.org/package.json", | ||
"name": "@vonage/subaccounts", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "The Subaccounts API enables you to create subaccounts under your primary account. Subaccounts facilitate differential product configuration, reporting, and billing. The Subaccounts API is released initially with restricted availability.", | ||
@@ -17,3 +18,12 @@ "keywords": [ | ||
"license": "Apache-2.0", | ||
"author": "Chuck MANCHUCK Reeves <chuck@manchuck.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Chuck \"MANCHUCK\" Reeves", | ||
"url": "https://github.com/manchuck" | ||
}, | ||
{ | ||
"name": "Chris Tankersley", | ||
"url": "https://github.com/dragonmantank" | ||
} | ||
], | ||
"main": "dist/index.js", | ||
@@ -31,11 +41,12 @@ "types": "dist/index.d.ts", | ||
"clean": "npx shx rm -rf dist tsconfig.tsbuildinfo", | ||
"compile": "npx tsc --build --verbose" | ||
"compile": "npx tsc --build --verbose", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"dependencies": { | ||
"@vonage/server-client": "^1.9.0" | ||
"@vonage/server-client": "^1.10.0" | ||
}, | ||
"devDependencies": { | ||
"@vonage/auth": "^1.7.0", | ||
"@vonage/auth": "^1.8.0", | ||
"nock": "^13.3.4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35993
797
54
+ Added@types/node@22.9.3(transitive)
- Removed@types/node@22.9.1(transitive)