@dforge-core/metadata 0.0.12 → 0.0.14
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/CHANGELOG.md +60 -0
- package/dist/index.d.ts +1251 -28
- package/dist/index.js +418 -32
- package/dist/index.js.map +1 -1
- package/package.json +60 -58
- package/schemas/data_views.schema.json +16 -3
- package/schemas/folders.schema.json +18 -2
- package/schemas/reports.schema.json +25 -4
- package/src/filter.ts +35 -3
- package/src/index.ts +10 -1
- package/src/reports.ts +38 -5
- package/dist/actions.d.ts +0 -31
- package/dist/actions.d.ts.map +0 -1
- package/dist/actions.js +0 -7
- package/dist/actions.js.map +0 -1
- package/dist/aggregation.d.ts +0 -13
- package/dist/aggregation.d.ts.map +0 -1
- package/dist/aggregation.js +0 -17
- package/dist/aggregation.js.map +0 -1
- package/dist/base-datatypes.d.ts +0 -5
- package/dist/base-datatypes.d.ts.map +0 -1
- package/dist/base-datatypes.js +0 -49
- package/dist/base-datatypes.js.map +0 -1
- package/dist/column-types.d.ts +0 -5
- package/dist/column-types.d.ts.map +0 -1
- package/dist/column-types.js +0 -18
- package/dist/column-types.js.map +0 -1
- package/dist/data-views.d.ts +0 -95
- package/dist/data-views.d.ts.map +0 -1
- package/dist/data-views.js +0 -18
- package/dist/data-views.js.map +0 -1
- package/dist/deps.d.ts +0 -55
- package/dist/deps.d.ts.map +0 -1
- package/dist/deps.js +0 -23
- package/dist/deps.js.map +0 -1
- package/dist/derive.d.ts +0 -19
- package/dist/derive.d.ts.map +0 -1
- package/dist/derive.js +0 -68
- package/dist/derive.js.map +0 -1
- package/dist/domains.d.ts +0 -32
- package/dist/domains.d.ts.map +0 -1
- package/dist/domains.js +0 -10
- package/dist/domains.js.map +0 -1
- package/dist/entity-meta.d.ts +0 -18
- package/dist/entity-meta.d.ts.map +0 -1
- package/dist/entity-meta.js +0 -45
- package/dist/entity-meta.js.map +0 -1
- package/dist/entity.d.ts +0 -116
- package/dist/entity.d.ts.map +0 -1
- package/dist/entity.js +0 -7
- package/dist/entity.js.map +0 -1
- package/dist/field-types.d.ts +0 -287
- package/dist/field-types.d.ts.map +0 -1
- package/dist/field-types.js +0 -58
- package/dist/field-types.js.map +0 -1
- package/dist/filter.d.ts +0 -26
- package/dist/filter.d.ts.map +0 -1
- package/dist/filter.js +0 -7
- package/dist/filter.js.map +0 -1
- package/dist/folders.d.ts +0 -32
- package/dist/folders.d.ts.map +0 -1
- package/dist/folders.js +0 -6
- package/dist/folders.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jobs.d.ts +0 -32
- package/dist/jobs.d.ts.map +0 -1
- package/dist/jobs.js +0 -3
- package/dist/jobs.js.map +0 -1
- package/dist/manifest.d.ts +0 -53
- package/dist/manifest.d.ts.map +0 -1
- package/dist/manifest.js +0 -4
- package/dist/manifest.js.map +0 -1
- package/dist/menus.d.ts +0 -32
- package/dist/menus.d.ts.map +0 -1
- package/dist/menus.js +0 -3
- package/dist/menus.js.map +0 -1
- package/dist/print-templates.d.ts +0 -36
- package/dist/print-templates.d.ts.map +0 -1
- package/dist/print-templates.js +0 -4
- package/dist/print-templates.js.map +0 -1
- package/dist/reports.d.ts +0 -84
- package/dist/reports.d.ts.map +0 -1
- package/dist/reports.js +0 -24
- package/dist/reports.js.map +0 -1
- package/dist/roles.d.ts +0 -10
- package/dist/roles.d.ts.map +0 -1
- package/dist/roles.js +0 -3
- package/dist/roles.js.map +0 -1
- package/dist/seed-data.d.ts +0 -8
- package/dist/seed-data.d.ts.map +0 -1
- package/dist/seed-data.js +0 -4
- package/dist/seed-data.js.map +0 -1
- package/dist/settings.d.ts +0 -26
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js +0 -3
- package/dist/settings.js.map +0 -1
- package/dist/traits.d.ts +0 -14
- package/dist/traits.d.ts.map +0 -1
- package/dist/traits.js +0 -121
- package/dist/traits.js.map +0 -1
- package/dist/triggers.d.ts +0 -28
- package/dist/triggers.d.ts.map +0 -1
- package/dist/triggers.js +0 -3
- package/dist/triggers.js.map +0 -1
- package/dist/types.d.ts +0 -128
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -7
- package/dist/types.js.map +0 -1
- package/dist/webhooks.d.ts +0 -31
- package/dist/webhooks.d.ts.map +0 -1
- package/dist/webhooks.js +0 -3
- package/dist/webhooks.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,60 +1,62 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
2
|
+
"name": "@dforge-core/metadata",
|
|
3
|
+
"version": "0.0.14",
|
|
4
|
+
"description": "Canonical dForge authoring registries — field types, base datatypes, column types, traits, data-view kinds and chart types — with derivation helpers. Runtime-dependency-free; the single source of truth shared by editors, the web app and the CLI.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "dForge",
|
|
7
|
+
"homepage": "https://github.com/iash44/dForge-core/tree/main/clients/packages/metadata#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/iash44/dForge-core.git",
|
|
11
|
+
"directory": "clients/packages/metadata"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/iash44/dForge-core/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"dforge",
|
|
18
|
+
"metadata",
|
|
19
|
+
"field-type",
|
|
20
|
+
"trait",
|
|
21
|
+
"registry",
|
|
22
|
+
"low-code"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"source": "./src/index.ts",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./schemas/*": "./schemas/*",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"src",
|
|
43
|
+
"schemas",
|
|
44
|
+
"CHANGELOG.md"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"sync-schemas": "node scripts/sync-schemas.mjs",
|
|
48
|
+
"build": "tsup",
|
|
49
|
+
"dev": "tsup --watch",
|
|
50
|
+
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"prepack": "pnpm sync-schemas && pnpm typecheck && pnpm build",
|
|
53
|
+
"package": "pnpm pack"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "^25.9.4",
|
|
57
|
+
"ajv": "^8.20.0",
|
|
58
|
+
"tsup": "^8.5.1",
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"vitest": "^4.1.10"
|
|
61
|
+
}
|
|
60
62
|
}
|
|
@@ -492,7 +492,20 @@
|
|
|
492
492
|
},
|
|
493
493
|
"o": {
|
|
494
494
|
"type": "string",
|
|
495
|
-
"
|
|
495
|
+
"enum": [
|
|
496
|
+
"=", "eq", "!=", "notEq",
|
|
497
|
+
">", "gr", ">=", "grEq", "<", "less", "<=", "lessEq",
|
|
498
|
+
"eqRef",
|
|
499
|
+
"contains", "!contains", "nContain",
|
|
500
|
+
"start", "!start", "nStart",
|
|
501
|
+
"end", "!end", "nEnd",
|
|
502
|
+
"mask", "!mask", "nMask",
|
|
503
|
+
"null", "empty", "!null", "nEmpty",
|
|
504
|
+
"in", "!in", "nIn",
|
|
505
|
+
"between", "btw", "!between", "nBetween",
|
|
506
|
+
"f", "func"
|
|
507
|
+
],
|
|
508
|
+
"description": "Operator. Closed set — this is exactly what the server's FilterBuilder translates, and an operator outside it is rejected at install. Symbolic forms and their word aliases are equivalent ('=' / 'eq', '!=' / 'notEq', '>' / 'gr', '>=' / 'grEq', '<' / 'less', '<=' / 'lessEq'); a leading '!' negates, with 'n'-prefixed spellings as the alias ('!in' / 'nIn'). Null checks are 'null' / 'empty' and '!null' / 'nEmpty' (NOT 'isNull' / 'isNotNull'); substring matching is 'contains' (NOT 'like'). 'eqRef' compares against another column (v = column code), 'f' / 'func' takes v = {fn: 'isToday' | 'isYesterday' | 'isThisWeek' | 'isThisMonth' | 'isThisYear' | 'isPast' | 'isFuture' | 'isCurrentUser'}."
|
|
496
509
|
},
|
|
497
510
|
"v": {
|
|
498
511
|
"description": "Comparison value. Scalars, arrays (for in/nIn), or parameter references like '@param_code'."
|
|
@@ -506,8 +519,8 @@
|
|
|
506
519
|
"properties": {
|
|
507
520
|
"g": {
|
|
508
521
|
"type": "string",
|
|
509
|
-
"enum": ["and", "or"],
|
|
510
|
-
"description": "Group combinator"
|
|
522
|
+
"enum": ["and", "or", "!and", "nAnd", "!or", "nOr"],
|
|
523
|
+
"description": "Group combinator. '!and' / '!or' negate the whole group ('nAnd' / 'nOr' are the alias spellings). Closed set — an unknown combinator is rejected at install (at query time it would silently fall back to AND)."
|
|
511
524
|
},
|
|
512
525
|
"i": {
|
|
513
526
|
"type": "array",
|
|
@@ -87,7 +87,23 @@
|
|
|
87
87
|
"required": ["c", "o"],
|
|
88
88
|
"properties": {
|
|
89
89
|
"c": { "type": "string" },
|
|
90
|
-
"o": {
|
|
90
|
+
"o": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"enum": [
|
|
93
|
+
"=", "eq", "!=", "notEq",
|
|
94
|
+
">", "gr", ">=", "grEq", "<", "less", "<=", "lessEq",
|
|
95
|
+
"eqRef",
|
|
96
|
+
"contains", "!contains", "nContain",
|
|
97
|
+
"start", "!start", "nStart",
|
|
98
|
+
"end", "!end", "nEnd",
|
|
99
|
+
"mask", "!mask", "nMask",
|
|
100
|
+
"null", "empty", "!null", "nEmpty",
|
|
101
|
+
"in", "!in", "nIn",
|
|
102
|
+
"between", "btw", "!between", "nBetween",
|
|
103
|
+
"f", "func"
|
|
104
|
+
],
|
|
105
|
+
"description": "Operator — same closed set as data_views.json. Null checks are 'null' / '!null' (NOT 'isNull' / 'isNotNull'); substring matching is 'contains' (NOT 'like'). An operator outside this set is rejected at install; at query time it would be dropped, widening the row filter it was meant to enforce."
|
|
106
|
+
},
|
|
91
107
|
"v": {}
|
|
92
108
|
},
|
|
93
109
|
"additionalProperties": false
|
|
@@ -96,7 +112,7 @@
|
|
|
96
112
|
"type": "object",
|
|
97
113
|
"required": ["g", "i"],
|
|
98
114
|
"properties": {
|
|
99
|
-
"g": { "type": "string", "enum": ["and", "or"] },
|
|
115
|
+
"g": { "type": "string", "enum": ["and", "or", "!and", "nAnd", "!or", "nOr"] },
|
|
100
116
|
"i": {
|
|
101
117
|
"type": "array",
|
|
102
118
|
"items": { "$ref": "#/$defs/filter" }
|
|
@@ -314,11 +314,16 @@
|
|
|
314
314
|
|
|
315
315
|
"paramDef": {
|
|
316
316
|
"type": "object",
|
|
317
|
-
"required": ["fieldTypeCd"],
|
|
317
|
+
"not": { "required": ["fieldTypeCd", "domain"] },
|
|
318
318
|
"properties": {
|
|
319
319
|
"fieldTypeCd": {
|
|
320
320
|
"type": "string",
|
|
321
|
-
"description": "Field type code (see settings.schema.json for the common list)"
|
|
321
|
+
"description": "Field type code (see settings.schema.json for the common list). Omit when `domain` is set — the domain supplies the control. May also be omitted entirely: a param declaring neither key installs as `text` (ReportRegistrar.DefaultParamFieldTypeCd). The one rejected combination is declaring both."
|
|
322
|
+
},
|
|
323
|
+
"domain": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"description": "Column domain (`domain_cd` or `module_cd.domain_cd`) the parameter borrows its control and option list from. The options and their translations stay on the domain, so a list shared with an entity column is authored once. The DSL equivalent for action params is `paramCd: domain <domainCd>`.",
|
|
326
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)?$"
|
|
322
327
|
},
|
|
323
328
|
"label": { "type": "string" },
|
|
324
329
|
"orderNum": {
|
|
@@ -366,7 +371,23 @@
|
|
|
366
371
|
"required": ["c", "o"],
|
|
367
372
|
"properties": {
|
|
368
373
|
"c": { "type": "string" },
|
|
369
|
-
"o": {
|
|
374
|
+
"o": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"enum": [
|
|
377
|
+
"=", "eq", "!=", "notEq",
|
|
378
|
+
">", "gr", ">=", "grEq", "<", "less", "<=", "lessEq",
|
|
379
|
+
"eqRef",
|
|
380
|
+
"contains", "!contains", "nContain",
|
|
381
|
+
"start", "!start", "nStart",
|
|
382
|
+
"end", "!end", "nEnd",
|
|
383
|
+
"mask", "!mask", "nMask",
|
|
384
|
+
"null", "empty", "!null", "nEmpty",
|
|
385
|
+
"in", "!in", "nIn",
|
|
386
|
+
"between", "btw", "!between", "nBetween",
|
|
387
|
+
"f", "func"
|
|
388
|
+
],
|
|
389
|
+
"description": "Operator — same closed set as data_views.json. Null checks are 'null' / '!null' (NOT 'isNull' / 'isNotNull'); substring matching is 'contains' (NOT 'like'). An operator outside this set is rejected at install; at query time it would be dropped, silently widening the dataset."
|
|
390
|
+
},
|
|
370
391
|
"v": {}
|
|
371
392
|
},
|
|
372
393
|
"additionalProperties": false
|
|
@@ -375,7 +396,7 @@
|
|
|
375
396
|
"type": "object",
|
|
376
397
|
"required": ["g", "i"],
|
|
377
398
|
"properties": {
|
|
378
|
-
"g": { "type": "string", "enum": ["and", "or"] },
|
|
399
|
+
"g": { "type": "string", "enum": ["and", "or", "!and", "nAnd", "!or", "nOr"] },
|
|
379
400
|
"i": {
|
|
380
401
|
"type": "array",
|
|
381
402
|
"items": { "$ref": "#/$defs/filter" }
|
package/src/filter.ts
CHANGED
|
@@ -4,12 +4,44 @@
|
|
|
4
4
|
// API: either a single condition `{c, o, v}` or a group `{g, i: [...]}`. Mirror
|
|
5
5
|
// of the `filter` $def repeated across data_views / reports / folders schemas.
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Every operator the server's FilterBuilder translates — the closed set the
|
|
9
|
+
* `o` enum in the data_views / reports / folders schemas mirrors, and the set
|
|
10
|
+
* the installer validates a package's filters against.
|
|
11
|
+
*
|
|
12
|
+
* Symbolic forms and their word aliases are equivalent (`=`/`eq`, `!=`/`notEq`,
|
|
13
|
+
* `>`/`gr`, …); a leading `!` negates, with `n`-prefixed spellings as the alias
|
|
14
|
+
* (`!in`/`nIn`). Note the two spellings authors most often get wrong: null
|
|
15
|
+
* checks are `null` / `!null` (not `isNull` / `isNotNull`) and substring
|
|
16
|
+
* matching is `contains` (not `like`).
|
|
17
|
+
*/
|
|
18
|
+
export const FILTER_OPERATORS = [
|
|
19
|
+
"=", "eq", "!=", "notEq",
|
|
20
|
+
">", "gr", ">=", "grEq", "<", "less", "<=", "lessEq",
|
|
21
|
+
"eqRef",
|
|
22
|
+
"contains", "!contains", "nContain",
|
|
23
|
+
"start", "!start", "nStart",
|
|
24
|
+
"end", "!end", "nEnd",
|
|
25
|
+
"mask", "!mask", "nMask",
|
|
26
|
+
"null", "empty", "!null", "nEmpty",
|
|
27
|
+
"in", "!in", "nIn",
|
|
28
|
+
"between", "btw", "!between", "nBetween",
|
|
29
|
+
"f", "func",
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
32
|
+
export type FilterOperator = (typeof FILTER_OPERATORS)[number];
|
|
33
|
+
|
|
34
|
+
/** Every group combinator the server recognizes. `!`/`n` forms negate the group. */
|
|
35
|
+
export const FILTER_GROUP_OPERATORS = ["and", "or", "!and", "nAnd", "!or", "nOr"] as const;
|
|
36
|
+
|
|
37
|
+
export type FilterGroupOperator = (typeof FILTER_GROUP_OPERATORS)[number];
|
|
38
|
+
|
|
7
39
|
/** A single filter condition. */
|
|
8
40
|
export interface FilterCondition {
|
|
9
41
|
/** Column code (supports dot navigation: 'customer.name'). */
|
|
10
42
|
c: string;
|
|
11
|
-
/** Operator
|
|
12
|
-
o:
|
|
43
|
+
/** Operator — see {@link FILTER_OPERATORS}. */
|
|
44
|
+
o: FilterOperator;
|
|
13
45
|
/** Comparison value: scalar, array (in/nIn) or a `@param_code` reference. */
|
|
14
46
|
v?: unknown;
|
|
15
47
|
}
|
|
@@ -17,7 +49,7 @@ export interface FilterCondition {
|
|
|
17
49
|
/** A boolean group of nested conditions/sub-groups. */
|
|
18
50
|
export interface FilterGroup {
|
|
19
51
|
/** Group combinator. */
|
|
20
|
-
g:
|
|
52
|
+
g: FilterGroupOperator;
|
|
21
53
|
/** Group items: nested conditions or sub-groups. */
|
|
22
54
|
i: Filter[];
|
|
23
55
|
}
|
package/src/index.ts
CHANGED
|
@@ -43,7 +43,15 @@ export {
|
|
|
43
43
|
} from "./derive";
|
|
44
44
|
|
|
45
45
|
// ── Shared filter expression (data views / reports / folders / API) ──────────
|
|
46
|
-
export type {
|
|
46
|
+
export type {
|
|
47
|
+
Filter,
|
|
48
|
+
FilterCondition,
|
|
49
|
+
FilterGroup,
|
|
50
|
+
FilterGroupOperator,
|
|
51
|
+
FilterOperator,
|
|
52
|
+
SortClause,
|
|
53
|
+
} from "./filter";
|
|
54
|
+
export { FILTER_GROUP_OPERATORS, FILTER_OPERATORS } from "./filter";
|
|
47
55
|
|
|
48
56
|
// ── Module-file structural types ─────────────────────────────────────────────
|
|
49
57
|
export type {
|
|
@@ -86,6 +94,7 @@ export {
|
|
|
86
94
|
type ReportQuery,
|
|
87
95
|
type ColumnDef,
|
|
88
96
|
type ParamDef,
|
|
97
|
+
type ParamDefBase,
|
|
89
98
|
type VizType,
|
|
90
99
|
} from "./reports";
|
|
91
100
|
|
package/src/reports.ts
CHANGED
|
@@ -30,10 +30,8 @@ export const chartTypes: readonly NamedKind[] = [
|
|
|
30
30
|
{ cd: "funnel", name: "Funnel" },
|
|
31
31
|
] as const;
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
export interface
|
|
35
|
-
/** Field type code (see settings for the common list). */
|
|
36
|
-
fieldTypeCd: string;
|
|
33
|
+
/** Everything a report parameter carries regardless of where its control comes from. */
|
|
34
|
+
export interface ParamDefBase {
|
|
37
35
|
label?: string;
|
|
38
36
|
/** Display order in the parameter form (falls back to declaration order). */
|
|
39
37
|
orderNum?: number;
|
|
@@ -45,10 +43,45 @@ export interface ParamDef {
|
|
|
45
43
|
default?: unknown;
|
|
46
44
|
/** Entity link for lookup-type params. */
|
|
47
45
|
link?: { entity: string; otherKey?: string };
|
|
48
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Field-type-specific params — most importantly `options` for a dropdown.
|
|
48
|
+
* Options accept the same rich `{value,label,icon,color}` form entity columns
|
|
49
|
+
* use; a bare string list renders the raw codes in every locale, so label them.
|
|
50
|
+
* Omitted on a domain-backed param: the domain owns the list.
|
|
51
|
+
*/
|
|
49
52
|
params?: Record<string, unknown>;
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
/**
|
|
56
|
+
* A report parameter definition (report- or dataset-level).
|
|
57
|
+
*
|
|
58
|
+
* A parameter takes its control from an explicit `fieldTypeCd` **or** from a
|
|
59
|
+
* column `domain` — never both. Declaring both is the one rejected combination
|
|
60
|
+
* (`not: { required: ["fieldTypeCd", "domain"] }` in `reports.schema.json`, and an
|
|
61
|
+
* install-time check that refuses to silently pick a winner). Declaring **neither**
|
|
62
|
+
* is fine: the param installs as `text`.
|
|
63
|
+
*
|
|
64
|
+
* Prefer `domain` whenever the choices are the same list a column uses (the usual
|
|
65
|
+
* case, since the value normally ends up written to that column): the options and
|
|
66
|
+
* their translations then live on the domain and are authored once, instead of
|
|
67
|
+
* being restated per parameter and left to drift.
|
|
68
|
+
*/
|
|
69
|
+
export type ParamDef =
|
|
70
|
+
| (ParamDefBase & {
|
|
71
|
+
/** Field type code (see settings for the common list). Defaults to `text`. */
|
|
72
|
+
fieldTypeCd?: string;
|
|
73
|
+
domain?: never;
|
|
74
|
+
})
|
|
75
|
+
| (ParamDefBase & {
|
|
76
|
+
/**
|
|
77
|
+
* Column domain (`domain_cd` or `module_cd.domain_cd`) supplying the control
|
|
78
|
+
* and the option list. The DSL equivalent for action params is
|
|
79
|
+
* `paramCd: domain <domainCd>`.
|
|
80
|
+
*/
|
|
81
|
+
domain: string;
|
|
82
|
+
fieldTypeCd?: never;
|
|
83
|
+
});
|
|
84
|
+
|
|
52
85
|
/** SQL/entity query for a `datasetType: 'Q'` dataset. */
|
|
53
86
|
export interface ReportQuery {
|
|
54
87
|
/** Source entity code. */
|
package/dist/actions.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execution mode. 'single' (default) and 'each' run the DSL per selected record;
|
|
3
|
-
* 'batch' runs once with all records exposed as `__records`.
|
|
4
|
-
*/
|
|
5
|
-
export type ActionExecutionMode = "single" | "each" | "batch";
|
|
6
|
-
/** A single action declaration (value in the `ui/actions.json` map). */
|
|
7
|
-
export interface ActionDef {
|
|
8
|
-
/** Human-readable description. */
|
|
9
|
-
description: string;
|
|
10
|
-
/** Button label. */
|
|
11
|
-
label: string;
|
|
12
|
-
/** Bootstrap icon class (e.g. 'bi-telephone-check'). */
|
|
13
|
-
icon: string;
|
|
14
|
-
/** Entity code this action targets. */
|
|
15
|
-
entityCode: string;
|
|
16
|
-
/** Per-record vs. batch execution. */
|
|
17
|
-
executionMode: ActionExecutionMode;
|
|
18
|
-
/** DSL script name (file under `logic/actions/<script>.dsl`). */
|
|
19
|
-
script: string;
|
|
20
|
-
/** Run inside a transaction (failures roll back). */
|
|
21
|
-
isTransacted?: boolean;
|
|
22
|
-
/** Display order. */
|
|
23
|
-
orderNum?: number;
|
|
24
|
-
/** Run in the background (newer `async`; some modules use `isAsync`). */
|
|
25
|
-
async?: boolean;
|
|
26
|
-
/** Alternate spelling of `async` used by some modules. Prefer `async`. */
|
|
27
|
-
isAsync?: boolean;
|
|
28
|
-
}
|
|
29
|
-
/** A `ui/actions.json` file: action code → definition. */
|
|
30
|
-
export type ActionsFile = Record<string, ActionDef>;
|
|
31
|
-
//# sourceMappingURL=actions.d.ts.map
|
package/dist/actions.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9D,wEAAwE;AACxE,MAAM,WAAW,SAAS;IACzB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,aAAa,EAAE,mBAAmB,CAAC;IACnC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC"}
|
package/dist/actions.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Actions — authoring shape of `ui/actions.json`.
|
|
2
|
-
//
|
|
3
|
-
// There is no published JSON schema for actions; this mirrors the shape used
|
|
4
|
-
// across the core modules. Parameter declarations and logic live in the action
|
|
5
|
-
// DSL file (`logic/actions/<script>.dsl`), not here.
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=actions.js.map
|
package/dist/actions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,qDAAqD"}
|
package/dist/aggregation.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const AggType: {
|
|
2
|
-
readonly Sum: "sum";
|
|
3
|
-
readonly Count: "count";
|
|
4
|
-
readonly Avg: "avg";
|
|
5
|
-
readonly Min: "min";
|
|
6
|
-
readonly Max: "max";
|
|
7
|
-
readonly Group: "group";
|
|
8
|
-
};
|
|
9
|
-
/** One of the aggregation codes ("sum" | "count" | …). */
|
|
10
|
-
export type AggType = (typeof AggType)[keyof typeof AggType];
|
|
11
|
-
/** All aggregation types as an array (useful for iteration). */
|
|
12
|
-
export declare const AGG_TYPE_LIST: readonly AggType[];
|
|
13
|
-
//# sourceMappingURL=aggregation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aggregation.d.ts","sourceRoot":"","sources":["../src/aggregation.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAC;AAEX,0DAA0D;AAC1D,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE7D,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAA2B,CAAC"}
|
package/dist/aggregation.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Aggregation types — the kinds of aggregation a column/report value can use.
|
|
2
|
-
//
|
|
3
|
-
// Declared as a `const` object + derived union (not a TS `enum`) so the package
|
|
4
|
-
// stays enum-free like the rest of its registries, while callers keep the
|
|
5
|
-
// ergonomic `AggType.Sum` member access. `AggType.Sum === "sum"` at runtime, so
|
|
6
|
-
// the value is interchangeable with the plain string everywhere.
|
|
7
|
-
export const AggType = {
|
|
8
|
-
Sum: "sum",
|
|
9
|
-
Count: "count",
|
|
10
|
-
Avg: "avg",
|
|
11
|
-
Min: "min",
|
|
12
|
-
Max: "max",
|
|
13
|
-
Group: "group",
|
|
14
|
-
};
|
|
15
|
-
/** All aggregation types as an array (useful for iteration). */
|
|
16
|
-
export const AGG_TYPE_LIST = Object.values(AggType);
|
|
17
|
-
//# sourceMappingURL=aggregation.js.map
|
package/dist/aggregation.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aggregation.js","sourceRoot":"","sources":["../src/aggregation.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAChF,iEAAiE;AAEjE,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACL,CAAC;AAKX,gEAAgE;AAChE,MAAM,CAAC,MAAM,aAAa,GAAuB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/base-datatypes.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { BaseDatatypeCd } from "./types";
|
|
2
|
-
export declare const baseDatatypes: readonly BaseDatatypeCd[];
|
|
3
|
-
/** Default PostgreSQL type for a base datatype, or `null` if non-physical. */
|
|
4
|
-
export declare function baseToDbDatatype(base: string): string | null;
|
|
5
|
-
//# sourceMappingURL=base-datatypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-datatypes.d.ts","sourceRoot":"","sources":["../src/base-datatypes.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,aAAa,EAAE,SAAS,cAAc,EAiBzC,CAAC;AAuBX,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE5D"}
|
package/dist/base-datatypes.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Base datatype registry — mirror of
|
|
2
|
-
// server/database/system-modules/metadata/seed-data/base_datatypes.json
|
|
3
|
-
//
|
|
4
|
-
// Plus the canonical mapping from an abstract base datatype to the default
|
|
5
|
-
// PostgreSQL column type the platform generates. The visual editor uses this so
|
|
6
|
-
// the author never has to type a raw SQL type.
|
|
7
|
-
export const baseDatatypes = [
|
|
8
|
-
"binary",
|
|
9
|
-
"bool",
|
|
10
|
-
"culture",
|
|
11
|
-
"cuid",
|
|
12
|
-
"date",
|
|
13
|
-
"guid",
|
|
14
|
-
"json",
|
|
15
|
-
"link",
|
|
16
|
-
"number",
|
|
17
|
-
"project",
|
|
18
|
-
"ref",
|
|
19
|
-
"set",
|
|
20
|
-
"string",
|
|
21
|
-
"time",
|
|
22
|
-
"timestamp",
|
|
23
|
-
"xml",
|
|
24
|
-
];
|
|
25
|
-
// Default PostgreSQL type per base datatype. `null` entries are non-physical
|
|
26
|
-
// (relationship/virtual) base types that never produce a column on their own.
|
|
27
|
-
const BASE_TO_DB = {
|
|
28
|
-
binary: "bytea",
|
|
29
|
-
bool: "bool",
|
|
30
|
-
culture: "varchar",
|
|
31
|
-
cuid: "cuid",
|
|
32
|
-
date: "date",
|
|
33
|
-
guid: "uuid",
|
|
34
|
-
json: "jsonb",
|
|
35
|
-
link: null,
|
|
36
|
-
number: "numeric",
|
|
37
|
-
project: "varchar",
|
|
38
|
-
ref: null,
|
|
39
|
-
set: null,
|
|
40
|
-
string: "varchar",
|
|
41
|
-
time: "time",
|
|
42
|
-
timestamp: "timestamptz",
|
|
43
|
-
xml: "xml",
|
|
44
|
-
};
|
|
45
|
-
/** Default PostgreSQL type for a base datatype, or `null` if non-physical. */
|
|
46
|
-
export function baseToDbDatatype(base) {
|
|
47
|
-
return BASE_TO_DB[base] ?? null;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=base-datatypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-datatypes.js","sourceRoot":"","sources":["../src/base-datatypes.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,0EAA0E;AAC1E,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,+CAA+C;AAI/C,MAAM,CAAC,MAAM,aAAa,GAA8B;IACvD,QAAQ;IACR,MAAM;IACN,SAAS;IACT,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,KAAK;IACL,KAAK;IACL,QAAQ;IACR,MAAM;IACN,WAAW;IACX,KAAK;CACI,CAAC;AAEX,6EAA6E;AAC7E,8EAA8E;AAC9E,MAAM,UAAU,GAA0C;IACzD,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,aAAa;IACxB,GAAG,EAAE,KAAK;CACV,CAAC;AAEF,8EAA8E;AAC9E,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC5C,OAAQ,UAA4C,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACpE,CAAC"}
|
package/dist/column-types.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ColumnTypeDef } from "./types";
|
|
2
|
-
export declare const columnTypes: readonly ColumnTypeDef[];
|
|
3
|
-
/** Look up a column type by letter. */
|
|
4
|
-
export declare function getColumnType(cd: string): ColumnTypeDef | undefined;
|
|
5
|
-
//# sourceMappingURL=column-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-types.d.ts","sourceRoot":"","sources":["../src/column-types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,WAAW,EAAE,SAAS,aAAa,EAQtC,CAAC;AAIX,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEnE"}
|
package/dist/column-types.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Column-type registry — the seven column kinds a field can have. Letters match
|
|
2
|
-
// the `column.column_type` values and entity.schema.json. The `name` /
|
|
3
|
-
// `description` here drive the friendly "what kind of field is this?" picker.
|
|
4
|
-
export const columnTypes = [
|
|
5
|
-
{ cd: "D", name: "Value", description: "A plain data column stored on this entity." },
|
|
6
|
-
{ cd: "R", name: "Reference", description: "An N:1 lookup to another entity (foreign key)." },
|
|
7
|
-
{ cd: "S", name: "Child list", description: "A 1:N collection of child records from another entity." },
|
|
8
|
-
{ cd: "F", name: "Formula", description: "A virtual value calculated from a formula expression." },
|
|
9
|
-
{ cd: "G", name: "Generated", description: "A physical column auto-maintained by the database (aggregate or expression)." },
|
|
10
|
-
{ cd: "A", name: "Accumulation register", description: "Posts this document into a balance entity (single direction)." },
|
|
11
|
-
{ cd: "L", name: "Ledger register", description: "Posts document lines into movements + balances (double entry)." },
|
|
12
|
-
];
|
|
13
|
-
const byCd = new Map(columnTypes.map((ct) => [ct.cd, ct]));
|
|
14
|
-
/** Look up a column type by letter. */
|
|
15
|
-
export function getColumnType(cd) {
|
|
16
|
-
return byCd.get(cd);
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=column-types.js.map
|
package/dist/column-types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-types.js","sourceRoot":"","sources":["../src/column-types.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uEAAuE;AACvE,8EAA8E;AAI9E,MAAM,CAAC,MAAM,WAAW,GAA6B;IACpD,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,4CAA4C,EAAE;IACrF,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,gDAAgD,EAAE;IAC7F,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,wDAAwD,EAAE;IACtG,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,uDAAuD,EAAE;IAClG,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,8EAA8E,EAAE;IAC3H,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,uBAAuB,EAAE,WAAW,EAAE,+DAA+D,EAAE;IACxH,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,gEAAgE,EAAE;CAC1G,CAAC;AAEX,MAAM,IAAI,GAAG,IAAI,GAAG,CAAwB,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAElF,uCAAuC;AACvC,MAAM,UAAU,aAAa,CAAC,EAAU;IACvC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC"}
|