@leancodepl/intl 9.7.2 → 9.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +201 -0
  3. package/README.md +68 -7
  4. package/{src → dist}/TranslationsServiceClient.d.ts +9 -1
  5. package/dist/TranslationsServiceClient.d.ts.map +1 -0
  6. package/dist/bin.cjs +2 -0
  7. package/dist/bin.d.ts +3 -0
  8. package/dist/bin.d.ts.map +1 -0
  9. package/dist/bin.js +103 -0
  10. package/{src → dist}/commands/diff.d.ts +3 -2
  11. package/dist/commands/diff.d.ts.map +1 -0
  12. package/{src → dist}/commands/download.d.ts +3 -2
  13. package/dist/commands/download.d.ts.map +1 -0
  14. package/{src → dist}/commands/local.d.ts +3 -2
  15. package/dist/commands/local.d.ts.map +1 -0
  16. package/{src → dist}/commands/sync.d.ts +3 -2
  17. package/dist/commands/sync.d.ts.map +1 -0
  18. package/{src → dist}/commands/upload.d.ts +3 -2
  19. package/dist/commands/upload.d.ts.map +1 -0
  20. package/{src → dist}/formatjs.d.ts +1 -0
  21. package/dist/formatjs.d.ts.map +1 -0
  22. package/dist/index.cjs +1 -0
  23. package/dist/index.d.ts +7 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +9 -0
  26. package/dist/loadConfig.d.ts +12 -0
  27. package/dist/loadConfig.d.ts.map +1 -0
  28. package/dist/logger.d.ts +9 -0
  29. package/dist/logger.d.ts.map +1 -0
  30. package/{src → dist}/mergeWithEnv.d.ts +1 -0
  31. package/dist/mergeWithEnv.d.ts.map +1 -0
  32. package/dist/mkTranslationsServiceClient-CYeFDsNC.cjs +5 -0
  33. package/dist/mkTranslationsServiceClient-D62VGNcU.js +1578 -0
  34. package/{src → dist}/mkTranslationsServiceClient.d.ts +2 -1
  35. package/dist/mkTranslationsServiceClient.d.ts.map +1 -0
  36. package/{src → dist}/poeditor/POEditorClient.d.ts +8 -2
  37. package/dist/poeditor/POEditorClient.d.ts.map +1 -0
  38. package/{src → dist}/poeditor/api.generated/api.d.ts +30 -41
  39. package/dist/poeditor/api.generated/api.d.ts.map +1 -0
  40. package/{src → dist}/poeditor/api.generated/base.d.ts +3 -13
  41. package/dist/poeditor/api.generated/base.d.ts.map +1 -0
  42. package/{src → dist}/poeditor/api.generated/common.d.ts +4 -14
  43. package/dist/poeditor/api.generated/common.d.ts.map +1 -0
  44. package/{src → dist}/poeditor/api.generated/configuration.d.ts +1 -0
  45. package/dist/poeditor/api.generated/configuration.d.ts.map +1 -0
  46. package/{src → dist}/poeditor/api.generated/index.d.ts +3 -2
  47. package/dist/poeditor/api.generated/index.d.ts.map +1 -0
  48. package/{src → dist}/poeditor/generatePoeditorClient.d.ts +1 -0
  49. package/dist/poeditor/generatePoeditorClient.d.ts.map +1 -0
  50. package/package.json +25 -7
  51. package/src/TranslationsServiceClient.js +0 -3
  52. package/src/TranslationsServiceClient.js.map +0 -1
  53. package/src/bin.d.ts +0 -2
  54. package/src/bin.js +0 -129
  55. package/src/bin.js.map +0 -1
  56. package/src/commands/diff.js +0 -35
  57. package/src/commands/diff.js.map +0 -1
  58. package/src/commands/download.js +0 -39
  59. package/src/commands/download.js.map +0 -1
  60. package/src/commands/local.js +0 -117
  61. package/src/commands/local.js.map +0 -1
  62. package/src/commands/sync.js +0 -34
  63. package/src/commands/sync.js.map +0 -1
  64. package/src/commands/upload.js +0 -32
  65. package/src/commands/upload.js.map +0 -1
  66. package/src/formatjs.js +0 -60
  67. package/src/formatjs.js.map +0 -1
  68. package/src/index.d.ts +0 -6
  69. package/src/index.js +0 -16
  70. package/src/index.js.map +0 -1
  71. package/src/mergeWithEnv.js +0 -14
  72. package/src/mergeWithEnv.js.map +0 -1
  73. package/src/mkTranslationsServiceClient.js +0 -14
  74. package/src/mkTranslationsServiceClient.js.map +0 -1
  75. package/src/poeditor/POEditorClient.js +0 -88
  76. package/src/poeditor/POEditorClient.js.map +0 -1
  77. package/src/poeditor/api.generated/api.js +0 -2654
  78. package/src/poeditor/api.generated/api.js.map +0 -1
  79. package/src/poeditor/api.generated/base.js +0 -69
  80. package/src/poeditor/api.generated/base.js.map +0 -1
  81. package/src/poeditor/api.generated/common.js +0 -146
  82. package/src/poeditor/api.generated/common.js.map +0 -1
  83. package/src/poeditor/api.generated/configuration.js +0 -100
  84. package/src/poeditor/api.generated/configuration.js.map +0 -1
  85. package/src/poeditor/api.generated/index.js +0 -18
  86. package/src/poeditor/api.generated/index.js.map +0 -1
  87. package/src/poeditor/generatePoeditorClient.js +0 -54
  88. package/src/poeditor/generatePoeditorClient.js.map +0 -1
