@lotics/cli 0.52.1 → 0.54.0
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.
|
@@ -123,6 +123,18 @@ function inputDeclToTsType(decl) {
|
|
|
123
123
|
return "{ start: string; end: string }";
|
|
124
124
|
case "file":
|
|
125
125
|
return "string";
|
|
126
|
+
case "object": {
|
|
127
|
+
const fields = decl.fields !== null && typeof decl.fields === "object"
|
|
128
|
+
? decl.fields
|
|
129
|
+
: {};
|
|
130
|
+
return inputsToType(fields);
|
|
131
|
+
}
|
|
132
|
+
case "array": {
|
|
133
|
+
const items = decl.items !== null && typeof decl.items === "object"
|
|
134
|
+
? decl.items
|
|
135
|
+
: null;
|
|
136
|
+
return items ? `ReadonlyArray<${inputDeclToTsType(items)}>` : "ReadonlyArray<unknown>";
|
|
137
|
+
}
|
|
126
138
|
case "json":
|
|
127
139
|
return "unknown";
|
|
128
140
|
default:
|
|
@@ -32,6 +32,32 @@ describe("generateAppWorkflowsDts", () => {
|
|
|
32
32
|
// No declared inputs → untyped callable in AppWorkflows.
|
|
33
33
|
expect(dts).toContain("computeQuote: Record<string, unknown>;");
|
|
34
34
|
});
|
|
35
|
+
it("types an array-of-objects INPUT as ReadonlyArray<{…}>", () => {
|
|
36
|
+
const dts = generateAppWorkflowsDts({
|
|
37
|
+
importLines: {
|
|
38
|
+
workflow_id: "wfl_4",
|
|
39
|
+
inputs: {
|
|
40
|
+
lines: {
|
|
41
|
+
type: "array",
|
|
42
|
+
items: {
|
|
43
|
+
type: "object",
|
|
44
|
+
fields: {
|
|
45
|
+
sku: { type: "text" },
|
|
46
|
+
qty: { type: "number" },
|
|
47
|
+
note: { type: "text", required: false },
|
|
48
|
+
ref: { type: "record_link", table_id: "tbl_x" },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
expect(dts).toContain("lines: ReadonlyArray<{");
|
|
56
|
+
expect(dts).toContain("sku: string;");
|
|
57
|
+
expect(dts).toContain("qty: number;");
|
|
58
|
+
expect(dts).toContain("note?: string;");
|
|
59
|
+
expect(dts).toContain("ref: string;");
|
|
60
|
+
});
|
|
35
61
|
it("maps record_link/select outputs the same way as inputs", () => {
|
|
36
62
|
const dts = generateAppWorkflowsDts({
|
|
37
63
|
lookup: {
|
package/dist/src/cli.js
CHANGED
|
@@ -30268,11 +30268,18 @@ function buildStarterTemplate(args) {
|
|
|
30268
30268
|
},
|
|
30269
30269
|
dependencies: {
|
|
30270
30270
|
"@lotics/app-sdk": sdkVersion,
|
|
30271
|
+
// Document preview engines for @lotics/ui FilePreview/FileGalleryModal
|
|
30272
|
+
// (Word, Excel/CSV). Lazy-loaded — an app that never previews them
|
|
30273
|
+
// pays no bundle cost; only node_modules size grows.
|
|
30274
|
+
"@lotics/docx": "^0.1.0",
|
|
30271
30275
|
"@lotics/ui": uiVersion,
|
|
30276
|
+
"@lotics/xlsx": "^0.1.0",
|
|
30272
30277
|
"@react-native-picker/picker": "^2.7.0",
|
|
30273
30278
|
"expo-image": "~3.0.9",
|
|
30274
30279
|
"lucide-react": "^0.562.0",
|
|
30275
30280
|
"lucide-react-native": "^0.562.0",
|
|
30281
|
+
// PDF preview engine for FilePreview/FileGalleryModal — also lazy-loaded.
|
|
30282
|
+
"pdfjs-dist": "^6.0.0",
|
|
30276
30283
|
react: "^19.0.0",
|
|
30277
30284
|
"react-dom": "^19.0.0",
|
|
30278
30285
|
"react-native": STARTER_REACT_NATIVE_VERSION,
|
|
@@ -31439,6 +31446,14 @@ function inputDeclToTsType(decl) {
|
|
|
31439
31446
|
return "{ start: string; end: string }";
|
|
31440
31447
|
case "file":
|
|
31441
31448
|
return "string";
|
|
31449
|
+
case "object": {
|
|
31450
|
+
const fields = decl.fields !== null && typeof decl.fields === "object" ? decl.fields : {};
|
|
31451
|
+
return inputsToType(fields);
|
|
31452
|
+
}
|
|
31453
|
+
case "array": {
|
|
31454
|
+
const items = decl.items !== null && typeof decl.items === "object" ? decl.items : null;
|
|
31455
|
+
return items ? `ReadonlyArray<${inputDeclToTsType(items)}>` : "ReadonlyArray<unknown>";
|
|
31456
|
+
}
|
|
31442
31457
|
case "json":
|
|
31443
31458
|
return "unknown";
|
|
31444
31459
|
default:
|
package/dist/starter_template.js
CHANGED
|
@@ -75,11 +75,18 @@ export function buildStarterTemplate(args) {
|
|
|
75
75
|
},
|
|
76
76
|
dependencies: {
|
|
77
77
|
"@lotics/app-sdk": sdkVersion,
|
|
78
|
+
// Document preview engines for @lotics/ui FilePreview/FileGalleryModal
|
|
79
|
+
// (Word, Excel/CSV). Lazy-loaded — an app that never previews them
|
|
80
|
+
// pays no bundle cost; only node_modules size grows.
|
|
81
|
+
"@lotics/docx": "^0.1.0",
|
|
78
82
|
"@lotics/ui": uiVersion,
|
|
83
|
+
"@lotics/xlsx": "^0.1.0",
|
|
79
84
|
"@react-native-picker/picker": "^2.7.0",
|
|
80
85
|
"expo-image": "~3.0.9",
|
|
81
86
|
"lucide-react": "^0.562.0",
|
|
82
87
|
"lucide-react-native": "^0.562.0",
|
|
88
|
+
// PDF preview engine for FilePreview/FileGalleryModal — also lazy-loaded.
|
|
89
|
+
"pdfjs-dist": "^6.0.0",
|
|
83
90
|
react: "^19.0.0",
|
|
84
91
|
"react-dom": "^19.0.0",
|
|
85
92
|
"react-native": STARTER_REACT_NATIVE_VERSION,
|