generaltranslation 8.2.6 → 8.2.7
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 +8 -0
- package/dist/ApiError-4zIP-twr.cjs +24 -0
- package/dist/ApiError-4zIP-twr.cjs.map +1 -0
- package/dist/ApiError-Bv7vlzyQ.mjs +19 -0
- package/dist/ApiError-Bv7vlzyQ.mjs.map +1 -0
- package/dist/errors.cjs +3 -0
- package/dist/errors.d.cts +11 -0
- package/dist/errors.d.mts +11 -0
- package/dist/errors.mjs +2 -0
- package/dist/id-CPbVYREY.mjs +74 -0
- package/dist/id-CPbVYREY.mjs.map +1 -0
- package/dist/id-VXBgyXu2.cjs +89 -0
- package/dist/id-VXBgyXu2.cjs.map +1 -0
- package/dist/id.cjs +5 -0
- package/dist/{id/hashSource.d.ts → id.d.cts} +20 -5
- package/dist/id.d.mts +40 -0
- package/dist/id.mjs +2 -0
- package/dist/index.cjs +3354 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1157 -0
- package/dist/index.d.mts +1157 -0
- package/dist/index.mjs +3305 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal-CTeI8uLd.mjs +774 -0
- package/dist/internal-CTeI8uLd.mjs.map +1 -0
- package/dist/internal-PCKq4YMW.cjs +1012 -0
- package/dist/internal-PCKq4YMW.cjs.map +1 -0
- package/dist/internal.cjs +43 -0
- package/dist/{internal.d.ts → internal.d.cts} +62 -114
- package/dist/internal.d.mts +242 -0
- package/dist/internal.mjs +3 -0
- package/dist/sha2-DKowBr6H.cjs +747 -0
- package/dist/sha2-DKowBr6H.cjs.map +1 -0
- package/dist/stableStringify-DgDlE_pD.mjs +53 -0
- package/dist/stableStringify-DgDlE_pD.mjs.map +1 -0
- package/dist/types-D2fTTTvZ.d.cts +737 -0
- package/dist/types-fUW4_Ole.d.mts +737 -0
- package/dist/types.cjs +17 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +16 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +52 -32
- package/dist/backwards-compatability/dataConversion.d.ts +0 -23
- package/dist/backwards-compatability/oldHashJsxChildren.d.ts +0 -23
- package/dist/backwards-compatability/oldTypes.d.ts +0 -21
- package/dist/backwards-compatability/typeChecking.d.ts +0 -21
- package/dist/cache/IntlCache.d.ts +0 -26
- package/dist/cache/types.d.ts +0 -32
- package/dist/derive/condenseVars.d.ts +0 -7
- package/dist/derive/declareVar.d.ts +0 -26
- package/dist/derive/decodeVars.d.ts +0 -9
- package/dist/derive/derive.d.ts +0 -38
- package/dist/derive/extractVars.d.ts +0 -9
- package/dist/derive/index.d.ts +0 -7
- package/dist/derive/indexVars.d.ts +0 -6
- package/dist/derive/utils/constants.d.ts +0 -2
- package/dist/derive/utils/regex.d.ts +0 -2
- package/dist/derive/utils/sanitizeVar.d.ts +0 -12
- package/dist/derive/utils/traverseHelpers.d.ts +0 -4
- package/dist/derive/utils/traverseIcu.d.ts +0 -20
- package/dist/derive/utils/types.d.ts +0 -23
- package/dist/errors/ApiError.d.ts +0 -7
- package/dist/errors/formattingErrors.d.ts +0 -1
- package/dist/errors.cjs.min.cjs +0 -2
- package/dist/errors.cjs.min.cjs.map +0 -1
- package/dist/errors.d.ts +0 -9
- package/dist/errors.esm.min.mjs +0 -2
- package/dist/errors.esm.min.mjs.map +0 -1
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +0 -59
- package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +0 -4
- package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +0 -48
- package/dist/formatting/format.d.ts +0 -1
- package/dist/id/hashTemplate.d.ts +0 -4
- package/dist/id/types.d.ts +0 -7
- package/dist/id.cjs.min.cjs +0 -2
- package/dist/id.cjs.min.cjs.map +0 -1
- package/dist/id.d.ts +0 -86
- package/dist/id.esm.min.mjs +0 -2
- package/dist/id.esm.min.mjs.map +0 -1
- package/dist/index.cjs.min.cjs +0 -2
- package/dist/index.cjs.min.cjs.map +0 -1
- package/dist/index.d.ts +0 -1627
- package/dist/index.esm.min.mjs +0 -2
- package/dist/index.esm.min.mjs.map +0 -1
- package/dist/internal.cjs.min.cjs +0 -2
- package/dist/internal.cjs.min.cjs.map +0 -1
- package/dist/internal.esm.min.mjs +0 -2
- package/dist/internal.esm.min.mjs.map +0 -1
- package/dist/locales/customLocaleMapping.d.ts +0 -11
- package/dist/locales/determineLocale.d.ts +0 -1
- package/dist/locales/getLocaleDirection.d.ts +0 -1
- package/dist/locales/getLocaleEmoji.d.ts +0 -2
- package/dist/locales/getLocaleName.d.ts +0 -1
- package/dist/locales/getLocaleProperties.d.ts +0 -32
- package/dist/locales/getPluralForm.d.ts +0 -9
- package/dist/locales/getRegionProperties.d.ts +0 -7
- package/dist/locales/isSameDialect.d.ts +0 -1
- package/dist/locales/isSameLanguage.d.ts +0 -1
- package/dist/locales/isSupersetLocale.d.ts +0 -1
- package/dist/locales/isValidLocale.d.ts +0 -1
- package/dist/locales/requiresTranslation.d.ts +0 -1
- package/dist/locales/resolveAliasLocale.d.ts +0 -8
- package/dist/locales/resolveCanonicalLocale.d.ts +0 -8
- package/dist/logging/errors.d.ts +0 -10
- package/dist/logging/logger.d.ts +0 -117
- package/dist/logging/warnings.d.ts +0 -2
- package/dist/projects/getProjectData.d.ts +0 -1
- package/dist/settings/plurals.d.ts +0 -3
- package/dist/settings/settings.d.ts +0 -2
- package/dist/settings/settingsUrls.d.ts +0 -3
- package/dist/translate/api.d.ts +0 -1
- package/dist/translate/awaitJobs.d.ts +0 -19
- package/dist/translate/checkJobStatus.d.ts +0 -8
- package/dist/translate/createBranch.d.ts +0 -10
- package/dist/translate/createTag.d.ts +0 -19
- package/dist/translate/downloadFileBatch.d.ts +0 -1
- package/dist/translate/enqueueFiles.d.ts +0 -8
- package/dist/translate/getOrphanedFiles.d.ts +0 -8
- package/dist/translate/processFileMoves.d.ts +0 -25
- package/dist/translate/publishFiles.d.ts +0 -17
- package/dist/translate/queryBranchData.d.ts +0 -3
- package/dist/translate/queryFileData.d.ts +0 -42
- package/dist/translate/querySourceFile.d.ts +0 -1
- package/dist/translate/setupProject.d.ts +0 -11
- package/dist/translate/submitUserEditDiffs.d.ts +0 -12
- package/dist/translate/translateMany.d.ts +0 -1
- package/dist/translate/uploadSourceFiles.d.ts +0 -1
- package/dist/translate/uploadTranslations.d.ts +0 -1
- package/dist/translate/utils/apiRequest.d.ts +0 -1
- package/dist/translate/utils/batch.d.ts +0 -52
- package/dist/translate/utils/fetchWithTimeout.d.ts +0 -1
- package/dist/translate/utils/generateRequestHeaders.d.ts +0 -2
- package/dist/translate/utils/handleFetchError.d.ts +0 -1
- package/dist/translate/utils/validateResponse.d.ts +0 -1
- package/dist/types-dir/api/branch.d.ts +0 -10
- package/dist/types-dir/api/checkFileTranslations.d.ts +0 -37
- package/dist/types-dir/api/downloadFile.d.ts +0 -3
- package/dist/types-dir/api/downloadFileBatch.d.ts +0 -34
- package/dist/types-dir/api/enqueueEntries.d.ts +0 -21
- package/dist/types-dir/api/enqueueFiles.d.ts +0 -56
- package/dist/types-dir/api/entry.d.ts +0 -36
- package/dist/types-dir/api/fetchTranslations.d.ts +0 -11
- package/dist/types-dir/api/file.d.ts +0 -54
- package/dist/types-dir/api/project.d.ts +0 -7
- package/dist/types-dir/api/translate.d.ts +0 -34
- package/dist/types-dir/api/translateMany.d.ts +0 -5
- package/dist/types-dir/api/translationStatus.d.ts +0 -9
- package/dist/types-dir/api/uploadFiles.d.ts +0 -43
- package/dist/types-dir/jsx/content.d.ts +0 -61
- package/dist/types-dir/jsx/variables.d.ts +0 -9
- package/dist/types-dir/transformations.d.ts +0 -8
- package/dist/types.cjs.min.cjs +0 -2
- package/dist/types.cjs.min.cjs.map +0 -1
- package/dist/types.d.ts +0 -652
- package/dist/types.esm.min.mjs +0 -2
- package/dist/types.esm.min.mjs.map +0 -1
- package/dist/utils/base64.d.ts +0 -2
- package/dist/utils/isVariable.d.ts +0 -2
- package/dist/utils/minify.d.ts +0 -2
- package/dist/utils/stableStringify.d.ts +0 -1
package/dist/types.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/types-dir/jsx/content.ts
|
|
3
|
+
/**
|
|
4
|
+
* Map of data-_gt properties to their corresponding React props
|
|
5
|
+
*/
|
|
6
|
+
const HTML_CONTENT_PROPS = {
|
|
7
|
+
pl: "placeholder",
|
|
8
|
+
ti: "title",
|
|
9
|
+
alt: "alt",
|
|
10
|
+
arl: "aria-label",
|
|
11
|
+
arb: "aria-labelledby",
|
|
12
|
+
ard: "aria-describedby"
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.HTML_CONTENT_PROPS = HTML_CONTENT_PROPS;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","names":[],"sources":["../src/types-dir/jsx/content.ts"],"sourcesContent":["import { Variable } from './variables';\n\n/**\n * Map of data-_gt properties to their corresponding React props\n */\nexport const HTML_CONTENT_PROPS = {\n pl: 'placeholder',\n ti: 'title',\n alt: 'alt',\n arl: 'aria-label',\n arb: 'aria-labelledby',\n ard: 'aria-describedby',\n} as const;\n\nexport type HtmlContentPropKeysRecord = Partial<\n Record<keyof typeof HTML_CONTENT_PROPS, string>\n>;\nexport type HtmlContentPropValuesRecord = Partial<\n Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>\n>;\n\n/**\n * GTProp is an internal property used to contain data for translating and rendering elements.\n * note, transformations are only read on the server side if they are 'plural' or 'branch'\n */\nexport type GTProp = {\n b?: Record<string, JsxChildren>; // Branches\n t?: 'p' | 'b'; // Branch Transformation\n} & HtmlContentPropKeysRecord;\n\nexport type JsxElement = {\n t?: string; // tag name\n i?: number; // id\n d?: GTProp; // GT data\n c?: JsxChildren; // children\n};\n\nexport type JsxChild = string | JsxElement | Variable;\n\n/**\n * The format of the string content\n */\nexport type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';\n\n/**\n * The format of the content\n */\nexport type DataFormat = 'JSX' | StringFormat;\n\n/**\n * String format content\n */\nexport type StringContent = IcuMessage | StringMessage | I18nextMessage;\n\n/**\n * A content type representing JSX, ICU, and I18next messages\n */\nexport type Content = JsxChildren | StringContent;\n\n/**\n * A content type representing JSX elements\n */\nexport type JsxChildren = JsxChild | JsxChild[];\n\n/**\n * A content type representing ICU messages\n */\nexport type IcuMessage = string;\n\n/**\n * A content type representing I18next messages\n */\nexport type I18nextMessage = string;\n\n/**\n * A content type representing plain strings\n */\nexport type StringMessage = string;\n"],"mappings":";;;;;AAKA,MAAa,qBAAqB;CAChC,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACN"}
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { $ as FileReference, A as BranchDataResult, At as VariableType, B as FileUpload, C as ProcessMovesOptions, Ct as JsxChild, D as FileDataQuery, Dt as StringFormat, E as OrphanedFile, Et as StringContent, F as DownloadFileOptions, G as FetchTranslationsOptions, I as PublishFileEntry, J as DownloadFileBatchOptions, K as FetchTranslationsResult, L as PublishFilesResult, M as TranslationError, Mt as CustomMapping, N as TranslationResult, O as FileDataResult, Ot as StringMessage, P as TranslationResultReference, Q as FileFormat, R as EnqueueEntriesOptions, S as MoveResult, St as IcuMessage, T as GetOrphanedFilesResult, Tt as JsxElement, U as CreateTagOptions, W as CreateTagResult, X as DownloadFileBatchResult, Z as DownloadedFile, _ as AwaitJobsResult, _t as GTProp, a as Metadata, at as CheckFileTranslationsOptions, b as JobStatus, bt as HtmlContentPropValuesRecord, c as Update, ct as FileTranslationQuery, d as Transformation, dt as ActionType, f as TransformationPrefix, ft as EntryMetadata, g as AwaitJobsOptions, gt as DataFormat, h as SubmitUserEditDiffsPayload, ht as Content, i as JsxTranslationResult, it as Updates, j as TranslateManyResult, jt as LocaleProperties, k as BranchQuery, kt as Variable, l as _Content, lt as TranslationStatusResult, m as SubmitUserEditDiff, n as FormatVariables, nt as EnqueueFilesOptions, o as Request, p as VariableTransformationSuffix, pt as TranslateManyEntry, q as RetrievedTranslations, r as IcuTranslationResult, rt as EnqueueFilesResult, s as TranslationRequestConfig, t as ContentTranslationResult, tt as FileToUpload, u as InjectionType, ut as HashMetadata, v as JobResult, vt as HTML_CONTENT_PROPS, w as ProcessMovesResponse, wt as JsxChildren, x as MoveMapping, xt as I18nextMessage, y as CheckJobStatusResult, yt as HtmlContentPropKeysRecord, z as EnqueueEntriesResult } from "./types-D2fTTTvZ.cjs";
|
|
2
|
+
export { AwaitJobsOptions, AwaitJobsResult, BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, ContentTranslationResult, CreateTagOptions, CreateTagResult, CustomMapping, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FetchTranslationsOptions, FetchTranslationsResult, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileTranslationQuery, FileUpload, FormatVariables, GTProp, GetOrphanedFilesResult, HTML_CONTENT_PROPS, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, IcuTranslationResult, InjectionType, JobResult, JobStatus, JsxChild, JsxChildren, JsxElement, JsxTranslationResult, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, Request, RetrievedTranslations, StringContent, StringFormat, StringMessage, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, TranslationStatusResult, Update, Updates, Variable, VariableTransformationSuffix, VariableType, _Content };
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { $ as FileReference, A as BranchDataResult, At as VariableType, B as FileUpload, C as ProcessMovesOptions, Ct as JsxChild, D as FileDataQuery, Dt as StringFormat, E as OrphanedFile, Et as StringContent, F as DownloadFileOptions, G as FetchTranslationsOptions, I as PublishFileEntry, J as DownloadFileBatchOptions, K as FetchTranslationsResult, L as PublishFilesResult, M as TranslationError, Mt as CustomMapping, N as TranslationResult, O as FileDataResult, Ot as StringMessage, P as TranslationResultReference, Q as FileFormat, R as EnqueueEntriesOptions, S as MoveResult, St as IcuMessage, T as GetOrphanedFilesResult, Tt as JsxElement, U as CreateTagOptions, W as CreateTagResult, X as DownloadFileBatchResult, Z as DownloadedFile, _ as AwaitJobsResult, _t as GTProp, a as Metadata, at as CheckFileTranslationsOptions, b as JobStatus, bt as HtmlContentPropValuesRecord, c as Update, ct as FileTranslationQuery, d as Transformation, dt as ActionType, f as TransformationPrefix, ft as EntryMetadata, g as AwaitJobsOptions, gt as DataFormat, h as SubmitUserEditDiffsPayload, ht as Content, i as JsxTranslationResult, it as Updates, j as TranslateManyResult, jt as LocaleProperties, k as BranchQuery, kt as Variable, l as _Content, lt as TranslationStatusResult, m as SubmitUserEditDiff, n as FormatVariables, nt as EnqueueFilesOptions, o as Request, p as VariableTransformationSuffix, pt as TranslateManyEntry, q as RetrievedTranslations, r as IcuTranslationResult, rt as EnqueueFilesResult, s as TranslationRequestConfig, t as ContentTranslationResult, tt as FileToUpload, u as InjectionType, ut as HashMetadata, v as JobResult, vt as HTML_CONTENT_PROPS, w as ProcessMovesResponse, wt as JsxChildren, x as MoveMapping, xt as I18nextMessage, y as CheckJobStatusResult, yt as HtmlContentPropKeysRecord, z as EnqueueEntriesResult } from "./types-fUW4_Ole.mjs";
|
|
2
|
+
export { AwaitJobsOptions, AwaitJobsResult, BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, ContentTranslationResult, CreateTagOptions, CreateTagResult, CustomMapping, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FetchTranslationsOptions, FetchTranslationsResult, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileTranslationQuery, FileUpload, FormatVariables, GTProp, GetOrphanedFilesResult, HTML_CONTENT_PROPS, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, IcuTranslationResult, InjectionType, JobResult, JobStatus, JsxChild, JsxChildren, JsxElement, JsxTranslationResult, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, Request, RetrievedTranslations, StringContent, StringFormat, StringMessage, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, TranslationStatusResult, Update, Updates, Variable, VariableTransformationSuffix, VariableType, _Content };
|
package/dist/types.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/types-dir/jsx/content.ts
|
|
2
|
+
/**
|
|
3
|
+
* Map of data-_gt properties to their corresponding React props
|
|
4
|
+
*/
|
|
5
|
+
const HTML_CONTENT_PROPS = {
|
|
6
|
+
pl: "placeholder",
|
|
7
|
+
ti: "title",
|
|
8
|
+
alt: "alt",
|
|
9
|
+
arl: "aria-label",
|
|
10
|
+
arb: "aria-labelledby",
|
|
11
|
+
ard: "aria-describedby"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { HTML_CONTENT_PROPS };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../src/types-dir/jsx/content.ts"],"sourcesContent":["import { Variable } from './variables';\n\n/**\n * Map of data-_gt properties to their corresponding React props\n */\nexport const HTML_CONTENT_PROPS = {\n pl: 'placeholder',\n ti: 'title',\n alt: 'alt',\n arl: 'aria-label',\n arb: 'aria-labelledby',\n ard: 'aria-describedby',\n} as const;\n\nexport type HtmlContentPropKeysRecord = Partial<\n Record<keyof typeof HTML_CONTENT_PROPS, string>\n>;\nexport type HtmlContentPropValuesRecord = Partial<\n Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>\n>;\n\n/**\n * GTProp is an internal property used to contain data for translating and rendering elements.\n * note, transformations are only read on the server side if they are 'plural' or 'branch'\n */\nexport type GTProp = {\n b?: Record<string, JsxChildren>; // Branches\n t?: 'p' | 'b'; // Branch Transformation\n} & HtmlContentPropKeysRecord;\n\nexport type JsxElement = {\n t?: string; // tag name\n i?: number; // id\n d?: GTProp; // GT data\n c?: JsxChildren; // children\n};\n\nexport type JsxChild = string | JsxElement | Variable;\n\n/**\n * The format of the string content\n */\nexport type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';\n\n/**\n * The format of the content\n */\nexport type DataFormat = 'JSX' | StringFormat;\n\n/**\n * String format content\n */\nexport type StringContent = IcuMessage | StringMessage | I18nextMessage;\n\n/**\n * A content type representing JSX, ICU, and I18next messages\n */\nexport type Content = JsxChildren | StringContent;\n\n/**\n * A content type representing JSX elements\n */\nexport type JsxChildren = JsxChild | JsxChild[];\n\n/**\n * A content type representing ICU messages\n */\nexport type IcuMessage = string;\n\n/**\n * A content type representing I18next messages\n */\nexport type I18nextMessage = string;\n\n/**\n * A content type representing plain strings\n */\nexport type StringMessage = string;\n"],"mappings":";;;;AAKA,MAAa,qBAAqB;CAChC,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACN"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generaltranslation",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.7",
|
|
4
4
|
"description": "A language toolkit for AI developers",
|
|
5
|
-
"main": "dist/index.cjs
|
|
6
|
-
"module": "dist/index.
|
|
7
|
-
"types": "dist/index.d.
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.cts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"CHANGELOG.md"
|
|
11
11
|
],
|
|
12
|
+
"sideEffects": false,
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
14
15
|
"url": "git+https://github.com/generaltranslation/gt.git"
|
|
@@ -30,18 +31,12 @@
|
|
|
30
31
|
},
|
|
31
32
|
"homepage": "https://generaltranslation.com/",
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@rollup/plugin-commonjs": "^28.0.1",
|
|
34
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
35
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
36
|
-
"@rollup/plugin-typescript": "^12.1.1",
|
|
37
34
|
"@types/node": "^20.14.9",
|
|
38
|
-
"
|
|
39
|
-
"rollup-plugin-dts": "^6.1.1",
|
|
40
|
-
"tslib": "^2.8.0",
|
|
35
|
+
"tsdown": "^0.21.10",
|
|
41
36
|
"typescript": "^5.6.2"
|
|
42
37
|
},
|
|
43
38
|
"typescript": {
|
|
44
|
-
"definition": "dist/index.d.
|
|
39
|
+
"definition": "dist/index.d.cts"
|
|
45
40
|
},
|
|
46
41
|
"dependencies": {
|
|
47
42
|
"@formatjs/icu-messageformat-parser": "^2.11.4",
|
|
@@ -50,44 +45,69 @@
|
|
|
50
45
|
},
|
|
51
46
|
"exports": {
|
|
52
47
|
".": {
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
"require": {
|
|
49
|
+
"types": "./dist/index.d.cts",
|
|
50
|
+
"default": "./dist/index.cjs"
|
|
51
|
+
},
|
|
52
|
+
"import": {
|
|
53
|
+
"types": "./dist/index.d.mts",
|
|
54
|
+
"default": "./dist/index.mjs"
|
|
55
|
+
}
|
|
56
56
|
},
|
|
57
57
|
"./id": {
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
"require": {
|
|
59
|
+
"types": "./dist/id.d.cts",
|
|
60
|
+
"default": "./dist/id.cjs"
|
|
61
|
+
},
|
|
62
|
+
"import": {
|
|
63
|
+
"types": "./dist/id.d.mts",
|
|
64
|
+
"default": "./dist/id.mjs"
|
|
65
|
+
}
|
|
61
66
|
},
|
|
62
67
|
"./internal": {
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
"require": {
|
|
69
|
+
"types": "./dist/internal.d.cts",
|
|
70
|
+
"default": "./dist/internal.cjs"
|
|
71
|
+
},
|
|
72
|
+
"import": {
|
|
73
|
+
"types": "./dist/internal.d.mts",
|
|
74
|
+
"default": "./dist/internal.mjs"
|
|
75
|
+
}
|
|
66
76
|
},
|
|
67
77
|
"./types": {
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
"require": {
|
|
79
|
+
"types": "./dist/types.d.cts",
|
|
80
|
+
"default": "./dist/types.cjs"
|
|
81
|
+
},
|
|
82
|
+
"import": {
|
|
83
|
+
"types": "./dist/types.d.mts",
|
|
84
|
+
"default": "./dist/types.mjs"
|
|
85
|
+
}
|
|
71
86
|
},
|
|
72
87
|
"./errors": {
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
"require": {
|
|
89
|
+
"types": "./dist/errors.d.cts",
|
|
90
|
+
"default": "./dist/errors.cjs"
|
|
91
|
+
},
|
|
92
|
+
"import": {
|
|
93
|
+
"types": "./dist/errors.d.mts",
|
|
94
|
+
"default": "./dist/errors.mjs"
|
|
95
|
+
}
|
|
76
96
|
}
|
|
77
97
|
},
|
|
78
98
|
"typesVersions": {
|
|
79
99
|
"*": {
|
|
80
100
|
"internal": [
|
|
81
|
-
"./dist/internal.d.
|
|
101
|
+
"./dist/internal.d.cts"
|
|
82
102
|
],
|
|
83
103
|
"id": [
|
|
84
|
-
"./dist/id.d.
|
|
104
|
+
"./dist/id.d.cts"
|
|
85
105
|
],
|
|
86
106
|
"types": [
|
|
87
|
-
"./dist/types.d.
|
|
107
|
+
"./dist/types.d.cts"
|
|
88
108
|
],
|
|
89
109
|
"errors": [
|
|
90
|
-
"./dist/errors.d.
|
|
110
|
+
"./dist/errors.d.cts"
|
|
91
111
|
]
|
|
92
112
|
}
|
|
93
113
|
},
|
|
@@ -111,7 +131,7 @@
|
|
|
111
131
|
"scripts": {
|
|
112
132
|
"build:release": "pnpm run build:clean",
|
|
113
133
|
"build:clean": "sh ../../scripts/clean.sh && pnpm run build",
|
|
114
|
-
"build": "
|
|
134
|
+
"build": "tsdown",
|
|
115
135
|
"lint": "eslint \"src/**/*.{js,ts}\" \"./**/__tests__/**/*.{js,ts}\"",
|
|
116
136
|
"lint:fix": "eslint \"src/**/*.{js,ts}\" \"./**/__tests__/**/*.{js,ts}\" --fix",
|
|
117
137
|
"test": "vitest run --config=./vitest.config.ts",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Variable as VariableObject, VariableType } from '../types';
|
|
2
|
-
import { OldBranchType, OldGTProp, OldJsxChild, OldJsxChildren, OldJsxElement, OldVariableObject, OldVariableType } from './oldTypes.js';
|
|
3
|
-
import { GTProp, JsxChild, JsxChildren, JsxElement } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Convert request data from old format to new format
|
|
6
|
-
*/
|
|
7
|
-
export declare function getNewJsxChild(child: OldJsxChild): JsxChild;
|
|
8
|
-
export declare function getNewJsxChildren(children: OldJsxChildren): JsxChildren;
|
|
9
|
-
export declare function getNewJsxElement(element: OldJsxElement): JsxElement;
|
|
10
|
-
export declare function getNewBranchType(branch: OldBranchType): 'b' | 'p';
|
|
11
|
-
export declare function getNewVariableType(variable: OldVariableType): VariableType;
|
|
12
|
-
export declare function getNewVariableObject(variable: OldVariableObject): VariableObject;
|
|
13
|
-
export declare function getNewGTProp(dataGT: OldGTProp): GTProp;
|
|
14
|
-
/**
|
|
15
|
-
* Convert response data from old format to new format
|
|
16
|
-
*/
|
|
17
|
-
export declare function getOldJsxChild(child: JsxChild): OldJsxChild;
|
|
18
|
-
export declare function getOldJsxChildren(children: JsxChildren | OldJsxChildren): OldJsxChildren;
|
|
19
|
-
export declare function getOldJsxElement(element: JsxElement): OldJsxElement;
|
|
20
|
-
export declare function getOldBranchType(branch: 'b' | 'p'): OldBranchType;
|
|
21
|
-
export declare function getOldVariableType(variable: VariableType): OldVariableType;
|
|
22
|
-
export declare function getOldVariableObject(variable: VariableObject): OldVariableObject;
|
|
23
|
-
export declare function getOldGTProp(dataGT: GTProp, i: number): OldGTProp;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OldJsxChildren } from './oldTypes';
|
|
2
|
-
/**
|
|
3
|
-
* Calculates a unique hash for a given string using sha256.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} string - The string to be hashed.
|
|
6
|
-
* @returns {string} - The resulting hash as a hexadecimal string.
|
|
7
|
-
*/
|
|
8
|
-
export declare function oldHashString(string: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.
|
|
11
|
-
*
|
|
12
|
-
* @param {any} childrenAsObjects - The children objects to be hashed.
|
|
13
|
-
* @param {string} context - The context for the children
|
|
14
|
-
* @param {string} id - The id for the JSX Children object
|
|
15
|
-
* @param {function} hashFunction custom hash function
|
|
16
|
-
* @returns {string} - The unique has of the children.
|
|
17
|
-
*/
|
|
18
|
-
export declare function oldHashJsxChildren({ source, context, id, dataFormat, }: {
|
|
19
|
-
source: OldJsxChildren;
|
|
20
|
-
context?: string;
|
|
21
|
-
id?: string;
|
|
22
|
-
dataFormat: string;
|
|
23
|
-
}, hashFunction?: (string: string) => string): string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type OldBranchType = 'branch' | 'plural';
|
|
2
|
-
export type OldGTProp = {
|
|
3
|
-
id: number;
|
|
4
|
-
transformation?: OldBranchType;
|
|
5
|
-
branches?: Record<string, OldJsxChildren>;
|
|
6
|
-
};
|
|
7
|
-
export type OldJsxElement = {
|
|
8
|
-
type: string;
|
|
9
|
-
props: {
|
|
10
|
-
children?: OldJsxChildren;
|
|
11
|
-
'data-_gt': OldGTProp;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type OldVariableType = 'number' | 'variable' | 'datetime' | 'currency';
|
|
15
|
-
export type OldVariableObject = {
|
|
16
|
-
variable?: OldVariableType;
|
|
17
|
-
key: string;
|
|
18
|
-
id?: number;
|
|
19
|
-
};
|
|
20
|
-
export type OldJsxChild = OldJsxElement | OldVariableObject | string;
|
|
21
|
-
export type OldJsxChildren = OldJsxChild | OldJsxChild[];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { JsxChild, JsxChildren } from '../types';
|
|
2
|
-
import { OldJsxChild, OldJsxChildren, OldVariableObject } from './oldTypes.js';
|
|
3
|
-
import { Variable as VariableObject } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Checks if a JSX child is an old variable object format
|
|
6
|
-
* @param child - The JSX child to check
|
|
7
|
-
* @returns True if the child is an old variable object (has 'key' property)
|
|
8
|
-
*/
|
|
9
|
-
export declare function isOldVariableObject(child: OldJsxChild | JsxChild): child is OldVariableObject;
|
|
10
|
-
/**
|
|
11
|
-
* Checks if a JSX child is a new variable object format
|
|
12
|
-
* @param child - The JSX child to check
|
|
13
|
-
* @returns True if the child is a new variable object (has 'k' property)
|
|
14
|
-
*/
|
|
15
|
-
export declare function isNewVariableObject(child: OldJsxChild | JsxChild): child is VariableObject;
|
|
16
|
-
/**
|
|
17
|
-
* Checks if JSX children follow the old format
|
|
18
|
-
* @param children - The JSX children to check (can be string, array, or single child)
|
|
19
|
-
* @returns True if all children are in the old format
|
|
20
|
-
*/
|
|
21
|
-
export declare function isOldJsxChildren(children: OldJsxChildren | JsxChildren): children is OldJsxChildren;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ConstructorType, CustomIntlConstructors } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Cache for Intl and custom format instances to avoid repeated instantiation
|
|
4
|
-
* Uses a two-level structure: constructor name -> cache key -> instance
|
|
5
|
-
*/
|
|
6
|
-
declare class IntlCache {
|
|
7
|
-
private cache;
|
|
8
|
-
constructor();
|
|
9
|
-
/**
|
|
10
|
-
* Generates a consistent cache key from locales and options
|
|
11
|
-
* Handles all LocalesArgument types (string, Locale, array, undefined)
|
|
12
|
-
*/
|
|
13
|
-
private _generateKey;
|
|
14
|
-
/**
|
|
15
|
-
* Gets a cached Intl instance or creates a new one if not found
|
|
16
|
-
* @param constructor The name of the Intl constructor to use
|
|
17
|
-
* @param args Constructor arguments (locales, options)
|
|
18
|
-
* @returns Cached or newly created Intl instance
|
|
19
|
-
*/
|
|
20
|
-
get<K extends keyof CustomIntlConstructors>(constructor: K, ...args: ConstructorParameters<CustomIntlConstructors[K]>): InstanceType<ConstructorType<K>>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Global instance of the Intl cache for use throughout the application
|
|
24
|
-
*/
|
|
25
|
-
export declare const intlCache: IntlCache;
|
|
26
|
-
export {};
|
package/dist/cache/types.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { CutoffFormatConstructor } from '../formatting/custom-formats/CutoffFormat/CutoffFormat';
|
|
2
|
-
/**
|
|
3
|
-
* Extracts only the constructor functions from the Intl namespace,
|
|
4
|
-
* filtering out static methods like getCanonicalLocales and supportedValuesOf
|
|
5
|
-
*/
|
|
6
|
-
type IntlConstructors = {
|
|
7
|
-
[K in keyof typeof Intl as (typeof Intl)[K] extends new (...args: any[]) => any ? K : never]: (typeof Intl)[K];
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Extended interface that includes all native Intl constructors plus custom ones
|
|
11
|
-
*/
|
|
12
|
-
export interface CustomIntlConstructors extends IntlConstructors {
|
|
13
|
-
CutoffFormat: typeof CutoffFormatConstructor;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Helper type to represent a constructor function for a given Intl constructor key
|
|
17
|
-
*/
|
|
18
|
-
export type ConstructorType<K extends keyof CustomIntlConstructors> = new (...args: ConstructorParameters<CustomIntlConstructors[K]>) => InstanceType<CustomIntlConstructors[K]>;
|
|
19
|
-
/**
|
|
20
|
-
* Type for the cache object structure - each constructor gets its own Record
|
|
21
|
-
* mapping cache keys to instances of that specific constructor type
|
|
22
|
-
*/
|
|
23
|
-
export type IntlCacheObject = {
|
|
24
|
-
[K in keyof CustomIntlConstructors]?: Record<string, InstanceType<ConstructorType<K>>>;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Type for the CustomIntl object that maps constructor names to constructor functions
|
|
28
|
-
*/
|
|
29
|
-
export type CustomIntlType = {
|
|
30
|
-
[K in keyof CustomIntlConstructors]: ConstructorType<K>;
|
|
31
|
-
};
|
|
32
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Given an indexed ICU string, condenses any select to an argument
|
|
3
|
-
* indexVars('Hello {_gt_1, select, other {World}}') => 'Hello {_gt_1}'
|
|
4
|
-
* @param {string} icuString - The ICU string to condense.
|
|
5
|
-
* @returns {string} The condensed ICU string.
|
|
6
|
-
*/
|
|
7
|
-
export declare function condenseVars(icuString: string): string;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze).
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* function nonDerivableFunction() {
|
|
6
|
-
* return Math.random();
|
|
7
|
-
* }
|
|
8
|
-
*
|
|
9
|
-
* function derivableFunction() {
|
|
10
|
-
* if (condition) {
|
|
11
|
-
* return declareVar(nonDerivableFunction())
|
|
12
|
-
* }
|
|
13
|
-
* return 'John Doe';
|
|
14
|
-
* }
|
|
15
|
-
*
|
|
16
|
-
* const gt = useGT();
|
|
17
|
-
* gt(`My name is ${derive(derivableFunction())}`);
|
|
18
|
-
*
|
|
19
|
-
* @param {string | number | boolean | null | undefined} variable - The variable to sanitize.
|
|
20
|
-
* @param {Object} [options] - The options for the sanitization.
|
|
21
|
-
* @param {string} [options.$name] - The name of the variable.
|
|
22
|
-
* @returns {string} The sanitized value.
|
|
23
|
-
*/
|
|
24
|
-
export declare function declareVar(variable: string | number | boolean | null | undefined, options?: {
|
|
25
|
-
$name?: string;
|
|
26
|
-
}): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar()
|
|
3
|
-
* @example
|
|
4
|
-
* const encodedIcu = "Hi" + declareVar("Brian") + ", my name is {name}"
|
|
5
|
-
* // 'Hi {_gt_, select, other {Brian}}, my name is {name}'
|
|
6
|
-
* decodeVars(encodedIcu)
|
|
7
|
-
* // 'Hi Brian, my name is {name}'
|
|
8
|
-
*/
|
|
9
|
-
export declare function decodeVars(icuString: string): string;
|
package/dist/derive/derive.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* derive() is a powerful but dangerous function which marks its argument as derivable (statically analyzable) for the compiler and CLI tool.
|
|
3
|
-
*
|
|
4
|
-
* This function is dangerous because it can cause the compiler and CLI tool to throw an error if the argument is not derivable.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```jsx
|
|
8
|
-
* function getSubject() {
|
|
9
|
-
* return (Math.random() > 0.5) ? "Alice" : "Brian";
|
|
10
|
-
* }
|
|
11
|
-
* ...
|
|
12
|
-
* gt(`My name is ${derive(getSubject())}`);
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @param {T extends string | boolean | number | null | undefined} content - Content to mark as derivable.
|
|
16
|
-
* @returns content
|
|
17
|
-
*/
|
|
18
|
-
export declare function derive<T extends string | boolean | number | null | undefined>(content: T): T;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use derive() instead.
|
|
21
|
-
*
|
|
22
|
-
* declareStatic() is a powerful but dangerous function which marks its argument as derivable (statically analyzable) for the compiler and CLI tool.
|
|
23
|
-
*
|
|
24
|
-
* This function is dangerous because it can cause the compiler and CLI tool to throw an error if the argument is not derivable.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```jsx
|
|
28
|
-
* function getSubject() {
|
|
29
|
-
* return (Math.random() > 0.5) ? "Alice" : "Brian";
|
|
30
|
-
* }
|
|
31
|
-
* ...
|
|
32
|
-
* gt(`My name is ${declareStatic(getSubject())}`);
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @param {T extends string | boolean | number | null | undefined} content - Content to mark as derivable.
|
|
36
|
-
* @returns content
|
|
37
|
-
*/
|
|
38
|
-
export declare const declareStatic: typeof derive;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Given an unindexed ICU string, extracts all the _gt_ variables and an indexed mapping of the variable to the values
|
|
3
|
-
*
|
|
4
|
-
* extractVars('Hello {_gt_, select, other {World}}') => { _gt_1: 'World' }
|
|
5
|
-
*
|
|
6
|
-
* @param {string} icuString - The ICU string to extract variables from.
|
|
7
|
-
* @returns {Record<string, string>} A mapping of the variable to the value.
|
|
8
|
-
*/
|
|
9
|
-
export declare function extractVars(icuString: string): Record<string, string>;
|
package/dist/derive/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IcuMessage } from '../types-dir/jsx/content';
|
|
2
|
-
/**
|
|
3
|
-
* Given an ICU string adds identifiers to each _gt_ placeholder
|
|
4
|
-
* indexVars('Hello {_gt_} {_gt_} World') => 'Hello {_gt_1_} {_gt_2_} World'
|
|
5
|
-
*/
|
|
6
|
-
export declare function indexVars(icuString: IcuMessage): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sanitizes string by escaping ICU syntax
|
|
3
|
-
*
|
|
4
|
-
* Sanitize arbitrary string so it does not break the following ICU message syntax:
|
|
5
|
-
* {_gt_, select, other {string_here}}
|
|
6
|
-
*
|
|
7
|
-
* Escapes ICU special characters by:
|
|
8
|
-
* 1. Doubling all single quotes (U+0027 ')
|
|
9
|
-
* 2. Adding a single quote before the first special character ({}<>)
|
|
10
|
-
* 3. Adding a single quote after the last special character ({}<>)
|
|
11
|
-
*/
|
|
12
|
-
export declare function sanitizeVar(string: string): string;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { GTIndexedSelectElement, GTUnindexedSelectElement } from './types';
|
|
2
|
-
import { type MessageFormatElement } from '@formatjs/icu-messageformat-parser/types.js';
|
|
3
|
-
export declare function isGTIndexedSelectElement(child: MessageFormatElement): child is GTIndexedSelectElement;
|
|
4
|
-
export declare function isGTUnindexedSelectElement(child: MessageFormatElement): child is GTUnindexedSelectElement;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { MessageFormatElement, ParserOptions } from '@formatjs/icu-messageformat-parser';
|
|
2
|
-
type TraverseIcuOptions = ParserOptions & {
|
|
3
|
-
recurseIntoVisited?: boolean;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Given an ICU string, traverse the AST and call the visitor function for each element that matches the type T
|
|
7
|
-
* @param icu - The ICU string to traverse
|
|
8
|
-
* @param shouldVisit - A function that returns true if the element should be visited
|
|
9
|
-
* @param visitor - A function that is called for each element that matches the type T
|
|
10
|
-
* @returns The modified AST of the ICU string
|
|
11
|
-
*
|
|
12
|
-
* @note This function is a heavy operation, use sparingly
|
|
13
|
-
*/
|
|
14
|
-
export declare function traverseIcu<T extends MessageFormatElement>({ icuString, shouldVisit, visitor, options: { recurseIntoVisited, ...otherOptions }, }: {
|
|
15
|
-
icuString: string;
|
|
16
|
-
shouldVisit: (element: MessageFormatElement) => element is T;
|
|
17
|
-
visitor: (element: T) => void;
|
|
18
|
-
options: TraverseIcuOptions;
|
|
19
|
-
}): MessageFormatElement[];
|
|
20
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { VAR_IDENTIFIER } from './constants';
|
|
2
|
-
import type { PluralOrSelectOption, LiteralElement, SelectElement } from '@formatjs/icu-messageformat-parser/types.js';
|
|
3
|
-
interface GTIndexedSelectOption extends PluralOrSelectOption {
|
|
4
|
-
value: Array<LiteralElement>;
|
|
5
|
-
}
|
|
6
|
-
export interface GTIndexedSelectElement extends SelectElement {
|
|
7
|
-
value: `${typeof VAR_IDENTIFIER}${number}`;
|
|
8
|
-
options: {
|
|
9
|
-
other: GTIndexedSelectOption;
|
|
10
|
-
[key: string]: PluralOrSelectOption;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
interface GTUnindexedSelectOption extends PluralOrSelectOption {
|
|
14
|
-
value: Array<LiteralElement>;
|
|
15
|
-
}
|
|
16
|
-
export interface GTUnindexedSelectElement extends SelectElement {
|
|
17
|
-
value: typeof VAR_IDENTIFIER;
|
|
18
|
-
options: {
|
|
19
|
-
other: GTUnindexedSelectOption;
|
|
20
|
-
[key: string]: PluralOrSelectOption;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createInvalidCutoffStyleError: (style: string) => string;
|
package/dist/errors.cjs.min.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var t=function(r,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])},t(r,o)};"function"==typeof SuppressedError&&SuppressedError;var r=function(r){function o(t,o,e){var n=r.call(this,t)||this;return n.name="ApiError",n.code=o,n.message=e,n}return function(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function e(){this.constructor=r}t(r,o),r.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}(o,r),o.prototype.getCode=function(){return this.code},o.prototype.getMessage=function(){return this.message},o}(Error);exports.ApiError=r;
|
|
2
|
-
//# sourceMappingURL=errors.cjs.min.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs.min.cjs","sources":["../../../node_modules/.pnpm/@rollup+plugin-typescript@12.1.4_rollup@4.52.3_tslib@2.8.1_typescript@5.9.2/node_modules/tslib/tslib.es6.js","../src/errors/ApiError.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","export class ApiError extends Error {\n public code: number;\n public message: string;\n\n constructor(error: string, code: number, message: string) {\n super(error);\n this.name = 'ApiError';\n this.code = code;\n this.message = message;\n }\n\n getCode() {\n return this.code;\n }\n\n getMessage() {\n return this.message;\n }\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","SuppressedError","ApiError","_super","error","code","message","_this","this","name","TypeError","String","__","constructor","create","__extends","getCode","getMessage","Error"],"mappings":"aAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAG,GAC1E,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,GAAI,EAC7FP,EAAcC,EAAGC,EAC5B,EAmTkD,mBAApBS,iBAAiCA,gBCxU/D,IAAAC,EAAA,SAAAC,GAIE,SAAAD,EAAYE,EAAeC,EAAcC,GACvC,IAAAC,EAAAJ,EAAKH,KAAAQ,KAACJ,IAAMI,YACZD,EAAKE,KAAO,WACZF,EAAKF,KAAOA,EACZE,EAAKD,QAAUA,GACjB,CASF,ODKO,SAAmBf,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIkB,UAAU,uBAAyBC,OAAOnB,GAAK,iCAE7D,SAASoB,IAAOJ,KAAKK,YAActB,CAAG,CADtCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOqB,OAAOtB,IAAMoB,EAAGd,UAAYN,EAAEM,UAAW,IAAIc,EACnF,CC7B8BG,CAAAb,EAAAC,GAW5BD,EAAAJ,UAAAkB,QAAA,WACE,OAAOR,KAAKH,IACd,EAEAH,EAAAJ,UAAAmB,WAAA,WACE,OAAOT,KAAKF,OACd,EACFJ,CAAA,CAlBA,CAA8BgB","x_google_ignoreList":[0]}
|