-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
996 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
packages/sms/lib/classes/Error/MessageSendPartialFailure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
/** | ||
* Collection Formats for API Parameter Serialization. | ||
* | ||
* Defines various collection formats used for serializing API parameters. | ||
* | ||
* @constant | ||
* @enum {string} | ||
* @readonly | ||
*/ | ||
export const COLLECTION_FORMATS = { | ||
/** | ||
* Comma-separated values collection format. | ||
*/ | ||
csv: ',', | ||
|
||
/** | ||
* Space-separated values collection format. | ||
*/ | ||
ssv: ' ', | ||
|
||
/** | ||
* Tab-separated values collection format. | ||
*/ | ||
tsv: '\t', | ||
|
||
/** | ||
* Pipe-separated values collection format. | ||
*/ | ||
pipes: '|', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,29 @@ | ||
/** | ||
* Enumeration representing the possible message classes. | ||
* | ||
* Defines different message classes that can be associated with SMS messages. | ||
* | ||
* @enum {number} | ||
* @readonly | ||
*/ | ||
export enum MessageClassEnum { | ||
NUMBER_0 = 0, | ||
NUMBER_1 = 1, | ||
NUMBER_2 = 2, | ||
NUMBER_3 = 3, | ||
/** | ||
* Class 0: Flash SMS. | ||
*/ | ||
NUMBER_0 = 0, | ||
|
||
/** | ||
* Class 1: Immediate display (user should be able to read the message instantly). | ||
*/ | ||
NUMBER_1 = 1, | ||
|
||
/** | ||
* Class 2: Mobile equipment-to-mobile equipment (ME-to-ME) communication. | ||
*/ | ||
NUMBER_2 = 2, | ||
|
||
/** | ||
* Class 3: SIM card-based storage. | ||
*/ | ||
NUMBER_3 = 3, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,112 @@ | ||
export enum SMSStatus { | ||
SUCCESS = '0', | ||
THROTTLED = '1', | ||
MISSING_REQUIRED_PARAM = '2', | ||
INVALID_PARAM = '3', | ||
INVALID_CREDENTIALS = '4', | ||
INTERNAL_ERROR = '5', | ||
INVALID_MESSAGE = '6', | ||
BARRED_NUMBER = '7', | ||
PARTNER_ACCOUNT_BARRED = '7', | ||
PARTNER_QUOTA_violation = '9', | ||
TOO_MANY_EXISTING_BINDS = '10', | ||
ACCOUNT_NOT_ENABLED = '11', | ||
MESSAGE_TOO_LONG = '12', | ||
INVALID_SIGNATURE = '14', | ||
INVALID_SENDER_ADDRESS = '15', | ||
INVALID_NETWORK_CODE = '22', | ||
INVALID_CALLBACK_URL = '23', | ||
NON_WHITELISTED_DESTINATION = '29', | ||
SIGNATURE_AND_API_SECRET_DISALLOWED = '32', | ||
NUMBER_DEACTIVATED = '33', | ||
/** | ||
* Enumeration representing possible SMS status codes. | ||
* | ||
* Defines different status codes that can be associated with SMS messages. | ||
* | ||
* @remarks This matches SMSStatus. Since Enums can't be joined, this is here | ||
* to help check valid statuses | ||
* | ||
* @enum {string} | ||
* @readonly | ||
*/ | ||
export enum SMSErrors { | ||
/** | ||
* Success: The message was sent successfully. | ||
*/ | ||
SUCCESS = '0', | ||
|
||
/** | ||
* Throttled: Sending SMS faster than the account limit. | ||
*/ | ||
THROTTLED = '1', | ||
|
||
/** | ||
* Missing Required Parameter: One or more required parameters are missing. | ||
*/ | ||
MISSING_REQUIRED_PARAM = '2', | ||
|
||
/** | ||
* Invalid Parameter: The value of one or more parameters is invalid. | ||
*/ | ||
INVALID_PARAM = '3', | ||
|
||
/** | ||
* Invalid Credentials: API key and/or secret are incorrect, invalid, or disabled. | ||
*/ | ||
INVALID_CREDENTIALS = '4', | ||
|
||
/** | ||
* Internal Error: An error occurred while processing the message. | ||
*/ | ||
INTERNAL_ERROR = '5', | ||
|
||
/** | ||
* Invalid Message: The platform was unable to process the message. | ||
*/ | ||
INVALID_MESSAGE = '6', | ||
|
||
/** | ||
* Barred Number: The number you're trying to send messages to is blacklisted. | ||
*/ | ||
BARRED_NUMBER = '7', | ||
|
||
/** | ||
* Partner Account Barred: Your Vonage account has been suspended. | ||
*/ | ||
PARTNER_ACCOUNT_BARRED = '7', | ||
|
||
/** | ||
* Partner Quota Violation: Insufficient credit to send the message. | ||
*/ | ||
PARTNER_QUOTA_VIOLATION = '9', | ||
|
||
/** | ||
* Too Many Existing Binds: Number of simultaneous connections exceeds account allocation. | ||
*/ | ||
TOO_MANY_EXISTING_BINDS = '10', | ||
|
||
/** | ||
* Account Not Enabled For HTTP: Account is not provisioned for the SMS API. | ||
*/ | ||
ACCOUNT_NOT_ENABLED = '11', | ||
|
||
/** | ||
* Message Too Long: Message length exceeds the maximum allowed. | ||
*/ | ||
MESSAGE_TOO_LONG = '12', | ||
|
||
/** | ||
* Invalid Signature: The supplied signature could not be verified. | ||
*/ | ||
INVALID_SIGNATURE = '14', | ||
|
||
/** | ||
* Invalid Sender Address: Using a non-authorized sender ID in the 'from' field. | ||
*/ | ||
INVALID_SENDER_ADDRESS = '15', | ||
|
||
/** | ||
* Invalid Network Code: Network code is unrecognized or doesn't match the destination. | ||
*/ | ||
INVALID_NETWORK_CODE = '22', | ||
|
||
/** | ||
* Invalid Callback URL: Callback URL is too long or contains illegal characters. | ||
*/ | ||
INVALID_CALLBACK_URL = '23', | ||
|
||
/** | ||
* Non-Whitelisted Destination: Vonage account is in demo mode and requires whitelisted numbers. | ||
*/ | ||
NON_WHITELISTED_DESTINATION = '29', | ||
|
||
/** | ||
* Signature And API Secret Disallowed: A signed request may not present an API secret. | ||
*/ | ||
SIGNATURE_AND_API_SECRET_DISALLOWED = '32', | ||
|
||
/** | ||
* Number Deactivated: The number you're trying to send messages to is deactivated. | ||
*/ | ||
NUMBER_DEACTIVATED = '33', | ||
} |
Oops, something went wrong.