@tandem-language-exchange/content-store 1.2.1 → 1.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 +38 -27
- package/dist/chunk-4DE47ZJD.js +19 -0
- package/dist/chunk-4DE47ZJD.js.map +1 -0
- package/dist/{chunk-OTZLCMZ6.js → chunk-6FXNAJSI.js} +37 -15
- package/dist/chunk-6FXNAJSI.js.map +1 -0
- package/dist/{chunk-PQJ2MGH7.js → chunk-BAJT7RMQ.js} +5 -3
- package/dist/{chunk-PQJ2MGH7.js.map → chunk-BAJT7RMQ.js.map} +1 -1
- package/dist/chunk-UPIQFNCR.js +17 -0
- package/dist/chunk-UPIQFNCR.js.map +1 -0
- package/dist/{chunk-LOCC2BXB.js → chunk-VKXN2SE6.js} +16 -20
- package/dist/chunk-VKXN2SE6.js.map +1 -0
- package/dist/client/fetch-content-bundles.js +6 -3
- package/dist/client/fetch-content-bundles.js.map +1 -1
- package/dist/client/fetch-merged-translation-bundles.js +19 -13
- package/dist/client/fetch-merged-translation-bundles.js.map +1 -1
- package/dist/client/fetch-translation-bundles.js +19 -15
- package/dist/client/fetch-translation-bundles.js.map +1 -1
- package/dist/client/query-cms.js +33 -0
- package/dist/client/query-cms.js.map +1 -0
- package/dist/{index-kfqHGgMO.d.ts → index-PQ7XN47c.d.ts} +23 -9
- package/dist/index.d.ts +1 -1
- package/dist/node.browser.js.map +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.js +50 -8
- package/dist/node.js.map +1 -1
- package/package.json +5 -4
- package/dist/chunk-LOCC2BXB.js.map +0 -1
- package/dist/chunk-OTZLCMZ6.js.map +0 -1
- package/dist/client/cli.js +0 -82
- package/dist/client/cli.js.map +0 -1
package/README.md
CHANGED
|
@@ -111,16 +111,19 @@ Downloads translation objects from S3. The **sync** stores each Lingohub file **
|
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
113
|
const files = await sdk.fetchTranslationBundles({
|
|
114
|
-
projects:
|
|
114
|
+
projects: {
|
|
115
|
+
'tandem': [], // all resources
|
|
116
|
+
'tandem-(website)': ['main', 'ai'], // only "main" and "ai" resources
|
|
117
|
+
},
|
|
115
118
|
locales: ['en', 'de'], // omit or leave empty to use the package default locale list
|
|
116
119
|
});
|
|
117
120
|
```
|
|
118
121
|
|
|
119
|
-
**Parameters:**
|
|
122
|
+
**Parameters (extends `TranslationFilterConfig`):**
|
|
120
123
|
|
|
121
124
|
| Field | Type | Description |
|
|
122
125
|
| --- | --- | --- |
|
|
123
|
-
| `projects` | `string[]
|
|
126
|
+
| `projects` | `Record<string, string[]>` | Map of Lingohub project id to resource keys. An empty array fetches **all** resources for that project; a populated array fetches only the listed resources (matched against the `resource` field in `src/shared/lingohub.ts`). |
|
|
124
127
|
| `locales` | `string[]` | Optional. Locale codes to fetch (e.g. `pt-br`, `zh-hans`). If omitted or empty, a built-in default list is used. |
|
|
125
128
|
| `retry` | `S3RetryConfig` | Optional. Overrides [S3 download retries](#s3-download-retries). |
|
|
126
129
|
|
|
@@ -149,7 +152,10 @@ Same **`projects`**, **`locales`**, and **`retry`** as `fetchTranslationBundles`
|
|
|
149
152
|
|
|
150
153
|
```typescript
|
|
151
154
|
const mergedPaths = await sdk.fetchMergedTranslationBundles({
|
|
152
|
-
projects:
|
|
155
|
+
projects: {
|
|
156
|
+
'tandem-(new-website)': [],
|
|
157
|
+
'tandem-(website)': ['main'],
|
|
158
|
+
},
|
|
153
159
|
locales: ['en'],
|
|
154
160
|
});
|
|
155
161
|
// mergedPaths.en → path to one big en.json
|
|
@@ -329,13 +335,13 @@ await fetchCmsBundles(store, './content-cache', {
|
|
|
329
335
|
});
|
|
330
336
|
|
|
331
337
|
await fetchTranslationBundles(store, './content-cache', {
|
|
332
|
-
projects:
|
|
338
|
+
projects: { 'tandem-(website)': [] },
|
|
333
339
|
locales: ['en', 'fr'],
|
|
334
340
|
retry: getDefaultS3RetryConfig(),
|
|
335
341
|
});
|
|
336
342
|
|
|
337
343
|
await fetchMergedTranslationBundles(store, './content-cache/merged', {
|
|
338
|
-
projects:
|
|
344
|
+
projects: { 'tandem-(new-website)': [], 'tandem-(website)': ['main'] },
|
|
339
345
|
locales: ['en'],
|
|
340
346
|
});
|
|
341
347
|
|
|
@@ -368,7 +374,7 @@ await sdk.fetchCmsBundles({
|
|
|
368
374
|
|
|
369
375
|
// Optional: pull translation bundles written by the Lingohub → S3 sync
|
|
370
376
|
await sdk.fetchTranslationBundles({
|
|
371
|
-
projects:
|
|
377
|
+
projects: { 'tandem-(website)': [] },
|
|
372
378
|
});
|
|
373
379
|
|
|
374
380
|
// 2. Query CMS bundle locally — no further network calls
|
|
@@ -383,7 +389,7 @@ console.log(grids);
|
|
|
383
389
|
```
|
|
384
390
|
## CLI
|
|
385
391
|
|
|
386
|
-
The package ships **`fetch-content-bundles`**, **`fetch-translation-bundles`**, and **`fetch-merged-translation-bundles`** as **`bin`** commands.
|
|
392
|
+
The package ships **`fetch-content-bundles`**, **`fetch-translation-bundles`**, and **`fetch-merged-translation-bundles`** as **`bin`** commands. The **`query-cms`** command lives at **`dist/client/query-cms.js`**; run with **`node node_modules/@tandem-language-exchange/content-store/dist/client/query-cms.js`** or via npm scripts.
|
|
387
393
|
|
|
388
394
|
### `fetch-content-bundles` — download bundles from S3
|
|
389
395
|
|
|
@@ -413,35 +419,40 @@ All **`bin`** tools read S3 settings from [S3 config via environment variables](
|
|
|
413
419
|
|
|
414
420
|
### `fetch-translation-bundles`
|
|
415
421
|
|
|
422
|
+
Both translation CLI commands accept a **`--config`** flag pointing to a JSON config file that defines which projects, resources, and locales to fetch.
|
|
423
|
+
|
|
424
|
+
**Config file format (`TranslationFilterConfig`):**
|
|
425
|
+
|
|
426
|
+
```json
|
|
427
|
+
{
|
|
428
|
+
"projects": {
|
|
429
|
+
"tandem": [],
|
|
430
|
+
"tandem-(website)": ["main", "ai"]
|
|
431
|
+
},
|
|
432
|
+
"locales": ["en", "de", "it"]
|
|
433
|
+
}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
- **`projects`** — map of Lingohub project id to resource keys. An empty array (`[]`) fetches **all** resources for that project. A populated array fetches only the listed resources (matched against the `resource` field in `src/shared/lingohub.ts`).
|
|
437
|
+
- **`locales`** — optional. Omit or leave empty to use the built-in default locale list.
|
|
438
|
+
|
|
416
439
|
```bash
|
|
417
|
-
npx fetch-translation-bundles --
|
|
440
|
+
npx fetch-translation-bundles --config ./translation-config.json --output ./content-cache
|
|
418
441
|
```
|
|
419
442
|
|
|
420
443
|
| Flag | Required | Default | Description |
|
|
421
444
|
| --- | --- | --- | --- |
|
|
422
|
-
| `--
|
|
423
|
-
| `--locales <list>` | No | | Comma-separated locales; omit to use the built-in default list |
|
|
445
|
+
| `--config <path>` | Yes | | Path to a JSON config file (`TranslationFilterConfig`) |
|
|
424
446
|
| `--output <dir>` | No | `./content-cache` | Output directory |
|
|
425
447
|
|
|
426
|
-
**zsh / bash:** Project ids often contain **`(`** and **`)`**. You must **quote** the argument when using `=` form, or use a space so the value is a separate token:
|
|
427
|
-
|
|
428
|
-
```bash
|
|
429
|
-
# Good — quoted
|
|
430
|
-
fetch-translation-bundles --projects='tandem-(new-website)' --output=src/data/cache
|
|
431
|
-
|
|
432
|
-
# Good — space form (value quoted or unambiguous)
|
|
433
|
-
fetch-translation-bundles --projects 'tandem-(new-website)' --output src/data/cache
|
|
434
|
-
|
|
435
|
-
# Bad in zsh — unquoted parentheses are shell syntax
|
|
436
|
-
fetch-translation-bundles --projects=tandem-(new-website) --output=src/data/cache
|
|
437
|
-
```
|
|
438
|
-
|
|
439
448
|
### `fetch-merged-translation-bundles`
|
|
440
449
|
|
|
441
450
|
Writes merged **`{locale}.json`** files (string key/value map; duplicate keys: last wins).
|
|
442
451
|
|
|
452
|
+
Uses the same config file format as `fetch-translation-bundles`.
|
|
453
|
+
|
|
443
454
|
```bash
|
|
444
|
-
npx fetch-merged-translation-bundles --
|
|
455
|
+
npx fetch-merged-translation-bundles --config ./translation-config.json --output ./content-cache/merged
|
|
445
456
|
```
|
|
446
457
|
|
|
447
458
|
Alternatively call **`fetchTranslationBundles`** / **`fetchMergedTranslationBundles`** from a Node script, or use the server’s **`POST /getTranslationBundles`** API (see [Server & CLI README](src/server/README.md)).
|
|
@@ -451,7 +462,7 @@ Alternatively call **`fetchTranslationBundles`** / **`fetchMergedTranslationBund
|
|
|
451
462
|
Reads a previously fetched bundle from disk and prints JSON to stdout. This command is **not** a separate `bin`; run the built client CLI (after `npm install` of this package):
|
|
452
463
|
|
|
453
464
|
```bash
|
|
454
|
-
node node_modules/@tandem-language-exchange/content-store/dist/client/
|
|
465
|
+
node node_modules/@tandem-language-exchange/content-store/dist/client/query-cms.js \
|
|
455
466
|
--cms contentful --type gridLayout \
|
|
456
467
|
--fields '{"columns":"2"}' \
|
|
457
468
|
--select title,bodyBefore \
|
|
@@ -463,7 +474,7 @@ node node_modules/@tandem-language-exchange/content-store/dist/client/cli.js que
|
|
|
463
474
|
|
|
464
475
|
```json
|
|
465
476
|
"scripts": {
|
|
466
|
-
"query:cms": "node ./node_modules/@tandem-language-exchange/content-store/dist/client/
|
|
477
|
+
"query:cms": "node ./node_modules/@tandem-language-exchange/content-store/dist/client/query-cms.js"
|
|
467
478
|
}
|
|
468
479
|
```
|
|
469
480
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/shared/config.ts
|
|
4
|
+
import dotenv from "dotenv";
|
|
5
|
+
dotenv.config({ path: ".env.local" });
|
|
6
|
+
dotenv.config();
|
|
7
|
+
var config = {
|
|
8
|
+
s3: {
|
|
9
|
+
bucket: process.env.CONTENT_STORE_S3_BUCKET ?? "",
|
|
10
|
+
region: process.env.CONTENT_STORE_S3_REGION ?? "eu-central-1",
|
|
11
|
+
accessKeyId: process.env.AWS_ACCESS_KEY ?? "",
|
|
12
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? ""
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
config
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-4DE47ZJD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/config.ts"],"sourcesContent":["import dotenv from 'dotenv';\nimport type { S3Config, CMSProvider } from './types';\n\ndotenv.config({ path: '.env.local' });\ndotenv.config();\n\nexport type { CMSProvider, S3Config };\n\nexport interface SharedConfig {\n s3: S3Config;\n}\n\nexport const config: SharedConfig = {\n s3: {\n bucket: process.env.CONTENT_STORE_S3_BUCKET ?? '',\n region: process.env.CONTENT_STORE_S3_REGION ?? 'eu-central-1',\n accessKeyId: process.env.AWS_ACCESS_KEY ?? '',\n secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '',\n }\n};\n"],"mappings":";;;AAAA,OAAO,YAAY;AAGnB,OAAO,OAAO,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,OAAO;AAQP,IAAM,SAAuB;AAAA,EAChC,IAAI;AAAA,IACA,QAAQ,QAAQ,IAAI,2BAA2B;AAAA,IAC/C,QAAQ,QAAQ,IAAI,2BAA2B;AAAA,IAC/C,aAAa,QAAQ,IAAI,kBAAkB;AAAA,IAC3C,iBAAiB,QAAQ,IAAI,yBAAyB;AAAA,EAC1D;AACJ;","names":[]}
|
|
@@ -84,41 +84,49 @@ var localeMapping = {
|
|
|
84
84
|
var allProjects = {
|
|
85
85
|
"tandem-(new-website)": [
|
|
86
86
|
{
|
|
87
|
+
resource: "main",
|
|
87
88
|
fileName: "Website.[locale].json",
|
|
88
89
|
type: "json"
|
|
89
90
|
}
|
|
90
91
|
],
|
|
91
92
|
"tandem-(website)": [
|
|
92
93
|
{
|
|
94
|
+
resource: "main",
|
|
93
95
|
fileName: "[locale].json",
|
|
94
96
|
type: "json"
|
|
95
97
|
},
|
|
96
98
|
{
|
|
99
|
+
resource: "ai",
|
|
97
100
|
fileName: "AI.[locale].json",
|
|
98
101
|
type: "json"
|
|
99
102
|
},
|
|
100
103
|
{
|
|
104
|
+
resource: "languages",
|
|
101
105
|
fileName: "languages.[locale].json",
|
|
102
106
|
type: "json"
|
|
103
107
|
}
|
|
104
108
|
],
|
|
105
109
|
"tandem": [
|
|
106
110
|
{
|
|
111
|
+
resource: "infoplist",
|
|
107
112
|
fileName: "InfoPlist.[locale].strings",
|
|
108
113
|
type: "strings",
|
|
109
114
|
localeMapping: localeMapping.ios
|
|
110
115
|
},
|
|
111
116
|
{
|
|
117
|
+
resource: "localizable",
|
|
112
118
|
fileName: "Localizable.[locale].strings",
|
|
113
119
|
type: "strings",
|
|
114
120
|
localeMapping: localeMapping.ios
|
|
115
121
|
},
|
|
116
122
|
{
|
|
123
|
+
resource: "ipad",
|
|
117
124
|
fileName: "MainiPad.[locale].strings",
|
|
118
125
|
type: "strings",
|
|
119
126
|
localeMapping: localeMapping.ios
|
|
120
127
|
},
|
|
121
128
|
{
|
|
129
|
+
resource: "main",
|
|
122
130
|
fileName: "Main.[locale].strings",
|
|
123
131
|
type: "strings",
|
|
124
132
|
localeMapping: localeMapping.ios
|
|
@@ -126,136 +134,163 @@ var allProjects = {
|
|
|
126
134
|
],
|
|
127
135
|
"tandem-(android)": [
|
|
128
136
|
{
|
|
137
|
+
resource: "accessibility",
|
|
129
138
|
fileName: "accessibility_localizable.[locale].xml",
|
|
130
139
|
type: "xml",
|
|
131
140
|
localeMapping: localeMapping.android
|
|
132
141
|
},
|
|
133
142
|
{
|
|
143
|
+
resource: "call",
|
|
134
144
|
fileName: "call_localizable.[locale].xml",
|
|
135
145
|
type: "xml",
|
|
136
146
|
localeMapping: localeMapping.android
|
|
137
147
|
},
|
|
138
148
|
{
|
|
149
|
+
resource: "cert",
|
|
139
150
|
fileName: "cert_localizable.[locale].xml",
|
|
140
151
|
type: "xml",
|
|
141
152
|
localeMapping: localeMapping.android
|
|
142
153
|
},
|
|
143
154
|
{
|
|
155
|
+
resource: "chat",
|
|
144
156
|
fileName: "chat_localizable.[locale].xml",
|
|
145
157
|
type: "xml",
|
|
146
158
|
localeMapping: localeMapping.android
|
|
147
159
|
},
|
|
148
160
|
{
|
|
161
|
+
resource: "checklist",
|
|
149
162
|
fileName: "checklist_localizable.[locale].xml",
|
|
150
163
|
type: "xml",
|
|
151
164
|
localeMapping: localeMapping.android
|
|
152
165
|
},
|
|
153
166
|
{
|
|
167
|
+
resource: "clubs",
|
|
154
168
|
fileName: "clubs_localizable.[locale].xml",
|
|
155
169
|
type: "xml",
|
|
156
170
|
localeMapping: localeMapping.android
|
|
157
171
|
},
|
|
158
172
|
{
|
|
173
|
+
resource: "common",
|
|
159
174
|
fileName: "common_localizable.[locale].xml",
|
|
160
175
|
type: "xml",
|
|
161
176
|
localeMapping: localeMapping.android
|
|
162
177
|
},
|
|
163
178
|
{
|
|
179
|
+
resource: "community",
|
|
164
180
|
fileName: "community_localizable.[locale].xml",
|
|
165
181
|
type: "xml",
|
|
166
182
|
localeMapping: localeMapping.android
|
|
167
183
|
},
|
|
168
184
|
{
|
|
185
|
+
resource: "correction",
|
|
169
186
|
fileName: "correction_localizable.[locale].xml",
|
|
170
187
|
type: "xml",
|
|
171
188
|
localeMapping: localeMapping.android
|
|
172
189
|
},
|
|
173
190
|
{
|
|
191
|
+
resource: "country_names",
|
|
174
192
|
fileName: "country_names.[locale].xml",
|
|
175
193
|
type: "xml",
|
|
176
194
|
localeMapping: localeMapping.android
|
|
177
195
|
},
|
|
178
196
|
{
|
|
197
|
+
resource: "emoji",
|
|
179
198
|
fileName: "emoji_localizable.[locale].xml",
|
|
180
199
|
type: "xml",
|
|
181
200
|
localeMapping: localeMapping.android
|
|
182
201
|
},
|
|
183
202
|
{
|
|
203
|
+
resource: "errors",
|
|
184
204
|
fileName: "errors_localizable.[locale].xml",
|
|
185
205
|
type: "xml",
|
|
186
206
|
localeMapping: localeMapping.android
|
|
187
207
|
},
|
|
188
208
|
{
|
|
209
|
+
resource: "expressions",
|
|
189
210
|
fileName: "expressions_localizable.[locale].xml",
|
|
190
211
|
type: "xml",
|
|
191
212
|
localeMapping: localeMapping.android
|
|
192
213
|
},
|
|
193
214
|
{
|
|
215
|
+
resource: "gif",
|
|
194
216
|
fileName: "gif_localizable.[locale].xml",
|
|
195
217
|
type: "xml",
|
|
196
218
|
localeMapping: localeMapping.android
|
|
197
219
|
},
|
|
198
220
|
{
|
|
221
|
+
resource: "guidelines",
|
|
199
222
|
fileName: "guidelines_localizable.[locale].xml",
|
|
200
223
|
type: "xml",
|
|
201
224
|
localeMapping: localeMapping.android
|
|
202
225
|
},
|
|
203
226
|
{
|
|
227
|
+
resource: "lanuguages",
|
|
204
228
|
fileName: "languages_localizable.[locale].xml",
|
|
205
229
|
type: "xml",
|
|
206
230
|
localeMapping: localeMapping.android
|
|
207
231
|
},
|
|
208
232
|
{
|
|
233
|
+
resource: "localizable",
|
|
209
234
|
fileName: "localizable.[locale].xml",
|
|
210
235
|
type: "xml",
|
|
211
236
|
localeMapping: localeMapping.android
|
|
212
237
|
},
|
|
213
238
|
{
|
|
239
|
+
resource: "localizable2",
|
|
214
240
|
fileName: "localizable2.[locale].xml",
|
|
215
241
|
type: "xml",
|
|
216
242
|
localeMapping: localeMapping.android
|
|
217
243
|
},
|
|
218
244
|
{
|
|
245
|
+
resource: "login",
|
|
219
246
|
fileName: "login_localizable.[locale].xml",
|
|
220
247
|
type: "xml",
|
|
221
248
|
localeMapping: localeMapping.android
|
|
222
249
|
},
|
|
223
250
|
{
|
|
251
|
+
resource: "myprofile",
|
|
224
252
|
fileName: "myprofile_localizable.[locale].xml",
|
|
225
253
|
type: "xml",
|
|
226
254
|
localeMapping: localeMapping.android
|
|
227
255
|
},
|
|
228
256
|
{
|
|
257
|
+
resource: "onb",
|
|
229
258
|
fileName: "onb_localizable.[locale].xml",
|
|
230
259
|
type: "xml",
|
|
231
260
|
localeMapping: localeMapping.android
|
|
232
261
|
},
|
|
233
262
|
{
|
|
263
|
+
resource: "parties",
|
|
234
264
|
fileName: "parties_localizable.[locale].xml",
|
|
235
265
|
type: "xml",
|
|
236
266
|
localeMapping: localeMapping.android
|
|
237
267
|
},
|
|
238
268
|
{
|
|
269
|
+
resource: "pro",
|
|
239
270
|
fileName: "pro_localizable.[locale].xml",
|
|
240
271
|
type: "xml",
|
|
241
272
|
localeMapping: localeMapping.android
|
|
242
273
|
},
|
|
243
274
|
{
|
|
275
|
+
resource: "pro_screen",
|
|
244
276
|
fileName: "pro_screen_localizable.[locale].xml",
|
|
245
277
|
type: "xml",
|
|
246
278
|
localeMapping: localeMapping.android
|
|
247
279
|
},
|
|
248
280
|
{
|
|
281
|
+
resource: "push_notification",
|
|
249
282
|
fileName: "push_notification_localizable.[locale].xml",
|
|
250
283
|
type: "xml",
|
|
251
284
|
localeMapping: localeMapping.android
|
|
252
285
|
},
|
|
253
286
|
{
|
|
287
|
+
resource: "reporting",
|
|
254
288
|
fileName: "reporting_localizable.[locale].xml",
|
|
255
289
|
type: "xml",
|
|
256
290
|
localeMapping: localeMapping.android
|
|
257
291
|
},
|
|
258
292
|
{
|
|
293
|
+
resource: "translation",
|
|
259
294
|
fileName: "translation_localizable.[locale].xml",
|
|
260
295
|
type: "xml",
|
|
261
296
|
localeMapping: localeMapping.android
|
|
@@ -263,6 +298,7 @@ var allProjects = {
|
|
|
263
298
|
],
|
|
264
299
|
"tandem-(web-invites)": [
|
|
265
300
|
{
|
|
301
|
+
resource: "main",
|
|
266
302
|
fileName: "[locale].json",
|
|
267
303
|
type: "json"
|
|
268
304
|
}
|
|
@@ -368,21 +404,7 @@ function translationJsonOutputPath(outputDir, objectKey) {
|
|
|
368
404
|
return path.resolve(outputDir, `${objectKey}.json`);
|
|
369
405
|
}
|
|
370
406
|
|
|
371
|
-
// src/shared/config.ts
|
|
372
|
-
import dotenv from "dotenv";
|
|
373
|
-
dotenv.config({ path: ".env.local" });
|
|
374
|
-
dotenv.config();
|
|
375
|
-
var config = {
|
|
376
|
-
s3: {
|
|
377
|
-
bucket: process.env.CONTENT_STORE_S3_BUCKET ?? "",
|
|
378
|
-
region: process.env.CONTENT_STORE_S3_REGION ?? "eu-central-1",
|
|
379
|
-
accessKeyId: process.env.AWS_ACCESS_KEY ?? "",
|
|
380
|
-
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? ""
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
|
|
384
407
|
export {
|
|
385
|
-
config,
|
|
386
408
|
ContentStore,
|
|
387
409
|
buildCmsObjectKey,
|
|
388
410
|
buildTranslationObjectKey,
|
|
@@ -393,4 +415,4 @@ export {
|
|
|
393
415
|
toFlatStringMap,
|
|
394
416
|
translationJsonOutputPath
|
|
395
417
|
};
|
|
396
|
-
//# sourceMappingURL=chunk-
|
|
418
|
+
//# sourceMappingURL=chunk-6FXNAJSI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/s3.ts","../src/shared/lingohub.ts","../src/shared/translationResource.ts","../src/shared/utils.ts"],"sourcesContent":["import {\n S3Client,\n PutObjectCommand,\n GetObjectCommand,\n} from '@aws-sdk/client-s3';\nimport type { S3Config } from './types';\n\nexport class ContentStore {\n private client: S3Client;\n private bucket: string;\n\n constructor(cfg: S3Config) {\n this.client = new S3Client({\n region: cfg.region,\n credentials: {\n accessKeyId: cfg.accessKeyId,\n secretAccessKey: cfg.secretAccessKey,\n },\n });\n this.bucket = cfg.bucket;\n }\n\n async upload(key: string, data: unknown): Promise<string> {\n await this.client.send(\n new PutObjectCommand({\n Bucket: this.bucket,\n Key: key,\n Body: JSON.stringify(data, null, 2),\n ContentType: 'application/json',\n }),\n );\n return key;\n }\n\n /** Raw UTF-8 body (e.g. Lingohub file bytes as text). */\n async uploadRaw(\n key: string,\n body: string,\n contentType: string,\n ): Promise<string> {\n await this.client.send(\n new PutObjectCommand({\n Bucket: this.bucket,\n Key: key,\n Body: body,\n ContentType: contentType,\n }),\n );\n return key;\n }\n\n async download(key: string): Promise<unknown> {\n const response = await this.client.send(\n new GetObjectCommand({ Bucket: this.bucket, Key: key }),\n );\n const body = await response.Body?.transformToString();\n if (!body) throw new Error(`Empty response for key: ${key}`);\n return JSON.parse(body);\n }\n\n /** Raw UTF-8 body from S3 (no JSON.parse). */\n async downloadRaw(key: string): Promise<string> {\n const response = await this.client.send(\n new GetObjectCommand({ Bucket: this.bucket, Key: key }),\n );\n const body = await response.Body?.transformToString();\n if (!body) throw new Error(`Empty response for key: ${key}`);\n return body;\n }\n}\n\n/** {cms}-{contentType}.json (always points at the latest version) */\nexport const buildCmsObjectKey = (cms: string, contentType: string): string => {\n return `${cms}-${contentType}.json`;\n}\n\nexport const buildTranslationObjectKey = (project:string, fileName: string, locale: string): string => {\n return `lingohub-${project}.${fileName.replaceAll('[locale]', locale)}`;\n}\n","export const defaultLocales = ['en', 'fr', 'de', 'es', 'it', 'pt-br', 'ru', 'zh-hans', 'zh-hant', 'ko', 'ja'];\n\nconst localeMapping = {\n ios: {\n 'pt-br': 'pt',\n 'zh-hans': 'zh-Hans',\n 'zh-hant': 'zh-Hant',\n },\n android: {\n 'pt-br': 'pt',\n 'zh-hans': 'zh-Hans-CN',\n 'zh-hant': 'zh-TW',\n },\n};\n\nexport type LingohubResource = {\n resource: string,\n fileName: string;\n type: 'json'|'strings'|'xml';\n localeMapping?: Record<string, string>;\n}\n\nexport const allProjects: Record<string, LingohubResource[]> = {\n 'tandem-(new-website)': [\n {\n resource: 'main',\n fileName: 'Website.[locale].json',\n type: 'json'\n }\n ],\n 'tandem-(website)': [\n {\n resource: 'main',\n fileName: '[locale].json',\n type: 'json'\n },\n {\n resource: 'ai',\n fileName: 'AI.[locale].json',\n type: 'json'\n },\n {\n resource: 'languages',\n fileName: 'languages.[locale].json',\n type: 'json'\n }\n ],\n 'tandem': [\n {\n resource: 'infoplist',\n fileName: 'InfoPlist.[locale].strings',\n type: 'strings',\n localeMapping: localeMapping.ios,\n },\n {\n resource: 'localizable',\n fileName: 'Localizable.[locale].strings',\n type: 'strings',\n localeMapping: localeMapping.ios,\n },\n {\n resource: 'ipad',\n fileName: 'MainiPad.[locale].strings',\n type: 'strings',\n localeMapping: localeMapping.ios,\n },\n {\n resource: 'main',\n fileName: 'Main.[locale].strings',\n type: 'strings',\n localeMapping: localeMapping.ios,\n }\n ],\n 'tandem-(android)': [\n {\n resource: 'accessibility',\n fileName: 'accessibility_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'call',\n fileName: 'call_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'cert',\n fileName: 'cert_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'chat',\n fileName: 'chat_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'checklist',\n fileName: 'checklist_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'clubs',\n fileName: 'clubs_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'common',\n fileName: 'common_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'community',\n fileName: 'community_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'correction',\n fileName: 'correction_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'country_names',\n fileName: 'country_names.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'emoji',\n fileName: 'emoji_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'errors',\n fileName: 'errors_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'expressions',\n fileName: 'expressions_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'gif',\n fileName: 'gif_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'guidelines',\n fileName: 'guidelines_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'lanuguages',\n fileName: 'languages_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'localizable',\n fileName: 'localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'localizable2',\n fileName: 'localizable2.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'login',\n fileName: 'login_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'myprofile',\n fileName: 'myprofile_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'onb',\n fileName: 'onb_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'parties',\n fileName: 'parties_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'pro',\n fileName: 'pro_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'pro_screen',\n fileName: 'pro_screen_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'push_notification',\n fileName: 'push_notification_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'reporting',\n fileName: 'reporting_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n },\n {\n resource: 'translation',\n fileName: 'translation_localizable.[locale].xml',\n type: 'xml',\n localeMapping: localeMapping.android,\n }\n\n ],\n 'tandem-(web-invites)': [\n {\n resource: 'main',\n fileName: '[locale].json',\n type: 'json'\n }\n ]\n};\n","import path from 'node:path';\nimport { convertXMLToJS, parseIOSStrings, transformObjectToFlat } from './utils';\nimport type { LingohubResource } from './lingohub';\n\n/** Content-Type for raw Lingohub bodies stored in S3. */\nexport function contentTypeForTranslationKey(objectKey: string): string {\n if (objectKey.endsWith('.json')) return 'application/json; charset=utf-8';\n if (objectKey.endsWith('.xml')) return 'application/xml; charset=utf-8';\n if (objectKey.endsWith('.strings')) return 'text/plain; charset=utf-8';\n return 'application/octet-stream';\n}\n\n/**\n * Parses a raw Lingohub file body from S3 into structured data.\n */\nexport function parseTranslationResourceRaw(\n raw: string,\n resource: LingohubResource,\n): unknown {\n if (resource.type === 'json') {\n return JSON.parse(raw) as unknown;\n }\n\n if (resource.type === 'strings') {\n return parseIOSStrings(raw);\n }\n\n if (resource.type === 'xml') {\n return convertXMLToJS(raw);\n }\n\n throw new Error(`Unsupported resource type: ${resource.type}`);\n}\n\n/**\n * Normalizes parsed translation data to a flat string map for merging (duplicate keys: last wins).\n */\nexport function toFlatStringMap(parsed: unknown): Record<string, string> {\n if (parsed === null || parsed === undefined) return {};\n if (typeof parsed === 'string') return { value: parsed };\n if (typeof parsed !== 'object') return { value: String(parsed) };\n if (Array.isArray(parsed)) {\n const out: Record<string, string> = {};\n parsed.forEach((v, i) => {\n out[String(i)] =\n typeof v === 'object' && v !== null ? JSON.stringify(v) : String(v);\n });\n return out;\n }\n\n const flat = transformObjectToFlat(parsed as Record<string, unknown>);\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(flat)) {\n if (v === null || v === undefined) {\n out[k] = '';\n } else if (typeof v === 'object') {\n out[k] = JSON.stringify(v);\n } else {\n out[k] = String(v);\n }\n }\n return out;\n}\n\n/** Where to write normalized JSON for one translation object key (avoids `.json.json`). */\nexport function translationJsonOutputPath(\n outputDir: string,\n objectKey: string,\n): string {\n if (objectKey.endsWith('.json')) {\n return path.resolve(outputDir, objectKey);\n }\n return path.resolve(outputDir, `${objectKey}.json`);\n}\n","import convert from 'xml-js';\nimport set from 'lodash.set';\nimport merge from 'lodash.merge';\n\nexport const transformObjectToNested = (data: Record<string, unknown>): Record<string, unknown> => {\n const result: Record<string, unknown> = {};\n\n Object.entries(data).forEach(([key, value]) => {\n const tempObject = {};\n set(tempObject, key, value);\n merge(result, tempObject);\n });\n\n return result;\n};\n\nexport const transformObjectToFlat = (data: Record<string, any>): Record<string, any> => { // eslint-disable-line @typescript-eslint/no-explicit-any\n const result: Record<string, unknown> = {};\n\n const flatten = (obj: Record<string, any>, path: string[] = []) => { // eslint-disable-line @typescript-eslint/no-explicit-any\n Object.entries(obj).forEach(([key, value]) => {\n if (typeof value === 'object') {\n flatten(value, path.concat(key));\n } else {\n result[path.concat(key).join('.')] = value;\n }\n });\n };\n\n flatten(data);\n\n return result;\n}\n\nexport const convertXMLToJS = (xml: string): Record<string, string> => {\n const converted = convert.xml2js(xml, {\n ignoreComment: true,\n ignoreDeclaration: true,\n ignoreInstruction: true,\n compact: true,\n }) as {\n resources: {\n string: {\n _attributes: { name: string },\n _text: 'User does not exist'\n }[];\n }\n };\n\n let mapped = {};\n converted.resources.string.forEach((item) => {\n mapped = {\n ...mapped,\n [item._attributes.name]: item._text,\n };\n });\n\n return mapped;\n};\n\nexport const parseIOSStrings = (strings: string): Record<string, string> => {\n const parsedObj: Record<string, string> = {};\n strings\n .split('\\n')\n .filter((line) => line.startsWith('\"') && line.endsWith(';'))\n .map((line) => line.trim().slice(0, -1))\n .forEach((line) => {\n let [key, value] = line.split(' = ');\n if (!key || !value) return;\n key = key.slice(1, -1);\n value = value.slice(1, -1);\n parsedObj[key] = value;\n });\n\n return parsedObj;\n};"],"mappings":";;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,IAAM,eAAN,MAAmB;AAAA,EAChB;AAAA,EACA;AAAA,EAER,YAAY,KAAe;AACzB,SAAK,SAAS,IAAI,SAAS;AAAA,MACzB,QAAQ,IAAI;AAAA,MACZ,aAAa;AAAA,QACX,aAAa,IAAI;AAAA,QACjB,iBAAiB,IAAI;AAAA,MACvB;AAAA,IACF,CAAC;AACD,SAAK,SAAS,IAAI;AAAA,EACpB;AAAA,EAEA,MAAM,OAAO,KAAa,MAAgC;AACxD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QAAI,MAAM,QAAQ,MAAM,QAAW;AACjC,UAAI,CAAC,IAAI;AAAA,IACX,WAAW,OAAO,MAAM,UAAU;AAChC,UAAI,CAAC,IAAI,KAAK,UAAU,CAAC;AAAA,IAC3B,OAAO;AACL,UAAI,CAAC,IAAI,OAAO,CAAC;AAAA,IACnB;AAAA,EACF;AACA,SAAO;AACT;AAGO,SAAS,0BACd,WACA,WACQ;AACR,MAAI,UAAU,SAAS,OAAO,GAAG;AAC/B,WAAO,KAAK,QAAQ,WAAW,SAAS;AAAA,EAC1C;AACA,SAAO,KAAK,QAAQ,WAAW,GAAG,SAAS,OAAO;AACpD;","names":["path","out"]}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
config
|
|
4
|
+
} from "./chunk-4DE47ZJD.js";
|
|
2
5
|
import {
|
|
3
6
|
ContentStore,
|
|
4
7
|
allProjects,
|
|
5
8
|
buildCmsObjectKey,
|
|
6
9
|
buildTranslationObjectKey,
|
|
7
|
-
config,
|
|
8
10
|
contentTypeForTranslationKey,
|
|
9
11
|
defaultLocales
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6FXNAJSI.js";
|
|
11
13
|
|
|
12
14
|
// src/server/config.ts
|
|
13
15
|
import dotenv from "dotenv";
|
|
@@ -433,4 +435,4 @@ export {
|
|
|
433
435
|
syncCmsContent,
|
|
434
436
|
syncTranslations
|
|
435
437
|
};
|
|
436
|
-
//# sourceMappingURL=chunk-
|
|
438
|
+
//# sourceMappingURL=chunk-BAJT7RMQ.js.map
|