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
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LocaleProperties } from './getLocaleProperties';
|
|
2
|
-
export type FullCustomMapping = Record<string, LocaleProperties>;
|
|
3
|
-
export type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
|
|
4
|
-
export declare const getCustomProperty: (customMapping: CustomMapping, locale: string, property: keyof LocaleProperties) => string | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Checks if a given locale should use the canonical locale.
|
|
7
|
-
* @param locale - The locale to check if it should use the canonical locale
|
|
8
|
-
* @param customMapping - The custom mapping to use for checking if the locale should use the canonical locale
|
|
9
|
-
* @returns True if the locale should use the canonical locale, false otherwise
|
|
10
|
-
*/
|
|
11
|
-
export declare const shouldUseCanonicalLocale: (locale: string, customMapping: CustomMapping) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { CustomMapping } from './customLocaleMapping';
|
|
2
|
-
export type LocaleProperties = {
|
|
3
|
-
code: string;
|
|
4
|
-
name: string;
|
|
5
|
-
nativeName: string;
|
|
6
|
-
languageCode: string;
|
|
7
|
-
languageName: string;
|
|
8
|
-
nativeLanguageName: string;
|
|
9
|
-
nameWithRegionCode: string;
|
|
10
|
-
nativeNameWithRegionCode: string;
|
|
11
|
-
regionCode: string;
|
|
12
|
-
regionName: string;
|
|
13
|
-
nativeRegionName: string;
|
|
14
|
-
scriptCode: string;
|
|
15
|
-
scriptName: string;
|
|
16
|
-
nativeScriptName: string;
|
|
17
|
-
maximizedCode: string;
|
|
18
|
-
maximizedName: string;
|
|
19
|
-
nativeMaximizedName: string;
|
|
20
|
-
minimizedCode: string;
|
|
21
|
-
minimizedName: string;
|
|
22
|
-
nativeMinimizedName: string;
|
|
23
|
-
emoji: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Creates a set of custom locale properties from a custom mapping.
|
|
27
|
-
*
|
|
28
|
-
* @param lArray - An array of locale codes to search for in the custom mapping.
|
|
29
|
-
* @param customMapping - Optional custom mapping of locale codes to names.
|
|
30
|
-
* @returns A partial set of locale properties, or undefined if no custom mapping is provided.
|
|
31
|
-
*/
|
|
32
|
-
export declare function createCustomLocaleProperties(lArray: string[], customMapping?: CustomMapping): Partial<LocaleProperties> | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PluralType } from '../settings/plurals';
|
|
2
|
-
/**
|
|
3
|
-
* Given a number and a list of allowed plural forms, return the plural form that best fits the number.
|
|
4
|
-
*
|
|
5
|
-
* @param {number} n - The number to determine the plural form for.
|
|
6
|
-
* @param {locales[]} forms - The allowed plural forms.
|
|
7
|
-
* @returns {PluralType} The determined plural form, or an empty string if none fit.
|
|
8
|
-
*/
|
|
9
|
-
export default function _getPluralForm(n: number, forms?: PluralType[], locales?: string[]): PluralType | '';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CustomMapping } from './customLocaleMapping';
|
|
2
|
-
/**
|
|
3
|
-
* Resolves the alias locale for a given locale.
|
|
4
|
-
* @param locale - The locale to resolve the alias locale for
|
|
5
|
-
* @param customMapping - The custom mapping to use for resolving the alias locale
|
|
6
|
-
* @returns The alias locale
|
|
7
|
-
*/
|
|
8
|
-
export declare function _resolveAliasLocale(locale: string, customMapping?: CustomMapping): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CustomMapping } from './customLocaleMapping';
|
|
2
|
-
/**
|
|
3
|
-
* Resolves the canonical locale for a given locale.
|
|
4
|
-
* @param locale - The locale to resolve the canonical locale for
|
|
5
|
-
* @param customMapping - The custom mapping to use for resolving the canonical locale
|
|
6
|
-
* @returns The canonical locale
|
|
7
|
-
*/
|
|
8
|
-
export declare function _resolveCanonicalLocale(locale: string, customMapping?: CustomMapping): string;
|
package/dist/logging/errors.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const translationTimeoutError: (timeout: number) => string;
|
|
2
|
-
export declare const translationRequestFailedError: (error: string) => string;
|
|
3
|
-
export declare const apiError: (status: number, statusText: string, error: string) => string;
|
|
4
|
-
export declare const invalidAuthError = "GT Error: Invalid authentication.";
|
|
5
|
-
export declare const noTargetLocaleProvidedError: (functionName: string) => string;
|
|
6
|
-
export declare const noSourceLocaleProvidedError: (functionName: string) => string;
|
|
7
|
-
export declare const noProjectIdProvidedError: (functionName: string) => string;
|
|
8
|
-
export declare const noApiKeyProvidedError: (functionName: string) => string;
|
|
9
|
-
export declare const invalidLocaleError: (locale: string) => string;
|
|
10
|
-
export declare const invalidLocalesError: (locales: string[]) => string;
|
package/dist/logging/logger.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comprehensive logging system for the General Translation library
|
|
3
|
-
* Provides structured logging with multiple levels and configurable output
|
|
4
|
-
*/
|
|
5
|
-
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
|
6
|
-
export interface LogEntry {
|
|
7
|
-
level: LogLevel;
|
|
8
|
-
message: string;
|
|
9
|
-
timestamp: Date;
|
|
10
|
-
context?: string;
|
|
11
|
-
metadata?: Record<string, any>;
|
|
12
|
-
}
|
|
13
|
-
export interface LoggerConfig {
|
|
14
|
-
/** Minimum log level to output */
|
|
15
|
-
level: LogLevel;
|
|
16
|
-
/** Whether to include timestamps in log output */
|
|
17
|
-
includeTimestamp: boolean;
|
|
18
|
-
/** Whether to include context information */
|
|
19
|
-
includeContext: boolean;
|
|
20
|
-
/** Custom prefix for all log messages */
|
|
21
|
-
prefix?: string;
|
|
22
|
-
/** Whether to output to console (default: true) */
|
|
23
|
-
enableConsole: boolean;
|
|
24
|
-
/** Custom log handlers */
|
|
25
|
-
handlers?: LogHandler[];
|
|
26
|
-
}
|
|
27
|
-
export interface LogHandler {
|
|
28
|
-
handle(entry: LogEntry): void;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Console log handler that outputs formatted messages to console
|
|
32
|
-
*/
|
|
33
|
-
export declare class ConsoleLogHandler implements LogHandler {
|
|
34
|
-
private config;
|
|
35
|
-
constructor(config: LoggerConfig);
|
|
36
|
-
handle(entry: LogEntry): void;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Main Logger class providing structured logging capabilities
|
|
40
|
-
*/
|
|
41
|
-
export declare class Logger {
|
|
42
|
-
private config;
|
|
43
|
-
private handlers;
|
|
44
|
-
constructor(config?: Partial<LoggerConfig>);
|
|
45
|
-
/**
|
|
46
|
-
* Add a custom log handler
|
|
47
|
-
*/
|
|
48
|
-
addHandler(handler: LogHandler): void;
|
|
49
|
-
/**
|
|
50
|
-
* Remove a log handler
|
|
51
|
-
*/
|
|
52
|
-
removeHandler(handler: LogHandler): void;
|
|
53
|
-
/**
|
|
54
|
-
* Update logger configuration
|
|
55
|
-
*/
|
|
56
|
-
configure(config: Partial<LoggerConfig>): void;
|
|
57
|
-
/**
|
|
58
|
-
* Check if a log level should be output based on current configuration
|
|
59
|
-
*/
|
|
60
|
-
private shouldLog;
|
|
61
|
-
/**
|
|
62
|
-
* Internal logging method that creates log entries and passes them to handlers
|
|
63
|
-
*/
|
|
64
|
-
private log;
|
|
65
|
-
/**
|
|
66
|
-
* Log a debug message
|
|
67
|
-
* Used for detailed diagnostic information, typically of interest only when diagnosing problems
|
|
68
|
-
*/
|
|
69
|
-
debug(message: string, context?: string, metadata?: Record<string, any>): void;
|
|
70
|
-
/**
|
|
71
|
-
* Log an info message
|
|
72
|
-
* Used for general information about application operation
|
|
73
|
-
*/
|
|
74
|
-
info(message: string, context?: string, metadata?: Record<string, any>): void;
|
|
75
|
-
/**
|
|
76
|
-
* Log a warning message
|
|
77
|
-
* Used for potentially problematic situations that don't prevent operation
|
|
78
|
-
*/
|
|
79
|
-
warn(message: string, context?: string, metadata?: Record<string, any>): void;
|
|
80
|
-
/**
|
|
81
|
-
* Log an error message
|
|
82
|
-
* Used for error events that might still allow the application to continue
|
|
83
|
-
*/
|
|
84
|
-
error(message: string, context?: string, metadata?: Record<string, any>): void;
|
|
85
|
-
/**
|
|
86
|
-
* Create a child logger with a specific context
|
|
87
|
-
*/
|
|
88
|
-
child(context: string): ContextLogger;
|
|
89
|
-
/**
|
|
90
|
-
* Get current logger configuration
|
|
91
|
-
*/
|
|
92
|
-
getConfig(): LoggerConfig;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Context logger that automatically includes context information
|
|
96
|
-
*/
|
|
97
|
-
export declare class ContextLogger {
|
|
98
|
-
private logger;
|
|
99
|
-
private context;
|
|
100
|
-
constructor(logger: Logger, context: string);
|
|
101
|
-
debug(message: string, metadata?: Record<string, any>): void;
|
|
102
|
-
info(message: string, metadata?: Record<string, any>): void;
|
|
103
|
-
warn(message: string, metadata?: Record<string, any>): void;
|
|
104
|
-
error(message: string, metadata?: Record<string, any>): void;
|
|
105
|
-
child(childContext: string): ContextLogger;
|
|
106
|
-
}
|
|
107
|
-
export declare const defaultLogger: Logger;
|
|
108
|
-
export declare const debug: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
|
109
|
-
export declare const info: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
|
110
|
-
export declare const warn: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
|
111
|
-
export declare const error: (message: string, context?: string, metadata?: Record<string, any>) => void;
|
|
112
|
-
export declare const fetchLogger: ContextLogger;
|
|
113
|
-
export declare const validationLogger: ContextLogger;
|
|
114
|
-
export declare const formattingLogger: ContextLogger;
|
|
115
|
-
export declare const localeLogger: ContextLogger;
|
|
116
|
-
export declare const gtInstanceLogger: ContextLogger;
|
|
117
|
-
export { Logger as GTLogger };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const formatI18nextWarning = "Warning: formatI18next is not currently supported but will be implemented in a future version. Use _formatMessageICU for current ICU message format support.";
|
|
2
|
-
export declare const formatJsxWarning = "Warning: formatJsx is not currently supported but will be implemented in a future version. Use _formatMessageICU for current ICU message format support.";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/translate/api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const API_VERSION = "2026-03-06.v1";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { JobStatus } from './checkJobStatus';
|
|
2
|
-
export type AwaitJobsOptions = {
|
|
3
|
-
/** Polling interval in seconds. Defaults to 5. */
|
|
4
|
-
pollingIntervalSeconds?: number;
|
|
5
|
-
/** Timeout in seconds. Defaults to 600 (10 minutes). If reached, resolves with whatever status is current. */
|
|
6
|
-
timeoutSeconds?: number;
|
|
7
|
-
};
|
|
8
|
-
export type JobResult = {
|
|
9
|
-
jobId: string;
|
|
10
|
-
status: JobStatus;
|
|
11
|
-
error?: {
|
|
12
|
-
message: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export type AwaitJobsResult = {
|
|
16
|
-
/** Whether all jobs completed (none still in progress). */
|
|
17
|
-
complete: boolean;
|
|
18
|
-
jobs: JobResult[];
|
|
19
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type CreateTagFileReference = {
|
|
2
|
-
fileId: string;
|
|
3
|
-
versionId: string;
|
|
4
|
-
branchId: string;
|
|
5
|
-
};
|
|
6
|
-
export type CreateTagOptions = {
|
|
7
|
-
tagId: string;
|
|
8
|
-
files: CreateTagFileReference[];
|
|
9
|
-
message?: string;
|
|
10
|
-
};
|
|
11
|
-
export type CreateTagResult = {
|
|
12
|
-
tag: {
|
|
13
|
-
id: string;
|
|
14
|
-
tagId: string;
|
|
15
|
-
message: string | null;
|
|
16
|
-
createdAt: string;
|
|
17
|
-
updatedAt: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export type MoveMapping = {
|
|
2
|
-
oldFileId: string;
|
|
3
|
-
newFileId: string;
|
|
4
|
-
newFileName: string;
|
|
5
|
-
};
|
|
6
|
-
export type MoveResult = {
|
|
7
|
-
oldFileId: string;
|
|
8
|
-
newFileId: string;
|
|
9
|
-
success: boolean;
|
|
10
|
-
newSourceFileId?: string;
|
|
11
|
-
clonedTranslationsCount?: number;
|
|
12
|
-
error?: string;
|
|
13
|
-
};
|
|
14
|
-
export type ProcessMovesResponse = {
|
|
15
|
-
results: MoveResult[];
|
|
16
|
-
summary: {
|
|
17
|
-
total: number;
|
|
18
|
-
succeeded: number;
|
|
19
|
-
failed: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export type ProcessMovesOptions = {
|
|
23
|
-
timeout?: number;
|
|
24
|
-
branchId?: string;
|
|
25
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type PublishFileEntry = {
|
|
2
|
-
fileId: string;
|
|
3
|
-
versionId: string;
|
|
4
|
-
branchId?: string;
|
|
5
|
-
publish: boolean;
|
|
6
|
-
fileName?: string;
|
|
7
|
-
};
|
|
8
|
-
export type PublishFilesResult = {
|
|
9
|
-
results: {
|
|
10
|
-
fileId: string;
|
|
11
|
-
versionId: string;
|
|
12
|
-
locale?: string;
|
|
13
|
-
branchId: string;
|
|
14
|
-
success: boolean;
|
|
15
|
-
error?: string;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export type FileDataQuery = {
|
|
2
|
-
sourceFiles?: {
|
|
3
|
-
fileId: string;
|
|
4
|
-
versionId: string;
|
|
5
|
-
branchId: string;
|
|
6
|
-
}[];
|
|
7
|
-
translatedFiles?: {
|
|
8
|
-
fileId: string;
|
|
9
|
-
versionId: string;
|
|
10
|
-
branchId: string;
|
|
11
|
-
locale: string;
|
|
12
|
-
}[];
|
|
13
|
-
};
|
|
14
|
-
export type FileDataResult = {
|
|
15
|
-
sourceFiles?: {
|
|
16
|
-
branchId: string;
|
|
17
|
-
fileId: string;
|
|
18
|
-
versionId: string;
|
|
19
|
-
fileName: string;
|
|
20
|
-
fileFormat: string;
|
|
21
|
-
dataFormat: string | null;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
updatedAt: string;
|
|
24
|
-
approvalRequiredAt: string | null;
|
|
25
|
-
publishedAt: string | null;
|
|
26
|
-
locales: string[];
|
|
27
|
-
sourceLocale: string;
|
|
28
|
-
}[];
|
|
29
|
-
translatedFiles?: {
|
|
30
|
-
branchId: string;
|
|
31
|
-
fileId: string;
|
|
32
|
-
versionId: string;
|
|
33
|
-
fileFormat: string;
|
|
34
|
-
dataFormat: string | null;
|
|
35
|
-
createdAt: string;
|
|
36
|
-
updatedAt: string;
|
|
37
|
-
approvedAt: string | null;
|
|
38
|
-
publishedAt: string | null;
|
|
39
|
-
completedAt: string | null;
|
|
40
|
-
locale: string;
|
|
41
|
-
}[];
|
|
42
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type SubmitUserEditDiff = {
|
|
2
|
-
fileName: string;
|
|
3
|
-
locale: string;
|
|
4
|
-
diff: string;
|
|
5
|
-
branchId: string;
|
|
6
|
-
versionId: string;
|
|
7
|
-
fileId: string;
|
|
8
|
-
localContent: string;
|
|
9
|
-
};
|
|
10
|
-
export type SubmitUserEditDiffsPayload = {
|
|
11
|
-
diffs: SubmitUserEditDiff[];
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Splits an array into batches of a specified size.
|
|
3
|
-
* @param items - The array to split into batches
|
|
4
|
-
* @param batchSize - The maximum size of each batch
|
|
5
|
-
* @returns An array of batches
|
|
6
|
-
*/
|
|
7
|
-
export declare function createBatches<T>(items: T[], batchSize: number): T[][];
|
|
8
|
-
/**
|
|
9
|
-
* Result of processing batches
|
|
10
|
-
*/
|
|
11
|
-
export interface BatchList<T> {
|
|
12
|
-
/** The items successfully processed across all batches */
|
|
13
|
-
data: T[];
|
|
14
|
-
/** The total number of items processed */
|
|
15
|
-
count: number;
|
|
16
|
-
/** The number of batches processed */
|
|
17
|
-
batchCount: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Options for batch processing
|
|
21
|
-
*/
|
|
22
|
-
export interface BatchProcessOptions {
|
|
23
|
-
/** Maximum number of items per batch (default: 100) */
|
|
24
|
-
batchSize?: number;
|
|
25
|
-
/** Whether to process batches in parallel (default: true) */
|
|
26
|
-
parallel?: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Processes items in batches using a provided processor function.
|
|
30
|
-
*
|
|
31
|
-
* @param items - The items to process
|
|
32
|
-
* @param processor - Async function that processes a single batch and returns items
|
|
33
|
-
* @param options - Optional configuration for batch processing
|
|
34
|
-
* @returns Promise that resolves to a BatchList containing all processed items
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* const result = await processBatches(
|
|
39
|
-
* files,
|
|
40
|
-
* async (batch) => {
|
|
41
|
-
* const response = await uploadFiles(batch);
|
|
42
|
-
* return response.uploadedFiles;
|
|
43
|
-
* },
|
|
44
|
-
* { batchSize: 100 }
|
|
45
|
-
* );
|
|
46
|
-
*
|
|
47
|
-
* console.log(result.data); // All items
|
|
48
|
-
* console.log(result.count); // Total count
|
|
49
|
-
* console.log(result.batchCount); // Number of batches processed
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
export declare function processBatches<TInput, TOutput>(items: TInput[], processor: (batch: TInput[]) => Promise<TOutput[]>, options?: BatchProcessOptions): Promise<BatchList<TOutput>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function handleFetchError(error: unknown, timeout: number): never;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function validateResponse(response: Response): Promise<void>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type FileTranslationQuery = {
|
|
2
|
-
versionId: string;
|
|
3
|
-
fileName?: string;
|
|
4
|
-
fileId?: string;
|
|
5
|
-
locale: string;
|
|
6
|
-
};
|
|
7
|
-
export type CheckFileTranslationsOptions = {
|
|
8
|
-
timeout?: number;
|
|
9
|
-
};
|
|
10
|
-
export type FileQuery = {
|
|
11
|
-
fileId: string;
|
|
12
|
-
branchId?: string;
|
|
13
|
-
versionId?: string;
|
|
14
|
-
};
|
|
15
|
-
export type FileQueryResult = {
|
|
16
|
-
sourceFile: {
|
|
17
|
-
id: string;
|
|
18
|
-
fileId: string;
|
|
19
|
-
versionId: string;
|
|
20
|
-
sourceLocale: string;
|
|
21
|
-
fileName: string;
|
|
22
|
-
fileFormat: string;
|
|
23
|
-
dataFormat: string | null;
|
|
24
|
-
createdAt: string;
|
|
25
|
-
updatedAt: string;
|
|
26
|
-
approvalRequiredAt: string | null;
|
|
27
|
-
locales: string[];
|
|
28
|
-
};
|
|
29
|
-
translations: {
|
|
30
|
-
locale: string;
|
|
31
|
-
completedAt: string | null;
|
|
32
|
-
approvedAt: string | null;
|
|
33
|
-
publishedAt: string | null;
|
|
34
|
-
createdAt: string | null;
|
|
35
|
-
updatedAt: string | null;
|
|
36
|
-
}[];
|
|
37
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FileFormat } from './file';
|
|
2
|
-
export type DownloadFileBatchRequest = {
|
|
3
|
-
fileId: string;
|
|
4
|
-
branchId?: string;
|
|
5
|
-
versionId?: string;
|
|
6
|
-
locale?: string;
|
|
7
|
-
useLatestAvailableVersion?: boolean;
|
|
8
|
-
}[];
|
|
9
|
-
export type DownloadFileBatchOptions = {
|
|
10
|
-
timeout?: number;
|
|
11
|
-
};
|
|
12
|
-
export type BatchDownloadResult = {
|
|
13
|
-
fileId: string;
|
|
14
|
-
fileName: string;
|
|
15
|
-
success: boolean;
|
|
16
|
-
content?: string;
|
|
17
|
-
contentType?: string;
|
|
18
|
-
error?: string;
|
|
19
|
-
};
|
|
20
|
-
export type DownloadedFile = {
|
|
21
|
-
id: string;
|
|
22
|
-
branchId: string;
|
|
23
|
-
fileId: string;
|
|
24
|
-
versionId: string;
|
|
25
|
-
locale?: string;
|
|
26
|
-
fileName?: string;
|
|
27
|
-
data: string;
|
|
28
|
-
metadata: Record<string, any>;
|
|
29
|
-
fileFormat: FileFormat;
|
|
30
|
-
};
|
|
31
|
-
export type DownloadFileBatchResult = {
|
|
32
|
-
files: DownloadedFile[];
|
|
33
|
-
count: number;
|
|
34
|
-
};
|