Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Code moved
Browse files Browse the repository at this point in the history
  • Loading branch information
sfcbetiuc committed Oct 30, 2019
1 parent 4310278 commit 00e4933
Show file tree
Hide file tree
Showing 127 changed files with 13,121 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env", "stage-0"]
}
66 changes: 66 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions .swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.4.8
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: node_js
node_js:
- "12.10.0"

branches:
only:
- master
- develop
- /^feature\/.*$/
- /^release\/.*$/
- /^hotfix\/.*$/
- /^*.0$/
- /^ci\/*.0$/
182 changes: 181 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 10 additions & 0 deletions docs/ApiError.md
Original file line number Diff line number Diff line change
@@ -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]


35 changes: 35 additions & 0 deletions docs/Asset.md
Original file line number Diff line number Diff line change
@@ -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]


Loading

0 comments on commit 00e4933

Please sign in to comment.