@@ -1,2654 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * API V2
6
- * Connect your software to POEditor with this simple API
7
- *
8
- * The version of the OpenAPI document: 1.0.6
9
- *
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.TranslationsAutomaticProviderEnum = exports.TranslationsApi = exports.TranslationsApiFactory = exports.TranslationsApiFp = exports.TranslationsApiAxiosParamCreator = exports.TermsUpdateFuzzyTriggerEnum = exports.TermsApi = exports.TermsApiFactory = exports.TermsApiFp = exports.TermsApiAxiosParamCreator = exports.ProjectsUploadFuzzyTriggerEnum = exports.ProjectsUploadReadFromSourceEnum = exports.ProjectsUploadSyncTermsEnum = exports.ProjectsUploadOverwriteEnum = exports.ProjectsUploadUpdatingEnum = exports.ProjectsExportOptionsEnum = exports.ProjectsExportTypeEnum = exports.ProjectsApi = exports.ProjectsApiFactory = exports.ProjectsApiFp = exports.ProjectsApiAxiosParamCreator = exports.LanguagesUpdateFuzzyTriggerEnum = exports.LanguagesApi = exports.LanguagesApiFactory = exports.LanguagesApiFp = exports.LanguagesApiAxiosParamCreator = exports.ContributorsAddAdminEnum = exports.ContributorsApi = exports.ContributorsApiFactory = exports.ContributorsApiFp = exports.ContributorsApiAxiosParamCreator = exports.ProjectLongProjectOpenEnum = exports.ProjectLongProjectPublicEnum = exports.ProjectListProjectsInnerOpenEnum = exports.ProjectListProjectsInnerPublicEnum = void 0;
17
- const tslib_1 = require("tslib");
18
- const axios_1 = tslib_1.__importDefault(require("axios"));
19
- // Some imports not used depending on template conditions
20
- // @ts-ignore
21
- const common_1 = require("./common");
22
- // @ts-ignore
23
- const base_1 = require("./base");
24
- exports.ProjectListProjectsInnerPublicEnum = {
25
- NUMBER_0: 0,
26
- NUMBER_1: 1,
27
- };
28
- exports.ProjectListProjectsInnerOpenEnum = {
29
- NUMBER_0: 0,
30
- NUMBER_1: 1,
31
- };
32
- exports.ProjectLongProjectPublicEnum = {
33
- NUMBER_0: 0,
34
- NUMBER_1: 1,
35
- };
36
- exports.ProjectLongProjectOpenEnum = {
37
- NUMBER_0: 0,
38
- NUMBER_1: 1,
39
- };
40
- /**
41
- * ContributorsApi - axios parameter creator
42
- * @export
43
- */
44
- const ContributorsApiAxiosParamCreator = function (configuration) {
45
- return {
46
- /**
47
- * Add Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_add).
48
- * @summary Adds a contributor to a project language or an administrator to a project.
49
- * @param {string} id The id of project
50
- * @param {string} name The name of contributor
51
- * @param {string} email The email of contributor
52
- * @param {string} [apiToken]
53
- * @param {string} [language] The language code (Required if adding a contributor)
54
- * @param {ContributorsAddAdminEnum} [admin] Set it to 1 for adding as administrator
55
- * @param {*} [options] Override http request option.
56
- * @throws {RequiredError}
57
- */
58
- contributorsAdd: async (id, name, email, apiToken, language, admin, options = {}) => {
59
- // verify required parameter 'id' is not null or undefined
60
- (0, common_1.assertParamExists)("contributorsAdd", "id", id);
61
- // verify required parameter 'name' is not null or undefined
62
- (0, common_1.assertParamExists)("contributorsAdd", "name", name);
63
- // verify required parameter 'email' is not null or undefined
64
- (0, common_1.assertParamExists)("contributorsAdd", "email", email);
65
- const localVarPath = `/contributors/add`;
66
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
67
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
68
- let baseOptions;
69
- if (configuration) {
70
- baseOptions = configuration.baseOptions;
71
- }
72
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
73
- const localVarHeaderParameter = {};
74
- const localVarQueryParameter = {};
75
- const localVarFormParams = new URLSearchParams();
76
- if (apiToken !== undefined) {
77
- localVarFormParams.set("api_token", apiToken);
78
- }
79
- if (id !== undefined) {
80
- localVarFormParams.set("id", id);
81
- }
82
- if (name !== undefined) {
83
- localVarFormParams.set("name", name);
84
- }
85
- if (email !== undefined) {
86
- localVarFormParams.set("email", email);
87
- }
88
- if (language !== undefined) {
89
- localVarFormParams.set("language", language);
90
- }
91
- if (admin !== undefined) {
92
- localVarFormParams.set("admin", admin);
93
- }
94
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
95
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
96
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
97
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
98
- localVarRequestOptions.data = localVarFormParams.toString();
99
- return {
100
- url: (0, common_1.toPathString)(localVarUrlObj),
101
- options: localVarRequestOptions,
102
- };
103
- },
104
- /**
105
- * Remove Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_remove).
106
- * @summary Removes a contributor from a project language or an admin from a project, if the language is not specified.
107
- * @param {string} id The id of project
108
- * @param {string} email The email of contributor
109
- * @param {string} [apiToken]
110
- * @param {string} [language] The language code (Required if removing a contributor from a certain language)
111
- * @param {*} [options] Override http request option.
112
- * @throws {RequiredError}
113
- */
114
- contributorsRemove: async (id, email, apiToken, language, options = {}) => {
115
- // verify required parameter 'id' is not null or undefined
116
- (0, common_1.assertParamExists)("contributorsRemove", "id", id);
117
- // verify required parameter 'email' is not null or undefined
118
- (0, common_1.assertParamExists)("contributorsRemove", "email", email);
119
- const localVarPath = `/contributors/remove`;
120
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
121
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
122
- let baseOptions;
123
- if (configuration) {
124
- baseOptions = configuration.baseOptions;
125
- }
126
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
127
- const localVarHeaderParameter = {};
128
- const localVarQueryParameter = {};
129
- const localVarFormParams = new URLSearchParams();
130
- if (apiToken !== undefined) {
131
- localVarFormParams.set("api_token", apiToken);
132
- }
133
- if (id !== undefined) {
134
- localVarFormParams.set("id", id);
135
- }
136
- if (email !== undefined) {
137
- localVarFormParams.set("email", email);
138
- }
139
- if (language !== undefined) {
140
- localVarFormParams.set("language", language);
141
- }
142
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
143
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
144
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
145
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
146
- localVarRequestOptions.data = localVarFormParams.toString();
147
- return {
148
- url: (0, common_1.toPathString)(localVarUrlObj),
149
- options: localVarRequestOptions,
150
- };
151
- },
152
- /**
153
- * List Contributors. More details in the [documentation](https://poeditor.com/docs/api#contributors_list).
154
- * @summary Returns the list of contributors from your projects.
155
- * @param {string} [apiToken]
156
- * @param {string} [id] The id of project (Optional, unless language is set. Then, it becomes required)
157
- * @param {string} [language] The language code
158
- * @param {*} [options] Override http request option.
159
- * @throws {RequiredError}
160
- */
161
- translationsList: async (apiToken, id, language, options = {}) => {
162
- const localVarPath = `/contributors/list`;
163
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
164
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
165
- let baseOptions;
166
- if (configuration) {
167
- baseOptions = configuration.baseOptions;
168
- }
169
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
170
- const localVarHeaderParameter = {};
171
- const localVarQueryParameter = {};
172
- const localVarFormParams = new URLSearchParams();
173
- if (apiToken !== undefined) {
174
- localVarFormParams.set("api_token", apiToken);
175
- }
176
- if (id !== undefined) {
177
- localVarFormParams.set("id", id);
178
- }
179
- if (language !== undefined) {
180
- localVarFormParams.set("language", language);
181
- }
182
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
183
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
184
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
185
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
186
- localVarRequestOptions.data = localVarFormParams.toString();
187
- return {
188
- url: (0, common_1.toPathString)(localVarUrlObj),
189
- options: localVarRequestOptions,
190
- };
191
- },
192
- };
193
- };
194
- exports.ContributorsApiAxiosParamCreator = ContributorsApiAxiosParamCreator;
195
- /**
196
- * ContributorsApi - functional programming interface
197
- * @export
198
- */
199
- const ContributorsApiFp = function (configuration) {
200
- const localVarAxiosParamCreator = (0, exports.ContributorsApiAxiosParamCreator)(configuration);
201
- return {
202
- /**
203
- * Add Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_add).
204
- * @summary Adds a contributor to a project language or an administrator to a project.
205
- * @param {string} id The id of project
206
- * @param {string} name The name of contributor
207
- * @param {string} email The email of contributor
208
- * @param {string} [apiToken]
209
- * @param {string} [language] The language code (Required if adding a contributor)
210
- * @param {ContributorsAddAdminEnum} [admin] Set it to 1 for adding as administrator
211
- * @param {*} [options] Override http request option.
212
- * @throws {RequiredError}
213
- */
214
- async contributorsAdd(id, name, email, apiToken, language, admin, options) {
215
- const localVarAxiosArgs = await localVarAxiosParamCreator.contributorsAdd(id, name, email, apiToken, language, admin, options);
216
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
217
- const localVarOperationServerBasePath = base_1.operationServerMap["ContributorsApi.contributorsAdd"]?.[localVarOperationServerIndex]?.url;
218
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
219
- },
220
- /**
221
- * Remove Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_remove).
222
- * @summary Removes a contributor from a project language or an admin from a project, if the language is not specified.
223
- * @param {string} id The id of project
224
- * @param {string} email The email of contributor
225
- * @param {string} [apiToken]
226
- * @param {string} [language] The language code (Required if removing a contributor from a certain language)
227
- * @param {*} [options] Override http request option.
228
- * @throws {RequiredError}
229
- */
230
- async contributorsRemove(id, email, apiToken, language, options) {
231
- const localVarAxiosArgs = await localVarAxiosParamCreator.contributorsRemove(id, email, apiToken, language, options);
232
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
233
- const localVarOperationServerBasePath = base_1.operationServerMap["ContributorsApi.contributorsRemove"]?.[localVarOperationServerIndex]?.url;
234
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
235
- },
236
- /**
237
- * List Contributors. More details in the [documentation](https://poeditor.com/docs/api#contributors_list).
238
- * @summary Returns the list of contributors from your projects.
239
- * @param {string} [apiToken]
240
- * @param {string} [id] The id of project (Optional, unless language is set. Then, it becomes required)
241
- * @param {string} [language] The language code
242
- * @param {*} [options] Override http request option.
243
- * @throws {RequiredError}
244
- */
245
- async translationsList(apiToken, id, language, options) {
246
- const localVarAxiosArgs = await localVarAxiosParamCreator.translationsList(apiToken, id, language, options);
247
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
248
- const localVarOperationServerBasePath = base_1.operationServerMap["ContributorsApi.translationsList"]?.[localVarOperationServerIndex]?.url;
249
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
250
- },
251
- };
252
- };
253
- exports.ContributorsApiFp = ContributorsApiFp;
254
- /**
255
- * ContributorsApi - factory interface
256
- * @export
257
- */
258
- const ContributorsApiFactory = function (configuration, basePath, axios) {
259
- const localVarFp = (0, exports.ContributorsApiFp)(configuration);
260
- return {
261
- /**
262
- * Add Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_add).
263
- * @summary Adds a contributor to a project language or an administrator to a project.
264
- * @param {string} id The id of project
265
- * @param {string} name The name of contributor
266
- * @param {string} email The email of contributor
267
- * @param {string} [apiToken]
268
- * @param {string} [language] The language code (Required if adding a contributor)
269
- * @param {ContributorsAddAdminEnum} [admin] Set it to 1 for adding as administrator
270
- * @param {*} [options] Override http request option.
271
- * @throws {RequiredError}
272
- */
273
- contributorsAdd(id, name, email, apiToken, language, admin, options) {
274
- return localVarFp
275
- .contributorsAdd(id, name, email, apiToken, language, admin, options)
276
- .then(request => request(axios, basePath));
277
- },
278
- /**
279
- * Remove Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_remove).
280
- * @summary Removes a contributor from a project language or an admin from a project, if the language is not specified.
281
- * @param {string} id The id of project
282
- * @param {string} email The email of contributor
283
- * @param {string} [apiToken]
284
- * @param {string} [language] The language code (Required if removing a contributor from a certain language)
285
- * @param {*} [options] Override http request option.
286
- * @throws {RequiredError}
287
- */
288
- contributorsRemove(id, email, apiToken, language, options) {
289
- return localVarFp
290
- .contributorsRemove(id, email, apiToken, language, options)
291
- .then(request => request(axios, basePath));
292
- },
293
- /**
294
- * List Contributors. More details in the [documentation](https://poeditor.com/docs/api#contributors_list).
295
- * @summary Returns the list of contributors from your projects.
296
- * @param {string} [apiToken]
297
- * @param {string} [id] The id of project (Optional, unless language is set. Then, it becomes required)
298
- * @param {string} [language] The language code
299
- * @param {*} [options] Override http request option.
300
- * @throws {RequiredError}
301
- */
302
- translationsList(apiToken, id, language, options) {
303
- return localVarFp.translationsList(apiToken, id, language, options).then(request => request(axios, basePath));
304
- },
305
- };
306
- };
307
- exports.ContributorsApiFactory = ContributorsApiFactory;
308
- /**
309
- * ContributorsApi - object-oriented interface
310
- * @export
311
- * @class ContributorsApi
312
- * @extends {BaseAPI}
313
- */
314
- class ContributorsApi extends base_1.BaseAPI {
315
- /**
316
- * Add Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_add).
317
- * @summary Adds a contributor to a project language or an administrator to a project.
318
- * @param {string} id The id of project
319
- * @param {string} name The name of contributor
320
- * @param {string} email The email of contributor
321
- * @param {string} [apiToken]
322
- * @param {string} [language] The language code (Required if adding a contributor)
323
- * @param {ContributorsAddAdminEnum} [admin] Set it to 1 for adding as administrator
324
- * @param {*} [options] Override http request option.
325
- * @throws {RequiredError}
326
- * @memberof ContributorsApi
327
- */
328
- contributorsAdd(id, name, email, apiToken, language, admin, options) {
329
- return (0, exports.ContributorsApiFp)(this.configuration)
330
- .contributorsAdd(id, name, email, apiToken, language, admin, options)
331
- .then(request => request(this.axios, this.basePath));
332
- }
333
- /**
334
- * Remove Contributor. More details in the [documentation](https://poeditor.com/docs/api#contributors_remove).
335
- * @summary Removes a contributor from a project language or an admin from a project, if the language is not specified.
336
- * @param {string} id The id of project
337
- * @param {string} email The email of contributor
338
- * @param {string} [apiToken]
339
- * @param {string} [language] The language code (Required if removing a contributor from a certain language)
340
- * @param {*} [options] Override http request option.
341
- * @throws {RequiredError}
342
- * @memberof ContributorsApi
343
- */
344
- contributorsRemove(id, email, apiToken, language, options) {
345
- return (0, exports.ContributorsApiFp)(this.configuration)
346
- .contributorsRemove(id, email, apiToken, language, options)
347
- .then(request => request(this.axios, this.basePath));
348
- }
349
- /**
350
- * List Contributors. More details in the [documentation](https://poeditor.com/docs/api#contributors_list).
351
- * @summary Returns the list of contributors from your projects.
352
- * @param {string} [apiToken]
353
- * @param {string} [id] The id of project (Optional, unless language is set. Then, it becomes required)
354
- * @param {string} [language] The language code
355
- * @param {*} [options] Override http request option.
356
- * @throws {RequiredError}
357
- * @memberof ContributorsApi
358
- */
359
- translationsList(apiToken, id, language, options) {
360
- return (0, exports.ContributorsApiFp)(this.configuration)
361
- .translationsList(apiToken, id, language, options)
362
- .then(request => request(this.axios, this.basePath));
363
- }
364
- }
365
- exports.ContributorsApi = ContributorsApi;
366
- /**
367
- * @export
368
- */
369
- exports.ContributorsAddAdminEnum = {
370
- NUMBER_0: 0,
371
- NUMBER_1: 1,
372
- };
373
- /**
374
- * LanguagesApi - axios parameter creator
375
- * @export
376
- */
377
- const LanguagesApiAxiosParamCreator = function (configuration) {
378
- return {
379
- /**
380
- * Add Language to Project. More details in the [documentation](https://poeditor.com/docs/api#languages_add).
381
- * @summary Adds a new language to project.
382
- * @param {number} id
383
- * @param {string} language
384
- * @param {string} [apiToken]
385
- * @param {*} [options] Override http request option.
386
- * @throws {RequiredError}
387
- */
388
- languagesAdd: async (id, language, apiToken, options = {}) => {
389
- // verify required parameter 'id' is not null or undefined
390
- (0, common_1.assertParamExists)("languagesAdd", "id", id);
391
- // verify required parameter 'language' is not null or undefined
392
- (0, common_1.assertParamExists)("languagesAdd", "language", language);
393
- const localVarPath = `/languages/add`;
394
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
395
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
396
- let baseOptions;
397
- if (configuration) {
398
- baseOptions = configuration.baseOptions;
399
- }
400
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
401
- const localVarHeaderParameter = {};
402
- const localVarQueryParameter = {};
403
- const localVarFormParams = new URLSearchParams();
404
- if (apiToken !== undefined) {
405
- localVarFormParams.set("api_token", apiToken);
406
- }
407
- if (id !== undefined) {
408
- localVarFormParams.set("id", id);
409
- }
410
- if (language !== undefined) {
411
- localVarFormParams.set("language", language);
412
- }
413
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
414
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
415
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
416
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
417
- localVarRequestOptions.data = localVarFormParams.toString();
418
- return {
419
- url: (0, common_1.toPathString)(localVarUrlObj),
420
- options: localVarRequestOptions,
421
- };
422
- },
423
- /**
424
- * Delete Language from Project. More details in the [documentation](https://poeditor.com/docs/api#languages_delete).
425
- * @summary Deletes existing language from project.
426
- * @param {number} id
427
- * @param {string} language
428
- * @param {string} [apiToken]
429
- * @param {*} [options] Override http request option.
430
- * @throws {RequiredError}
431
- */
432
- languagesDelete: async (id, language, apiToken, options = {}) => {
433
- // verify required parameter 'id' is not null or undefined
434
- (0, common_1.assertParamExists)("languagesDelete", "id", id);
435
- // verify required parameter 'language' is not null or undefined
436
- (0, common_1.assertParamExists)("languagesDelete", "language", language);
437
- const localVarPath = `/languages/delete`;
438
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
439
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
440
- let baseOptions;
441
- if (configuration) {
442
- baseOptions = configuration.baseOptions;
443
- }
444
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
445
- const localVarHeaderParameter = {};
446
- const localVarQueryParameter = {};
447
- const localVarFormParams = new URLSearchParams();
448
- if (apiToken !== undefined) {
449
- localVarFormParams.set("api_token", apiToken);
450
- }
451
- if (id !== undefined) {
452
- localVarFormParams.set("id", id);
453
- }
454
- if (language !== undefined) {
455
- localVarFormParams.set("language", language);
456
- }
457
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
458
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
459
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
460
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
461
- localVarRequestOptions.data = localVarFormParams.toString();
462
- return {
463
- url: (0, common_1.toPathString)(localVarUrlObj),
464
- options: localVarRequestOptions,
465
- };
466
- },
467
- /**
468
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_list).
469
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
470
- * @param {number} id
471
- * @param {string} [apiToken]
472
- * @param {*} [options] Override http request option.
473
- * @throws {RequiredError}
474
- */
475
- languagesList: async (id, apiToken, options = {}) => {
476
- // verify required parameter 'id' is not null or undefined
477
- (0, common_1.assertParamExists)("languagesList", "id", id);
478
- const localVarPath = `/languages/list`;
479
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
480
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
481
- let baseOptions;
482
- if (configuration) {
483
- baseOptions = configuration.baseOptions;
484
- }
485
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
486
- const localVarHeaderParameter = {};
487
- const localVarQueryParameter = {};
488
- const localVarFormParams = new URLSearchParams();
489
- if (apiToken !== undefined) {
490
- localVarFormParams.set("api_token", apiToken);
491
- }
492
- if (id !== undefined) {
493
- localVarFormParams.set("id", id);
494
- }
495
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
496
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
497
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
498
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
499
- localVarRequestOptions.data = localVarFormParams.toString();
500
- return {
501
- url: (0, common_1.toPathString)(localVarUrlObj),
502
- options: localVarRequestOptions,
503
- };
504
- },
505
- /**
506
- * Update Project Language. More details in the [documentation](https://poeditor.com/docs/api#languages_update).
507
- * @summary Inserts / overwrites translations.
508
- * @param {number} id
509
- * @param {string} language The language code
510
- * @param {string} data JSON format
511
- * @param {string} [apiToken]
512
- * @param {LanguagesUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
513
- * @param {*} [options] Override http request option.
514
- * @throws {RequiredError}
515
- */
516
- languagesUpdate: async (id, language, data, apiToken, fuzzyTrigger, options = {}) => {
517
- // verify required parameter 'id' is not null or undefined
518
- (0, common_1.assertParamExists)("languagesUpdate", "id", id);
519
- // verify required parameter 'language' is not null or undefined
520
- (0, common_1.assertParamExists)("languagesUpdate", "language", language);
521
- // verify required parameter 'data' is not null or undefined
522
- (0, common_1.assertParamExists)("languagesUpdate", "data", data);
523
- const localVarPath = `/languages/update`;
524
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
525
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
526
- let baseOptions;
527
- if (configuration) {
528
- baseOptions = configuration.baseOptions;
529
- }
530
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
531
- const localVarHeaderParameter = {};
532
- const localVarQueryParameter = {};
533
- const localVarFormParams = new URLSearchParams();
534
- if (apiToken !== undefined) {
535
- localVarFormParams.set("api_token", apiToken);
536
- }
537
- if (id !== undefined) {
538
- localVarFormParams.set("id", id);
539
- }
540
- if (language !== undefined) {
541
- localVarFormParams.set("language", language);
542
- }
543
- if (fuzzyTrigger !== undefined) {
544
- localVarFormParams.set("fuzzy_trigger", fuzzyTrigger);
545
- }
546
- if (data !== undefined) {
547
- localVarFormParams.set("data", data);
548
- }
549
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
550
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
551
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
552
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
553
- localVarRequestOptions.data = localVarFormParams.toString();
554
- return {
555
- url: (0, common_1.toPathString)(localVarUrlObj),
556
- options: localVarRequestOptions,
557
- };
558
- },
559
- /**
560
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_available).
561
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
562
- * @param {number} id
563
- * @param {string} [apiToken]
564
- * @param {*} [options] Override http request option.
565
- * @throws {RequiredError}
566
- */
567
- projectsAvailable: async (id, apiToken, options = {}) => {
568
- // verify required parameter 'id' is not null or undefined
569
- (0, common_1.assertParamExists)("projectsAvailable", "id", id);
570
- const localVarPath = `/languages/available`;
571
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
572
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
573
- let baseOptions;
574
- if (configuration) {
575
- baseOptions = configuration.baseOptions;
576
- }
577
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
578
- const localVarHeaderParameter = {};
579
- const localVarQueryParameter = {};
580
- const localVarFormParams = new URLSearchParams();
581
- if (apiToken !== undefined) {
582
- localVarFormParams.set("api_token", apiToken);
583
- }
584
- if (id !== undefined) {
585
- localVarFormParams.set("id", id);
586
- }
587
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
588
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
589
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
590
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
591
- localVarRequestOptions.data = localVarFormParams.toString();
592
- return {
593
- url: (0, common_1.toPathString)(localVarUrlObj),
594
- options: localVarRequestOptions,
595
- };
596
- },
597
- };
598
- };
599
- exports.LanguagesApiAxiosParamCreator = LanguagesApiAxiosParamCreator;
600
- /**
601
- * LanguagesApi - functional programming interface
602
- * @export
603
- */
604
- const LanguagesApiFp = function (configuration) {
605
- const localVarAxiosParamCreator = (0, exports.LanguagesApiAxiosParamCreator)(configuration);
606
- return {
607
- /**
608
- * Add Language to Project. More details in the [documentation](https://poeditor.com/docs/api#languages_add).
609
- * @summary Adds a new language to project.
610
- * @param {number} id
611
- * @param {string} language
612
- * @param {string} [apiToken]
613
- * @param {*} [options] Override http request option.
614
- * @throws {RequiredError}
615
- */
616
- async languagesAdd(id, language, apiToken, options) {
617
- const localVarAxiosArgs = await localVarAxiosParamCreator.languagesAdd(id, language, apiToken, options);
618
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
619
- const localVarOperationServerBasePath = base_1.operationServerMap["LanguagesApi.languagesAdd"]?.[localVarOperationServerIndex]?.url;
620
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
621
- },
622
- /**
623
- * Delete Language from Project. More details in the [documentation](https://poeditor.com/docs/api#languages_delete).
624
- * @summary Deletes existing language from project.
625
- * @param {number} id
626
- * @param {string} language
627
- * @param {string} [apiToken]
628
- * @param {*} [options] Override http request option.
629
- * @throws {RequiredError}
630
- */
631
- async languagesDelete(id, language, apiToken, options) {
632
- const localVarAxiosArgs = await localVarAxiosParamCreator.languagesDelete(id, language, apiToken, options);
633
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
634
- const localVarOperationServerBasePath = base_1.operationServerMap["LanguagesApi.languagesDelete"]?.[localVarOperationServerIndex]?.url;
635
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
636
- },
637
- /**
638
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_list).
639
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
640
- * @param {number} id
641
- * @param {string} [apiToken]
642
- * @param {*} [options] Override http request option.
643
- * @throws {RequiredError}
644
- */
645
- async languagesList(id, apiToken, options) {
646
- const localVarAxiosArgs = await localVarAxiosParamCreator.languagesList(id, apiToken, options);
647
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
648
- const localVarOperationServerBasePath = base_1.operationServerMap["LanguagesApi.languagesList"]?.[localVarOperationServerIndex]?.url;
649
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
650
- },
651
- /**
652
- * Update Project Language. More details in the [documentation](https://poeditor.com/docs/api#languages_update).
653
- * @summary Inserts / overwrites translations.
654
- * @param {number} id
655
- * @param {string} language The language code
656
- * @param {string} data JSON format
657
- * @param {string} [apiToken]
658
- * @param {LanguagesUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
659
- * @param {*} [options] Override http request option.
660
- * @throws {RequiredError}
661
- */
662
- async languagesUpdate(id, language, data, apiToken, fuzzyTrigger, options) {
663
- const localVarAxiosArgs = await localVarAxiosParamCreator.languagesUpdate(id, language, data, apiToken, fuzzyTrigger, options);
664
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
665
- const localVarOperationServerBasePath = base_1.operationServerMap["LanguagesApi.languagesUpdate"]?.[localVarOperationServerIndex]?.url;
666
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
667
- },
668
- /**
669
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_available).
670
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
671
- * @param {number} id
672
- * @param {string} [apiToken]
673
- * @param {*} [options] Override http request option.
674
- * @throws {RequiredError}
675
- */
676
- async projectsAvailable(id, apiToken, options) {
677
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsAvailable(id, apiToken, options);
678
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
679
- const localVarOperationServerBasePath = base_1.operationServerMap["LanguagesApi.projectsAvailable"]?.[localVarOperationServerIndex]?.url;
680
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
681
- },
682
- };
683
- };
684
- exports.LanguagesApiFp = LanguagesApiFp;
685
- /**
686
- * LanguagesApi - factory interface
687
- * @export
688
- */
689
- const LanguagesApiFactory = function (configuration, basePath, axios) {
690
- const localVarFp = (0, exports.LanguagesApiFp)(configuration);
691
- return {
692
- /**
693
- * Add Language to Project. More details in the [documentation](https://poeditor.com/docs/api#languages_add).
694
- * @summary Adds a new language to project.
695
- * @param {number} id
696
- * @param {string} language
697
- * @param {string} [apiToken]
698
- * @param {*} [options] Override http request option.
699
- * @throws {RequiredError}
700
- */
701
- languagesAdd(id, language, apiToken, options) {
702
- return localVarFp.languagesAdd(id, language, apiToken, options).then(request => request(axios, basePath));
703
- },
704
- /**
705
- * Delete Language from Project. More details in the [documentation](https://poeditor.com/docs/api#languages_delete).
706
- * @summary Deletes existing language from project.
707
- * @param {number} id
708
- * @param {string} language
709
- * @param {string} [apiToken]
710
- * @param {*} [options] Override http request option.
711
- * @throws {RequiredError}
712
- */
713
- languagesDelete(id, language, apiToken, options) {
714
- return localVarFp.languagesDelete(id, language, apiToken, options).then(request => request(axios, basePath));
715
- },
716
- /**
717
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_list).
718
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
719
- * @param {number} id
720
- * @param {string} [apiToken]
721
- * @param {*} [options] Override http request option.
722
- * @throws {RequiredError}
723
- */
724
- languagesList(id, apiToken, options) {
725
- return localVarFp.languagesList(id, apiToken, options).then(request => request(axios, basePath));
726
- },
727
- /**
728
- * Update Project Language. More details in the [documentation](https://poeditor.com/docs/api#languages_update).
729
- * @summary Inserts / overwrites translations.
730
- * @param {number} id
731
- * @param {string} language The language code
732
- * @param {string} data JSON format
733
- * @param {string} [apiToken]
734
- * @param {LanguagesUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
735
- * @param {*} [options] Override http request option.
736
- * @throws {RequiredError}
737
- */
738
- languagesUpdate(id, language, data, apiToken, fuzzyTrigger, options) {
739
- return localVarFp
740
- .languagesUpdate(id, language, data, apiToken, fuzzyTrigger, options)
741
- .then(request => request(axios, basePath));
742
- },
743
- /**
744
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_available).
745
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
746
- * @param {number} id
747
- * @param {string} [apiToken]
748
- * @param {*} [options] Override http request option.
749
- * @throws {RequiredError}
750
- */
751
- projectsAvailable(id, apiToken, options) {
752
- return localVarFp.projectsAvailable(id, apiToken, options).then(request => request(axios, basePath));
753
- },
754
- };
755
- };
756
- exports.LanguagesApiFactory = LanguagesApiFactory;
757
- /**
758
- * LanguagesApi - object-oriented interface
759
- * @export
760
- * @class LanguagesApi
761
- * @extends {BaseAPI}
762
- */
763
- class LanguagesApi extends base_1.BaseAPI {
764
- /**
765
- * Add Language to Project. More details in the [documentation](https://poeditor.com/docs/api#languages_add).
766
- * @summary Adds a new language to project.
767
- * @param {number} id
768
- * @param {string} language
769
- * @param {string} [apiToken]
770
- * @param {*} [options] Override http request option.
771
- * @throws {RequiredError}
772
- * @memberof LanguagesApi
773
- */
774
- languagesAdd(id, language, apiToken, options) {
775
- return (0, exports.LanguagesApiFp)(this.configuration)
776
- .languagesAdd(id, language, apiToken, options)
777
- .then(request => request(this.axios, this.basePath));
778
- }
779
- /**
780
- * Delete Language from Project. More details in the [documentation](https://poeditor.com/docs/api#languages_delete).
781
- * @summary Deletes existing language from project.
782
- * @param {number} id
783
- * @param {string} language
784
- * @param {string} [apiToken]
785
- * @param {*} [options] Override http request option.
786
- * @throws {RequiredError}
787
- * @memberof LanguagesApi
788
- */
789
- languagesDelete(id, language, apiToken, options) {
790
- return (0, exports.LanguagesApiFp)(this.configuration)
791
- .languagesDelete(id, language, apiToken, options)
792
- .then(request => request(this.axios, this.basePath));
793
- }
794
- /**
795
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_list).
796
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
797
- * @param {number} id
798
- * @param {string} [apiToken]
799
- * @param {*} [options] Override http request option.
800
- * @throws {RequiredError}
801
- * @memberof LanguagesApi
802
- */
803
- languagesList(id, apiToken, options) {
804
- return (0, exports.LanguagesApiFp)(this.configuration)
805
- .languagesList(id, apiToken, options)
806
- .then(request => request(this.axios, this.basePath));
807
- }
808
- /**
809
- * Update Project Language. More details in the [documentation](https://poeditor.com/docs/api#languages_update).
810
- * @summary Inserts / overwrites translations.
811
- * @param {number} id
812
- * @param {string} language The language code
813
- * @param {string} data JSON format
814
- * @param {string} [apiToken]
815
- * @param {LanguagesUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
816
- * @param {*} [options] Override http request option.
817
- * @throws {RequiredError}
818
- * @memberof LanguagesApi
819
- */
820
- languagesUpdate(id, language, data, apiToken, fuzzyTrigger, options) {
821
- return (0, exports.LanguagesApiFp)(this.configuration)
822
- .languagesUpdate(id, language, data, apiToken, fuzzyTrigger, options)
823
- .then(request => request(this.axios, this.basePath));
824
- }
825
- /**
826
- * List Languages. More details in the [documentation](https://poeditor.com/docs/api#languages_available).
827
- * @summary Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.
828
- * @param {number} id
829
- * @param {string} [apiToken]
830
- * @param {*} [options] Override http request option.
831
- * @throws {RequiredError}
832
- * @memberof LanguagesApi
833
- */
834
- projectsAvailable(id, apiToken, options) {
835
- return (0, exports.LanguagesApiFp)(this.configuration)
836
- .projectsAvailable(id, apiToken, options)
837
- .then(request => request(this.axios, this.basePath));
838
- }
839
- }
840
- exports.LanguagesApi = LanguagesApi;
841
- /**
842
- * @export
843
- */
844
- exports.LanguagesUpdateFuzzyTriggerEnum = {
845
- NUMBER_0: 0,
846
- NUMBER_1: 1,
847
- };
848
- /**
849
- * ProjectsApi - axios parameter creator
850
- * @export
851
- */
852
- const ProjectsApiAxiosParamCreator = function (configuration) {
853
- return {
854
- /**
855
- * Add Project. More details in the [documentation](https://poeditor.com/docs/api#projects_add).
856
- * @summary Creates a new project. Returns project details (if successful).
857
- * @param {string} name
858
- * @param {string} [apiToken]
859
- * @param {string} [description]
860
- * @param {*} [options] Override http request option.
861
- * @throws {RequiredError}
862
- */
863
- projectsAdd: async (name, apiToken, description, options = {}) => {
864
- // verify required parameter 'name' is not null or undefined
865
- (0, common_1.assertParamExists)("projectsAdd", "name", name);
866
- const localVarPath = `/projects/add`;
867
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
868
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
869
- let baseOptions;
870
- if (configuration) {
871
- baseOptions = configuration.baseOptions;
872
- }
873
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
874
- const localVarHeaderParameter = {};
875
- const localVarQueryParameter = {};
876
- const localVarFormParams = new URLSearchParams();
877
- if (apiToken !== undefined) {
878
- localVarFormParams.set("api_token", apiToken);
879
- }
880
- if (name !== undefined) {
881
- localVarFormParams.set("name", name);
882
- }
883
- if (description !== undefined) {
884
- localVarFormParams.set("description", description);
885
- }
886
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
887
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
888
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
889
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
890
- localVarRequestOptions.data = localVarFormParams.toString();
891
- return {
892
- url: (0, common_1.toPathString)(localVarUrlObj),
893
- options: localVarRequestOptions,
894
- };
895
- },
896
- /**
897
- * Delete Project. More details in the [documentation](https://poeditor.com/docs/api#projects_delete).
898
- * @summary Deletes the project from the account. You must be the owner of the project.
899
- * @param {number} id
900
- * @param {string} [apiToken]
901
- * @param {*} [options] Override http request option.
902
- * @throws {RequiredError}
903
- */
904
- projectsDelete: async (id, apiToken, options = {}) => {
905
- // verify required parameter 'id' is not null or undefined
906
- (0, common_1.assertParamExists)("projectsDelete", "id", id);
907
- const localVarPath = `/projects/delete`;
908
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
909
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
910
- let baseOptions;
911
- if (configuration) {
912
- baseOptions = configuration.baseOptions;
913
- }
914
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
915
- const localVarHeaderParameter = {};
916
- const localVarQueryParameter = {};
917
- const localVarFormParams = new URLSearchParams();
918
- if (apiToken !== undefined) {
919
- localVarFormParams.set("api_token", apiToken);
920
- }
921
- if (id !== undefined) {
922
- localVarFormParams.set("id", id);
923
- }
924
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
925
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
926
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
927
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
928
- localVarRequestOptions.data = localVarFormParams.toString();
929
- return {
930
- url: (0, common_1.toPathString)(localVarUrlObj),
931
- options: localVarRequestOptions,
932
- };
933
- },
934
- /**
935
- * Export. More details in the [documentation](https://poeditor.com/docs/api#projects_export).
936
- * @summary Returns the link of the file (expires after 10 minutes). The settings inherited from the project will be the ones at the time of the download.
937
- * @param {number} id
938
- * @param {string} language
939
- * @param {ProjectsExportTypeEnum} type
940
- * @param {string} [apiToken]
941
- * @param {string} [filters]
942
- * @param {string} [order]
943
- * @param {string} [tags]
944
- * @param {ProjectsExportOptionsEnum} [_options]
945
- * @param {*} [options] Override http request option.
946
- * @throws {RequiredError}
947
- */
948
- projectsExport: async (id, language, type, apiToken, filters, order, tags, _options, options = {}) => {
949
- // verify required parameter 'id' is not null or undefined
950
- (0, common_1.assertParamExists)("projectsExport", "id", id);
951
- // verify required parameter 'language' is not null or undefined
952
- (0, common_1.assertParamExists)("projectsExport", "language", language);
953
- // verify required parameter 'type' is not null or undefined
954
- (0, common_1.assertParamExists)("projectsExport", "type", type);
955
- const localVarPath = `/projects/export`;
956
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
957
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
958
- let baseOptions;
959
- if (configuration) {
960
- baseOptions = configuration.baseOptions;
961
- }
962
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
963
- const localVarHeaderParameter = {};
964
- const localVarQueryParameter = {};
965
- const localVarFormParams = new URLSearchParams();
966
- if (apiToken !== undefined) {
967
- localVarFormParams.set("api_token", apiToken);
968
- }
969
- if (id !== undefined) {
970
- localVarFormParams.set("id", id);
971
- }
972
- if (language !== undefined) {
973
- localVarFormParams.set("language", language);
974
- }
975
- if (type !== undefined) {
976
- localVarFormParams.set("type", type);
977
- }
978
- if (filters !== undefined) {
979
- localVarFormParams.set("filters", filters);
980
- }
981
- if (order !== undefined) {
982
- localVarFormParams.set("order", order);
983
- }
984
- if (tags !== undefined) {
985
- localVarFormParams.set("tags", tags);
986
- }
987
- if (_options !== undefined) {
988
- localVarFormParams.set("options", _options);
989
- }
990
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
991
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
992
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
993
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
994
- localVarRequestOptions.data = localVarFormParams.toString();
995
- return {
996
- url: (0, common_1.toPathString)(localVarUrlObj),
997
- options: localVarRequestOptions,
998
- };
999
- },
1000
- /**
1001
- * List Projects. More details in the [documentation](https://poeditor.com/docs/api#projects_list).
1002
- * @summary Returns the list of projects owned by user.
1003
- * @param {string} apiToken
1004
- * @param {*} [options] Override http request option.
1005
- * @throws {RequiredError}
1006
- */
1007
- projectsList: async (apiToken, options = {}) => {
1008
- // verify required parameter 'apiToken' is not null or undefined
1009
- (0, common_1.assertParamExists)("projectsList", "apiToken", apiToken);
1010
- const localVarPath = `/projects/list`;
1011
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1012
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1013
- let baseOptions;
1014
- if (configuration) {
1015
- baseOptions = configuration.baseOptions;
1016
- }
1017
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1018
- const localVarHeaderParameter = {};
1019
- const localVarQueryParameter = {};
1020
- const localVarFormParams = new URLSearchParams();
1021
- if (apiToken !== undefined) {
1022
- localVarFormParams.set("api_token", apiToken);
1023
- }
1024
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1025
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1026
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1027
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1028
- localVarRequestOptions.data = localVarFormParams.toString();
1029
- return {
1030
- url: (0, common_1.toPathString)(localVarUrlObj),
1031
- options: localVarRequestOptions,
1032
- };
1033
- },
1034
- /**
1035
- * Sync Terms. More details in the [documentation](https://poeditor.com/docs/api#projects_sync).
1036
- * @summary Syncs your project with the array you send (terms that are not found in the JSON object will be deleted from project and the new ones added). Please use with caution. If wrong data is sent, existing terms and their translations might be irreversibly lost.
1037
- * @param {number} id
1038
- * @param {string} data JSON format
1039
- * @param {string} [apiToken]
1040
- * @param {*} [options] Override http request option.
1041
- * @throws {RequiredError}
1042
- */
1043
- projectsSync: async (id, data, apiToken, options = {}) => {
1044
- // verify required parameter 'id' is not null or undefined
1045
- (0, common_1.assertParamExists)("projectsSync", "id", id);
1046
- // verify required parameter 'data' is not null or undefined
1047
- (0, common_1.assertParamExists)("projectsSync", "data", data);
1048
- const localVarPath = `/projects/sync`;
1049
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1050
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1051
- let baseOptions;
1052
- if (configuration) {
1053
- baseOptions = configuration.baseOptions;
1054
- }
1055
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1056
- const localVarHeaderParameter = {};
1057
- const localVarQueryParameter = {};
1058
- const localVarFormParams = new URLSearchParams();
1059
- if (apiToken !== undefined) {
1060
- localVarFormParams.set("api_token", apiToken);
1061
- }
1062
- if (id !== undefined) {
1063
- localVarFormParams.set("id", id);
1064
- }
1065
- if (data !== undefined) {
1066
- localVarFormParams.set("data", data);
1067
- }
1068
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1069
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1070
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1071
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1072
- localVarRequestOptions.data = localVarFormParams.toString();
1073
- return {
1074
- url: (0, common_1.toPathString)(localVarUrlObj),
1075
- options: localVarRequestOptions,
1076
- };
1077
- },
1078
- /**
1079
- * Update Project Settings. More details in the [documentation](https://poeditor.com/docs/api#projects_update).
1080
- * @summary Updates project settings (name, description, reference language, fallback language). If optional parameters are not sent, their respective fields are not updated.
1081
- * @param {number} id
1082
- * @param {string} [apiToken]
1083
- * @param {string} [name]
1084
- * @param {string} [description]
1085
- * @param {string} [referenceLanguage]
1086
- * @param {string} [fallbackLanguage]
1087
- * @param {*} [options] Override http request option.
1088
- * @throws {RequiredError}
1089
- */
1090
- projectsUpdate: async (id, apiToken, name, description, referenceLanguage, fallbackLanguage, options = {}) => {
1091
- // verify required parameter 'id' is not null or undefined
1092
- (0, common_1.assertParamExists)("projectsUpdate", "id", id);
1093
- const localVarPath = `/projects/update`;
1094
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1095
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1096
- let baseOptions;
1097
- if (configuration) {
1098
- baseOptions = configuration.baseOptions;
1099
- }
1100
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1101
- const localVarHeaderParameter = {};
1102
- const localVarQueryParameter = {};
1103
- const localVarFormParams = new URLSearchParams();
1104
- if (apiToken !== undefined) {
1105
- localVarFormParams.set("api_token", apiToken);
1106
- }
1107
- if (id !== undefined) {
1108
- localVarFormParams.set("id", id);
1109
- }
1110
- if (name !== undefined) {
1111
- localVarFormParams.set("name", name);
1112
- }
1113
- if (description !== undefined) {
1114
- localVarFormParams.set("description", description);
1115
- }
1116
- if (referenceLanguage !== undefined) {
1117
- localVarFormParams.set("reference_language", referenceLanguage);
1118
- }
1119
- if (fallbackLanguage !== undefined) {
1120
- localVarFormParams.set("fallback_language", fallbackLanguage);
1121
- }
1122
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1123
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1124
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1125
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1126
- localVarRequestOptions.data = localVarFormParams.toString();
1127
- return {
1128
- url: (0, common_1.toPathString)(localVarUrlObj),
1129
- options: localVarRequestOptions,
1130
- };
1131
- },
1132
- /**
1133
- * Upload. More details in the [documentation](https://poeditor.com/docs/api#projects_upload).
1134
- * @summary Updates terms / translations - No more than one request every 20 seconds.
1135
- * @param {ProjectsUploadUpdatingEnum} updating
1136
- * @param {File} file Uploaded file (.po, .xls or any of the supported file formats)
1137
- * @param {string} [apiToken]
1138
- * @param {number} [id]
1139
- * @param {string} [language] The language code (Required only if `updating` is terms_translations or translations). When using `terms_translations` with `.xcstrings` file format, leave it empty to import all the languages in the file.
1140
- * @param {ProjectsUploadOverwriteEnum} [overwrite] Set it to 1 if you want to overwrite translations
1141
- * @param {ProjectsUploadSyncTermsEnum} [syncTerms] Set it to 1 if you want to sync your terms (terms that are not found in the uploaded file will be deleted from project and the new ones added). Ignored if `updating` = translations.
1142
- * @param {string} [tags] Add tags to the project terms; available when updating terms or terms_translations; you can use the following keys: \\\"all\\\" - for the all the imported terms, \\\"new\\\" - for the terms which arent already in the project, \\\"obsolete\\\" - for the terms which are in the project but not in the imported file and \\\"overwritten_translations\\\" - for the terms for which translations change
1143
- * @param {ProjectsUploadReadFromSourceEnum} [readFromSource] For .xliff format only - set it to 1 if you want to import translations from the source tag
1144
- * @param {ProjectsUploadFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
1145
- * @param {*} [options] Override http request option.
1146
- * @throws {RequiredError}
1147
- */
1148
- projectsUpload: async (updating, file, apiToken, id, language, overwrite, syncTerms, tags, readFromSource, fuzzyTrigger, options = {}) => {
1149
- // verify required parameter 'updating' is not null or undefined
1150
- (0, common_1.assertParamExists)("projectsUpload", "updating", updating);
1151
- // verify required parameter 'file' is not null or undefined
1152
- (0, common_1.assertParamExists)("projectsUpload", "file", file);
1153
- const localVarPath = `/projects/upload`;
1154
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1155
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1156
- let baseOptions;
1157
- if (configuration) {
1158
- baseOptions = configuration.baseOptions;
1159
- }
1160
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1161
- const localVarHeaderParameter = {};
1162
- const localVarQueryParameter = {};
1163
- const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
1164
- if (apiToken !== undefined) {
1165
- localVarFormParams.append("api_token", apiToken);
1166
- }
1167
- if (id !== undefined) {
1168
- localVarFormParams.append("id", id);
1169
- }
1170
- if (updating !== undefined) {
1171
- localVarFormParams.append("updating", updating);
1172
- }
1173
- if (file !== undefined) {
1174
- localVarFormParams.append("file", file);
1175
- }
1176
- if (language !== undefined) {
1177
- localVarFormParams.append("language", language);
1178
- }
1179
- if (overwrite !== undefined) {
1180
- localVarFormParams.append("overwrite", overwrite);
1181
- }
1182
- if (syncTerms !== undefined) {
1183
- localVarFormParams.append("sync_terms", syncTerms);
1184
- }
1185
- if (tags !== undefined) {
1186
- localVarFormParams.append("tags", tags);
1187
- }
1188
- if (readFromSource !== undefined) {
1189
- localVarFormParams.append("read_from_source", readFromSource);
1190
- }
1191
- if (fuzzyTrigger !== undefined) {
1192
- localVarFormParams.append("fuzzy_trigger", fuzzyTrigger);
1193
- }
1194
- localVarHeaderParameter["Content-Type"] = "multipart/form-data";
1195
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1196
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1197
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1198
- localVarRequestOptions.data = localVarFormParams;
1199
- return {
1200
- url: (0, common_1.toPathString)(localVarUrlObj),
1201
- options: localVarRequestOptions,
1202
- };
1203
- },
1204
- /**
1205
- * View Project Details. More details in the [documentation](https://poeditor.com/docs/api#projects_view).
1206
- * @summary Returns projects details
1207
- * @param {number} id
1208
- * @param {string} [apiToken]
1209
- * @param {*} [options] Override http request option.
1210
- * @throws {RequiredError}
1211
- */
1212
- projectsView: async (id, apiToken, options = {}) => {
1213
- // verify required parameter 'id' is not null or undefined
1214
- (0, common_1.assertParamExists)("projectsView", "id", id);
1215
- const localVarPath = `/projects/view`;
1216
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1217
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1218
- let baseOptions;
1219
- if (configuration) {
1220
- baseOptions = configuration.baseOptions;
1221
- }
1222
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1223
- const localVarHeaderParameter = {};
1224
- const localVarQueryParameter = {};
1225
- const localVarFormParams = new URLSearchParams();
1226
- if (apiToken !== undefined) {
1227
- localVarFormParams.set("api_token", apiToken);
1228
- }
1229
- if (id !== undefined) {
1230
- localVarFormParams.set("id", id);
1231
- }
1232
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1233
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1234
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1235
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1236
- localVarRequestOptions.data = localVarFormParams.toString();
1237
- return {
1238
- url: (0, common_1.toPathString)(localVarUrlObj),
1239
- options: localVarRequestOptions,
1240
- };
1241
- },
1242
- };
1243
- };
1244
- exports.ProjectsApiAxiosParamCreator = ProjectsApiAxiosParamCreator;
1245
- /**
1246
- * ProjectsApi - functional programming interface
1247
- * @export
1248
- */
1249
- const ProjectsApiFp = function (configuration) {
1250
- const localVarAxiosParamCreator = (0, exports.ProjectsApiAxiosParamCreator)(configuration);
1251
- return {
1252
- /**
1253
- * Add Project. More details in the [documentation](https://poeditor.com/docs/api#projects_add).
1254
- * @summary Creates a new project. Returns project details (if successful).
1255
- * @param {string} name
1256
- * @param {string} [apiToken]
1257
- * @param {string} [description]
1258
- * @param {*} [options] Override http request option.
1259
- * @throws {RequiredError}
1260
- */
1261
- async projectsAdd(name, apiToken, description, options) {
1262
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsAdd(name, apiToken, description, options);
1263
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1264
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsAdd"]?.[localVarOperationServerIndex]?.url;
1265
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1266
- },
1267
- /**
1268
- * Delete Project. More details in the [documentation](https://poeditor.com/docs/api#projects_delete).
1269
- * @summary Deletes the project from the account. You must be the owner of the project.
1270
- * @param {number} id
1271
- * @param {string} [apiToken]
1272
- * @param {*} [options] Override http request option.
1273
- * @throws {RequiredError}
1274
- */
1275
- async projectsDelete(id, apiToken, options) {
1276
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsDelete(id, apiToken, options);
1277
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1278
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsDelete"]?.[localVarOperationServerIndex]?.url;
1279
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1280
- },
1281
- /**
1282
- * Export. More details in the [documentation](https://poeditor.com/docs/api#projects_export).
1283
- * @summary Returns the link of the file (expires after 10 minutes). The settings inherited from the project will be the ones at the time of the download.
1284
- * @param {number} id
1285
- * @param {string} language
1286
- * @param {ProjectsExportTypeEnum} type
1287
- * @param {string} [apiToken]
1288
- * @param {string} [filters]
1289
- * @param {string} [order]
1290
- * @param {string} [tags]
1291
- * @param {ProjectsExportOptionsEnum} [_options]
1292
- * @param {*} [options] Override http request option.
1293
- * @throws {RequiredError}
1294
- */
1295
- async projectsExport(id, language, type, apiToken, filters, order, tags, _options, options) {
1296
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsExport(id, language, type, apiToken, filters, order, tags, _options, options);
1297
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1298
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsExport"]?.[localVarOperationServerIndex]?.url;
1299
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1300
- },
1301
- /**
1302
- * List Projects. More details in the [documentation](https://poeditor.com/docs/api#projects_list).
1303
- * @summary Returns the list of projects owned by user.
1304
- * @param {string} apiToken
1305
- * @param {*} [options] Override http request option.
1306
- * @throws {RequiredError}
1307
- */
1308
- async projectsList(apiToken, options) {
1309
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsList(apiToken, options);
1310
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1311
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsList"]?.[localVarOperationServerIndex]?.url;
1312
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1313
- },
1314
- /**
1315
- * Sync Terms. More details in the [documentation](https://poeditor.com/docs/api#projects_sync).
1316
- * @summary Syncs your project with the array you send (terms that are not found in the JSON object will be deleted from project and the new ones added). Please use with caution. If wrong data is sent, existing terms and their translations might be irreversibly lost.
1317
- * @param {number} id
1318
- * @param {string} data JSON format
1319
- * @param {string} [apiToken]
1320
- * @param {*} [options] Override http request option.
1321
- * @throws {RequiredError}
1322
- */
1323
- async projectsSync(id, data, apiToken, options) {
1324
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsSync(id, data, apiToken, options);
1325
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1326
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsSync"]?.[localVarOperationServerIndex]?.url;
1327
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1328
- },
1329
- /**
1330
- * Update Project Settings. More details in the [documentation](https://poeditor.com/docs/api#projects_update).
1331
- * @summary Updates project settings (name, description, reference language, fallback language). If optional parameters are not sent, their respective fields are not updated.
1332
- * @param {number} id
1333
- * @param {string} [apiToken]
1334
- * @param {string} [name]
1335
- * @param {string} [description]
1336
- * @param {string} [referenceLanguage]
1337
- * @param {string} [fallbackLanguage]
1338
- * @param {*} [options] Override http request option.
1339
- * @throws {RequiredError}
1340
- */
1341
- async projectsUpdate(id, apiToken, name, description, referenceLanguage, fallbackLanguage, options) {
1342
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsUpdate(id, apiToken, name, description, referenceLanguage, fallbackLanguage, options);
1343
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1344
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsUpdate"]?.[localVarOperationServerIndex]?.url;
1345
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1346
- },
1347
- /**
1348
- * Upload. More details in the [documentation](https://poeditor.com/docs/api#projects_upload).
1349
- * @summary Updates terms / translations - No more than one request every 20 seconds.
1350
- * @param {ProjectsUploadUpdatingEnum} updating
1351
- * @param {File} file Uploaded file (.po, .xls or any of the supported file formats)
1352
- * @param {string} [apiToken]
1353
- * @param {number} [id]
1354
- * @param {string} [language] The language code (Required only if `updating` is terms_translations or translations). When using `terms_translations` with `.xcstrings` file format, leave it empty to import all the languages in the file.
1355
- * @param {ProjectsUploadOverwriteEnum} [overwrite] Set it to 1 if you want to overwrite translations
1356
- * @param {ProjectsUploadSyncTermsEnum} [syncTerms] Set it to 1 if you want to sync your terms (terms that are not found in the uploaded file will be deleted from project and the new ones added). Ignored if `updating` = translations.
1357
- * @param {string} [tags] Add tags to the project terms; available when updating terms or terms_translations; you can use the following keys: \\\"all\\\" - for the all the imported terms, \\\"new\\\" - for the terms which arent already in the project, \\\"obsolete\\\" - for the terms which are in the project but not in the imported file and \\\"overwritten_translations\\\" - for the terms for which translations change
1358
- * @param {ProjectsUploadReadFromSourceEnum} [readFromSource] For .xliff format only - set it to 1 if you want to import translations from the source tag
1359
- * @param {ProjectsUploadFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
1360
- * @param {*} [options] Override http request option.
1361
- * @throws {RequiredError}
1362
- */
1363
- async projectsUpload(updating, file, apiToken, id, language, overwrite, syncTerms, tags, readFromSource, fuzzyTrigger, options) {
1364
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsUpload(updating, file, apiToken, id, language, overwrite, syncTerms, tags, readFromSource, fuzzyTrigger, options);
1365
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1366
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsUpload"]?.[localVarOperationServerIndex]?.url;
1367
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1368
- },
1369
- /**
1370
- * View Project Details. More details in the [documentation](https://poeditor.com/docs/api#projects_view).
1371
- * @summary Returns projects details
1372
- * @param {number} id
1373
- * @param {string} [apiToken]
1374
- * @param {*} [options] Override http request option.
1375
- * @throws {RequiredError}
1376
- */
1377
- async projectsView(id, apiToken, options) {
1378
- const localVarAxiosArgs = await localVarAxiosParamCreator.projectsView(id, apiToken, options);
1379
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1380
- const localVarOperationServerBasePath = base_1.operationServerMap["ProjectsApi.projectsView"]?.[localVarOperationServerIndex]?.url;
1381
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1382
- },
1383
- };
1384
- };
1385
- exports.ProjectsApiFp = ProjectsApiFp;
1386
- /**
1387
- * ProjectsApi - factory interface
1388
- * @export
1389
- */
1390
- const ProjectsApiFactory = function (configuration, basePath, axios) {
1391
- const localVarFp = (0, exports.ProjectsApiFp)(configuration);
1392
- return {
1393
- /**
1394
- * Add Project. More details in the [documentation](https://poeditor.com/docs/api#projects_add).
1395
- * @summary Creates a new project. Returns project details (if successful).
1396
- * @param {string} name
1397
- * @param {string} [apiToken]
1398
- * @param {string} [description]
1399
- * @param {*} [options] Override http request option.
1400
- * @throws {RequiredError}
1401
- */
1402
- projectsAdd(name, apiToken, description, options) {
1403
- return localVarFp.projectsAdd(name, apiToken, description, options).then(request => request(axios, basePath));
1404
- },
1405
- /**
1406
- * Delete Project. More details in the [documentation](https://poeditor.com/docs/api#projects_delete).
1407
- * @summary Deletes the project from the account. You must be the owner of the project.
1408
- * @param {number} id
1409
- * @param {string} [apiToken]
1410
- * @param {*} [options] Override http request option.
1411
- * @throws {RequiredError}
1412
- */
1413
- projectsDelete(id, apiToken, options) {
1414
- return localVarFp.projectsDelete(id, apiToken, options).then(request => request(axios, basePath));
1415
- },
1416
- /**
1417
- * Export. More details in the [documentation](https://poeditor.com/docs/api#projects_export).
1418
- * @summary Returns the link of the file (expires after 10 minutes). The settings inherited from the project will be the ones at the time of the download.
1419
- * @param {number} id
1420
- * @param {string} language
1421
- * @param {ProjectsExportTypeEnum} type
1422
- * @param {string} [apiToken]
1423
- * @param {string} [filters]
1424
- * @param {string} [order]
1425
- * @param {string} [tags]
1426
- * @param {ProjectsExportOptionsEnum} [_options]
1427
- * @param {*} [options] Override http request option.
1428
- * @throws {RequiredError}
1429
- */
1430
- projectsExport(id, language, type, apiToken, filters, order, tags, _options, options) {
1431
- return localVarFp
1432
- .projectsExport(id, language, type, apiToken, filters, order, tags, _options, options)
1433
- .then(request => request(axios, basePath));
1434
- },
1435
- /**
1436
- * List Projects. More details in the [documentation](https://poeditor.com/docs/api#projects_list).
1437
- * @summary Returns the list of projects owned by user.
1438
- * @param {string} apiToken
1439
- * @param {*} [options] Override http request option.
1440
- * @throws {RequiredError}
1441
- */
1442
- projectsList(apiToken, options) {
1443
- return localVarFp.projectsList(apiToken, options).then(request => request(axios, basePath));
1444
- },
1445
- /**
1446
- * Sync Terms. More details in the [documentation](https://poeditor.com/docs/api#projects_sync).
1447
- * @summary Syncs your project with the array you send (terms that are not found in the JSON object will be deleted from project and the new ones added). Please use with caution. If wrong data is sent, existing terms and their translations might be irreversibly lost.
1448
- * @param {number} id
1449
- * @param {string} data JSON format
1450
- * @param {string} [apiToken]
1451
- * @param {*} [options] Override http request option.
1452
- * @throws {RequiredError}
1453
- */
1454
- projectsSync(id, data, apiToken, options) {
1455
- return localVarFp.projectsSync(id, data, apiToken, options).then(request => request(axios, basePath));
1456
- },
1457
- /**
1458
- * Update Project Settings. More details in the [documentation](https://poeditor.com/docs/api#projects_update).
1459
- * @summary Updates project settings (name, description, reference language, fallback language). If optional parameters are not sent, their respective fields are not updated.
1460
- * @param {number} id
1461
- * @param {string} [apiToken]
1462
- * @param {string} [name]
1463
- * @param {string} [description]
1464
- * @param {string} [referenceLanguage]
1465
- * @param {string} [fallbackLanguage]
1466
- * @param {*} [options] Override http request option.
1467
- * @throws {RequiredError}
1468
- */
1469
- projectsUpdate(id, apiToken, name, description, referenceLanguage, fallbackLanguage, options) {
1470
- return localVarFp
1471
- .projectsUpdate(id, apiToken, name, description, referenceLanguage, fallbackLanguage, options)
1472
- .then(request => request(axios, basePath));
1473
- },
1474
- /**
1475
- * Upload. More details in the [documentation](https://poeditor.com/docs/api#projects_upload).
1476
- * @summary Updates terms / translations - No more than one request every 20 seconds.
1477
- * @param {ProjectsUploadUpdatingEnum} updating
1478
- * @param {File} file Uploaded file (.po, .xls or any of the supported file formats)
1479
- * @param {string} [apiToken]
1480
- * @param {number} [id]
1481
- * @param {string} [language] The language code (Required only if `updating` is terms_translations or translations). When using `terms_translations` with `.xcstrings` file format, leave it empty to import all the languages in the file.
1482
- * @param {ProjectsUploadOverwriteEnum} [overwrite] Set it to 1 if you want to overwrite translations
1483
- * @param {ProjectsUploadSyncTermsEnum} [syncTerms] Set it to 1 if you want to sync your terms (terms that are not found in the uploaded file will be deleted from project and the new ones added). Ignored if `updating` = translations.
1484
- * @param {string} [tags] Add tags to the project terms; available when updating terms or terms_translations; you can use the following keys: \\\"all\\\" - for the all the imported terms, \\\"new\\\" - for the terms which arent already in the project, \\\"obsolete\\\" - for the terms which are in the project but not in the imported file and \\\"overwritten_translations\\\" - for the terms for which translations change
1485
- * @param {ProjectsUploadReadFromSourceEnum} [readFromSource] For .xliff format only - set it to 1 if you want to import translations from the source tag
1486
- * @param {ProjectsUploadFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
1487
- * @param {*} [options] Override http request option.
1488
- * @throws {RequiredError}
1489
- */
1490
- projectsUpload(updating, file, apiToken, id, language, overwrite, syncTerms, tags, readFromSource, fuzzyTrigger, options) {
1491
- return localVarFp
1492
- .projectsUpload(updating, file, apiToken, id, language, overwrite, syncTerms, tags, readFromSource, fuzzyTrigger, options)
1493
- .then(request => request(axios, basePath));
1494
- },
1495
- /**
1496
- * View Project Details. More details in the [documentation](https://poeditor.com/docs/api#projects_view).
1497
- * @summary Returns projects details
1498
- * @param {number} id
1499
- * @param {string} [apiToken]
1500
- * @param {*} [options] Override http request option.
1501
- * @throws {RequiredError}
1502
- */
1503
- projectsView(id, apiToken, options) {
1504
- return localVarFp.projectsView(id, apiToken, options).then(request => request(axios, basePath));
1505
- },
1506
- };
1507
- };
1508
- exports.ProjectsApiFactory = ProjectsApiFactory;
1509
- /**
1510
- * ProjectsApi - object-oriented interface
1511
- * @export
1512
- * @class ProjectsApi
1513
- * @extends {BaseAPI}
1514
- */
1515
- class ProjectsApi extends base_1.BaseAPI {
1516
- /**
1517
- * Add Project. More details in the [documentation](https://poeditor.com/docs/api#projects_add).
1518
- * @summary Creates a new project. Returns project details (if successful).
1519
- * @param {string} name
1520
- * @param {string} [apiToken]
1521
- * @param {string} [description]
1522
- * @param {*} [options] Override http request option.
1523
- * @throws {RequiredError}
1524
- * @memberof ProjectsApi
1525
- */
1526
- projectsAdd(name, apiToken, description, options) {
1527
- return (0, exports.ProjectsApiFp)(this.configuration)
1528
- .projectsAdd(name, apiToken, description, options)
1529
- .then(request => request(this.axios, this.basePath));
1530
- }
1531
- /**
1532
- * Delete Project. More details in the [documentation](https://poeditor.com/docs/api#projects_delete).
1533
- * @summary Deletes the project from the account. You must be the owner of the project.
1534
- * @param {number} id
1535
- * @param {string} [apiToken]
1536
- * @param {*} [options] Override http request option.
1537
- * @throws {RequiredError}
1538
- * @memberof ProjectsApi
1539
- */
1540
- projectsDelete(id, apiToken, options) {
1541
- return (0, exports.ProjectsApiFp)(this.configuration)
1542
- .projectsDelete(id, apiToken, options)
1543
- .then(request => request(this.axios, this.basePath));
1544
- }
1545
- /**
1546
- * Export. More details in the [documentation](https://poeditor.com/docs/api#projects_export).
1547
- * @summary Returns the link of the file (expires after 10 minutes). The settings inherited from the project will be the ones at the time of the download.
1548
- * @param {number} id
1549
- * @param {string} language
1550
- * @param {ProjectsExportTypeEnum} type
1551
- * @param {string} [apiToken]
1552
- * @param {string} [filters]
1553
- * @param {string} [order]
1554
- * @param {string} [tags]
1555
- * @param {ProjectsExportOptionsEnum} [_options]
1556
- * @param {*} [options] Override http request option.
1557
- * @throws {RequiredError}
1558
- * @memberof ProjectsApi
1559
- */
1560
- projectsExport(id, language, type, apiToken, filters, order, tags, _options, options) {
1561
- return (0, exports.ProjectsApiFp)(this.configuration)
1562
- .projectsExport(id, language, type, apiToken, filters, order, tags, _options, options)
1563
- .then(request => request(this.axios, this.basePath));
1564
- }
1565
- /**
1566
- * List Projects. More details in the [documentation](https://poeditor.com/docs/api#projects_list).
1567
- * @summary Returns the list of projects owned by user.
1568
- * @param {string} apiToken
1569
- * @param {*} [options] Override http request option.
1570
- * @throws {RequiredError}
1571
- * @memberof ProjectsApi
1572
- */
1573
- projectsList(apiToken, options) {
1574
- return (0, exports.ProjectsApiFp)(this.configuration)
1575
- .projectsList(apiToken, options)
1576
- .then(request => request(this.axios, this.basePath));
1577
- }
1578
- /**
1579
- * Sync Terms. More details in the [documentation](https://poeditor.com/docs/api#projects_sync).
1580
- * @summary Syncs your project with the array you send (terms that are not found in the JSON object will be deleted from project and the new ones added). Please use with caution. If wrong data is sent, existing terms and their translations might be irreversibly lost.
1581
- * @param {number} id
1582
- * @param {string} data JSON format
1583
- * @param {string} [apiToken]
1584
- * @param {*} [options] Override http request option.
1585
- * @throws {RequiredError}
1586
- * @memberof ProjectsApi
1587
- */
1588
- projectsSync(id, data, apiToken, options) {
1589
- return (0, exports.ProjectsApiFp)(this.configuration)
1590
- .projectsSync(id, data, apiToken, options)
1591
- .then(request => request(this.axios, this.basePath));
1592
- }
1593
- /**
1594
- * Update Project Settings. More details in the [documentation](https://poeditor.com/docs/api#projects_update).
1595
- * @summary Updates project settings (name, description, reference language, fallback language). If optional parameters are not sent, their respective fields are not updated.
1596
- * @param {number} id
1597
- * @param {string} [apiToken]
1598
- * @param {string} [name]
1599
- * @param {string} [description]
1600
- * @param {string} [referenceLanguage]
1601
- * @param {string} [fallbackLanguage]
1602
- * @param {*} [options] Override http request option.
1603
- * @throws {RequiredError}
1604
- * @memberof ProjectsApi
1605
- */
1606
- projectsUpdate(id, apiToken, name, description, referenceLanguage, fallbackLanguage, options) {
1607
- return (0, exports.ProjectsApiFp)(this.configuration)
1608
- .projectsUpdate(id, apiToken, name, description, referenceLanguage, fallbackLanguage, options)
1609
- .then(request => request(this.axios, this.basePath));
1610
- }
1611
- /**
1612
- * Upload. More details in the [documentation](https://poeditor.com/docs/api#projects_upload).
1613
- * @summary Updates terms / translations - No more than one request every 20 seconds.
1614
- * @param {ProjectsUploadUpdatingEnum} updating
1615
- * @param {File} file Uploaded file (.po, .xls or any of the supported file formats)
1616
- * @param {string} [apiToken]
1617
- * @param {number} [id]
1618
- * @param {string} [language] The language code (Required only if `updating` is terms_translations or translations). When using `terms_translations` with `.xcstrings` file format, leave it empty to import all the languages in the file.
1619
- * @param {ProjectsUploadOverwriteEnum} [overwrite] Set it to 1 if you want to overwrite translations
1620
- * @param {ProjectsUploadSyncTermsEnum} [syncTerms] Set it to 1 if you want to sync your terms (terms that are not found in the uploaded file will be deleted from project and the new ones added). Ignored if `updating` = translations.
1621
- * @param {string} [tags] Add tags to the project terms; available when updating terms or terms_translations; you can use the following keys: \\\"all\\\" - for the all the imported terms, \\\"new\\\" - for the terms which arent already in the project, \\\"obsolete\\\" - for the terms which are in the project but not in the imported file and \\\"overwritten_translations\\\" - for the terms for which translations change
1622
- * @param {ProjectsUploadReadFromSourceEnum} [readFromSource] For .xliff format only - set it to 1 if you want to import translations from the source tag
1623
- * @param {ProjectsUploadFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
1624
- * @param {*} [options] Override http request option.
1625
- * @throws {RequiredError}
1626
- * @memberof ProjectsApi
1627
- */
1628
- projectsUpload(updating, file, apiToken, id, language, overwrite, syncTerms, tags, readFromSource, fuzzyTrigger, options) {
1629
- return (0, exports.ProjectsApiFp)(this.configuration)
1630
- .projectsUpload(updating, file, apiToken, id, language, overwrite, syncTerms, tags, readFromSource, fuzzyTrigger, options)
1631
- .then(request => request(this.axios, this.basePath));
1632
- }
1633
- /**
1634
- * View Project Details. More details in the [documentation](https://poeditor.com/docs/api#projects_view).
1635
- * @summary Returns projects details
1636
- * @param {number} id
1637
- * @param {string} [apiToken]
1638
- * @param {*} [options] Override http request option.
1639
- * @throws {RequiredError}
1640
- * @memberof ProjectsApi
1641
- */
1642
- projectsView(id, apiToken, options) {
1643
- return (0, exports.ProjectsApiFp)(this.configuration)
1644
- .projectsView(id, apiToken, options)
1645
- .then(request => request(this.axios, this.basePath));
1646
- }
1647
- }
1648
- exports.ProjectsApi = ProjectsApi;
1649
- /**
1650
- * @export
1651
- */
1652
- exports.ProjectsExportTypeEnum = {
1653
- Arb: "arb",
1654
- Csv: "csv",
1655
- Ini: "ini",
1656
- KeyValueJson: "key_value_json",
1657
- I18next: "i18next",
1658
- Json: "json",
1659
- Po: "po",
1660
- Pot: "pot",
1661
- Mo: "mo",
1662
- Properties: "properties",
1663
- Resw: "resw",
1664
- Resx: "resx",
1665
- Ts: "ts",
1666
- AppleStrings: "apple_strings",
1667
- Xliff: "xliff",
1668
- Xliff12: "xliff_1_2",
1669
- Xlf: "xlf",
1670
- Xmb: "xmb",
1671
- Xtb: "xtb",
1672
- Rise360Xliff: "rise_360_xliff",
1673
- Xls: "xls",
1674
- Xlsx: "xlsx",
1675
- AndroidStrings: "android_strings",
1676
- Yml: "yml",
1677
- Php: "php",
1678
- };
1679
- /**
1680
- * @export
1681
- */
1682
- exports.ProjectsExportOptionsEnum = {
1683
- Unquoted1: '[{\"unquoted\": 1}]',
1684
- Unencoded1: '[{\"unencoded\": 1}]',
1685
- ExportAll1: '[{\"export_all\": 1}]',
1686
- };
1687
- /**
1688
- * @export
1689
- */
1690
- exports.ProjectsUploadUpdatingEnum = {
1691
- Terms: "terms",
1692
- Translations: "translations",
1693
- TermsTranslations: "terms_translations",
1694
- };
1695
- /**
1696
- * @export
1697
- */
1698
- exports.ProjectsUploadOverwriteEnum = {
1699
- NUMBER_0: 0,
1700
- NUMBER_1: 1,
1701
- };
1702
- /**
1703
- * @export
1704
- */
1705
- exports.ProjectsUploadSyncTermsEnum = {
1706
- NUMBER_0: 0,
1707
- NUMBER_1: 1,
1708
- };
1709
- /**
1710
- * @export
1711
- */
1712
- exports.ProjectsUploadReadFromSourceEnum = {
1713
- NUMBER_0: 0,
1714
- NUMBER_1: 1,
1715
- };
1716
- /**
1717
- * @export
1718
- */
1719
- exports.ProjectsUploadFuzzyTriggerEnum = {
1720
- NUMBER_0: 0,
1721
- NUMBER_1: 1,
1722
- };
1723
- /**
1724
- * TermsApi - axios parameter creator
1725
- * @export
1726
- */
1727
- const TermsApiAxiosParamCreator = function (configuration) {
1728
- return {
1729
- /**
1730
- * Add Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_add).
1731
- * @summary Adds terms to project.
1732
- * @param {number} id
1733
- * @param {string} data JSON format
1734
- * @param {string} [apiToken]
1735
- * @param {*} [options] Override http request option.
1736
- * @throws {RequiredError}
1737
- */
1738
- termsAdd: async (id, data, apiToken, options = {}) => {
1739
- // verify required parameter 'id' is not null or undefined
1740
- (0, common_1.assertParamExists)("termsAdd", "id", id);
1741
- // verify required parameter 'data' is not null or undefined
1742
- (0, common_1.assertParamExists)("termsAdd", "data", data);
1743
- const localVarPath = `/terms/add`;
1744
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1745
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1746
- let baseOptions;
1747
- if (configuration) {
1748
- baseOptions = configuration.baseOptions;
1749
- }
1750
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1751
- const localVarHeaderParameter = {};
1752
- const localVarQueryParameter = {};
1753
- const localVarFormParams = new URLSearchParams();
1754
- if (apiToken !== undefined) {
1755
- localVarFormParams.set("api_token", apiToken);
1756
- }
1757
- if (id !== undefined) {
1758
- localVarFormParams.set("id", id);
1759
- }
1760
- if (data !== undefined) {
1761
- localVarFormParams.set("data", data);
1762
- }
1763
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1764
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1765
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1766
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1767
- localVarRequestOptions.data = localVarFormParams.toString();
1768
- return {
1769
- url: (0, common_1.toPathString)(localVarUrlObj),
1770
- options: localVarRequestOptions,
1771
- };
1772
- },
1773
- /**
1774
- * Add Comment. More details in the [documentation](https://poeditor.com/docs/api#terms_add_comment).
1775
- * @summary Adds comments to existing terms.
1776
- * @param {number} id
1777
- * @param {string} data JSON format
1778
- * @param {string} [apiToken]
1779
- * @param {*} [options] Override http request option.
1780
- * @throws {RequiredError}
1781
- */
1782
- termsAddComment: async (id, data, apiToken, options = {}) => {
1783
- // verify required parameter 'id' is not null or undefined
1784
- (0, common_1.assertParamExists)("termsAddComment", "id", id);
1785
- // verify required parameter 'data' is not null or undefined
1786
- (0, common_1.assertParamExists)("termsAddComment", "data", data);
1787
- const localVarPath = `/terms/add_comment`;
1788
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1789
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1790
- let baseOptions;
1791
- if (configuration) {
1792
- baseOptions = configuration.baseOptions;
1793
- }
1794
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1795
- const localVarHeaderParameter = {};
1796
- const localVarQueryParameter = {};
1797
- const localVarFormParams = new URLSearchParams();
1798
- if (apiToken !== undefined) {
1799
- localVarFormParams.set("api_token", apiToken);
1800
- }
1801
- if (id !== undefined) {
1802
- localVarFormParams.set("id", id);
1803
- }
1804
- if (data !== undefined) {
1805
- localVarFormParams.set("data", data);
1806
- }
1807
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1808
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1809
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1810
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1811
- localVarRequestOptions.data = localVarFormParams.toString();
1812
- return {
1813
- url: (0, common_1.toPathString)(localVarUrlObj),
1814
- options: localVarRequestOptions,
1815
- };
1816
- },
1817
- /**
1818
- * Delete Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_delete).
1819
- * @summary Deletes terms from project.
1820
- * @param {number} id
1821
- * @param {string} data JSON format
1822
- * @param {string} [apiToken]
1823
- * @param {*} [options] Override http request option.
1824
- * @throws {RequiredError}
1825
- */
1826
- termsDelete: async (id, data, apiToken, options = {}) => {
1827
- // verify required parameter 'id' is not null or undefined
1828
- (0, common_1.assertParamExists)("termsDelete", "id", id);
1829
- // verify required parameter 'data' is not null or undefined
1830
- (0, common_1.assertParamExists)("termsDelete", "data", data);
1831
- const localVarPath = `/terms/delete`;
1832
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1833
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1834
- let baseOptions;
1835
- if (configuration) {
1836
- baseOptions = configuration.baseOptions;
1837
- }
1838
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1839
- const localVarHeaderParameter = {};
1840
- const localVarQueryParameter = {};
1841
- const localVarFormParams = new URLSearchParams();
1842
- if (apiToken !== undefined) {
1843
- localVarFormParams.set("api_token", apiToken);
1844
- }
1845
- if (id !== undefined) {
1846
- localVarFormParams.set("id", id);
1847
- }
1848
- if (data !== undefined) {
1849
- localVarFormParams.set("data", data);
1850
- }
1851
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1852
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1853
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1854
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1855
- localVarRequestOptions.data = localVarFormParams.toString();
1856
- return {
1857
- url: (0, common_1.toPathString)(localVarUrlObj),
1858
- options: localVarRequestOptions,
1859
- };
1860
- },
1861
- /**
1862
- * List Project Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_list).
1863
- * @summary Returns project\'s terms and translations if the argument language is provided.
1864
- * @param {number} id
1865
- * @param {string} [apiToken]
1866
- * @param {string} [language] The language code
1867
- * @param {*} [options] Override http request option.
1868
- * @throws {RequiredError}
1869
- */
1870
- termsList: async (id, apiToken, language, options = {}) => {
1871
- // verify required parameter 'id' is not null or undefined
1872
- (0, common_1.assertParamExists)("termsList", "id", id);
1873
- const localVarPath = `/terms/list`;
1874
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1875
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1876
- let baseOptions;
1877
- if (configuration) {
1878
- baseOptions = configuration.baseOptions;
1879
- }
1880
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1881
- const localVarHeaderParameter = {};
1882
- const localVarQueryParameter = {};
1883
- const localVarFormParams = new URLSearchParams();
1884
- if (apiToken !== undefined) {
1885
- localVarFormParams.set("api_token", apiToken);
1886
- }
1887
- if (id !== undefined) {
1888
- localVarFormParams.set("id", id);
1889
- }
1890
- if (language !== undefined) {
1891
- localVarFormParams.set("language", language);
1892
- }
1893
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1894
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1895
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1896
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1897
- localVarRequestOptions.data = localVarFormParams.toString();
1898
- return {
1899
- url: (0, common_1.toPathString)(localVarUrlObj),
1900
- options: localVarRequestOptions,
1901
- };
1902
- },
1903
- /**
1904
- * Update Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_update).
1905
- * @summary Updates project terms. Lets you change the text, context, reference, plural and tags.
1906
- * @param {number} id
1907
- * @param {string} data JSON format
1908
- * @param {string} [apiToken]
1909
- * @param {TermsUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
1910
- * @param {*} [options] Override http request option.
1911
- * @throws {RequiredError}
1912
- */
1913
- termsUpdate: async (id, data, apiToken, fuzzyTrigger, options = {}) => {
1914
- // verify required parameter 'id' is not null or undefined
1915
- (0, common_1.assertParamExists)("termsUpdate", "id", id);
1916
- // verify required parameter 'data' is not null or undefined
1917
- (0, common_1.assertParamExists)("termsUpdate", "data", data);
1918
- const localVarPath = `/terms/update`;
1919
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1920
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1921
- let baseOptions;
1922
- if (configuration) {
1923
- baseOptions = configuration.baseOptions;
1924
- }
1925
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
1926
- const localVarHeaderParameter = {};
1927
- const localVarQueryParameter = {};
1928
- const localVarFormParams = new URLSearchParams();
1929
- if (apiToken !== undefined) {
1930
- localVarFormParams.set("api_token", apiToken);
1931
- }
1932
- if (id !== undefined) {
1933
- localVarFormParams.set("id", id);
1934
- }
1935
- if (data !== undefined) {
1936
- localVarFormParams.set("data", data);
1937
- }
1938
- if (fuzzyTrigger !== undefined) {
1939
- localVarFormParams.set("fuzzy_trigger", fuzzyTrigger);
1940
- }
1941
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
1942
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1943
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1944
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1945
- localVarRequestOptions.data = localVarFormParams.toString();
1946
- return {
1947
- url: (0, common_1.toPathString)(localVarUrlObj),
1948
- options: localVarRequestOptions,
1949
- };
1950
- },
1951
- };
1952
- };
1953
- exports.TermsApiAxiosParamCreator = TermsApiAxiosParamCreator;
1954
- /**
1955
- * TermsApi - functional programming interface
1956
- * @export
1957
- */
1958
- const TermsApiFp = function (configuration) {
1959
- const localVarAxiosParamCreator = (0, exports.TermsApiAxiosParamCreator)(configuration);
1960
- return {
1961
- /**
1962
- * Add Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_add).
1963
- * @summary Adds terms to project.
1964
- * @param {number} id
1965
- * @param {string} data JSON format
1966
- * @param {string} [apiToken]
1967
- * @param {*} [options] Override http request option.
1968
- * @throws {RequiredError}
1969
- */
1970
- async termsAdd(id, data, apiToken, options) {
1971
- const localVarAxiosArgs = await localVarAxiosParamCreator.termsAdd(id, data, apiToken, options);
1972
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1973
- const localVarOperationServerBasePath = base_1.operationServerMap["TermsApi.termsAdd"]?.[localVarOperationServerIndex]?.url;
1974
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1975
- },
1976
- /**
1977
- * Add Comment. More details in the [documentation](https://poeditor.com/docs/api#terms_add_comment).
1978
- * @summary Adds comments to existing terms.
1979
- * @param {number} id
1980
- * @param {string} data JSON format
1981
- * @param {string} [apiToken]
1982
- * @param {*} [options] Override http request option.
1983
- * @throws {RequiredError}
1984
- */
1985
- async termsAddComment(id, data, apiToken, options) {
1986
- const localVarAxiosArgs = await localVarAxiosParamCreator.termsAddComment(id, data, apiToken, options);
1987
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1988
- const localVarOperationServerBasePath = base_1.operationServerMap["TermsApi.termsAddComment"]?.[localVarOperationServerIndex]?.url;
1989
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1990
- },
1991
- /**
1992
- * Delete Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_delete).
1993
- * @summary Deletes terms from project.
1994
- * @param {number} id
1995
- * @param {string} data JSON format
1996
- * @param {string} [apiToken]
1997
- * @param {*} [options] Override http request option.
1998
- * @throws {RequiredError}
1999
- */
2000
- async termsDelete(id, data, apiToken, options) {
2001
- const localVarAxiosArgs = await localVarAxiosParamCreator.termsDelete(id, data, apiToken, options);
2002
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2003
- const localVarOperationServerBasePath = base_1.operationServerMap["TermsApi.termsDelete"]?.[localVarOperationServerIndex]?.url;
2004
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2005
- },
2006
- /**
2007
- * List Project Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_list).
2008
- * @summary Returns project\'s terms and translations if the argument language is provided.
2009
- * @param {number} id
2010
- * @param {string} [apiToken]
2011
- * @param {string} [language] The language code
2012
- * @param {*} [options] Override http request option.
2013
- * @throws {RequiredError}
2014
- */
2015
- async termsList(id, apiToken, language, options) {
2016
- const localVarAxiosArgs = await localVarAxiosParamCreator.termsList(id, apiToken, language, options);
2017
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2018
- const localVarOperationServerBasePath = base_1.operationServerMap["TermsApi.termsList"]?.[localVarOperationServerIndex]?.url;
2019
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2020
- },
2021
- /**
2022
- * Update Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_update).
2023
- * @summary Updates project terms. Lets you change the text, context, reference, plural and tags.
2024
- * @param {number} id
2025
- * @param {string} data JSON format
2026
- * @param {string} [apiToken]
2027
- * @param {TermsUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
2028
- * @param {*} [options] Override http request option.
2029
- * @throws {RequiredError}
2030
- */
2031
- async termsUpdate(id, data, apiToken, fuzzyTrigger, options) {
2032
- const localVarAxiosArgs = await localVarAxiosParamCreator.termsUpdate(id, data, apiToken, fuzzyTrigger, options);
2033
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2034
- const localVarOperationServerBasePath = base_1.operationServerMap["TermsApi.termsUpdate"]?.[localVarOperationServerIndex]?.url;
2035
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2036
- },
2037
- };
2038
- };
2039
- exports.TermsApiFp = TermsApiFp;
2040
- /**
2041
- * TermsApi - factory interface
2042
- * @export
2043
- */
2044
- const TermsApiFactory = function (configuration, basePath, axios) {
2045
- const localVarFp = (0, exports.TermsApiFp)(configuration);
2046
- return {
2047
- /**
2048
- * Add Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_add).
2049
- * @summary Adds terms to project.
2050
- * @param {number} id
2051
- * @param {string} data JSON format
2052
- * @param {string} [apiToken]
2053
- * @param {*} [options] Override http request option.
2054
- * @throws {RequiredError}
2055
- */
2056
- termsAdd(id, data, apiToken, options) {
2057
- return localVarFp.termsAdd(id, data, apiToken, options).then(request => request(axios, basePath));
2058
- },
2059
- /**
2060
- * Add Comment. More details in the [documentation](https://poeditor.com/docs/api#terms_add_comment).
2061
- * @summary Adds comments to existing terms.
2062
- * @param {number} id
2063
- * @param {string} data JSON format
2064
- * @param {string} [apiToken]
2065
- * @param {*} [options] Override http request option.
2066
- * @throws {RequiredError}
2067
- */
2068
- termsAddComment(id, data, apiToken, options) {
2069
- return localVarFp.termsAddComment(id, data, apiToken, options).then(request => request(axios, basePath));
2070
- },
2071
- /**
2072
- * Delete Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_delete).
2073
- * @summary Deletes terms from project.
2074
- * @param {number} id
2075
- * @param {string} data JSON format
2076
- * @param {string} [apiToken]
2077
- * @param {*} [options] Override http request option.
2078
- * @throws {RequiredError}
2079
- */
2080
- termsDelete(id, data, apiToken, options) {
2081
- return localVarFp.termsDelete(id, data, apiToken, options).then(request => request(axios, basePath));
2082
- },
2083
- /**
2084
- * List Project Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_list).
2085
- * @summary Returns project\'s terms and translations if the argument language is provided.
2086
- * @param {number} id
2087
- * @param {string} [apiToken]
2088
- * @param {string} [language] The language code
2089
- * @param {*} [options] Override http request option.
2090
- * @throws {RequiredError}
2091
- */
2092
- termsList(id, apiToken, language, options) {
2093
- return localVarFp.termsList(id, apiToken, language, options).then(request => request(axios, basePath));
2094
- },
2095
- /**
2096
- * Update Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_update).
2097
- * @summary Updates project terms. Lets you change the text, context, reference, plural and tags.
2098
- * @param {number} id
2099
- * @param {string} data JSON format
2100
- * @param {string} [apiToken]
2101
- * @param {TermsUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
2102
- * @param {*} [options] Override http request option.
2103
- * @throws {RequiredError}
2104
- */
2105
- termsUpdate(id, data, apiToken, fuzzyTrigger, options) {
2106
- return localVarFp.termsUpdate(id, data, apiToken, fuzzyTrigger, options).then(request => request(axios, basePath));
2107
- },
2108
- };
2109
- };
2110
- exports.TermsApiFactory = TermsApiFactory;
2111
- /**
2112
- * TermsApi - object-oriented interface
2113
- * @export
2114
- * @class TermsApi
2115
- * @extends {BaseAPI}
2116
- */
2117
- class TermsApi extends base_1.BaseAPI {
2118
- /**
2119
- * Add Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_add).
2120
- * @summary Adds terms to project.
2121
- * @param {number} id
2122
- * @param {string} data JSON format
2123
- * @param {string} [apiToken]
2124
- * @param {*} [options] Override http request option.
2125
- * @throws {RequiredError}
2126
- * @memberof TermsApi
2127
- */
2128
- termsAdd(id, data, apiToken, options) {
2129
- return (0, exports.TermsApiFp)(this.configuration)
2130
- .termsAdd(id, data, apiToken, options)
2131
- .then(request => request(this.axios, this.basePath));
2132
- }
2133
- /**
2134
- * Add Comment. More details in the [documentation](https://poeditor.com/docs/api#terms_add_comment).
2135
- * @summary Adds comments to existing terms.
2136
- * @param {number} id
2137
- * @param {string} data JSON format
2138
- * @param {string} [apiToken]
2139
- * @param {*} [options] Override http request option.
2140
- * @throws {RequiredError}
2141
- * @memberof TermsApi
2142
- */
2143
- termsAddComment(id, data, apiToken, options) {
2144
- return (0, exports.TermsApiFp)(this.configuration)
2145
- .termsAddComment(id, data, apiToken, options)
2146
- .then(request => request(this.axios, this.basePath));
2147
- }
2148
- /**
2149
- * Delete Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_delete).
2150
- * @summary Deletes terms from project.
2151
- * @param {number} id
2152
- * @param {string} data JSON format
2153
- * @param {string} [apiToken]
2154
- * @param {*} [options] Override http request option.
2155
- * @throws {RequiredError}
2156
- * @memberof TermsApi
2157
- */
2158
- termsDelete(id, data, apiToken, options) {
2159
- return (0, exports.TermsApiFp)(this.configuration)
2160
- .termsDelete(id, data, apiToken, options)
2161
- .then(request => request(this.axios, this.basePath));
2162
- }
2163
- /**
2164
- * List Project Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_list).
2165
- * @summary Returns project\'s terms and translations if the argument language is provided.
2166
- * @param {number} id
2167
- * @param {string} [apiToken]
2168
- * @param {string} [language] The language code
2169
- * @param {*} [options] Override http request option.
2170
- * @throws {RequiredError}
2171
- * @memberof TermsApi
2172
- */
2173
- termsList(id, apiToken, language, options) {
2174
- return (0, exports.TermsApiFp)(this.configuration)
2175
- .termsList(id, apiToken, language, options)
2176
- .then(request => request(this.axios, this.basePath));
2177
- }
2178
- /**
2179
- * Update Terms. More details in the [documentation](https://poeditor.com/docs/api#terms_update).
2180
- * @summary Updates project terms. Lets you change the text, context, reference, plural and tags.
2181
- * @param {number} id
2182
- * @param {string} data JSON format
2183
- * @param {string} [apiToken]
2184
- * @param {TermsUpdateFuzzyTriggerEnum} [fuzzyTrigger] Set it to 1 to mark corresponding translations from the other languages as fuzzy for the updated values
2185
- * @param {*} [options] Override http request option.
2186
- * @throws {RequiredError}
2187
- * @memberof TermsApi
2188
- */
2189
- termsUpdate(id, data, apiToken, fuzzyTrigger, options) {
2190
- return (0, exports.TermsApiFp)(this.configuration)
2191
- .termsUpdate(id, data, apiToken, fuzzyTrigger, options)
2192
- .then(request => request(this.axios, this.basePath));
2193
- }
2194
- }
2195
- exports.TermsApi = TermsApi;
2196
- /**
2197
- * @export
2198
- */
2199
- exports.TermsUpdateFuzzyTriggerEnum = {
2200
- NUMBER_0: 0,
2201
- NUMBER_1: 1,
2202
- };
2203
- /**
2204
- * TranslationsApi - axios parameter creator
2205
- * @export
2206
- */
2207
- const TranslationsApiAxiosParamCreator = function (configuration) {
2208
- return {
2209
- /**
2210
- * Add Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_add).
2211
- * @summary Adds translations to project. If translation exists, it will not overwrite it.
2212
- * @param {number} id
2213
- * @param {string} language The language code
2214
- * @param {string} data JSON format
2215
- * @param {string} [apiToken]
2216
- * @param {*} [options] Override http request option.
2217
- * @throws {RequiredError}
2218
- */
2219
- translationsAdd: async (id, language, data, apiToken, options = {}) => {
2220
- // verify required parameter 'id' is not null or undefined
2221
- (0, common_1.assertParamExists)("translationsAdd", "id", id);
2222
- // verify required parameter 'language' is not null or undefined
2223
- (0, common_1.assertParamExists)("translationsAdd", "language", language);
2224
- // verify required parameter 'data' is not null or undefined
2225
- (0, common_1.assertParamExists)("translationsAdd", "data", data);
2226
- const localVarPath = `/translations/add`;
2227
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2228
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2229
- let baseOptions;
2230
- if (configuration) {
2231
- baseOptions = configuration.baseOptions;
2232
- }
2233
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
2234
- const localVarHeaderParameter = {};
2235
- const localVarQueryParameter = {};
2236
- const localVarFormParams = new URLSearchParams();
2237
- if (apiToken !== undefined) {
2238
- localVarFormParams.set("api_token", apiToken);
2239
- }
2240
- if (id !== undefined) {
2241
- localVarFormParams.set("id", id);
2242
- }
2243
- if (language !== undefined) {
2244
- localVarFormParams.set("language", language);
2245
- }
2246
- if (data !== undefined) {
2247
- localVarFormParams.set("data", data);
2248
- }
2249
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
2250
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2251
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2252
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2253
- localVarRequestOptions.data = localVarFormParams.toString();
2254
- return {
2255
- url: (0, common_1.toPathString)(localVarUrlObj),
2256
- options: localVarRequestOptions,
2257
- };
2258
- },
2259
- /**
2260
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_automatic).
2261
- * @summary Updates existing translations.
2262
- * @param {number} id
2263
- * @param {TranslationsAutomaticProviderEnum} provider
2264
- * @param {string} [apiToken]
2265
- * @param {string} [sourceLanguage] The language code
2266
- * @param {string} [providerSourceLanguage] The language code
2267
- * @param {string} [targetLanguages] A JSON of the languages to translate to
2268
- * @param {string} [_options] A JSON of the advanced options you want to use with the selected provider. Possible options include the POEditor tag of the strings you want to send for translation and some provider-specific options
2269
- * @param {*} [options] Override http request option.
2270
- * @throws {RequiredError}
2271
- */
2272
- translationsAutomatic: async (id, provider, apiToken, sourceLanguage, providerSourceLanguage, targetLanguages, _options, options = {}) => {
2273
- // verify required parameter 'id' is not null or undefined
2274
- (0, common_1.assertParamExists)("translationsAutomatic", "id", id);
2275
- // verify required parameter 'provider' is not null or undefined
2276
- (0, common_1.assertParamExists)("translationsAutomatic", "provider", provider);
2277
- const localVarPath = `/translations/automatic`;
2278
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2279
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2280
- let baseOptions;
2281
- if (configuration) {
2282
- baseOptions = configuration.baseOptions;
2283
- }
2284
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
2285
- const localVarHeaderParameter = {};
2286
- const localVarQueryParameter = {};
2287
- const localVarFormParams = new URLSearchParams();
2288
- if (apiToken !== undefined) {
2289
- localVarFormParams.set("api_token", apiToken);
2290
- }
2291
- if (id !== undefined) {
2292
- localVarFormParams.set("id", id);
2293
- }
2294
- if (sourceLanguage !== undefined) {
2295
- localVarFormParams.set("source_language", sourceLanguage);
2296
- }
2297
- if (providerSourceLanguage !== undefined) {
2298
- localVarFormParams.set("provider_source_language", providerSourceLanguage);
2299
- }
2300
- if (provider !== undefined) {
2301
- localVarFormParams.set("provider", provider);
2302
- }
2303
- if (targetLanguages !== undefined) {
2304
- localVarFormParams.set("target_languages", targetLanguages);
2305
- }
2306
- if (_options !== undefined) {
2307
- localVarFormParams.set("options", _options);
2308
- }
2309
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
2310
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2311
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2312
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2313
- localVarRequestOptions.data = localVarFormParams.toString();
2314
- return {
2315
- url: (0, common_1.toPathString)(localVarUrlObj),
2316
- options: localVarRequestOptions,
2317
- };
2318
- },
2319
- /**
2320
- * Delete Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_delete).
2321
- * @summary Deletes translations from specified language.
2322
- * @param {number} id
2323
- * @param {string} language The language code
2324
- * @param {string} data JSON format
2325
- * @param {string} [apiToken]
2326
- * @param {*} [options] Override http request option.
2327
- * @throws {RequiredError}
2328
- */
2329
- translationsDelete: async (id, language, data, apiToken, options = {}) => {
2330
- // verify required parameter 'id' is not null or undefined
2331
- (0, common_1.assertParamExists)("translationsDelete", "id", id);
2332
- // verify required parameter 'language' is not null or undefined
2333
- (0, common_1.assertParamExists)("translationsDelete", "language", language);
2334
- // verify required parameter 'data' is not null or undefined
2335
- (0, common_1.assertParamExists)("translationsDelete", "data", data);
2336
- const localVarPath = `/translations/delete`;
2337
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2338
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2339
- let baseOptions;
2340
- if (configuration) {
2341
- baseOptions = configuration.baseOptions;
2342
- }
2343
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
2344
- const localVarHeaderParameter = {};
2345
- const localVarQueryParameter = {};
2346
- const localVarFormParams = new URLSearchParams();
2347
- if (apiToken !== undefined) {
2348
- localVarFormParams.set("api_token", apiToken);
2349
- }
2350
- if (id !== undefined) {
2351
- localVarFormParams.set("id", id);
2352
- }
2353
- if (language !== undefined) {
2354
- localVarFormParams.set("language", language);
2355
- }
2356
- if (data !== undefined) {
2357
- localVarFormParams.set("data", data);
2358
- }
2359
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
2360
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2361
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2362
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2363
- localVarRequestOptions.data = localVarFormParams.toString();
2364
- return {
2365
- url: (0, common_1.toPathString)(localVarUrlObj),
2366
- options: localVarRequestOptions,
2367
- };
2368
- },
2369
- /**
2370
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_update).
2371
- * @summary Updates existing translations.
2372
- * @param {number} id
2373
- * @param {string} language The language code
2374
- * @param {string} data JSON format
2375
- * @param {string} [apiToken]
2376
- * @param {*} [options] Override http request option.
2377
- * @throws {RequiredError}
2378
- */
2379
- translationsUpdate: async (id, language, data, apiToken, options = {}) => {
2380
- // verify required parameter 'id' is not null or undefined
2381
- (0, common_1.assertParamExists)("translationsUpdate", "id", id);
2382
- // verify required parameter 'language' is not null or undefined
2383
- (0, common_1.assertParamExists)("translationsUpdate", "language", language);
2384
- // verify required parameter 'data' is not null or undefined
2385
- (0, common_1.assertParamExists)("translationsUpdate", "data", data);
2386
- const localVarPath = `/translations/update`;
2387
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
2388
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2389
- let baseOptions;
2390
- if (configuration) {
2391
- baseOptions = configuration.baseOptions;
2392
- }
2393
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
2394
- const localVarHeaderParameter = {};
2395
- const localVarQueryParameter = {};
2396
- const localVarFormParams = new URLSearchParams();
2397
- if (apiToken !== undefined) {
2398
- localVarFormParams.set("api_token", apiToken);
2399
- }
2400
- if (id !== undefined) {
2401
- localVarFormParams.set("id", id);
2402
- }
2403
- if (language !== undefined) {
2404
- localVarFormParams.set("language", language);
2405
- }
2406
- if (data !== undefined) {
2407
- localVarFormParams.set("data", data);
2408
- }
2409
- localVarHeaderParameter["Content-Type"] = "application/x-www-form-urlencoded";
2410
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2411
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2412
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2413
- localVarRequestOptions.data = localVarFormParams.toString();
2414
- return {
2415
- url: (0, common_1.toPathString)(localVarUrlObj),
2416
- options: localVarRequestOptions,
2417
- };
2418
- },
2419
- };
2420
- };
2421
- exports.TranslationsApiAxiosParamCreator = TranslationsApiAxiosParamCreator;
2422
- /**
2423
- * TranslationsApi - functional programming interface
2424
- * @export
2425
- */
2426
- const TranslationsApiFp = function (configuration) {
2427
- const localVarAxiosParamCreator = (0, exports.TranslationsApiAxiosParamCreator)(configuration);
2428
- return {
2429
- /**
2430
- * Add Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_add).
2431
- * @summary Adds translations to project. If translation exists, it will not overwrite it.
2432
- * @param {number} id
2433
- * @param {string} language The language code
2434
- * @param {string} data JSON format
2435
- * @param {string} [apiToken]
2436
- * @param {*} [options] Override http request option.
2437
- * @throws {RequiredError}
2438
- */
2439
- async translationsAdd(id, language, data, apiToken, options) {
2440
- const localVarAxiosArgs = await localVarAxiosParamCreator.translationsAdd(id, language, data, apiToken, options);
2441
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2442
- const localVarOperationServerBasePath = base_1.operationServerMap["TranslationsApi.translationsAdd"]?.[localVarOperationServerIndex]?.url;
2443
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2444
- },
2445
- /**
2446
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_automatic).
2447
- * @summary Updates existing translations.
2448
- * @param {number} id
2449
- * @param {TranslationsAutomaticProviderEnum} provider
2450
- * @param {string} [apiToken]
2451
- * @param {string} [sourceLanguage] The language code
2452
- * @param {string} [providerSourceLanguage] The language code
2453
- * @param {string} [targetLanguages] A JSON of the languages to translate to
2454
- * @param {string} [_options] A JSON of the advanced options you want to use with the selected provider. Possible options include the POEditor tag of the strings you want to send for translation and some provider-specific options
2455
- * @param {*} [options] Override http request option.
2456
- * @throws {RequiredError}
2457
- */
2458
- async translationsAutomatic(id, provider, apiToken, sourceLanguage, providerSourceLanguage, targetLanguages, _options, options) {
2459
- const localVarAxiosArgs = await localVarAxiosParamCreator.translationsAutomatic(id, provider, apiToken, sourceLanguage, providerSourceLanguage, targetLanguages, _options, options);
2460
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2461
- const localVarOperationServerBasePath = base_1.operationServerMap["TranslationsApi.translationsAutomatic"]?.[localVarOperationServerIndex]?.url;
2462
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2463
- },
2464
- /**
2465
- * Delete Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_delete).
2466
- * @summary Deletes translations from specified language.
2467
- * @param {number} id
2468
- * @param {string} language The language code
2469
- * @param {string} data JSON format
2470
- * @param {string} [apiToken]
2471
- * @param {*} [options] Override http request option.
2472
- * @throws {RequiredError}
2473
- */
2474
- async translationsDelete(id, language, data, apiToken, options) {
2475
- const localVarAxiosArgs = await localVarAxiosParamCreator.translationsDelete(id, language, data, apiToken, options);
2476
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2477
- const localVarOperationServerBasePath = base_1.operationServerMap["TranslationsApi.translationsDelete"]?.[localVarOperationServerIndex]?.url;
2478
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2479
- },
2480
- /**
2481
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_update).
2482
- * @summary Updates existing translations.
2483
- * @param {number} id
2484
- * @param {string} language The language code
2485
- * @param {string} data JSON format
2486
- * @param {string} [apiToken]
2487
- * @param {*} [options] Override http request option.
2488
- * @throws {RequiredError}
2489
- */
2490
- async translationsUpdate(id, language, data, apiToken, options) {
2491
- const localVarAxiosArgs = await localVarAxiosParamCreator.translationsUpdate(id, language, data, apiToken, options);
2492
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2493
- const localVarOperationServerBasePath = base_1.operationServerMap["TranslationsApi.translationsUpdate"]?.[localVarOperationServerIndex]?.url;
2494
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2495
- },
2496
- };
2497
- };
2498
- exports.TranslationsApiFp = TranslationsApiFp;
2499
- /**
2500
- * TranslationsApi - factory interface
2501
- * @export
2502
- */
2503
- const TranslationsApiFactory = function (configuration, basePath, axios) {
2504
- const localVarFp = (0, exports.TranslationsApiFp)(configuration);
2505
- return {
2506
- /**
2507
- * Add Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_add).
2508
- * @summary Adds translations to project. If translation exists, it will not overwrite it.
2509
- * @param {number} id
2510
- * @param {string} language The language code
2511
- * @param {string} data JSON format
2512
- * @param {string} [apiToken]
2513
- * @param {*} [options] Override http request option.
2514
- * @throws {RequiredError}
2515
- */
2516
- translationsAdd(id, language, data, apiToken, options) {
2517
- return localVarFp.translationsAdd(id, language, data, apiToken, options).then(request => request(axios, basePath));
2518
- },
2519
- /**
2520
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_automatic).
2521
- * @summary Updates existing translations.
2522
- * @param {number} id
2523
- * @param {TranslationsAutomaticProviderEnum} provider
2524
- * @param {string} [apiToken]
2525
- * @param {string} [sourceLanguage] The language code
2526
- * @param {string} [providerSourceLanguage] The language code
2527
- * @param {string} [targetLanguages] A JSON of the languages to translate to
2528
- * @param {string} [_options] A JSON of the advanced options you want to use with the selected provider. Possible options include the POEditor tag of the strings you want to send for translation and some provider-specific options
2529
- * @param {*} [options] Override http request option.
2530
- * @throws {RequiredError}
2531
- */
2532
- translationsAutomatic(id, provider, apiToken, sourceLanguage, providerSourceLanguage, targetLanguages, _options, options) {
2533
- return localVarFp
2534
- .translationsAutomatic(id, provider, apiToken, sourceLanguage, providerSourceLanguage, targetLanguages, _options, options)
2535
- .then(request => request(axios, basePath));
2536
- },
2537
- /**
2538
- * Delete Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_delete).
2539
- * @summary Deletes translations from specified language.
2540
- * @param {number} id
2541
- * @param {string} language The language code
2542
- * @param {string} data JSON format
2543
- * @param {string} [apiToken]
2544
- * @param {*} [options] Override http request option.
2545
- * @throws {RequiredError}
2546
- */
2547
- translationsDelete(id, language, data, apiToken, options) {
2548
- return localVarFp
2549
- .translationsDelete(id, language, data, apiToken, options)
2550
- .then(request => request(axios, basePath));
2551
- },
2552
- /**
2553
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_update).
2554
- * @summary Updates existing translations.
2555
- * @param {number} id
2556
- * @param {string} language The language code
2557
- * @param {string} data JSON format
2558
- * @param {string} [apiToken]
2559
- * @param {*} [options] Override http request option.
2560
- * @throws {RequiredError}
2561
- */
2562
- translationsUpdate(id, language, data, apiToken, options) {
2563
- return localVarFp
2564
- .translationsUpdate(id, language, data, apiToken, options)
2565
- .then(request => request(axios, basePath));
2566
- },
2567
- };
2568
- };
2569
- exports.TranslationsApiFactory = TranslationsApiFactory;
2570
- /**
2571
- * TranslationsApi - object-oriented interface
2572
- * @export
2573
- * @class TranslationsApi
2574
- * @extends {BaseAPI}
2575
- */
2576
- class TranslationsApi extends base_1.BaseAPI {
2577
- /**
2578
- * Add Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_add).
2579
- * @summary Adds translations to project. If translation exists, it will not overwrite it.
2580
- * @param {number} id
2581
- * @param {string} language The language code
2582
- * @param {string} data JSON format
2583
- * @param {string} [apiToken]
2584
- * @param {*} [options] Override http request option.
2585
- * @throws {RequiredError}
2586
- * @memberof TranslationsApi
2587
- */
2588
- translationsAdd(id, language, data, apiToken, options) {
2589
- return (0, exports.TranslationsApiFp)(this.configuration)
2590
- .translationsAdd(id, language, data, apiToken, options)
2591
- .then(request => request(this.axios, this.basePath));
2592
- }
2593
- /**
2594
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_automatic).
2595
- * @summary Updates existing translations.
2596
- * @param {number} id
2597
- * @param {TranslationsAutomaticProviderEnum} provider
2598
- * @param {string} [apiToken]
2599
- * @param {string} [sourceLanguage] The language code
2600
- * @param {string} [providerSourceLanguage] The language code
2601
- * @param {string} [targetLanguages] A JSON of the languages to translate to
2602
- * @param {string} [_options] A JSON of the advanced options you want to use with the selected provider. Possible options include the POEditor tag of the strings you want to send for translation and some provider-specific options
2603
- * @param {*} [options] Override http request option.
2604
- * @throws {RequiredError}
2605
- * @memberof TranslationsApi
2606
- */
2607
- translationsAutomatic(id, provider, apiToken, sourceLanguage, providerSourceLanguage, targetLanguages, _options, options) {
2608
- return (0, exports.TranslationsApiFp)(this.configuration)
2609
- .translationsAutomatic(id, provider, apiToken, sourceLanguage, providerSourceLanguage, targetLanguages, _options, options)
2610
- .then(request => request(this.axios, this.basePath));
2611
- }
2612
- /**
2613
- * Delete Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_delete).
2614
- * @summary Deletes translations from specified language.
2615
- * @param {number} id
2616
- * @param {string} language The language code
2617
- * @param {string} data JSON format
2618
- * @param {string} [apiToken]
2619
- * @param {*} [options] Override http request option.
2620
- * @throws {RequiredError}
2621
- * @memberof TranslationsApi
2622
- */
2623
- translationsDelete(id, language, data, apiToken, options) {
2624
- return (0, exports.TranslationsApiFp)(this.configuration)
2625
- .translationsDelete(id, language, data, apiToken, options)
2626
- .then(request => request(this.axios, this.basePath));
2627
- }
2628
- /**
2629
- * Update Translations. More details in the [documentation](https://poeditor.com/docs/api#translations_update).
2630
- * @summary Updates existing translations.
2631
- * @param {number} id
2632
- * @param {string} language The language code
2633
- * @param {string} data JSON format
2634
- * @param {string} [apiToken]
2635
- * @param {*} [options] Override http request option.
2636
- * @throws {RequiredError}
2637
- * @memberof TranslationsApi
2638
- */
2639
- translationsUpdate(id, language, data, apiToken, options) {
2640
- return (0, exports.TranslationsApiFp)(this.configuration)
2641
- .translationsUpdate(id, language, data, apiToken, options)
2642
- .then(request => request(this.axios, this.basePath));
2643
- }
2644
- }
2645
- exports.TranslationsApi = TranslationsApi;
2646
- /**
2647
- * @export
2648
- */
2649
- exports.TranslationsAutomaticProviderEnum = {
2650
- Google: "google",
2651
- Microsoft: "microsoft",
2652
- Deepl: "deepl",
2653
- };
2654
- //# sourceMappingURL=api.js.map