diff --git a/README.md b/README.md index 430e158..1016966 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -## phrase-js@1.5.6 +## phrase-js@1.5.7 Phrase Strings is a translation management platform for software projects. You can collaborate on language file translation with your team or order translations through our platform. The API allows you to import locale files, download locale files, tag keys or interact in other ways with the localization data stored in Phrase Strings for your account. ## This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 2.0.0 -- Package version: 1.5.6 +- Package version: 1.5.7 - Build package: phrase-js For more information, please visit [https://developers.phrase.com/api/](https://developers.phrase.com/api/) @@ -47,14 +47,14 @@ _published:_ ``` -npm install phrase-js@1.5.6 --save +npm install phrase-js@1.5.7 --save ``` if you are using yarn ``` -yarn install phrase-js@1.5.6 +yarn install phrase-js@1.5.7 ``` _unPublished (not recommended):_ @@ -104,7 +104,7 @@ here is the example package.json "@types/node": "^14.0.1", "form-data": "^3.0.0", "node-fetch": "^2.6.0", - "phrase-js": "^1.5.6" + "phrase-js": "^1.5.7" }, "devDependencies": { "tslint": "^5.20.1", diff --git a/package.json b/package.json index 1f4e055..862fe89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "phrase-js", - "version": "1.5.6", + "version": "1.5.7", "description": "OpenAPI client for Phrase Strings", "author": "OpenAPI-Generator", "license" : "MIT", diff --git a/src/models/JobLocale.ts b/src/models/JobLocale.ts index da18330..4f49e80 100644 --- a/src/models/JobLocale.ts +++ b/src/models/JobLocale.ts @@ -21,10 +21,14 @@ import { LocalePreviewFromJSON, LocalePreviewFromJSONTyped, LocalePreviewToJSON, - UserPreview, - UserPreviewFromJSON, - UserPreviewFromJSONTyped, - UserPreviewToJSON, + LocaleTeamPreview, + LocaleTeamPreviewFromJSON, + LocaleTeamPreviewFromJSONTyped, + LocaleTeamPreviewToJSON, + LocaleUserPreview, + LocaleUserPreviewFromJSON, + LocaleUserPreviewFromJSONTyped, + LocaleUserPreviewToJSON, } from './'; /** @@ -53,10 +57,16 @@ export interface JobLocale { locale?: LocalePreview; /** * - * @type {Array} + * @type {Array} * @memberof JobLocale */ - users?: Array; + users?: Array; + /** + * + * @type {Array} + * @memberof JobLocale + */ + teams?: Array; /** * * @type {boolean} @@ -90,7 +100,8 @@ export function JobLocaleFromJSONTyped(json: any, ignoreDiscriminator: boolean): 'id': !exists(json, 'id') ? undefined : json['id'], 'job': !exists(json, 'job') ? undefined : JobPreviewFromJSON(json['job']), 'locale': !exists(json, 'locale') ? undefined : LocalePreviewFromJSON(json['locale']), - 'users': !exists(json, 'users') ? undefined : ((json['users'] as Array).map(UserPreviewFromJSON)), + 'users': !exists(json, 'users') ? undefined : ((json['users'] as Array).map(LocaleUserPreviewFromJSON)), + 'teams': !exists(json, 'teams') ? undefined : ((json['teams'] as Array).map(LocaleTeamPreviewFromJSON)), 'completed': !exists(json, 'completed') ? undefined : json['completed'], 'translationCompletedAt': !exists(json, 'translation_completed_at') ? undefined : (new Date(json['translation_completed_at'])), 'reviewCompletedAt': !exists(json, 'review_completed_at') ? undefined : (new Date(json['review_completed_at'])), @@ -109,7 +120,8 @@ export function JobLocaleToJSON(value?: JobLocale | null): any { 'id': value.id, 'job': JobPreviewToJSON(value.job), 'locale': LocalePreviewToJSON(value.locale), - 'users': value.users === undefined ? undefined : ((value.users as Array).map(UserPreviewToJSON)), + 'users': value.users === undefined ? undefined : ((value.users as Array).map(LocaleUserPreviewToJSON)), + 'teams': value.teams === undefined ? undefined : ((value.teams as Array).map(LocaleTeamPreviewToJSON)), 'completed': value.completed, 'translation_completed_at': value.translationCompletedAt === undefined ? undefined : (value.translationCompletedAt.toISOString()), 'review_completed_at': value.reviewCompletedAt === undefined ? undefined : (value.reviewCompletedAt.toISOString()), diff --git a/src/models/JobLocaleUpdateParameters.ts b/src/models/JobLocaleUpdateParameters.ts index 952300a..9614b4b 100644 --- a/src/models/JobLocaleUpdateParameters.ts +++ b/src/models/JobLocaleUpdateParameters.ts @@ -42,6 +42,18 @@ export interface JobLocaleUpdateParameters { * @memberof JobLocaleUpdateParameters */ reviewerIds?: Array; + /** + * Array of team ids to be assigned to the job locale as translators + * @type {Array} + * @memberof JobLocaleUpdateParameters + */ + translatorTeamIds?: Array; + /** + * Array of team ids to be assigned to the job locale as reviewers + * @type {Array} + * @memberof JobLocaleUpdateParameters + */ + reviewerTeamIds?: Array; } export function JobLocaleUpdateParametersFromJSON(json: any): JobLocaleUpdateParameters { @@ -58,6 +70,8 @@ export function JobLocaleUpdateParametersFromJSONTyped(json: any, ignoreDiscrimi 'localeId': !exists(json, 'locale_id') ? undefined : json['locale_id'], 'userIds': !exists(json, 'user_ids') ? undefined : json['user_ids'], 'reviewerIds': !exists(json, 'reviewer_ids') ? undefined : json['reviewer_ids'], + 'translatorTeamIds': !exists(json, 'translator_team_ids') ? undefined : json['translator_team_ids'], + 'reviewerTeamIds': !exists(json, 'reviewer_team_ids') ? undefined : json['reviewer_team_ids'], }; } @@ -74,6 +88,8 @@ export function JobLocaleUpdateParametersToJSON(value?: JobLocaleUpdateParameter 'locale_id': value.localeId, 'user_ids': value.userIds, 'reviewer_ids': value.reviewerIds, + 'translator_team_ids': value.translatorTeamIds, + 'reviewer_team_ids': value.reviewerTeamIds, }; } diff --git a/src/models/JobLocalesCreateParameters.ts b/src/models/JobLocalesCreateParameters.ts index ee21f3b..9bab942 100644 --- a/src/models/JobLocalesCreateParameters.ts +++ b/src/models/JobLocalesCreateParameters.ts @@ -29,7 +29,7 @@ export interface JobLocalesCreateParameters { * @type {string} * @memberof JobLocalesCreateParameters */ - localeId?: string; + localeId: string; /** * Array of user ids to be assigned to the job locale as translators * @type {Array} @@ -42,6 +42,18 @@ export interface JobLocalesCreateParameters { * @memberof JobLocalesCreateParameters */ reviewerIds?: Array; + /** + * Array of team ids to be assigned to the job locale as translators + * @type {Array} + * @memberof JobLocalesCreateParameters + */ + translatorTeamIds?: Array; + /** + * Array of team ids to be assigned to the job locale as reviewers + * @type {Array} + * @memberof JobLocalesCreateParameters + */ + reviewerTeamIds?: Array; } export function JobLocalesCreateParametersFromJSON(json: any): JobLocalesCreateParameters { @@ -55,9 +67,11 @@ export function JobLocalesCreateParametersFromJSONTyped(json: any, ignoreDiscrim return { 'branch': !exists(json, 'branch') ? undefined : json['branch'], - 'localeId': !exists(json, 'locale_id') ? undefined : json['locale_id'], + 'localeId': json['locale_id'], 'userIds': !exists(json, 'user_ids') ? undefined : json['user_ids'], 'reviewerIds': !exists(json, 'reviewer_ids') ? undefined : json['reviewer_ids'], + 'translatorTeamIds': !exists(json, 'translator_team_ids') ? undefined : json['translator_team_ids'], + 'reviewerTeamIds': !exists(json, 'reviewer_team_ids') ? undefined : json['reviewer_team_ids'], }; } @@ -74,6 +88,8 @@ export function JobLocalesCreateParametersToJSON(value?: JobLocalesCreateParamet 'locale_id': value.localeId, 'user_ids': value.userIds, 'reviewer_ids': value.reviewerIds, + 'translator_team_ids': value.translatorTeamIds, + 'reviewer_team_ids': value.reviewerTeamIds, }; } diff --git a/src/models/JobTemplateLocaleUpdateParameters.ts b/src/models/JobTemplateLocaleUpdateParameters.ts index 8e2d31d..8674e38 100644 --- a/src/models/JobTemplateLocaleUpdateParameters.ts +++ b/src/models/JobTemplateLocaleUpdateParameters.ts @@ -29,7 +29,7 @@ export interface JobTemplateLocaleUpdateParameters { * @type {string} * @memberof JobTemplateLocaleUpdateParameters */ - localeId: string; + localeId?: string; /** * Array of user ids to be assigned to the job template locale * @type {Array} @@ -42,6 +42,18 @@ export interface JobTemplateLocaleUpdateParameters { * @memberof JobTemplateLocaleUpdateParameters */ reviewerIds?: Array; + /** + * Array of team ids to be assigned to the job locale as translators + * @type {Array} + * @memberof JobTemplateLocaleUpdateParameters + */ + translatorTeamIds?: Array; + /** + * Array of team ids to be assigned to the job locale as reviewers + * @type {Array} + * @memberof JobTemplateLocaleUpdateParameters + */ + reviewerTeamIds?: Array; } export function JobTemplateLocaleUpdateParametersFromJSON(json: any): JobTemplateLocaleUpdateParameters { @@ -55,9 +67,11 @@ export function JobTemplateLocaleUpdateParametersFromJSONTyped(json: any, ignore return { 'branch': !exists(json, 'branch') ? undefined : json['branch'], - 'localeId': json['locale_id'], + 'localeId': !exists(json, 'locale_id') ? undefined : json['locale_id'], 'userIds': !exists(json, 'user_ids') ? undefined : json['user_ids'], 'reviewerIds': !exists(json, 'reviewer_ids') ? undefined : json['reviewer_ids'], + 'translatorTeamIds': !exists(json, 'translator_team_ids') ? undefined : json['translator_team_ids'], + 'reviewerTeamIds': !exists(json, 'reviewer_team_ids') ? undefined : json['reviewer_team_ids'], }; } @@ -74,6 +88,8 @@ export function JobTemplateLocaleUpdateParametersToJSON(value?: JobTemplateLocal 'locale_id': value.localeId, 'user_ids': value.userIds, 'reviewer_ids': value.reviewerIds, + 'translator_team_ids': value.translatorTeamIds, + 'reviewer_team_ids': value.reviewerTeamIds, }; } diff --git a/src/models/JobTemplateLocales.ts b/src/models/JobTemplateLocales.ts index cfe62fa..f10927e 100644 --- a/src/models/JobTemplateLocales.ts +++ b/src/models/JobTemplateLocales.ts @@ -13,14 +13,14 @@ import { exists, mapValues } from '../runtime'; import { + Items, + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, JobTemplatePreview, JobTemplatePreviewFromJSON, JobTemplatePreviewFromJSONTyped, JobTemplatePreviewToJSON, - JobTemplateUserPreview, - JobTemplateUserPreviewFromJSON, - JobTemplateUserPreviewFromJSONTyped, - JobTemplateUserPreviewToJSON, LocalePreview, LocalePreviewFromJSON, LocalePreviewFromJSONTyped, @@ -53,10 +53,16 @@ export interface JobTemplateLocales { locale?: LocalePreview; /** * - * @type {Array} + * @type {Array} * @memberof JobTemplateLocales */ - users?: Array; + users?: Array; + /** + * + * @type {Array} + * @memberof JobTemplateLocales + */ + teams?: Array; } export function JobTemplateLocalesFromJSON(json: any): JobTemplateLocales { @@ -72,7 +78,8 @@ export function JobTemplateLocalesFromJSONTyped(json: any, ignoreDiscriminator: 'id': !exists(json, 'id') ? undefined : json['id'], 'jobTemplate': !exists(json, 'job_template') ? undefined : JobTemplatePreviewFromJSON(json['job_template']), 'locale': !exists(json, 'locale') ? undefined : LocalePreviewFromJSON(json['locale']), - 'users': !exists(json, 'users') ? undefined : ((json['users'] as Array).map(JobTemplateUserPreviewFromJSON)), + 'users': !exists(json, 'users') ? undefined : ((json['users'] as Array).map(ItemsFromJSON)), + 'teams': !exists(json, 'teams') ? undefined : ((json['teams'] as Array).map(ItemsFromJSON)), }; } @@ -88,7 +95,8 @@ export function JobTemplateLocalesToJSON(value?: JobTemplateLocales | null): any 'id': value.id, 'job_template': JobTemplatePreviewToJSON(value.jobTemplate), 'locale': LocalePreviewToJSON(value.locale), - 'users': value.users === undefined ? undefined : ((value.users as Array).map(JobTemplateUserPreviewToJSON)), + 'users': value.users === undefined ? undefined : ((value.users as Array).map(ItemsToJSON)), + 'teams': value.teams === undefined ? undefined : ((value.teams as Array).map(ItemsToJSON)), }; } diff --git a/src/models/JobTemplateLocalesCreateParameters.ts b/src/models/JobTemplateLocalesCreateParameters.ts index 4f6ddae..31c11cc 100644 --- a/src/models/JobTemplateLocalesCreateParameters.ts +++ b/src/models/JobTemplateLocalesCreateParameters.ts @@ -42,6 +42,18 @@ export interface JobTemplateLocalesCreateParameters { * @memberof JobTemplateLocalesCreateParameters */ reviewerIds?: Array; + /** + * Array of team ids to be assigned to the job locale as translators + * @type {Array} + * @memberof JobTemplateLocalesCreateParameters + */ + translatorTeamIds?: Array; + /** + * Array of team ids to be assigned to the job locale as reviewers + * @type {Array} + * @memberof JobTemplateLocalesCreateParameters + */ + reviewerTeamIds?: Array; } export function JobTemplateLocalesCreateParametersFromJSON(json: any): JobTemplateLocalesCreateParameters { @@ -58,6 +70,8 @@ export function JobTemplateLocalesCreateParametersFromJSONTyped(json: any, ignor 'localeId': json['locale_id'], 'userIds': !exists(json, 'user_ids') ? undefined : json['user_ids'], 'reviewerIds': !exists(json, 'reviewer_ids') ? undefined : json['reviewer_ids'], + 'translatorTeamIds': !exists(json, 'translator_team_ids') ? undefined : json['translator_team_ids'], + 'reviewerTeamIds': !exists(json, 'reviewer_team_ids') ? undefined : json['reviewer_team_ids'], }; } @@ -74,6 +88,8 @@ export function JobTemplateLocalesCreateParametersToJSON(value?: JobTemplateLoca 'locale_id': value.localeId, 'user_ids': value.userIds, 'reviewer_ids': value.reviewerIds, + 'translator_team_ids': value.translatorTeamIds, + 'reviewer_team_ids': value.reviewerTeamIds, }; } diff --git a/src/models/LocaleTeamPreview.ts b/src/models/LocaleTeamPreview.ts new file mode 100644 index 0000000..22a516c --- /dev/null +++ b/src/models/LocaleTeamPreview.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Phrase Strings API Reference + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@phrase.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface LocaleTeamPreview + */ +export interface LocaleTeamPreview { + /** + * + * @type {string} + * @memberof LocaleTeamPreview + */ + id?: string; + /** + * + * @type {string} + * @memberof LocaleTeamPreview + */ + name?: string; + /** + * + * @type {string} + * @memberof LocaleTeamPreview + */ + role?: string; +} + +export function LocaleTeamPreviewFromJSON(json: any): LocaleTeamPreview { + return LocaleTeamPreviewFromJSONTyped(json, false); +} + +export function LocaleTeamPreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): LocaleTeamPreview { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'id': !exists(json, 'id') ? undefined : json['id'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'role': !exists(json, 'role') ? undefined : json['role'], + }; +} + +export function LocaleTeamPreviewToJSON(value?: LocaleTeamPreview | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'id': value.id, + 'name': value.name, + 'role': value.role, + }; +} + + diff --git a/src/models/JobTemplateUserPreview.ts b/src/models/LocaleUserPreview.ts similarity index 68% rename from src/models/JobTemplateUserPreview.ts rename to src/models/LocaleUserPreview.ts index f80fa28..39ef197 100644 --- a/src/models/JobTemplateUserPreview.ts +++ b/src/models/LocaleUserPreview.ts @@ -15,40 +15,40 @@ import { exists, mapValues } from '../runtime'; /** * * @export - * @interface JobTemplateUserPreview + * @interface LocaleUserPreview */ -export interface JobTemplateUserPreview { +export interface LocaleUserPreview { /** * * @type {string} - * @memberof JobTemplateUserPreview + * @memberof LocaleUserPreview */ id?: string; /** * * @type {string} - * @memberof JobTemplateUserPreview + * @memberof LocaleUserPreview */ username?: string; /** * * @type {string} - * @memberof JobTemplateUserPreview + * @memberof LocaleUserPreview */ name?: string; /** * * @type {string} - * @memberof JobTemplateUserPreview + * @memberof LocaleUserPreview */ role?: string; } -export function JobTemplateUserPreviewFromJSON(json: any): JobTemplateUserPreview { - return JobTemplateUserPreviewFromJSONTyped(json, false); +export function LocaleUserPreviewFromJSON(json: any): LocaleUserPreview { + return LocaleUserPreviewFromJSONTyped(json, false); } -export function JobTemplateUserPreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): JobTemplateUserPreview { +export function LocaleUserPreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): LocaleUserPreview { if ((json === undefined) || (json === null)) { return json; } @@ -61,7 +61,7 @@ export function JobTemplateUserPreviewFromJSONTyped(json: any, ignoreDiscriminat }; } -export function JobTemplateUserPreviewToJSON(value?: JobTemplateUserPreview | null): any { +export function LocaleUserPreviewToJSON(value?: LocaleUserPreview | null): any { if (value === undefined) { return undefined; } diff --git a/src/models/index.ts b/src/models/index.ts index 27df8f7..ecb6337 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -83,7 +83,6 @@ export * from './JobTemplateLocales'; export * from './JobTemplateLocalesCreateParameters'; export * from './JobTemplatePreview'; export * from './JobTemplateUpdateParameters'; -export * from './JobTemplateUserPreview'; export * from './JobUpdateParameters'; export * from './KeyCreateParameters'; export * from './KeyPreview'; @@ -100,7 +99,9 @@ export * from './LocaleDetails1'; export * from './LocalePreview'; export * from './LocalePreview1'; export * from './LocaleStatistics'; +export * from './LocaleTeamPreview'; export * from './LocaleUpdateParameters'; +export * from './LocaleUserPreview'; export * from './Member'; export * from './MemberProjectDetail'; export * from './MemberProjectDetailProjectRoles'; diff --git a/src/runtime.ts b/src/runtime.ts index b55e42a..10e6583 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -145,7 +145,7 @@ export class Configuration { configuration.headers = {} } - configuration.headers["User-Agent"] = "OpenAPI-Generator/1.5.6/js" + configuration.headers["User-Agent"] = "OpenAPI-Generator/1.5.7/js" } get basePath(): string {