generaltranslation 9.5.1 → 9.5.2
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 +9 -0
- package/dist/adapter/createGtApi.js +49 -51
- package/dist/{derive-sRw1yaMu.cjs → derive-BgahX4Pv.cjs} +7 -30
- package/dist/derive-BgahX4Pv.cjs.map +1 -0
- package/dist/{derive-BVRyqmWc.mjs → derive-BotyrXAq.mjs} +8 -31
- package/dist/derive-BotyrXAq.mjs.map +1 -0
- package/dist/{derive-texIAHzc.d.mts → derive-VfZjYfIU.d.mts} +1 -1
- package/dist/{diagnostics-DYtVjOm5.d.mts → diagnostics-BKjlDmJK.d.mts} +1 -1
- package/dist/diagnostics.d.mts +1 -1
- package/dist/errors.cjs +7 -2
- package/dist/errors.d.cts +2 -9
- package/dist/errors.d.mts +2 -9
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/{file-Dga6cyM8.mjs → file-BZmC4OTj.mjs} +1 -1
- package/dist/{file-B37WkCqM.cjs.map → file-BZmC4OTj.mjs.map} +1 -1
- package/dist/{file-B37WkCqM.cjs → file-DNWSAhTC.cjs} +1 -1
- package/dist/{file-Dga6cyM8.mjs.map → file-DNWSAhTC.cjs.map} +1 -1
- package/dist/id.d.mts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.mts +3 -3
- package/dist/internal.mjs +2 -2
- package/dist/openapi.json +731 -87
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/{runtimeTranslate-CVw143pQ.mjs → runtimeTranslate-CI936gg9.mjs} +3 -7
- package/dist/runtimeTranslate-CI936gg9.mjs.map +1 -0
- package/dist/{runtimeTranslate-DJioRjb6.cjs → runtimeTranslate-_gLYFBvE.cjs} +3 -7
- package/dist/runtimeTranslate-_gLYFBvE.cjs.map +1 -0
- package/dist/translate/utils/unwrapApiResult.js +2 -7
- package/dist/translate/utils/validateResponse.js +1 -1
- package/dist/{types-Si4UstLL.d.mts → types-CEsh60Yt.d.mts} +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +1 -1
- package/package.json +2 -2
- package/dist/ApiError-BCjEo_CM.cjs +0 -18
- package/dist/ApiError-BCjEo_CM.cjs.map +0 -1
- package/dist/ApiError-DxWKM0Xt.mjs +0 -13
- package/dist/ApiError-DxWKM0Xt.mjs.map +0 -1
- package/dist/derive-BVRyqmWc.mjs.map +0 -1
- package/dist/derive-sRw1yaMu.cjs.map +0 -1
- package/dist/errors/ApiError.d.ts +0 -5
- package/dist/errors/ApiError.js +0 -27
- package/dist/runtimeTranslate-CVw143pQ.mjs.map +0 -1
- package/dist/runtimeTranslate-DJioRjb6.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-
|
|
1
|
+
{"version":3,"file":"file-BZmC4OTj.mjs","names":[],"sources":["../src/types-dir/api/file.ts"],"sourcesContent":["import type { FileFormat } from '@generaltranslation/api';\nimport type { DataFormat } from '@generaltranslation/format/types';\nimport { Updates } from './enqueueFiles';\nimport type { JsonObject } from './json';\n\nexport type { FileFormat };\n\n/**\n * File formats whose content travels through the pipeline already\n * base64-encoded, so the usual UTF-8 encode/decode steps are skipped and the\n * bytes reach the API unaltered.\n *\n * LOTTIE qualifies because it is a zip bundle. Apple's `.strings` and\n * `.stringsdict` do not: they are text in whichever encoding Xcode wrote, and\n * the client decodes that to UTF-8 before upload and restores it on write, so\n * only the client ever handles their bytes.\n */\nexport const BINARY_FILE_FORMATS: ReadonlySet<FileFormat> = new Set<FileFormat>(\n ['LOTTIE']\n);\n\n/**\n * Whether a file format's content is carried as base64 end-to-end rather than\n * as a UTF-8 text string.\n */\nexport function isBinaryFileFormat(fileFormat: FileFormat): boolean {\n return BINARY_FILE_FORMATS.has(fileFormat);\n}\n\n/**\n * Metadata for files or entries.\n */\nexport type FormatMetadata = JsonObject | Updates[number]['metadata'];\n\n/**\n * File object structure for uploading files.\n * @see {@link FileReferenceOptionalBranchId}\n * @property {string} content - Content of the file.\n * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)\n * @property {FormatMetadata} [formatMetadata] - Optional metadata for the file, specific to the format of the file\n * @property {string} [incomingBranchId] - The ID of the incoming branch of the file.\n * @property {string} [checkedOutBranchId] - The ID of the checked-out branch of the file.\n */\nexport type FileToUpload = Omit<FileReference, 'branchId'> & {\n content: string;\n locale: string;\n // Optional output format requested for generated translations.\n transformFormat?: FileFormat;\n formatMetadata?: FormatMetadata;\n branchId?: string;\n incomingBranchId?: string;\n checkedOutBranchId?: string;\n};\n\n/**\n * File object structure for referencing files.\n * @property {string} fileId - The ID of the file.\n * @property {string} versionId - The ID of the version of the file\n * @property {string} branchId - The ID of the branch of the file\n * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)\n * @property {string} fileName - The name of the file.\n * @property {FileFormat} fileFormat - The format of the file (JSON, MDX, MD, etc.).\n * @property {DataFormat} [dataFormat] - Optional format of the data within the file.\n */\nexport type FileReference = {\n fileId: string;\n versionId: string;\n branchId: string;\n fileName: string;\n fileFormat: FileFormat;\n // Optional output format requested for generated translations.\n transformFormat?: FileFormat;\n dataFormat?: DataFormat;\n};\n\n/**\n * File reference object structure for referencing files.\n * @see {@link FileReference}\n * @property {string} [branchId] - The ID of the branch of the file\n */\nexport type FileReferenceIds = Omit<\n FileReference,\n 'branchId' | 'fileName' | 'fileFormat' | 'dataFormat'\n> & {\n branchId?: string;\n fileName?: string;\n fileFormat?: FileFormat;\n transformFormat?: FileFormat;\n dataFormat?: DataFormat;\n};\n"],"mappings":";;;;;;;;;;;AAiBA,MAAa,sBAA+C,IAAI,IAC9D,CAAC,SAAS,CACX;;;;;AAMD,SAAgB,mBAAmB,YAAiC;AAClE,QAAO,oBAAoB,IAAI,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-
|
|
1
|
+
{"version":3,"file":"file-DNWSAhTC.cjs","names":[],"sources":["../src/types-dir/api/file.ts"],"sourcesContent":["import type { FileFormat } from '@generaltranslation/api';\nimport type { DataFormat } from '@generaltranslation/format/types';\nimport { Updates } from './enqueueFiles';\nimport type { JsonObject } from './json';\n\nexport type { FileFormat };\n\n/**\n * File formats whose content travels through the pipeline already\n * base64-encoded, so the usual UTF-8 encode/decode steps are skipped and the\n * bytes reach the API unaltered.\n *\n * LOTTIE qualifies because it is a zip bundle. Apple's `.strings` and\n * `.stringsdict` do not: they are text in whichever encoding Xcode wrote, and\n * the client decodes that to UTF-8 before upload and restores it on write, so\n * only the client ever handles their bytes.\n */\nexport const BINARY_FILE_FORMATS: ReadonlySet<FileFormat> = new Set<FileFormat>(\n ['LOTTIE']\n);\n\n/**\n * Whether a file format's content is carried as base64 end-to-end rather than\n * as a UTF-8 text string.\n */\nexport function isBinaryFileFormat(fileFormat: FileFormat): boolean {\n return BINARY_FILE_FORMATS.has(fileFormat);\n}\n\n/**\n * Metadata for files or entries.\n */\nexport type FormatMetadata = JsonObject | Updates[number]['metadata'];\n\n/**\n * File object structure for uploading files.\n * @see {@link FileReferenceOptionalBranchId}\n * @property {string} content - Content of the file.\n * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)\n * @property {FormatMetadata} [formatMetadata] - Optional metadata for the file, specific to the format of the file\n * @property {string} [incomingBranchId] - The ID of the incoming branch of the file.\n * @property {string} [checkedOutBranchId] - The ID of the checked-out branch of the file.\n */\nexport type FileToUpload = Omit<FileReference, 'branchId'> & {\n content: string;\n locale: string;\n // Optional output format requested for generated translations.\n transformFormat?: FileFormat;\n formatMetadata?: FormatMetadata;\n branchId?: string;\n incomingBranchId?: string;\n checkedOutBranchId?: string;\n};\n\n/**\n * File object structure for referencing files.\n * @property {string} fileId - The ID of the file.\n * @property {string} versionId - The ID of the version of the file\n * @property {string} branchId - The ID of the branch of the file\n * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)\n * @property {string} fileName - The name of the file.\n * @property {FileFormat} fileFormat - The format of the file (JSON, MDX, MD, etc.).\n * @property {DataFormat} [dataFormat] - Optional format of the data within the file.\n */\nexport type FileReference = {\n fileId: string;\n versionId: string;\n branchId: string;\n fileName: string;\n fileFormat: FileFormat;\n // Optional output format requested for generated translations.\n transformFormat?: FileFormat;\n dataFormat?: DataFormat;\n};\n\n/**\n * File reference object structure for referencing files.\n * @see {@link FileReference}\n * @property {string} [branchId] - The ID of the branch of the file\n */\nexport type FileReferenceIds = Omit<\n FileReference,\n 'branchId' | 'fileName' | 'fileFormat' | 'dataFormat'\n> & {\n branchId?: string;\n fileName?: string;\n fileFormat?: FileFormat;\n transformFormat?: FileFormat;\n dataFormat?: DataFormat;\n};\n"],"mappings":";;;;;;;;;;;AAiBA,MAAa,sBAA+C,IAAI,IAC9D,CAAC,SAAS,CACX;;;;;AAMD,SAAgB,mBAAmB,YAAiC;AAClE,QAAO,oBAAoB,IAAI,WAAW"}
|
package/dist/id.d.mts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_runtimeTranslate = require("./runtimeTranslate-
|
|
3
|
-
const require_derive = require("./derive-
|
|
2
|
+
const require_runtimeTranslate = require("./runtimeTranslate-_gLYFBvE.cjs");
|
|
3
|
+
const require_derive = require("./derive-BgahX4Pv.cjs");
|
|
4
4
|
const require_runtime = require("./runtime.cjs");
|
|
5
5
|
let _generaltranslation_format = require("@generaltranslation/format");
|
|
6
6
|
//#region src/index.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as DownloadFileOptions, Ct as FileQueryResult, F as SubmitUserEditDiffsPayload, G as FileDataQuery, I as AwaitJobsOptions$1, J as BranchDataResult, K as FileDataResult, L as AwaitJobsResult, St as FileQuery, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, at as SetupProjectFileReference, ct as EnqueueFilesOptions, dt as DownloadFileBatchResult, et as PublishFileEntry, gt as FileReferenceIds, it as UploadFilesResponse, lt as DownloadFileBatchOptions, n as CreateTagOptions, nt as FileUpload, ot as SetupProjectOptions, q as BranchQuery, r as CreateTagResult, rt as UploadFilesOptions, st as SetupProjectResult, tt as PublishFilesResult, u as GetOrphanedFilesResult, ut as DownloadFileBatchRequest, xt as CheckFileTranslationsOptions, yt as EnqueueFilesResult, z as CheckJobStatusResult } from "./types-
|
|
1
|
+
import { $ as DownloadFileOptions, Ct as FileQueryResult, F as SubmitUserEditDiffsPayload, G as FileDataQuery, I as AwaitJobsOptions$1, J as BranchDataResult, K as FileDataResult, L as AwaitJobsResult, St as FileQuery, U as ProcessMovesOptions, V as MoveMapping, W as ProcessMovesResponse, at as SetupProjectFileReference, ct as EnqueueFilesOptions, dt as DownloadFileBatchResult, et as PublishFileEntry, gt as FileReferenceIds, it as UploadFilesResponse, lt as DownloadFileBatchOptions, n as CreateTagOptions, nt as FileUpload, ot as SetupProjectOptions, q as BranchQuery, r as CreateTagResult, rt as UploadFilesOptions, st as SetupProjectResult, tt as PublishFilesResult, u as GetOrphanedFilesResult, ut as DownloadFileBatchRequest, xt as CheckFileTranslationsOptions, yt as EnqueueFilesResult, z as CheckJobStatusResult } from "./types-CEsh60Yt.mjs";
|
|
2
2
|
import { GTConstructorParams, GTRuntime } from "./runtime.mjs";
|
|
3
|
-
import { n as declareVar, r as decodeVars, t as derive } from "./derive-
|
|
3
|
+
import { n as declareVar, r as decodeVars, t as derive } from "./derive-VfZjYfIU.mjs";
|
|
4
4
|
import { CreateBranchResponse, GetProjectInfoResponse, UploadAssetsResponse } from "@generaltranslation/api";
|
|
5
5
|
import { LocaleConfig, 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";
|
|
6
6
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as gtInstanceLogger, d as noSourceLocaleProvidedError, f as noTargetLocaleProvidedError, r as validateAuth } from "./runtimeTranslate-
|
|
2
|
-
import { c as createGtApiAdapter, n as declareVar, r as decodeVars, t as derive } from "./derive-
|
|
1
|
+
import { c as gtInstanceLogger, d as noSourceLocaleProvidedError, f as noTargetLocaleProvidedError, r as validateAuth } from "./runtimeTranslate-CI936gg9.mjs";
|
|
2
|
+
import { c as createGtApiAdapter, n as declareVar, r as decodeVars, t as derive } from "./derive-BotyrXAq.mjs";
|
|
3
3
|
import { GTRuntime } from "./runtime.mjs";
|
|
4
4
|
import { LocaleConfig, 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";
|
|
5
5
|
//#region src/index.ts
|
package/dist/internal.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_runtimeTranslate = require("./runtimeTranslate-
|
|
2
|
+
const require_runtimeTranslate = require("./runtimeTranslate-_gLYFBvE.cjs");
|
|
3
3
|
const require_diagnostics = require("./diagnostics-DKtiPUvo.cjs");
|
|
4
4
|
const require_id = require("./id-DJ_59q21.cjs");
|
|
5
|
-
const require_derive = require("./derive-
|
|
5
|
+
const require_derive = require("./derive-BgahX4Pv.cjs");
|
|
6
6
|
let _generaltranslation_api = require("@generaltranslation/api");
|
|
7
7
|
let _generaltranslation_icu = require("@generaltranslation/icu");
|
|
8
8
|
let _generaltranslation_format_internal = require("@generaltranslation/format/internal");
|
package/dist/internal.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as formatDiagnosticErrorDetails, n as DiagnosticSeverity, r as createDiagnosticMessage, t as DiagnosticMessageInput } from "./diagnostics-
|
|
2
|
-
import { Ft as TranslateManyEntry, It as TranslateOptions, N as VariableTransformationSuffix, O as Variable, Pt as RuntimeTranslateManyOptions, Y as TranslateManyResult, Z as TranslationResult, _ as JsxChildren, ft as DownloadedFile, g as JsxChild, k as VariableType, mt as FileFormat, v as JsxElement, y as LocaleProperties } from "./types-
|
|
3
|
-
import { n as declareVar, r as decodeVars, t as derive } from "./derive-
|
|
1
|
+
import { i as formatDiagnosticErrorDetails, n as DiagnosticSeverity, r as createDiagnosticMessage, t as DiagnosticMessageInput } from "./diagnostics-BKjlDmJK.mjs";
|
|
2
|
+
import { Ft as TranslateManyEntry, It as TranslateOptions, N as VariableTransformationSuffix, O as Variable, Pt as RuntimeTranslateManyOptions, Y as TranslateManyResult, Z as TranslationResult, _ as JsxChildren, ft as DownloadedFile, g as JsxChild, k as VariableType, mt as FileFormat, v as JsxElement, y as LocaleProperties } from "./types-CEsh60Yt.mjs";
|
|
3
|
+
import { n as declareVar, r as decodeVars, t as derive } from "./derive-VfZjYfIU.mjs";
|
|
4
4
|
import * as _$_generaltranslation_api0 from "@generaltranslation/api";
|
|
5
5
|
import { API_VERSION, ApiClientConfig, AwaitJobsOptions, CreateBranchData, CreateProjectApiKeyData, CreateProjectData, CreateTagData, DownloadFilesData, EnqueueFileTranslationsData, GenerateProjectContextData, GetBranchInfoData, GetFileInfoData, GetTranslationJobInfoResponse, GetTranslationStatusData, ModelProvider, ProcessFileMovesData, PublishFilesData, SubmitUserEditDiffsData, UploadAssetsData, UploadSourceFilesData, UploadTranslationsData, createApiClient } from "@generaltranslation/api";
|
|
6
6
|
import { CustomMapping, IcuMessage } from "@generaltranslation/format/types";
|
package/dist/internal.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as unwrapApiResult, g as libraryDefaultLocale, h as defaultRuntimeApiUrl, i as isErrorResult, m as defaultCacheUrl, o as isModelProvider, p as defaultBaseUrl, s as supportedModelProviders } from "./runtimeTranslate-
|
|
1
|
+
import { a as unwrapApiResult, g as libraryDefaultLocale, h as defaultRuntimeApiUrl, i as isErrorResult, m as defaultCacheUrl, o as isModelProvider, p as defaultBaseUrl, s as supportedModelProviders } from "./runtimeTranslate-CI936gg9.mjs";
|
|
2
2
|
import { n as formatDiagnosticErrorDetails, t as createDiagnosticMessage } from "./diagnostics-DKA2SkZB.mjs";
|
|
3
3
|
import { r as isVariable } from "./id-B2wA7-S-.mjs";
|
|
4
|
-
import { a as isGTUnindexedSelectElement, c as createGtApiAdapter, d as decodeFileContent, f as encode, i as isGTIndexedSelectElement, l as isSupportedFileFormatTransform, n as declareVar, o as VAR_IDENTIFIER, p as encodeFileContent, r as decodeVars, s as traverseIcu, t as derive, u as decode } from "./derive-
|
|
4
|
+
import { a as isGTUnindexedSelectElement, c as createGtApiAdapter, d as decodeFileContent, f as encode, i as isGTIndexedSelectElement, l as isSupportedFileFormatTransform, n as declareVar, o as VAR_IDENTIFIER, p as encodeFileContent, r as decodeVars, s as traverseIcu, t as derive, u as decode } from "./derive-BotyrXAq.mjs";
|
|
5
5
|
import { API_VERSION } from "@generaltranslation/api";
|
|
6
6
|
import { TYPE, printAST } from "@generaltranslation/icu";
|
|
7
7
|
import { getCachedPluralRules } from "@generaltranslation/format/internal";
|