@datamagik/cli 0.1.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.
- package/LICENSE +21 -0
- package/assets/dm-script-globals.d.ts +181 -0
- package/dist/api.d.ts +247 -0
- package/dist/api.js +200 -0
- package/dist/api.js.map +1 -0
- package/dist/commands/add.d.ts +28 -0
- package/dist/commands/add.js +260 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/dev.d.ts +25 -0
- package/dist/commands/dev.js +113 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/init.d.ts +23 -0
- package/dist/commands/init.js +136 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +16 -0
- package/dist/commands/login.js +42 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/publish.d.ts +23 -0
- package/dist/commands/publish.js +113 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/script.d.ts +69 -0
- package/dist/commands/script.js +289 -0
- package/dist/commands/script.js.map +1 -0
- package/dist/commands/sql.d.ts +28 -0
- package/dist/commands/sql.js +124 -0
- package/dist/commands/sql.js.map +1 -0
- package/dist/commands/typegen.d.ts +13 -0
- package/dist/commands/typegen.js +50 -0
- package/dist/commands/typegen.js.map +1 -0
- package/dist/config.d.ts +45 -0
- package/dist/config.js +118 -0
- package/dist/config.js.map +1 -0
- package/dist/credentials.d.ts +17 -0
- package/dist/credentials.js +49 -0
- package/dist/credentials.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +268 -0
- package/dist/index.js.map +1 -0
- package/dist/scriptfile.d.ts +10 -0
- package/dist/scriptfile.js +91 -0
- package/dist/scriptfile.js.map +1 -0
- package/dist/sqlfile.d.ts +9 -0
- package/dist/sqlfile.js +75 -0
- package/dist/sqlfile.js.map +1 -0
- package/dist/typegen/emit.d.ts +22 -0
- package/dist/typegen/emit.js +255 -0
- package/dist/typegen/emit.js.map +1 -0
- package/dist/typegen/meta.d.ts +84 -0
- package/dist/typegen/meta.js +209 -0
- package/dist/typegen/meta.js.map +1 -0
- package/package.json +35 -0
- package/templates/showcase/README.md +55 -0
- package/templates/showcase/_gitignore +4 -0
- package/templates/showcase/dm.config.json +16 -0
- package/templates/showcase/env.d.ts +7 -0
- package/templates/showcase/index.html +12 -0
- package/templates/showcase/package.json +25 -0
- package/templates/showcase/src/App.vue +67 -0
- package/templates/showcase/src/assets/datamagik-logo.png +0 -0
- package/templates/showcase/src/components/ShowcasePanel.vue +47 -0
- package/templates/showcase/src/components/panels/ContextPanel.vue +35 -0
- package/templates/showcase/src/components/panels/NavigatePanel.vue +38 -0
- package/templates/showcase/src/components/panels/OutputPanel.vue +50 -0
- package/templates/showcase/src/components/panels/PrintPanel.vue +68 -0
- package/templates/showcase/src/components/panels/QueryPanel.vue +52 -0
- package/templates/showcase/src/components/panels/ScriptPanel.vue +55 -0
- package/templates/showcase/src/components/panels/SerialPanel.vue +64 -0
- package/templates/showcase/src/dm-script-types.d.ts +13 -0
- package/templates/showcase/src/dm.generated.ts +65 -0
- package/templates/showcase/src/format.ts +13 -0
- package/templates/showcase/src/main.ts +5 -0
- package/templates/showcase/src/style.css +134 -0
- package/templates/showcase/tsconfig.json +17 -0
- package/templates/showcase/vite.config.ts +9 -0
- package/templates/simple/README.md +37 -0
- package/templates/simple/_gitignore +4 -0
- package/templates/simple/dm.config.json +10 -0
- package/templates/simple/env.d.ts +7 -0
- package/templates/simple/index.html +12 -0
- package/templates/simple/package.json +25 -0
- package/templates/simple/src/App.vue +71 -0
- package/templates/simple/src/dm.generated.ts +32 -0
- package/templates/simple/src/main.ts +5 -0
- package/templates/simple/src/style.css +63 -0
- package/templates/simple/tsconfig.json +17 -0
- package/templates/simple/vite.config.ts +9 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emits the `dm.generated.ts` module from fetched metadata.
|
|
3
|
+
*
|
|
4
|
+
* Deterministic: aliases are sorted within each category, the output carries
|
|
5
|
+
* no timestamps, and identical inputs always produce byte-identical output —
|
|
6
|
+
* the file is meant to be committed.
|
|
7
|
+
*/
|
|
8
|
+
export function emitGeneratedModule(meta) {
|
|
9
|
+
const tables = [...meta.tables].sort(byAlias);
|
|
10
|
+
const odbc = [...meta.odbc].sort(byAlias);
|
|
11
|
+
const scripts = [...meta.scripts].sort(byAlias);
|
|
12
|
+
const serials = [...meta.serials].sort(byAlias);
|
|
13
|
+
const printers = [...meta.printers].sort(byAlias);
|
|
14
|
+
const usesImageRef = tables.some((t) => t.fields.some((f) => f.type === 'picture'));
|
|
15
|
+
const usesScriptTypeOf = scripts.length > 0;
|
|
16
|
+
const typeImports = ['AliasRegistry'];
|
|
17
|
+
if (usesImageRef)
|
|
18
|
+
typeImports.push('DmImageRef');
|
|
19
|
+
if (usesScriptTypeOf)
|
|
20
|
+
typeImports.push('ScriptTypeOf');
|
|
21
|
+
typeImports.sort();
|
|
22
|
+
const out = [];
|
|
23
|
+
out.push('/* eslint-disable */');
|
|
24
|
+
out.push('// ----------------------------------------------------------------------------');
|
|
25
|
+
out.push('// Generated by `dm typegen` — DO NOT EDIT.');
|
|
26
|
+
out.push('// Aliases come from dm.config.json; the same declarations gate authorization');
|
|
27
|
+
out.push('// server-side, so this autocomplete surface equals the permission surface.');
|
|
28
|
+
out.push('// Commit this file so CI and editors work without platform access.');
|
|
29
|
+
out.push('// ----------------------------------------------------------------------------');
|
|
30
|
+
out.push("import { createDm } from '@datamagik/app-sdk';");
|
|
31
|
+
out.push(`import type { ${typeImports.join(', ')} } from '@datamagik/app-sdk';`);
|
|
32
|
+
out.push('');
|
|
33
|
+
for (const t of tables)
|
|
34
|
+
out.push(...emitTableInterface(t), '');
|
|
35
|
+
for (const q of odbc)
|
|
36
|
+
out.push(...emitOdbcTypes(q), '');
|
|
37
|
+
for (const s of serials)
|
|
38
|
+
out.push(...emitSerialContext(s), '');
|
|
39
|
+
out.push(...emitDmGenerated(tables, odbc, scripts, serials, printers), '');
|
|
40
|
+
out.push(...emitRegistry(tables, odbc, scripts, serials, printers), '');
|
|
41
|
+
out.push('/** Ready-to-use, fully typed SDK instance for this app. */');
|
|
42
|
+
out.push('export const dm = createDm<DmGenerated>(dmRegistry);');
|
|
43
|
+
out.push('');
|
|
44
|
+
return out.join('\n');
|
|
45
|
+
}
|
|
46
|
+
const byAlias = (a, b) => (a.alias < b.alias ? -1 : a.alias > b.alias ? 1 : 0);
|
|
47
|
+
/** `parts` → `PartsRow`-style Pascal case. */
|
|
48
|
+
export function pascal(alias) {
|
|
49
|
+
return alias.charAt(0).toUpperCase() + alias.slice(1);
|
|
50
|
+
}
|
|
51
|
+
const IDENT_RE = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
52
|
+
function propKey(name) {
|
|
53
|
+
return IDENT_RE.test(name) ? name : JSON.stringify(name);
|
|
54
|
+
}
|
|
55
|
+
/** Strips comment-terminators so descriptions cannot break out of TSDoc. */
|
|
56
|
+
function safeComment(s) {
|
|
57
|
+
return s.replace(/\*\//g, '*\\/').replace(/[\r\n]+/g, ' ');
|
|
58
|
+
}
|
|
59
|
+
function tsdoc(lines, indent = '') {
|
|
60
|
+
const clean = lines.filter((l) => l !== '');
|
|
61
|
+
if (clean.length === 0)
|
|
62
|
+
return [];
|
|
63
|
+
if (clean.length === 1)
|
|
64
|
+
return [`${indent}/** ${safeComment(clean[0])} */`];
|
|
65
|
+
return [`${indent}/**`, ...clean.map((l) => `${indent} * ${safeComment(l)}`), `${indent} */`];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Maps a lookup-table `value_schema` field type to TypeScript
|
|
69
|
+
* (design §8.1): text→string, number→number, date→string (ISO 8601),
|
|
70
|
+
* boolean→boolean, picture→DmImageRef, lookup_table→number (FK).
|
|
71
|
+
*/
|
|
72
|
+
export function lookupFieldType(type) {
|
|
73
|
+
switch (type) {
|
|
74
|
+
case 'text':
|
|
75
|
+
return { ts: 'string' };
|
|
76
|
+
case 'number':
|
|
77
|
+
return { ts: 'number' };
|
|
78
|
+
case 'date':
|
|
79
|
+
return { ts: 'string', note: 'ISO 8601 date' };
|
|
80
|
+
case 'boolean':
|
|
81
|
+
return { ts: 'boolean' };
|
|
82
|
+
case 'picture':
|
|
83
|
+
return { ts: 'DmImageRef' };
|
|
84
|
+
case 'lookup_table':
|
|
85
|
+
return { ts: 'number', note: 'FK → lookup_data_id' };
|
|
86
|
+
default:
|
|
87
|
+
return { ts: 'unknown', note: `unrecognized schema type "${type}"` };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Maps an ODBC parameter type to TypeScript: string|int|float|bool. */
|
|
91
|
+
export function odbcParamType(type) {
|
|
92
|
+
switch (type) {
|
|
93
|
+
case 'string':
|
|
94
|
+
return 'string';
|
|
95
|
+
case 'int':
|
|
96
|
+
case 'float':
|
|
97
|
+
return 'number';
|
|
98
|
+
case 'bool':
|
|
99
|
+
return 'boolean';
|
|
100
|
+
default:
|
|
101
|
+
return 'unknown';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function emitTableInterface(t) {
|
|
105
|
+
const lines = [];
|
|
106
|
+
const doc = [`Row of lookup table "${t.tableName}" (source #${t.sourceId}).`];
|
|
107
|
+
if (t.description)
|
|
108
|
+
doc.push(t.description);
|
|
109
|
+
lines.push(...tsdoc(doc));
|
|
110
|
+
lines.push(`export interface ${pascal(t.alias)}Row {`);
|
|
111
|
+
const fields = [...t.fields].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
112
|
+
for (const f of fields) {
|
|
113
|
+
const { ts, note } = lookupFieldType(f.type);
|
|
114
|
+
const fdoc = [];
|
|
115
|
+
if (f.description)
|
|
116
|
+
fdoc.push(f.description);
|
|
117
|
+
if (note)
|
|
118
|
+
fdoc.push(`(${note})`);
|
|
119
|
+
lines.push(...tsdoc([fdoc.join(' ')], ' '));
|
|
120
|
+
lines.push(` ${propKey(f.name)}: ${ts};`);
|
|
121
|
+
}
|
|
122
|
+
lines.push('}');
|
|
123
|
+
return lines;
|
|
124
|
+
}
|
|
125
|
+
function emitOdbcTypes(q) {
|
|
126
|
+
const lines = [];
|
|
127
|
+
const name = pascal(q.alias);
|
|
128
|
+
const doc = [`Parameters of ODBC query "${q.queryName}" (source #${q.sourceId}).`];
|
|
129
|
+
if (q.description)
|
|
130
|
+
doc.push(q.description);
|
|
131
|
+
doc.push('Parameters with a default value are optional.');
|
|
132
|
+
lines.push(...tsdoc(doc));
|
|
133
|
+
lines.push(`export interface ${name}Params {`);
|
|
134
|
+
const params = [...q.parameters].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
135
|
+
for (const p of params) {
|
|
136
|
+
const optional = p.default !== undefined && p.default !== null;
|
|
137
|
+
const pdoc = [];
|
|
138
|
+
if (optional)
|
|
139
|
+
pdoc.push(`Default: ${JSON.stringify(p.default)}`);
|
|
140
|
+
lines.push(...tsdoc([pdoc.join(' ')], ' '));
|
|
141
|
+
lines.push(` ${propKey(p.name)}${optional ? '?' : ''}: ${odbcParamType(p.type)};`);
|
|
142
|
+
}
|
|
143
|
+
lines.push('}');
|
|
144
|
+
lines.push(...tsdoc([
|
|
145
|
+
`Row of ODBC query "${q.queryName}" (source #${q.sourceId}).`,
|
|
146
|
+
'Columns are not statically declared by the platform; narrow this type manually if needed.',
|
|
147
|
+
]));
|
|
148
|
+
lines.push(`export type ${name}Row = Record<string, unknown>;`);
|
|
149
|
+
return lines;
|
|
150
|
+
}
|
|
151
|
+
function emitSerialContext(s) {
|
|
152
|
+
const lines = [];
|
|
153
|
+
const doc = [
|
|
154
|
+
`Generation context for serial series "${s.name}" (series #${s.seriesId}).`,
|
|
155
|
+
`Format: \`${s.formatString}\` — \`generate()\` returns serial numbers in this shape.`,
|
|
156
|
+
];
|
|
157
|
+
lines.push(...tsdoc(doc));
|
|
158
|
+
const name = `${pascal(s.alias)}Context`;
|
|
159
|
+
if (s.contextFields === null) {
|
|
160
|
+
lines.push(`export type ${name} = Record<string, unknown>;`);
|
|
161
|
+
return lines;
|
|
162
|
+
}
|
|
163
|
+
if (s.contextFields.length === 0) {
|
|
164
|
+
lines.push(`export type ${name} = Record<string, never>;`);
|
|
165
|
+
return lines;
|
|
166
|
+
}
|
|
167
|
+
lines.push(`export interface ${name} {`);
|
|
168
|
+
const fields = [...s.contextFields].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
169
|
+
for (const f of fields) {
|
|
170
|
+
if (f.description)
|
|
171
|
+
lines.push(...tsdoc([f.description], ' '));
|
|
172
|
+
lines.push(` ${propKey(f.name)}${f.required ? '' : '?'}: ${f.tsType};`);
|
|
173
|
+
}
|
|
174
|
+
lines.push('}');
|
|
175
|
+
return lines;
|
|
176
|
+
}
|
|
177
|
+
function printerFormatsUnion(p) {
|
|
178
|
+
const order = ['zpl', 'pdf', 'pdf_base64', 'html'];
|
|
179
|
+
const formats = order.filter((f) => p.formats.includes(f));
|
|
180
|
+
return (formats.length > 0 ? formats : order).map((f) => `'${f}'`).join(' | ');
|
|
181
|
+
}
|
|
182
|
+
function emitDmGenerated(tables, odbc, scripts, serials, printers) {
|
|
183
|
+
const lines = [];
|
|
184
|
+
lines.push(...tsdoc([
|
|
185
|
+
'Typed alias surface for this app. Passed as the generic of `createDm` so',
|
|
186
|
+
'every alias autocompletes in any TypeScript-aware editor.',
|
|
187
|
+
]));
|
|
188
|
+
lines.push('export interface DmGenerated {');
|
|
189
|
+
lines.push(' tables: {');
|
|
190
|
+
for (const t of tables) {
|
|
191
|
+
lines.push(...tsdoc([`Lookup table "${t.tableName}" (#${t.sourceId})`], ' '));
|
|
192
|
+
lines.push(` ${propKey(t.alias)}: ${pascal(t.alias)}Row;`);
|
|
193
|
+
}
|
|
194
|
+
lines.push(' };');
|
|
195
|
+
lines.push(' odbc: {');
|
|
196
|
+
for (const q of odbc) {
|
|
197
|
+
lines.push(...tsdoc([`ODBC query "${q.queryName}" (#${q.sourceId})`], ' '));
|
|
198
|
+
lines.push(` ${propKey(q.alias)}: { params: ${pascal(q.alias)}Params; row: ${pascal(q.alias)}Row };`);
|
|
199
|
+
}
|
|
200
|
+
lines.push(' };');
|
|
201
|
+
lines.push(' scripts: {');
|
|
202
|
+
for (const s of scripts) {
|
|
203
|
+
lines.push(...tsdoc([
|
|
204
|
+
`Script "${s.scriptName}" (#${s.sourceId}).${s.description ? ` ${s.description}` : ''}`,
|
|
205
|
+
'Scripts have no declared IO schema; types default to `unknown`.',
|
|
206
|
+
`Augment \`DmScriptTypes\` in '@datamagik/app-sdk' to type this script.`,
|
|
207
|
+
], ' '));
|
|
208
|
+
lines.push(` ${propKey(s.alias)}: ScriptTypeOf<'${s.alias}'>;`);
|
|
209
|
+
}
|
|
210
|
+
lines.push(' };');
|
|
211
|
+
lines.push(' serials: {');
|
|
212
|
+
for (const s of serials) {
|
|
213
|
+
lines.push(...tsdoc([`Serial series "${s.name}" (#${s.seriesId}) — format \`${s.formatString}\``], ' '));
|
|
214
|
+
lines.push(` ${propKey(s.alias)}: { context: ${pascal(s.alias)}Context };`);
|
|
215
|
+
}
|
|
216
|
+
lines.push(' };');
|
|
217
|
+
lines.push(' printers: {');
|
|
218
|
+
for (const p of printers) {
|
|
219
|
+
const caps = [`Printer "${p.name}" (#${p.printerId})`];
|
|
220
|
+
const detail = [p.type];
|
|
221
|
+
if (p.protocol)
|
|
222
|
+
detail.push(p.protocol);
|
|
223
|
+
if (p.dpi)
|
|
224
|
+
detail.push(`${p.dpi}dpi`);
|
|
225
|
+
if (p.isZplCompatible)
|
|
226
|
+
detail.push('ZPL-compatible');
|
|
227
|
+
caps.push(`— ${detail.join(', ')}`);
|
|
228
|
+
lines.push(...tsdoc([caps.join(' ')], ' '));
|
|
229
|
+
lines.push(` ${propKey(p.alias)}: { formats: ${printerFormatsUnion(p)} };`);
|
|
230
|
+
}
|
|
231
|
+
lines.push(' };');
|
|
232
|
+
lines.push('}');
|
|
233
|
+
return lines;
|
|
234
|
+
}
|
|
235
|
+
function emitRegistry(tables, odbc, scripts, serials, printers) {
|
|
236
|
+
const lines = [];
|
|
237
|
+
lines.push(...tsdoc([
|
|
238
|
+
'Runtime alias → { type, id } registry. The SDK uses it to map aliases to',
|
|
239
|
+
'the numeric ids the platform APIs (and authorization gates) operate on.',
|
|
240
|
+
]));
|
|
241
|
+
lines.push('export const dmRegistry: AliasRegistry = {');
|
|
242
|
+
const entries = [
|
|
243
|
+
...tables.map((t) => ({ alias: t.alias, type: 'lookup_table', id: t.sourceId })),
|
|
244
|
+
...odbc.map((q) => ({ alias: q.alias, type: 'odbc_query', id: q.sourceId })),
|
|
245
|
+
...scripts.map((s) => ({ alias: s.alias, type: 'script', id: s.sourceId })),
|
|
246
|
+
...serials.map((s) => ({ alias: s.alias, type: 'serial_series', id: s.seriesId })),
|
|
247
|
+
...printers.map((p) => ({ alias: p.alias, type: 'printer', id: p.printerId })),
|
|
248
|
+
].sort((a, b) => (a.alias < b.alias ? -1 : a.alias > b.alias ? 1 : 0));
|
|
249
|
+
for (const e of entries) {
|
|
250
|
+
lines.push(` ${propKey(e.alias)}: { type: '${e.type}', id: ${e.id} },`);
|
|
251
|
+
}
|
|
252
|
+
lines.push('};');
|
|
253
|
+
return lines;
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=emit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/typegen/emit.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAiB;IACnD,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;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OdbcQueryParameter } from '../api.js';
|
|
3
|
+
/** Normalized metadata that drives code emission (fetched once per run). */
|
|
4
|
+
export interface TypegenMeta {
|
|
5
|
+
tables: TableMeta[];
|
|
6
|
+
odbc: OdbcMeta[];
|
|
7
|
+
scripts: ScriptAliasMeta[];
|
|
8
|
+
serials: SerialAliasMeta[];
|
|
9
|
+
printers: PrinterAliasMeta[];
|
|
10
|
+
}
|
|
11
|
+
export interface TableMeta {
|
|
12
|
+
alias: string;
|
|
13
|
+
sourceId: number;
|
|
14
|
+
tableName: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
fields: SchemaField[];
|
|
17
|
+
}
|
|
18
|
+
export interface OdbcMeta {
|
|
19
|
+
alias: string;
|
|
20
|
+
sourceId: number;
|
|
21
|
+
queryName: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
parameters: OdbcQueryParameter[];
|
|
24
|
+
}
|
|
25
|
+
export interface ScriptAliasMeta {
|
|
26
|
+
alias: string;
|
|
27
|
+
sourceId: number;
|
|
28
|
+
scriptName: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
}
|
|
31
|
+
/** A serial-series context field (parsed from the series' context schema). */
|
|
32
|
+
export interface ContextField {
|
|
33
|
+
name: string;
|
|
34
|
+
/** TS type to emit, e.g. `string` or `number`. */
|
|
35
|
+
tsType: string;
|
|
36
|
+
required: boolean;
|
|
37
|
+
description?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SerialAliasMeta {
|
|
40
|
+
alias: string;
|
|
41
|
+
seriesId: number;
|
|
42
|
+
name: string;
|
|
43
|
+
formatString: string;
|
|
44
|
+
/** null when the context schema is absent/unparseable → free-form context. */
|
|
45
|
+
contextFields: ContextField[] | null;
|
|
46
|
+
}
|
|
47
|
+
export interface PrinterAliasMeta {
|
|
48
|
+
alias: string;
|
|
49
|
+
printerId: number;
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
protocol?: string;
|
|
53
|
+
dpi?: number;
|
|
54
|
+
isZplCompatible: boolean;
|
|
55
|
+
/** Supported print formats (subset of zpl|pdf|pdf_base64|html). */
|
|
56
|
+
formats: string[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fetches metadata for every declaration in `dm.config.json`.
|
|
60
|
+
* `printers: "all"` expands to every printer in the company registry, with
|
|
61
|
+
* aliases derived from printer names.
|
|
62
|
+
*/
|
|
63
|
+
export declare function loadTypegenMeta(config: DmConfig, client: PlatformMetadataClient): Promise<TypegenMeta>;
|
|
64
|
+
/**
|
|
65
|
+
* Derives the supported print formats for a printer:
|
|
66
|
+
* - `zpl` for ZPL-compatible printers (raw-socket Zebra path);
|
|
67
|
+
* - `pdf` and `pdf_base64` for IPP printers;
|
|
68
|
+
* - `html` is always available (server-side rendering before delivery).
|
|
69
|
+
* If nothing else matched, the full union is allowed (capability unknown).
|
|
70
|
+
*/
|
|
71
|
+
export declare function printerFormats(p: {
|
|
72
|
+
protocol?: string;
|
|
73
|
+
isZplCompatible?: boolean;
|
|
74
|
+
}): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Parses a series `contextSchema` (free-form JSONB) into typed fields.
|
|
77
|
+
* Supports the two shapes seen in practice:
|
|
78
|
+
* - an array of `{ name, type?, required?, description? }`
|
|
79
|
+
* - an object map `{ NAME: "string" | { type, required?, description? } }`
|
|
80
|
+
* Anything else → `null` (context stays `Record<string, unknown>`).
|
|
81
|
+
*/
|
|
82
|
+
export declare function parseContextSchema(schema: unknown): ContextField[] | null;
|
|
83
|
+
/** Converts a printer display name to a camelCase identifier alias. */
|
|
84
|
+
export declare function aliasFromName(name: string): string;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches metadata for every declaration in `dm.config.json`.
|
|
3
|
+
* `printers: "all"` expands to every printer in the company registry, with
|
|
4
|
+
* aliases derived from printer names.
|
|
5
|
+
*/
|
|
6
|
+
export async function loadTypegenMeta(config, client) {
|
|
7
|
+
const tables = [];
|
|
8
|
+
const odbc = [];
|
|
9
|
+
const scripts = [];
|
|
10
|
+
for (const source of config.sources) {
|
|
11
|
+
switch (source.type) {
|
|
12
|
+
case 'lookup_table': {
|
|
13
|
+
const t = await client.getLookupTable(source.sourceId);
|
|
14
|
+
tables.push({
|
|
15
|
+
alias: source.alias,
|
|
16
|
+
sourceId: source.sourceId,
|
|
17
|
+
tableName: t.table_name,
|
|
18
|
+
description: t.description ?? undefined,
|
|
19
|
+
fields: t.value_schema ?? [],
|
|
20
|
+
});
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
case 'odbc_query': {
|
|
24
|
+
const q = await client.getOdbcQuery(source.sourceId);
|
|
25
|
+
odbc.push({
|
|
26
|
+
alias: source.alias,
|
|
27
|
+
sourceId: source.sourceId,
|
|
28
|
+
queryName: q.query_name,
|
|
29
|
+
description: q.description ?? undefined,
|
|
30
|
+
parameters: q.parameters ?? [],
|
|
31
|
+
});
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case 'script': {
|
|
35
|
+
const s = await client.getScript(source.sourceId);
|
|
36
|
+
scripts.push({
|
|
37
|
+
alias: source.alias,
|
|
38
|
+
sourceId: source.sourceId,
|
|
39
|
+
scriptName: s.script_name,
|
|
40
|
+
description: s.description ?? undefined,
|
|
41
|
+
});
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const serials = [];
|
|
47
|
+
for (const decl of config.serialSeries) {
|
|
48
|
+
const s = await client.getSeries(decl.seriesId);
|
|
49
|
+
serials.push({
|
|
50
|
+
alias: decl.alias,
|
|
51
|
+
seriesId: decl.seriesId,
|
|
52
|
+
name: s.name,
|
|
53
|
+
formatString: s.formatString,
|
|
54
|
+
contextFields: parseContextSchema(s.contextSchema),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const printers = [];
|
|
58
|
+
if (config.printers === 'all') {
|
|
59
|
+
const all = await client.listPrinters();
|
|
60
|
+
const used = new Set();
|
|
61
|
+
for (const p of all) {
|
|
62
|
+
printers.push(toPrinterMeta(uniqueAlias(aliasFromName(p.name), used), p));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else if (config.printers.length > 0) {
|
|
66
|
+
const all = await client.listPrinters();
|
|
67
|
+
const byId = new Map(all.map((p) => [String(p.printerId), p]));
|
|
68
|
+
for (const decl of config.printers) {
|
|
69
|
+
const p = byId.get(String(decl.printerId));
|
|
70
|
+
if (!p) {
|
|
71
|
+
throw new Error(`Printer ${decl.printerId} (alias "${decl.alias}") not found in the company printer registry (GET /api/printers)`);
|
|
72
|
+
}
|
|
73
|
+
printers.push(toPrinterMeta(decl.alias, p));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { tables, odbc, scripts, serials, printers };
|
|
77
|
+
}
|
|
78
|
+
function toPrinterMeta(alias, p) {
|
|
79
|
+
return {
|
|
80
|
+
alias,
|
|
81
|
+
printerId: Number(p.printerId),
|
|
82
|
+
name: p.name,
|
|
83
|
+
type: p.type,
|
|
84
|
+
protocol: p.protocol,
|
|
85
|
+
dpi: p.dpi,
|
|
86
|
+
isZplCompatible: p.isZplCompatible === true,
|
|
87
|
+
formats: printerFormats(p),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Derives the supported print formats for a printer:
|
|
92
|
+
* - `zpl` for ZPL-compatible printers (raw-socket Zebra path);
|
|
93
|
+
* - `pdf` and `pdf_base64` for IPP printers;
|
|
94
|
+
* - `html` is always available (server-side rendering before delivery).
|
|
95
|
+
* If nothing else matched, the full union is allowed (capability unknown).
|
|
96
|
+
*/
|
|
97
|
+
export function printerFormats(p) {
|
|
98
|
+
const formats = [];
|
|
99
|
+
if (p.isZplCompatible === true)
|
|
100
|
+
formats.push('zpl');
|
|
101
|
+
if (p.protocol === 'ipp')
|
|
102
|
+
formats.push('pdf', 'pdf_base64');
|
|
103
|
+
formats.push('html');
|
|
104
|
+
if (formats.length === 1)
|
|
105
|
+
return ['zpl', 'pdf', 'pdf_base64', 'html'];
|
|
106
|
+
return formats;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Parses a series `contextSchema` (free-form JSONB) into typed fields.
|
|
110
|
+
* Supports the two shapes seen in practice:
|
|
111
|
+
* - an array of `{ name, type?, required?, description? }`
|
|
112
|
+
* - an object map `{ NAME: "string" | { type, required?, description? } }`
|
|
113
|
+
* Anything else → `null` (context stays `Record<string, unknown>`).
|
|
114
|
+
*/
|
|
115
|
+
export function parseContextSchema(schema) {
|
|
116
|
+
let value = schema;
|
|
117
|
+
if (typeof value === 'string') {
|
|
118
|
+
try {
|
|
119
|
+
value = JSON.parse(value);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (!value || typeof value !== 'object')
|
|
126
|
+
return null;
|
|
127
|
+
const toTs = (t) => {
|
|
128
|
+
switch (typeof t === 'string' ? t.toLowerCase() : '') {
|
|
129
|
+
case 'number':
|
|
130
|
+
case 'int':
|
|
131
|
+
case 'integer':
|
|
132
|
+
case 'float':
|
|
133
|
+
return 'number';
|
|
134
|
+
case 'boolean':
|
|
135
|
+
case 'bool':
|
|
136
|
+
return 'boolean';
|
|
137
|
+
case 'string':
|
|
138
|
+
case 'text':
|
|
139
|
+
case 'date':
|
|
140
|
+
return 'string';
|
|
141
|
+
default:
|
|
142
|
+
return 'string';
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
if (Array.isArray(value)) {
|
|
146
|
+
const fields = [];
|
|
147
|
+
for (const item of value) {
|
|
148
|
+
if (!item || typeof item !== 'object')
|
|
149
|
+
return null;
|
|
150
|
+
const o = item;
|
|
151
|
+
if (typeof o['name'] !== 'string' || o['name'] === '')
|
|
152
|
+
return null;
|
|
153
|
+
fields.push({
|
|
154
|
+
name: o['name'],
|
|
155
|
+
tsType: toTs(o['type']),
|
|
156
|
+
required: o['required'] === true,
|
|
157
|
+
description: typeof o['description'] === 'string' ? o['description'] : undefined,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return fields;
|
|
161
|
+
}
|
|
162
|
+
// Object map form.
|
|
163
|
+
const entries = Object.entries(value);
|
|
164
|
+
if (entries.length === 0)
|
|
165
|
+
return [];
|
|
166
|
+
const fields = [];
|
|
167
|
+
for (const [name, v] of entries) {
|
|
168
|
+
if (typeof v === 'string') {
|
|
169
|
+
fields.push({ name, tsType: toTs(v), required: false });
|
|
170
|
+
}
|
|
171
|
+
else if (v && typeof v === 'object' && !Array.isArray(v)) {
|
|
172
|
+
const o = v;
|
|
173
|
+
fields.push({
|
|
174
|
+
name,
|
|
175
|
+
tsType: toTs(o['type']),
|
|
176
|
+
required: o['required'] === true,
|
|
177
|
+
description: typeof o['description'] === 'string' ? o['description'] : undefined,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return fields;
|
|
185
|
+
}
|
|
186
|
+
/** Converts a printer display name to a camelCase identifier alias. */
|
|
187
|
+
export function aliasFromName(name) {
|
|
188
|
+
const parts = name
|
|
189
|
+
.replace(/[^A-Za-z0-9]+/g, ' ')
|
|
190
|
+
.trim()
|
|
191
|
+
.split(/\s+/)
|
|
192
|
+
.filter(Boolean);
|
|
193
|
+
if (parts.length === 0)
|
|
194
|
+
return 'printer';
|
|
195
|
+
const [first, ...rest] = parts;
|
|
196
|
+
let alias = first.toLowerCase() + rest.map((p) => p.charAt(0).toUpperCase() + p.slice(1).toLowerCase()).join('');
|
|
197
|
+
if (/^[0-9]/.test(alias))
|
|
198
|
+
alias = `p${alias}`;
|
|
199
|
+
return alias;
|
|
200
|
+
}
|
|
201
|
+
function uniqueAlias(base, used) {
|
|
202
|
+
let alias = base;
|
|
203
|
+
let n = 2;
|
|
204
|
+
while (used.has(alias))
|
|
205
|
+
alias = `${base}${n++}`;
|
|
206
|
+
used.add(alias);
|
|
207
|
+
return alias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C,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxG,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;IAC9C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,IAAiB;IAClD,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,KAAK,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;IAChD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChB,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@datamagik/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "DataMagik dm CLI: login, typegen, dev server, and SPA publish for app-designer SPA apps",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"dm": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"templates",
|
|
16
|
+
"assets"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.json",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"gen:globals": "node scripts/gen-script-globals.mjs",
|
|
22
|
+
"gen:globals:check": "node scripts/gen-script-globals.mjs --check",
|
|
23
|
+
"prepublishOnly": "npm run build"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"archiver": "^7.0.1",
|
|
27
|
+
"commander": "^12.1.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/archiver": "^6.0.3",
|
|
31
|
+
"@types/node": "^22.10.0",
|
|
32
|
+
"typescript": "^5.6.0",
|
|
33
|
+
"vitest": "^3.2.0"
|
|
34
|
+
}
|
|
35
|
+
}
|