@localess/cli 3.0.1-dev.20260425193501 → 3.0.1-dev.20260425203948
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/dist/index.mjs +12 -9
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -196,7 +196,7 @@ function y(e) {
|
|
|
196
196
|
let t = await v(i, n, e.retryCount, e.retryDelay, e.debug);
|
|
197
197
|
e.debug && console.log(_, "getSchemas status : ", t.status);
|
|
198
198
|
let a = await t.json();
|
|
199
|
-
return
|
|
199
|
+
return r.set(i, a), a;
|
|
200
200
|
} catch (e) {
|
|
201
201
|
return console.error(_, "getSchemas error : ", e), {};
|
|
202
202
|
}
|
|
@@ -363,13 +363,17 @@ function I(e) {
|
|
|
363
363
|
t.push(`export type ${e} = ${r};\n`);
|
|
364
364
|
}
|
|
365
365
|
} else {
|
|
366
|
-
let
|
|
366
|
+
let a = i;
|
|
367
367
|
i.type === k.ROOT && n.push(e);
|
|
368
|
-
let
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
368
|
+
let o = [
|
|
369
|
+
" _id: string;",
|
|
370
|
+
` _schema: '${r}';`,
|
|
371
|
+
...(a.fields ?? []).map((e) => {
|
|
372
|
+
let t = F(e), n = e.required ? "" : "?";
|
|
373
|
+
return ` ${e.name}${n}: ${t};`;
|
|
374
|
+
})
|
|
375
|
+
];
|
|
376
|
+
t.push(`export interface ${e} {\n${o.join("\n")}\n}\n`);
|
|
373
377
|
}
|
|
374
378
|
}
|
|
375
379
|
return n.length > 0 ? t.push(`export type ContentData = ${n.join(" | ")};\n`) : t.push("export type ContentData = unknown;\n"), t.join("\n");
|
|
@@ -386,8 +390,7 @@ var L = s(u.cwd(), b, "localess.ts"), R = new e("generate").description("Generat
|
|
|
386
390
|
let n = y({
|
|
387
391
|
origin: t.origin,
|
|
388
392
|
spaceId: t.space,
|
|
389
|
-
token: t.token
|
|
390
|
-
debug: !0
|
|
393
|
+
token: t.token
|
|
391
394
|
});
|
|
392
395
|
console.log("Fetching schemas from Localess...");
|
|
393
396
|
let r = await n.getSchemas();
|