Skip to content

Commit

Permalink
Update to v3.0.1 (#3)
Browse files Browse the repository at this point in the history
* Update to 3.0.1

* Removing extra spacing from documentation

* Upgrade swagger version and use cursor object

* Remove extra test files
  • Loading branch information
phil-ma authored Dec 5, 2019
1 parent 89c302c commit 4b4c6ca
Show file tree
Hide file tree
Showing 102 changed files with 2,764 additions and 3,143 deletions.
112 changes: 57 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ See our [Implementation Guide](https://docs.dyspatch.io/development/implementing
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 2019.10
- Package version: 3.0.0
- Package version: 3.0.1
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
For more information, please visit [https://docs.dyspatch.io](https://docs.dyspatch.io)

Expand All @@ -25,8 +25,7 @@ npm install dyspatch-client --save

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
Expand All @@ -44,8 +43,7 @@ Finally, switch to the directory you want to use your dyspatch-client from, and
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

You should now be able to `require('dyspatch-client')` in javascript files from the directory you ran the last
command above from.
You should now be able to `require('dyspatch-client')` in javascript files from the directory you ran the last command above from.

#### git

Expand All @@ -61,14 +59,14 @@ then install it via:

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming _main.js_ is your entry file, that's to say your javascript file where you actually
perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually
use this library):

```shell
browserify main.js > bundle.js
```

Then include _bundle.js_ in the HTML pages.
Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Expand All @@ -84,7 +82,7 @@ module: {
amd: false
}
}
];
]
}
```

Expand All @@ -93,79 +91,83 @@ module: {
Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var DyspatchClient = require("dyspatch-client");
var DyspatchClient = require('dyspatch-client');

var defaultClient = DyspatchClient.ApiClient.instance;

// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications["Bearer"];
Bearer.apiKey = "YOUR API KEY";
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix['Authorization'] = "Token"

var api = new DyspatchClient.DraftsApi();
var api = new DyspatchClient.DraftsApi()

var draftId = "draftId_example"; // {String} A draft ID

var targetLanguage = "targetLanguage_example"; // {String} The type of templating language to compile as. Should only be used for visual templates.


var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log("API called successfully. Returned data: " + data);
console.log('API called successfully. Returned data: ' + data);
}
};
api.draftsDraftIdGet(draftId, targetLanguage, callback);

```

## Documentation for API Endpoints

All URIs are relative to _https://api.dyspatch.io_

