generaltranslation 8.2.17 → 8.2.19
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.
- package/CHANGELOG.md +12 -0
- package/dist/id/hashSource.d.ts +1 -1
- package/dist/id/hashSource.js +2 -2
- package/dist/id/types.d.ts +1 -0
- package/dist/{id-DEaFhGqX.mjs → id-BS-dC63I.mjs} +3 -2
- package/dist/id-BS-dC63I.mjs.map +1 -0
- package/dist/{id-C2orn1MA.cjs → id-BrGkL9bC.cjs} +3 -2
- package/dist/id-BrGkL9bC.cjs.map +1 -0
- package/dist/id.cjs +1 -1
- package/dist/id.d.cts +2 -1
- package/dist/id.d.mts +2 -1
- package/dist/id.mjs +1 -1
- package/dist/index.cjs +28 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -2
- package/dist/index.d.mts +21 -2
- package/dist/index.d.ts +8 -0
- package/dist/index.js +20 -0
- package/dist/index.mjs +28 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.mts +1 -1
- package/dist/translate/enqueueFiles.d.ts +0 -1
- package/dist/translate/enqueueFiles.js +0 -1
- package/dist/translate/getProjectInfo.d.ts +11 -0
- package/dist/translate/getProjectInfo.js +54 -0
- package/dist/translate/queryFileData.d.ts +0 -1
- package/dist/translate/utils/generateRequestHeaders.js +2 -7
- package/dist/{types-CdRgQtET.d.cts → types-Czjib__7.d.cts} +4 -7
- package/dist/{types-Db2Dn3oN.d.mts → types-Dr51dZ5s.d.mts} +4 -7
- package/dist/types-dir/api/checkFileTranslations.d.ts +0 -1
- package/dist/types-dir/api/enqueueEntries.d.ts +0 -2
- package/dist/types-dir/api/enqueueFiles.d.ts +1 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/id-C2orn1MA.cjs.map +0 -1
- package/dist/id-DEaFhGqX.mjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as TranslationResult, Ct as EnqueueFilesResult, Dt as FileQueryResult, Et as FileQuery, F as SubmitUserEditDiffsPayload, G as GetOrphanedFilesResult, I as AwaitJobsOptions, J as FileDataResult, L as AwaitJobsResult, Lt as TranslateManyEntry, Q as TranslationError, Rt as TranslateOptions, Tt as CheckFileTranslationsOptions, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, X as BranchDataResult, Y as BranchQuery, Z as TranslateManyResult, bt as FileReferenceIds, ct as UploadFilesResponse, gt as DownloadFileBatchResult, ht as DownloadFileBatchRequest, lt as CreateTagOptions, mt as DownloadFileBatchOptions, nt as PublishFileEntry, ot as FileUpload, q as FileDataQuery, rt as PublishFilesResult, st as UploadFilesOptions, tt as DownloadFileOptions, ut as CreateTagResult, yt as FileReference, z as CheckJobStatusResult } from "./types-
|
|
1
|
+
import { $ as TranslationResult, Ct as EnqueueFilesResult, Dt as FileQueryResult, Et as FileQuery, F as SubmitUserEditDiffsPayload, G as GetOrphanedFilesResult, I as AwaitJobsOptions, J as FileDataResult, L as AwaitJobsResult, Lt as TranslateManyEntry, Q as TranslationError, Rt as TranslateOptions, Tt as CheckFileTranslationsOptions, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, X as BranchDataResult, Y as BranchQuery, Z as TranslateManyResult, bt as FileReferenceIds, ct as UploadFilesResponse, gt as DownloadFileBatchResult, ht as DownloadFileBatchRequest, lt as CreateTagOptions, mt as DownloadFileBatchOptions, nt as PublishFileEntry, ot as FileUpload, q as FileDataQuery, rt as PublishFilesResult, st as UploadFilesOptions, tt as DownloadFileOptions, ut as CreateTagResult, yt as FileReference, z as CheckJobStatusResult } from "./types-Czjib__7.cjs";
|
|
2
2
|
import { LocaleConfig, LocaleConfig as LocaleConfig$1, LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
|
|
3
3
|
import { CustomMapping, CustomRegionMapping, CutoffFormatOptions, FormatVariables, LocaleProperties, StringFormat } from "@generaltranslation/format/types";
|
|
4
4
|
|
|
@@ -19,7 +19,6 @@ type SetupProjectOptions = {
|
|
|
19
19
|
type EnqueueOptions = {
|
|
20
20
|
sourceLocale?: string;
|
|
21
21
|
targetLocales: string[];
|
|
22
|
-
requireApproval?: boolean;
|
|
23
22
|
modelProvider?: string;
|
|
24
23
|
force?: boolean;
|
|
25
24
|
timeout?: number;
|
|
@@ -34,6 +33,19 @@ type ProjectData = {
|
|
|
34
33
|
currentLocales: string[];
|
|
35
34
|
};
|
|
36
35
|
//#endregion
|
|
36
|
+
//#region src/translate/getProjectInfo.d.ts
|
|
37
|
+
type ProjectInfoResult = {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
orgId: string;
|
|
41
|
+
defaultLocale: string;
|
|
42
|
+
currentLocales: string[];
|
|
43
|
+
autoApprove?: boolean;
|
|
44
|
+
};
|
|
45
|
+
type GetProjectInfoOptions = {
|
|
46
|
+
timeout?: number;
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
37
49
|
//#region src/translate/createBranch.d.ts
|
|
38
50
|
type CreateBranchQuery = {
|
|
39
51
|
branchName: string;
|
|
@@ -276,6 +288,13 @@ declare class GT {
|
|
|
276
288
|
* });
|
|
277
289
|
*
|
|
278
290
|
*/
|
|
291
|
+
/**
|
|
292
|
+
* Fetches project info (name, locales, review settings) for the
|
|
293
|
+
* authenticated project.
|
|
294
|
+
* @param options - The options for the API call.
|
|
295
|
+
* @returns The project info.
|
|
296
|
+
*/
|
|
297
|
+
getProjectInfo(options?: GetProjectInfoOptions): Promise<ProjectInfoResult>;
|
|
279
298
|
queryFileData(data: FileDataQuery, options?: CheckFileTranslationsOptions): Promise<FileDataResult>;
|
|
280
299
|
/**
|
|
281
300
|
* Gets source and translation information for a given file ID and version ID.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as TranslationResult, Ct as EnqueueFilesResult, Dt as FileQueryResult, Et as FileQuery, F as SubmitUserEditDiffsPayload, G as GetOrphanedFilesResult, I as AwaitJobsOptions, J as FileDataResult, L as AwaitJobsResult, Lt as TranslateManyEntry, Q as TranslationError, Rt as TranslateOptions, Tt as CheckFileTranslationsOptions, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, X as BranchDataResult, Y as BranchQuery, Z as TranslateManyResult, bt as FileReferenceIds, ct as UploadFilesResponse, gt as DownloadFileBatchResult, ht as DownloadFileBatchRequest, lt as CreateTagOptions, mt as DownloadFileBatchOptions, nt as PublishFileEntry, ot as FileUpload, q as FileDataQuery, rt as PublishFilesResult, st as UploadFilesOptions, tt as DownloadFileOptions, ut as CreateTagResult, yt as FileReference, z as CheckJobStatusResult } from "./types-
|
|
1
|
+
import { $ as TranslationResult, Ct as EnqueueFilesResult, Dt as FileQueryResult, Et as FileQuery, F as SubmitUserEditDiffsPayload, G as GetOrphanedFilesResult, I as AwaitJobsOptions, J as FileDataResult, L as AwaitJobsResult, Lt as TranslateManyEntry, Q as TranslationError, Rt as TranslateOptions, Tt as CheckFileTranslationsOptions, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, X as BranchDataResult, Y as BranchQuery, Z as TranslateManyResult, bt as FileReferenceIds, ct as UploadFilesResponse, gt as DownloadFileBatchResult, ht as DownloadFileBatchRequest, lt as CreateTagOptions, mt as DownloadFileBatchOptions, nt as PublishFileEntry, ot as FileUpload, q as FileDataQuery, rt as PublishFilesResult, st as UploadFilesOptions, tt as DownloadFileOptions, ut as CreateTagResult, yt as FileReference, z as CheckJobStatusResult } from "./types-Dr51dZ5s.mjs";
|
|
2
2
|
import { LocaleConfig, LocaleConfig as LocaleConfig$1, LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale } from "@generaltranslation/format";
|
|
3
3
|
import { CustomMapping, CustomRegionMapping, CutoffFormatOptions, FormatVariables, LocaleProperties, StringFormat } from "@generaltranslation/format/types";
|
|
4
4
|
|
|
@@ -19,7 +19,6 @@ type SetupProjectOptions = {
|
|
|
19
19
|
type EnqueueOptions = {
|
|
20
20
|
sourceLocale?: string;
|
|
21
21
|
targetLocales: string[];
|
|
22
|
-
requireApproval?: boolean;
|
|
23
22
|
modelProvider?: string;
|
|
24
23
|
force?: boolean;
|
|
25
24
|
timeout?: number;
|
|
@@ -34,6 +33,19 @@ type ProjectData = {
|
|
|
34
33
|
currentLocales: string[];
|
|
35
34
|
};
|
|
36
35
|
//#endregion
|
|
36
|
+
//#region src/translate/getProjectInfo.d.ts
|
|
37
|
+
type ProjectInfoResult = {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
orgId: string;
|
|
41
|
+
defaultLocale: string;
|
|
42
|
+
currentLocales: string[];
|
|
43
|
+
autoApprove?: boolean;
|
|
44
|
+
};
|
|
45
|
+
type GetProjectInfoOptions = {
|
|
46
|
+
timeout?: number;
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
37
49
|
//#region src/translate/createBranch.d.ts
|
|
38
50
|
type CreateBranchQuery = {
|
|
39
51
|
branchName: string;
|
|
@@ -276,6 +288,13 @@ declare class GT {
|
|
|
276
288
|
* });
|
|
277
289
|
*
|
|
278
290
|
*/
|
|
291
|
+
/**
|
|
292
|
+
* Fetches project info (name, locales, review settings) for the
|
|
293
|
+
* authenticated project.
|
|
294
|
+
* @param options - The options for the API call.
|
|
295
|
+
* @returns The project info.
|
|
296
|
+
*/
|
|
297
|
+
getProjectInfo(options?: GetProjectInfoOptions): Promise<ProjectInfoResult>;
|
|
279
298
|
queryFileData(data: FileDataQuery, options?: CheckFileTranslationsOptions): Promise<FileDataResult>;
|
|
280
299
|
/**
|
|
281
300
|
* Gets source and translation information for a given file ID and version ID.
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { DownloadFileBatchRequest } from './types-dir/api/downloadFileBatch';
|
|
|
12
12
|
import { CheckJobStatusResult } from './translate/checkJobStatus';
|
|
13
13
|
import { AwaitJobsOptions, AwaitJobsResult } from './translate/awaitJobs';
|
|
14
14
|
import type { FileDataQuery, FileDataResult } from './translate/queryFileData';
|
|
15
|
+
import type { GetProjectInfoOptions, ProjectInfoResult } from './translate/getProjectInfo';
|
|
15
16
|
import type { BranchQuery } from './translate/queryBranchData';
|
|
16
17
|
import type { BranchDataResult } from './types-dir/api/branch';
|
|
17
18
|
import type { CreateBranchQuery, CreateBranchResult } from './translate/createBranch';
|
|
@@ -242,6 +243,13 @@ export declare class GT {
|
|
|
242
243
|
* });
|
|
243
244
|
*
|
|
244
245
|
*/
|
|
246
|
+
/**
|
|
247
|
+
* Fetches project info (name, locales, review settings) for the
|
|
248
|
+
* authenticated project.
|
|
249
|
+
* @param options - The options for the API call.
|
|
250
|
+
* @returns The project info.
|
|
251
|
+
*/
|
|
252
|
+
getProjectInfo(options?: GetProjectInfoOptions): Promise<ProjectInfoResult>;
|
|
245
253
|
queryFileData(data: FileDataQuery, options?: CheckFileTranslationsOptions): Promise<FileDataResult>;
|
|
246
254
|
/**
|
|
247
255
|
* Gets source and translation information for a given file ID and version ID.
|
package/dist/index.js
CHANGED
|
@@ -65,6 +65,7 @@ import _getProjectData from './projects/getProjectData';
|
|
|
65
65
|
import { _checkJobStatus, } from './translate/checkJobStatus';
|
|
66
66
|
import _awaitJobs from './translate/awaitJobs';
|
|
67
67
|
import _queryFileData from './translate/queryFileData';
|
|
68
|
+
import _getProjectInfo from './translate/getProjectInfo';
|
|
68
69
|
import _queryBranchData from './translate/queryBranchData';
|
|
69
70
|
import _createBranch from './translate/createBranch';
|
|
70
71
|
import _processFileMoves from './translate/processFileMoves';
|
|
@@ -502,6 +503,25 @@ var GT = /** @class */ (function () {
|
|
|
502
503
|
* });
|
|
503
504
|
*
|
|
504
505
|
*/
|
|
506
|
+
/**
|
|
507
|
+
* Fetches project info (name, locales, review settings) for the
|
|
508
|
+
* authenticated project.
|
|
509
|
+
* @param options - The options for the API call.
|
|
510
|
+
* @returns The project info.
|
|
511
|
+
*/
|
|
512
|
+
GT.prototype.getProjectInfo = function () {
|
|
513
|
+
return __awaiter(this, arguments, void 0, function (options) {
|
|
514
|
+
if (options === void 0) { options = {}; }
|
|
515
|
+
return __generator(this, function (_a) {
|
|
516
|
+
switch (_a.label) {
|
|
517
|
+
case 0:
|
|
518
|
+
this._validateAuth('getProjectInfo');
|
|
519
|
+
return [4 /*yield*/, _getProjectInfo(options, this._getTranslationConfig())];
|
|
520
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
};
|
|
505
525
|
GT.prototype.queryFileData = function (data_1) {
|
|
506
526
|
return __awaiter(this, arguments, void 0, function (data, options) {
|
|
507
527
|
var result;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as createDiagnosticMessage, n as encode, r as validateFileFormatTransforms, t as decode, u as defaultTimeout } from "./base64-r7YWJYWt.mjs";
|
|
2
2
|
import { t as ApiError } from "./ApiError-0DxxIHLp.mjs";
|
|
3
|
-
import { n as hashSource } from "./id-
|
|
3
|
+
import { n as hashSource } from "./id-BS-dC63I.mjs";
|
|
4
4
|
import { LocaleConfig, LocaleConfig as LocaleConfig$1, determineLocale, determineLocale as determineLocale$1, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, getRegionProperties as getRegionProperties$1, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, isValidLocale as isValidLocale$1, requiresTranslation, requiresTranslation as requiresTranslation$1, resolveAliasLocale, resolveAliasLocale as resolveAliasLocale$1, resolveCanonicalLocale, resolveCanonicalLocale as resolveCanonicalLocale$1, standardizeLocale, standardizeLocale as standardizeLocale$1 } from "@generaltranslation/format";
|
|
5
5
|
//#region src/logging/errors.ts
|
|
6
6
|
const GT_SOURCE = "GT";
|
|
@@ -329,10 +329,9 @@ const API_VERSION$1 = "2026-03-06.v1";
|
|
|
329
329
|
function generateRequestHeaders(config, excludeContentType = false) {
|
|
330
330
|
const authHeaders = {
|
|
331
331
|
...!excludeContentType && { "Content-Type": "application/json" },
|
|
332
|
-
"
|
|
332
|
+
"gt-project-id": config.projectId
|
|
333
333
|
};
|
|
334
|
-
if (config.apiKey)
|
|
335
|
-
else authHeaders["x-gt-api-key"] = config.apiKey;
|
|
334
|
+
if (config.apiKey) authHeaders["Authorization"] = `Bearer ${config.apiKey}`;
|
|
336
335
|
authHeaders["gt-api-version"] = API_VERSION$1;
|
|
337
336
|
return authHeaders;
|
|
338
337
|
}
|
|
@@ -564,7 +563,6 @@ async function _enqueueFiles(files, options, config) {
|
|
|
564
563
|
})),
|
|
565
564
|
targetLocales: options.targetLocales,
|
|
566
565
|
sourceLocale: options.sourceLocale,
|
|
567
|
-
requireApproval: options.requireApproval,
|
|
568
566
|
modelProvider: options.modelProvider,
|
|
569
567
|
force: options.force
|
|
570
568
|
},
|
|
@@ -848,6 +846,21 @@ async function _queryFileData(data, options = {}, config) {
|
|
|
848
846
|
});
|
|
849
847
|
}
|
|
850
848
|
//#endregion
|
|
849
|
+
//#region src/translate/getProjectInfo.ts
|
|
850
|
+
/**
|
|
851
|
+
* @internal
|
|
852
|
+
* Fetches project info (name, locales, review settings) for a project.
|
|
853
|
+
* @param options - The options for the API call.
|
|
854
|
+
* @param config - The configuration for the API call.
|
|
855
|
+
* @returns The project info.
|
|
856
|
+
*/
|
|
857
|
+
async function _getProjectInfo(options, config) {
|
|
858
|
+
return apiRequest(config, `/v2/project/info/${config.projectId}`, {
|
|
859
|
+
method: "GET",
|
|
860
|
+
timeout: options.timeout
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
//#endregion
|
|
851
864
|
//#region src/translate/queryBranchData.ts
|
|
852
865
|
/**
|
|
853
866
|
* @internal
|
|
@@ -1255,6 +1268,16 @@ var GT = class {
|
|
|
1255
1268
|
* });
|
|
1256
1269
|
*
|
|
1257
1270
|
*/
|
|
1271
|
+
/**
|
|
1272
|
+
* Fetches project info (name, locales, review settings) for the
|
|
1273
|
+
* authenticated project.
|
|
1274
|
+
* @param options - The options for the API call.
|
|
1275
|
+
* @returns The project info.
|
|
1276
|
+
*/
|
|
1277
|
+
async getProjectInfo(options = {}) {
|
|
1278
|
+
this._validateAuth("getProjectInfo");
|
|
1279
|
+
return await _getProjectInfo(options, this._getTranslationConfig());
|
|
1280
|
+
}
|
|
1258
1281
|
async queryFileData(data, options = {}) {
|
|
1259
1282
|
this._validateAuth("queryFileData");
|
|
1260
1283
|
data.translatedFiles = data.translatedFiles?.map((item) => ({
|