diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..67b369e
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,3 @@
+{
+ "presets": ["env", "stage-0"]
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..47cf36f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,66 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# TypeScript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+
+# next.js build output
+.next
+
+# IntelliJ IDEA
+.idea/
+*.iml
+*.iws
diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore
new file mode 100644
index 0000000..65c853d
--- /dev/null
+++ b/.swagger-codegen-ignore
@@ -0,0 +1,27 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
+
+test/api/AssetApi.spec.js
+test/api/CampaignApi.spec.js
+test/api/TransactionalMessagingApi.spec.js
\ No newline at end of file
diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION
new file mode 100644
index 0000000..752a79e
--- /dev/null
+++ b/.swagger-codegen/VERSION
@@ -0,0 +1 @@
+2.4.8
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..3abdec1
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,13 @@
+language: node_js
+node_js:
+ - "12.10.0"
+
+branches:
+ only:
+ - master
+ - develop
+ - /^feature\/.*$/
+ - /^release\/.*$/
+ - /^hotfix\/.*$/
+ - /^*.0$/
+ - /^ci\/*.0$/
\ No newline at end of file
diff --git a/README.md b/README.md
index 6ae1332..198e0b0 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,181 @@
-# This project is under development
+# SalesforceMarketingCloud
+
+SalesforceMarketingCloud - JavaScript client for SalesforceMarketingCloud
+Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
+
+- API version: 1.0.0
+- Package version: 1.0.0
+- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
+
+## Installation
+
+### For [Node.js](https://nodejs.org/)
+
+#### npm
+
+To publish the library as a [npm](https://www.npmjs.com/),
+please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
+
+Then install it via:
+
+```shell
+npm install SalesforceMarketingCloud --save
+```
+
+#### git
+#
+If the library is hosted at a git repository, e.g.
+https://github.com/GIT_USER_ID/GIT_REPO_ID
+then install it via:
+
+```shell
+npm install GIT_USER_ID/GIT_REPO_ID --save
+```
+
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following JS code:
+
+### Usage scenarios
+#### Using the Client class with the configuration passed through environment variables
+
+```javascript
+const SalesforceMarketingCloud = require('SalesforceMarketingCloud');
+const Client = require('SalesforceMarketingCloud/src/Api/Client');
+
+let client = new Client();
+let assetApi = client.assetApi;
+
+let asset = AssetFactory.create(); // your own implementation of an asset factory that sets at least the mandatory properties
+let createAssetResult = assetApi.createAsset(asset);
+
+createAssetResult.then(data => {
+ console.log(data);
+}, reason => {
+ console.error(reason);
+});
+
+```
+
+#### Authentication environment variables:
+- SFMC_AUTH_BASE_URL
+- SFMC_CLIENT_ID
+- SFMC_CLIENT_SECRET
+- SFMC_ACCOUNT_ID
+- SFMC_SCOPE (space-separated list of data-access permissions for your application - optional parameter)
+
+#### Transactional Messaging integration tests environment variables:
+- SFMC_COUNTRY_CODE
+- SFMC_KEYWORD
+- SFMC_SHORT_CODE
+
+
+#### Using the Client class with the configuration passed through a configuration object
+
+```javascript
+const SalesforceMarketingCloud = require('SalesforceMarketingCloud');
+const Client = require('SalesforceMarketingCloud/src/Api/Client');
+
+const config = {
+ authBaseUrl: 'YOUR AUTH BASE URL',
+ clientId: 'YOUR CLIENT ID',
+ clientSecret: 'YOUR CLIENT SECRET',
+ accountId: 'YOUR ACCOUNT ID',
+ scope: 'SPACE-SEPARATED LIST OF DATA-ACCESS PERMISSIONS FOR YOUR APPLICATION' // optional parameter
+};
+
+// Transactional Messaging integration tests config parameters:
+
+config.shortCode = 'YOUR SHORT CODE';
+config.keyWord = 'YOUR KEY WORD';
+config.countryCode = 'YOUR COUNTRY CODE';
+
+let client = new Client(config);
+let assetApi = client.assetApi;
+
+let asset = AssetFactory.create(); // your own implementation of an asset factory that sets at least the mandatory properties
+let createAssetResult = assetApi.createAsset(asset);
+
+createAssetResult.then(data => {
+ console.log(data);
+}, reason => {
+ console.error(reason);
+});
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *https://www.exacttargetapis.com*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*SalesforceMarketingCloud.AssetApi* | [**createAsset**](docs/AssetApi.md#createAsset) | **POST** /asset/v1/content/assets | createAsset
+*SalesforceMarketingCloud.AssetApi* | [**deleteAssetById**](docs/AssetApi.md#deleteAssetById) | **DELETE** /asset/v1/content/assets/{id} | deleteAssetById
+*SalesforceMarketingCloud.AssetApi* | [**getAssetById**](docs/AssetApi.md#getAssetById) | **GET** /asset/v1/content/assets/{id} | getAssetById
+*SalesforceMarketingCloud.AssetApi* | [**partiallyUpdateAssetById**](docs/AssetApi.md#partiallyUpdateAssetById) | **PATCH** /asset/v1/content/assets/{id} | partiallyUpdateAssetById
+*SalesforceMarketingCloud.CampaignApi* | [**createCampaign**](docs/CampaignApi.md#createCampaign) | **POST** /hub/v1/campaigns | createCampaign
+*SalesforceMarketingCloud.CampaignApi* | [**deleteCampaignById**](docs/CampaignApi.md#deleteCampaignById) | **DELETE** /hub/v1/campaigns/{id} | deleteCampaignById
+*SalesforceMarketingCloud.CampaignApi* | [**getCampaignById**](docs/CampaignApi.md#getCampaignById) | **GET** /hub/v1/campaigns/{id} | getCampaignById
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**createEmailDefinition**](docs/TransactionalMessagingApi.md#createEmailDefinition) | **POST** /messaging/v1/email/definitions/ | createEmailDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**createSmsDefinition**](docs/TransactionalMessagingApi.md#createSmsDefinition) | **POST** /messaging/v1/sms/definitions | createSmsDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**deleteEmailDefinition**](docs/TransactionalMessagingApi.md#deleteEmailDefinition) | **DELETE** /messaging/v1/email/definitions/{definitionKey} | deleteEmailDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**deleteQueuedMessagesForEmailDefinition**](docs/TransactionalMessagingApi.md#deleteQueuedMessagesForEmailDefinition) | **DELETE** /messaging/v1/email/definitions/{definitionKey}/queue | deleteQueuedMessagesForEmailDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**deleteQueuedMessagesForSmsDefinition**](docs/TransactionalMessagingApi.md#deleteQueuedMessagesForSmsDefinition) | **DELETE** /messaging/v1/sms/definitions/{definitionKey}/queue | deleteQueuedMessagesForSmsDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**deleteSmsDefinition**](docs/TransactionalMessagingApi.md#deleteSmsDefinition) | **DELETE** /messaging/v1/sms/definitions/{definitionKey} | deleteSmsDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getEmailDefinition**](docs/TransactionalMessagingApi.md#getEmailDefinition) | **GET** /messaging/v1/email/definitions/{definitionKey} | getEmailDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getEmailDefinitions**](docs/TransactionalMessagingApi.md#getEmailDefinitions) | **GET** /messaging/v1/email/definitions/ | getEmailDefinitions
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getEmailSendStatusForRecipient**](docs/TransactionalMessagingApi.md#getEmailSendStatusForRecipient) | **GET** /messaging/v1/email/messages/{messageKey} | getEmailSendStatusForRecipient
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getEmailsNotSentToRecipients**](docs/TransactionalMessagingApi.md#getEmailsNotSentToRecipients) | **GET** /messaging/v1/email/messages/ | getEmailsNotSentToRecipients
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getQueueMetricsForEmailDefinition**](docs/TransactionalMessagingApi.md#getQueueMetricsForEmailDefinition) | **GET** /messaging/v1/email/definitions/{definitionKey}/queue | getQueueMetricsForEmailDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getQueueMetricsForSmsDefinition**](docs/TransactionalMessagingApi.md#getQueueMetricsForSmsDefinition) | **GET** /messaging/v1/sms/definitions/{definitionKey}/queue | getQueueMetricsForSmsDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getSMSsNotSentToRecipients**](docs/TransactionalMessagingApi.md#getSMSsNotSentToRecipients) | **GET** /messaging/v1/sms/messages/ | getSMSsNotSentToRecipients
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getSmsDefinition**](docs/TransactionalMessagingApi.md#getSmsDefinition) | **GET** /messaging/v1/sms/definitions/{definitionKey} | getSmsDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getSmsDefinitions**](docs/TransactionalMessagingApi.md#getSmsDefinitions) | **GET** /messaging/v1/sms/definitions | getSmsDefinitions
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**getSmsSendStatusForRecipient**](docs/TransactionalMessagingApi.md#getSmsSendStatusForRecipient) | **GET** /messaging/v1/sms/messages/{messageKey} | getSmsSendStatusForRecipient
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**partiallyUpdateEmailDefinition**](docs/TransactionalMessagingApi.md#partiallyUpdateEmailDefinition) | **PATCH** /messaging/v1/email/definitions/{definitionKey} | partiallyUpdateEmailDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**partiallyUpdateSmsDefinition**](docs/TransactionalMessagingApi.md#partiallyUpdateSmsDefinition) | **PATCH** /messaging/v1/sms/definitions/{definitionKey} | partiallyUpdateSmsDefinition
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**sendEmailToMultipleRecipients**](docs/TransactionalMessagingApi.md#sendEmailToMultipleRecipients) | **POST** /messaging/v1/email/messages/ | sendEmailToMultipleRecipients
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**sendEmailToSingleRecipient**](docs/TransactionalMessagingApi.md#sendEmailToSingleRecipient) | **POST** /messaging/v1/email/messages/{messageKey} | sendEmailToSingleRecipient
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**sendSmsToMultipleRecipients**](docs/TransactionalMessagingApi.md#sendSmsToMultipleRecipients) | **POST** /messaging/v1/sms/messages/ | sendSmsToMultipleRecipients
+*SalesforceMarketingCloud.TransactionalMessagingApi* | [**sendSmsToSingleRecipient**](docs/TransactionalMessagingApi.md#sendSmsToSingleRecipient) | **POST** /messaging/v1/sms/messages/{messageKey} | sendSmsToSingleRecipient
+
+
+## Documentation for Models
+
+ - [SalesforceMarketingCloud.ApiError](docs/ApiError.md)
+ - [SalesforceMarketingCloud.Asset](docs/Asset.md)
+ - [SalesforceMarketingCloud.AssetType](docs/AssetType.md)
+ - [SalesforceMarketingCloud.Attributes](docs/Attributes.md)
+ - [SalesforceMarketingCloud.Campaign](docs/Campaign.md)
+ - [SalesforceMarketingCloud.CreateEmailDefinitionContent](docs/CreateEmailDefinitionContent.md)
+ - [SalesforceMarketingCloud.CreateEmailDefinitionOptionsRequest](docs/CreateEmailDefinitionOptionsRequest.md)
+ - [SalesforceMarketingCloud.CreateEmailDefinitionRequest](docs/CreateEmailDefinitionRequest.md)
+ - [SalesforceMarketingCloud.CreateEmailDefinitionSubscriptions](docs/CreateEmailDefinitionSubscriptions.md)
+ - [SalesforceMarketingCloud.CreateSmsDefinitionContent](docs/CreateSmsDefinitionContent.md)
+ - [SalesforceMarketingCloud.CreateSmsDefinitionRequest](docs/CreateSmsDefinitionRequest.md)
+ - [SalesforceMarketingCloud.CreateSmsDefinitionSubscriptions](docs/CreateSmsDefinitionSubscriptions.md)
+ - [SalesforceMarketingCloud.DeleteQueuedMessagesForSendDefinitionResponse](docs/DeleteQueuedMessagesForSendDefinitionResponse.md)
+ - [SalesforceMarketingCloud.DeleteSendDefinitionResponse](docs/DeleteSendDefinitionResponse.md)
+ - [SalesforceMarketingCloud.GetDefinitionSendStatusForRecipientResponse](docs/GetDefinitionSendStatusForRecipientResponse.md)
+ - [SalesforceMarketingCloud.GetDefinitionSendStatusForRecipientResponseInfo](docs/GetDefinitionSendStatusForRecipientResponseInfo.md)
+ - [SalesforceMarketingCloud.GetDefinitionsNotSentToRecipientsMessage](docs/GetDefinitionsNotSentToRecipientsMessage.md)
+ - [SalesforceMarketingCloud.GetDefinitionsNotSentToRecipientsMessageInfo](docs/GetDefinitionsNotSentToRecipientsMessageInfo.md)
+ - [SalesforceMarketingCloud.GetDefinitionsNotSentToRecipientsResponse](docs/GetDefinitionsNotSentToRecipientsResponse.md)
+ - [SalesforceMarketingCloud.GetEmailDefinitionsResponse](docs/GetEmailDefinitionsResponse.md)
+ - [SalesforceMarketingCloud.GetQueueMetricsForSendDefinitionResponse](docs/GetQueueMetricsForSendDefinitionResponse.md)
+ - [SalesforceMarketingCloud.GetSmsDefinitionsResponse](docs/GetSmsDefinitionsResponse.md)
+ - [SalesforceMarketingCloud.Recipient](docs/Recipient.md)
+ - [SalesforceMarketingCloud.SendDefinitionResponseItem](docs/SendDefinitionResponseItem.md)
+ - [SalesforceMarketingCloud.SendDefinitionToMultipleRecipientsResponse](docs/SendDefinitionToMultipleRecipientsResponse.md)
+ - [SalesforceMarketingCloud.SendDefinitionToSingleRecipientResponse](docs/SendDefinitionToSingleRecipientResponse.md)
+ - [SalesforceMarketingCloud.SendEmailToMultipleRecipientsRequest](docs/SendEmailToMultipleRecipientsRequest.md)
+ - [SalesforceMarketingCloud.SendEmailToSingleRecipientRequest](docs/SendEmailToSingleRecipientRequest.md)
+ - [SalesforceMarketingCloud.SendSmsContentRequest](docs/SendSmsContentRequest.md)
+ - [SalesforceMarketingCloud.SendSmsToMultipleRecipientsRequest](docs/SendSmsToMultipleRecipientsRequest.md)
+ - [SalesforceMarketingCloud.SendSmsToMultipleRecipientsSubscriptionsRequest](docs/SendSmsToMultipleRecipientsSubscriptionsRequest.md)
+ - [SalesforceMarketingCloud.SendSmsToSingleRecipientRequest](docs/SendSmsToSingleRecipientRequest.md)
+ - [SalesforceMarketingCloud.SharingProperties](docs/SharingProperties.md)
+ - [SalesforceMarketingCloud.UpdateEmailDefinitionRequest](docs/UpdateEmailDefinitionRequest.md)
+ - [SalesforceMarketingCloud.UpdateSmsDefinitionRequest](docs/UpdateSmsDefinitionRequest.md)
diff --git a/docs/ApiError.md b/docs/ApiError.md
new file mode 100644
index 0000000..78b7010
--- /dev/null
+++ b/docs/ApiError.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.ApiError
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **String** | The error message | [optional]
+**errorCode** | **Number** | The specific error code | [optional]
+**documentation** | **String** | Any specific documentation for the error | [optional]
+
+
diff --git a/docs/Asset.md b/docs/Asset.md
new file mode 100644
index 0000000..5e735c4
--- /dev/null
+++ b/docs/Asset.md
@@ -0,0 +1,35 @@
+# SalesforceMarketingCloud.Asset
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Number** | The id of the asset | [optional]
+**customerKey** | **String** | Reference to customer's private ID/name for the asset |
+**contentType** | **String** | The type that the content attribute will be in | [optional]
+**data** | **Object** | Property bag containing the asset data | [optional]
+**assetType** | [**AssetType**](AssetType.md) | |
+**version** | **Number** | The version of the asset | [optional]
+**locked** | **Boolean** | Specifies if the asset can be modified or not | [optional]
+**fileProperties** | **Object** | Stores the different properties that this asset refers to if it is a file type | [optional]
+**name** | **String** | Name of the asset, set by the client |
+**description** | **String** | Description of the asset, set by the client |
+**category** | **Object** | ID of the category the asset belongs to | [optional]
+**tags** | **[String]** | List of tags associated with the asset | [optional]
+**content** | **String** | The actual content of the asset | [optional]
+**design** | **String** | Fallback for display when neither content nor supercontent are provided | [optional]
+**superContent** | **String** | Content that supersedes content in terms of display | [optional]
+**customFields** | **Object** | Custom fields within an asset | [optional]
+**views** | **Object** | Views within an asset | [optional]
+**blocks** | **Object** | Blocks within the asset | [optional]
+**minBlocks** | **Number** | Minimum number of blocks within an asset | [optional]
+**maxBlocks** | **Number** | Maximum number of blocks within an asset | [optional]
+**channels** | **Object** | List of channels that are allowed to use this asset | [optional]
+**allowedBlocks** | **[String]** | List of blocks that are allowed in the asset | [optional]
+**slots** | **Object** | Slots within the asset | [optional]
+**businessUnitAvailability** | **Object** | A dictionary of member IDs that have been granted access to the asset | [optional]
+**sharingProperties** | [**SharingProperties**](SharingProperties.md) | | [optional]
+**template** | **Object** | Template the asset follows | [optional]
+**file** | **String** | Base64-encoded string of a file associated with an asset | [optional]
+**generateFrom** | **String** | Tells the sending compiler what view to use for generating this view's content | [optional]
+
+
diff --git a/docs/AssetApi.md b/docs/AssetApi.md
new file mode 100644
index 0000000..112d29c
--- /dev/null
+++ b/docs/AssetApi.md
@@ -0,0 +1,187 @@
+# SalesforceMarketingCloud.AssetApi
+
+All URIs are relative to *https://www.exacttargetapis.com*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createAsset**](AssetApi.md#createAsset) | **POST** /asset/v1/content/assets | createAsset
+[**deleteAssetById**](AssetApi.md#deleteAssetById) | **DELETE** /asset/v1/content/assets/{id} | deleteAssetById
+[**getAssetById**](AssetApi.md#getAssetById) | **GET** /asset/v1/content/assets/{id} | getAssetById
+[**partiallyUpdateAssetById**](AssetApi.md#partiallyUpdateAssetById) | **PATCH** /asset/v1/content/assets/{id} | partiallyUpdateAssetById
+
+
+
+# **createAsset**
+> Asset createAsset(body)
+
+createAsset
+
+Creates a new asset.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.AssetApi();
+
+let body = new SalesforceMarketingCloud.Asset(); // Asset | JSON Parameters
+
+apiInstance.createAsset(body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Asset**](Asset.md)| JSON Parameters |
+
+### Return type
+
+[**Asset**](Asset.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **deleteAssetById**
+> deleteAssetById(id)
+
+deleteAssetById
+
+Deletes an asset.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.AssetApi();
+
+let id = 8.14; // Number | The ID of the asset to delete
+
+apiInstance.deleteAssetById(id).then(() => {
+ console.log('API called successfully.');
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **Number**| The ID of the asset to delete |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getAssetById**
+> Asset getAssetById(id)
+
+getAssetById
+
+Gets an asset by ID.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.AssetApi();
+
+let id = 8.14; // Number | The ID of the asset
+
+apiInstance.getAssetById(id).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **Number**| The ID of the asset |
+
+### Return type
+
+[**Asset**](Asset.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **partiallyUpdateAssetById**
+> Asset partiallyUpdateAssetById(id, body)
+
+partiallyUpdateAssetById
+
+Updates part of an asset.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.AssetApi();
+
+let id = 8.14; // Number | The ID of the asset to update
+
+let body = new SalesforceMarketingCloud.Asset(); // Asset | JSON Parameters
+
+apiInstance.partiallyUpdateAssetById(id, body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **Number**| The ID of the asset to update |
+ **body** | [**Asset**](Asset.md)| JSON Parameters |
+
+### Return type
+
+[**Asset**](Asset.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
diff --git a/docs/AssetType.md b/docs/AssetType.md
new file mode 100644
index 0000000..c3da54e
--- /dev/null
+++ b/docs/AssetType.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.AssetType
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Number** | The id of the asset type |
+**name** | **String** | The name of the asset type |
+**displayName** | **String** | The description of the asset type | [optional]
+
+
diff --git a/docs/Attributes.md b/docs/Attributes.md
new file mode 100644
index 0000000..5044465
--- /dev/null
+++ b/docs/Attributes.md
@@ -0,0 +1,7 @@
+# SalesforceMarketingCloud.Attributes
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+
diff --git a/docs/Campaign.md b/docs/Campaign.md
new file mode 100644
index 0000000..91325b5
--- /dev/null
+++ b/docs/Campaign.md
@@ -0,0 +1,15 @@
+# SalesforceMarketingCloud.Campaign
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Name of the campaign with a maximum length of 128 characters |
+**description** | **String** | Description of the campaign with a maximum length of 512 characters |
+**campaignCode** | **String** | Unique identifier for the campaign with a maximum length of 36 characters |
+**color** | **String** | Hex color value |
+**favorite** | **Boolean** | Determines if the campaign will be flagged as a favorite |
+**id** | **String** | The id of the campaign | [optional]
+**createdDate** | **Date** | The date the object was created. | [optional]
+**modifiedDate** | **Date** | The date the object was modified. | [optional]
+
+
diff --git a/docs/CampaignApi.md b/docs/CampaignApi.md
new file mode 100644
index 0000000..74746b0
--- /dev/null
+++ b/docs/CampaignApi.md
@@ -0,0 +1,140 @@
+# SalesforceMarketingCloud.CampaignApi
+
+All URIs are relative to *https://www.exacttargetapis.com*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createCampaign**](CampaignApi.md#createCampaign) | **POST** /hub/v1/campaigns | createCampaign
+[**deleteCampaignById**](CampaignApi.md#deleteCampaignById) | **DELETE** /hub/v1/campaigns/{id} | deleteCampaignById
+[**getCampaignById**](CampaignApi.md#getCampaignById) | **GET** /hub/v1/campaigns/{id} | getCampaignById
+
+
+
+# **createCampaign**
+> Campaign createCampaign(body)
+
+createCampaign
+
+Creates a campaign.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.CampaignApi();
+
+let body = new SalesforceMarketingCloud.Campaign(); // Campaign | JSON Parameters
+
+apiInstance.createCampaign(body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**Campaign**](Campaign.md)| JSON Parameters |
+
+### Return type
+
+[**Campaign**](Campaign.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **deleteCampaignById**
+> deleteCampaignById(id)
+
+deleteCampaignById
+
+Deletes a campaign.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.CampaignApi();
+
+let id = "id_example"; // String | The ID of the campaign to delete
+
+apiInstance.deleteCampaignById(id).then(() => {
+ console.log('API called successfully.');
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **String**| The ID of the campaign to delete |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getCampaignById**
+> Campaign getCampaignById(id)
+
+getCampaignById
+
+Retrieves a campaign.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.CampaignApi();
+
+let id = "id_example"; // String | Campaign ID
+
+apiInstance.getCampaignById(id).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **String**| Campaign ID |
+
+### Return type
+
+[**Campaign**](Campaign.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
diff --git a/docs/CreateEmailDefinitionContent.md b/docs/CreateEmailDefinitionContent.md
new file mode 100644
index 0000000..94d4220
--- /dev/null
+++ b/docs/CreateEmailDefinitionContent.md
@@ -0,0 +1,8 @@
+# SalesforceMarketingCloud.CreateEmailDefinitionContent
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**customerKey** | **String** | Unique identifier of the content asset. |
+
+
diff --git a/docs/CreateEmailDefinitionOptionsRequest.md b/docs/CreateEmailDefinitionOptionsRequest.md
new file mode 100644
index 0000000..987bc9f
--- /dev/null
+++ b/docs/CreateEmailDefinitionOptionsRequest.md
@@ -0,0 +1,8 @@
+# SalesforceMarketingCloud.CreateEmailDefinitionOptionsRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**trackLinks** | **Boolean** | Wraps links for tracking and reporting. Default is true. | [optional]
+
+
diff --git a/docs/CreateEmailDefinitionRequest.md b/docs/CreateEmailDefinitionRequest.md
new file mode 100644
index 0000000..b3031c5
--- /dev/null
+++ b/docs/CreateEmailDefinitionRequest.md
@@ -0,0 +1,19 @@
+# SalesforceMarketingCloud.CreateEmailDefinitionRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+**name** | **String** | Name of the definition. Must be unique. |
+**definitionKey** | **String** | Unique, user-generated key to access the definition object. |
+**definitionId** | **String** | Definition Id | [optional]
+**description** | **String** | User-provided description of the email definition. | [optional]
+**classification** | **String** | Marketing Cloud external key of a sending classification defined in Email Studio Administration. Only transactional classifications are permitted. Default is default transactional. | [optional]
+**status** | **String** | Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days. | [optional]
+**createdDate** | **Date** | The date the object was created. | [optional]
+**modifiedDate** | **Date** | The date the object was modified. | [optional]
+**content** | [**CreateEmailDefinitionContent**](CreateEmailDefinitionContent.md) | |
+**subscriptions** | [**CreateEmailDefinitionSubscriptions**](CreateEmailDefinitionSubscriptions.md) | |
+**options** | [**CreateEmailDefinitionOptionsRequest**](CreateEmailDefinitionOptionsRequest.md) | | [optional]
+
+
diff --git a/docs/CreateEmailDefinitionSubscriptions.md b/docs/CreateEmailDefinitionSubscriptions.md
new file mode 100644
index 0000000..470232a
--- /dev/null
+++ b/docs/CreateEmailDefinitionSubscriptions.md
@@ -0,0 +1,11 @@
+# SalesforceMarketingCloud.CreateEmailDefinitionSubscriptions
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**list** | **String** | Marketing Cloud external key of the list or all subscribers. Contains the subscriber keys and profile attributes. |
+**dataExtension** | **String** | Marketing Cloud external key of the triggered send data extension. Each request inserts as a new row in the data extension. | [optional]
+**autoAddSubscriber** | **Boolean** | Adds the recipient’s email address and contact key as a subscriber key to subscriptions.list. Default is true. | [optional] [default to true]
+**updateSubscriber** | **Boolean** | Updates the recipient’s contact key as a subscriber key with the provided email address and profile attributes to subscriptions.list. Default is true. | [optional]
+
+
diff --git a/docs/CreateSmsDefinitionContent.md b/docs/CreateSmsDefinitionContent.md
new file mode 100644
index 0000000..2714b4a
--- /dev/null
+++ b/docs/CreateSmsDefinitionContent.md
@@ -0,0 +1,8 @@
+# SalesforceMarketingCloud.CreateSmsDefinitionContent
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **String** | The message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message. |
+
+
diff --git a/docs/CreateSmsDefinitionRequest.md b/docs/CreateSmsDefinitionRequest.md
new file mode 100644
index 0000000..671a334
--- /dev/null
+++ b/docs/CreateSmsDefinitionRequest.md
@@ -0,0 +1,16 @@
+# SalesforceMarketingCloud.CreateSmsDefinitionRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**definitionKey** | **String** | Unique, user-generated key to access the definition object. |
+**name** | **String** | Name of the definition. Must be unique. |
+**content** | [**CreateSmsDefinitionContent**](CreateSmsDefinitionContent.md) | |
+**status** | **String** | Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days. | [optional]
+**createdDate** | **Date** | The date the object was created. | [optional]
+**modifiedDate** | **Date** | The date the object was modified. | [optional]
+**description** | **String** | User-provided description of the SMS definition. | [optional]
+**subscriptions** | [**CreateSmsDefinitionSubscriptions**](CreateSmsDefinitionSubscriptions.md) | |
+**requestId** | **String** | The ID of the request | [optional]
+
+
diff --git a/docs/CreateSmsDefinitionSubscriptions.md b/docs/CreateSmsDefinitionSubscriptions.md
new file mode 100644
index 0000000..d509d2b
--- /dev/null
+++ b/docs/CreateSmsDefinitionSubscriptions.md
@@ -0,0 +1,11 @@
+# SalesforceMarketingCloud.CreateSmsDefinitionSubscriptions
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**shortCode** | **String** | The short code for the mobile transmissions for each message on this definition. |
+**countryCode** | **String** | The country code associated with the shortCode for the mobile transmissions for each message on this definition. |
+**keyword** | **String** | The keyword used to track messages. | [optional]
+**autoAddSubscriber** | **Boolean** | Permits adding a recipient as subscriber against the shortCode using contactKey. When false, the message is rejected if contactKey does not exist as a subscriber. Default is true. | [optional] [default to true]
+
+
diff --git a/docs/DeleteQueuedMessagesForSendDefinitionResponse.md b/docs/DeleteQueuedMessagesForSendDefinitionResponse.md
new file mode 100644
index 0000000..e09140d
--- /dev/null
+++ b/docs/DeleteQueuedMessagesForSendDefinitionResponse.md
@@ -0,0 +1,8 @@
+# SalesforceMarketingCloud.DeleteQueuedMessagesForSendDefinitionResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+
+
diff --git a/docs/DeleteSendDefinitionResponse.md b/docs/DeleteSendDefinitionResponse.md
new file mode 100644
index 0000000..1f006d8
--- /dev/null
+++ b/docs/DeleteSendDefinitionResponse.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.DeleteSendDefinitionResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **String** | The response message | [optional]
+**requestId** | **String** | The ID of the request | [optional]
+**deletedDefinitionKey** | **String** | The key of the deleted definition | [optional]
+
+
diff --git a/docs/GetDefinitionSendStatusForRecipientResponse.md b/docs/GetDefinitionSendStatusForRecipientResponse.md
new file mode 100644
index 0000000..130ef11
--- /dev/null
+++ b/docs/GetDefinitionSendStatusForRecipientResponse.md
@@ -0,0 +1,12 @@
+# SalesforceMarketingCloud.GetDefinitionSendStatusForRecipientResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+**eventCategoryType** | **String** | The status of the message | [optional]
+**timestamp** | **Date** | The date the ... | [optional]
+**compositeId** | **String** | The Id of ... | [optional]
+**info** | [**GetDefinitionSendStatusForRecipientResponseInfo**](GetDefinitionSendStatusForRecipientResponseInfo.md) | | [optional]
+
+
diff --git a/docs/GetDefinitionSendStatusForRecipientResponseInfo.md b/docs/GetDefinitionSendStatusForRecipientResponseInfo.md
new file mode 100644
index 0000000..6d2d2b4
--- /dev/null
+++ b/docs/GetDefinitionSendStatusForRecipientResponseInfo.md
@@ -0,0 +1,12 @@
+# SalesforceMarketingCloud.GetDefinitionSendStatusForRecipientResponseInfo
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**messageKey** | **String** | Unique identifier used to track message status. | [optional]
+**contactKey** | **String** | Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address. | [optional]
+**to** | **String** | Channel address of the recipient. For email, it’s the recipient's email address. | [optional]
+**statusCode** | **Number** | The specific status code | [optional]
+**statusMessage** | **String** | The specific status message | [optional]
+
+
diff --git a/docs/GetDefinitionsNotSentToRecipientsMessage.md b/docs/GetDefinitionsNotSentToRecipientsMessage.md
new file mode 100644
index 0000000..c4ea52c
--- /dev/null
+++ b/docs/GetDefinitionsNotSentToRecipientsMessage.md
@@ -0,0 +1,14 @@
+# SalesforceMarketingCloud.GetDefinitionsNotSentToRecipientsMessage
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**statusCode** | **Number** | The specific status code | [optional]
+**statusMessage** | **String** | The specific status message | [optional]
+**eventCategoryType** | **String** | The status of the message | [optional]
+**timestamp** | **Date** | The date the ... | [optional]
+**definitionKey** | **String** | Unique, user-generated key to access the definition object. | [optional]
+**eventID** | **Number** | | [optional]
+**info** | [**GetDefinitionsNotSentToRecipientsMessageInfo**](GetDefinitionsNotSentToRecipientsMessageInfo.md) | | [optional]
+
+
diff --git a/docs/GetDefinitionsNotSentToRecipientsMessageInfo.md b/docs/GetDefinitionsNotSentToRecipientsMessageInfo.md
new file mode 100644
index 0000000..c578a94
--- /dev/null
+++ b/docs/GetDefinitionsNotSentToRecipientsMessageInfo.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.GetDefinitionsNotSentToRecipientsMessageInfo
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**messageKey** | **String** | Unique identifier used to track message status. | [optional]
+**contactKey** | **String** | Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address. | [optional]
+**to** | **String** | Channel address of the recipient. For email, it’s the recipient's email address. | [optional]
+
+
diff --git a/docs/GetDefinitionsNotSentToRecipientsResponse.md b/docs/GetDefinitionsNotSentToRecipientsResponse.md
new file mode 100644
index 0000000..f91850c
--- /dev/null
+++ b/docs/GetDefinitionsNotSentToRecipientsResponse.md
@@ -0,0 +1,12 @@
+# SalesforceMarketingCloud.GetDefinitionsNotSentToRecipientsResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**lastEventID** | **Number** | Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest | [optional]
+**messages** | [**[GetDefinitionsNotSentToRecipientsMessage]**](GetDefinitionsNotSentToRecipientsMessage.md) | | [optional]
+**count** | **Number** | Number of pages | [optional]
+**requestId** | **String** | The ID of the request | [optional]
+**pageSize** | **Number** | Number of definitions, which are array elements, to return per paged response. | [optional]
+
+
diff --git a/docs/GetEmailDefinitionsResponse.md b/docs/GetEmailDefinitionsResponse.md
new file mode 100644
index 0000000..b6616e3
--- /dev/null
+++ b/docs/GetEmailDefinitionsResponse.md
@@ -0,0 +1,12 @@
+# SalesforceMarketingCloud.GetEmailDefinitionsResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+**definitions** | [**[CreateEmailDefinitionRequest]**](CreateEmailDefinitionRequest.md) | | [optional]
+**count** | **Number** | Number of pages | [optional]
+**page** | **Number** | Page number to return. | [optional]
+**pageSize** | **Number** | Number of definitions, which are array elements, to return per paged response. | [optional]
+
+
diff --git a/docs/GetQueueMetricsForSendDefinitionResponse.md b/docs/GetQueueMetricsForSendDefinitionResponse.md
new file mode 100644
index 0000000..0b5dd97
--- /dev/null
+++ b/docs/GetQueueMetricsForSendDefinitionResponse.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.GetQueueMetricsForSendDefinitionResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+**count** | **Number** | Number of pages | [optional]
+**ageSeconds** | **Number** | Number of seconds | [optional]
+
+
diff --git a/docs/GetSmsDefinitionsResponse.md b/docs/GetSmsDefinitionsResponse.md
new file mode 100644
index 0000000..721dbe7
--- /dev/null
+++ b/docs/GetSmsDefinitionsResponse.md
@@ -0,0 +1,12 @@
+# SalesforceMarketingCloud.GetSmsDefinitionsResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+**definitions** | [**[CreateSmsDefinitionRequest]**](CreateSmsDefinitionRequest.md) | | [optional]
+**count** | **Number** | Number of pages | [optional]
+**page** | **Number** | Page number to return. | [optional]
+**pageSize** | **Number** | Number of definitions, which are array elements, to return per paged response. | [optional]
+
+
diff --git a/docs/Recipient.md b/docs/Recipient.md
new file mode 100644
index 0000000..6b6e3b3
--- /dev/null
+++ b/docs/Recipient.md
@@ -0,0 +1,11 @@
+# SalesforceMarketingCloud.Recipient
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**contactKey** | **String** | Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address. |
+**to** | **String** | Channel address of the recipient. For email, it’s the recipient's email address. For SMS, it’s the recipient's E.164-based mobile number. | [optional]
+**messageKey** | **String** | Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected. | [optional]
+**attributes** | [**Attributes**](Attributes.md) | | [optional]
+
+
diff --git a/docs/SendDefinitionResponseItem.md b/docs/SendDefinitionResponseItem.md
new file mode 100644
index 0000000..3bdfa9a
--- /dev/null
+++ b/docs/SendDefinitionResponseItem.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.SendDefinitionResponseItem
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**messageKey** | **String** | Unique identifier used to track message status. | [optional]
+**errorCode** | **Number** | The specific error code | [optional]
+**message** | **String** | The error message | [optional]
+
+
diff --git a/docs/SendDefinitionToMultipleRecipientsResponse.md b/docs/SendDefinitionToMultipleRecipientsResponse.md
new file mode 100644
index 0000000..1548148
--- /dev/null
+++ b/docs/SendDefinitionToMultipleRecipientsResponse.md
@@ -0,0 +1,11 @@
+# SalesforceMarketingCloud.SendDefinitionToMultipleRecipientsResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+**errorcode** | **Number** | The specific error code | [optional]
+**message** | **String** | | [optional]
+**responses** | [**[SendDefinitionResponseItem]**](SendDefinitionResponseItem.md) | | [optional]
+
+
diff --git a/docs/SendDefinitionToSingleRecipientResponse.md b/docs/SendDefinitionToSingleRecipientResponse.md
new file mode 100644
index 0000000..2a08ac8
--- /dev/null
+++ b/docs/SendDefinitionToSingleRecipientResponse.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.SendDefinitionToSingleRecipientResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**requestId** | **String** | The ID of the request | [optional]
+**errorcode** | **Number** | The specific error code | [optional]
+**responses** | [**[SendDefinitionResponseItem]**](SendDefinitionResponseItem.md) | | [optional]
+
+
diff --git a/docs/SendEmailToMultipleRecipientsRequest.md b/docs/SendEmailToMultipleRecipientsRequest.md
new file mode 100644
index 0000000..4387552
--- /dev/null
+++ b/docs/SendEmailToMultipleRecipientsRequest.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.SendEmailToMultipleRecipientsRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**definitionKey** | **String** | Unique, user-generated key to access the definition object. |
+**recipients** | [**[Recipient]**](Recipient.md) | Array of recipient objects that contain parameters and metadata for the recipients, such as send tracking and personalization attributes. Use this parameter to send to multiple recipients in one request. Use either the recipient or recipients parameter, but not both. |
+**attributes** | [**Attributes**](Attributes.md) | | [optional]
+
+
diff --git a/docs/SendEmailToSingleRecipientRequest.md b/docs/SendEmailToSingleRecipientRequest.md
new file mode 100644
index 0000000..41c52aa
--- /dev/null
+++ b/docs/SendEmailToSingleRecipientRequest.md
@@ -0,0 +1,9 @@
+# SalesforceMarketingCloud.SendEmailToSingleRecipientRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**definitionKey** | **String** | Unique identifier of the definition. |
+**recipient** | [**Recipient**](Recipient.md) | |
+
+
diff --git a/docs/SendSmsContentRequest.md b/docs/SendSmsContentRequest.md
new file mode 100644
index 0000000..fa1b361
--- /dev/null
+++ b/docs/SendSmsContentRequest.md
@@ -0,0 +1,8 @@
+# SalesforceMarketingCloud.SendSmsContentRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **String** | Override for message content in the definition that you want sent with each message. Use substitution strings to personalize the content. | [optional]
+
+
diff --git a/docs/SendSmsToMultipleRecipientsRequest.md b/docs/SendSmsToMultipleRecipientsRequest.md
new file mode 100644
index 0000000..9b95661
--- /dev/null
+++ b/docs/SendSmsToMultipleRecipientsRequest.md
@@ -0,0 +1,12 @@
+# SalesforceMarketingCloud.SendSmsToMultipleRecipientsRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**definitionKey** | **String** | Unique, user-generated key to access the definition object. |
+**recipients** | [**[Recipient]**](Recipient.md) | Array of recipient objects that contain parameters and metadata for the recipients, such as send tracking and personalization attributes. Use this parameter to send to multiple recipients in one request. Use either the recipient or recipients parameter, but not both. |
+**subscriptions** | [**SendSmsToMultipleRecipientsSubscriptionsRequest**](SendSmsToMultipleRecipientsSubscriptionsRequest.md) | | [optional]
+**content** | [**SendSmsContentRequest**](SendSmsContentRequest.md) | | [optional]
+**attributes** | [**Attributes**](Attributes.md) | | [optional]
+
+
diff --git a/docs/SendSmsToMultipleRecipientsSubscriptionsRequest.md b/docs/SendSmsToMultipleRecipientsSubscriptionsRequest.md
new file mode 100644
index 0000000..17b3c58
--- /dev/null
+++ b/docs/SendSmsToMultipleRecipientsSubscriptionsRequest.md
@@ -0,0 +1,8 @@
+# SalesforceMarketingCloud.SendSmsToMultipleRecipientsSubscriptionsRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**resubscribe** | **Boolean** | Forces the message send request to subscribe the mobile number back into a short code if a user may have requested STOP. Often used to ensure that critical transactional messages are delivered irrespective of a mobile number subscriber status. | [optional]
+
+
diff --git a/docs/SendSmsToSingleRecipientRequest.md b/docs/SendSmsToSingleRecipientRequest.md
new file mode 100644
index 0000000..74e31a8
--- /dev/null
+++ b/docs/SendSmsToSingleRecipientRequest.md
@@ -0,0 +1,10 @@
+# SalesforceMarketingCloud.SendSmsToSingleRecipientRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**definitionKey** | **String** | Unique identifier of the definition. |
+**recipient** | [**Recipient**](Recipient.md) | |
+**content** | [**SendSmsContentRequest**](SendSmsContentRequest.md) | | [optional]
+
+
diff --git a/docs/SharingProperties.md b/docs/SharingProperties.md
new file mode 100644
index 0000000..584173f
--- /dev/null
+++ b/docs/SharingProperties.md
@@ -0,0 +1,22 @@
+# SalesforceMarketingCloud.SharingProperties
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**sharingType** | **String** | Indicates the permission that you are granting to the list of MIDs in sharedWith. Possible values are view, edit, or local. | [optional]
+**sharedWith** | **[Number]** | List of MID IDs the asset is shared with | [optional]
+
+
+
+## Enum: SharingTypeEnum
+
+
+* `view` (value: `"view"`)
+
+* `edit` (value: `"edit"`)
+
+* `local` (value: `"local"`)
+
+
+
+
diff --git a/docs/TransactionalMessagingApi.md b/docs/TransactionalMessagingApi.md
new file mode 100644
index 0000000..ffef7a9
--- /dev/null
+++ b/docs/TransactionalMessagingApi.md
@@ -0,0 +1,1014 @@
+# SalesforceMarketingCloud.TransactionalMessagingApi
+
+All URIs are relative to *https://www.exacttargetapis.com*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createEmailDefinition**](TransactionalMessagingApi.md#createEmailDefinition) | **POST** /messaging/v1/email/definitions/ | createEmailDefinition
+[**createSmsDefinition**](TransactionalMessagingApi.md#createSmsDefinition) | **POST** /messaging/v1/sms/definitions | createSmsDefinition
+[**deleteEmailDefinition**](TransactionalMessagingApi.md#deleteEmailDefinition) | **DELETE** /messaging/v1/email/definitions/{definitionKey} | deleteEmailDefinition
+[**deleteQueuedMessagesForEmailDefinition**](TransactionalMessagingApi.md#deleteQueuedMessagesForEmailDefinition) | **DELETE** /messaging/v1/email/definitions/{definitionKey}/queue | deleteQueuedMessagesForEmailDefinition
+[**deleteQueuedMessagesForSmsDefinition**](TransactionalMessagingApi.md#deleteQueuedMessagesForSmsDefinition) | **DELETE** /messaging/v1/sms/definitions/{definitionKey}/queue | deleteQueuedMessagesForSmsDefinition
+[**deleteSmsDefinition**](TransactionalMessagingApi.md#deleteSmsDefinition) | **DELETE** /messaging/v1/sms/definitions/{definitionKey} | deleteSmsDefinition
+[**getEmailDefinition**](TransactionalMessagingApi.md#getEmailDefinition) | **GET** /messaging/v1/email/definitions/{definitionKey} | getEmailDefinition
+[**getEmailDefinitions**](TransactionalMessagingApi.md#getEmailDefinitions) | **GET** /messaging/v1/email/definitions/ | getEmailDefinitions
+[**getEmailSendStatusForRecipient**](TransactionalMessagingApi.md#getEmailSendStatusForRecipient) | **GET** /messaging/v1/email/messages/{messageKey} | getEmailSendStatusForRecipient
+[**getEmailsNotSentToRecipients**](TransactionalMessagingApi.md#getEmailsNotSentToRecipients) | **GET** /messaging/v1/email/messages/ | getEmailsNotSentToRecipients
+[**getQueueMetricsForEmailDefinition**](TransactionalMessagingApi.md#getQueueMetricsForEmailDefinition) | **GET** /messaging/v1/email/definitions/{definitionKey}/queue | getQueueMetricsForEmailDefinition
+[**getQueueMetricsForSmsDefinition**](TransactionalMessagingApi.md#getQueueMetricsForSmsDefinition) | **GET** /messaging/v1/sms/definitions/{definitionKey}/queue | getQueueMetricsForSmsDefinition
+[**getSMSsNotSentToRecipients**](TransactionalMessagingApi.md#getSMSsNotSentToRecipients) | **GET** /messaging/v1/sms/messages/ | getSMSsNotSentToRecipients
+[**getSmsDefinition**](TransactionalMessagingApi.md#getSmsDefinition) | **GET** /messaging/v1/sms/definitions/{definitionKey} | getSmsDefinition
+[**getSmsDefinitions**](TransactionalMessagingApi.md#getSmsDefinitions) | **GET** /messaging/v1/sms/definitions | getSmsDefinitions
+[**getSmsSendStatusForRecipient**](TransactionalMessagingApi.md#getSmsSendStatusForRecipient) | **GET** /messaging/v1/sms/messages/{messageKey} | getSmsSendStatusForRecipient
+[**partiallyUpdateEmailDefinition**](TransactionalMessagingApi.md#partiallyUpdateEmailDefinition) | **PATCH** /messaging/v1/email/definitions/{definitionKey} | partiallyUpdateEmailDefinition
+[**partiallyUpdateSmsDefinition**](TransactionalMessagingApi.md#partiallyUpdateSmsDefinition) | **PATCH** /messaging/v1/sms/definitions/{definitionKey} | partiallyUpdateSmsDefinition
+[**sendEmailToMultipleRecipients**](TransactionalMessagingApi.md#sendEmailToMultipleRecipients) | **POST** /messaging/v1/email/messages/ | sendEmailToMultipleRecipients
+[**sendEmailToSingleRecipient**](TransactionalMessagingApi.md#sendEmailToSingleRecipient) | **POST** /messaging/v1/email/messages/{messageKey} | sendEmailToSingleRecipient
+[**sendSmsToMultipleRecipients**](TransactionalMessagingApi.md#sendSmsToMultipleRecipients) | **POST** /messaging/v1/sms/messages/ | sendSmsToMultipleRecipients
+[**sendSmsToSingleRecipient**](TransactionalMessagingApi.md#sendSmsToSingleRecipient) | **POST** /messaging/v1/sms/messages/{messageKey} | sendSmsToSingleRecipient
+
+
+
+# **createEmailDefinition**
+> CreateEmailDefinitionRequest createEmailDefinition(body)
+
+createEmailDefinition
+
+Creates the definition for an email.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let body = new SalesforceMarketingCloud.CreateEmailDefinitionRequest(); // CreateEmailDefinitionRequest | JSON Parameters
+
+apiInstance.createEmailDefinition(body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**CreateEmailDefinitionRequest**](CreateEmailDefinitionRequest.md)| JSON Parameters |
+
+### Return type
+
+[**CreateEmailDefinitionRequest**](CreateEmailDefinitionRequest.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **createSmsDefinition**
+> CreateSmsDefinitionRequest createSmsDefinition(body)
+
+createSmsDefinition
+
+Creates the definition for an SMS.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let body = new SalesforceMarketingCloud.CreateSmsDefinitionRequest(); // CreateSmsDefinitionRequest | JSON Parameters
+
+apiInstance.createSmsDefinition(body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**CreateSmsDefinitionRequest**](CreateSmsDefinitionRequest.md)| JSON Parameters |
+
+### Return type
+
+[**CreateSmsDefinitionRequest**](CreateSmsDefinitionRequest.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **deleteEmailDefinition**
+> DeleteSendDefinitionResponse deleteEmailDefinition(definitionKey)
+
+deleteEmailDefinition
+
+Deletes an email definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to delete
+
+apiInstance.deleteEmailDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the definition to delete |
+
+### Return type
+
+[**DeleteSendDefinitionResponse**](DeleteSendDefinitionResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **deleteQueuedMessagesForEmailDefinition**
+> DeleteQueuedMessagesForSendDefinitionResponse deleteQueuedMessagesForEmailDefinition(definitionKey)
+
+deleteQueuedMessagesForEmailDefinition
+
+Deletes the queue for an email definition. The email definition must be in inactive status.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the email definition
+
+apiInstance.deleteQueuedMessagesForEmailDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the email definition |
+
+### Return type
+
+[**DeleteQueuedMessagesForSendDefinitionResponse**](DeleteQueuedMessagesForSendDefinitionResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **deleteQueuedMessagesForSmsDefinition**
+> DeleteQueuedMessagesForSendDefinitionResponse deleteQueuedMessagesForSmsDefinition(definitionKey)
+
+deleteQueuedMessagesForSmsDefinition
+
+Deletes the queue for a SMS definition. The SMS definition must be in inactive status.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the SMS definition
+
+apiInstance.deleteQueuedMessagesForSmsDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the SMS definition |
+
+### Return type
+
+[**DeleteQueuedMessagesForSendDefinitionResponse**](DeleteQueuedMessagesForSendDefinitionResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **deleteSmsDefinition**
+> DeleteSendDefinitionResponse deleteSmsDefinition(definitionKey)
+
+deleteSmsDefinition
+
+Deletes an sms definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to delete
+
+apiInstance.deleteSmsDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the definition to delete |
+
+### Return type
+
+[**DeleteSendDefinitionResponse**](DeleteSendDefinitionResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getEmailDefinition**
+> CreateEmailDefinitionRequest getEmailDefinition(definitionKey)
+
+getEmailDefinition
+
+Gets email definition configuration details for a definition key.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to get
+
+apiInstance.getEmailDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the definition to get |
+
+### Return type
+
+[**CreateEmailDefinitionRequest**](CreateEmailDefinitionRequest.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getEmailDefinitions**
+> GetEmailDefinitionsResponse getEmailDefinitions(opts)
+
+getEmailDefinitions
+
+Gets a list of email definitions.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let opts = {
+ 'status': "status_example", // String | Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
+ 'pageSize': 8.14, // Number | Number of definitions, which are array elements, to return per paged response.
+ 'page': 8.14, // Number | Page number to return.
+ 'orderBy': "orderBy_example" // String | Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
+};
+apiInstance.getEmailDefinitions(opts).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | **String**| Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq. | [optional]
+ **pageSize** | **Number**| Number of definitions, which are array elements, to return per paged response. | [optional]
+ **page** | **Number**| Page number to return. | [optional]
+ **orderBy** | **String**| Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status. | [optional]
+
+### Return type
+
+[**GetEmailDefinitionsResponse**](GetEmailDefinitionsResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getEmailSendStatusForRecipient**
+> GetDefinitionSendStatusForRecipientResponse getEmailSendStatusForRecipient(messageKey)
+
+getEmailSendStatusForRecipient
+
+Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let messageKey = "messageKey_example"; // String | Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide it in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.
+
+apiInstance.getEmailSendStatusForRecipient(messageKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **messageKey** | **String**| Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide it in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response. |
+
+### Return type
+
+[**GetDefinitionSendStatusForRecipientResponse**](GetDefinitionSendStatusForRecipientResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getEmailsNotSentToRecipients**
+> GetDefinitionsNotSentToRecipientsResponse getEmailsNotSentToRecipients(type, opts)
+
+getEmailsNotSentToRecipients
+
+Gets a paginated list of messages that were not sent, ordered from oldest to newest.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let type = "type_example"; // String | Only notSent is supported.
+
+let opts = {
+ 'pageSize': 56, // Number | Number of messageKeys (array elements) to return per response page.
+ 'lastEventId': 56 // Number | Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
+};
+apiInstance.getEmailsNotSentToRecipients(type, opts).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **type** | **String**| Only notSent is supported. |
+ **pageSize** | **Number**| Number of messageKeys (array elements) to return per response page. | [optional]
+ **lastEventId** | **Number**| Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest. | [optional]
+
+### Return type
+
+[**GetDefinitionsNotSentToRecipientsResponse**](GetDefinitionsNotSentToRecipientsResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getQueueMetricsForEmailDefinition**
+> GetQueueMetricsForSendDefinitionResponse getQueueMetricsForEmailDefinition(definitionKey)
+
+getQueueMetricsForEmailDefinition
+
+Gets metrics for the messages of an email definition. Applies to messages that are accepted but not yet processed.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the email definition
+
+apiInstance.getQueueMetricsForEmailDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the email definition |
+
+### Return type
+
+[**GetQueueMetricsForSendDefinitionResponse**](GetQueueMetricsForSendDefinitionResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getQueueMetricsForSmsDefinition**
+> GetQueueMetricsForSendDefinitionResponse getQueueMetricsForSmsDefinition(definitionKey)
+
+getQueueMetricsForSmsDefinition
+
+Gets metrics for the messages of a SMS definition. Applies to messages that are accepted but not yet processed.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the SMS definition
+
+apiInstance.getQueueMetricsForSmsDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the SMS definition |
+
+### Return type
+
+[**GetQueueMetricsForSendDefinitionResponse**](GetQueueMetricsForSendDefinitionResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getSMSsNotSentToRecipients**
+> GetDefinitionsNotSentToRecipientsResponse getSMSsNotSentToRecipients(type, opts)
+
+getSMSsNotSentToRecipients
+
+Gets a paginated list of messages that were not sent, ordered from oldest to newest.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let type = "type_example"; // String | Only notSent is supported.
+
+let opts = {
+ 'pageSize': 56, // Number | Number of messageKeys (array elements) to return per response page.
+ 'lastEventId': 56 // Number | Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
+};
+apiInstance.getSMSsNotSentToRecipients(type, opts).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **type** | **String**| Only notSent is supported. |
+ **pageSize** | **Number**| Number of messageKeys (array elements) to return per response page. | [optional]
+ **lastEventId** | **Number**| Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest. | [optional]
+
+### Return type
+
+[**GetDefinitionsNotSentToRecipientsResponse**](GetDefinitionsNotSentToRecipientsResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getSmsDefinition**
+> CreateSmsDefinitionRequest getSmsDefinition(definitionKey)
+
+getSmsDefinition
+
+Gets SMS definition configuration details for a definition key.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to get
+
+apiInstance.getSmsDefinition(definitionKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the definition to get |
+
+### Return type
+
+[**CreateSmsDefinitionRequest**](CreateSmsDefinitionRequest.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getSmsDefinitions**
+> GetSmsDefinitionsResponse getSmsDefinitions(opts)
+
+getSmsDefinitions
+
+Gets a list of SMS definitions.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let opts = {
+ 'status': "status_example", // String | Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
+ 'pageSize': 8.14, // Number | Number of definitions, which are array elements, to return per paged response.
+ 'page': 8.14, // Number | Page number to return.
+ 'orderBy': "orderBy_example" // String | Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
+};
+apiInstance.getSmsDefinitions(opts).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | **String**| Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq. | [optional]
+ **pageSize** | **Number**| Number of definitions, which are array elements, to return per paged response. | [optional]
+ **page** | **Number**| Page number to return. | [optional]
+ **orderBy** | **String**| Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status. | [optional]
+
+### Return type
+
+[**GetSmsDefinitionsResponse**](GetSmsDefinitionsResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getSmsSendStatusForRecipient**
+> GetDefinitionSendStatusForRecipientResponse getSmsSendStatusForRecipient(messageKey)
+
+getSmsSendStatusForRecipient
+
+Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let messageKey = "messageKey_example"; // String | Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide message key in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.
+
+apiInstance.getSmsSendStatusForRecipient(messageKey).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **messageKey** | **String**| Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide message key in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response. |
+
+### Return type
+
+[**GetDefinitionSendStatusForRecipientResponse**](GetDefinitionSendStatusForRecipientResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **partiallyUpdateEmailDefinition**
+> CreateEmailDefinitionRequest partiallyUpdateEmailDefinition(definitionKey, body)
+
+partiallyUpdateEmailDefinition
+
+Updates a specific email definition.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition.
+
+let body = new SalesforceMarketingCloud.UpdateEmailDefinitionRequest(); // UpdateEmailDefinitionRequest | JSON Parameters
+
+apiInstance.partiallyUpdateEmailDefinition(definitionKey, body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the definition. |
+ **body** | [**UpdateEmailDefinitionRequest**](UpdateEmailDefinitionRequest.md)| JSON Parameters |
+
+### Return type
+
+[**CreateEmailDefinitionRequest**](CreateEmailDefinitionRequest.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **partiallyUpdateSmsDefinition**
+> CreateSmsDefinitionRequest partiallyUpdateSmsDefinition(definitionKey, body)
+
+partiallyUpdateSmsDefinition
+
+Updates a specific SMS definition.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition.
+
+let body = new SalesforceMarketingCloud.UpdateSmsDefinitionRequest(); // UpdateSmsDefinitionRequest | JSON Parameters
+
+apiInstance.partiallyUpdateSmsDefinition(definitionKey, body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **definitionKey** | **String**| Unique identifier of the definition. |
+ **body** | [**UpdateSmsDefinitionRequest**](UpdateSmsDefinitionRequest.md)| JSON Parameters |
+
+### Return type
+
+[**CreateSmsDefinitionRequest**](CreateSmsDefinitionRequest.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **sendEmailToMultipleRecipients**
+> SendDefinitionToMultipleRecipientsResponse sendEmailToMultipleRecipients(body)
+
+sendEmailToMultipleRecipients
+
+Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let body = new SalesforceMarketingCloud.SendEmailToMultipleRecipientsRequest(); // SendEmailToMultipleRecipientsRequest | JSON Parameters
+
+apiInstance.sendEmailToMultipleRecipients(body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**SendEmailToMultipleRecipientsRequest**](SendEmailToMultipleRecipientsRequest.md)| JSON Parameters |
+
+### Return type
+
+[**SendDefinitionToMultipleRecipientsResponse**](SendDefinitionToMultipleRecipientsResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **sendEmailToSingleRecipient**
+> SendDefinitionToSingleRecipientResponse sendEmailToSingleRecipient(messageKey, body)
+
+sendEmailToSingleRecipient
+
+Sends a message to a single recipient via an email definition using a messageKey path parameter.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let messageKey = "messageKey_example"; // String | Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
+
+let body = new SalesforceMarketingCloud.SendEmailToSingleRecipientRequest(); // SendEmailToSingleRecipientRequest | JSON Parameters
+
+apiInstance.sendEmailToSingleRecipient(messageKey, body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **messageKey** | **String**| Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected. |
+ **body** | [**SendEmailToSingleRecipientRequest**](SendEmailToSingleRecipientRequest.md)| JSON Parameters |
+
+### Return type
+
+[**SendDefinitionToSingleRecipientResponse**](SendDefinitionToSingleRecipientResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **sendSmsToMultipleRecipients**
+> SendDefinitionToMultipleRecipientsResponse sendSmsToMultipleRecipients(body)
+
+sendSmsToMultipleRecipients
+
+Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let body = new SalesforceMarketingCloud.SendSmsToMultipleRecipientsRequest(); // SendSmsToMultipleRecipientsRequest | JSON Parameters
+
+apiInstance.sendSmsToMultipleRecipients(body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | [**SendSmsToMultipleRecipientsRequest**](SendSmsToMultipleRecipientsRequest.md)| JSON Parameters |
+
+### Return type
+
+[**SendDefinitionToMultipleRecipientsResponse**](SendDefinitionToMultipleRecipientsResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **sendSmsToSingleRecipient**
+> SendDefinitionToSingleRecipientResponse sendSmsToSingleRecipient(messageKey, body)
+
+sendSmsToSingleRecipient
+
+Sends a message to a single recipient via a SMS definition using a messageKey path parameter.
+
+### Example
+```javascript
+const SalesforceMarketingCloud = require ('SalesforceMarketingCloud');
+
+let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();
+
+let messageKey = "messageKey_example"; // String | Unique identifier of the definition used to track message status. The messageKey can be created automatically when you create a message, or you can provide it as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
+
+let body = new SalesforceMarketingCloud.SendSmsToSingleRecipientRequest(); // SendSmsToSingleRecipientRequest | JSON Parameters
+
+apiInstance.sendSmsToSingleRecipient(messageKey, body).then((data) => {
+ console.log('API called successfully. Returned data: ' + data);
+}, (error) => {
+ console.error(error);
+});
+
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **messageKey** | **String**| Unique identifier of the definition used to track message status. The messageKey can be created automatically when you create a message, or you can provide it as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected. |
+ **body** | [**SendSmsToSingleRecipientRequest**](SendSmsToSingleRecipientRequest.md)| JSON Parameters |
+
+### Return type
+
+[**SendDefinitionToSingleRecipientResponse**](SendDefinitionToSingleRecipientResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
diff --git a/docs/UpdateEmailDefinitionRequest.md b/docs/UpdateEmailDefinitionRequest.md
new file mode 100644
index 0000000..185dd11
--- /dev/null
+++ b/docs/UpdateEmailDefinitionRequest.md
@@ -0,0 +1,14 @@
+# SalesforceMarketingCloud.UpdateEmailDefinitionRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Name of the definition. Must be unique. | [optional]
+**content** | [**CreateEmailDefinitionContent**](CreateEmailDefinitionContent.md) | | [optional]
+**status** | **String** | Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days. | [optional]
+**description** | **String** | User-provided description of the email definition. | [optional]
+**classification** | **String** | Marketing Cloud external key of a sending classification defined in Email Studio Administration. Only transactional classifications are permitted. Default is default transactional. | [optional]
+**subscriptions** | [**CreateEmailDefinitionSubscriptions**](CreateEmailDefinitionSubscriptions.md) | | [optional]
+**options** | [**CreateEmailDefinitionOptionsRequest**](CreateEmailDefinitionOptionsRequest.md) | | [optional]
+
+
diff --git a/docs/UpdateSmsDefinitionRequest.md b/docs/UpdateSmsDefinitionRequest.md
new file mode 100644
index 0000000..0502e06
--- /dev/null
+++ b/docs/UpdateSmsDefinitionRequest.md
@@ -0,0 +1,12 @@
+# SalesforceMarketingCloud.UpdateSmsDefinitionRequest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Name of the definition. Must be unique. | [optional]
+**content** | [**CreateSmsDefinitionContent**](CreateSmsDefinitionContent.md) | | [optional]
+**status** | **String** | Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days. | [optional]
+**description** | **String** | User-provided description of the SMS definition. | [optional]
+**subscriptions** | [**CreateSmsDefinitionSubscriptions**](CreateSmsDefinitionSubscriptions.md) | | [optional]
+
+
diff --git a/git_push.sh b/git_push.sh
new file mode 100644
index 0000000..0d041ad
--- /dev/null
+++ b/git_push.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/mocha.opts b/mocha.opts
new file mode 100644
index 0000000..9070118
--- /dev/null
+++ b/mocha.opts
@@ -0,0 +1 @@
+--timeout 10000
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..6d7bdfe
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,2428 @@
+{
+ "name": "SalesforceMarketingCloud",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@sinonjs/commons": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz",
+ "integrity": "sha512-w4/WHG7C4WWFyE5geCieFJF6MZkbW4VAriol5KlmQXpAQdxvV0p26sqNZOW6Qyw6Y0l9K4g+cHvvczR2sEEpqg==",
+ "dev": true,
+ "requires": {
+ "type-detect": "4.0.8"
+ }
+ },
+ "@sinonjs/formatio": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz",
+ "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==",
+ "dev": true,
+ "requires": {
+ "@sinonjs/commons": "^1",
+ "@sinonjs/samsam": "^3.1.0"
+ }
+ },
+ "@sinonjs/samsam": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz",
+ "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==",
+ "dev": true,
+ "requires": {
+ "@sinonjs/commons": "^1.3.0",
+ "array-from": "^2.1.1",
+ "lodash": "^4.17.15"
+ }
+ },
+ "@sinonjs/text-encoding": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz",
+ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==",
+ "dev": true
+ },
+ "ansi-colors": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
+ "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==",
+ "dev": true
+ },
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dev": true,
+ "requires": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
+ "array-from": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz",
+ "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=",
+ "dev": true
+ },
+ "asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+ },
+ "babel-code-frame": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
+ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.1.3",
+ "esutils": "^2.0.2",
+ "js-tokens": "^3.0.2"
+ }
+ },
+ "babel-core": {
+ "version": "6.26.3",
+ "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
+ "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "^6.26.0",
+ "babel-generator": "^6.26.0",
+ "babel-helpers": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-register": "^6.26.0",
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "convert-source-map": "^1.5.1",
+ "debug": "^2.6.9",
+ "json5": "^0.5.1",
+ "lodash": "^4.17.4",
+ "minimatch": "^3.0.4",
+ "path-is-absolute": "^1.0.1",
+ "private": "^0.1.8",
+ "slash": "^1.0.0",
+ "source-map": "^0.5.7"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "babel-generator": {
+ "version": "6.26.1",
+ "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz",
+ "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==",
+ "dev": true,
+ "requires": {
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "detect-indent": "^4.0.0",
+ "jsesc": "^1.3.0",
+ "lodash": "^4.17.4",
+ "source-map": "^0.5.7",
+ "trim-right": "^1.0.1"
+ }
+ },
+ "babel-helper-bindify-decorators": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz",
+ "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-builder-binary-assignment-operator-visitor": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz",
+ "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=",
+ "dev": true,
+ "requires": {
+ "babel-helper-explode-assignable-expression": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-call-delegate": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
+ "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=",
+ "dev": true,
+ "requires": {
+ "babel-helper-hoist-variables": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-define-map": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz",
+ "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "^6.24.1",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "lodash": "^4.17.4"
+ }
+ },
+ "babel-helper-explode-assignable-expression": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
+ "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-explode-class": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz",
+ "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=",
+ "dev": true,
+ "requires": {
+ "babel-helper-bindify-decorators": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-function-name": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
+ "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=",
+ "dev": true,
+ "requires": {
+ "babel-helper-get-function-arity": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-get-function-arity": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz",
+ "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-hoist-variables": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz",
+ "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-optimise-call-expression": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz",
+ "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-regex": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz",
+ "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "lodash": "^4.17.4"
+ }
+ },
+ "babel-helper-remap-async-to-generator": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz",
+ "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helper-replace-supers": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
+ "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=",
+ "dev": true,
+ "requires": {
+ "babel-helper-optimise-call-expression": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-helpers": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
+ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-messages": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
+ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-check-es2015-constants": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz",
+ "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-syntax-async-functions": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
+ "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=",
+ "dev": true
+ },
+ "babel-plugin-syntax-async-generators": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz",
+ "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=",
+ "dev": true
+ },
+ "babel-plugin-syntax-class-constructor-call": {
+ "version": "6.18.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz",
+ "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=",
+ "dev": true
+ },
+ "babel-plugin-syntax-class-properties": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz",
+ "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=",
+ "dev": true
+ },
+ "babel-plugin-syntax-decorators": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz",
+ "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=",
+ "dev": true
+ },
+ "babel-plugin-syntax-do-expressions": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz",
+ "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=",
+ "dev": true
+ },
+ "babel-plugin-syntax-dynamic-import": {
+ "version": "6.18.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
+ "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=",
+ "dev": true
+ },
+ "babel-plugin-syntax-exponentiation-operator": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz",
+ "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
+ "dev": true
+ },
+ "babel-plugin-syntax-export-extensions": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz",
+ "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=",
+ "dev": true
+ },
+ "babel-plugin-syntax-function-bind": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz",
+ "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=",
+ "dev": true
+ },
+ "babel-plugin-syntax-object-rest-spread": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
+ "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=",
+ "dev": true
+ },
+ "babel-plugin-syntax-trailing-function-commas": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz",
+ "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=",
+ "dev": true
+ },
+ "babel-plugin-transform-async-generator-functions": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz",
+ "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=",
+ "dev": true,
+ "requires": {
+ "babel-helper-remap-async-to-generator": "^6.24.1",
+ "babel-plugin-syntax-async-generators": "^6.5.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-async-to-generator": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
+ "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
+ "dev": true,
+ "requires": {
+ "babel-helper-remap-async-to-generator": "^6.24.1",
+ "babel-plugin-syntax-async-functions": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-class-constructor-call": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz",
+ "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-class-constructor-call": "^6.18.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-class-properties": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz",
+ "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "^6.24.1",
+ "babel-plugin-syntax-class-properties": "^6.8.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-decorators": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz",
+ "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=",
+ "dev": true,
+ "requires": {
+ "babel-helper-explode-class": "^6.24.1",
+ "babel-plugin-syntax-decorators": "^6.13.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-do-expressions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz",
+ "integrity": "sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-do-expressions": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-arrow-functions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
+ "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-block-scoped-functions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz",
+ "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-block-scoping": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz",
+ "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "lodash": "^4.17.4"
+ }
+ },
+ "babel-plugin-transform-es2015-classes": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz",
+ "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=",
+ "dev": true,
+ "requires": {
+ "babel-helper-define-map": "^6.24.1",
+ "babel-helper-function-name": "^6.24.1",
+ "babel-helper-optimise-call-expression": "^6.24.1",
+ "babel-helper-replace-supers": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-computed-properties": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz",
+ "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-destructuring": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz",
+ "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-duplicate-keys": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz",
+ "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-for-of": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz",
+ "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-function-name": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz",
+ "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=",
+ "dev": true,
+ "requires": {
+ "babel-helper-function-name": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-literals": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz",
+ "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-amd": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz",
+ "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-commonjs": {
+ "version": "6.26.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz",
+ "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-strict-mode": "^6.24.1",
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-types": "^6.26.0"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-systemjs": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz",
+ "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=",
+ "dev": true,
+ "requires": {
+ "babel-helper-hoist-variables": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-modules-umd": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz",
+ "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-es2015-modules-amd": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-object-super": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz",
+ "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=",
+ "dev": true,
+ "requires": {
+ "babel-helper-replace-supers": "^6.24.1",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-parameters": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz",
+ "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=",
+ "dev": true,
+ "requires": {
+ "babel-helper-call-delegate": "^6.24.1",
+ "babel-helper-get-function-arity": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1",
+ "babel-traverse": "^6.24.1",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-shorthand-properties": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz",
+ "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-spread": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz",
+ "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-sticky-regex": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz",
+ "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=",
+ "dev": true,
+ "requires": {
+ "babel-helper-regex": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-plugin-transform-es2015-template-literals": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz",
+ "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-typeof-symbol": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz",
+ "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-es2015-unicode-regex": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz",
+ "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=",
+ "dev": true,
+ "requires": {
+ "babel-helper-regex": "^6.24.1",
+ "babel-runtime": "^6.22.0",
+ "regexpu-core": "^2.0.0"
+ }
+ },
+ "babel-plugin-transform-exponentiation-operator": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz",
+ "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=",
+ "dev": true,
+ "requires": {
+ "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1",
+ "babel-plugin-syntax-exponentiation-operator": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-export-extensions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz",
+ "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-export-extensions": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-function-bind": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz",
+ "integrity": "sha1-xvuOlqwpajELjPjqQBRiQH3fapc=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-function-bind": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-transform-object-rest-spread": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz",
+ "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-object-rest-spread": "^6.8.0",
+ "babel-runtime": "^6.26.0"
+ }
+ },
+ "babel-plugin-transform-regenerator": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
+ "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=",
+ "dev": true,
+ "requires": {
+ "regenerator-transform": "^0.10.0"
+ }
+ },
+ "babel-plugin-transform-strict-mode": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz",
+ "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0",
+ "babel-types": "^6.24.1"
+ }
+ },
+ "babel-preset-env": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz",
+ "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==",
+ "dev": true,
+ "requires": {
+ "babel-plugin-check-es2015-constants": "^6.22.0",
+ "babel-plugin-syntax-trailing-function-commas": "^6.22.0",
+ "babel-plugin-transform-async-to-generator": "^6.22.0",
+ "babel-plugin-transform-es2015-arrow-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoping": "^6.23.0",
+ "babel-plugin-transform-es2015-classes": "^6.23.0",
+ "babel-plugin-transform-es2015-computed-properties": "^6.22.0",
+ "babel-plugin-transform-es2015-destructuring": "^6.23.0",
+ "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0",
+ "babel-plugin-transform-es2015-for-of": "^6.23.0",
+ "babel-plugin-transform-es2015-function-name": "^6.22.0",
+ "babel-plugin-transform-es2015-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-modules-amd": "^6.22.0",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
+ "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0",
+ "babel-plugin-transform-es2015-modules-umd": "^6.23.0",
+ "babel-plugin-transform-es2015-object-super": "^6.22.0",
+ "babel-plugin-transform-es2015-parameters": "^6.23.0",
+ "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0",
+ "babel-plugin-transform-es2015-spread": "^6.22.0",
+ "babel-plugin-transform-es2015-sticky-regex": "^6.22.0",
+ "babel-plugin-transform-es2015-template-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0",
+ "babel-plugin-transform-es2015-unicode-regex": "^6.22.0",
+ "babel-plugin-transform-exponentiation-operator": "^6.22.0",
+ "babel-plugin-transform-regenerator": "^6.22.0",
+ "browserslist": "^3.2.6",
+ "invariant": "^2.2.2",
+ "semver": "^5.3.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ }
+ }
+ },
+ "babel-preset-stage-0": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz",
+ "integrity": "sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-do-expressions": "^6.22.0",
+ "babel-plugin-transform-function-bind": "^6.22.0",
+ "babel-preset-stage-1": "^6.24.1"
+ }
+ },
+ "babel-preset-stage-1": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz",
+ "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-class-constructor-call": "^6.24.1",
+ "babel-plugin-transform-export-extensions": "^6.22.0",
+ "babel-preset-stage-2": "^6.24.1"
+ }
+ },
+ "babel-preset-stage-2": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz",
+ "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-dynamic-import": "^6.18.0",
+ "babel-plugin-transform-class-properties": "^6.24.1",
+ "babel-plugin-transform-decorators": "^6.24.1",
+ "babel-preset-stage-3": "^6.24.1"
+ }
+ },
+ "babel-preset-stage-3": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz",
+ "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-trailing-function-commas": "^6.22.0",
+ "babel-plugin-transform-async-generator-functions": "^6.24.1",
+ "babel-plugin-transform-async-to-generator": "^6.24.1",
+ "babel-plugin-transform-exponentiation-operator": "^6.24.1",
+ "babel-plugin-transform-object-rest-spread": "^6.22.0"
+ }
+ },
+ "babel-register": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
+ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=",
+ "dev": true,
+ "requires": {
+ "babel-core": "^6.26.0",
+ "babel-runtime": "^6.26.0",
+ "core-js": "^2.5.0",
+ "home-or-tmp": "^2.0.0",
+ "lodash": "^4.17.4",
+ "mkdirp": "^0.5.1",
+ "source-map-support": "^0.4.15"
+ }
+ },
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "dev": true,
+ "requires": {
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
+ }
+ },
+ "babel-template": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz",
+ "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "lodash": "^4.17.4"
+ }
+ },
+ "babel-traverse": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz",
+ "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "^6.26.0",
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "debug": "^2.6.8",
+ "globals": "^9.18.0",
+ "invariant": "^2.2.2",
+ "lodash": "^4.17.4"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "babel-types": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz",
+ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ }
+ },
+ "babylon": {
+ "version": "6.18.0",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
+ "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
+ "dev": true
+ },
+ "balanced-match": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "dev": true
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "browser-stdout": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "dev": true
+ },
+ "browserslist": {
+ "version": "3.2.8",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz",
+ "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30000844",
+ "electron-to-chromium": "^1.3.47"
+ }
+ },
+ "camelcase": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+ "dev": true
+ },
+ "caniuse-lite": {
+ "version": "1.0.30000989",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz",
+ "integrity": "sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw==",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "cliui": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
+ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
+ "dev": true,
+ "requires": {
+ "string-width": "^2.1.1",
+ "strip-ansi": "^4.0.0",
+ "wrap-ansi": "^2.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ }
+ }
+ },
+ "code-point-at": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+ "dev": true
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+ "dev": true
+ },
+ "combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "requires": {
+ "delayed-stream": "~1.0.0"
+ }
+ },
+ "component-emitter": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
+ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "convert-source-map": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz",
+ "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "~5.1.1"
+ },
+ "dependencies": {
+ "safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "dev": true
+ }
+ }
+ },
+ "cookiejar": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz",
+ "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA=="
+ },
+ "core-js": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz",
+ "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==",
+ "dev": true
+ },
+ "cross-spawn": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+ "dev": true,
+ "requires": {
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ }
+ }
+ },
+ "debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+ "dev": true
+ },
+ "define-properties": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
+ "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
+ "dev": true,
+ "requires": {
+ "object-keys": "^1.0.12"
+ }
+ },
+ "delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+ },
+ "detect-indent": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
+ "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
+ "dev": true,
+ "requires": {
+ "repeating": "^2.0.0"
+ }
+ },
+ "diff": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
+ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.260",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.260.tgz",
+ "integrity": "sha512-wGt+OivF1C1MPwaSv3LJ96ebNbLAWlx3HndivDDWqwIVSQxmhL17Y/YmwUdEMtS/bPyommELt47Dct0/VZNQBQ==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
+ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
+ "dev": true
+ },
+ "end-of-stream": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
+ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
+ "dev": true,
+ "requires": {
+ "once": "^1.4.0"
+ }
+ },
+ "es-abstract": {
+ "version": "1.14.2",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.2.tgz",
+ "integrity": "sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg==",
+ "dev": true,
+ "requires": {
+ "es-to-primitive": "^1.2.0",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "has-symbols": "^1.0.0",
+ "is-callable": "^1.1.4",
+ "is-regex": "^1.0.4",
+ "object-inspect": "^1.6.0",
+ "object-keys": "^1.1.1",
+ "string.prototype.trimleft": "^2.0.0",
+ "string.prototype.trimright": "^2.0.0"
+ }
+ },
+ "es-to-primitive": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz",
+ "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==",
+ "dev": true,
+ "requires": {
+ "is-callable": "^1.1.4",
+ "is-date-object": "^1.0.1",
+ "is-symbol": "^1.0.2"
+ }
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
+ "esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true
+ },
+ "esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true
+ },
+ "execa": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
+ "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^6.0.0",
+ "get-stream": "^4.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
+ }
+ },
+ "expect.js": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz",
+ "integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=",
+ "dev": true
+ },
+ "fast-safe-stringify": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
+ "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
+ },
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "flat": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz",
+ "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==",
+ "dev": true,
+ "requires": {
+ "is-buffer": "~2.0.3"
+ }
+ },
+ "form-data": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz",
+ "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
+ "requires": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.6",
+ "mime-types": "^2.1.12"
+ }
+ },
+ "formidable": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz",
+ "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg=="
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+ "dev": true
+ },
+ "get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "dev": true
+ },
+ "get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dev": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "glob": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
+ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "globals": {
+ "version": "9.18.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
+ "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
+ "dev": true
+ },
+ "growl": {
+ "version": "1.10.5",
+ "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
+ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
+ "dev": true
+ },
+ "has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dev": true,
+ "requires": {
+ "function-bind": "^1.1.1"
+ }
+ },
+ "has-ansi": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true
+ },
+ "has-symbols": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
+ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=",
+ "dev": true
+ },
+ "he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "dev": true
+ },
+ "home-or-tmp": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
+ "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
+ "dev": true,
+ "requires": {
+ "os-homedir": "^1.0.0",
+ "os-tmpdir": "^1.0.1"
+ }
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "invariant": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
+ "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
+ "dev": true,
+ "requires": {
+ "loose-envify": "^1.0.0"
+ }
+ },
+ "invert-kv": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
+ "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
+ "dev": true
+ },
+ "is-buffer": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
+ "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==",
+ "dev": true
+ },
+ "is-callable": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
+ "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==",
+ "dev": true
+ },
+ "is-date-object": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
+ "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
+ "dev": true
+ },
+ "is-finite": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
+ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+ "dev": true
+ },
+ "is-regex": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
+ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
+ "dev": true,
+ "requires": {
+ "has": "^1.0.1"
+ }
+ },
+ "is-stream": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
+ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
+ "dev": true
+ },
+ "is-symbol": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
+ "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
+ "dev": true,
+ "requires": {
+ "has-symbols": "^1.0.0"
+ }
+ },
+ "isarray": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
+ "dev": true
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+ "dev": true
+ },
+ "js-tokens": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
+ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
+ "dev": true
+ },
+ "js-yaml": {
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ }
+ },
+ "jsesc": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
+ "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
+ "dev": true
+ },
+ "json5": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
+ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
+ "dev": true
+ },
+ "just-extend": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz",
+ "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==",
+ "dev": true
+ },
+ "lcid": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
+ "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
+ "dev": true,
+ "requires": {
+ "invert-kv": "^2.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.15",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
+ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+ "dev": true
+ },
+ "log-symbols": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
+ "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.0.1"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ }
+ },
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "lolex": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz",
+ "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==",
+ "dev": true
+ },
+ "loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "dev": true,
+ "requires": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ }
+ },
+ "map-age-cleaner": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
+ "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
+ "dev": true,
+ "requires": {
+ "p-defer": "^1.0.0"
+ }
+ },
+ "mem": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
+ "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
+ "dev": true,
+ "requires": {
+ "map-age-cleaner": "^0.1.1",
+ "mimic-fn": "^2.0.0",
+ "p-is-promise": "^2.0.0"
+ }
+ },
+ "methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
+ },
+ "mime": {
+ "version": "2.4.4",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz",
+ "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA=="
+ },
+ "mime-db": {
+ "version": "1.40.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
+ "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
+ },
+ "mime-types": {
+ "version": "2.1.24",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
+ "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
+ "requires": {
+ "mime-db": "1.40.0"
+ }
+ },
+ "mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "dev": true
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "dev": true
+ },
+ "mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.8"
+ }
+ },
+ "mocha": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz",
+ "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "3.2.3",
+ "browser-stdout": "1.3.1",
+ "debug": "3.2.6",
+ "diff": "3.5.0",
+ "escape-string-regexp": "1.0.5",
+ "find-up": "3.0.0",
+ "glob": "7.1.3",
+ "growl": "1.10.5",
+ "he": "1.2.0",
+ "js-yaml": "3.13.1",
+ "log-symbols": "2.2.0",
+ "minimatch": "3.0.4",
+ "mkdirp": "0.5.1",
+ "ms": "2.1.1",
+ "node-environment-flags": "1.0.5",
+ "object.assign": "4.1.0",
+ "strip-json-comments": "2.0.1",
+ "supports-color": "6.0.0",
+ "which": "1.3.1",
+ "wide-align": "1.1.3",
+ "yargs": "13.2.2",
+ "yargs-parser": "13.0.0",
+ "yargs-unparser": "1.5.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "ms": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
+ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz",
+ "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "nice-try": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "dev": true
+ },
+ "nise": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz",
+ "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==",
+ "dev": true,
+ "requires": {
+ "@sinonjs/formatio": "^3.2.1",
+ "@sinonjs/text-encoding": "^0.7.1",
+ "just-extend": "^4.0.2",
+ "lolex": "^4.1.0",
+ "path-to-regexp": "^1.7.0"
+ }
+ },
+ "node-environment-flags": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz",
+ "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==",
+ "dev": true,
+ "requires": {
+ "object.getownpropertydescriptors": "^2.0.3",
+ "semver": "^5.7.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ }
+ }
+ },
+ "npm-run-path": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
+ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
+ "dev": true,
+ "requires": {
+ "path-key": "^2.0.0"
+ }
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+ "dev": true
+ },
+ "object-inspect": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz",
+ "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==",
+ "dev": true
+ },
+ "object-keys": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
+ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+ "dev": true
+ },
+ "object.assign": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
+ "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.2",
+ "function-bind": "^1.1.1",
+ "has-symbols": "^1.0.0",
+ "object-keys": "^1.0.11"
+ }
+ },
+ "object.getownpropertydescriptors": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
+ "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.2",
+ "es-abstract": "^1.5.1"
+ }
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "os-homedir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
+ "dev": true
+ },
+ "os-locale": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
+ "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
+ "dev": true,
+ "requires": {
+ "execa": "^1.0.0",
+ "lcid": "^2.0.0",
+ "mem": "^4.0.0"
+ }
+ },
+ "os-tmpdir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+ "dev": true
+ },
+ "p-defer": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
+ "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
+ "dev": true
+ },
+ "p-finally": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
+ "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
+ "dev": true
+ },
+ "p-is-promise": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
+ "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==",
+ "dev": true
+ },
+ "p-limit": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
+ "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true
+ },
+ "path-exists": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+ "dev": true
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true
+ },
+ "path-key": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
+ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
+ "dev": true
+ },
+ "path-to-regexp": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz",
+ "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=",
+ "dev": true,
+ "requires": {
+ "isarray": "0.0.1"
+ }
+ },
+ "private": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
+ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==",
+ "dev": true
+ },
+ "pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "dev": true,
+ "requires": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "qs": {
+ "version": "6.8.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.8.0.tgz",
+ "integrity": "sha512-tPSkj8y92PfZVbinY1n84i1Qdx75lZjMQYx9WZhnkofyxzw2r7Ho39G3/aEvSUdebxpnnM4LZJCtvE/Aq3+s9w=="
+ },
+ "readable-stream": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
+ "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
+ "requires": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ }
+ },
+ "regenerate": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz",
+ "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==",
+ "dev": true
+ },
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
+ "dev": true
+ },
+ "regenerator-transform": {
+ "version": "0.10.1",
+ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz",
+ "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.18.0",
+ "babel-types": "^6.19.0",
+ "private": "^0.1.6"
+ }
+ },
+ "regexpu-core": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
+ "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=",
+ "dev": true,
+ "requires": {
+ "regenerate": "^1.2.1",
+ "regjsgen": "^0.2.0",
+ "regjsparser": "^0.1.4"
+ }
+ },
+ "regjsgen": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
+ "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=",
+ "dev": true
+ },
+ "regjsparser": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
+ "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
+ "dev": true,
+ "requires": {
+ "jsesc": "~0.5.0"
+ },
+ "dependencies": {
+ "jsesc": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+ "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
+ "dev": true
+ }
+ }
+ },
+ "repeating": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
+ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
+ "dev": true,
+ "requires": {
+ "is-finite": "^1.0.0"
+ }
+ },
+ "require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
+ "dev": true
+ },
+ "require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
+ },
+ "safe-buffer": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
+ "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
+ },
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
+ },
+ "set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+ "dev": true
+ },
+ "shebang-command": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "^1.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
+ "dev": true
+ },
+ "signal-exit": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
+ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
+ "dev": true
+ },
+ "sinon": {
+ "version": "7.4.2",
+ "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.4.2.tgz",
+ "integrity": "sha512-pY5RY99DKelU3pjNxcWo6XqeB1S118GBcVIIdDi6V+h6hevn1izcg2xv1hTHW/sViRXU7sUOxt4wTUJ3gsW2CQ==",
+ "dev": true,
+ "requires": {
+ "@sinonjs/commons": "^1.4.0",
+ "@sinonjs/formatio": "^3.2.1",
+ "@sinonjs/samsam": "^3.3.3",
+ "diff": "^3.5.0",
+ "lolex": "^4.2.0",
+ "nise": "^1.5.2",
+ "supports-color": "^5.5.0"
+ },
+ "dependencies": {
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "slash": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
+ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true
+ },
+ "source-map-support": {
+ "version": "0.4.18",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz",
+ "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==",
+ "dev": true,
+ "requires": {
+ "source-map": "^0.5.6"
+ }
+ },
+ "sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
+ "dev": true
+ },
+ "string-width": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+ "dev": true,
+ "requires": {
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^4.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ }
+ }
+ },
+ "string.prototype.trimleft": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz",
+ "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.3",
+ "function-bind": "^1.1.1"
+ }
+ },
+ "string.prototype.trimright": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz",
+ "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.3",
+ "function-bind": "^1.1.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "requires": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "strip-eof": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
+ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
+ "dev": true
+ },
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "dev": true
+ },
+ "superagent": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.1.0.tgz",
+ "integrity": "sha512-7V6JVx5N+eTL1MMqRBX0v0bG04UjrjAvvZJTF/VDH/SH2GjSLqlrcYepFlpTrXpm37aSY6h3GGVWGxXl/98TKA==",
+ "requires": {
+ "component-emitter": "^1.3.0",
+ "cookiejar": "^2.1.2",
+ "debug": "^4.1.1",
+ "fast-safe-stringify": "^2.0.6",
+ "form-data": "^2.3.3",
+ "formidable": "^1.2.1",
+ "methods": "^1.1.2",
+ "mime": "^2.4.4",
+ "qs": "^6.7.0",
+ "readable-stream": "^3.4.0",
+ "semver": "^6.1.1"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ },
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ },
+ "trim-right": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
+ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
+ "dev": true
+ },
+ "type-detect": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
+ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
+ "dev": true
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+ },
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "which-module": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
+ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
+ "dev": true
+ },
+ "wide-align": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
+ "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
+ "dev": true,
+ "requires": {
+ "string-width": "^1.0.2 || 2"
+ }
+ },
+ "wrap-ansi": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
+ "dev": true,
+ "requires": {
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1"
+ },
+ "dependencies": {
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "dev": true,
+ "requires": {
+ "code-point-at": "^1.0.0",
+ "is-fullwidth-code-point": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ }
+ }
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ },
+ "y18n": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
+ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
+ "dev": true
+ },
+ "yargs": {
+ "version": "13.2.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz",
+ "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==",
+ "dev": true,
+ "requires": {
+ "cliui": "^4.0.0",
+ "find-up": "^3.0.0",
+ "get-caller-file": "^2.0.1",
+ "os-locale": "^3.1.0",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^3.0.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^13.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+ "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^4.1.0"
+ }
+ }
+ }
+ },
+ "yargs-parser": {
+ "version": "13.0.0",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz",
+ "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==",
+ "dev": true,
+ "requires": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ }
+ },
+ "yargs-unparser": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz",
+ "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==",
+ "dev": true,
+ "requires": {
+ "flat": "^4.1.0",
+ "lodash": "^4.17.11",
+ "yargs": "^12.0.5"
+ },
+ "dependencies": {
+ "get-caller-file": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
+ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
+ "dev": true
+ },
+ "require-main-filename": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
+ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
+ "dev": true
+ },
+ "yargs": {
+ "version": "12.0.5",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
+ "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==",
+ "dev": true,
+ "requires": {
+ "cliui": "^4.0.0",
+ "decamelize": "^1.2.0",
+ "find-up": "^3.0.0",
+ "get-caller-file": "^1.0.1",
+ "os-locale": "^3.0.0",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^1.0.1",
+ "set-blocking": "^2.0.0",
+ "string-width": "^2.0.0",
+ "which-module": "^2.0.0",
+ "y18n": "^3.2.1 || ^4.0.0",
+ "yargs-parser": "^11.1.1"
+ }
+ },
+ "yargs-parser": {
+ "version": "11.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz",
+ "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==",
+ "dev": true,
+ "requires": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..f9b0d61
--- /dev/null
+++ b/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "SalesforceMarketingCloud",
+ "version": "1.0.0",
+ "description": "Marketing_Clouds_REST_API_is_our_newest_API__It_supports_multi_channel_use_cases_is_much_more_lightweight_and_easy_to_use_than_our_SOAP_API_and_is_getting_more_comprehensive_with_every_release_",
+ "license": "Apache 2.0",
+ "main": "src/index.js",
+ "scripts": {
+ "test": "node_modules/.bin/mocha test/unit --recursive && node_modules/.bin/mocha test/integration --recursive --timeout {TEST_TIMEOUT}s"
+ },
+ "browser": {
+ "fs": false
+ },
+ "dependencies": {
+ "superagent": "^5.1.0"
+ },
+ "devDependencies": {
+ "babel-core": "^6.26.3",
+ "babel-preset-env": "^1.7.0",
+ "babel-preset-stage-0": "^6.24.1",
+ "expect.js": "^0.3.1",
+ "mocha": "^6.2.0",
+ "sinon": "^7.4.2"
+ }
+}
diff --git a/src/Api/AssetApi.js b/src/Api/AssetApi.js
new file mode 100644
index 0000000..dc71b83
--- /dev/null
+++ b/src/Api/AssetApi.js
@@ -0,0 +1,249 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiError = require ('../Model/ApiError');
+const Asset = require ('../Model/Asset');
+const BaseApi = require('./BaseApi');
+
+/**
+* Asset service.
+* @module Api/AssetApi
+* @version 1.0.0
+*/
+module.exports = class AssetApi extends BaseApi {
+
+ /**
+ * Constructs a new AssetApi.
+ * @alias module:Api/AssetApi
+ * @class
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
+ * default to {@link module:ApiClient#instance} if unspecified.
+ */
+ constructor(authBaseUrl, clientId, clientSecret, accountId, scope) {
+ super(authBaseUrl, clientId, clientSecret, accountId, scope);
+ }
+
+
+
+ /**
+ * createAsset
+ * Creates a new asset.
+ * @param {module:Model/Asset} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/Asset} and HTTP response
+ */
+ createAssetWithHttpInfo(caller, body) {
+ let postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling createAsset");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/asset/v1/content/assets', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * createAsset
+ * Creates a new asset.
+ * @param {module:Model/Asset} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/Asset}
+ */
+ createAsset(body) {
+ return this.createAssetWithHttpInfo('createAsset', body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * deleteAssetById
+ * Deletes an asset.
+ * @param {Number} id The ID of the asset to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
+ */
+ deleteAssetByIdWithHttpInfo(caller, id) {
+ let postBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id === undefined || id === null) {
+ throw new Error("Missing the required parameter 'id' when calling deleteAssetById");
+ }
+
+
+ let pathParams = {
+ 'id': id
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = null;
+
+ return this.apiClient.callApi(
+ '/asset/v1/content/assets/{id}', 'DELETE',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * deleteAssetById
+ * Deletes an asset.
+ * @param {Number} id The ID of the asset to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
+ */
+ deleteAssetById(id) {
+ return this.deleteAssetByIdWithHttpInfo('deleteAssetById', id)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getAssetById
+ * Gets an asset by ID.
+ * @param {Number} id The ID of the asset
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/Asset} and HTTP response
+ */
+ getAssetByIdWithHttpInfo(caller, id) {
+ let postBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id === undefined || id === null) {
+ throw new Error("Missing the required parameter 'id' when calling getAssetById");
+ }
+
+
+ let pathParams = {
+ 'id': id
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/asset/v1/content/assets/{id}', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getAssetById
+ * Gets an asset by ID.
+ * @param {Number} id The ID of the asset
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/Asset}
+ */
+ getAssetById(id) {
+ return this.getAssetByIdWithHttpInfo('getAssetById', id)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * partiallyUpdateAssetById
+ * Updates part of an asset.
+ * @param {Number} id The ID of the asset to update
+ * @param {module:Model/Asset} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/Asset} and HTTP response
+ */
+ partiallyUpdateAssetByIdWithHttpInfo(caller, id, body) {
+ let postBody = body;
+
+ // verify the required parameter 'id' is set
+ if (id === undefined || id === null) {
+ throw new Error("Missing the required parameter 'id' when calling partiallyUpdateAssetById");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling partiallyUpdateAssetById");
+ }
+
+
+ let pathParams = {
+ 'id': id
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/asset/v1/content/assets/{id}', 'PATCH',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * partiallyUpdateAssetById
+ * Updates part of an asset.
+ * @param {Number} id The ID of the asset to update
+ * @param {module:Model/Asset} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/Asset}
+ */
+ partiallyUpdateAssetById(id, body) {
+ return this.partiallyUpdateAssetByIdWithHttpInfo('partiallyUpdateAssetById', id, body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+}
diff --git a/src/Api/BaseApi.js b/src/Api/BaseApi.js
new file mode 100644
index 0000000..e31384f
--- /dev/null
+++ b/src/Api/BaseApi.js
@@ -0,0 +1,20 @@
+const ClientConfiguration = require('../Auth/ClientConfiguration');
+const RuntimeInformationProvider = require('../RuntimeInformationProvider');
+const ApiClient = require('../ApiClient');
+const AuthService = require('../Auth/AuthService');
+const OAuth2ApiClient = require('../OAuth2ApiClient');
+const CacheService = require('../Auth/CacheService');
+
+class BaseApi {
+ constructor(authBaseUrl, clientId, clientSecret, accountId, scope){
+ this.clientConfiguration = new ClientConfiguration(authBaseUrl, clientId, clientSecret, accountId, scope);
+ this.runtimeInformationProvider = new RuntimeInformationProvider();
+ let apiClient = new ApiClient(this.runtimeInformationProvider);
+ let cacheService = new CacheService();
+
+ this.authService = new AuthService(this.clientConfiguration, apiClient, cacheService);
+ this.apiClient = new OAuth2ApiClient(this.authService, this.runtimeInformationProvider);
+ }
+}
+
+module.exports = BaseApi;
\ No newline at end of file
diff --git a/src/Api/CampaignApi.js b/src/Api/CampaignApi.js
new file mode 100644
index 0000000..89dfc36
--- /dev/null
+++ b/src/Api/CampaignApi.js
@@ -0,0 +1,191 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiError = require ('../Model/ApiError');
+const Campaign = require ('../Model/Campaign');
+const BaseApi = require('./BaseApi');
+
+/**
+* Campaign service.
+* @module Api/CampaignApi
+* @version 1.0.0
+*/
+module.exports = class CampaignApi extends BaseApi {
+
+ /**
+ * Constructs a new CampaignApi.
+ * @alias module:Api/CampaignApi
+ * @class
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
+ * default to {@link module:ApiClient#instance} if unspecified.
+ */
+ constructor(authBaseUrl, clientId, clientSecret, accountId, scope) {
+ super(authBaseUrl, clientId, clientSecret, accountId, scope);
+ }
+
+
+
+ /**
+ * createCampaign
+ * Creates a campaign.
+ * @param {module:Model/Campaign} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/Campaign} and HTTP response
+ */
+ createCampaignWithHttpInfo(caller, body) {
+ let postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling createCampaign");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/hub/v1/campaigns', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * createCampaign
+ * Creates a campaign.
+ * @param {module:Model/Campaign} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/Campaign}
+ */
+ createCampaign(body) {
+ return this.createCampaignWithHttpInfo('createCampaign', body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * deleteCampaignById
+ * Deletes a campaign.
+ * @param {String} id The ID of the campaign to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
+ */
+ deleteCampaignByIdWithHttpInfo(caller, id) {
+ let postBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id === undefined || id === null) {
+ throw new Error("Missing the required parameter 'id' when calling deleteCampaignById");
+ }
+
+
+ let pathParams = {
+ 'id': id
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = null;
+
+ return this.apiClient.callApi(
+ '/hub/v1/campaigns/{id}', 'DELETE',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * deleteCampaignById
+ * Deletes a campaign.
+ * @param {String} id The ID of the campaign to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
+ */
+ deleteCampaignById(id) {
+ return this.deleteCampaignByIdWithHttpInfo('deleteCampaignById', id)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getCampaignById
+ * Retrieves a campaign.
+ * @param {String} id Campaign ID
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/Campaign} and HTTP response
+ */
+ getCampaignByIdWithHttpInfo(caller, id) {
+ let postBody = null;
+
+ // verify the required parameter 'id' is set
+ if (id === undefined || id === null) {
+ throw new Error("Missing the required parameter 'id' when calling getCampaignById");
+ }
+
+
+ let pathParams = {
+ 'id': id
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/hub/v1/campaigns/{id}', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getCampaignById
+ * Retrieves a campaign.
+ * @param {String} id Campaign ID
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/Campaign}
+ */
+ getCampaignById(id) {
+ return this.getCampaignByIdWithHttpInfo('getCampaignById', id)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+}
diff --git a/src/Api/Client.js b/src/Api/Client.js
new file mode 100644
index 0000000..7700653
--- /dev/null
+++ b/src/Api/Client.js
@@ -0,0 +1,75 @@
+const EnvironmentConfigProvider = require('../EnvironmentConfigProvider');
+
+(function (root, factory) {
+ factory(require('../index'));
+}(this, function (SalesforceMarketingCloud) {
+ class Client {
+ constructor(clientConfig) {
+ let _authBaseUrl;
+ this.getAuthBaseUrl = () => { return _authBaseUrl; };
+ let _clientId;
+ this.getClientId = () => { return _clientId; };
+ let _clientSecret;
+ this.getClientSecret = () => { return _clientSecret; };
+ let _accountId;
+ this.getAccountId = () => { return _accountId; };
+ let _scope;
+ this.getScope = () => { return _scope; };
+
+ this._assetApi = undefined;
+ this._campaignApi = undefined;
+ this._transactionalMessagingApi = undefined;
+
+ if (!clientConfig) {
+ let environmentConfigProvider = new EnvironmentConfigProvider();
+
+ _authBaseUrl = environmentConfigProvider.get('SFMC_AUTH_BASE_URL');
+ _clientId = environmentConfigProvider.get('SFMC_CLIENT_ID');
+ _clientSecret = environmentConfigProvider.get('SFMC_CLIENT_SECRET');
+ _accountId = environmentConfigProvider.get('SFMC_ACCOUNT_ID');
+ _scope = environmentConfigProvider.get('SFMC_SCOPE', false);
+ } else {
+ _authBaseUrl = clientConfig.authBaseUrl;
+ _clientId = clientConfig.clientId;
+ _clientSecret = clientConfig.clientSecret;
+ _accountId = clientConfig.accountId;
+ _scope = clientConfig.scope;
+ }
+ }
+
+ get assetApi() {
+ if(this._assetApi === undefined){
+ this._assetApi = new SalesforceMarketingCloud.AssetApi(
+ this.getAuthBaseUrl(),
+ this.getClientId(),
+ this.getClientSecret(),
+ this.getAccountId(),
+ this.getScope());
+ }
+ return this._assetApi;
+ }
+ get campaignApi() {
+ if(this._campaignApi === undefined){
+ this._campaignApi = new SalesforceMarketingCloud.CampaignApi(
+ this.getAuthBaseUrl(),
+ this.getClientId(),
+ this.getClientSecret(),
+ this.getAccountId(),
+ this.getScope());
+ }
+ return this._campaignApi;
+ }
+ get transactionalMessagingApi() {
+ if(this._transactionalMessagingApi === undefined){
+ this._transactionalMessagingApi = new SalesforceMarketingCloud.TransactionalMessagingApi(
+ this.getAuthBaseUrl(),
+ this.getClientId(),
+ this.getClientSecret(),
+ this.getAccountId(),
+ this.getScope());
+ }
+ return this._transactionalMessagingApi;
+ }
+ }
+ module.exports = Client;
+}));
\ No newline at end of file
diff --git a/src/Api/TransactionalMessagingApi.js b/src/Api/TransactionalMessagingApi.js
new file mode 100644
index 0000000..a75f311
--- /dev/null
+++ b/src/Api/TransactionalMessagingApi.js
@@ -0,0 +1,1233 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiError = require ('../Model/ApiError');
+const CreateEmailDefinitionRequest = require ('../Model/CreateEmailDefinitionRequest');
+const CreateSmsDefinitionRequest = require ('../Model/CreateSmsDefinitionRequest');
+const DeleteQueuedMessagesForSendDefinitionResponse = require ('../Model/DeleteQueuedMessagesForSendDefinitionResponse');
+const DeleteSendDefinitionResponse = require ('../Model/DeleteSendDefinitionResponse');
+const GetDefinitionSendStatusForRecipientResponse = require ('../Model/GetDefinitionSendStatusForRecipientResponse');
+const GetDefinitionsNotSentToRecipientsResponse = require ('../Model/GetDefinitionsNotSentToRecipientsResponse');
+const GetEmailDefinitionsResponse = require ('../Model/GetEmailDefinitionsResponse');
+const GetQueueMetricsForSendDefinitionResponse = require ('../Model/GetQueueMetricsForSendDefinitionResponse');
+const GetSmsDefinitionsResponse = require ('../Model/GetSmsDefinitionsResponse');
+const SendDefinitionToMultipleRecipientsResponse = require ('../Model/SendDefinitionToMultipleRecipientsResponse');
+const SendDefinitionToSingleRecipientResponse = require ('../Model/SendDefinitionToSingleRecipientResponse');
+const SendEmailToMultipleRecipientsRequest = require ('../Model/SendEmailToMultipleRecipientsRequest');
+const SendEmailToSingleRecipientRequest = require ('../Model/SendEmailToSingleRecipientRequest');
+const SendSmsToMultipleRecipientsRequest = require ('../Model/SendSmsToMultipleRecipientsRequest');
+const SendSmsToSingleRecipientRequest = require ('../Model/SendSmsToSingleRecipientRequest');
+const UpdateEmailDefinitionRequest = require ('../Model/UpdateEmailDefinitionRequest');
+const UpdateSmsDefinitionRequest = require ('../Model/UpdateSmsDefinitionRequest');
+const BaseApi = require('./BaseApi');
+
+/**
+* TransactionalMessaging service.
+* @module Api/TransactionalMessagingApi
+* @version 1.0.0
+*/
+module.exports = class TransactionalMessagingApi extends BaseApi {
+
+ /**
+ * Constructs a new TransactionalMessagingApi.
+ * @alias module:Api/TransactionalMessagingApi
+ * @class
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
+ * default to {@link module:ApiClient#instance} if unspecified.
+ */
+ constructor(authBaseUrl, clientId, clientSecret, accountId, scope) {
+ super(authBaseUrl, clientId, clientSecret, accountId, scope);
+ }
+
+
+
+ /**
+ * createEmailDefinition
+ * Creates the definition for an email.
+ * @param {module:Model/CreateEmailDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/CreateEmailDefinitionRequest} and HTTP response
+ */
+ createEmailDefinitionWithHttpInfo(caller, body) {
+ let postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling createEmailDefinition");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/definitions/', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * createEmailDefinition
+ * Creates the definition for an email.
+ * @param {module:Model/CreateEmailDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/CreateEmailDefinitionRequest}
+ */
+ createEmailDefinition(body) {
+ return this.createEmailDefinitionWithHttpInfo('createEmailDefinition', body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * createSmsDefinition
+ * Creates the definition for an SMS.
+ * @param {module:Model/CreateSmsDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/CreateSmsDefinitionRequest} and HTTP response
+ */
+ createSmsDefinitionWithHttpInfo(caller, body) {
+ let postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling createSmsDefinition");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/definitions', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * createSmsDefinition
+ * Creates the definition for an SMS.
+ * @param {module:Model/CreateSmsDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/CreateSmsDefinitionRequest}
+ */
+ createSmsDefinition(body) {
+ return this.createSmsDefinitionWithHttpInfo('createSmsDefinition', body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * deleteEmailDefinition
+ * Deletes an email definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.
+ * @param {String} definitionKey Unique identifier of the definition to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/DeleteSendDefinitionResponse} and HTTP response
+ */
+ deleteEmailDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling deleteEmailDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/definitions/{definitionKey}', 'DELETE',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * deleteEmailDefinition
+ * Deletes an email definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.
+ * @param {String} definitionKey Unique identifier of the definition to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/DeleteSendDefinitionResponse}
+ */
+ deleteEmailDefinition(definitionKey) {
+ return this.deleteEmailDefinitionWithHttpInfo('deleteEmailDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * deleteQueuedMessagesForEmailDefinition
+ * Deletes the queue for an email definition. The email definition must be in inactive status.
+ * @param {String} definitionKey Unique identifier of the email definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/DeleteQueuedMessagesForSendDefinitionResponse} and HTTP response
+ */
+ deleteQueuedMessagesForEmailDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling deleteQueuedMessagesForEmailDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/definitions/{definitionKey}/queue', 'DELETE',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * deleteQueuedMessagesForEmailDefinition
+ * Deletes the queue for an email definition. The email definition must be in inactive status.
+ * @param {String} definitionKey Unique identifier of the email definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/DeleteQueuedMessagesForSendDefinitionResponse}
+ */
+ deleteQueuedMessagesForEmailDefinition(definitionKey) {
+ return this.deleteQueuedMessagesForEmailDefinitionWithHttpInfo('deleteQueuedMessagesForEmailDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * deleteQueuedMessagesForSmsDefinition
+ * Deletes the queue for a SMS definition. The SMS definition must be in inactive status.
+ * @param {String} definitionKey Unique identifier of the SMS definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/DeleteQueuedMessagesForSendDefinitionResponse} and HTTP response
+ */
+ deleteQueuedMessagesForSmsDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling deleteQueuedMessagesForSmsDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/definitions/{definitionKey}/queue', 'DELETE',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * deleteQueuedMessagesForSmsDefinition
+ * Deletes the queue for a SMS definition. The SMS definition must be in inactive status.
+ * @param {String} definitionKey Unique identifier of the SMS definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/DeleteQueuedMessagesForSendDefinitionResponse}
+ */
+ deleteQueuedMessagesForSmsDefinition(definitionKey) {
+ return this.deleteQueuedMessagesForSmsDefinitionWithHttpInfo('deleteQueuedMessagesForSmsDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * deleteSmsDefinition
+ * Deletes an sms definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.
+ * @param {String} definitionKey Unique identifier of the definition to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/DeleteSendDefinitionResponse} and HTTP response
+ */
+ deleteSmsDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling deleteSmsDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/definitions/{definitionKey}', 'DELETE',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * deleteSmsDefinition
+ * Deletes an sms definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.
+ * @param {String} definitionKey Unique identifier of the definition to delete
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/DeleteSendDefinitionResponse}
+ */
+ deleteSmsDefinition(definitionKey) {
+ return this.deleteSmsDefinitionWithHttpInfo('deleteSmsDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getEmailDefinition
+ * Gets email definition configuration details for a definition key.
+ * @param {String} definitionKey Unique identifier of the definition to get
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/CreateEmailDefinitionRequest} and HTTP response
+ */
+ getEmailDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling getEmailDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/definitions/{definitionKey}', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getEmailDefinition
+ * Gets email definition configuration details for a definition key.
+ * @param {String} definitionKey Unique identifier of the definition to get
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/CreateEmailDefinitionRequest}
+ */
+ getEmailDefinition(definitionKey) {
+ return this.getEmailDefinitionWithHttpInfo('getEmailDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getEmailDefinitions
+ * Gets a list of email definitions.
+ * @param {Object} opts Optional parameters
+ * @param {module:Model/String} opts.status Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
+ * @param {Number} opts.pageSize Number of definitions, which are array elements, to return per paged response.
+ * @param {Number} opts.page Page number to return.
+ * @param {module:Model/String} opts.orderBy Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetEmailDefinitionsResponse} and HTTP response
+ */
+ getEmailDefinitionsWithHttpInfo(caller, opts) {
+ opts = opts || {};
+ let postBody = null;
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'status': opts['status'],
+ 'pageSize': opts['pageSize'],
+ 'page': opts['page'],
+ 'orderBy': opts['orderBy']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/definitions/', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getEmailDefinitions
+ * Gets a list of email definitions.
+ * @param {Object} opts Optional parameters
+ * @param {module:Model/String} opts.status Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
+ * @param {Number} opts.pageSize Number of definitions, which are array elements, to return per paged response.
+ * @param {Number} opts.page Page number to return.
+ * @param {module:Model/String} opts.orderBy Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetEmailDefinitionsResponse}
+ */
+ getEmailDefinitions(opts) {
+ return this.getEmailDefinitionsWithHttpInfo('getEmailDefinitions', opts)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getEmailSendStatusForRecipient
+ * Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.
+ * @param {String} messageKey Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide it in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetDefinitionSendStatusForRecipientResponse} and HTTP response
+ */
+ getEmailSendStatusForRecipientWithHttpInfo(caller, messageKey) {
+ let postBody = null;
+
+ // verify the required parameter 'messageKey' is set
+ if (messageKey === undefined || messageKey === null) {
+ throw new Error("Missing the required parameter 'messageKey' when calling getEmailSendStatusForRecipient");
+ }
+
+
+ let pathParams = {
+ 'messageKey': messageKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/messages/{messageKey}', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getEmailSendStatusForRecipient
+ * Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.
+ * @param {String} messageKey Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide it in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetDefinitionSendStatusForRecipientResponse}
+ */
+ getEmailSendStatusForRecipient(messageKey) {
+ return this.getEmailSendStatusForRecipientWithHttpInfo('getEmailSendStatusForRecipient', messageKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getEmailsNotSentToRecipients
+ * Gets a paginated list of messages that were not sent, ordered from oldest to newest.
+ * @param {String} type Only notSent is supported.
+ * @param {Object} opts Optional parameters
+ * @param {Number} opts.pageSize Number of messageKeys (array elements) to return per response page.
+ * @param {Number} opts.lastEventId Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetDefinitionsNotSentToRecipientsResponse} and HTTP response
+ */
+ getEmailsNotSentToRecipientsWithHttpInfo(caller, type, opts) {
+ opts = opts || {};
+ let postBody = null;
+
+ // verify the required parameter 'type' is set
+ if (type === undefined || type === null) {
+ throw new Error("Missing the required parameter 'type' when calling getEmailsNotSentToRecipients");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'type': type,
+ '$pageSize': opts['pageSize'],
+ 'lastEventId': opts['lastEventId']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/messages/', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getEmailsNotSentToRecipients
+ * Gets a paginated list of messages that were not sent, ordered from oldest to newest.
+ * @param {String} type Only notSent is supported.
+ * @param {Object} opts Optional parameters
+ * @param {Number} opts.pageSize Number of messageKeys (array elements) to return per response page.
+ * @param {Number} opts.lastEventId Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetDefinitionsNotSentToRecipientsResponse}
+ */
+ getEmailsNotSentToRecipients(type, opts) {
+ return this.getEmailsNotSentToRecipientsWithHttpInfo('getEmailsNotSentToRecipients', type, opts)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getQueueMetricsForEmailDefinition
+ * Gets metrics for the messages of an email definition. Applies to messages that are accepted but not yet processed.
+ * @param {String} definitionKey Unique identifier of the email definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetQueueMetricsForSendDefinitionResponse} and HTTP response
+ */
+ getQueueMetricsForEmailDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling getQueueMetricsForEmailDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/definitions/{definitionKey}/queue', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getQueueMetricsForEmailDefinition
+ * Gets metrics for the messages of an email definition. Applies to messages that are accepted but not yet processed.
+ * @param {String} definitionKey Unique identifier of the email definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetQueueMetricsForSendDefinitionResponse}
+ */
+ getQueueMetricsForEmailDefinition(definitionKey) {
+ return this.getQueueMetricsForEmailDefinitionWithHttpInfo('getQueueMetricsForEmailDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getQueueMetricsForSmsDefinition
+ * Gets metrics for the messages of a SMS definition. Applies to messages that are accepted but not yet processed.
+ * @param {String} definitionKey Unique identifier of the SMS definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetQueueMetricsForSendDefinitionResponse} and HTTP response
+ */
+ getQueueMetricsForSmsDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling getQueueMetricsForSmsDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/definitions/{definitionKey}/queue', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getQueueMetricsForSmsDefinition
+ * Gets metrics for the messages of a SMS definition. Applies to messages that are accepted but not yet processed.
+ * @param {String} definitionKey Unique identifier of the SMS definition
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetQueueMetricsForSendDefinitionResponse}
+ */
+ getQueueMetricsForSmsDefinition(definitionKey) {
+ return this.getQueueMetricsForSmsDefinitionWithHttpInfo('getQueueMetricsForSmsDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getSMSsNotSentToRecipients
+ * Gets a paginated list of messages that were not sent, ordered from oldest to newest.
+ * @param {String} type Only notSent is supported.
+ * @param {Object} opts Optional parameters
+ * @param {Number} opts.pageSize Number of messageKeys (array elements) to return per response page.
+ * @param {Number} opts.lastEventId Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetDefinitionsNotSentToRecipientsResponse} and HTTP response
+ */
+ getSMSsNotSentToRecipientsWithHttpInfo(caller, type, opts) {
+ opts = opts || {};
+ let postBody = null;
+
+ // verify the required parameter 'type' is set
+ if (type === undefined || type === null) {
+ throw new Error("Missing the required parameter 'type' when calling getSMSsNotSentToRecipients");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'type': type,
+ '$pageSize': opts['pageSize'],
+ 'lastEventId': opts['lastEventId']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/messages/', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getSMSsNotSentToRecipients
+ * Gets a paginated list of messages that were not sent, ordered from oldest to newest.
+ * @param {String} type Only notSent is supported.
+ * @param {Object} opts Optional parameters
+ * @param {Number} opts.pageSize Number of messageKeys (array elements) to return per response page.
+ * @param {Number} opts.lastEventId Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetDefinitionsNotSentToRecipientsResponse}
+ */
+ getSMSsNotSentToRecipients(type, opts) {
+ return this.getSMSsNotSentToRecipientsWithHttpInfo('getSMSsNotSentToRecipients', type, opts)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getSmsDefinition
+ * Gets SMS definition configuration details for a definition key.
+ * @param {String} definitionKey Unique identifier of the definition to get
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/CreateSmsDefinitionRequest} and HTTP response
+ */
+ getSmsDefinitionWithHttpInfo(caller, definitionKey) {
+ let postBody = null;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling getSmsDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/definitions/{definitionKey}', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getSmsDefinition
+ * Gets SMS definition configuration details for a definition key.
+ * @param {String} definitionKey Unique identifier of the definition to get
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/CreateSmsDefinitionRequest}
+ */
+ getSmsDefinition(definitionKey) {
+ return this.getSmsDefinitionWithHttpInfo('getSmsDefinition', definitionKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getSmsDefinitions
+ * Gets a list of SMS definitions.
+ * @param {Object} opts Optional parameters
+ * @param {module:Model/String} opts.status Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
+ * @param {Number} opts.pageSize Number of definitions, which are array elements, to return per paged response.
+ * @param {Number} opts.page Page number to return.
+ * @param {module:Model/String} opts.orderBy Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetSmsDefinitionsResponse} and HTTP response
+ */
+ getSmsDefinitionsWithHttpInfo(caller, opts) {
+ opts = opts || {};
+ let postBody = null;
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'status': opts['status'],
+ 'pageSize': opts['pageSize'],
+ 'page': opts['page'],
+ 'orderBy': opts['orderBy']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/definitions', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getSmsDefinitions
+ * Gets a list of SMS definitions.
+ * @param {Object} opts Optional parameters
+ * @param {module:Model/String} opts.status Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
+ * @param {Number} opts.pageSize Number of definitions, which are array elements, to return per paged response.
+ * @param {Number} opts.page Page number to return.
+ * @param {module:Model/String} opts.orderBy Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetSmsDefinitionsResponse}
+ */
+ getSmsDefinitions(opts) {
+ return this.getSmsDefinitionsWithHttpInfo('getSmsDefinitions', opts)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * getSmsSendStatusForRecipient
+ * Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.
+ * @param {String} messageKey Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide message key in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/GetDefinitionSendStatusForRecipientResponse} and HTTP response
+ */
+ getSmsSendStatusForRecipientWithHttpInfo(caller, messageKey) {
+ let postBody = null;
+
+ // verify the required parameter 'messageKey' is set
+ if (messageKey === undefined || messageKey === null) {
+ throw new Error("Missing the required parameter 'messageKey' when calling getSmsSendStatusForRecipient");
+ }
+
+
+ let pathParams = {
+ 'messageKey': messageKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/messages/{messageKey}', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * getSmsSendStatusForRecipient
+ * Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.
+ * @param {String} messageKey Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide message key in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/GetDefinitionSendStatusForRecipientResponse}
+ */
+ getSmsSendStatusForRecipient(messageKey) {
+ return this.getSmsSendStatusForRecipientWithHttpInfo('getSmsSendStatusForRecipient', messageKey)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * partiallyUpdateEmailDefinition
+ * Updates a specific email definition.
+ * @param {String} definitionKey Unique identifier of the definition.
+ * @param {module:Model/UpdateEmailDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/CreateEmailDefinitionRequest} and HTTP response
+ */
+ partiallyUpdateEmailDefinitionWithHttpInfo(caller, definitionKey, body) {
+ let postBody = body;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling partiallyUpdateEmailDefinition");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling partiallyUpdateEmailDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/definitions/{definitionKey}', 'PATCH',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * partiallyUpdateEmailDefinition
+ * Updates a specific email definition.
+ * @param {String} definitionKey Unique identifier of the definition.
+ * @param {module:Model/UpdateEmailDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/CreateEmailDefinitionRequest}
+ */
+ partiallyUpdateEmailDefinition(definitionKey, body) {
+ return this.partiallyUpdateEmailDefinitionWithHttpInfo('partiallyUpdateEmailDefinition', definitionKey, body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * partiallyUpdateSmsDefinition
+ * Updates a specific SMS definition.
+ * @param {String} definitionKey Unique identifier of the definition.
+ * @param {module:Model/UpdateSmsDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/CreateSmsDefinitionRequest} and HTTP response
+ */
+ partiallyUpdateSmsDefinitionWithHttpInfo(caller, definitionKey, body) {
+ let postBody = body;
+
+ // verify the required parameter 'definitionKey' is set
+ if (definitionKey === undefined || definitionKey === null) {
+ throw new Error("Missing the required parameter 'definitionKey' when calling partiallyUpdateSmsDefinition");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling partiallyUpdateSmsDefinition");
+ }
+
+
+ let pathParams = {
+ 'definitionKey': definitionKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/definitions/{definitionKey}', 'PATCH',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * partiallyUpdateSmsDefinition
+ * Updates a specific SMS definition.
+ * @param {String} definitionKey Unique identifier of the definition.
+ * @param {module:Model/UpdateSmsDefinitionRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/CreateSmsDefinitionRequest}
+ */
+ partiallyUpdateSmsDefinition(definitionKey, body) {
+ return this.partiallyUpdateSmsDefinitionWithHttpInfo('partiallyUpdateSmsDefinition', definitionKey, body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * sendEmailToMultipleRecipients
+ * Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.
+ * @param {module:Model/SendEmailToMultipleRecipientsRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/SendDefinitionToMultipleRecipientsResponse} and HTTP response
+ */
+ sendEmailToMultipleRecipientsWithHttpInfo(caller, body) {
+ let postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling sendEmailToMultipleRecipients");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/messages/', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * sendEmailToMultipleRecipients
+ * Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.
+ * @param {module:Model/SendEmailToMultipleRecipientsRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/SendDefinitionToMultipleRecipientsResponse}
+ */
+ sendEmailToMultipleRecipients(body) {
+ return this.sendEmailToMultipleRecipientsWithHttpInfo('sendEmailToMultipleRecipients', body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * sendEmailToSingleRecipient
+ * Sends a message to a single recipient via an email definition using a messageKey path parameter.
+ * @param {String} messageKey Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
+ * @param {module:Model/SendEmailToSingleRecipientRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/SendDefinitionToSingleRecipientResponse} and HTTP response
+ */
+ sendEmailToSingleRecipientWithHttpInfo(caller, messageKey, body) {
+ let postBody = body;
+
+ // verify the required parameter 'messageKey' is set
+ if (messageKey === undefined || messageKey === null) {
+ throw new Error("Missing the required parameter 'messageKey' when calling sendEmailToSingleRecipient");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling sendEmailToSingleRecipient");
+ }
+
+
+ let pathParams = {
+ 'messageKey': messageKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/email/messages/{messageKey}', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * sendEmailToSingleRecipient
+ * Sends a message to a single recipient via an email definition using a messageKey path parameter.
+ * @param {String} messageKey Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
+ * @param {module:Model/SendEmailToSingleRecipientRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/SendDefinitionToSingleRecipientResponse}
+ */
+ sendEmailToSingleRecipient(messageKey, body) {
+ return this.sendEmailToSingleRecipientWithHttpInfo('sendEmailToSingleRecipient', messageKey, body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * sendSmsToMultipleRecipients
+ * Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.
+ * @param {module:Model/SendSmsToMultipleRecipientsRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/SendDefinitionToMultipleRecipientsResponse} and HTTP response
+ */
+ sendSmsToMultipleRecipientsWithHttpInfo(caller, body) {
+ let postBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling sendSmsToMultipleRecipients");
+ }
+
+
+ let pathParams = {
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/messages/', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * sendSmsToMultipleRecipients
+ * Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.
+ * @param {module:Model/SendSmsToMultipleRecipientsRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/SendDefinitionToMultipleRecipientsResponse}
+ */
+ sendSmsToMultipleRecipients(body) {
+ return this.sendSmsToMultipleRecipientsWithHttpInfo('sendSmsToMultipleRecipients', body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+ /**
+ * sendSmsToSingleRecipient
+ * Sends a message to a single recipient via a SMS definition using a messageKey path parameter.
+ * @param {String} messageKey Unique identifier of the definition used to track message status. The messageKey can be created automatically when you create a message, or you can provide it as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
+ * @param {module:Model/SendSmsToSingleRecipientRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:Model/SendDefinitionToSingleRecipientResponse} and HTTP response
+ */
+ sendSmsToSingleRecipientWithHttpInfo(caller, messageKey, body) {
+ let postBody = body;
+
+ // verify the required parameter 'messageKey' is set
+ if (messageKey === undefined || messageKey === null) {
+ throw new Error("Missing the required parameter 'messageKey' when calling sendSmsToSingleRecipient");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body === undefined || body === null) {
+ throw new Error("Missing the required parameter 'body' when calling sendSmsToSingleRecipient");
+ }
+
+
+ let pathParams = {
+ 'messageKey': messageKey
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authName = '';
+ let contentTypes = [];
+ let accepts = [];
+ let returnType = Object;
+
+ return this.apiClient.callApi(
+ '/messaging/v1/sms/messages/{messageKey}', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authName, contentTypes, accepts, returnType, caller
+ );
+ }
+
+ /**
+ * sendSmsToSingleRecipient
+ * Sends a message to a single recipient via a SMS definition using a messageKey path parameter.
+ * @param {String} messageKey Unique identifier of the definition used to track message status. The messageKey can be created automatically when you create a message, or you can provide it as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
+ * @param {module:Model/SendSmsToSingleRecipientRequest} body JSON Parameters
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:Model/SendDefinitionToSingleRecipientResponse}
+ */
+ sendSmsToSingleRecipient(messageKey, body) {
+ return this.sendSmsToSingleRecipientWithHttpInfo('sendSmsToSingleRecipient', messageKey, body)
+ .then(function(response_and_data) {
+ return response_and_data.data;
+ });
+ }
+
+
+}
diff --git a/src/ApiClient.js b/src/ApiClient.js
new file mode 100644
index 0000000..09fc609
--- /dev/null
+++ b/src/ApiClient.js
@@ -0,0 +1,554 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const superagent = require ('superagent');
+const querystring = require ('querystring');
+const Authentication = require('../src/Auth/Authentication');
+const ApiExceptionFactory = require('./Exception/ApiExceptionFactory');
+
+/**
+* @module ApiClient
+* @version 1.0.0
+*/
+
+/**
+* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
+* application to use this class directly - the *Api and model classes provide the public API for the service. The
+* contents of this file should be regarded as internal but are documented for completeness.
+* @alias module:ApiClient
+* @class
+*/
+
+class ApiClient {
+ constructor(runtimeInformationProvider) {
+ this.runtimeInformationProvider = runtimeInformationProvider;
+ /**
+ * The base URL against which to resolve every API call's (relative) path.
+ * @type {String}
+ * @default https://www.exacttargetapis.com
+ */
+ this.basePath = 'https://www.exacttargetapis.com'.replace(/\/+$/, '');
+
+ /**
+ * The authentication method to be included for all API calls.
+ */
+ this.authentication = {
+ 'oauth2' : new Authentication()
+ }
+
+ /**
+ * The default HTTP headers to be included for all API calls.
+ * @type {Array.
+* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
+* param
.
+ */
+ paramToString(param) {
+ if (param == undefined || param == null) {
+ return '';
+ }
+ if (param instanceof Date) {
+ return param.toJSON();
+ }
+
+ return param.toString();
+ }
+
+ /**
+ * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
+ * NOTE: query parameters are not handled here.
+ * @param {String} path The path to append to the base URL.
+ * @param {Object} pathParams The parameter values to append.
+ * @returns {String} The encoded path with parameter values substituted.
+ */
+ buildUrl(path, pathParams) {
+ if (!path.match(/^\//)) {
+ path = '/' + path;
+ }
+
+ var url = this.basePath + path;
+ url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => {
+ var value;
+ if (pathParams.hasOwnProperty(key)) {
+ value = this.paramToString(pathParams[key]);
+ } else {
+ value = fullMatch;
+ }
+
+ return encodeURIComponent(value);
+ });
+
+ return url;
+ }
+
+ /**
+ * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
+ *
+ * @param {String} contentType The MIME content type to check.
+ * @returns {Boolean} true
if contentType
represents JSON, otherwise false
.
+ */
+ isJsonMime(contentType) {
+ return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
+ }
+
+ /**
+ * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
+ * @param {Array.true
if param
represents a file.
+ */
+ isFileParam(param) {
+ // fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
+ if (typeof require === 'function') {
+ let fs;
+ try {
+ fs = require('fs');
+ } catch (err) {}
+ if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
+ return true;
+ }
+ }
+
+ // Buffer in Node.js
+ if (typeof Buffer === 'function' && param instanceof Buffer) {
+ return true;
+ }
+
+ // Blob in browser
+ if (typeof Blob === 'function' && param instanceof Blob) {
+ return true;
+ }
+
+ // File in browser (it seems File object is also instance of Blob, but keep this for safe)
+ if (typeof File === 'function' && param instanceof File) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Normalizes parameter values:
+ *
+ *
+ * @param {Object.csv
+ * @const
+ */
+ CSV: ',',
+
+ /**
+ * Space-separated values. Value: ssv
+ * @const
+ */
+ SSV: ' ',
+
+ /**
+ * Tab-separated values. Value: tsv
+ * @const
+ */
+ TSV: '\t',
+
+ /**
+ * Pipe(|)-separated values. Value: pipes
+ * @const
+ */
+ PIPES: '|',
+
+ /**
+ * Native array. Value: multi
+ * @const
+ */
+ MULTI: 'multi'
+ };
+
+ /**
+ * Builds a string representation of an array-type actual parameter, according to the given collection format.
+ * @param {Array} param An array parameter.
+ * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
+ * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
+ * param
as is if collectionFormat
is multi
.
+ */
+ buildCollectionParam(param, collectionFormat) {
+ if (param == null) {
+ return null;
+ }
+ switch (collectionFormat) {
+ case 'csv':
+ return param.map(this.paramToString).join(',');
+ case 'ssv':
+ return param.map(this.paramToString).join(' ');
+ case 'tsv':
+ return param.map(this.paramToString).join('\t');
+ case 'pipes':
+ return param.map(this.paramToString).join('|');
+ case 'multi':
+ //return the array directly as SuperAgent will handle it as expected
+ return param.map(this.paramToString);
+ default:
+ throw new Error('Unknown collection format: ' + collectionFormat);
+ }
+ }
+
+ /**
+ * Applies authentication headers to the request.
+ * @param {Object} request The request object created by a superagent()
call.
+ * @param {String} authName String representing authentication method name.
+ */
+ applyAuthToRequest(request, authName) {
+ var auth = this.authentication[authName];
+
+ if (auth.type === 'oauth2'){
+ if (auth.accessToken) {
+ request.set({'Authorization': 'Bearer ' + auth.accessToken});
+ }
+ }
+ else{
+ throw new Error('Unknown authentication type: ' + auth.type);
+ }
+ }
+
+ /**
+ * Deserializes an HTTP response body into a value of the specified type.
+ * @param {Object} response A SuperAgent response object.
+ * @param {(String|Array.data
will be converted to this type.
+ * @returns A value of the specified type.
+ */
+ deserialize(response, returnType) {
+ if (response == null || returnType == null || response.status == 204) {
+ return null;
+ }
+
+ // Rely on SuperAgent for parsing response body.
+ // See http://visionmedia.github.io/superagent/#parsing-response-bodies
+ var data = response.body;
+ if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) {
+ // SuperAgent does not always produce a body; use the unparsed response as a fallback
+ data = response.text;
+ }
+
+ return ApiClient.convertToType(data, returnType);
+ }
+
+
+
+ /**
+ * Invokes the REST service using the supplied settings and parameters.
+ * @param {String} path The base URL to invoke.
+ * @param {String} httpMethod The HTTP method to use.
+ * @param {Object.
data
will be converted to this type.
+ * @returns An instance of the specified type or null or undefined if data is null or undefined.
+ */
+ static convertToType(data, type) {
+ if (data === null || data === undefined)
+ return data
+
+ switch (type) {
+ case 'Boolean':
+ return Boolean(data);
+ case 'Integer':
+ return parseInt(data, 10);
+ case 'Number':
+ return parseFloat(data);
+ case 'String':
+ return String(data);
+ case 'Date':
+ return ApiClient.parseDate(String(data));
+ case 'Blob':
+ return data;
+ default:
+ if (type === Object) {
+ // generic object, return directly
+ return data;
+ } else if (typeof type === 'function') {
+ // for model type like: User
+ return type.constructFromObject(data);
+ } else if (Array.isArray(type)) {
+ // for array type like: ['String']
+ var itemType = type[0];
+
+ return data.map((item) => {
+ return ApiClient.convertToType(item, itemType);
+ });
+ } else if (typeof type === 'object') {
+ // for plain object type like: {'String': 'Integer'}
+ var keyType, valueType;
+ for (var k in type) {
+ if (type.hasOwnProperty(k)) {
+ keyType = k;
+ valueType = type[k];
+ break;
+ }
+ }
+
+ var result = {};
+ for (var k in data) {
+ if (data.hasOwnProperty(k)) {
+ var key = ApiClient.convertToType(k, keyType);
+ var value = ApiClient.convertToType(data[k], valueType);
+ result[key] = value;
+ }
+ }
+
+ return result;
+ } else {
+ // for unknown type, return the data directly
+ return data;
+ }
+ }
+ }
+
+ /**
+ * Constructs a new map or array model from REST data.
+ * @param data {Object|Array} The REST data.
+ * @param obj {Object|Array} The target object or array.
+ */
+ static constructFromObject(data, obj, itemType) {
+ if (Array.isArray(data)) {
+ for (var i = 0; i < data.length; i++) {
+ if (data.hasOwnProperty(i))
+ obj[i] = ApiClient.convertToType(data[i], itemType);
+ }
+ } else {
+ for (var k in data) {
+ if (data.hasOwnProperty(k))
+ obj[k] = ApiClient.convertToType(data[k], itemType);
+ }
+ }
+ };
+}
+
+/**
+* The default API client implementation.
+* @type {module:ApiClient}
+*/
+
+module.exports = ApiClient;
\ No newline at end of file
diff --git a/src/Auth/AuthService.js b/src/Auth/AuthService.js
new file mode 100644
index 0000000..3401e27
--- /dev/null
+++ b/src/Auth/AuthService.js
@@ -0,0 +1,59 @@
+const RuntimeInformationProvider = require('../RuntimeInformationProvider');
+
+class AuthService{
+ constructor(clientConfig, apiClient, cacheService){
+ this.clientConfig = clientConfig;
+ this.apiClient = apiClient;
+ this.cacheService = cacheService;
+ }
+
+ async getTokenResponse() {
+
+ let cacheKey = this.getCacheKey();
+ let cachedTokenResponse = this.cacheService.get(cacheKey);
+
+ if(!cachedTokenResponse){
+ this.apiClient.basePath = this.clientConfig.authBaseUrl;
+
+ let authRequestResponse = await this.apiClient.callApi('v2/token',
+ 'POST',
+ {},
+ {},
+ {'User-Agent': new RuntimeInformationProvider().getUserAgentString()},
+ {},
+ this.getTokenRequestPayload(),
+ 'oauth2',
+ [],
+ [],
+ Object,
+ 'getTokenResponse'
+ );
+
+ this.cacheService.addOrUpdate(cacheKey, authRequestResponse.data);
+
+ return authRequestResponse.data;
+ }
+ else{
+ return cachedTokenResponse.tokenResponse;
+ }
+ }
+
+ getCacheKey(){
+ return this.clientConfig.clientId + '-' + this.clientConfig.accountId;
+ }
+
+ getTokenRequestPayload(){
+ let tokenRequestPayload = {
+ 'client_id': this.clientConfig.clientId,
+ 'client_secret': this.clientConfig.clientSecret,
+ 'grant_type': 'client_credentials',
+ 'account_id': this.clientConfig.accountId
+ };
+ if (this.clientConfig.scope) {
+ tokenRequestPayload['scope'] = this.clientConfig.scope;
+ }
+ return tokenRequestPayload;
+ }
+}
+
+module.exports = AuthService;
\ No newline at end of file
diff --git a/src/Auth/Authentication.js b/src/Auth/Authentication.js
new file mode 100644
index 0000000..c4598ce
--- /dev/null
+++ b/src/Auth/Authentication.js
@@ -0,0 +1,18 @@
+class Authentication {
+ constructor(){
+ this._accessToken = undefined;
+ this._type = "oauth2";
+ }
+
+ get accessToken() {
+ return this._accessToken;
+ }
+ set accessToken(value) {
+ this._accessToken = value;
+ }
+ get type() {
+ return this._type;
+ }
+}
+
+module.exports = Authentication;
\ No newline at end of file
diff --git a/src/Auth/CacheService.js b/src/Auth/CacheService.js
new file mode 100644
index 0000000..4e5617c
--- /dev/null
+++ b/src/Auth/CacheService.js
@@ -0,0 +1,26 @@
+class CacheService {
+ static cachedData = {};
+
+ get(cacheKey) {
+ if (CacheService.cachedData.hasOwnProperty(cacheKey) && this.isCachedValueValid(cacheKey)) {
+ return CacheService.cachedData[cacheKey];
+ }
+ return null;
+ }
+
+ addOrUpdate(cacheKey, value) {
+ let invalidCacheWindowInSeconds = 30;
+ let expirationTime = new Date().getTime() + (value.expires_in - invalidCacheWindowInSeconds) * 1000;
+
+ CacheService.cachedData[cacheKey] = {
+ expirationTime: expirationTime,
+ tokenResponse: value
+ }
+ }
+
+ isCachedValueValid(cacheKey) {
+ return new Date().getTime() < CacheService.cachedData[cacheKey].expirationTime;
+ }
+}
+
+module.exports = CacheService;
\ No newline at end of file
diff --git a/src/Auth/ClientConfiguration.js b/src/Auth/ClientConfiguration.js
new file mode 100644
index 0000000..5af5241
--- /dev/null
+++ b/src/Auth/ClientConfiguration.js
@@ -0,0 +1,30 @@
+class ClientConfiguration{
+ constructor(authBaseUrl, clientId, clientSecret, accountId, scope){
+ this._authBaseUrl = authBaseUrl;
+ this._clientId = clientId;
+ this._clientSecret = clientSecret;
+ this._accountId = accountId;
+ this._scope = scope;
+ }
+ get authBaseUrl() {
+ return this._authBaseUrl;
+ }
+
+ get clientId() {
+ return this._clientId;
+ }
+
+ get clientSecret() {
+ return this._clientSecret;
+ }
+
+ get accountId() {
+ return this._accountId;
+ }
+
+ get scope() {
+ return this._scope;
+ }
+}
+
+module.exports = ClientConfiguration;
\ No newline at end of file
diff --git a/src/EnvironmentConfigProvider.js b/src/EnvironmentConfigProvider.js
new file mode 100644
index 0000000..24c0322
--- /dev/null
+++ b/src/EnvironmentConfigProvider.js
@@ -0,0 +1,17 @@
+const EnvironmentVariableNotSetException = require('./Exception/EnvironmentVariableNotSetException');
+
+class EnvironmentConfigProvider {
+ get(envVariable, isMandatory = true) {
+ let envVariableValue = process.env[envVariable];
+
+ if (envVariableValue) {
+ return envVariableValue;
+ }
+ if (isMandatory) {
+ throw new EnvironmentVariableNotSetException(envVariable);
+ }
+ return null;
+ }
+}
+
+module.exports = EnvironmentConfigProvider;
\ No newline at end of file
diff --git a/src/Exception/ApiException.js b/src/Exception/ApiException.js
new file mode 100644
index 0000000..56e8483
--- /dev/null
+++ b/src/Exception/ApiException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class ApiException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = ApiException;
+
diff --git a/src/Exception/ApiExceptionFactory.js b/src/Exception/ApiExceptionFactory.js
new file mode 100644
index 0000000..29f7aa2
--- /dev/null
+++ b/src/Exception/ApiExceptionFactory.js
@@ -0,0 +1,50 @@
+const BadRequestException = require('./BadRequestException');
+const AuthenticationFailureException = require('./AuthenticationFailureException');
+const UnauthorizedAccessException = require('./UnauthorizedAccessException');
+const ResourceNotFoundException = require('./ResourceNotFoundException');
+const InternalServerErrorException = require('./InternalServerErrorException');
+const BadGatewayException = require('./BadGatewayException');
+const ServiceUnavailableException = require('./ServiceUnavailableException');
+const GatewayTimeoutException = require('./GatewayTimeoutException');
+const ServerUnreachableException = require('./ServerUnreachableException');
+const ApiException = require('./ApiException');
+
+class ApiExceptionFactory {
+ static createCustomException(caller, error) {
+ let statusCode = error.status;
+ let exceptionMessage;
+
+ if (statusCode >= 400) {
+
+ exceptionMessage = `Error calling ${caller}: ${JSON.stringify(error.response.body)}`;
+
+ switch (statusCode) {
+ case 400:
+ return new BadRequestException(exceptionMessage, statusCode);
+ case 401:
+ return new AuthenticationFailureException(exceptionMessage, statusCode);
+ case 403:
+ return new UnauthorizedAccessException(exceptionMessage, statusCode);
+ case 404:
+ return new ResourceNotFoundException(exceptionMessage, statusCode);
+ case 500:
+ return new InternalServerErrorException(exceptionMessage, statusCode);
+ case 502:
+ return new BadGatewayException(exceptionMessage, statusCode);
+ case 503:
+ return new ServiceUnavailableException(exceptionMessage, statusCode);
+ case 504:
+ return new GatewayTimeoutException(exceptionMessage, statusCode);
+ default:
+ return new ApiException(exceptionMessage, statusCode);
+ }
+ }
+ if(statusCode === undefined){
+ exceptionMessage = `Error calling ${caller}: ${JSON.stringify(error)}`;
+
+ return new ServerUnreachableException(exceptionMessage);
+ }
+ }
+}
+
+module.exports = ApiExceptionFactory;
\ No newline at end of file
diff --git a/src/Exception/AuthenticationFailureException.js b/src/Exception/AuthenticationFailureException.js
new file mode 100644
index 0000000..2e8e8d0
--- /dev/null
+++ b/src/Exception/AuthenticationFailureException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class AuthenticationFailureException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = AuthenticationFailureException;
+
diff --git a/src/Exception/BadGatewayException.js b/src/Exception/BadGatewayException.js
new file mode 100644
index 0000000..a2996eb
--- /dev/null
+++ b/src/Exception/BadGatewayException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class BadGatewayException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = BadGatewayException;
+
diff --git a/src/Exception/BadRequestException.js b/src/Exception/BadRequestException.js
new file mode 100644
index 0000000..ad4f312
--- /dev/null
+++ b/src/Exception/BadRequestException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class BadRequestException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = BadRequestException;
+
diff --git a/src/Exception/BaseApiException.js b/src/Exception/BaseApiException.js
new file mode 100644
index 0000000..c41631a
--- /dev/null
+++ b/src/Exception/BaseApiException.js
@@ -0,0 +1,10 @@
+class BaseApiException extends Error {
+ constructor(exceptionMessage, statusCode) {
+ super();
+ this.message = exceptionMessage;
+ this.status = statusCode;
+ }
+}
+
+module.exports = BaseApiException;
+
diff --git a/src/Exception/EnvironmentVariableNotSetException.js b/src/Exception/EnvironmentVariableNotSetException.js
new file mode 100644
index 0000000..3681fcb
--- /dev/null
+++ b/src/Exception/EnvironmentVariableNotSetException.js
@@ -0,0 +1,10 @@
+class EnvironmentVariableNotSetException extends Error {
+ constructor(envVariable) {
+ super();
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ this.message = `Environment variable ${envVariable} is not set`;
+ }
+}
+
+module.exports = EnvironmentVariableNotSetException;
+
diff --git a/src/Exception/GatewayTimeoutException.js b/src/Exception/GatewayTimeoutException.js
new file mode 100644
index 0000000..61417b1
--- /dev/null
+++ b/src/Exception/GatewayTimeoutException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class GatewayTimeoutException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = GatewayTimeoutException;
+
diff --git a/src/Exception/InternalServerErrorException.js b/src/Exception/InternalServerErrorException.js
new file mode 100644
index 0000000..bdfaa90
--- /dev/null
+++ b/src/Exception/InternalServerErrorException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class InternalServerErrorException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = InternalServerErrorException;
+
diff --git a/src/Exception/InvalidModelException.js b/src/Exception/InvalidModelException.js
new file mode 100644
index 0000000..293bf10
--- /dev/null
+++ b/src/Exception/InvalidModelException.js
@@ -0,0 +1,9 @@
+class InvalidModelException extends Error {
+ constructor(exceptionMessage) {
+ super();
+ this.message = exceptionMessage;
+ }
+}
+
+module.exports = InvalidModelException;
+
diff --git a/src/Exception/ResourceNotFoundException.js b/src/Exception/ResourceNotFoundException.js
new file mode 100644
index 0000000..5327912
--- /dev/null
+++ b/src/Exception/ResourceNotFoundException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class ResourceNotFoundException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = ResourceNotFoundException;
+
diff --git a/src/Exception/ServerUnreachableException.js b/src/Exception/ServerUnreachableException.js
new file mode 100644
index 0000000..7de19b8
--- /dev/null
+++ b/src/Exception/ServerUnreachableException.js
@@ -0,0 +1,10 @@
+class ServerUnreachableException extends Error {
+ constructor(exceptionMessage) {
+ super();
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ this.message = exceptionMessage;
+ }
+}
+
+module.exports = ServerUnreachableException;
+
diff --git a/src/Exception/ServiceUnavailableException.js b/src/Exception/ServiceUnavailableException.js
new file mode 100644
index 0000000..d35fc51
--- /dev/null
+++ b/src/Exception/ServiceUnavailableException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class ServiceUnavailableException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = ServiceUnavailableException;
+
diff --git a/src/Exception/UnauthorizedAccessException.js b/src/Exception/UnauthorizedAccessException.js
new file mode 100644
index 0000000..cc3e2c6
--- /dev/null
+++ b/src/Exception/UnauthorizedAccessException.js
@@ -0,0 +1,11 @@
+const BaseApiException = require('./BaseApiException');
+
+class UnauthorizedAccessException extends BaseApiException {
+ constructor(exceptionMessage, statusCode) {
+ super(exceptionMessage, statusCode);
+ this.name = 'Salesforce.MarketingCloud.Exceptions.' + this.constructor.name;
+ }
+}
+
+module.exports = UnauthorizedAccessException;
+
diff --git a/src/Model/ApiError.js b/src/Model/ApiError.js
new file mode 100644
index 0000000..6b91bbd
--- /dev/null
+++ b/src/Model/ApiError.js
@@ -0,0 +1,95 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The ApiError model module.
+* @module Model/ApiError
+* @version 1.0.0
+*/
+module.exports = class ApiError{
+ /**
+ * Constructs a new
ApiError
.
+ * @alias module:Model/ApiError
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+ }
+
+ /**
+ * Constructs a ApiError
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/ApiError} obj Optional instance to populate.
+ * @return {module:Model/ApiError} The populated ApiError
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new ApiError();
+
+
+
+
+
+ if (data.hasOwnProperty('message')) {
+ obj['message'] = ApiClient.convertToType(data['message'], 'String');
+ }
+ if (data.hasOwnProperty('errorCode')) {
+ obj['errorCode'] = ApiClient.convertToType(data['errorCode'], 'Number');
+ }
+ if (data.hasOwnProperty('documentation')) {
+ obj['documentation'] = ApiClient.convertToType(data['documentation'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The error message
+ * @member {String} message
+ */
+ message = undefined;
+ /**
+ * The specific error code
+ * @member {Number} errorCode
+ */
+ errorCode = undefined;
+ /**
+ * Any specific documentation for the error
+ * @member {String} documentation
+ */
+ documentation = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/Asset.js b/src/Model/Asset.js
new file mode 100644
index 0000000..64aa7a6
--- /dev/null
+++ b/src/Model/Asset.js
@@ -0,0 +1,344 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const AssetType = require ('./AssetType');
+const SharingProperties = require ('./SharingProperties');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The Asset model module.
+* @module Model/Asset
+* @version 1.0.0
+*/
+module.exports = class Asset{
+ /**
+ * Constructs a new Asset
.
+ * @alias module:Model/Asset
+ * @class
+ * @param customerKey {String} Reference to customer's private ID/name for the asset
+ * @param assetType {module:Model/AssetType}
+ * @param name {String} Name of the asset, set by the client
+ * @param description {String} Description of the asset, set by the client
+ */
+
+ constructor(customerKey, assetType, name, description) {
+
+
+ // verify the required parameter 'customerKey' is set
+ if(customerKey === undefined || customerKey === null){
+ throw new InvalidModelException('"customerKey" is a required property for Asset and cannot be undefined or null');
+ }
+ this['customerKey'] = customerKey;
+
+
+
+ // verify the required parameter 'assetType' is set
+ if(assetType === undefined || assetType === null){
+ throw new InvalidModelException('"assetType" is a required property for Asset and cannot be undefined or null');
+ }
+ this['assetType'] = assetType;
+
+
+
+
+ // verify the required parameter 'name' is set
+ if(name === undefined || name === null){
+ throw new InvalidModelException('"name" is a required property for Asset and cannot be undefined or null');
+ }
+ this['name'] = name;
+
+ // verify the required parameter 'description' is set
+ if(description === undefined || description === null){
+ throw new InvalidModelException('"description" is a required property for Asset and cannot be undefined or null');
+ }
+ this['description'] = description;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a Asset
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/Asset} obj Optional instance to populate.
+ * @return {module:Model/Asset} The populated Asset
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new Asset();
+
+
+
+
+
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'Number');
+ }
+ if (data.hasOwnProperty('customerKey')) {
+ obj['customerKey'] = ApiClient.convertToType(data['customerKey'], 'String');
+ }
+ if (data.hasOwnProperty('contentType')) {
+ obj['contentType'] = ApiClient.convertToType(data['contentType'], 'String');
+ }
+ if (data.hasOwnProperty('data')) {
+ obj['data'] = ApiClient.convertToType(data['data'], Object);
+ }
+ if (data.hasOwnProperty('assetType')) {
+ obj['assetType'] = AssetType.constructFromObject(data['assetType']);
+ }
+ if (data.hasOwnProperty('version')) {
+ obj['version'] = ApiClient.convertToType(data['version'], 'Number');
+ }
+ if (data.hasOwnProperty('locked')) {
+ obj['locked'] = ApiClient.convertToType(data['locked'], 'Boolean');
+ }
+ if (data.hasOwnProperty('fileProperties')) {
+ obj['fileProperties'] = ApiClient.convertToType(data['fileProperties'], Object);
+ }
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('category')) {
+ obj['category'] = ApiClient.convertToType(data['category'], Object);
+ }
+ if (data.hasOwnProperty('tags')) {
+ obj['tags'] = ApiClient.convertToType(data['tags'], ['String']);
+ }
+ if (data.hasOwnProperty('content')) {
+ obj['content'] = ApiClient.convertToType(data['content'], 'String');
+ }
+ if (data.hasOwnProperty('design')) {
+ obj['design'] = ApiClient.convertToType(data['design'], 'String');
+ }
+ if (data.hasOwnProperty('superContent')) {
+ obj['superContent'] = ApiClient.convertToType(data['superContent'], 'String');
+ }
+ if (data.hasOwnProperty('customFields')) {
+ obj['customFields'] = ApiClient.convertToType(data['customFields'], Object);
+ }
+ if (data.hasOwnProperty('views')) {
+ obj['views'] = ApiClient.convertToType(data['views'], Object);
+ }
+ if (data.hasOwnProperty('blocks')) {
+ obj['blocks'] = ApiClient.convertToType(data['blocks'], Object);
+ }
+ if (data.hasOwnProperty('minBlocks')) {
+ obj['minBlocks'] = ApiClient.convertToType(data['minBlocks'], 'Number');
+ }
+ if (data.hasOwnProperty('maxBlocks')) {
+ obj['maxBlocks'] = ApiClient.convertToType(data['maxBlocks'], 'Number');
+ }
+ if (data.hasOwnProperty('channels')) {
+ obj['channels'] = ApiClient.convertToType(data['channels'], Object);
+ }
+ if (data.hasOwnProperty('allowedBlocks')) {
+ obj['allowedBlocks'] = ApiClient.convertToType(data['allowedBlocks'], ['String']);
+ }
+ if (data.hasOwnProperty('slots')) {
+ obj['slots'] = ApiClient.convertToType(data['slots'], Object);
+ }
+ if (data.hasOwnProperty('businessUnitAvailability')) {
+ obj['businessUnitAvailability'] = ApiClient.convertToType(data['businessUnitAvailability'], Object);
+ }
+ if (data.hasOwnProperty('sharingProperties')) {
+ obj['sharingProperties'] = SharingProperties.constructFromObject(data['sharingProperties']);
+ }
+ if (data.hasOwnProperty('template')) {
+ obj['template'] = ApiClient.convertToType(data['template'], Object);
+ }
+ if (data.hasOwnProperty('file')) {
+ obj['file'] = ApiClient.convertToType(data['file'], 'String');
+ }
+ if (data.hasOwnProperty('generateFrom')) {
+ obj['generateFrom'] = ApiClient.convertToType(data['generateFrom'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The id of the asset
+ * @member {Number} id
+ */
+ id = undefined;
+ /**
+ * Reference to customer's private ID/name for the asset
+ * @member {String} customerKey
+ */
+ customerKey = undefined;
+ /**
+ * The type that the content attribute will be in
+ * @member {String} contentType
+ */
+ contentType = undefined;
+ /**
+ * Property bag containing the asset data
+ * @member {Object} data
+ */
+ data = undefined;
+ /**
+ * @member {module:Model/AssetType} assetType
+ */
+ assetType = undefined;
+ /**
+ * The version of the asset
+ * @member {Number} version
+ */
+ version = undefined;
+ /**
+ * Specifies if the asset can be modified or not
+ * @member {Boolean} locked
+ */
+ locked = undefined;
+ /**
+ * Stores the different properties that this asset refers to if it is a file type
+ * @member {Object} fileProperties
+ */
+ fileProperties = undefined;
+ /**
+ * Name of the asset, set by the client
+ * @member {String} name
+ */
+ name = undefined;
+ /**
+ * Description of the asset, set by the client
+ * @member {String} description
+ */
+ description = undefined;
+ /**
+ * ID of the category the asset belongs to
+ * @member {Object} category
+ */
+ category = undefined;
+ /**
+ * List of tags associated with the asset
+ * @member {Array.AssetType
.
+ * The asset type
+ * @alias module:Model/AssetType
+ * @class
+ * @param id {Number} The id of the asset type
+ * @param name {String} The name of the asset type
+ */
+
+ constructor(id, name) {
+
+ // verify the required parameter 'id' is set
+ if(id === undefined || id === null){
+ throw new InvalidModelException('"id" is a required property for AssetType and cannot be undefined or null');
+ }
+ this['id'] = id;
+
+ // verify the required parameter 'name' is set
+ if(name === undefined || name === null){
+ throw new InvalidModelException('"name" is a required property for AssetType and cannot be undefined or null');
+ }
+ this['name'] = name;
+
+
+ }
+
+ /**
+ * Constructs a AssetType
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/AssetType} obj Optional instance to populate.
+ * @return {module:Model/AssetType} The populated AssetType
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new AssetType();
+
+
+
+
+
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'Number');
+ }
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('displayName')) {
+ obj['displayName'] = ApiClient.convertToType(data['displayName'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The id of the asset type
+ * @member {Number} id
+ */
+ id = undefined;
+ /**
+ * The name of the asset type
+ * @member {String} name
+ */
+ name = undefined;
+ /**
+ * The description of the asset type
+ * @member {String} displayName
+ */
+ displayName = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/Attributes.js b/src/Model/Attributes.js
new file mode 100644
index 0000000..8674c3f
--- /dev/null
+++ b/src/Model/Attributes.js
@@ -0,0 +1,68 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The Attributes model module.
+* @module Model/Attributes
+* @version 1.0.0
+*/
+module.exports = class Attributes{
+ /**
+ * Constructs a new Attributes
.
+ * @alias module:Model/Attributes
+ * @class
+ */
+
+ constructor() {
+
+ }
+
+ /**
+ * Constructs a Attributes
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/Attributes} obj Optional instance to populate.
+ * @return {module:Model/Attributes} The populated Attributes
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new Attributes();
+
+
+
+
+
+ }
+ return obj;
+ }
+
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/Campaign.js b/src/Model/Campaign.js
new file mode 100644
index 0000000..b73f99e
--- /dev/null
+++ b/src/Model/Campaign.js
@@ -0,0 +1,179 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The Campaign model module.
+* @module Model/Campaign
+* @version 1.0.0
+*/
+module.exports = class Campaign{
+ /**
+ * Constructs a new Campaign
.
+ * @alias module:Model/Campaign
+ * @class
+ * @param name {String} Name of the campaign with a maximum length of 128 characters
+ * @param description {String} Description of the campaign with a maximum length of 512 characters
+ * @param campaignCode {String} Unique identifier for the campaign with a maximum length of 36 characters
+ * @param color {String} Hex color value
+ * @param favorite {Boolean} Determines if the campaign will be flagged as a favorite
+ */
+
+ constructor(name, description, campaignCode, color, favorite) {
+
+ // verify the required parameter 'name' is set
+ if(name === undefined || name === null){
+ throw new InvalidModelException('"name" is a required property for Campaign and cannot be undefined or null');
+ }
+ if (name.length > 128) {
+ throw new InvalidModelException('invalid length for "name". It must be smaller than or equal to 128.');
+ }
+ this['name'] = name;
+
+ // verify the required parameter 'description' is set
+ if(description === undefined || description === null){
+ throw new InvalidModelException('"description" is a required property for Campaign and cannot be undefined or null');
+ }
+ if (description.length > 512) {
+ throw new InvalidModelException('invalid length for "description". It must be smaller than or equal to 512.');
+ }
+ this['description'] = description;
+
+ // verify the required parameter 'campaignCode' is set
+ if(campaignCode === undefined || campaignCode === null){
+ throw new InvalidModelException('"campaignCode" is a required property for Campaign and cannot be undefined or null');
+ }
+ if (campaignCode.length > 36) {
+ throw new InvalidModelException('invalid length for "campaignCode". It must be smaller than or equal to 36.');
+ }
+ this['campaignCode'] = campaignCode;
+
+ // verify the required parameter 'color' is set
+ if(color === undefined || color === null){
+ throw new InvalidModelException('"color" is a required property for Campaign and cannot be undefined or null');
+ }
+ this['color'] = color;
+
+ // verify the required parameter 'favorite' is set
+ if(favorite === undefined || favorite === null){
+ throw new InvalidModelException('"favorite" is a required property for Campaign and cannot be undefined or null');
+ }
+ this['favorite'] = favorite;
+
+
+
+
+ }
+
+ /**
+ * Constructs a Campaign
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/Campaign} obj Optional instance to populate.
+ * @return {module:Model/Campaign} The populated Campaign
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new Campaign();
+
+
+
+
+
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('campaignCode')) {
+ obj['campaignCode'] = ApiClient.convertToType(data['campaignCode'], 'String');
+ }
+ if (data.hasOwnProperty('color')) {
+ obj['color'] = ApiClient.convertToType(data['color'], 'String');
+ }
+ if (data.hasOwnProperty('favorite')) {
+ obj['favorite'] = ApiClient.convertToType(data['favorite'], 'Boolean');
+ }
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'String');
+ }
+ if (data.hasOwnProperty('createdDate')) {
+ obj['createdDate'] = ApiClient.convertToType(data['createdDate'], 'Date');
+ }
+ if (data.hasOwnProperty('modifiedDate')) {
+ obj['modifiedDate'] = ApiClient.convertToType(data['modifiedDate'], 'Date');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Name of the campaign with a maximum length of 128 characters
+ * @member {String} name
+ */
+ name = undefined;
+ /**
+ * Description of the campaign with a maximum length of 512 characters
+ * @member {String} description
+ */
+ description = undefined;
+ /**
+ * Unique identifier for the campaign with a maximum length of 36 characters
+ * @member {String} campaignCode
+ */
+ campaignCode = undefined;
+ /**
+ * Hex color value
+ * @member {String} color
+ */
+ color = undefined;
+ /**
+ * Determines if the campaign will be flagged as a favorite
+ * @member {Boolean} favorite
+ */
+ favorite = undefined;
+ /**
+ * The id of the campaign
+ * @member {String} id
+ */
+ id = undefined;
+ /**
+ * The date the object was created.
+ * @member {Date} createdDate
+ */
+ createdDate = undefined;
+ /**
+ * The date the object was modified.
+ * @member {Date} modifiedDate
+ */
+ modifiedDate = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/CreateEmailDefinitionContent.js b/src/Model/CreateEmailDefinitionContent.js
new file mode 100644
index 0000000..f04aada
--- /dev/null
+++ b/src/Model/CreateEmailDefinitionContent.js
@@ -0,0 +1,83 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The CreateEmailDefinitionContent model module.
+* @module Model/CreateEmailDefinitionContent
+* @version 1.0.0
+*/
+module.exports = class CreateEmailDefinitionContent{
+ /**
+ * Constructs a new CreateEmailDefinitionContent
.
+ * @alias module:Model/CreateEmailDefinitionContent
+ * @class
+ * @param customerKey {String} Unique identifier of the content asset.
+ */
+
+ constructor(customerKey) {
+
+ // verify the required parameter 'customerKey' is set
+ if(customerKey === undefined || customerKey === null){
+ throw new InvalidModelException('"customerKey" is a required property for CreateEmailDefinitionContent and cannot be undefined or null');
+ }
+ this['customerKey'] = customerKey;
+
+ }
+
+ /**
+ * Constructs a CreateEmailDefinitionContent
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/CreateEmailDefinitionContent} obj Optional instance to populate.
+ * @return {module:Model/CreateEmailDefinitionContent} The populated CreateEmailDefinitionContent
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new CreateEmailDefinitionContent();
+
+
+
+
+
+ if (data.hasOwnProperty('customerKey')) {
+ obj['customerKey'] = ApiClient.convertToType(data['customerKey'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique identifier of the content asset.
+ * @member {String} customerKey
+ */
+ customerKey = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/CreateEmailDefinitionOptionsRequest.js b/src/Model/CreateEmailDefinitionOptionsRequest.js
new file mode 100644
index 0000000..bc79b91
--- /dev/null
+++ b/src/Model/CreateEmailDefinitionOptionsRequest.js
@@ -0,0 +1,77 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The CreateEmailDefinitionOptionsRequest model module.
+* @module Model/CreateEmailDefinitionOptionsRequest
+* @version 1.0.0
+*/
+module.exports = class CreateEmailDefinitionOptionsRequest{
+ /**
+ * Constructs a new CreateEmailDefinitionOptionsRequest
.
+ * @alias module:Model/CreateEmailDefinitionOptionsRequest
+ * @class
+ */
+
+ constructor() {
+
+
+ }
+
+ /**
+ * Constructs a CreateEmailDefinitionOptionsRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/CreateEmailDefinitionOptionsRequest} obj Optional instance to populate.
+ * @return {module:Model/CreateEmailDefinitionOptionsRequest} The populated CreateEmailDefinitionOptionsRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new CreateEmailDefinitionOptionsRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('trackLinks')) {
+ obj['trackLinks'] = ApiClient.convertToType(data['trackLinks'], 'Boolean');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Wraps links for tracking and reporting. Default is true.
+ * @member {Boolean} trackLinks
+ */
+ trackLinks = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/CreateEmailDefinitionRequest.js b/src/Model/CreateEmailDefinitionRequest.js
new file mode 100644
index 0000000..8e93661
--- /dev/null
+++ b/src/Model/CreateEmailDefinitionRequest.js
@@ -0,0 +1,200 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const CreateEmailDefinitionContent = require ('./CreateEmailDefinitionContent');
+const CreateEmailDefinitionOptionsRequest = require ('./CreateEmailDefinitionOptionsRequest');
+const CreateEmailDefinitionSubscriptions = require ('./CreateEmailDefinitionSubscriptions');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The CreateEmailDefinitionRequest model module.
+* @module Model/CreateEmailDefinitionRequest
+* @version 1.0.0
+*/
+module.exports = class CreateEmailDefinitionRequest{
+ /**
+ * Constructs a new CreateEmailDefinitionRequest
.
+ * @alias module:Model/CreateEmailDefinitionRequest
+ * @class
+ * @param name {String} Name of the definition. Must be unique.
+ * @param definitionKey {String} Unique, user-generated key to access the definition object.
+ * @param content {module:Model/CreateEmailDefinitionContent}
+ * @param subscriptions {module:Model/CreateEmailDefinitionSubscriptions}
+ */
+
+ constructor(name, definitionKey, content, subscriptions) {
+
+
+ // verify the required parameter 'name' is set
+ if(name === undefined || name === null){
+ throw new InvalidModelException('"name" is a required property for CreateEmailDefinitionRequest and cannot be undefined or null');
+ }
+ this['name'] = name;
+
+ // verify the required parameter 'definitionKey' is set
+ if(definitionKey === undefined || definitionKey === null){
+ throw new InvalidModelException('"definitionKey" is a required property for CreateEmailDefinitionRequest and cannot be undefined or null');
+ }
+ this['definitionKey'] = definitionKey;
+
+
+
+
+
+
+
+ // verify the required parameter 'content' is set
+ if(content === undefined || content === null){
+ throw new InvalidModelException('"content" is a required property for CreateEmailDefinitionRequest and cannot be undefined or null');
+ }
+ this['content'] = content;
+
+ // verify the required parameter 'subscriptions' is set
+ if(subscriptions === undefined || subscriptions === null){
+ throw new InvalidModelException('"subscriptions" is a required property for CreateEmailDefinitionRequest and cannot be undefined or null');
+ }
+ this['subscriptions'] = subscriptions;
+
+
+ }
+
+ /**
+ * Constructs a CreateEmailDefinitionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/CreateEmailDefinitionRequest} obj Optional instance to populate.
+ * @return {module:Model/CreateEmailDefinitionRequest} The populated CreateEmailDefinitionRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new CreateEmailDefinitionRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('definitionKey')) {
+ obj['definitionKey'] = ApiClient.convertToType(data['definitionKey'], 'String');
+ }
+ if (data.hasOwnProperty('definitionId')) {
+ obj['definitionId'] = ApiClient.convertToType(data['definitionId'], 'String');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('classification')) {
+ obj['classification'] = ApiClient.convertToType(data['classification'], 'String');
+ }
+ if (data.hasOwnProperty('status')) {
+ obj['status'] = ApiClient.convertToType(data['status'], 'String');
+ }
+ if (data.hasOwnProperty('createdDate')) {
+ obj['createdDate'] = ApiClient.convertToType(data['createdDate'], 'Date');
+ }
+ if (data.hasOwnProperty('modifiedDate')) {
+ obj['modifiedDate'] = ApiClient.convertToType(data['modifiedDate'], 'Date');
+ }
+ if (data.hasOwnProperty('content')) {
+ obj['content'] = CreateEmailDefinitionContent.constructFromObject(data['content']);
+ }
+ if (data.hasOwnProperty('subscriptions')) {
+ obj['subscriptions'] = CreateEmailDefinitionSubscriptions.constructFromObject(data['subscriptions']);
+ }
+ if (data.hasOwnProperty('options')) {
+ obj['options'] = CreateEmailDefinitionOptionsRequest.constructFromObject(data['options']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * Name of the definition. Must be unique.
+ * @member {String} name
+ */
+ name = undefined;
+ /**
+ * Unique, user-generated key to access the definition object.
+ * @member {String} definitionKey
+ */
+ definitionKey = undefined;
+ /**
+ * Definition Id
+ * @member {String} definitionId
+ */
+ definitionId = undefined;
+ /**
+ * User-provided description of the email definition.
+ * @member {String} description
+ */
+ description = undefined;
+ /**
+ * Marketing Cloud external key of a sending classification defined in Email Studio Administration. Only transactional classifications are permitted. Default is default transactional.
+ * @member {String} classification
+ */
+ classification = undefined;
+ /**
+ * Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days.
+ * @member {String} status
+ */
+ status = undefined;
+ /**
+ * The date the object was created.
+ * @member {Date} createdDate
+ */
+ createdDate = undefined;
+ /**
+ * The date the object was modified.
+ * @member {Date} modifiedDate
+ */
+ modifiedDate = undefined;
+ /**
+ * @member {module:Model/CreateEmailDefinitionContent} content
+ */
+ content = undefined;
+ /**
+ * @member {module:Model/CreateEmailDefinitionSubscriptions} subscriptions
+ */
+ subscriptions = undefined;
+ /**
+ * @member {module:Model/CreateEmailDefinitionOptionsRequest} options
+ */
+ options = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/CreateEmailDefinitionSubscriptions.js b/src/Model/CreateEmailDefinitionSubscriptions.js
new file mode 100644
index 0000000..04fbe94
--- /dev/null
+++ b/src/Model/CreateEmailDefinitionSubscriptions.js
@@ -0,0 +1,111 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The CreateEmailDefinitionSubscriptions model module.
+* @module Model/CreateEmailDefinitionSubscriptions
+* @version 1.0.0
+*/
+module.exports = class CreateEmailDefinitionSubscriptions{
+ /**
+ * Constructs a new CreateEmailDefinitionSubscriptions
.
+ * @alias module:Model/CreateEmailDefinitionSubscriptions
+ * @class
+ * @param list {String} Marketing Cloud external key of the list or all subscribers. Contains the subscriber keys and profile attributes.
+ */
+
+ constructor(list) {
+
+ // verify the required parameter 'list' is set
+ if(list === undefined || list === null){
+ throw new InvalidModelException('"list" is a required property for CreateEmailDefinitionSubscriptions and cannot be undefined or null');
+ }
+ this['list'] = list;
+
+
+
+
+ }
+
+ /**
+ * Constructs a CreateEmailDefinitionSubscriptions
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/CreateEmailDefinitionSubscriptions} obj Optional instance to populate.
+ * @return {module:Model/CreateEmailDefinitionSubscriptions} The populated CreateEmailDefinitionSubscriptions
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new CreateEmailDefinitionSubscriptions();
+
+
+
+
+
+ if (data.hasOwnProperty('list')) {
+ obj['list'] = ApiClient.convertToType(data['list'], 'String');
+ }
+ if (data.hasOwnProperty('dataExtension')) {
+ obj['dataExtension'] = ApiClient.convertToType(data['dataExtension'], 'String');
+ }
+ if (data.hasOwnProperty('autoAddSubscriber')) {
+ obj['autoAddSubscriber'] = ApiClient.convertToType(data['autoAddSubscriber'], 'Boolean');
+ }
+ if (data.hasOwnProperty('updateSubscriber')) {
+ obj['updateSubscriber'] = ApiClient.convertToType(data['updateSubscriber'], 'Boolean');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Marketing Cloud external key of the list or all subscribers. Contains the subscriber keys and profile attributes.
+ * @member {String} list
+ */
+ list = undefined;
+ /**
+ * Marketing Cloud external key of the triggered send data extension. Each request inserts as a new row in the data extension.
+ * @member {String} dataExtension
+ */
+ dataExtension = undefined;
+ /**
+ * Adds the recipient’s email address and contact key as a subscriber key to subscriptions.list. Default is true.
+ * @member {Boolean} autoAddSubscriber
+ * @default true
+ */
+ autoAddSubscriber = true;
+ /**
+ * Updates the recipient’s contact key as a subscriber key with the provided email address and profile attributes to subscriptions.list. Default is true.
+ * @member {Boolean} updateSubscriber
+ */
+ updateSubscriber = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/CreateSmsDefinitionContent.js b/src/Model/CreateSmsDefinitionContent.js
new file mode 100644
index 0000000..dc39905
--- /dev/null
+++ b/src/Model/CreateSmsDefinitionContent.js
@@ -0,0 +1,83 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The CreateSmsDefinitionContent model module.
+* @module Model/CreateSmsDefinitionContent
+* @version 1.0.0
+*/
+module.exports = class CreateSmsDefinitionContent{
+ /**
+ * Constructs a new CreateSmsDefinitionContent
.
+ * @alias module:Model/CreateSmsDefinitionContent
+ * @class
+ * @param message {String} The message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message.
+ */
+
+ constructor(message) {
+
+ // verify the required parameter 'message' is set
+ if(message === undefined || message === null){
+ throw new InvalidModelException('"message" is a required property for CreateSmsDefinitionContent and cannot be undefined or null');
+ }
+ this['message'] = message;
+
+ }
+
+ /**
+ * Constructs a CreateSmsDefinitionContent
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/CreateSmsDefinitionContent} obj Optional instance to populate.
+ * @return {module:Model/CreateSmsDefinitionContent} The populated CreateSmsDefinitionContent
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new CreateSmsDefinitionContent();
+
+
+
+
+
+ if (data.hasOwnProperty('message')) {
+ obj['message'] = ApiClient.convertToType(data['message'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message.
+ * @member {String} message
+ */
+ message = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/CreateSmsDefinitionRequest.js b/src/Model/CreateSmsDefinitionRequest.js
new file mode 100644
index 0000000..80bf4a8
--- /dev/null
+++ b/src/Model/CreateSmsDefinitionRequest.js
@@ -0,0 +1,173 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const CreateSmsDefinitionContent = require ('./CreateSmsDefinitionContent');
+const CreateSmsDefinitionSubscriptions = require ('./CreateSmsDefinitionSubscriptions');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The CreateSmsDefinitionRequest model module.
+* @module Model/CreateSmsDefinitionRequest
+* @version 1.0.0
+*/
+module.exports = class CreateSmsDefinitionRequest{
+ /**
+ * Constructs a new CreateSmsDefinitionRequest
.
+ * @alias module:Model/CreateSmsDefinitionRequest
+ * @class
+ * @param definitionKey {String} Unique, user-generated key to access the definition object.
+ * @param name {String} Name of the definition. Must be unique.
+ * @param content {module:Model/CreateSmsDefinitionContent}
+ * @param subscriptions {module:Model/CreateSmsDefinitionSubscriptions}
+ */
+
+ constructor(definitionKey, name, content, subscriptions) {
+
+ // verify the required parameter 'definitionKey' is set
+ if(definitionKey === undefined || definitionKey === null){
+ throw new InvalidModelException('"definitionKey" is a required property for CreateSmsDefinitionRequest and cannot be undefined or null');
+ }
+ this['definitionKey'] = definitionKey;
+
+ // verify the required parameter 'name' is set
+ if(name === undefined || name === null){
+ throw new InvalidModelException('"name" is a required property for CreateSmsDefinitionRequest and cannot be undefined or null');
+ }
+ this['name'] = name;
+
+ // verify the required parameter 'content' is set
+ if(content === undefined || content === null){
+ throw new InvalidModelException('"content" is a required property for CreateSmsDefinitionRequest and cannot be undefined or null');
+ }
+ this['content'] = content;
+
+
+
+
+
+ // verify the required parameter 'subscriptions' is set
+ if(subscriptions === undefined || subscriptions === null){
+ throw new InvalidModelException('"subscriptions" is a required property for CreateSmsDefinitionRequest and cannot be undefined or null');
+ }
+ this['subscriptions'] = subscriptions;
+
+
+ }
+
+ /**
+ * Constructs a CreateSmsDefinitionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/CreateSmsDefinitionRequest} obj Optional instance to populate.
+ * @return {module:Model/CreateSmsDefinitionRequest} The populated CreateSmsDefinitionRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new CreateSmsDefinitionRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('definitionKey')) {
+ obj['definitionKey'] = ApiClient.convertToType(data['definitionKey'], 'String');
+ }
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('content')) {
+ obj['content'] = CreateSmsDefinitionContent.constructFromObject(data['content']);
+ }
+ if (data.hasOwnProperty('status')) {
+ obj['status'] = ApiClient.convertToType(data['status'], 'String');
+ }
+ if (data.hasOwnProperty('createdDate')) {
+ obj['createdDate'] = ApiClient.convertToType(data['createdDate'], 'Date');
+ }
+ if (data.hasOwnProperty('modifiedDate')) {
+ obj['modifiedDate'] = ApiClient.convertToType(data['modifiedDate'], 'Date');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('subscriptions')) {
+ obj['subscriptions'] = CreateSmsDefinitionSubscriptions.constructFromObject(data['subscriptions']);
+ }
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique, user-generated key to access the definition object.
+ * @member {String} definitionKey
+ */
+ definitionKey = undefined;
+ /**
+ * Name of the definition. Must be unique.
+ * @member {String} name
+ */
+ name = undefined;
+ /**
+ * @member {module:Model/CreateSmsDefinitionContent} content
+ */
+ content = undefined;
+ /**
+ * Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days.
+ * @member {String} status
+ */
+ status = undefined;
+ /**
+ * The date the object was created.
+ * @member {Date} createdDate
+ */
+ createdDate = undefined;
+ /**
+ * The date the object was modified.
+ * @member {Date} modifiedDate
+ */
+ modifiedDate = undefined;
+ /**
+ * User-provided description of the SMS definition.
+ * @member {String} description
+ */
+ description = undefined;
+ /**
+ * @member {module:Model/CreateSmsDefinitionSubscriptions} subscriptions
+ */
+ subscriptions = undefined;
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/CreateSmsDefinitionSubscriptions.js b/src/Model/CreateSmsDefinitionSubscriptions.js
new file mode 100644
index 0000000..61afbc1
--- /dev/null
+++ b/src/Model/CreateSmsDefinitionSubscriptions.js
@@ -0,0 +1,117 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The CreateSmsDefinitionSubscriptions model module.
+* @module Model/CreateSmsDefinitionSubscriptions
+* @version 1.0.0
+*/
+module.exports = class CreateSmsDefinitionSubscriptions{
+ /**
+ * Constructs a new CreateSmsDefinitionSubscriptions
.
+ * @alias module:Model/CreateSmsDefinitionSubscriptions
+ * @class
+ * @param shortCode {String} The short code for the mobile transmissions for each message on this definition.
+ * @param countryCode {String} The country code associated with the shortCode for the mobile transmissions for each message on this definition.
+ */
+
+ constructor(shortCode, countryCode) {
+
+ // verify the required parameter 'shortCode' is set
+ if(shortCode === undefined || shortCode === null){
+ throw new InvalidModelException('"shortCode" is a required property for CreateSmsDefinitionSubscriptions and cannot be undefined or null');
+ }
+ this['shortCode'] = shortCode;
+
+ // verify the required parameter 'countryCode' is set
+ if(countryCode === undefined || countryCode === null){
+ throw new InvalidModelException('"countryCode" is a required property for CreateSmsDefinitionSubscriptions and cannot be undefined or null');
+ }
+ this['countryCode'] = countryCode;
+
+
+
+ }
+
+ /**
+ * Constructs a CreateSmsDefinitionSubscriptions
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/CreateSmsDefinitionSubscriptions} obj Optional instance to populate.
+ * @return {module:Model/CreateSmsDefinitionSubscriptions} The populated CreateSmsDefinitionSubscriptions
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new CreateSmsDefinitionSubscriptions();
+
+
+
+
+
+ if (data.hasOwnProperty('shortCode')) {
+ obj['shortCode'] = ApiClient.convertToType(data['shortCode'], 'String');
+ }
+ if (data.hasOwnProperty('countryCode')) {
+ obj['countryCode'] = ApiClient.convertToType(data['countryCode'], 'String');
+ }
+ if (data.hasOwnProperty('keyword')) {
+ obj['keyword'] = ApiClient.convertToType(data['keyword'], 'String');
+ }
+ if (data.hasOwnProperty('autoAddSubscriber')) {
+ obj['autoAddSubscriber'] = ApiClient.convertToType(data['autoAddSubscriber'], 'Boolean');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The short code for the mobile transmissions for each message on this definition.
+ * @member {String} shortCode
+ */
+ shortCode = undefined;
+ /**
+ * The country code associated with the shortCode for the mobile transmissions for each message on this definition.
+ * @member {String} countryCode
+ */
+ countryCode = undefined;
+ /**
+ * The keyword used to track messages.
+ * @member {String} keyword
+ */
+ keyword = undefined;
+ /**
+ * Permits adding a recipient as subscriber against the shortCode using contactKey. When false, the message is rejected if contactKey does not exist as a subscriber. Default is true.
+ * @member {Boolean} autoAddSubscriber
+ * @default true
+ */
+ autoAddSubscriber = true;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/DeleteQueuedMessagesForSendDefinitionResponse.js b/src/Model/DeleteQueuedMessagesForSendDefinitionResponse.js
new file mode 100644
index 0000000..e6f7a75
--- /dev/null
+++ b/src/Model/DeleteQueuedMessagesForSendDefinitionResponse.js
@@ -0,0 +1,77 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The DeleteQueuedMessagesForSendDefinitionResponse model module.
+* @module Model/DeleteQueuedMessagesForSendDefinitionResponse
+* @version 1.0.0
+*/
+module.exports = class DeleteQueuedMessagesForSendDefinitionResponse{
+ /**
+ * Constructs a new DeleteQueuedMessagesForSendDefinitionResponse
.
+ * @alias module:Model/DeleteQueuedMessagesForSendDefinitionResponse
+ * @class
+ */
+
+ constructor() {
+
+
+ }
+
+ /**
+ * Constructs a DeleteQueuedMessagesForSendDefinitionResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/DeleteQueuedMessagesForSendDefinitionResponse} obj Optional instance to populate.
+ * @return {module:Model/DeleteQueuedMessagesForSendDefinitionResponse} The populated DeleteQueuedMessagesForSendDefinitionResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new DeleteQueuedMessagesForSendDefinitionResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/DeleteSendDefinitionResponse.js b/src/Model/DeleteSendDefinitionResponse.js
new file mode 100644
index 0000000..c25f37d
--- /dev/null
+++ b/src/Model/DeleteSendDefinitionResponse.js
@@ -0,0 +1,95 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The DeleteSendDefinitionResponse model module.
+* @module Model/DeleteSendDefinitionResponse
+* @version 1.0.0
+*/
+module.exports = class DeleteSendDefinitionResponse{
+ /**
+ * Constructs a new DeleteSendDefinitionResponse
.
+ * @alias module:Model/DeleteSendDefinitionResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+ }
+
+ /**
+ * Constructs a DeleteSendDefinitionResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/DeleteSendDefinitionResponse} obj Optional instance to populate.
+ * @return {module:Model/DeleteSendDefinitionResponse} The populated DeleteSendDefinitionResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new DeleteSendDefinitionResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('message')) {
+ obj['message'] = ApiClient.convertToType(data['message'], 'String');
+ }
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('deletedDefinitionKey')) {
+ obj['deletedDefinitionKey'] = ApiClient.convertToType(data['deletedDefinitionKey'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The response message
+ * @member {String} message
+ */
+ message = undefined;
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * The key of the deleted definition
+ * @member {String} deletedDefinitionKey
+ */
+ deletedDefinitionKey = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/GetDefinitionSendStatusForRecipientResponse.js b/src/Model/GetDefinitionSendStatusForRecipientResponse.js
new file mode 100644
index 0000000..b3f3ab8
--- /dev/null
+++ b/src/Model/GetDefinitionSendStatusForRecipientResponse.js
@@ -0,0 +1,113 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const GetDefinitionSendStatusForRecipientResponseInfo = require ('./GetDefinitionSendStatusForRecipientResponseInfo');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The GetDefinitionSendStatusForRecipientResponse model module.
+* @module Model/GetDefinitionSendStatusForRecipientResponse
+* @version 1.0.0
+*/
+module.exports = class GetDefinitionSendStatusForRecipientResponse{
+ /**
+ * Constructs a new GetDefinitionSendStatusForRecipientResponse
.
+ * @alias module:Model/GetDefinitionSendStatusForRecipientResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetDefinitionSendStatusForRecipientResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetDefinitionSendStatusForRecipientResponse} obj Optional instance to populate.
+ * @return {module:Model/GetDefinitionSendStatusForRecipientResponse} The populated GetDefinitionSendStatusForRecipientResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetDefinitionSendStatusForRecipientResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('eventCategoryType')) {
+ obj['eventCategoryType'] = ApiClient.convertToType(data['eventCategoryType'], 'String');
+ }
+ if (data.hasOwnProperty('timestamp')) {
+ obj['timestamp'] = ApiClient.convertToType(data['timestamp'], 'Date');
+ }
+ if (data.hasOwnProperty('compositeId')) {
+ obj['compositeId'] = ApiClient.convertToType(data['compositeId'], 'String');
+ }
+ if (data.hasOwnProperty('info')) {
+ obj['info'] = GetDefinitionSendStatusForRecipientResponseInfo.constructFromObject(data['info']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * The status of the message
+ * @member {String} eventCategoryType
+ */
+ eventCategoryType = undefined;
+ /**
+ * The date the ...
+ * @member {Date} timestamp
+ */
+ timestamp = undefined;
+ /**
+ * The Id of ...
+ * @member {String} compositeId
+ */
+ compositeId = undefined;
+ /**
+ * @member {module:Model/GetDefinitionSendStatusForRecipientResponseInfo} info
+ */
+ info = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/GetDefinitionSendStatusForRecipientResponseInfo.js b/src/Model/GetDefinitionSendStatusForRecipientResponseInfo.js
new file mode 100644
index 0000000..f9e5c12
--- /dev/null
+++ b/src/Model/GetDefinitionSendStatusForRecipientResponseInfo.js
@@ -0,0 +1,113 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The GetDefinitionSendStatusForRecipientResponseInfo model module.
+* @module Model/GetDefinitionSendStatusForRecipientResponseInfo
+* @version 1.0.0
+*/
+module.exports = class GetDefinitionSendStatusForRecipientResponseInfo{
+ /**
+ * Constructs a new GetDefinitionSendStatusForRecipientResponseInfo
.
+ * @alias module:Model/GetDefinitionSendStatusForRecipientResponseInfo
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetDefinitionSendStatusForRecipientResponseInfo
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetDefinitionSendStatusForRecipientResponseInfo} obj Optional instance to populate.
+ * @return {module:Model/GetDefinitionSendStatusForRecipientResponseInfo} The populated GetDefinitionSendStatusForRecipientResponseInfo
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetDefinitionSendStatusForRecipientResponseInfo();
+
+
+
+
+
+ if (data.hasOwnProperty('messageKey')) {
+ obj['messageKey'] = ApiClient.convertToType(data['messageKey'], 'String');
+ }
+ if (data.hasOwnProperty('contactKey')) {
+ obj['contactKey'] = ApiClient.convertToType(data['contactKey'], 'String');
+ }
+ if (data.hasOwnProperty('to')) {
+ obj['to'] = ApiClient.convertToType(data['to'], 'String');
+ }
+ if (data.hasOwnProperty('statusCode')) {
+ obj['statusCode'] = ApiClient.convertToType(data['statusCode'], 'Number');
+ }
+ if (data.hasOwnProperty('statusMessage')) {
+ obj['statusMessage'] = ApiClient.convertToType(data['statusMessage'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique identifier used to track message status.
+ * @member {String} messageKey
+ */
+ messageKey = undefined;
+ /**
+ * Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address.
+ * @member {String} contactKey
+ */
+ contactKey = undefined;
+ /**
+ * Channel address of the recipient. For email, it’s the recipient's email address.
+ * @member {String} to
+ */
+ to = undefined;
+ /**
+ * The specific status code
+ * @member {Number} statusCode
+ */
+ statusCode = undefined;
+ /**
+ * The specific status message
+ * @member {String} statusMessage
+ */
+ statusMessage = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/GetDefinitionsNotSentToRecipientsMessage.js b/src/Model/GetDefinitionsNotSentToRecipientsMessage.js
new file mode 100644
index 0000000..4bab465
--- /dev/null
+++ b/src/Model/GetDefinitionsNotSentToRecipientsMessage.js
@@ -0,0 +1,131 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const GetDefinitionsNotSentToRecipientsMessageInfo = require ('./GetDefinitionsNotSentToRecipientsMessageInfo');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The GetDefinitionsNotSentToRecipientsMessage model module.
+* @module Model/GetDefinitionsNotSentToRecipientsMessage
+* @version 1.0.0
+*/
+module.exports = class GetDefinitionsNotSentToRecipientsMessage{
+ /**
+ * Constructs a new GetDefinitionsNotSentToRecipientsMessage
.
+ * @alias module:Model/GetDefinitionsNotSentToRecipientsMessage
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetDefinitionsNotSentToRecipientsMessage
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetDefinitionsNotSentToRecipientsMessage} obj Optional instance to populate.
+ * @return {module:Model/GetDefinitionsNotSentToRecipientsMessage} The populated GetDefinitionsNotSentToRecipientsMessage
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetDefinitionsNotSentToRecipientsMessage();
+
+
+
+
+
+ if (data.hasOwnProperty('statusCode')) {
+ obj['statusCode'] = ApiClient.convertToType(data['statusCode'], 'Number');
+ }
+ if (data.hasOwnProperty('statusMessage')) {
+ obj['statusMessage'] = ApiClient.convertToType(data['statusMessage'], 'String');
+ }
+ if (data.hasOwnProperty('eventCategoryType')) {
+ obj['eventCategoryType'] = ApiClient.convertToType(data['eventCategoryType'], 'String');
+ }
+ if (data.hasOwnProperty('timestamp')) {
+ obj['timestamp'] = ApiClient.convertToType(data['timestamp'], 'Date');
+ }
+ if (data.hasOwnProperty('definitionKey')) {
+ obj['definitionKey'] = ApiClient.convertToType(data['definitionKey'], 'String');
+ }
+ if (data.hasOwnProperty('eventID')) {
+ obj['eventID'] = ApiClient.convertToType(data['eventID'], 'Number');
+ }
+ if (data.hasOwnProperty('info')) {
+ obj['info'] = GetDefinitionsNotSentToRecipientsMessageInfo.constructFromObject(data['info']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The specific status code
+ * @member {Number} statusCode
+ */
+ statusCode = undefined;
+ /**
+ * The specific status message
+ * @member {String} statusMessage
+ */
+ statusMessage = undefined;
+ /**
+ * The status of the message
+ * @member {String} eventCategoryType
+ */
+ eventCategoryType = undefined;
+ /**
+ * The date the ...
+ * @member {Date} timestamp
+ */
+ timestamp = undefined;
+ /**
+ * Unique, user-generated key to access the definition object.
+ * @member {String} definitionKey
+ */
+ definitionKey = undefined;
+ /**
+ *
+ * @member {Number} eventID
+ */
+ eventID = undefined;
+ /**
+ * @member {module:Model/GetDefinitionsNotSentToRecipientsMessageInfo} info
+ */
+ info = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/GetDefinitionsNotSentToRecipientsMessageInfo.js b/src/Model/GetDefinitionsNotSentToRecipientsMessageInfo.js
new file mode 100644
index 0000000..e3400be
--- /dev/null
+++ b/src/Model/GetDefinitionsNotSentToRecipientsMessageInfo.js
@@ -0,0 +1,95 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The GetDefinitionsNotSentToRecipientsMessageInfo model module.
+* @module Model/GetDefinitionsNotSentToRecipientsMessageInfo
+* @version 1.0.0
+*/
+module.exports = class GetDefinitionsNotSentToRecipientsMessageInfo{
+ /**
+ * Constructs a new GetDefinitionsNotSentToRecipientsMessageInfo
.
+ * @alias module:Model/GetDefinitionsNotSentToRecipientsMessageInfo
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetDefinitionsNotSentToRecipientsMessageInfo
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetDefinitionsNotSentToRecipientsMessageInfo} obj Optional instance to populate.
+ * @return {module:Model/GetDefinitionsNotSentToRecipientsMessageInfo} The populated GetDefinitionsNotSentToRecipientsMessageInfo
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetDefinitionsNotSentToRecipientsMessageInfo();
+
+
+
+
+
+ if (data.hasOwnProperty('messageKey')) {
+ obj['messageKey'] = ApiClient.convertToType(data['messageKey'], 'String');
+ }
+ if (data.hasOwnProperty('contactKey')) {
+ obj['contactKey'] = ApiClient.convertToType(data['contactKey'], 'String');
+ }
+ if (data.hasOwnProperty('to')) {
+ obj['to'] = ApiClient.convertToType(data['to'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique identifier used to track message status.
+ * @member {String} messageKey
+ */
+ messageKey = undefined;
+ /**
+ * Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address.
+ * @member {String} contactKey
+ */
+ contactKey = undefined;
+ /**
+ * Channel address of the recipient. For email, it’s the recipient's email address.
+ * @member {String} to
+ */
+ to = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/GetDefinitionsNotSentToRecipientsResponse.js b/src/Model/GetDefinitionsNotSentToRecipientsResponse.js
new file mode 100644
index 0000000..a40f25b
--- /dev/null
+++ b/src/Model/GetDefinitionsNotSentToRecipientsResponse.js
@@ -0,0 +1,114 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const GetDefinitionsNotSentToRecipientsMessage = require ('./GetDefinitionsNotSentToRecipientsMessage');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The GetDefinitionsNotSentToRecipientsResponse model module.
+* @module Model/GetDefinitionsNotSentToRecipientsResponse
+* @version 1.0.0
+*/
+module.exports = class GetDefinitionsNotSentToRecipientsResponse{
+ /**
+ * Constructs a new GetDefinitionsNotSentToRecipientsResponse
.
+ * @alias module:Model/GetDefinitionsNotSentToRecipientsResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetDefinitionsNotSentToRecipientsResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetDefinitionsNotSentToRecipientsResponse} obj Optional instance to populate.
+ * @return {module:Model/GetDefinitionsNotSentToRecipientsResponse} The populated GetDefinitionsNotSentToRecipientsResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetDefinitionsNotSentToRecipientsResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('lastEventID')) {
+ obj['lastEventID'] = ApiClient.convertToType(data['lastEventID'], 'Number');
+ }
+ if (data.hasOwnProperty('messages')) {
+ obj['messages'] = ApiClient.convertToType(data['messages'], [GetDefinitionsNotSentToRecipientsMessage]);
+ }
+ if (data.hasOwnProperty('count')) {
+ obj['count'] = ApiClient.convertToType(data['count'], 'Number');
+ }
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('pageSize')) {
+ obj['pageSize'] = ApiClient.convertToType(data['pageSize'], 'Number');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest
+ * @member {Number} lastEventID
+ */
+ lastEventID = undefined;
+ /**
+ *
+ * @member {Array.GetEmailDefinitionsResponse
.
+ * @alias module:Model/GetEmailDefinitionsResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetEmailDefinitionsResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetEmailDefinitionsResponse} obj Optional instance to populate.
+ * @return {module:Model/GetEmailDefinitionsResponse} The populated GetEmailDefinitionsResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetEmailDefinitionsResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('definitions')) {
+ obj['definitions'] = ApiClient.convertToType(data['definitions'], [CreateEmailDefinitionRequest]);
+ }
+ if (data.hasOwnProperty('count')) {
+ obj['count'] = ApiClient.convertToType(data['count'], 'Number');
+ }
+ if (data.hasOwnProperty('page')) {
+ obj['page'] = ApiClient.convertToType(data['page'], 'Number');
+ }
+ if (data.hasOwnProperty('pageSize')) {
+ obj['pageSize'] = ApiClient.convertToType(data['pageSize'], 'Number');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * @member {Array.GetQueueMetricsForSendDefinitionResponse
.
+ * @alias module:Model/GetQueueMetricsForSendDefinitionResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetQueueMetricsForSendDefinitionResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetQueueMetricsForSendDefinitionResponse} obj Optional instance to populate.
+ * @return {module:Model/GetQueueMetricsForSendDefinitionResponse} The populated GetQueueMetricsForSendDefinitionResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetQueueMetricsForSendDefinitionResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('count')) {
+ obj['count'] = ApiClient.convertToType(data['count'], 'Number');
+ }
+ if (data.hasOwnProperty('ageSeconds')) {
+ obj['ageSeconds'] = ApiClient.convertToType(data['ageSeconds'], 'Number');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * Number of pages
+ * @member {Number} count
+ */
+ count = undefined;
+ /**
+ * Number of seconds
+ * @member {Number} ageSeconds
+ */
+ ageSeconds = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/GetSmsDefinitionsResponse.js b/src/Model/GetSmsDefinitionsResponse.js
new file mode 100644
index 0000000..fc9a36f
--- /dev/null
+++ b/src/Model/GetSmsDefinitionsResponse.js
@@ -0,0 +1,113 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const CreateSmsDefinitionRequest = require ('./CreateSmsDefinitionRequest');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The GetSmsDefinitionsResponse model module.
+* @module Model/GetSmsDefinitionsResponse
+* @version 1.0.0
+*/
+module.exports = class GetSmsDefinitionsResponse{
+ /**
+ * Constructs a new GetSmsDefinitionsResponse
.
+ * @alias module:Model/GetSmsDefinitionsResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a GetSmsDefinitionsResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/GetSmsDefinitionsResponse} obj Optional instance to populate.
+ * @return {module:Model/GetSmsDefinitionsResponse} The populated GetSmsDefinitionsResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new GetSmsDefinitionsResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('definitions')) {
+ obj['definitions'] = ApiClient.convertToType(data['definitions'], [CreateSmsDefinitionRequest]);
+ }
+ if (data.hasOwnProperty('count')) {
+ obj['count'] = ApiClient.convertToType(data['count'], 'Number');
+ }
+ if (data.hasOwnProperty('page')) {
+ obj['page'] = ApiClient.convertToType(data['page'], 'Number');
+ }
+ if (data.hasOwnProperty('pageSize')) {
+ obj['pageSize'] = ApiClient.convertToType(data['pageSize'], 'Number');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * @member {Array.Recipient
.
+ * @alias module:Model/Recipient
+ * @class
+ * @param contactKey {String} Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address.
+ */
+
+ constructor(contactKey) {
+
+ // verify the required parameter 'contactKey' is set
+ if(contactKey === undefined || contactKey === null){
+ throw new InvalidModelException('"contactKey" is a required property for Recipient and cannot be undefined or null');
+ }
+ this['contactKey'] = contactKey;
+
+
+
+
+ }
+
+ /**
+ * Constructs a Recipient
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/Recipient} obj Optional instance to populate.
+ * @return {module:Model/Recipient} The populated Recipient
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new Recipient();
+
+
+
+
+
+ if (data.hasOwnProperty('contactKey')) {
+ obj['contactKey'] = ApiClient.convertToType(data['contactKey'], 'String');
+ }
+ if (data.hasOwnProperty('to')) {
+ obj['to'] = ApiClient.convertToType(data['to'], 'String');
+ }
+ if (data.hasOwnProperty('messageKey')) {
+ obj['messageKey'] = ApiClient.convertToType(data['messageKey'], 'String');
+ }
+ if (data.hasOwnProperty('attributes')) {
+ obj['attributes'] = Attributes.constructFromObject(data['attributes']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address.
+ * @member {String} contactKey
+ */
+ contactKey = undefined;
+ /**
+ * Channel address of the recipient. For email, it’s the recipient's email address. For SMS, it’s the recipient's E.164-based mobile number.
+ * @member {String} to
+ */
+ to = undefined;
+ /**
+ * Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
+ * @member {String} messageKey
+ */
+ messageKey = undefined;
+ /**
+ * @member {module:Model/Attributes} attributes
+ */
+ attributes = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/SendDefinitionResponseItem.js b/src/Model/SendDefinitionResponseItem.js
new file mode 100644
index 0000000..ff43d09
--- /dev/null
+++ b/src/Model/SendDefinitionResponseItem.js
@@ -0,0 +1,95 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The SendDefinitionResponseItem model module.
+* @module Model/SendDefinitionResponseItem
+* @version 1.0.0
+*/
+module.exports = class SendDefinitionResponseItem{
+ /**
+ * Constructs a new SendDefinitionResponseItem
.
+ * @alias module:Model/SendDefinitionResponseItem
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+ }
+
+ /**
+ * Constructs a SendDefinitionResponseItem
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendDefinitionResponseItem} obj Optional instance to populate.
+ * @return {module:Model/SendDefinitionResponseItem} The populated SendDefinitionResponseItem
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendDefinitionResponseItem();
+
+
+
+
+
+ if (data.hasOwnProperty('messageKey')) {
+ obj['messageKey'] = ApiClient.convertToType(data['messageKey'], 'String');
+ }
+ if (data.hasOwnProperty('errorCode')) {
+ obj['errorCode'] = ApiClient.convertToType(data['errorCode'], 'Number');
+ }
+ if (data.hasOwnProperty('message')) {
+ obj['message'] = ApiClient.convertToType(data['message'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique identifier used to track message status.
+ * @member {String} messageKey
+ */
+ messageKey = undefined;
+ /**
+ * The specific error code
+ * @member {Number} errorCode
+ */
+ errorCode = undefined;
+ /**
+ * The error message
+ * @member {String} message
+ */
+ message = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/SendDefinitionToMultipleRecipientsResponse.js b/src/Model/SendDefinitionToMultipleRecipientsResponse.js
new file mode 100644
index 0000000..f5dc6b2
--- /dev/null
+++ b/src/Model/SendDefinitionToMultipleRecipientsResponse.js
@@ -0,0 +1,105 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const SendDefinitionResponseItem = require ('./SendDefinitionResponseItem');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The SendDefinitionToMultipleRecipientsResponse model module.
+* @module Model/SendDefinitionToMultipleRecipientsResponse
+* @version 1.0.0
+*/
+module.exports = class SendDefinitionToMultipleRecipientsResponse{
+ /**
+ * Constructs a new SendDefinitionToMultipleRecipientsResponse
.
+ * @alias module:Model/SendDefinitionToMultipleRecipientsResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a SendDefinitionToMultipleRecipientsResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendDefinitionToMultipleRecipientsResponse} obj Optional instance to populate.
+ * @return {module:Model/SendDefinitionToMultipleRecipientsResponse} The populated SendDefinitionToMultipleRecipientsResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendDefinitionToMultipleRecipientsResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('errorcode')) {
+ obj['errorcode'] = ApiClient.convertToType(data['errorcode'], 'Number');
+ }
+ if (data.hasOwnProperty('message')) {
+ obj['message'] = ApiClient.convertToType(data['message'], 'String');
+ }
+ if (data.hasOwnProperty('responses')) {
+ obj['responses'] = ApiClient.convertToType(data['responses'], [SendDefinitionResponseItem]);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * The specific error code
+ * @member {Number} errorcode
+ */
+ errorcode = undefined;
+ /**
+ *
+ * @member {String} message
+ */
+ message = undefined;
+ /**
+ *
+ * @member {Array.SendDefinitionToSingleRecipientResponse
.
+ * @alias module:Model/SendDefinitionToSingleRecipientResponse
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+ }
+
+ /**
+ * Constructs a SendDefinitionToSingleRecipientResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendDefinitionToSingleRecipientResponse} obj Optional instance to populate.
+ * @return {module:Model/SendDefinitionToSingleRecipientResponse} The populated SendDefinitionToSingleRecipientResponse
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendDefinitionToSingleRecipientResponse();
+
+
+
+
+
+ if (data.hasOwnProperty('requestId')) {
+ obj['requestId'] = ApiClient.convertToType(data['requestId'], 'String');
+ }
+ if (data.hasOwnProperty('errorcode')) {
+ obj['errorcode'] = ApiClient.convertToType(data['errorcode'], 'Number');
+ }
+ if (data.hasOwnProperty('responses')) {
+ obj['responses'] = ApiClient.convertToType(data['responses'], [SendDefinitionResponseItem]);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * The ID of the request
+ * @member {String} requestId
+ */
+ requestId = undefined;
+ /**
+ * The specific error code
+ * @member {Number} errorcode
+ */
+ errorcode = undefined;
+ /**
+ *
+ * @member {Array.SendEmailToMultipleRecipientsRequest
.
+ * @alias module:Model/SendEmailToMultipleRecipientsRequest
+ * @class
+ * @param definitionKey {String} Unique, user-generated key to access the definition object.
+ * @param recipients {Array.SendEmailToMultipleRecipientsRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendEmailToMultipleRecipientsRequest} obj Optional instance to populate.
+ * @return {module:Model/SendEmailToMultipleRecipientsRequest} The populated SendEmailToMultipleRecipientsRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendEmailToMultipleRecipientsRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('definitionKey')) {
+ obj['definitionKey'] = ApiClient.convertToType(data['definitionKey'], 'String');
+ }
+ if (data.hasOwnProperty('recipients')) {
+ obj['recipients'] = ApiClient.convertToType(data['recipients'], [Recipient]);
+ }
+ if (data.hasOwnProperty('attributes')) {
+ obj['attributes'] = Attributes.constructFromObject(data['attributes']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique, user-generated key to access the definition object.
+ * @member {String} definitionKey
+ */
+ definitionKey = undefined;
+ /**
+ * Array of recipient objects that contain parameters and metadata for the recipients, such as send tracking and personalization attributes. Use this parameter to send to multiple recipients in one request. Use either the recipient or recipients parameter, but not both.
+ * @member {Array.SendEmailToSingleRecipientRequest
.
+ * @alias module:Model/SendEmailToSingleRecipientRequest
+ * @class
+ * @param definitionKey {String} Unique identifier of the definition.
+ * @param recipient {module:Model/Recipient}
+ */
+
+ constructor(definitionKey, recipient) {
+
+ // verify the required parameter 'definitionKey' is set
+ if(definitionKey === undefined || definitionKey === null){
+ throw new InvalidModelException('"definitionKey" is a required property for SendEmailToSingleRecipientRequest and cannot be undefined or null');
+ }
+ this['definitionKey'] = definitionKey;
+
+ // verify the required parameter 'recipient' is set
+ if(recipient === undefined || recipient === null){
+ throw new InvalidModelException('"recipient" is a required property for SendEmailToSingleRecipientRequest and cannot be undefined or null');
+ }
+ this['recipient'] = recipient;
+
+ }
+
+ /**
+ * Constructs a SendEmailToSingleRecipientRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendEmailToSingleRecipientRequest} obj Optional instance to populate.
+ * @return {module:Model/SendEmailToSingleRecipientRequest} The populated SendEmailToSingleRecipientRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendEmailToSingleRecipientRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('definitionKey')) {
+ obj['definitionKey'] = ApiClient.convertToType(data['definitionKey'], 'String');
+ }
+ if (data.hasOwnProperty('recipient')) {
+ obj['recipient'] = Recipient.constructFromObject(data['recipient']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique identifier of the definition.
+ * @member {String} definitionKey
+ */
+ definitionKey = undefined;
+ /**
+ * @member {module:Model/Recipient} recipient
+ */
+ recipient = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/SendSmsContentRequest.js b/src/Model/SendSmsContentRequest.js
new file mode 100644
index 0000000..34c70be
--- /dev/null
+++ b/src/Model/SendSmsContentRequest.js
@@ -0,0 +1,77 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The SendSmsContentRequest model module.
+* @module Model/SendSmsContentRequest
+* @version 1.0.0
+*/
+module.exports = class SendSmsContentRequest{
+ /**
+ * Constructs a new SendSmsContentRequest
.
+ * @alias module:Model/SendSmsContentRequest
+ * @class
+ */
+
+ constructor() {
+
+
+ }
+
+ /**
+ * Constructs a SendSmsContentRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendSmsContentRequest} obj Optional instance to populate.
+ * @return {module:Model/SendSmsContentRequest} The populated SendSmsContentRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendSmsContentRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('message')) {
+ obj['message'] = ApiClient.convertToType(data['message'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Override for message content in the definition that you want sent with each message. Use substitution strings to personalize the content.
+ * @member {String} message
+ */
+ message = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/SendSmsToMultipleRecipientsRequest.js b/src/Model/SendSmsToMultipleRecipientsRequest.js
new file mode 100644
index 0000000..76e5611
--- /dev/null
+++ b/src/Model/SendSmsToMultipleRecipientsRequest.js
@@ -0,0 +1,126 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const Attributes = require ('./Attributes');
+const Recipient = require ('./Recipient');
+const SendSmsContentRequest = require ('./SendSmsContentRequest');
+const SendSmsToMultipleRecipientsSubscriptionsRequest = require ('./SendSmsToMultipleRecipientsSubscriptionsRequest');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The SendSmsToMultipleRecipientsRequest model module.
+* @module Model/SendSmsToMultipleRecipientsRequest
+* @version 1.0.0
+*/
+module.exports = class SendSmsToMultipleRecipientsRequest{
+ /**
+ * Constructs a new SendSmsToMultipleRecipientsRequest
.
+ * @alias module:Model/SendSmsToMultipleRecipientsRequest
+ * @class
+ * @param definitionKey {String} Unique, user-generated key to access the definition object.
+ * @param recipients {Array.SendSmsToMultipleRecipientsRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendSmsToMultipleRecipientsRequest} obj Optional instance to populate.
+ * @return {module:Model/SendSmsToMultipleRecipientsRequest} The populated SendSmsToMultipleRecipientsRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendSmsToMultipleRecipientsRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('definitionKey')) {
+ obj['definitionKey'] = ApiClient.convertToType(data['definitionKey'], 'String');
+ }
+ if (data.hasOwnProperty('recipients')) {
+ obj['recipients'] = ApiClient.convertToType(data['recipients'], [Recipient]);
+ }
+ if (data.hasOwnProperty('subscriptions')) {
+ obj['subscriptions'] = SendSmsToMultipleRecipientsSubscriptionsRequest.constructFromObject(data['subscriptions']);
+ }
+ if (data.hasOwnProperty('content')) {
+ obj['content'] = SendSmsContentRequest.constructFromObject(data['content']);
+ }
+ if (data.hasOwnProperty('attributes')) {
+ obj['attributes'] = Attributes.constructFromObject(data['attributes']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique, user-generated key to access the definition object.
+ * @member {String} definitionKey
+ */
+ definitionKey = undefined;
+ /**
+ * Array of recipient objects that contain parameters and metadata for the recipients, such as send tracking and personalization attributes. Use this parameter to send to multiple recipients in one request. Use either the recipient or recipients parameter, but not both.
+ * @member {Array.SendSmsToMultipleRecipientsSubscriptionsRequest
.
+ * @alias module:Model/SendSmsToMultipleRecipientsSubscriptionsRequest
+ * @class
+ */
+
+ constructor() {
+
+
+ }
+
+ /**
+ * Constructs a SendSmsToMultipleRecipientsSubscriptionsRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendSmsToMultipleRecipientsSubscriptionsRequest} obj Optional instance to populate.
+ * @return {module:Model/SendSmsToMultipleRecipientsSubscriptionsRequest} The populated SendSmsToMultipleRecipientsSubscriptionsRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendSmsToMultipleRecipientsSubscriptionsRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('resubscribe')) {
+ obj['resubscribe'] = ApiClient.convertToType(data['resubscribe'], 'Boolean');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Forces the message send request to subscribe the mobile number back into a short code if a user may have requested STOP. Often used to ensure that critical transactional messages are delivered irrespective of a mobile number subscriber status.
+ * @member {Boolean} resubscribe
+ */
+ resubscribe = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/SendSmsToSingleRecipientRequest.js b/src/Model/SendSmsToSingleRecipientRequest.js
new file mode 100644
index 0000000..3c9360e
--- /dev/null
+++ b/src/Model/SendSmsToSingleRecipientRequest.js
@@ -0,0 +1,107 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const Recipient = require ('./Recipient');
+const SendSmsContentRequest = require ('./SendSmsContentRequest');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The SendSmsToSingleRecipientRequest model module.
+* @module Model/SendSmsToSingleRecipientRequest
+* @version 1.0.0
+*/
+module.exports = class SendSmsToSingleRecipientRequest{
+ /**
+ * Constructs a new SendSmsToSingleRecipientRequest
.
+ * @alias module:Model/SendSmsToSingleRecipientRequest
+ * @class
+ * @param definitionKey {String} Unique identifier of the definition.
+ * @param recipient {module:Model/Recipient}
+ */
+
+ constructor(definitionKey, recipient) {
+
+ // verify the required parameter 'definitionKey' is set
+ if(definitionKey === undefined || definitionKey === null){
+ throw new InvalidModelException('"definitionKey" is a required property for SendSmsToSingleRecipientRequest and cannot be undefined or null');
+ }
+ this['definitionKey'] = definitionKey;
+
+ // verify the required parameter 'recipient' is set
+ if(recipient === undefined || recipient === null){
+ throw new InvalidModelException('"recipient" is a required property for SendSmsToSingleRecipientRequest and cannot be undefined or null');
+ }
+ this['recipient'] = recipient;
+
+
+ }
+
+ /**
+ * Constructs a SendSmsToSingleRecipientRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SendSmsToSingleRecipientRequest} obj Optional instance to populate.
+ * @return {module:Model/SendSmsToSingleRecipientRequest} The populated SendSmsToSingleRecipientRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SendSmsToSingleRecipientRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('definitionKey')) {
+ obj['definitionKey'] = ApiClient.convertToType(data['definitionKey'], 'String');
+ }
+ if (data.hasOwnProperty('recipient')) {
+ obj['recipient'] = Recipient.constructFromObject(data['recipient']);
+ }
+ if (data.hasOwnProperty('content')) {
+ obj['content'] = SendSmsContentRequest.constructFromObject(data['content']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Unique identifier of the definition.
+ * @member {String} definitionKey
+ */
+ definitionKey = undefined;
+ /**
+ * @member {module:Model/Recipient} recipient
+ */
+ recipient = undefined;
+ /**
+ * @member {module:Model/SendSmsContentRequest} content
+ */
+ content = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/SharingProperties.js b/src/Model/SharingProperties.js
new file mode 100644
index 0000000..2453ae0
--- /dev/null
+++ b/src/Model/SharingProperties.js
@@ -0,0 +1,112 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The SharingProperties model module.
+* @module Model/SharingProperties
+* @version 1.0.0
+*/
+module.exports = class SharingProperties{
+ /**
+ * Constructs a new SharingProperties
.
+ * @alias module:Model/SharingProperties
+ * @class
+ */
+
+ constructor() {
+
+
+
+ }
+
+ /**
+ * Constructs a SharingProperties
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/SharingProperties} obj Optional instance to populate.
+ * @return {module:Model/SharingProperties} The populated SharingProperties
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new SharingProperties();
+
+
+
+
+
+ if (data.hasOwnProperty('sharingType')) {
+ obj['sharingType'] = ApiClient.convertToType(data['sharingType'], 'String');
+ }
+ if (data.hasOwnProperty('sharedWith')) {
+ obj['sharedWith'] = ApiClient.convertToType(data['sharedWith'], ['Number']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Indicates the permission that you are granting to the list of MIDs in sharedWith. Possible values are view, edit, or local.
+ * @member {module:Model/SharingProperties.SharingTypeEnum} sharingType
+ */
+ sharingType = undefined;
+ /**
+ * List of MID IDs the asset is shared with
+ * @member {Array.sharingType
property.
+ * @enum {String}
+ * @readonly
+ */
+ static SharingTypeEnum = {
+
+ /**
+ * value: "view"
+ * @const
+ */
+ "view": "view",
+
+ /**
+ * value: "edit"
+ * @const
+ */
+ "edit": "edit",
+
+ /**
+ * value: "local"
+ * @const
+ */
+ "local": "local"
+ };
+
+
+
+}
+
+
diff --git a/src/Model/UpdateEmailDefinitionRequest.js b/src/Model/UpdateEmailDefinitionRequest.js
new file mode 100644
index 0000000..23b4d6d
--- /dev/null
+++ b/src/Model/UpdateEmailDefinitionRequest.js
@@ -0,0 +1,131 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const CreateEmailDefinitionContent = require ('./CreateEmailDefinitionContent');
+const CreateEmailDefinitionOptionsRequest = require ('./CreateEmailDefinitionOptionsRequest');
+const CreateEmailDefinitionSubscriptions = require ('./CreateEmailDefinitionSubscriptions');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The UpdateEmailDefinitionRequest model module.
+* @module Model/UpdateEmailDefinitionRequest
+* @version 1.0.0
+*/
+module.exports = class UpdateEmailDefinitionRequest{
+ /**
+ * Constructs a new UpdateEmailDefinitionRequest
.
+ * @alias module:Model/UpdateEmailDefinitionRequest
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a UpdateEmailDefinitionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/UpdateEmailDefinitionRequest} obj Optional instance to populate.
+ * @return {module:Model/UpdateEmailDefinitionRequest} The populated UpdateEmailDefinitionRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new UpdateEmailDefinitionRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('content')) {
+ obj['content'] = CreateEmailDefinitionContent.constructFromObject(data['content']);
+ }
+ if (data.hasOwnProperty('status')) {
+ obj['status'] = ApiClient.convertToType(data['status'], 'String');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('classification')) {
+ obj['classification'] = ApiClient.convertToType(data['classification'], 'String');
+ }
+ if (data.hasOwnProperty('subscriptions')) {
+ obj['subscriptions'] = CreateEmailDefinitionSubscriptions.constructFromObject(data['subscriptions']);
+ }
+ if (data.hasOwnProperty('options')) {
+ obj['options'] = CreateEmailDefinitionOptionsRequest.constructFromObject(data['options']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Name of the definition. Must be unique.
+ * @member {String} name
+ */
+ name = undefined;
+ /**
+ * @member {module:Model/CreateEmailDefinitionContent} content
+ */
+ content = undefined;
+ /**
+ * Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days.
+ * @member {String} status
+ */
+ status = undefined;
+ /**
+ * User-provided description of the email definition.
+ * @member {String} description
+ */
+ description = undefined;
+ /**
+ * Marketing Cloud external key of a sending classification defined in Email Studio Administration. Only transactional classifications are permitted. Default is default transactional.
+ * @member {String} classification
+ */
+ classification = undefined;
+ /**
+ * @member {module:Model/CreateEmailDefinitionSubscriptions} subscriptions
+ */
+ subscriptions = undefined;
+ /**
+ * @member {module:Model/CreateEmailDefinitionOptionsRequest} options
+ */
+ options = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/Model/UpdateSmsDefinitionRequest.js b/src/Model/UpdateSmsDefinitionRequest.js
new file mode 100644
index 0000000..0499af2
--- /dev/null
+++ b/src/Model/UpdateSmsDefinitionRequest.js
@@ -0,0 +1,113 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require ('../ApiClient');
+const CreateSmsDefinitionContent = require ('./CreateSmsDefinitionContent');
+const CreateSmsDefinitionSubscriptions = require ('./CreateSmsDefinitionSubscriptions');
+
+
+
+
+
+const InvalidModelException = require('../Exception/InvalidModelException');
+
+/**
+* The UpdateSmsDefinitionRequest model module.
+* @module Model/UpdateSmsDefinitionRequest
+* @version 1.0.0
+*/
+module.exports = class UpdateSmsDefinitionRequest{
+ /**
+ * Constructs a new UpdateSmsDefinitionRequest
.
+ * @alias module:Model/UpdateSmsDefinitionRequest
+ * @class
+ */
+
+ constructor() {
+
+
+
+
+
+
+ }
+
+ /**
+ * Constructs a UpdateSmsDefinitionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:Model/UpdateSmsDefinitionRequest} obj Optional instance to populate.
+ * @return {module:Model/UpdateSmsDefinitionRequest} The populated UpdateSmsDefinitionRequest
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new UpdateSmsDefinitionRequest();
+
+
+
+
+
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('content')) {
+ obj['content'] = CreateSmsDefinitionContent.constructFromObject(data['content']);
+ }
+ if (data.hasOwnProperty('status')) {
+ obj['status'] = ApiClient.convertToType(data['status'], 'String');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('subscriptions')) {
+ obj['subscriptions'] = CreateSmsDefinitionSubscriptions.constructFromObject(data['subscriptions']);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Name of the definition. Must be unique.
+ * @member {String} name
+ */
+ name = undefined;
+ /**
+ * @member {module:Model/CreateSmsDefinitionContent} content
+ */
+ content = undefined;
+ /**
+ * Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days.
+ * @member {String} status
+ */
+ status = undefined;
+ /**
+ * User-provided description of the SMS definition.
+ * @member {String} description
+ */
+ description = undefined;
+ /**
+ * @member {module:Model/CreateSmsDefinitionSubscriptions} subscriptions
+ */
+ subscriptions = undefined;
+
+
+
+
+
+
+
+
+}
+
+
diff --git a/src/OAuth2ApiClient.js b/src/OAuth2ApiClient.js
new file mode 100644
index 0000000..ef6d706
--- /dev/null
+++ b/src/OAuth2ApiClient.js
@@ -0,0 +1,20 @@
+const ApiClient = require('./ApiClient');
+
+class OAuth2ApiClient extends ApiClient{
+ constructor(authService, runtimeInformationProvider){
+ super(runtimeInformationProvider);
+ this.authService = authService;
+ }
+
+ async callApi(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, caller) {
+
+ let tokenResponse = await this.authService.getTokenResponse();
+
+ this.basePath = tokenResponse['rest_instance_url'];
+ this.authentication['oauth2'].accessToken = tokenResponse['access_token'];
+
+ return super.callApi(path, httpMethod, pathParams, queryParams, headerParams, formParams, bodyParam, 'oauth2', contentTypes, accepts, returnType, caller);
+ }
+}
+
+module.exports = OAuth2ApiClient;
diff --git a/src/RuntimeInformationProvider.js b/src/RuntimeInformationProvider.js
new file mode 100644
index 0000000..9bbd56d
--- /dev/null
+++ b/src/RuntimeInformationProvider.js
@@ -0,0 +1,18 @@
+const pkg = require('../package');
+const os = require('os');
+
+class RuntimeInformationProvider{
+ constructor(){
+ this._nodeVersion = process.version;
+ this._osType = os.type();
+ this._osRelease = os.release();
+ }
+ getUserAgentString(){
+ return `MCSDK/NODE/${RuntimeInformationProvider.getSdkVersion()}/${this._nodeVersion}/${this._osType}/${this._osRelease}`;
+ }
+ static getSdkVersion(){
+ return pkg['version'];
+ }
+}
+
+module.exports = RuntimeInformationProvider;
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
new file mode 100644
index 0000000..0deabb0
--- /dev/null
+++ b/src/index.js
@@ -0,0 +1,321 @@
+/**
+ * Marketing Cloud REST API
+ * Marketing Cloud's REST API is our newest API. It supports multi-channel use cases, is much more lightweight and easy to use than our SOAP API, and is getting more comprehensive with every release.
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: mc_sdk@salesforce.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ *
+ */
+
+
+const ApiClient = require('./ApiClient');
+const ApiError = require ('./Model/ApiError');
+const Asset = require ('./Model/Asset');
+const AssetType = require ('./Model/AssetType');
+const Attributes = require ('./Model/Attributes');
+const Campaign = require ('./Model/Campaign');
+const CreateEmailDefinitionContent = require ('./Model/CreateEmailDefinitionContent');
+const CreateEmailDefinitionOptionsRequest = require ('./Model/CreateEmailDefinitionOptionsRequest');
+const CreateEmailDefinitionRequest = require ('./Model/CreateEmailDefinitionRequest');
+const CreateEmailDefinitionSubscriptions = require ('./Model/CreateEmailDefinitionSubscriptions');
+const CreateSmsDefinitionContent = require ('./Model/CreateSmsDefinitionContent');
+const CreateSmsDefinitionRequest = require ('./Model/CreateSmsDefinitionRequest');
+const CreateSmsDefinitionSubscriptions = require ('./Model/CreateSmsDefinitionSubscriptions');
+const DeleteQueuedMessagesForSendDefinitionResponse = require ('./Model/DeleteQueuedMessagesForSendDefinitionResponse');
+const DeleteSendDefinitionResponse = require ('./Model/DeleteSendDefinitionResponse');
+const GetDefinitionSendStatusForRecipientResponse = require ('./Model/GetDefinitionSendStatusForRecipientResponse');
+const GetDefinitionSendStatusForRecipientResponseInfo = require ('./Model/GetDefinitionSendStatusForRecipientResponseInfo');
+const GetDefinitionsNotSentToRecipientsMessage = require ('./Model/GetDefinitionsNotSentToRecipientsMessage');
+const GetDefinitionsNotSentToRecipientsMessageInfo = require ('./Model/GetDefinitionsNotSentToRecipientsMessageInfo');
+const GetDefinitionsNotSentToRecipientsResponse = require ('./Model/GetDefinitionsNotSentToRecipientsResponse');
+const GetEmailDefinitionsResponse = require ('./Model/GetEmailDefinitionsResponse');
+const GetQueueMetricsForSendDefinitionResponse = require ('./Model/GetQueueMetricsForSendDefinitionResponse');
+const GetSmsDefinitionsResponse = require ('./Model/GetSmsDefinitionsResponse');
+const Recipient = require ('./Model/Recipient');
+const SendDefinitionResponseItem = require ('./Model/SendDefinitionResponseItem');
+const SendDefinitionToMultipleRecipientsResponse = require ('./Model/SendDefinitionToMultipleRecipientsResponse');
+const SendDefinitionToSingleRecipientResponse = require ('./Model/SendDefinitionToSingleRecipientResponse');
+const SendEmailToMultipleRecipientsRequest = require ('./Model/SendEmailToMultipleRecipientsRequest');
+const SendEmailToSingleRecipientRequest = require ('./Model/SendEmailToSingleRecipientRequest');
+const SendSmsContentRequest = require ('./Model/SendSmsContentRequest');
+const SendSmsToMultipleRecipientsRequest = require ('./Model/SendSmsToMultipleRecipientsRequest');
+const SendSmsToMultipleRecipientsSubscriptionsRequest = require ('./Model/SendSmsToMultipleRecipientsSubscriptionsRequest');
+const SendSmsToSingleRecipientRequest = require ('./Model/SendSmsToSingleRecipientRequest');
+const SharingProperties = require ('./Model/SharingProperties');
+const UpdateEmailDefinitionRequest = require ('./Model/UpdateEmailDefinitionRequest');
+const UpdateSmsDefinitionRequest = require ('./Model/UpdateSmsDefinitionRequest');
+const AssetApi = require ('./Api/AssetApi');
+const CampaignApi = require ('./Api/CampaignApi');
+const TransactionalMessagingApi = require ('./Api/TransactionalMessagingApi');
+
+
+/**
+* Marketing_Clouds_REST_API_is_our_newest_API__It_supports_multi_channel_use_cases_is_much_more_lightweight_and_easy_to_use_than_our_SOAP_API_and_is_getting_more_comprehensive_with_every_release_.
+* The index
module provides access to constructors for all the classes which comprise the public API.
+*
+* var SalesforceMarketingCloud = require('index'); // See note below*.
+* var xxxSvc = new SalesforceMarketingCloud.XxxApi(); // Allocate the API class we're going to use.
+* var yyyModel = new SalesforceMarketingCloud.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+*
+* *NOTE: For a top-level AMD script, use require(['index'], function(){...})
+* and put the application logic within the callback function.
+*
+* A non-AMD browser application (discouraged) might do something like this: +*
+* var xxxSvc = new SalesforceMarketingCloud.XxxApi(); // Allocate the API class we're going to use. +* var yyy = new SalesforceMarketingCloud.Yyy(); // Construct a model instance. +* yyyModel.someProperty = 'someValue'; +* ... +* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service. +* ... +*+* +* @module index +* @version 1.0.0 +*/ +module.exports={ + /** + * The ApiClient constructor. + * @property {module:ApiClient} + */ + ApiClient, + + /** + * The ApiError model constructor. + * @property {module:Model/ApiError} + */ + ApiError, + + /** + * The Asset model constructor. + * @property {module:Model/Asset} + */ + Asset, + + /** + * The AssetType model constructor. + * @property {module:Model/AssetType} + */ + AssetType, + + /** + * The Attributes model constructor. + * @property {module:Model/Attributes} + */ + Attributes, + + /** + * The Campaign model constructor. + * @property {module:Model/Campaign} + */ + Campaign, + + /** + * The CreateEmailDefinitionContent model constructor. + * @property {module:Model/CreateEmailDefinitionContent} + */ + CreateEmailDefinitionContent, + + /** + * The CreateEmailDefinitionOptionsRequest model constructor. + * @property {module:Model/CreateEmailDefinitionOptionsRequest} + */ + CreateEmailDefinitionOptionsRequest, + + /** + * The CreateEmailDefinitionRequest model constructor. + * @property {module:Model/CreateEmailDefinitionRequest} + */ + CreateEmailDefinitionRequest, + + /** + * The CreateEmailDefinitionSubscriptions model constructor. + * @property {module:Model/CreateEmailDefinitionSubscriptions} + */ + CreateEmailDefinitionSubscriptions, + + /** + * The CreateSmsDefinitionContent model constructor. + * @property {module:Model/CreateSmsDefinitionContent} + */ + CreateSmsDefinitionContent, + + /** + * The CreateSmsDefinitionRequest model constructor. + * @property {module:Model/CreateSmsDefinitionRequest} + */ + CreateSmsDefinitionRequest, + + /** + * The CreateSmsDefinitionSubscriptions model constructor. + * @property {module:Model/CreateSmsDefinitionSubscriptions} + */ + CreateSmsDefinitionSubscriptions, + + /** + * The DeleteQueuedMessagesForSendDefinitionResponse model constructor. + * @property {module:Model/DeleteQueuedMessagesForSendDefinitionResponse} + */ + DeleteQueuedMessagesForSendDefinitionResponse, + + /** + * The DeleteSendDefinitionResponse model constructor. + * @property {module:Model/DeleteSendDefinitionResponse} + */ + DeleteSendDefinitionResponse, + + /** + * The GetDefinitionSendStatusForRecipientResponse model constructor. + * @property {module:Model/GetDefinitionSendStatusForRecipientResponse} + */ + GetDefinitionSendStatusForRecipientResponse, + + /** + * The GetDefinitionSendStatusForRecipientResponseInfo model constructor. + * @property {module:Model/GetDefinitionSendStatusForRecipientResponseInfo} + */ + GetDefinitionSendStatusForRecipientResponseInfo, + + /** + * The GetDefinitionsNotSentToRecipientsMessage model constructor. + * @property {module:Model/GetDefinitionsNotSentToRecipientsMessage} + */ + GetDefinitionsNotSentToRecipientsMessage, + + /** + * The GetDefinitionsNotSentToRecipientsMessageInfo model constructor. + * @property {module:Model/GetDefinitionsNotSentToRecipientsMessageInfo} + */ + GetDefinitionsNotSentToRecipientsMessageInfo, + + /** + * The GetDefinitionsNotSentToRecipientsResponse model constructor. + * @property {module:Model/GetDefinitionsNotSentToRecipientsResponse} + */ + GetDefinitionsNotSentToRecipientsResponse, + + /** + * The GetEmailDefinitionsResponse model constructor. + * @property {module:Model/GetEmailDefinitionsResponse} + */ + GetEmailDefinitionsResponse, + + /** + * The GetQueueMetricsForSendDefinitionResponse model constructor. + * @property {module:Model/GetQueueMetricsForSendDefinitionResponse} + */ + GetQueueMetricsForSendDefinitionResponse, + + /** + * The GetSmsDefinitionsResponse model constructor. + * @property {module:Model/GetSmsDefinitionsResponse} + */ + GetSmsDefinitionsResponse, + + /** + * The Recipient model constructor. + * @property {module:Model/Recipient} + */ + Recipient, + + /** + * The SendDefinitionResponseItem model constructor. + * @property {module:Model/SendDefinitionResponseItem} + */ + SendDefinitionResponseItem, + + /** + * The SendDefinitionToMultipleRecipientsResponse model constructor. + * @property {module:Model/SendDefinitionToMultipleRecipientsResponse} + */ + SendDefinitionToMultipleRecipientsResponse, + + /** + * The SendDefinitionToSingleRecipientResponse model constructor. + * @property {module:Model/SendDefinitionToSingleRecipientResponse} + */ + SendDefinitionToSingleRecipientResponse, + + /** + * The SendEmailToMultipleRecipientsRequest model constructor. + * @property {module:Model/SendEmailToMultipleRecipientsRequest} + */ + SendEmailToMultipleRecipientsRequest, + + /** + * The SendEmailToSingleRecipientRequest model constructor. + * @property {module:Model/SendEmailToSingleRecipientRequest} + */ + SendEmailToSingleRecipientRequest, + + /** + * The SendSmsContentRequest model constructor. + * @property {module:Model/SendSmsContentRequest} + */ + SendSmsContentRequest, + + /** + * The SendSmsToMultipleRecipientsRequest model constructor. + * @property {module:Model/SendSmsToMultipleRecipientsRequest} + */ + SendSmsToMultipleRecipientsRequest, + + /** + * The SendSmsToMultipleRecipientsSubscriptionsRequest model constructor. + * @property {module:Model/SendSmsToMultipleRecipientsSubscriptionsRequest} + */ + SendSmsToMultipleRecipientsSubscriptionsRequest, + + /** + * The SendSmsToSingleRecipientRequest model constructor. + * @property {module:Model/SendSmsToSingleRecipientRequest} + */ + SendSmsToSingleRecipientRequest, + + /** + * The SharingProperties model constructor. + * @property {module:Model/SharingProperties} + */ + SharingProperties, + + /** + * The UpdateEmailDefinitionRequest model constructor. + * @property {module:Model/UpdateEmailDefinitionRequest} + */ + UpdateEmailDefinitionRequest, + + /** + * The UpdateSmsDefinitionRequest model constructor. + * @property {module:Model/UpdateSmsDefinitionRequest} + */ + UpdateSmsDefinitionRequest, + + /** + * The AssetApi service constructor. + * @property {module:Api/AssetApi} + */ + AssetApi, + + /** + * The CampaignApi service constructor. + * @property {module:Api/CampaignApi} + */ + CampaignApi, + + /** + * The TransactionalMessagingApi service constructor. + * @property {module:Api/TransactionalMessagingApi} + */ + TransactionalMessagingApi +}; diff --git a/test/TestHelper.js b/test/TestHelper.js new file mode 100644 index 0000000..c76f906 --- /dev/null +++ b/test/TestHelper.js @@ -0,0 +1,52 @@ +const ClientConfiguration = require('../src/Auth/ClientConfiguration'); + +class TestHelper { + static createTokenResponseData() { + return { + data: { + access_token: 'access_token', + expires_in: 1080, + rest_instance_url: 'rest_instance_url', + soap_instance_url: 'soap_instance_url', + scope: 'scope', + token_type: 'Bearer' + } + } + } + static createClientConfiguration() { + return new ClientConfiguration( + 'https://auth.com', + 'clientId', + 'clientSecret', + 123456, + 'scope' + ) + } + static createRequestResponse(statusCode) { + return { + status: statusCode, + response: { + body: 'errorResponseBody' + } + } + } + static createServerUnreachableError(){ + return { + code: 'ENOTFOUND', + errno: 'ENOTFOUND', + syscall: 'getaddrinfo', + hostname: 'host' + } + } + static createConfigProvider(){ + return { + authBaseUrl: 'authBaseUrl', + clientId: 'clientId', + clientSecret: 'clientSecret', + accountId: 'accountId', + scope: 'scope', + } + } +} + +module.exports = TestHelper; \ No newline at end of file diff --git a/test/integration/api/ApiSutFactory.js b/test/integration/api/ApiSutFactory.js new file mode 100644 index 0000000..69768dc --- /dev/null +++ b/test/integration/api/ApiSutFactory.js @@ -0,0 +1,20 @@ +const EnvironmentConfigProvider = require('../../../src/EnvironmentConfigProvider'); + +class ApiSutFactory{ + constructor(type){ + this._type = type; + } + create(){ + let environmentConfigProvider = new EnvironmentConfigProvider(); + + let authBaseUrl = environmentConfigProvider.get('SFMC_AUTH_BASE_URL'); + let clientId = environmentConfigProvider.get('SFMC_CLIENT_ID'); + let clientSecret = environmentConfigProvider.get('SFMC_CLIENT_SECRET'); + let accountId = environmentConfigProvider.get('SFMC_ACCOUNT_ID'); + let scope = environmentConfigProvider.get('SFMC_SCOPE', false); + + return new this._type(authBaseUrl, clientId, clientSecret, accountId, scope); + } +} + +module.exports = ApiSutFactory; \ No newline at end of file diff --git a/test/integration/api/AssetApi.spec.js b/test/integration/api/AssetApi.spec.js new file mode 100644 index 0000000..6da584f --- /dev/null +++ b/test/integration/api/AssetApi.spec.js @@ -0,0 +1,113 @@ +const ApiSutFactory = require('./ApiSutFactory'); + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../../src'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../../src')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SalesforceMarketingCloud); + } +}(this, function(expect, SalesforceMarketingCloud) { + 'use strict'; + + const HTML_EMAIL_ASSET_TYPE_ID = 196; + + let assetApiInstance; + + before(()=>{ + assetApiInstance = new ApiSutFactory(SalesforceMarketingCloud.AssetApi.prototype.constructor).create(); + }); + + describe('AssetApi', function() { + describe('createAsset', function() { + it('should call createAsset successfully', async ()=>{ + let asset = createAssetObject(); + + let createAssetResponse = await assetApiInstance.createAsset(asset); + + expect(createAssetResponse.customerKey).to.eql(asset.customerKey); + expect(createAssetResponse.name).to.eql(asset.name); + expect(createAssetResponse.description).to.eql(asset.description); + expect(createAssetResponse.assetType.id).to.eql(asset.assetType.id); + expect(createAssetResponse.assetType.name).to.eql(asset.assetType.name); + + await assetApiInstance.deleteAssetById(createAssetResponse.id); + }); + }); + describe('deleteAssetById', function() { + it('should call deleteAssetById successfully', async ()=>{ + let asset = createAssetObject(); + let createAssetResponse = await assetApiInstance.createAsset(asset); + let assetToDeleteId = createAssetResponse.id; + + await assetApiInstance.deleteAssetById(assetToDeleteId); + + try{ + await assetApiInstance.getAssetById(assetToDeleteId); + } + catch(error) { + expect(error.status).to.eql(404); + + return + } + expect().fail('Exception was not thrown'); + }); + }); + describe('getAssetById', function() { + it('should call getAssetById successfully', async ()=> { + let asset = createAssetObject(); + let createAssetResponse = await assetApiInstance.createAsset(asset); + let assetToRetrieveId = createAssetResponse.id; + + let getAssetByIdResponse = await assetApiInstance.getAssetById(assetToRetrieveId); + + expect(getAssetByIdResponse.customerKey).to.eql(asset.customerKey); + expect(getAssetByIdResponse.name).to.eql(asset.name); + expect(getAssetByIdResponse.description).to.eql(asset.description); + expect(getAssetByIdResponse.assetType.id).to.eql(asset.assetType.id); + expect(getAssetByIdResponse.assetType.name).to.eql(asset.assetType.name); + + await assetApiInstance.deleteAssetById(createAssetResponse.id); + }); + }); + describe('partiallyUpdateAssetById', function() { + it('should call partiallyUpdateAssetById successfully', async ()=> { + let asset = createAssetObject(); + let createAssetResponse = await assetApiInstance.createAsset(asset); + let assetToPartiallyUpdateId = createAssetResponse.id; + createAssetResponse.description = 'Updated asset description'; + + let partiallyUpdateAssetResult = await assetApiInstance.partiallyUpdateAssetById(assetToPartiallyUpdateId, createAssetResponse); + + expect(partiallyUpdateAssetResult.description).to.eql(createAssetResponse.description); + + expect(partiallyUpdateAssetResult.customerKey).to.eql(asset.customerKey); + expect(partiallyUpdateAssetResult.name).to.eql(asset.name); + expect(partiallyUpdateAssetResult.assetType.id).to.eql(asset.assetType.id); + expect(partiallyUpdateAssetResult.assetType.name).to.eql(asset.assetType.name); + + await assetApiInstance.deleteAssetById(createAssetResponse.id); + }); + }); + }); + + function createAssetObject() { + let assetType = new SalesforceMarketingCloud.AssetType(HTML_EMAIL_ASSET_TYPE_ID, 'textblock'); + + let customerKey = getUUID(10); + let assetName = 'Asset ' + getUUID(10); + let assetDescription = 'Asset from Automated Node.js SDK'; + + return new SalesforceMarketingCloud.Asset(customerKey, assetType, assetName, assetDescription); + } + + function getUUID(length){ + return Math.random().toString(16).substring(0, length); + } +})); + + diff --git a/test/integration/api/CampaignApi.spec.js b/test/integration/api/CampaignApi.spec.js new file mode 100644 index 0000000..1095522 --- /dev/null +++ b/test/integration/api/CampaignApi.spec.js @@ -0,0 +1,90 @@ +const ApiSutFactory = require('./ApiSutFactory'); + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../../src'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../../src')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SalesforceMarketingCloud); + } +}(this, function(expect, SalesforceMarketingCloud) { + 'use strict'; + + let campaignApiInstance; + + before(()=>{ + campaignApiInstance = new ApiSutFactory(SalesforceMarketingCloud.CampaignApi.prototype.constructor).create(); + }); + + describe('CampaignApi', function() { + describe('createCampaign', function() { + it('should call createCampaign successfully', async ()=> { + let campaign = createCampaignObject(); + + let createCampaignResponse = await campaignApiInstance.createCampaign(campaign); + + expect(createCampaignResponse.name).to.eql(campaign.name); + expect(createCampaignResponse.description).to.eql(campaign.description); + expect(createCampaignResponse.campaignCode).to.eql(campaign.campaignCode); + expect(createCampaignResponse.color).to.eql(campaign.color); + expect(createCampaignResponse.favorite).to.eql(campaign.favorite); + + await campaignApiInstance.deleteCampaignById(createCampaignResponse.id); + }); + }); + describe('deleteCampaignById', function() { + it('should call deleteCampaignById successfully', async ()=> { + let campaign = createCampaignObject(); + let createCampaignResponse = await campaignApiInstance.createCampaign(campaign); + let campaignToDeleteId = createCampaignResponse.id; + + await campaignApiInstance.deleteCampaignById(campaignToDeleteId); + + try { + await campaignApiInstance.getCampaignById(campaignToDeleteId); + } + catch (error) { + expect(error.status).to.eql(400); + + return + } + expect().fail('Exception was not thrown'); + }); + }); + describe('getCampaignById', function() { + it('should call getCampaignById successfully', async ()=> { + let campaign = createCampaignObject(); + let createCampaignResponse = await campaignApiInstance.createCampaign(campaign); + let campaignToRetrieveId = createCampaignResponse.id; + + let getCampaignByIdResponse = await campaignApiInstance.getCampaignById(campaignToRetrieveId); + + expect(getCampaignByIdResponse.name).to.eql(campaign.name); + expect(getCampaignByIdResponse.description).to.eql(campaign.description); + expect(getCampaignByIdResponse.campaignCode).to.eql(campaign.campaignCode); + expect(getCampaignByIdResponse.color).to.eql(campaign.color); + expect(getCampaignByIdResponse.favorite).to.eql(campaign.favorite); + + await campaignApiInstance.deleteCampaignById(createCampaignResponse.id); + }); + }); + }); + + function createCampaignObject() { + let campaignName = 'Campaign ' + getUUID(10); + let campaignDescription = 'Campaign from Automated Node.js SDK'; + let campaignCode = 'CampaignCode'; + let campaignColor = "0000ff"; + let favorite = false; + + return new SalesforceMarketingCloud.Campaign(campaignName, campaignDescription, campaignCode, campaignColor, favorite); + } + + function getUUID(length){ + return Math.random().toString(16).substring(0, length); + } +})); diff --git a/test/integration/api/TransactionalMessagingApi.spec.js b/test/integration/api/TransactionalMessagingApi.spec.js new file mode 100644 index 0000000..22ba05b --- /dev/null +++ b/test/integration/api/TransactionalMessagingApi.spec.js @@ -0,0 +1,460 @@ +const ApiSutFactory = require('./ApiSutFactory'); +const EnvironmentConfigProvider = require('../../../src/EnvironmentConfigProvider'); + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../../src'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../../src')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SalesforceMarketingCloud); + } +}(this, function(expect, SalesforceMarketingCloud) { + 'use strict'; + + const JOHN_DOE_GMAIL_COM = "johnDoe@gmail.com"; + const JOHANNA_DOE_YAHOO_COM = "johannaDoe@yahoo.com"; + const HTML_EMAIL_ASSET_TYPE_ID = 208; + + let assetApiInstance; + let transactionalMessagingApiInstance; + let environmentConfigProvider; + + before(()=>{ + transactionalMessagingApiInstance = new ApiSutFactory(SalesforceMarketingCloud.TransactionalMessagingApi.prototype.constructor).create(); + assetApiInstance = new ApiSutFactory(SalesforceMarketingCloud.AssetApi.prototype.constructor).create(); + environmentConfigProvider = new EnvironmentConfigProvider(); + }); + + describe('TransactionalMessagingApi', function() { + describe('createEmailDefinition', function() { + it('should call createEmailDefinition successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + + expect(createEmailDefinitionResult.name).to.eql(emailDefinition.name); + expect(createEmailDefinitionResult.definitionKey).to.eql(emailDefinition.definitionKey); + expect(createEmailDefinitionResult.content.customerKey).to.eql(emailDefinition.content.customerKey); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('createSmsDefinition', function() { + it('should call createSmsDefinition successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + + expect(createSmsDefinitionResult.definitionKey).to.eql(smsDefinition.definitionKey); + expect(createSmsDefinitionResult.name).to.eql(smsDefinition.name); + expect(createSmsDefinitionResult.subscriptions.shortCode).to.eql(smsDefinition.subscriptions.shortCode); + expect(createSmsDefinitionResult.subscriptions.countryCode).to.eql(smsDefinition.subscriptions.countryCode); + expect(createSmsDefinitionResult.content).to.eql(smsDefinition.content); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + describe('deleteEmailDefinition', function() { + it('should call deleteEmailDefinition successfully when definitionKey is valid', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + + let deleteEmailDefinitionResult = await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + + expect(deleteEmailDefinitionResult.requestId).not.be(undefined); + expect(deleteEmailDefinitionResult.deletedDefinitionKey).not.be(undefined); + expect(deleteEmailDefinitionResult.message).to.eql("Success"); + }); + }); + describe('deleteEmailDefinition', function() { + it('should not call deleteEmailDefinition successfully when definitionKey is invalid', async ()=> { + let emailDefinitionToDeleteKey = 'NonExistingEmailDefinitionKey'; + + try{ + await transactionalMessagingApiInstance.deleteEmailDefinition(emailDefinitionToDeleteKey); + } + catch (error) { + expect(error.status).to.eql(404); + } + }); + }); + describe('deleteQueuedMessagesForEmailDefinition', function() { + it('should call deleteQueuedMessagesForEmailDefinition successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + emailDefinition.status = 'inactive'; + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + + let deleteQueuedMessagesForEmailDefinitionResult = await transactionalMessagingApiInstance.deleteQueuedMessagesForEmailDefinition(createEmailDefinitionResult.definitionKey); + + expect(deleteQueuedMessagesForEmailDefinitionResult.requestId).not.be(undefined); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('deleteQueuedMessagesForSmsDefinition', function() { + it('should call deleteQueuedMessagesForSmsDefinition successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + smsDefinition.status = 'inactive'; + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + + let deleteQueuedMessagesForSmsDefinitionResult = await transactionalMessagingApiInstance.deleteQueuedMessagesForSmsDefinition(createSmsDefinitionResult.definitionKey); + + expect(deleteQueuedMessagesForSmsDefinitionResult.requestId).not.be(undefined); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + describe('deleteSmsDefinition', function() { + it('should call deleteSmsDefinition successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + + let deleteSmsDefinitionResult = await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + + expect(deleteSmsDefinitionResult.requestId).not.be(undefined); + expect(deleteSmsDefinitionResult.deletedDefinitionKey).not.be(undefined); + expect(deleteSmsDefinitionResult.message).to.eql("Success"); + }); + }); + describe('deleteSmsDefinition', function() { + it('should not call deleteSmsDefinition successfully when definitionKey is invalid', async ()=> { + let smsDefinitionToDeleteKey = 'NonExistingSmsDefinitionKey'; + + try{ + await transactionalMessagingApiInstance.deleteSmsDefinition(smsDefinitionToDeleteKey); + } + catch (error) { + expect(error.status).to.eql(404); + } + }); + }); + describe('getEmailDefinition', function() { + it('should call getEmailDefinition successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + + let getEmailDefinitionsResult = await transactionalMessagingApiInstance.getEmailDefinition(createEmailDefinitionResult.definitionKey); + + expect(getEmailDefinitionsResult.name).to.eql(emailDefinition.name); + expect(getEmailDefinitionsResult.definitionKey).to.eql(emailDefinition.definitionKey); + expect(getEmailDefinitionsResult.content.customerKey).to.eql(emailDefinition.content.customerKey); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('getEmailDefinitions', function() { + it('should call getEmailDefinitions successfully', async ()=> { + let opts = { + 'status': undefined, + 'orderBy': undefined, + 'pageSize': undefined, + 'page': undefined + }; + + let getEmailDefinitionsResult = await transactionalMessagingApiInstance.getEmailDefinitions(opts); + + expect(getEmailDefinitionsResult.requestId).not.be(undefined); + expect(getEmailDefinitionsResult.definitions).not.be(undefined); + expect(getEmailDefinitionsResult.count).not.be(undefined); + expect(getEmailDefinitionsResult.page).not.be(undefined); + expect(getEmailDefinitionsResult.pageSize).not.be(undefined); + }); + }); + describe('getEmailSendStatusForRecipient', function() { + it('should call getEmailSendStatusForRecipient successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + let recipient = new SalesforceMarketingCloud.Recipient(JOHN_DOE_GMAIL_COM); + let messageRequestBody = new SalesforceMarketingCloud.SendEmailToSingleRecipientRequest(createEmailDefinitionResult.definitionKey, recipient); + let messageKey = getUUID(); + await transactionalMessagingApiInstance.sendEmailToSingleRecipient(messageKey, messageRequestBody); + + let getEmailSendStatusForRecipientResult = await transactionalMessagingApiInstance.getEmailSendStatusForRecipient(messageKey); + + let eventCategoryTypes = ['TransactionalSendEvents.EmailSent', 'TransactionalSendEvents.EmailQueued', 'TransactionalSendEvents.EmailNotSent']; + + expect(getEmailSendStatusForRecipientResult.requestId).not.be(undefined); + expect(getEmailSendStatusForRecipientResult.timestamp).not.be(undefined); + expect(eventCategoryTypes).to.contain(getEmailSendStatusForRecipientResult.eventCategoryType); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('getEmailsNotSentToRecipients', function() { + it('should call getEmailsNotSentToRecipients successfully', async ()=> { + let opts = { + 'pageSize':undefined, + 'lastEventId':undefined + }; + + let getEmailsNotSentToRecipientsResponse = await transactionalMessagingApiInstance.getEmailsNotSentToRecipients('notSent', opts); + + expect(getEmailsNotSentToRecipientsResponse.requestId).not.be(undefined); + expect(getEmailsNotSentToRecipientsResponse.lastEventID).not.be(undefined); + expect(getEmailsNotSentToRecipientsResponse.messages).not.be(undefined); + expect(getEmailsNotSentToRecipientsResponse.count).not.be(undefined); + expect(getEmailsNotSentToRecipientsResponse.pageSize).not.be(undefined); + }); + }); + describe('getQueueMetricsForEmailDefinition', function() { + it('should call getQueueMetricsForEmailDefinition successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + + let getQueueMetricsForEmailDefinitionResult = await transactionalMessagingApiInstance.getQueueMetricsForEmailDefinition(createEmailDefinitionResult.definitionKey); + + expect(getQueueMetricsForEmailDefinitionResult.requestId); + expect(getQueueMetricsForEmailDefinitionResult.count); + expect(getQueueMetricsForEmailDefinitionResult.ageSeconds); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('getQueueMetricsForSmsDefinition', function() { + it('should call getQueueMetricsForSmsDefinition successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + + let getQueueMetricsForSmsDefinitionResult = await transactionalMessagingApiInstance.getQueueMetricsForSmsDefinition(createSmsDefinitionResult.definitionKey); + + expect(getQueueMetricsForSmsDefinitionResult.requestId); + expect(getQueueMetricsForSmsDefinitionResult.count); + expect(getQueueMetricsForSmsDefinitionResult.ageSeconds); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + describe('getSMSsNotSentToRecipients', function() { + it('should call getSMSsNotSentToRecipients successfully', async ()=> { + let opts = { + 'pageSize':undefined, + 'lastEventId':undefined + }; + + let getSMSsNotSentToRecipientsResponse = await transactionalMessagingApiInstance.getSMSsNotSentToRecipients('notSent', opts); + + expect(getSMSsNotSentToRecipientsResponse.requestId).not.be(undefined); + expect(getSMSsNotSentToRecipientsResponse.lastEventID).not.be(undefined); + expect(getSMSsNotSentToRecipientsResponse.messages).not.be(undefined); + expect(getSMSsNotSentToRecipientsResponse.count).not.be(undefined); + expect(getSMSsNotSentToRecipientsResponse.pageSize).not.be(undefined); + }); + }); + describe('getSmsDefinition', function() { + it('should call getSmsDefinition successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + + let getSmsDefinitionResult = await transactionalMessagingApiInstance.getSmsDefinition(createSmsDefinitionResult.definitionKey); + + expect(getSmsDefinitionResult.definitionKey).to.eql(smsDefinition.definitionKey); + expect(getSmsDefinitionResult.name).to.eql(smsDefinition.name); + expect(getSmsDefinitionResult.subscriptions.shortCode).to.eql(smsDefinition.subscriptions.shortCode); + expect(getSmsDefinitionResult.subscriptions.countryCode).to.eql(smsDefinition.subscriptions.countryCode); + expect(getSmsDefinitionResult.content).to.eql(smsDefinition.content); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + describe('getSmsDefinitions', function() { + it('should call getSmsDefinitions successfully', async ()=> { + let opts = { + 'status':undefined, + 'orderBy':undefined, + 'pageSize':undefined, + 'page':undefined + }; + + let getSmsDefinitionsResult = await transactionalMessagingApiInstance.getSmsDefinitions(opts); + + expect(getSmsDefinitionsResult.requestId).not.be(undefined); + expect(getSmsDefinitionsResult.definitions).not.be(undefined); + expect(getSmsDefinitionsResult.count).not.be(undefined); + expect(getSmsDefinitionsResult.page).not.be(undefined); + expect(getSmsDefinitionsResult.pageSize).not.be(undefined); + }); + }); + describe('getSmsSendStatusForRecipient', function() { + it('should call getSmsSendStatusForRecipient successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + let recipient = new SalesforceMarketingCloud.Recipient(JOHN_DOE_GMAIL_COM); + let messageRequestBody = new SalesforceMarketingCloud.SendSmsToSingleRecipientRequest(createSmsDefinitionResult.definitionKey, recipient); + let messageKey = getUUID(); + await transactionalMessagingApiInstance.sendSmsToSingleRecipient(messageKey, messageRequestBody); + + let getSmsSendStatusForRecipientResult = await transactionalMessagingApiInstance.getSmsSendStatusForRecipient(messageKey); + + let eventCategoryTypes = ['TransactionalSendEvents.SMSSent', 'TransactionalSendEvents.SMSQueued', 'TransactionalSendEvents.SMSNotSent']; + + expect(getSmsSendStatusForRecipientResult.requestId).not.be(undefined); + expect(getSmsSendStatusForRecipientResult.timestamp).not.be(undefined); + expect(eventCategoryTypes).to.contain(getSmsSendStatusForRecipientResult.eventCategoryType); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + describe('partiallyUpdateEmailDefinition', function() { + it('should call partiallyUpdateEmailDefinition successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + let updatedDefinitionDescription = new SalesforceMarketingCloud.UpdateEmailDefinitionRequest(); + updatedDefinitionDescription.description = 'Updated email definition description'; + + let partiallyUpdateEmailDefinitionResult = await transactionalMessagingApiInstance.partiallyUpdateEmailDefinition(createEmailDefinitionResult.definitionKey, updatedDefinitionDescription); + + expect(partiallyUpdateEmailDefinitionResult.description).to.eql(updatedDefinitionDescription.description); + + expect(partiallyUpdateEmailDefinitionResult.definitionKey).to.eql(emailDefinition.definitionKey); + expect(partiallyUpdateEmailDefinitionResult.name).to.eql(emailDefinition.name); + expect(partiallyUpdateEmailDefinitionResult.content.customerKey).to.eql(emailDefinition.content.customerKey); + expect(partiallyUpdateEmailDefinitionResult.content.customerKey).to.eql(emailDefinition.content.customerKey); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('partiallyUpdateSmsDefinition', function() { + it('should call partiallyUpdateSmsDefinition successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + let updatedDefinitionDescription = new SalesforceMarketingCloud.UpdateSmsDefinitionRequest(); + updatedDefinitionDescription.description = 'Updated SMS definition description'; + + let partiallyUpdateSmsDefinitionResult = await transactionalMessagingApiInstance.partiallyUpdateSmsDefinition(createSmsDefinitionResult.definitionKey, updatedDefinitionDescription); + + expect(partiallyUpdateSmsDefinitionResult.description).to.eql(updatedDefinitionDescription.description); + + expect(partiallyUpdateSmsDefinitionResult.definitionKey).to.eql(smsDefinition.definitionKey); + expect(partiallyUpdateSmsDefinitionResult.name).to.eql(smsDefinition.name); + expect(partiallyUpdateSmsDefinitionResult.content.customerKey).to.eql(smsDefinition.content.customerKey); + expect(partiallyUpdateSmsDefinitionResult.content.customerKey).to.eql(smsDefinition.content.customerKey); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + describe('sendEmailToMultipleRecipients', function() { + it('should call sendEmailToMultipleRecipients successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + let recipient1 = new SalesforceMarketingCloud.Recipient(JOHN_DOE_GMAIL_COM); + let recipient2 = new SalesforceMarketingCloud.Recipient(JOHANNA_DOE_YAHOO_COM); + let recipientsList = [recipient1, recipient2]; + let batchMessageRequestBody = new SalesforceMarketingCloud.SendEmailToMultipleRecipientsRequest(createEmailDefinitionResult.definitionKey, recipientsList); + + let sendEmailToMultipleRecipientsResult = await transactionalMessagingApiInstance.sendEmailToMultipleRecipients(batchMessageRequestBody); + + expect(sendEmailToMultipleRecipientsResult.requestId).not.be(undefined); + expect(sendEmailToMultipleRecipientsResult.errorcode).not.be(undefined); + expect(sendEmailToMultipleRecipientsResult.responses).not.be(undefined); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('sendEmailToSingleRecipient', function() { + it('should call sendEmailToSingleRecipient successfully', async ()=> { + let emailDefinition = await createEmailDefinitionObject(); + let createEmailDefinitionResult = await transactionalMessagingApiInstance.createEmailDefinition(emailDefinition); + let recipient = new SalesforceMarketingCloud.Recipient(JOHN_DOE_GMAIL_COM); + let messageRequestBody = new SalesforceMarketingCloud.SendEmailToSingleRecipientRequest(createEmailDefinitionResult.definitionKey, recipient); + let messageKey = getUUID(); + + let sendEmailToSingleRecipientResult = await transactionalMessagingApiInstance.sendEmailToSingleRecipient(messageKey, messageRequestBody); + + expect(sendEmailToSingleRecipientResult.requestId).not.be(undefined); + expect(sendEmailToSingleRecipientResult.errorcode).not.be(undefined); + expect(sendEmailToSingleRecipientResult.responses).not.be(undefined); + + await transactionalMessagingApiInstance.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + }); + }); + describe('sendSmsToMultipleRecipients', function() { + it('should call sendSmsToMultipleRecipients successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + let recipient1 = new SalesforceMarketingCloud.Recipient(JOHN_DOE_GMAIL_COM); + let recipient2 = new SalesforceMarketingCloud.Recipient(JOHANNA_DOE_YAHOO_COM); + let recipientsList = [recipient1, recipient2]; + let batchMessageRequestBody = new SalesforceMarketingCloud.SendSmsToMultipleRecipientsRequest(createSmsDefinitionResult.definitionKey, recipientsList); + + let sendSmsToMultipleRecipientsResult = await transactionalMessagingApiInstance.sendSmsToMultipleRecipients(batchMessageRequestBody); + + expect(sendSmsToMultipleRecipientsResult.requestId).not.be(undefined); + expect(sendSmsToMultipleRecipientsResult.errorcode).not.be(undefined); + expect(sendSmsToMultipleRecipientsResult.responses).not.be(undefined); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + describe('sendSmsToSingleRecipient', function() { + it('should call sendSmsToSingleRecipient successfully', async ()=> { + let smsDefinition = createSmsDefinitionObject(); + let createSmsDefinitionResult = await transactionalMessagingApiInstance.createSmsDefinition(smsDefinition); + let recipient = new SalesforceMarketingCloud.Recipient(JOHN_DOE_GMAIL_COM); + let messageRequestBody = new SalesforceMarketingCloud.SendSmsToSingleRecipientRequest(createSmsDefinitionResult.definitionKey, recipient); + let messageKey = getUUID(); + + let sendSmsToSingleRecipientResult = await transactionalMessagingApiInstance.sendSmsToSingleRecipient(messageKey, messageRequestBody); + + expect(sendSmsToSingleRecipientResult.requestId).not.be(undefined); + expect(sendSmsToSingleRecipientResult.errorcode).not.be(undefined); + expect(sendSmsToSingleRecipientResult.responses).not.be(undefined); + + await transactionalMessagingApiInstance.deleteSmsDefinition(createSmsDefinitionResult.definitionKey); + }); + }); + }); + + function createSmsDefinitionObject() { + let shortCode = environmentConfigProvider.get('SFMC_SHORT_CODE'); + let countryCode = environmentConfigProvider.get('SFMC_COUNTRY_CODE'); + let keyword = environmentConfigProvider.get('SFMC_KEYWORD'); + let smsDefinitionSubscriptions = new SalesforceMarketingCloud.CreateSmsDefinitionSubscriptions(shortCode, countryCode); + smsDefinitionSubscriptions.keyword = keyword; + + let smsDefinitionContent = new SalesforceMarketingCloud.CreateSmsDefinitionContent('SMS definition message content'); + + let smsDefinitionKey = getUUID(10); + let smsDefinitionName = 'SMSdefinition ' + getUUID(10); + + return new SalesforceMarketingCloud.CreateSmsDefinitionRequest(smsDefinitionKey, smsDefinitionName, smsDefinitionContent, smsDefinitionSubscriptions); + } + + async function createEmailDefinitionObject() { + let asset = createAssetObject(); + + let createAssetResponse = await assetApiInstance.createAsset(asset); + let customerKey = createAssetResponse.customerKey; + + let emailDefinitionName = 'EmailDefinition ' + getUUID(10); + let emailDefinitionKey= 'EmailDefinition ' + getUUID(10); + let emailDefinitionContent = new SalesforceMarketingCloud.CreateEmailDefinitionContent(customerKey); + let emailDefinitionSubscriptions = new SalesforceMarketingCloud.CreateEmailDefinitionSubscriptions("All Subscribers"); + + return new SalesforceMarketingCloud.CreateEmailDefinitionRequest(emailDefinitionName, emailDefinitionKey, emailDefinitionContent, emailDefinitionSubscriptions); + } + + function createAssetObject() { + let customerKey = getUUID(10); + let assetType = new SalesforceMarketingCloud.AssetType(HTML_EMAIL_ASSET_TYPE_ID, 'htmlemail'); + let assetName = 'Asset ' + getUUID(10); + let assetDescription = 'Asset from Automated Node.js SDK'; + let asset = new SalesforceMarketingCloud.Asset(customerKey, assetType, assetName, assetDescription); + + asset.views = { + 'subjectline':{ + 'content':'New TS Subject Line' + } + }; + + return asset; + } + + function getUUID(length){ + + return Math.random().toString(16).substring(0, length); + } +})); diff --git a/test/integration/auth/AuthServiceIntegrationTests.spec.js b/test/integration/auth/AuthServiceIntegrationTests.spec.js new file mode 100644 index 0000000..d0f95d6 --- /dev/null +++ b/test/integration/auth/AuthServiceIntegrationTests.spec.js @@ -0,0 +1,106 @@ +const EnvironmentConfigProvider = require('../../../src/EnvironmentConfigProvider'); +const ClientConfiguration = require('../../../src/Auth/ClientConfiguration'); +const ApiClient = require('../../../src/ApiClient'); +const RuntimeInformationProvider = require('../../../src/RuntimeInformationProvider'); +const AuthService = require('../../../src/Auth/AuthService'); +const CacheService = require('../../../src/Auth/CacheService'); + +const expect = require('expect.js'); +const sinon = require('sinon'); + +let authBaseUrl; +let clientId; +let clientSecret; +let accountId; +let scope; + +let environmentConfigProvider; +let clientConfiguration; +let apiClient; +let cacheService; +let authService; + +describe('AuthService', function () { + + before(() => { + environmentConfigProvider = new EnvironmentConfigProvider(); + + authBaseUrl = environmentConfigProvider.get('SFMC_AUTH_BASE_URL'); + clientId = environmentConfigProvider.get('SFMC_CLIENT_ID'); + clientSecret = environmentConfigProvider.get('SFMC_CLIENT_SECRET'); + accountId = environmentConfigProvider.get('SFMC_ACCOUNT_ID'); + scope = environmentConfigProvider.get('SFMC_SCOPE', false); + + cacheService = new CacheService(); + apiClient = new ApiClient(new RuntimeInformationProvider()); + }); + + afterEach(()=>{ + CacheService.cachedData = {}; + }); + + describe('getTokenResponse', function () { + it('should return token response for valid credentials', async () => { + clientConfiguration = new ClientConfiguration(authBaseUrl, clientId, clientSecret, accountId, scope); + authService = new AuthService(clientConfiguration, apiClient, cacheService); + + let tokenResponse = await authService.getTokenResponse(); + + expect(tokenResponse.access_token).not.be(undefined); + expect(tokenResponse.rest_instance_url).not.be(undefined); + expect(tokenResponse.soap_instance_url).not.be(undefined); + expect(tokenResponse.token_type).not.be(undefined); + expect(tokenResponse.expires_in).to.be.greaterThan(0); + }); + }); + describe('getTokenResponse', function () { + it('should return Unauthorized error for invalid clientId', async () => { + let invalidClientConfiguration = new ClientConfiguration(authBaseUrl, 'invalidClientId', clientSecret, accountId, scope); + authService = new AuthService(invalidClientConfiguration, apiClient, cacheService); + + try { + await authService.getTokenResponse(); + } catch (e) { + expect(e.status).to.eql(401); + } + }); + }); + describe('getTokenResponse', function () { + it('should return Unauthorized error for invalid clientSecret', async () => { + let invalidClientConfiguration = new ClientConfiguration(authBaseUrl, clientId, 'invalidClientSecret', accountId, scope); + authService = new AuthService(invalidClientConfiguration, apiClient, cacheService); + + try { + await authService.getTokenResponse(); + } catch (e) { + expect(e.status).to.eql(401); + } + }); + }); + describe('getTokenResponse', function () { + it('should return the same token response object when called multiple times', async () => { + clientConfiguration = new ClientConfiguration(authBaseUrl, clientId, clientSecret, accountId, scope); + authService = new AuthService(clientConfiguration, apiClient, cacheService); + + let tokenResponse1 = await authService.getTokenResponse(); + let tokenResponse2 = await authService.getTokenResponse(); + + expect(tokenResponse1).to.eql(tokenResponse2); + }); + }); + describe('getTokenResponse', function () { + it('should call only one time the ApiClient callApi method when multiple instances are used', async () => { + clientConfiguration = new ClientConfiguration(authBaseUrl, clientId, clientSecret, accountId, scope); + + let authService1 = new AuthService(clientConfiguration, apiClient, cacheService); + let authService2 = new AuthService(clientConfiguration, apiClient, cacheService); + + let apiClientSpy = sinon.spy(apiClient, 'callApi'); + + await authService1.getTokenResponse(); + await authService2.getTokenResponse(); + + expect(apiClientSpy.calledOnce).to.eql(true); + }); + }); +}); diff --git a/test/integration/exception/ApiExceptionFactoryIntegrationTests.spec.js b/test/integration/exception/ApiExceptionFactoryIntegrationTests.spec.js new file mode 100644 index 0000000..9b06e20 --- /dev/null +++ b/test/integration/exception/ApiExceptionFactoryIntegrationTests.spec.js @@ -0,0 +1,101 @@ +const EnvironmentConfigProvider = require('../../../src/EnvironmentConfigProvider'); +const ClientConfiguration = require('../../../src/Auth/ClientConfiguration'); +const ApiClient = require('../../../src/ApiClient'); +const RuntimeInformationProvider = require('../../../src/RuntimeInformationProvider'); +const AuthService = require('../../../src/Auth/AuthService'); +const CacheService = require('../../../src/Auth/CacheService'); +const AuthenticationFailureException = require('../../../src/Exception/AuthenticationFailureException'); +const ServerUnreachableException = require('../../../src/Exception/ServerUnreachableException'); +const BadRequestException = require('../../../src/Exception/BadRequestException'); +const ResourceNotFoundException = require('../../../src/Exception/ResourceNotFoundException'); +const ApiSutFactory = require('../api/ApiSutFactory'); +const AssetApi = require('../../../src/Api/AssetApi'); + +const expect = require('expect.js'); + +let authBaseUrl; +let clientId; +let clientSecret; +let accountId; +let scope; + +let environmentConfigProvider; +let apiClient; +let cacheService; +let authService; +let assetApiInstance; +let clientConfiguration; + +describe('ApiExceptionFactory', function () { + before(() => { + environmentConfigProvider = new EnvironmentConfigProvider(); + + authBaseUrl = environmentConfigProvider.get('SFMC_AUTH_BASE_URL'); + clientId = environmentConfigProvider.get('SFMC_CLIENT_ID'); + clientSecret = environmentConfigProvider.get('SFMC_CLIENT_SECRET'); + accountId = environmentConfigProvider.get('SFMC_ACCOUNT_ID'); + scope = environmentConfigProvider.get('SFMC_SCOPE', false); + + cacheService = new CacheService(); + apiClient = new ApiClient(new RuntimeInformationProvider()); + assetApiInstance = new ApiSutFactory(AssetApi.prototype.constructor).create(); + clientConfiguration = new ClientConfiguration(authBaseUrl, clientId, clientSecret, accountId, scope); + }); + + describe('createCustomException', function () { + it('should return AuthenticationFailureException for invalid clientId', async () => { + let invalidClientIdConfig = new ClientConfiguration(authBaseUrl, 'invalidClientId', clientSecret, accountId, scope); + authService = new AuthService(invalidClientIdConfig, apiClient, cacheService); + + try { + await authService.getTokenResponse(); + } catch (e) { + expect(e).to.be.an(AuthenticationFailureException); + + return + } + expect().fail('Exception was not thrown'); + }); + it('should return BadRequestException when number passed for clientId', async () => { + let invalidClientSecretConfig = new ClientConfiguration(authBaseUrl, 3.141592, clientSecret, accountId, scope); + authService = new AuthService(invalidClientSecretConfig, apiClient, cacheService); + + try { + await authService.getTokenResponse(); + } catch (e) { + expect(e).to.be.an(BadRequestException); + + return + } + expect().fail('Exception was not thrown'); + }); + it('should return ServerUnreachableException for invalid authBaseUrl', async () => { + let invalidClientSecretConfig = new ClientConfiguration('invalidAuthBaseUrl', clientId, clientSecret, accountId, scope); + authService = new AuthService(invalidClientSecretConfig, apiClient, cacheService); + + try { + await authService.getTokenResponse(); + } catch (e) { + expect(e).to.be.an(ServerUnreachableException); + + return + } + expect().fail('Exception was not thrown'); + }); + it('should return ResourceNotFoundException for GET on invalid asset id', async () => { + try { + let randomInt = getRandomInt(7); + await assetApiInstance.getAssetById(randomInt); + } catch (e) { + expect(e).to.be.an(ResourceNotFoundException); + + return + } + expect().fail('Exception was not thrown'); + }); + }); +}); + +function getRandomInt(length){ + return Math.floor(Math.random() * Math.pow(10, length)); +} diff --git a/test/samples/ConfigurationObjectClient.js b/test/samples/ConfigurationObjectClient.js new file mode 100644 index 0000000..b4976a3 --- /dev/null +++ b/test/samples/ConfigurationObjectClient.js @@ -0,0 +1,59 @@ +const Client = require('../../src/Api/Client'); +const SampleHelper = require('./SampleHelper'); +const SalesforceMarketingCloud = require('../../src'); + +(async () => { + // Replace 'CONTACT_KEY' with a real subscriber key + const CONTACT_KEY = 'CONTACT_KEY'; + + // Replace the values in the following object with your Marketing Cloud account credentials + const CONFIGURATION_OBJECT = { + authBaseUrl: 'YOUR AUTH BASE URL', + clientId: 'YOUR CLIENT ID', + clientSecret: 'YOUR CLIENT SECRET', + accountId: 'YOUR ACCOUNT ID' + }; + + // Configuration object instantiated client: + let client = new Client(CONFIGURATION_OBJECT); + + // Get the the asset, transactional messaging API instances: + let assetApi = client.assetApi; + let transactionalMessagingApi = client.transactionalMessagingApi; + + // Create email send definition: + let emailDefinitionObject = await SampleHelper.createEmailDefinitionObject(assetApi); + let createEmailDefinitionResult = await transactionalMessagingApi.createEmailDefinition(emailDefinitionObject); + console.log('createEmailDefinitionResult: ' + JSON.stringify(createEmailDefinitionResult)); + + // Get email send definition: + let getEmailDefinitionsResult = await transactionalMessagingApi.getEmailDefinition(createEmailDefinitionResult.definitionKey); + console.log('getEmailDefinitionsResult: ' + JSON.stringify(getEmailDefinitionsResult)); + + // Update email send definition: + let updatedDefinitionDescription = new SalesforceMarketingCloud.UpdateEmailDefinitionRequest(); + updatedDefinitionDescription.description = 'Updated email definition description'; + + let partiallyUpdateEmailDefinitionResult = await transactionalMessagingApi.partiallyUpdateEmailDefinition(createEmailDefinitionResult.definitionKey, updatedDefinitionDescription); + console.log('partiallyUpdateEmailDefinitionResult: ' + JSON.stringify(partiallyUpdateEmailDefinitionResult)); + + // Get email send definition: + getEmailDefinitionsResult = await transactionalMessagingApi.getEmailDefinition(createEmailDefinitionResult.definitionKey); + console.log('getEmailDefinitionsResult: ' + JSON.stringify(getEmailDefinitionsResult)); + + // Send email to single recipient: + let recipient = new SalesforceMarketingCloud.Recipient(CONTACT_KEY); + + let messageKey = SampleHelper.getUUID(5); + let messageRequestBody = new SalesforceMarketingCloud.SendEmailToSingleRecipientRequest(createEmailDefinitionResult.definitionKey, recipient); + let sendEmailToSingleRecipientResult = await transactionalMessagingApi.sendEmailToSingleRecipient(messageKey, messageRequestBody); + console.log('sendEmailToSingleRecipientResult: ' + JSON.stringify(sendEmailToSingleRecipientResult)); + + // Get the send status of the email send: + let recipientSendStatus = await transactionalMessagingApi.getEmailSendStatusForRecipient(messageKey); + console.log('send status for recipient: ' + JSON.stringify(recipientSendStatus)); + + // Delete email send definition: + let deleteEmailDefinitionResult = await transactionalMessagingApi.deleteEmailDefinition(createEmailDefinitionResult.definitionKey); + console.log('deleteEmailDefinitionResult: ' + JSON.stringify(deleteEmailDefinitionResult)); +})(); \ No newline at end of file diff --git a/test/samples/EnvironmentVariablesClient.js b/test/samples/EnvironmentVariablesClient.js new file mode 100644 index 0000000..c7a4711 --- /dev/null +++ b/test/samples/EnvironmentVariablesClient.js @@ -0,0 +1,38 @@ +const Client = require('../../src/Api/Client'); +const SampleHelper = require('./SampleHelper'); +const SalesforceMarketingCloud = require('../../src'); + +(async () => { + // Replace 'CONTACT1_KEY' and 'CONTACT2_KEY' with real subscriber keys + const CONTACT1_KEY = 'CONTACT1_KEY'; + const CONTACT2_KEY = 'CONTACT2_KEY'; + + // Environment variables instantiated client: + let client = new Client(); + + // Get the asset, transactional messaging API instances: + let assetApi = client.assetApi; + let transactionalMessagingApi = client.transactionalMessagingApi; + + // Create email send definition: + let emailDefinitionObject = await SampleHelper.createEmailDefinitionObject(assetApi); + let createEmailDefinitionResult = await transactionalMessagingApi.createEmailDefinition(emailDefinitionObject); + console.log('createEmailDefinitionResult: ' + JSON.stringify(createEmailDefinitionResult)); + + // Send email to multiple recipients: + let recipient1 = new SalesforceMarketingCloud.Recipient(CONTACT1_KEY); + let recipient2 = new SalesforceMarketingCloud.Recipient(CONTACT2_KEY); + recipient1.messageKey = SampleHelper.getUUID(5); + recipient2.messageKey = SampleHelper.getUUID(5); + let recipientsList = [recipient1, recipient2]; + + let batchMessageRequestBody = new SalesforceMarketingCloud.SendEmailToMultipleRecipientsRequest(createEmailDefinitionResult.definitionKey, recipientsList); + let sendEmailToMultipleRecipientsResult = await transactionalMessagingApi.sendEmailToMultipleRecipients(batchMessageRequestBody); + console.log('sendEmailToMultipleRecipientsResult: ' + JSON.stringify(sendEmailToMultipleRecipientsResult)); + + // Get the send status of the two email sends: + let recipient1_sendStatus = await transactionalMessagingApi.getEmailSendStatusForRecipient(recipient1.messageKey); + let recipient2_sendStatus = await transactionalMessagingApi.getEmailSendStatusForRecipient(recipient2.messageKey); + console.log('send status for recipient1: ' + JSON.stringify(recipient1_sendStatus)); + console.log('send status for recipient2: ' + JSON.stringify(recipient2_sendStatus)); +})(); \ No newline at end of file diff --git a/test/samples/SampleHelper.js b/test/samples/SampleHelper.js new file mode 100644 index 0000000..c2b67a8 --- /dev/null +++ b/test/samples/SampleHelper.js @@ -0,0 +1,49 @@ +const Asset = require('../../src/Model/Asset'); +const AssetType = require('../../src/Model/AssetType'); +const SalesforceMarketingCloud = require('../../src'); + +class SampleHelper { + static createEmailAsset() { + let customerKey = 'EmailAssetCustomerKey' + SampleHelper.getUUID(5); // it has be unique + let assetName = 'EmailAssetName' + SampleHelper.getUUID(5); // it has be unique + let assetDescription = 'EmailAsset created from automated Node.js SDK'; + + const HTML_EMAIL_ASSET_TYPE_ID = 208; + const ASSET_TYPE_NAME = 'htmlemail'; + let assetType = new AssetType(HTML_EMAIL_ASSET_TYPE_ID, ASSET_TYPE_NAME); + + let asset = new Asset(customerKey, assetType, assetName, assetDescription); + + /* An email asset has to have at least these minimal + properties set in order for the send definition to become active*/ + + asset.views = { + 'subjectline': { + 'content': 'New TS Subject Line' + } + }; + return asset; + } + + static async createEmailDefinitionObject(assetApi) { + /* Replace 'SUBSCRIBERS-LIST-KEY' with the key of + one of your subscribers lists or use 'All Subscribers'*/ + const SUBSCRIBERS_LIST_KEY = 'SUBSCRIBERS_LIST_KEY'; + + let asset = SampleHelper.createEmailAsset(); + let createAssetResponse = await assetApi.createAsset(asset); + let customerKey = createAssetResponse.customerKey; + let emailDefinitionName = 'EmailDefinitionName' + SampleHelper.getUUID(5); // it has be unique + let emailDefinitionKey = 'EmailDefinitionKey' + SampleHelper.getUUID(5); // it has be unique + let emailDefinitionContent = new SalesforceMarketingCloud.CreateEmailDefinitionContent(customerKey); + let emailDefinitionSubscriptions = new SalesforceMarketingCloud.CreateEmailDefinitionSubscriptions(SUBSCRIBERS_LIST_KEY); + + return new SalesforceMarketingCloud.CreateEmailDefinitionRequest(emailDefinitionName, emailDefinitionKey, emailDefinitionContent, emailDefinitionSubscriptions); + } + + static getUUID(length) { + return Math.random().toString(16).substring(0, length); + } +} + +module.exports = SampleHelper; \ No newline at end of file diff --git a/test/unit/Client.spec.js b/test/unit/Client.spec.js new file mode 100644 index 0000000..cd78a63 --- /dev/null +++ b/test/unit/Client.spec.js @@ -0,0 +1,102 @@ +const Client = require('../../src/Api/Client'); +const TestHelper = require('../TestHelper'); + +(function (root, factory) { + factory(require('expect.js'), require('../../src')); +}(this, function (expect, SalesforceMarketingCloud) { + 'use strict'; + + describe('Client', function () { + + let client; + let configMock; + + before(() => { + configMock = TestHelper.createConfigProvider(); + client = new Client(); + }); + + describe('assetApi getter', function () { + it('should return a AssetApi instance', () => { + let assetApi = client.assetApi; + + expect(assetApi).to.be.a(SalesforceMarketingCloud.AssetApi); + }); + it('should return the same AssetApi instance ', () => { + let assetApi1 = client.assetApi; + let assetApi2 = client.assetApi; + + expect(assetApi1).to.be(assetApi2); + }); + }); + describe('campaignApi getter', function () { + it('should return a CampaignApi instance', () => { + let campaignApi = client.campaignApi; + + expect(campaignApi).to.be.a(SalesforceMarketingCloud.CampaignApi); + }); + it('should return the same CampaignApi instance', function () { + let campaignApi1 = client.campaignApi; + let campaignApi2 = client.campaignApi; + + expect(campaignApi1).to.be(campaignApi2); + }); + }); + describe('transactionalMessagingApi getter', function () { + it('should return a TransactionalMessagingApi instance', () => { + let transactionalMessagingApi = client.transactionalMessagingApi; + + expect(transactionalMessagingApi).to.be.a(SalesforceMarketingCloud.TransactionalMessagingApi); + }); + it('should return the same TransactionalMessagingApi instance', function () { + let transactionalMessagingApi1 = client.transactionalMessagingApi; + let transactionalMessagingApi2 = client.transactionalMessagingApi; + + expect(transactionalMessagingApi1).to.be(transactionalMessagingApi2); + }); + }); + describe('constructor', function () { + it('should set the config parameters from env. variables when called with no passed in parameter', function () { + let configBackup = getEnvVariables(); + setEnvVariables(configMock); + + client = new Client(); + + expect(client.getAuthBaseUrl()).to.eql(configMock.authBaseUrl); + expect(client.getClientId()).to.eql(configMock.clientId); + expect(client.getClientSecret()).to.eql(configMock.clientSecret); + expect(client.getAccountId()).to.eql(configMock.accountId); + expect(client.getScope()).to.eql(configMock.scope); + + setEnvVariables(configBackup); + }); + it('should set the config parameters from the passed in parameter when used', function () { + client = new Client(configMock); + + expect(client.getAuthBaseUrl()).to.eql(configMock.authBaseUrl); + expect(client.getClientId()).to.eql(configMock.clientId); + expect(client.getClientSecret()).to.eql(configMock.clientSecret); + expect(client.getAccountId()).to.eql(configMock.accountId); + expect(client.getScope()).to.eql(configMock.scope); + }); + }) + }); + + function setEnvVariables(config) { + process.env.SFMC_AUTH_BASE_URL = config.authBaseUrl; + process.env.SFMC_CLIENT_ID = config.clientId; + process.env.SFMC_CLIENT_SECRET = config.clientSecret; + process.env.SFMC_ACCOUNT_ID = config.accountId; + process.env.SFMC_SCOPE = config.scope; + } + + function getEnvVariables() { + return{ + authBaseUrl: process.env.SFMC_AUTH_BASE_URL, + clientId: process.env.SFMC_CLIENT_ID, + clientSecret: process.env.SFMC_CLIENT_SECRET, + accountId: process.env.SFMC_ACCOUNT_ID, + scope: process.env.SFMC_SCOPE + } + } +})); diff --git a/test/unit/ClientSideValidation.spec.js b/test/unit/ClientSideValidation.spec.js new file mode 100644 index 0000000..651a1f8 --- /dev/null +++ b/test/unit/ClientSideValidation.spec.js @@ -0,0 +1,81 @@ +const Campaign = require('../../src/Model/Campaign'); +const InvalidModelException = require('../../src/Exception/InvalidModelException'); + +const expect = require('expect.js'); + +describe('Campaign', function () { + describe('constructor', function () { + + let properties; + const exceptionReasons = [undefined, null]; + const requiredProperties = ['name', 'description', 'campaignCode', 'color', 'favorite']; + + beforeEach(() => { + properties = { + name: 'validName', + description: 'validDescription', + campaignCode: 'validCampaignCode', + color: '0000ff', // valid color value + favorite: true // valid favorite value + }; + }); + + exceptionReasons.forEach((exceptionReason) => { + requiredProperties.forEach((requiredProperty) => { + it(`should return InvalidModelException for ${exceptionReason} ${requiredProperty}`, function () { + + properties[requiredProperty] = exceptionReason; + + try { + new Campaign(properties.name, properties.description, properties.campaignCode, properties.color, properties.favorite); + } catch (e) { + expect(e).to.be.an(InvalidModelException); + expect(e.message).to.eql(`"${requiredProperty}" is a required property for Campaign and cannot be undefined or null`); + + return + } + expect().fail('Exception was not thrown'); + }) + }) + }); + it('should return InvalidModelException for Campaign name longer than 128 characters', function () { + let invalidCampaignName = '#'.repeat(129); + + try { + new Campaign(invalidCampaignName, properties.description, properties.campaignCode, properties.color, properties.favorite); + } catch (e) { + expect(e).to.be.an(InvalidModelException); + expect(e.message).to.eql('invalid length for "name". It must be smaller than or equal to 128.'); + + return + } + expect().fail('Exception was not thrown'); + }); + it('should return InvalidModelException for Campaign description longer than 512 characters', function () { + let invalidCampaignDescription = '#'.repeat(513); + + try { + new Campaign(properties.name, invalidCampaignDescription, properties.campaignCode, properties.color, properties.favorite); + } catch (e) { + expect(e).to.be.an(InvalidModelException); + expect(e.message).to.eql('invalid length for "description". It must be smaller than or equal to 512.'); + + return + } + expect().fail('Exception was not thrown'); + }); + it('should return InvalidModelException for Campaign campaignCode longer than 36 characters', function () { + let invalidCampaignCampaignCode = '#'.repeat(37); + + try { + new Campaign(properties.name, properties.description, invalidCampaignCampaignCode, properties.color, properties.favorite); + } catch (e) { + expect(e).to.be.an(InvalidModelException); + expect(e.message).to.eql('invalid length for "campaignCode". It must be smaller than or equal to 36.'); + + return + } + expect().fail('Exception was not thrown'); + }); + }); +}); \ No newline at end of file diff --git a/test/unit/EnvironmentConfigProvider.spec.js b/test/unit/EnvironmentConfigProvider.spec.js new file mode 100644 index 0000000..b1d4d65 --- /dev/null +++ b/test/unit/EnvironmentConfigProvider.spec.js @@ -0,0 +1,41 @@ +const expect = require('expect.js'); +const EnvironmentConfigProvider = require('../../src/EnvironmentConfigProvider'); +const EnvironmentVariableNotSetException = require('../../src/Exception/EnvironmentVariableNotSetException'); + +describe('EnvironmentConfigProvider', function () { + + let environmentConfigProvider; + + before(() => { + environmentConfigProvider = new EnvironmentConfigProvider(); + }); + + describe('get', function () { + it('should return a environment variable if set', function () { + let authBaseUrlEnvVariableBackup = process.env.SFMC_AUTH_BASE_URL; + process.env.SFMC_AUTH_BASE_URL = 'authBaseUrl'; + + let authBaseUrlEnvVariable = environmentConfigProvider.get('SFMC_AUTH_BASE_URL'); + + expect(authBaseUrlEnvVariable).to.eql('authBaseUrl'); + + process.env.SFMC_AUTH_BASE_URL = authBaseUrlEnvVariableBackup; + }); + it('should throw a EnvironmentVariableNotSetException for an unset, mandatory variable', function () { + try { + environmentConfigProvider.get('notExistingEnvironmentVariable'); + } catch (e) { + expect(e).to.be.an(EnvironmentVariableNotSetException); + expect(e.message).to.eql('Environment variable notExistingEnvironmentVariable is not set'); + + return + } + expect().fail('Exception was not thrown'); + }); + it('should return null for an unset, not mandatory variable', function () { + let authBaseUrlEnvVariable = environmentConfigProvider.get('notExistingEnvironmentVariable', false); + + expect(authBaseUrlEnvVariable).to.eql(null); + }); + }) +}); \ No newline at end of file diff --git a/test/unit/auth/AuthServiceUnitTests.spec.js b/test/unit/auth/AuthServiceUnitTests.spec.js new file mode 100644 index 0000000..6af9ac8 --- /dev/null +++ b/test/unit/auth/AuthServiceUnitTests.spec.js @@ -0,0 +1,67 @@ +const CacheService = require('../../../src/Auth/CacheService'); +const TestHelper = require('../../TestHelper'); +const ApiClient = require('../../../src/ApiClient'); +const AuthService = require('../../../src/Auth/AuthService'); + +const expect = require('expect.js'); +const sinon = require('sinon'); + +const date = new Date(2000, 1, 1).getTime(); + +let cacheService; +let clientConfiguration; +let tokenResponseData; +let apiClientStub; +let clock; + +describe('AuthService', function () { + before(() => { + clientConfiguration = TestHelper.createClientConfiguration(); + tokenResponseData = TestHelper.createTokenResponseData(); + cacheService = new CacheService(); + }); + + beforeEach(() => { + apiClientStub = sinon.createStubInstance(ApiClient, { + callApi: tokenResponseData + }); + clock = sinon.useFakeTimers(date); + }); + + afterEach(() => { + CacheService.cachedData = {}; + apiClientStub.callApi.restore(); + clock.restore(); + }); + + describe('getTokenResponse', function () { + it('should execute the callApi method when there is no cached value for a cache key', async () => { + let authService = new AuthService(clientConfiguration, apiClientStub, cacheService); + + await authService.getTokenResponse(); + + expect(apiClientStub.callApi.calledOnce).to.eql(true); + }); + it('should execute the callApi method when the cached value for a cache key is expired', async () => { + let authService = new AuthService(clientConfiguration, apiClientStub, cacheService); + + await authService.getTokenResponse(); + let invalidCacheWindowInSeconds = 30; + let validCacheWindowInMs = (tokenResponseData.expires_in - invalidCacheWindowInSeconds) * 1000; + // making the cached data corresponding to cacheKey to have the expirationTime equal to the current time, thus invalid + clock.tick(validCacheWindowInMs); + await authService.getTokenResponse(); + + expect(apiClientStub.callApi.calledTwice).to.eql(true); + }); + it('should execute exactly one time the callApi method when multiple instances are used', async () => { + let authService1 = new AuthService(clientConfiguration, apiClientStub, cacheService); + let authService2 = new AuthService(clientConfiguration, apiClientStub, cacheService); + + await authService1.getTokenResponse(); + await authService2.getTokenResponse(); + + expect(apiClientStub.callApi.calledOnce).to.eql(true); + }) + }); +}); diff --git a/test/unit/auth/CacheServiceUnitTests.spec.js b/test/unit/auth/CacheServiceUnitTests.spec.js new file mode 100644 index 0000000..7c616d7 --- /dev/null +++ b/test/unit/auth/CacheServiceUnitTests.spec.js @@ -0,0 +1,67 @@ +const CacheService = require('../../../src/Auth/CacheService'); +const TestHelper = require('../../TestHelper'); + +const expect = require('expect.js'); +const sinon = require('sinon'); + +describe('CacheService', function () { + const cacheKey = 'cacheKey'; + const date = new Date(2000, 1, 1).getTime(); + + let cacheService; + let clock; + let tokenResponseData; + + before(() => { + cacheService = new CacheService(); + tokenResponseData = TestHelper.createTokenResponseData(); + }); + + beforeEach(() => { + clock = sinon.useFakeTimers(date); + }); + + afterEach(() => { + CacheService.cachedData = {}; + clock.restore(); + }); + + describe('get', function () { + it('should return null when passed parameter is not a key in the cache', function () { + expect(cacheService.get(cacheKey)).to.eql(null); + }); + it('should return the cached value when the passed parameter is a cache key and the corresponding cache not expired', function () { + cacheService.addOrUpdate(cacheKey, tokenResponseData.data); + + let cachedTokenResponseData = cacheService.get(cacheKey); + + expect(cachedTokenResponseData.tokenResponse.access_token).to.eql('access_token'); + expect(cachedTokenResponseData.tokenResponse.expires_in).to.be.greaterThan(0); + expect(cachedTokenResponseData.tokenResponse.rest_instance_url).to.eql('rest_instance_url'); + expect(cachedTokenResponseData.tokenResponse.soap_instance_url).to.eql('soap_instance_url'); + expect(cachedTokenResponseData.tokenResponse.scope).to.eql('scope'); + expect(cachedTokenResponseData.tokenResponse.token_type).to.eql('Bearer'); + }); + it('should return null when the passed parameter is a cache key and the corresponding cache is expired', function () { + cacheService.addOrUpdate(cacheKey, tokenResponseData); + let invalidCacheWindowInSeconds = 30; + let validCacheWindowInMs = (tokenResponseData.expires_in - invalidCacheWindowInSeconds) * 1000; + // making the cached data corresponding to cacheKey to have the expirationTime equal to the current time, thus invalid + clock.tick(validCacheWindowInMs); + + let cachedTokenResponseData = cacheService.get(cacheKey); + + expect(cachedTokenResponseData).to.eql(null); + }); + }); + describe('addOrUpdate', function () { + it('should overwrite cached value when called two times for the same key', function () { + cacheService.addOrUpdate(cacheKey, tokenResponseData.data); + let firstCachedTokenResponseData = cacheService.get(cacheKey); + cacheService.addOrUpdate(cacheKey, tokenResponseData.data); + let secondCachedTokenResponseData = cacheService.get(cacheKey); + + expect(secondCachedTokenResponseData).not.to.equal(firstCachedTokenResponseData); + }); + }); +}); \ No newline at end of file diff --git a/test/unit/exception/ApiExceptionFactoryUnitTests.spec.js b/test/unit/exception/ApiExceptionFactoryUnitTests.spec.js new file mode 100644 index 0000000..87cf066 --- /dev/null +++ b/test/unit/exception/ApiExceptionFactoryUnitTests.spec.js @@ -0,0 +1,50 @@ +const TestHelper = require('../../TestHelper'); +const ApiExceptionFactory = require('../../../src/Exception/ApiExceptionFactory'); + +const expect = require('expect.js'); + +describe('ApiExceptionFactory', function () { + + const callApiCallerMethod = 'callApiCallerMethod'; + const exceptions = [ + {BadRequestException: 400}, + {AuthenticationFailureException: 401}, + {UnauthorizedAccessException: 403}, + {ResourceNotFoundException: 404}, + {InternalServerErrorException: 500}, + {BadGatewayException: 502}, + {ServiceUnavailableException: 503}, + {GatewayTimeoutException: 504}, + {ApiException: 418} + ]; + + describe('createCustomException', function () { + exceptions.forEach((exception) => { + + let exceptionObjKey = Object.keys(exception)[0]; + let exceptionObjValue = exception[exceptionObjKey]; + + it(`should return ${exceptionObjKey} for a ${exceptionObjValue} status code in the request response`, function () { + let requestResponse = TestHelper.createRequestResponse(exceptionObjValue); + let expectedExceptionMessage = `Error calling ${callApiCallerMethod}: "${requestResponse.response.body}"`; + let expectedExceptionName = `Salesforce.MarketingCloud.Exceptions.${exceptionObjKey}`; + + let returnedException = ApiExceptionFactory.createCustomException(callApiCallerMethod, requestResponse); + + expect(returnedException.name).to.eql(expectedExceptionName); + expect(returnedException.message).to.eql(expectedExceptionMessage); + expect(returnedException.status).to.eql(exceptionObjValue); + }); + }); + it('should return ServerUnreachableException when status code is undefined', function () { + let serverUnreachableError = TestHelper.createServerUnreachableError(); + let expectedExceptionMessage = `Error calling ${callApiCallerMethod}: ${JSON.stringify(serverUnreachableError)}`; + let expectedExceptionName = `Salesforce.MarketingCloud.Exceptions.ServerUnreachableException`; + + let returnedException = ApiExceptionFactory.createCustomException(callApiCallerMethod, serverUnreachableError); + + expect(returnedException.name).to.eql(expectedExceptionName); + expect(returnedException.message).to.eql(expectedExceptionMessage); + }); + }); +}); \ No newline at end of file