| Class | Method | HTTP request | Description |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------- |
| _DyspatchClient.DraftsApi_ | [**draftsDraftIdGet**](docs/DraftsApi.md#draftsDraftIdGet) | **GET** /drafts/{draftId} | Get Draft by ID |
| _DyspatchClient.DraftsApi_ | [**draftsDraftIdLocalizationKeysGet**](docs/DraftsApi.md#draftsDraftIdLocalizationKeysGet) | **GET** /drafts/{draftId}/localizationKeys | Get Localization Keys |
| _DyspatchClient.DraftsApi_ | [**draftsDraftIdLocalizationsGet**](docs/DraftsApi.md#draftsDraftIdLocalizationsGet) | **GET** /drafts/{draftId}/localizations | Get Localizations on a Draft |
| _DyspatchClient.DraftsApi_ | [**draftsDraftIdLocalizationsLanguageIdDelete**](docs/DraftsApi.md#draftsDraftIdLocalizationsLanguageIdDelete) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a Localization |
| _DyspatchClient.DraftsApi_ | [**draftsDraftIdLocalizationsLanguageIdPut**](docs/DraftsApi.md#draftsDraftIdLocalizationsLanguageIdPut) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or Update a Localization |
| _DyspatchClient.DraftsApi_ | [**draftsDraftIdLocalizationsLanguageIdTranslationsPut**](docs/DraftsApi.md#draftsDraftIdLocalizationsLanguageIdTranslationsPut) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set Translations for Language |
| _DyspatchClient.DraftsApi_ | [**draftsDraftIdPublishRequestPost**](docs/DraftsApi.md#draftsDraftIdPublishRequestPost) | **POST** /drafts/{draftId}/publishRequest | Submit the Draft for Approval |
| _DyspatchClient.DraftsApi_ | [**draftsGet**](docs/DraftsApi.md#draftsGet) | **GET** /drafts | List Drafts |
| _DyspatchClient.LocalizationsApi_ | [**localizationsLocalizationIdGet**](docs/LocalizationsApi.md#localizationsLocalizationIdGet) | **GET** /localizations/{localizationId} | Get Localization Object by ID |
| _DyspatchClient.TemplatesApi_ | [**templatesGet**](docs/TemplatesApi.md#templatesGet) | **GET** /templates | List Templates |
| _DyspatchClient.TemplatesApi_ | [**templatesTemplateIdGet**](docs/TemplatesApi.md#templatesTemplateIdGet) | **GET** /templates/{templateId} | Get Template by ID |
All URIs are relative to *https://api.dyspatch.io*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DyspatchClient.DraftsApi* | [**draftsDraftIdGet**](docs/DraftsApi.md#draftsDraftIdGet) | **GET** /drafts/{draftId} | Get Draft by ID
*DyspatchClient.DraftsApi* | [**draftsDraftIdLocalizationKeysGet**](docs/DraftsApi.md#draftsDraftIdLocalizationKeysGet) | **GET** /drafts/{draftId}/localizationKeys | Get Localization Keys
*DyspatchClient.DraftsApi* | [**draftsDraftIdLocalizationsGet**](docs/DraftsApi.md#draftsDraftIdLocalizationsGet) | **GET** /drafts/{draftId}/localizations | Get Localizations on a Draft
*DyspatchClient.DraftsApi* | [**draftsDraftIdLocalizationsLanguageIdDelete**](docs/DraftsApi.md#draftsDraftIdLocalizationsLanguageIdDelete) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a Localization
*DyspatchClient.DraftsApi* | [**draftsDraftIdLocalizationsLanguageIdPut**](docs/DraftsApi.md#draftsDraftIdLocalizationsLanguageIdPut) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or Update a Localization
*DyspatchClient.DraftsApi* | [**draftsDraftIdLocalizationsLanguageIdTranslationsPut**](docs/DraftsApi.md#draftsDraftIdLocalizationsLanguageIdTranslationsPut) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set Translations for Language
*DyspatchClient.DraftsApi* | [**draftsDraftIdPublishRequestPost**](docs/DraftsApi.md#draftsDraftIdPublishRequestPost) | **POST** /drafts/{draftId}/publishRequest | Submit the Draft for Approval
*DyspatchClient.DraftsApi* | [**draftsGet**](docs/DraftsApi.md#draftsGet) | **GET** /drafts | List Drafts
*DyspatchClient.LocalizationsApi* | [**localizationsLocalizationIdGet**](docs/LocalizationsApi.md#localizationsLocalizationIdGet) | **GET** /localizations/{localizationId} | Get Localization Object by ID
*DyspatchClient.TemplatesApi* | [**templatesGet**](docs/TemplatesApi.md#templatesGet) | **GET** /templates | List Templates
*DyspatchClient.TemplatesApi* | [**templatesTemplateIdGet**](docs/TemplatesApi.md#templatesTemplateIdGet) | **GET** /templates/{templateId} | Get Template by ID


## Documentation for Models

- [DyspatchClient.APIError](docs/APIError.md)
- [DyspatchClient.Body](docs/Body.md)
- [DyspatchClient.CompiledRead](docs/CompiledRead.md)
- [DyspatchClient.CreatedAt](docs/CreatedAt.md)
- [DyspatchClient.Cursor](docs/Cursor.md)
- [DyspatchClient.DraftDescription](docs/DraftDescription.md)
- [DyspatchClient.DraftId](docs/DraftId.md)
- [DyspatchClient.DraftMetaRead](docs/DraftMetaRead.md)
- [DyspatchClient.DraftName](docs/DraftName.md)
- [DyspatchClient.DraftRead](docs/DraftRead.md)
- [DyspatchClient.DraftUrl](docs/DraftUrl.md)
- [DyspatchClient.DraftsRead](docs/DraftsRead.md)
- [DyspatchClient.LanguageId](docs/LanguageId.md)
- [DyspatchClient.LocalizationId](docs/LocalizationId.md)
- [DyspatchClient.LocalizationKeyRead](docs/LocalizationKeyRead.md)
- [DyspatchClient.LocalizationMetaRead](docs/LocalizationMetaRead.md)
- [DyspatchClient.LocalizationName](docs/LocalizationName.md)
- [DyspatchClient.LocalizationRead](docs/LocalizationRead.md)
- [DyspatchClient.LocalizationUrl](docs/LocalizationUrl.md)
- [DyspatchClient.TemplateDescription](docs/TemplateDescription.md)
- [DyspatchClient.TemplateId](docs/TemplateId.md)
- [DyspatchClient.TemplateMetaRead](docs/TemplateMetaRead.md)
- [DyspatchClient.TemplateName](docs/TemplateName.md)
- [DyspatchClient.TemplateRead](docs/TemplateRead.md)
- [DyspatchClient.TemplateUrl](docs/TemplateUrl.md)
- [DyspatchClient.TemplatesRead](docs/TemplatesRead.md)
- [DyspatchClient.UpdatedAt](docs/UpdatedAt.md)
- [DyspatchClient.APIError](docs/APIError.md)
- [DyspatchClient.Body](docs/Body.md)
- [DyspatchClient.CompiledRead](docs/CompiledRead.md)
- [DyspatchClient.CreatedAt](docs/CreatedAt.md)
- [DyspatchClient.Cursor](docs/Cursor.md)
- [DyspatchClient.DraftDescription](docs/DraftDescription.md)
- [DyspatchClient.DraftId](docs/DraftId.md)
- [DyspatchClient.DraftMetaRead](docs/DraftMetaRead.md)
- [DyspatchClient.DraftName](docs/DraftName.md)
- [DyspatchClient.DraftRead](docs/DraftRead.md)
- [DyspatchClient.DraftUrl](docs/DraftUrl.md)
- [DyspatchClient.DraftsRead](docs/DraftsRead.md)
- [DyspatchClient.LanguageId](docs/LanguageId.md)
- [DyspatchClient.LocalizationId](docs/LocalizationId.md)
- [DyspatchClient.LocalizationKeyRead](docs/LocalizationKeyRead.md)
- [DyspatchClient.LocalizationMetaRead](docs/LocalizationMetaRead.md)
- [DyspatchClient.LocalizationName](docs/LocalizationName.md)
- [DyspatchClient.LocalizationRead](docs/LocalizationRead.md)
- [DyspatchClient.LocalizationUrl](docs/LocalizationUrl.md)
- [DyspatchClient.TemplateDescription](docs/TemplateDescription.md)
- [DyspatchClient.TemplateId](docs/TemplateId.md)
- [DyspatchClient.TemplateMetaRead](docs/TemplateMetaRead.md)
- [DyspatchClient.TemplateName](docs/TemplateName.md)
- [DyspatchClient.TemplateRead](docs/TemplateRead.md)
- [DyspatchClient.TemplateUrl](docs/TemplateUrl.md)
- [DyspatchClient.TemplatesRead](docs/TemplatesRead.md)
- [DyspatchClient.UpdatedAt](docs/UpdatedAt.md)


## Documentation for Authorization

Expand Down
14 changes: 7 additions & 7 deletions docs/APIError.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **String** | Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. | [optional]
**message** | **String** | Human readable error message | [optional]
**parameter** | **String** | The invalid parameter, if &#39;code&#39; is invalid_parameter | [optional]
**parameter** | **String** | The invalid parameter, if 'code' is invalid_parameter | [optional]


<a name="CodeEnum"></a>
## Enum: CodeEnum


* `server_error` (value: `"server_error"`)
* `serverError` (value: `"server_error"`)

* `invalid_parameter` (value: `"invalid_parameter"`)
* `invalidParameter` (value: `"invalid_parameter"`)

* `invalid_body` (value: `"invalid_body"`)
* `invalidBody` (value: `"invalid_body"`)

* `invalid_request` (value: `"invalid_request"`)
* `invalidRequest` (value: `"invalid_request"`)

* `unauthorized` (value: `"unauthorized"`)

* `unauthenticated` (value: `"unauthenticated"`)

* `not_found` (value: `"not_found"`)
* `notFound` (value: `"not_found"`)

* `rate_limited` (value: `"rate_limited"`)
* `rateLimited` (value: `"rate_limited"`)



Expand Down
2 changes: 1 addition & 1 deletion docs/DraftRead.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Name | Type | Description | Notes
**compiled** | [**CompiledRead**](CompiledRead.md) | | [optional]
**createdAt** | **Date** | The time of initial creation | [optional]
**updatedAt** | **Date** | The time of last update | [optional]
**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the Template&#39;s available localizations | [optional]
**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the Template's available localizations | [optional]


14 changes: 8 additions & 6 deletions docs/DraftsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Method | HTTP request | Description
Get Draft by ID

Gets a draft object with the matching ID. The \&quot;compiled\&quot; field will contain the unlocalized default template object.
Gets a draft object with the matching ID. The \"compiled\" field will contain the unlocalized default template object.

### Example
```javascript
Expand Down Expand Up @@ -76,7 +76,7 @@ Name | Type | Description | Notes
Get Localization Keys

Returns the list of values that need to be translated for the draft. Set the &#x60;Accept&#x60; header to &#x60;application/vnd.dyspatch.2019.10+json&#x60; to get a JSON object, or &#x60;text/vnd.dyspatch.2019.10+x-gettext-translation&#x60; to get the POT file.
Returns the list of values that need to be translated for the draft. Set the `Accept` header to `application/vnd.dyspatch.2019.10+json` to get a JSON object, or `text/vnd.dyspatch.2019.10+x-gettext-translation` to get the POT file.

### Example
```javascript
Expand Down Expand Up @@ -112,7 +112,7 @@ apiInstance.draftsDraftIdLocalizationKeysGet(draftId, , opts, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**draftId** | **String**| A draft ID |
**accept** | **String**| A version of the API that should be used for the request. For example, to use version \&quot;2019.10\&quot;, set the value to \&quot;application/vnd.dyspatch.2019.10+json\&quot;. | [optional]
**accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\". | [optional]

### Return type

Expand Down Expand Up @@ -186,7 +186,7 @@ Name | Type | Description | Notes
Remove a Localization

Deletes the localization with the given &#x60;languageId&#x60; if it exists.
Deletes the localization with the given `languageId` if it exists.

### Example
```javascript
Expand Down Expand Up @@ -242,7 +242,7 @@ null (empty response body)
Create or Update a Localization

Inserts a localization or sets the name on an existing localization that already uses the &#x60;languageId&#x60;.
Inserts a localization or sets the name on an existing localization that already uses the `languageId`.

### Example
```javascript
Expand Down Expand Up @@ -301,7 +301,7 @@ null (empty response body)
Set Translations for Language

Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format &#x60;%(my_variable)s&#x60; and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set &#x60;Content-Type&#x60; header to &#x60;application/json&#x60;. For gettext PO format set &#x60;Content-Type&#x60; header to &#x60;text/x-gettext-translation&#x60;.
Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format `%(my_variable)s` and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set `Content-Type` header to `application/json`. For gettext PO format set `Content-Type` header to `text/x-gettext-translation`.

### Example
```javascript
Expand Down Expand Up @@ -429,6 +429,7 @@ Bearer.apiKey = 'YOUR API KEY';
var apiInstance = new DyspatchClient.DraftsApi();

var opts = {
'cursor': "cursor_example", // String | A cursor value used to retrieve a specific page from a paginated result set.
'status': "status_example" // String | Filter the list of drafts by a particular status
};

Expand All @@ -446,6 +447,7 @@ apiInstance.draftsGet(opts, callback);

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional]
**status** | **String**| Filter the list of drafts by a particular status | [optional]

### Return type
Expand Down
2 changes: 1 addition & 1 deletion docs/DraftsRead.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cursor** | **Object** | Information about paginated results | [optional]
**cursor** | [**Cursor**](Cursor.md) | | [optional]
**data** | [**[DraftMetaRead]**](DraftMetaRead.md) | A list of draft metadata objects | [optional]


2 changes: 1 addition & 1 deletion docs/TemplateMetaRead.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Name | Type | Description | Notes
**name** | **String** | The name of a template | [optional]
**description** | **String** | A description of the template | [optional]
**url** | **String** | The API url for a specific template | [optional]
**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the template&#39;s available localization objects | [optional]
**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the template's available localization objects | [optional]
**createdAt** | **Date** | The time of initial creation | [optional]
**updatedAt** | **Date** | The time of last update | [optional]

Expand Down
Loading

0 comments on commit 4b4c6ca

Please sign in to comment.