@_linked/translation 0.2.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/README.md +102 -0
- package/lib/cjs/data/translation.json +8 -0
- package/lib/esm/archive.d.ts +133 -0
- package/lib/esm/archive.js +567 -0
- package/lib/esm/archive.js.map +1 -0
- package/lib/esm/authorization.d.ts +12 -0
- package/lib/esm/authorization.js +10 -0
- package/lib/esm/authorization.js.map +1 -0
- package/lib/esm/backend.d.ts +1 -0
- package/lib/esm/backend.js +3 -0
- package/lib/esm/backend.js.map +1 -0
- package/lib/esm/cdn-loader.d.ts +40 -0
- package/lib/esm/cdn-loader.js +200 -0
- package/lib/esm/cdn-loader.js.map +1 -0
- package/lib/esm/checks.d.ts +56 -0
- package/lib/esm/checks.js +288 -0
- package/lib/esm/checks.js.map +1 -0
- package/lib/esm/compile.d.ts +64 -0
- package/lib/esm/compile.js +99 -0
- package/lib/esm/compile.js.map +1 -0
- package/lib/esm/core/messages.d.ts +25 -0
- package/lib/esm/core/messages.js +76 -0
- package/lib/esm/core/messages.js.map +1 -0
- package/lib/esm/data/translation.json +8 -0
- package/lib/esm/discovery.d.ts +97 -0
- package/lib/esm/discovery.js +365 -0
- package/lib/esm/discovery.js.map +1 -0
- package/lib/esm/exchange.d.ts +100 -0
- package/lib/esm/exchange.js +223 -0
- package/lib/esm/exchange.js.map +1 -0
- package/lib/esm/export.d.ts +28 -0
- package/lib/esm/export.js +92 -0
- package/lib/esm/export.js.map +1 -0
- package/lib/esm/formats/csv.d.ts +8 -0
- package/lib/esm/formats/csv.js +397 -0
- package/lib/esm/formats/csv.js.map +1 -0
- package/lib/esm/formats/json.d.ts +30 -0
- package/lib/esm/formats/json.js +459 -0
- package/lib/esm/formats/json.js.map +1 -0
- package/lib/esm/formats/xliff.d.ts +12 -0
- package/lib/esm/formats/xliff.js +577 -0
- package/lib/esm/formats/xliff.js.map +1 -0
- package/lib/esm/import.d.ts +197 -0
- package/lib/esm/import.js +391 -0
- package/lib/esm/import.js.map +1 -0
- package/lib/esm/index.d.ts +42 -0
- package/lib/esm/index.js +34 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/key-sync-node.d.ts +29 -0
- package/lib/esm/key-sync-node.js +174 -0
- package/lib/esm/key-sync-node.js.map +1 -0
- package/lib/esm/key-sync.d.ts +46 -0
- package/lib/esm/key-sync.js +114 -0
- package/lib/esm/key-sync.js.map +1 -0
- package/lib/esm/key-version.d.ts +50 -0
- package/lib/esm/key-version.js +134 -0
- package/lib/esm/key-version.js.map +1 -0
- package/lib/esm/languages.d.ts +18 -0
- package/lib/esm/languages.js +74 -0
- package/lib/esm/languages.js.map +1 -0
- package/lib/esm/linked-discovery.d.ts +44 -0
- package/lib/esm/linked-discovery.js +267 -0
- package/lib/esm/linked-discovery.js.map +1 -0
- package/lib/esm/message-format.d.ts +41 -0
- package/lib/esm/message-format.js +133 -0
- package/lib/esm/message-format.js.map +1 -0
- package/lib/esm/mt.d.ts +111 -0
- package/lib/esm/mt.js +142 -0
- package/lib/esm/mt.js.map +1 -0
- package/lib/esm/ontologies/translation.d.ts +203 -0
- package/lib/esm/ontologies/translation.js +219 -0
- package/lib/esm/ontologies/translation.js.map +1 -0
- package/lib/esm/package.d.ts +4 -0
- package/lib/esm/package.js +11 -0
- package/lib/esm/package.js.map +1 -0
- package/lib/esm/react.d.ts +55 -0
- package/lib/esm/react.js +127 -0
- package/lib/esm/react.js.map +1 -0
- package/lib/esm/records.d.ts +151 -0
- package/lib/esm/records.js +2 -0
- package/lib/esm/records.js.map +1 -0
- package/lib/esm/release.d.ts +198 -0
- package/lib/esm/release.js +435 -0
- package/lib/esm/release.js.map +1 -0
- package/lib/esm/shape-catalog.d.ts +79 -0
- package/lib/esm/shape-catalog.js +118 -0
- package/lib/esm/shape-catalog.js.map +1 -0
- package/lib/esm/shapes/GlossaryTerm.d.ts +28 -0
- package/lib/esm/shapes/GlossaryTerm.js +94 -0
- package/lib/esm/shapes/GlossaryTerm.js.map +1 -0
- package/lib/esm/shapes/TranslationInventoryOrigin.d.ts +33 -0
- package/lib/esm/shapes/TranslationInventoryOrigin.js +209 -0
- package/lib/esm/shapes/TranslationInventoryOrigin.js.map +1 -0
- package/lib/esm/shapes/TranslationKey.d.ts +92 -0
- package/lib/esm/shapes/TranslationKey.js +194 -0
- package/lib/esm/shapes/TranslationKey.js.map +1 -0
- package/lib/esm/shapes/TranslationKeyVersion.d.ts +19 -0
- package/lib/esm/shapes/TranslationKeyVersion.js +125 -0
- package/lib/esm/shapes/TranslationKeyVersion.js.map +1 -0
- package/lib/esm/shapes/TranslationLanguage.d.ts +15 -0
- package/lib/esm/shapes/TranslationLanguage.js +102 -0
- package/lib/esm/shapes/TranslationLanguage.js.map +1 -0
- package/lib/esm/shapes/TranslationProvider.d.ts +409 -0
- package/lib/esm/shapes/TranslationProvider.js +1376 -0
- package/lib/esm/shapes/TranslationProvider.js.map +1 -0
- package/lib/esm/shapes/TranslationRelease.d.ts +36 -0
- package/lib/esm/shapes/TranslationRelease.js +149 -0
- package/lib/esm/shapes/TranslationRelease.js.map +1 -0
- package/lib/esm/shapes/TranslationRevision.d.ts +39 -0
- package/lib/esm/shapes/TranslationRevision.js +159 -0
- package/lib/esm/shapes/TranslationRevision.js.map +1 -0
- package/lib/esm/shapes/TranslationUnit.d.ts +26 -0
- package/lib/esm/shapes/TranslationUnit.js +111 -0
- package/lib/esm/shapes/TranslationUnit.js.map +1 -0
- package/package.json +134 -0
- package/src/archive.ts +894 -0
- package/src/authorization.ts +33 -0
- package/src/backend.ts +2 -0
- package/src/cdn-loader.ts +264 -0
- package/src/checks.ts +413 -0
- package/src/compile.ts +168 -0
- package/src/core/messages.ts +106 -0
- package/src/data/translation.json +8 -0
- package/src/discovery.ts +594 -0
- package/src/exchange.ts +428 -0
- package/src/export.ts +135 -0
- package/src/formats/csv.ts +459 -0
- package/src/formats/json.ts +587 -0
- package/src/formats/xliff.ts +708 -0
- package/src/import.ts +648 -0
- package/src/index.ts +207 -0
- package/src/key-sync-node.ts +269 -0
- package/src/key-sync.ts +168 -0
- package/src/key-version.ts +206 -0
- package/src/languages.ts +102 -0
- package/src/linked-discovery.ts +385 -0
- package/src/message-format.ts +214 -0
- package/src/mt.ts +248 -0
- package/src/ontologies/translation.ts +234 -0
- package/src/package.ts +19 -0
- package/src/react.tsx +250 -0
- package/src/records.ts +180 -0
- package/src/release.ts +726 -0
- package/src/shape-catalog.ts +198 -0
- package/src/shapes/GlossaryTerm.ts +61 -0
- package/src/shapes/TranslationInventoryOrigin.ts +131 -0
- package/src/shapes/TranslationKey.ts +174 -0
- package/src/shapes/TranslationKeyVersion.ts +77 -0
- package/src/shapes/TranslationLanguage.ts +51 -0
- package/src/shapes/TranslationProvider.ts +1755 -0
- package/src/shapes/TranslationRelease.ts +114 -0
- package/src/shapes/TranslationRevision.ts +105 -0
- package/src/shapes/TranslationUnit.ts +72 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { ShapeProvider } from '@_linked/server-utils/utils/ShapeProvider';
|
|
2
|
+
import type { GlossaryTermRecord, TranslationEntryRecord, TranslationMemoryMatchRecord, TranslationMemoryPretranslateCandidate, TranslationMemoryPretranslateReport, TranslationMemoryRecord, TranslationProposalDecision, TranslationRevisionRecord, TranslationRevisionStatus, TranslationState, TranslationKeyVersionRecord, TranslationReleaseRecord, TranslationUnitRecord } from '../records.js';
|
|
3
|
+
import { TranslationKey } from './TranslationKey.js';
|
|
4
|
+
import type { TranslationMessages } from '../core/messages.js';
|
|
5
|
+
export interface TranslationKeyInput {
|
|
6
|
+
appId: string;
|
|
7
|
+
key: string;
|
|
8
|
+
sourceText: string;
|
|
9
|
+
namespace?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
kind?: 'ui' | 'content';
|
|
12
|
+
ofNode?: string;
|
|
13
|
+
ofField?: string;
|
|
14
|
+
ofShape?: string;
|
|
15
|
+
ofProperty?: string;
|
|
16
|
+
fromPackage?: string;
|
|
17
|
+
/** Force the override flag; when omitted it is derived (see upsertTranslationKey). */
|
|
18
|
+
overridden?: boolean;
|
|
19
|
+
format?: 'simple' | 'icu';
|
|
20
|
+
sourceLanguage?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TranslationUnitInput {
|
|
23
|
+
appId: string;
|
|
24
|
+
key: string;
|
|
25
|
+
language: string;
|
|
26
|
+
text: string;
|
|
27
|
+
state?: TranslationState;
|
|
28
|
+
updatedBy?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Who/what authored a unit write — recorded on its `applied` revision (AD-P). */
|
|
31
|
+
export interface TranslationAuthorship {
|
|
32
|
+
/** WebID of the human author, or the MT provider IRI. */
|
|
33
|
+
author?: string;
|
|
34
|
+
authorKind?: 'human' | 'machine';
|
|
35
|
+
/** MT provider key when authorKind is 'machine'. */
|
|
36
|
+
mtProvider?: string;
|
|
37
|
+
note?: string;
|
|
38
|
+
}
|
|
39
|
+
type TranslationKeyRow = Omit<TranslationEntryRecord, 'units'>;
|
|
40
|
+
type TranslationUnitRow = TranslationUnitRecord & {
|
|
41
|
+
ofKey?: {
|
|
42
|
+
key?: string;
|
|
43
|
+
};
|
|
44
|
+
ofKeyVersion?: string | {
|
|
45
|
+
id?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type TranslationKeyVersionRow = TranslationKeyVersionRecord & {
|
|
49
|
+
ofKey?: {
|
|
50
|
+
key?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type TranslationMemoryUnitRow = {
|
|
54
|
+
id?: string | {
|
|
55
|
+
id?: string;
|
|
56
|
+
};
|
|
57
|
+
language?: string;
|
|
58
|
+
text?: string;
|
|
59
|
+
state?: string;
|
|
60
|
+
updatedAt?: string;
|
|
61
|
+
ofKey?: {
|
|
62
|
+
key?: string;
|
|
63
|
+
};
|
|
64
|
+
ofKeyVersion?: string | {
|
|
65
|
+
id?: string;
|
|
66
|
+
sourceText?: string;
|
|
67
|
+
sourceHash?: string;
|
|
68
|
+
contractHash?: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Shared TM/carry-forward classifier (Plan 018 §5.5). Exact source matches may
|
|
73
|
+
* cross logical keys; changed-source carry-forward candidates never do.
|
|
74
|
+
*/
|
|
75
|
+
export declare function classifyTranslationMemoryMatches(input: {
|
|
76
|
+
key: string;
|
|
77
|
+
language: string;
|
|
78
|
+
currentVersion: TranslationKeyVersionRecord;
|
|
79
|
+
rows?: TranslationMemoryUnitRow[];
|
|
80
|
+
}): TranslationMemoryMatchRecord[];
|
|
81
|
+
/** Build the reviewed-unit index shown in the explicit TM browser. */
|
|
82
|
+
export declare function toTranslationMemoryRecords(rows?: TranslationMemoryUnitRow[]): TranslationMemoryRecord[];
|
|
83
|
+
/**
|
|
84
|
+
* Find current untranslated cells that can be filled without MT cost.
|
|
85
|
+
* Source AND argument-contract hashes must match; the current version can
|
|
86
|
+
* never source itself.
|
|
87
|
+
*/
|
|
88
|
+
export declare function findExactMemoryPretranslations(input: {
|
|
89
|
+
entries: TranslationEntryRecord[];
|
|
90
|
+
memory: TranslationMemoryRecord[];
|
|
91
|
+
language: string;
|
|
92
|
+
}): TranslationMemoryPretranslateCandidate[];
|
|
93
|
+
/**
|
|
94
|
+
* Convert LINKED query rows into a deterministic, serialization-safe editor
|
|
95
|
+
* contract. Exported for package-unit testing; it performs no I/O.
|
|
96
|
+
*/
|
|
97
|
+
export declare function groupTranslationEntries(keyRows?: TranslationKeyRow[], unitRows?: TranslationUnitRow[], versionRows?: TranslationKeyVersionRow[]): TranslationEntryRecord[];
|
|
98
|
+
/** App-scoped key read shared by the RPC provider and managed key-sync flows. */
|
|
99
|
+
export declare function listTranslationKeys(data: {
|
|
100
|
+
appId: string;
|
|
101
|
+
}): Promise<({
|
|
102
|
+
namespace: string;
|
|
103
|
+
} & {
|
|
104
|
+
id: string;
|
|
105
|
+
} & {
|
|
106
|
+
key: string;
|
|
107
|
+
} & {
|
|
108
|
+
sourceText: string;
|
|
109
|
+
} & {
|
|
110
|
+
description: string;
|
|
111
|
+
} & {
|
|
112
|
+
kind: string;
|
|
113
|
+
} & {
|
|
114
|
+
ofNode: string;
|
|
115
|
+
} & {
|
|
116
|
+
ofField: string;
|
|
117
|
+
} & {
|
|
118
|
+
ofShape: string;
|
|
119
|
+
} & {
|
|
120
|
+
ofProperty: string;
|
|
121
|
+
} & {
|
|
122
|
+
fromPackage: string;
|
|
123
|
+
} & {
|
|
124
|
+
overridden: boolean;
|
|
125
|
+
} & {
|
|
126
|
+
overridden: boolean;
|
|
127
|
+
} & {
|
|
128
|
+
format: string;
|
|
129
|
+
} & {
|
|
130
|
+
currentVersion: {
|
|
131
|
+
id: string;
|
|
132
|
+
};
|
|
133
|
+
})[]>;
|
|
134
|
+
/**
|
|
135
|
+
* App-scoped keys + grouped language units as plain records — the read behind
|
|
136
|
+
* the editor RPC AND the publish/compile flow (Plan 016 P2.3). No auth of its
|
|
137
|
+
* own (the RPC wrapper gates); callers on the server run it in request context.
|
|
138
|
+
*/
|
|
139
|
+
export declare function listTranslationEntries(data: {
|
|
140
|
+
appId: string;
|
|
141
|
+
}): Promise<TranslationEntryRecord[]>;
|
|
142
|
+
export declare function listTranslationKeyVersions(data: {
|
|
143
|
+
appId: string;
|
|
144
|
+
key?: string;
|
|
145
|
+
}): Promise<TranslationKeyVersionRecord[]>;
|
|
146
|
+
export declare function listTranslationReleases(data: {
|
|
147
|
+
appId: string;
|
|
148
|
+
}): Promise<TranslationReleaseRecord[]>;
|
|
149
|
+
export declare function createTranslationRelease(data: Omit<TranslationReleaseRecord, 'id' | 'createdAt'> & {
|
|
150
|
+
createdAt?: string;
|
|
151
|
+
}): Promise<TranslationReleaseRecord>;
|
|
152
|
+
export declare function advanceTranslationReleaseHotfix(data: {
|
|
153
|
+
id: string;
|
|
154
|
+
expectedSequence: number;
|
|
155
|
+
hotfixSequence: number;
|
|
156
|
+
manifestHash: string;
|
|
157
|
+
}): Promise<TranslationReleaseRecord>;
|
|
158
|
+
/**
|
|
159
|
+
* Convert LINKED revision rows into plain RPC-safe records, newest first.
|
|
160
|
+
* Exported for package-unit testing; performs no I/O.
|
|
161
|
+
*/
|
|
162
|
+
export declare function toRevisionRecords(rows?: Array<Record<string, unknown>>): TranslationRevisionRecord[];
|
|
163
|
+
export declare function getTranslationRevision(data: {
|
|
164
|
+
appId: string;
|
|
165
|
+
revisionId: string;
|
|
166
|
+
}): Promise<TranslationRevisionRecord | null>;
|
|
167
|
+
/** Pending human proposals for the app, optionally narrowed to one language. */
|
|
168
|
+
export declare function listTranslationProposals(data: {
|
|
169
|
+
appId: string;
|
|
170
|
+
language?: string;
|
|
171
|
+
}): Promise<TranslationRevisionRecord[]>;
|
|
172
|
+
export declare function decideTranslationProposal(data: {
|
|
173
|
+
appId: string;
|
|
174
|
+
revisionId: string;
|
|
175
|
+
decision: 'accept' | 'reject';
|
|
176
|
+
note?: string;
|
|
177
|
+
}, reviewer?: string): Promise<TranslationProposalDecision>;
|
|
178
|
+
/**
|
|
179
|
+
* Idempotent key write shared by the RPC provider and managed key-sync flows.
|
|
180
|
+
* Source drift marks every existing language unit stale before returning.
|
|
181
|
+
*/
|
|
182
|
+
export declare function upsertTranslationKey(data: TranslationKeyInput, authorship?: {
|
|
183
|
+
createdBy?: string;
|
|
184
|
+
}): Promise<{
|
|
185
|
+
id: string;
|
|
186
|
+
versionId: string;
|
|
187
|
+
versionCreated: boolean;
|
|
188
|
+
}>;
|
|
189
|
+
/**
|
|
190
|
+
* Append one revision WITHOUT touching the unit (Plan 017 AD-P) — the write
|
|
191
|
+
* path for MT SUGGESTIONS (Slice B) and translator PROPOSALS (Slice C): a
|
|
192
|
+
* pending value a reviewer/editor applies later. `basedOnText` should carry
|
|
193
|
+
* the unit text visible to the author, for conflict detection at decision time.
|
|
194
|
+
*/
|
|
195
|
+
export declare function createTranslationRevision(data: {
|
|
196
|
+
appId: string;
|
|
197
|
+
key: string;
|
|
198
|
+
language: string;
|
|
199
|
+
text: string;
|
|
200
|
+
status: TranslationRevisionStatus;
|
|
201
|
+
author?: string;
|
|
202
|
+
authorKind?: 'human' | 'machine';
|
|
203
|
+
mtProvider?: string;
|
|
204
|
+
basedOnText?: string;
|
|
205
|
+
note?: string;
|
|
206
|
+
}): Promise<{
|
|
207
|
+
id: string;
|
|
208
|
+
}>;
|
|
209
|
+
/**
|
|
210
|
+
* Idempotent unit write shared by the RPC provider, import, and (P4) MT flows.
|
|
211
|
+
* Every write that CHANGES the text also records an append-only
|
|
212
|
+
* `status:'applied'` `TranslationRevision` (Plan 017 AD-P) carrying the
|
|
213
|
+
* previous text as `basedOnText` — the audit trail behind the history UI.
|
|
214
|
+
* Re-saving identical text updates state/provenance without a revision.
|
|
215
|
+
*/
|
|
216
|
+
export declare function upsertTranslationUnit(data: TranslationUnitInput, authorship?: TranslationAuthorship): Promise<{
|
|
217
|
+
id: string;
|
|
218
|
+
revisionId?: string;
|
|
219
|
+
}>;
|
|
220
|
+
/** One app-scoped lookup powers both exact TM and same-key carry-forward. */
|
|
221
|
+
export declare function listTranslationMemoryMatches(data: {
|
|
222
|
+
appId: string;
|
|
223
|
+
key: string;
|
|
224
|
+
language: string;
|
|
225
|
+
}): Promise<TranslationMemoryMatchRecord[]>;
|
|
226
|
+
/** App-scoped reviewed-unit index for search, audit, and exact reuse. */
|
|
227
|
+
export declare function listTranslationMemory(data: {
|
|
228
|
+
appId: string;
|
|
229
|
+
}): Promise<TranslationMemoryRecord[]>;
|
|
230
|
+
/** Preview or apply every safe exact-match TM candidate for one language. */
|
|
231
|
+
export declare function pretranslateFromMemory(data: {
|
|
232
|
+
appId: string;
|
|
233
|
+
language: string;
|
|
234
|
+
dryRun?: boolean;
|
|
235
|
+
}, authorship?: {
|
|
236
|
+
author?: string;
|
|
237
|
+
}): Promise<TranslationMemoryPretranslateReport>;
|
|
238
|
+
/** App-data termbase read shared by Studio, MT, and publish quality gates. */
|
|
239
|
+
export declare function listGlossaryTerms(data: {
|
|
240
|
+
appId: string;
|
|
241
|
+
}): Promise<GlossaryTermRecord[]>;
|
|
242
|
+
/**
|
|
243
|
+
* Apply a server-validated memory candidate. Exact matches retain `machine`
|
|
244
|
+
* state and `tm` provenance; changed-source carry-forward is an explicit
|
|
245
|
+
* reviewer action and becomes reviewed.
|
|
246
|
+
*/
|
|
247
|
+
export declare function applyTranslationMemoryMatch(data: {
|
|
248
|
+
appId: string;
|
|
249
|
+
key: string;
|
|
250
|
+
language: string;
|
|
251
|
+
unitId: string;
|
|
252
|
+
}, authorship?: {
|
|
253
|
+
author?: string;
|
|
254
|
+
}): Promise<TranslationUnitRecord>;
|
|
255
|
+
/** Server boundary for app-scoped translation keys and language units. */
|
|
256
|
+
export declare class TranslationProvider extends ShapeProvider {
|
|
257
|
+
shape: typeof TranslationKey;
|
|
258
|
+
/**
|
|
259
|
+
* Authoring gate. Reads `linkedAuth` off the request the LINKED server already
|
|
260
|
+
* populates — framework-level, so this stays portable (no CN/create-now-js
|
|
261
|
+
* import, AD-G). Anonymous callers can no longer read or write an app's
|
|
262
|
+
* translation content via `/call`. Fine-grained "is translation enabled for
|
|
263
|
+
* this app + is the caller a project member" gating is a Create Now concern and
|
|
264
|
+
* is enforced additionally at the CN route layer (`isTranslationEnabledForApp`).
|
|
265
|
+
* `getMessages` intentionally stays public — it is the app's runtime string
|
|
266
|
+
* fetch, not an authoring surface.
|
|
267
|
+
*/
|
|
268
|
+
private requireAuthor;
|
|
269
|
+
private requireAccess;
|
|
270
|
+
listKeys(data: {
|
|
271
|
+
appId: string;
|
|
272
|
+
}): Promise<({
|
|
273
|
+
namespace: string;
|
|
274
|
+
} & {
|
|
275
|
+
id: string;
|
|
276
|
+
} & {
|
|
277
|
+
key: string;
|
|
278
|
+
} & {
|
|
279
|
+
sourceText: string;
|
|
280
|
+
} & {
|
|
281
|
+
description: string;
|
|
282
|
+
} & {
|
|
283
|
+
kind: string;
|
|
284
|
+
} & {
|
|
285
|
+
ofNode: string;
|
|
286
|
+
} & {
|
|
287
|
+
ofField: string;
|
|
288
|
+
} & {
|
|
289
|
+
ofShape: string;
|
|
290
|
+
} & {
|
|
291
|
+
ofProperty: string;
|
|
292
|
+
} & {
|
|
293
|
+
fromPackage: string;
|
|
294
|
+
} & {
|
|
295
|
+
overridden: boolean;
|
|
296
|
+
} & {
|
|
297
|
+
overridden: boolean;
|
|
298
|
+
} & {
|
|
299
|
+
format: string;
|
|
300
|
+
} & {
|
|
301
|
+
currentVersion: {
|
|
302
|
+
id: string;
|
|
303
|
+
};
|
|
304
|
+
})[]>;
|
|
305
|
+
listEntries(data: {
|
|
306
|
+
appId: string;
|
|
307
|
+
}): Promise<TranslationEntryRecord[]>;
|
|
308
|
+
listKeyVersions(data: {
|
|
309
|
+
appId: string;
|
|
310
|
+
key?: string;
|
|
311
|
+
}): Promise<TranslationKeyVersionRecord[]>;
|
|
312
|
+
listMemoryMatches(data: {
|
|
313
|
+
appId: string;
|
|
314
|
+
key: string;
|
|
315
|
+
language: string;
|
|
316
|
+
}): Promise<TranslationMemoryMatchRecord[]>;
|
|
317
|
+
proposeRevision(data: {
|
|
318
|
+
appId: string;
|
|
319
|
+
key: string;
|
|
320
|
+
language: string;
|
|
321
|
+
text: string;
|
|
322
|
+
basedOnText?: string;
|
|
323
|
+
note?: string;
|
|
324
|
+
}): Promise<{
|
|
325
|
+
id: string;
|
|
326
|
+
}>;
|
|
327
|
+
listProposals(data: {
|
|
328
|
+
appId: string;
|
|
329
|
+
language?: string;
|
|
330
|
+
}): Promise<TranslationRevisionRecord[]>;
|
|
331
|
+
decideProposal(data: {
|
|
332
|
+
appId: string;
|
|
333
|
+
revisionId: string;
|
|
334
|
+
decision: 'accept' | 'reject';
|
|
335
|
+
note?: string;
|
|
336
|
+
}): Promise<TranslationProposalDecision>;
|
|
337
|
+
listMemory(data: {
|
|
338
|
+
appId: string;
|
|
339
|
+
}): Promise<TranslationMemoryRecord[]>;
|
|
340
|
+
pretranslateMemory(data: {
|
|
341
|
+
appId: string;
|
|
342
|
+
language: string;
|
|
343
|
+
dryRun?: boolean;
|
|
344
|
+
}): Promise<TranslationMemoryPretranslateReport>;
|
|
345
|
+
applyMemoryMatch(data: {
|
|
346
|
+
appId: string;
|
|
347
|
+
key: string;
|
|
348
|
+
language: string;
|
|
349
|
+
unitId: string;
|
|
350
|
+
}): Promise<TranslationUnitRecord>;
|
|
351
|
+
listReleases(data: {
|
|
352
|
+
appId: string;
|
|
353
|
+
}): Promise<TranslationReleaseRecord[]>;
|
|
354
|
+
createRelease(data: Omit<TranslationReleaseRecord, 'id' | 'createdAt'> & {
|
|
355
|
+
createdAt?: string;
|
|
356
|
+
}): Promise<TranslationReleaseRecord>;
|
|
357
|
+
advanceReleaseHotfix(data: {
|
|
358
|
+
id: string;
|
|
359
|
+
expectedSequence: number;
|
|
360
|
+
hotfixSequence: number;
|
|
361
|
+
manifestHash: string;
|
|
362
|
+
}): Promise<TranslationReleaseRecord>;
|
|
363
|
+
upsertKey(data: TranslationKeyInput): Promise<{
|
|
364
|
+
id: string;
|
|
365
|
+
}>;
|
|
366
|
+
/** WebID of the signed-in caller — never trust a client-supplied author. */
|
|
367
|
+
private authorIri;
|
|
368
|
+
upsertUnit(data: TranslationUnitInput): Promise<{
|
|
369
|
+
id: string;
|
|
370
|
+
}>;
|
|
371
|
+
/**
|
|
372
|
+
* Glossary CRUD (Plan 017 Slice B). App-data is branch-routed per app, so
|
|
373
|
+
* every GlossaryTerm in context belongs to the calling app; the appId only
|
|
374
|
+
* anchors the IRIs. Uniqueness = (term, language) — upsert is
|
|
375
|
+
* delete-then-create on that identity.
|
|
376
|
+
*/
|
|
377
|
+
listGlossary(data: {
|
|
378
|
+
appId: string;
|
|
379
|
+
}): Promise<GlossaryTermRecord[]>;
|
|
380
|
+
upsertGlossaryTerm(data: {
|
|
381
|
+
appId: string;
|
|
382
|
+
term: string;
|
|
383
|
+
termType?: 'prefer' | 'require' | 'keep' | 'forbid';
|
|
384
|
+
translation?: string;
|
|
385
|
+
useInstead?: string;
|
|
386
|
+
language?: string;
|
|
387
|
+
caseSensitive?: boolean;
|
|
388
|
+
description?: string;
|
|
389
|
+
}): Promise<{
|
|
390
|
+
id: string;
|
|
391
|
+
}>;
|
|
392
|
+
deleteGlossaryTerm(data: {
|
|
393
|
+
appId: string;
|
|
394
|
+
id: string;
|
|
395
|
+
}): Promise<{
|
|
396
|
+
deleted: boolean;
|
|
397
|
+
}>;
|
|
398
|
+
/** History for one (key, language) cell — newest first (Plan 017 AD-P). */
|
|
399
|
+
listRevisions(data: {
|
|
400
|
+
appId: string;
|
|
401
|
+
key: string;
|
|
402
|
+
language: string;
|
|
403
|
+
}): Promise<TranslationRevisionRecord[]>;
|
|
404
|
+
getMessages(data: {
|
|
405
|
+
appId: string;
|
|
406
|
+
language: string;
|
|
407
|
+
}): Promise<TranslationMessages>;
|
|
408
|
+
}
|
|
409
|
+
export {};
|