@dforge-core/metadata 0.0.12 → 0.0.13
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 +22 -0
- package/dist/index.d.ts +1221 -28
- package/dist/index.js +418 -32
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/schemas/data_views.schema.json +16 -3
- package/schemas/folders.schema.json +18 -2
- package/schemas/reports.schema.json +18 -2
- package/src/filter.ts +35 -3
- package/src/index.ts +9 -1
- 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
|
@@ -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" }
|
|
@@ -366,7 +366,23 @@
|
|
|
366
366
|
"required": ["c", "o"],
|
|
367
367
|
"properties": {
|
|
368
368
|
"c": { "type": "string" },
|
|
369
|
-
"o": {
|
|
369
|
+
"o": {
|
|
370
|
+
"type": "string",
|
|
371
|
+
"enum": [
|
|
372
|
+
"=", "eq", "!=", "notEq",
|
|
373
|
+
">", "gr", ">=", "grEq", "<", "less", "<=", "lessEq",
|
|
374
|
+
"eqRef",
|
|
375
|
+
"contains", "!contains", "nContain",
|
|
376
|
+
"start", "!start", "nStart",
|
|
377
|
+
"end", "!end", "nEnd",
|
|
378
|
+
"mask", "!mask", "nMask",
|
|
379
|
+
"null", "empty", "!null", "nEmpty",
|
|
380
|
+
"in", "!in", "nIn",
|
|
381
|
+
"between", "btw", "!between", "nBetween",
|
|
382
|
+
"f", "func"
|
|
383
|
+
],
|
|
384
|
+
"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."
|
|
385
|
+
},
|
|
370
386
|
"v": {}
|
|
371
387
|
},
|
|
372
388
|
"additionalProperties": false
|
|
@@ -375,7 +391,7 @@
|
|
|
375
391
|
"type": "object",
|
|
376
392
|
"required": ["g", "i"],
|
|
377
393
|
"properties": {
|
|
378
|
-
"g": { "type": "string", "enum": ["and", "or"] },
|
|
394
|
+
"g": { "type": "string", "enum": ["and", "or", "!and", "nAnd", "!or", "nOr"] },
|
|
379
395
|
"i": {
|
|
380
396
|
"type": "array",
|
|
381
397
|
"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 {
|
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"}
|
package/dist/data-views.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { Filter } from "./filter";
|
|
2
|
-
import type { NamedKind } from "./types";
|
|
3
|
-
export type { NamedKind };
|
|
4
|
-
/** `viewType` values for `ui/data_views.json`. Source: data_views.schema.json. */
|
|
5
|
-
export type ViewType = "grid" | "list" | "kanban" | "calendar" | "gallery" | "tree-grid" | "diagram" | "master-detail" | "library" | "matrix";
|
|
6
|
-
/** Friendly picker list of the view kinds. */
|
|
7
|
-
export declare const dataViewKinds: readonly NamedKind[];
|
|
8
|
-
/** A column in a data source: shorthand string code or a configured object. */
|
|
9
|
-
export type ViewColumn = string | {
|
|
10
|
-
/** Column code. */
|
|
11
|
-
column_cd: string;
|
|
12
|
-
/** Column width in pixels. */
|
|
13
|
-
width?: number;
|
|
14
|
-
/** Whether the column is visible (default true). */
|
|
15
|
-
visible?: boolean;
|
|
16
|
-
/** Pin column to an edge. */
|
|
17
|
-
pinned?: "left" | "right";
|
|
18
|
-
};
|
|
19
|
-
/** One data source within a view. */
|
|
20
|
-
export interface DataSource {
|
|
21
|
-
/** Entity code to query. */
|
|
22
|
-
entityCode: string;
|
|
23
|
-
/** Nesting level (0 = root, 1+ = detail). */
|
|
24
|
-
level?: number;
|
|
25
|
-
/** Human-readable label (used in master-detail tabs). */
|
|
26
|
-
label?: string;
|
|
27
|
-
/** Column configuration. */
|
|
28
|
-
columns?: ViewColumn[];
|
|
29
|
-
/** Set field on the parent entity linking to this detail level. */
|
|
30
|
-
parentSetField?: string;
|
|
31
|
-
/** Per-source filter; overrides the view-level filter for this source. */
|
|
32
|
-
filter?: Filter;
|
|
33
|
-
/** Per-source sort order (array of `{ c, d }` entries). */
|
|
34
|
-
order?: unknown;
|
|
35
|
-
}
|
|
36
|
-
export interface KanbanViewConfig {
|
|
37
|
-
/** Dropdown/flags/reference column to group cards by. */
|
|
38
|
-
groupByField: string;
|
|
39
|
-
}
|
|
40
|
-
export interface CalendarViewConfig {
|
|
41
|
-
/** Date/timestamp column used to place events. */
|
|
42
|
-
dateField: string;
|
|
43
|
-
/** Column shown as event title (defaults to the entity toString). */
|
|
44
|
-
titleField?: string;
|
|
45
|
-
/** Column whose value drives the event pill color. */
|
|
46
|
-
colorField?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface TreeGridViewConfig {
|
|
49
|
-
/** Self-referencing FK column (parent record). */
|
|
50
|
-
parentField: string;
|
|
51
|
-
/** Node label field (defaults to entity toString). */
|
|
52
|
-
labelField?: string;
|
|
53
|
-
/** Field containing a Bootstrap icon class per node. */
|
|
54
|
-
iconField?: string;
|
|
55
|
-
}
|
|
56
|
-
export interface ListLevelConfig {
|
|
57
|
-
/** Entity code for this child level. */
|
|
58
|
-
entityCode: string;
|
|
59
|
-
/** FK column in the child entity linking back to the parent. */
|
|
60
|
-
foreignKey: string;
|
|
61
|
-
/** Columns to display inline for each child row. */
|
|
62
|
-
columns?: string[];
|
|
63
|
-
}
|
|
64
|
-
export interface ListViewConfig {
|
|
65
|
-
titleField?: string;
|
|
66
|
-
subtitleField?: string;
|
|
67
|
-
/** Hierarchical child levels for expandable list rows. */
|
|
68
|
-
levels?: ListLevelConfig[];
|
|
69
|
-
}
|
|
70
|
-
export interface DiagramViewConfig {
|
|
71
|
-
/** Column to group diagram nodes by. */
|
|
72
|
-
groupByField?: string;
|
|
73
|
-
/** Group values hidden by default. */
|
|
74
|
-
defaultHiddenGroups?: string[];
|
|
75
|
-
}
|
|
76
|
-
/** A single data view (value in the `ui/data_views.json` map). */
|
|
77
|
-
export interface DataViewDef {
|
|
78
|
-
viewType: ViewType;
|
|
79
|
-
/** Human-readable view name. */
|
|
80
|
-
label?: string;
|
|
81
|
-
/** Bootstrap icon class (e.g. 'bi-bounding-box'). */
|
|
82
|
-
icon?: string;
|
|
83
|
-
description?: string;
|
|
84
|
-
/** Data sources (at least one; master-detail needs two). */
|
|
85
|
-
dataSources: DataSource[];
|
|
86
|
-
/** Default filter applied to all sources unless one declares its own. */
|
|
87
|
-
filter?: Filter;
|
|
88
|
-
/** Default sort order. */
|
|
89
|
-
order?: unknown;
|
|
90
|
-
/** View-type-specific configuration. */
|
|
91
|
-
viewConfig?: KanbanViewConfig | CalendarViewConfig | TreeGridViewConfig | ListViewConfig | DiagramViewConfig | Record<string, unknown>;
|
|
92
|
-
}
|
|
93
|
-
/** A `ui/data_views.json` file: data view code → definition. */
|
|
94
|
-
export type DataViewsFile = Record<string, DataViewDef>;
|
|
95
|
-
//# sourceMappingURL=data-views.d.ts.map
|
package/dist/data-views.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-views.d.ts","sourceRoot":"","sources":["../src/data-views.ts"],"names":[],"mappings":"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"}
|
package/dist/data-views.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Data-view registries + the authoring shape of a `ui/data_views.json` file.
|
|
2
|
-
//
|
|
3
|
-
// `dataViewKinds` is the friendly picker list; `DataViewDef` and friends mirror
|
|
4
|
-
// the structural `data_views.schema.json` so editors/MCP/CLI can build views.
|
|
5
|
-
/** Friendly picker list of the view kinds. */
|
|
6
|
-
export const dataViewKinds = [
|
|
7
|
-
{ cd: "grid", name: "Grid" },
|
|
8
|
-
{ cd: "list", name: "List" },
|
|
9
|
-
{ cd: "kanban", name: "Kanban" },
|
|
10
|
-
{ cd: "calendar", name: "Calendar" },
|
|
11
|
-
{ cd: "gallery", name: "Gallery" },
|
|
12
|
-
{ cd: "tree-grid", name: "Tree Grid" },
|
|
13
|
-
{ cd: "diagram", name: "Diagram" },
|
|
14
|
-
{ cd: "master-detail", name: "Master / Detail" },
|
|
15
|
-
{ cd: "library", name: "Library" },
|
|
16
|
-
{ cd: "matrix", name: "Matrix" },
|
|
17
|
-
];
|
|
18
|
-
//# sourceMappingURL=data-views.js.map
|
package/dist/data-views.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-views.js","sourceRoot":"","sources":["../src/data-views.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAoB9E,8CAA8C;AAC9C,MAAM,CAAC,MAAM,aAAa,GAAyB;IAClD,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAC5B,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAC5B,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;IACpC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE;IACtC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,EAAE,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,iBAAiB,EAAE;IAChD,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;CACvB,CAAC"}
|
package/dist/deps.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Allowed storage-class tokens for a consumed column — Postgres type names with
|
|
3
|
-
* length/scale stripped. Closed allowlist, kept in lockstep with the `type` enum in
|
|
4
|
-
* `deps.schema.json` (and `DependencyContractValidator.ValidColumnTypes` on the C#
|
|
5
|
-
* side); the `schemas.test.ts` parity guard fails if this drifts from the schema.
|
|
6
|
-
* Extend all three together if a provider column legitimately uses a type not here.
|
|
7
|
-
*/
|
|
8
|
-
export declare const DEP_COLUMN_TYPES: readonly ["int2", "int4", "int8", "smallint", "integer", "bigint", "numeric", "decimal", "float4", "float8", "real", "money", "varchar", "text", "char", "bpchar", "bool", "boolean", "date", "time", "timetz", "timestamp", "timestamptz", "uuid", "json", "jsonb", "bytea"];
|
|
9
|
-
/**
|
|
10
|
-
* Storage class pinned for a consumed column — the provider's physical Postgres type
|
|
11
|
-
* with length/scale stripped (e.g. `int8`, `numeric`, `varchar`). dForge's `cuid`
|
|
12
|
-
* Snowflake PK normalizes to `int8`. Pinning the storage class (not a coarse base
|
|
13
|
-
* type) keeps FK/lookup compatibility meaningful — an `int8` key needs `int8`, not
|
|
14
|
-
* any number. One of {@link DEP_COLUMN_TYPES}.
|
|
15
|
-
*/
|
|
16
|
-
export type DepColumnType = (typeof DEP_COLUMN_TYPES)[number];
|
|
17
|
-
/** Whether the consumer reads or writes a column. Default `read`. */
|
|
18
|
-
export type DepColumnMode = "read" | "write";
|
|
19
|
-
/** Kinds of cross-module usage a provenance token can name. */
|
|
20
|
-
export type DepProvenanceKind = "ref" | "extends" | "formula" | "action" | "view" | "report" | "print" | "role";
|
|
21
|
-
/**
|
|
22
|
-
* A usage token of the form `<kind>:<symbol>` — e.g. `ref:invoice.customer`,
|
|
23
|
-
* `extends:party`, `action:check_credit`, `role:fin.admin`. Names the consuming
|
|
24
|
-
* symbol so the completeness lint can reconcile declared vs actual usage. Note:
|
|
25
|
-
* `display` is intentionally not a kind — the label is the provider's concern.
|
|
26
|
-
*/
|
|
27
|
-
export type DepProvenance = `${DepProvenanceKind}:${string}`;
|
|
28
|
-
/** A single consumed provider column. */
|
|
29
|
-
export interface DepColumn {
|
|
30
|
-
/** Storage class — the provider column's physical Postgres type, params stripped (`int8`, `varchar`, `numeric`, …). */
|
|
31
|
-
type: DepColumnType;
|
|
32
|
-
/** Per-column provenance: which symbols read/write/join on this column. */
|
|
33
|
-
use: DepProvenance[];
|
|
34
|
-
/** `write` implies an insert/update right + settable column. Default `read`; omit for reads. */
|
|
35
|
-
mode?: DepColumnMode;
|
|
36
|
-
}
|
|
37
|
-
/** What the consumer needs from one provider entity. */
|
|
38
|
-
export interface DepEntity {
|
|
39
|
-
/** The provider entity's PK column — the anchor every reference joins on. No label/display. */
|
|
40
|
-
pk: string;
|
|
41
|
-
/** Entity-level provenance: why this entity is consumed (ref/extends/role/view/report/print/action). */
|
|
42
|
-
use: DepProvenance[];
|
|
43
|
-
/** Provider columns actually read/written/joined. Omit for extension-only targets. */
|
|
44
|
-
columns?: Record<string, DepColumn>;
|
|
45
|
-
}
|
|
46
|
-
/** A `deps/<provider>.json` file: the consumer's contract against one dependency. */
|
|
47
|
-
export interface DepsFile {
|
|
48
|
-
/** Code of the dependency (provider) module this contract is against (e.g. `parties`). */
|
|
49
|
-
module: string;
|
|
50
|
-
/** Semver range the consumer requires of the provider (e.g. `>=0.1.0`). */
|
|
51
|
-
version: string;
|
|
52
|
-
/** Consumed provider entities, keyed by entity code. */
|
|
53
|
-
entities: Record<string, DepEntity>;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=deps.d.ts.map
|
package/dist/deps.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,+QAOnB,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,qEAAqE;AACrE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7C,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GAC1B,KAAK,GACL,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,iBAAiB,IAAI,MAAM,EAAE,CAAC;AAE7D,yCAAyC;AACzC,MAAM,WAAW,SAAS;IACzB,uHAAuH;IACvH,IAAI,EAAE,aAAa,CAAC;IACpB,2EAA2E;IAC3E,GAAG,EAAE,aAAa,EAAE,CAAC;IACrB,gGAAgG;IAChG,IAAI,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACzB,+FAA+F;IAC/F,EAAE,EAAE,MAAM,CAAC;IACX,wGAAwG;IACxG,GAAG,EAAE,aAAa,EAAE,CAAC;IACrB,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,qFAAqF;AACrF,MAAM,WAAW,QAAQ;IACxB,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC"}
|
package/dist/deps.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Dependency contracts — authoring shape of `deps/<provider>.json`. Mirror of deps.schema.json.
|
|
2
|
-
//
|
|
3
|
-
// One file per dependency declares everything a consumer module consumes from a
|
|
4
|
-
// provider: the entities, columns (each pinned to its provider storage class — a
|
|
5
|
-
// Postgres type token like int8/varchar/numeric, not a base datatype), and the
|
|
6
|
-
// provenance of each usage. The provider stays the source of truth; this is the
|
|
7
|
-
// consumer's import list. See docs/modules/dependency-contracts.md.
|
|
8
|
-
/**
|
|
9
|
-
* Allowed storage-class tokens for a consumed column — Postgres type names with
|
|
10
|
-
* length/scale stripped. Closed allowlist, kept in lockstep with the `type` enum in
|
|
11
|
-
* `deps.schema.json` (and `DependencyContractValidator.ValidColumnTypes` on the C#
|
|
12
|
-
* side); the `schemas.test.ts` parity guard fails if this drifts from the schema.
|
|
13
|
-
* Extend all three together if a provider column legitimately uses a type not here.
|
|
14
|
-
*/
|
|
15
|
-
export const DEP_COLUMN_TYPES = [
|
|
16
|
-
"int2", "int4", "int8", "smallint", "integer", "bigint",
|
|
17
|
-
"numeric", "decimal", "float4", "float8", "real", "money",
|
|
18
|
-
"varchar", "text", "char", "bpchar",
|
|
19
|
-
"bool", "boolean",
|
|
20
|
-
"date", "time", "timetz", "timestamp", "timestamptz",
|
|
21
|
-
"uuid", "json", "jsonb", "bytea",
|
|
22
|
-
];
|
|
23
|
-
//# sourceMappingURL=deps.js.map
|
package/dist/deps.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,+EAA+E;AAC/E,gFAAgF;AAChF,oEAAoE;AAEpE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ;IACvD,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO;IACzD,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ;IACnC,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa;IACpD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;CACvB,CAAC"}
|
package/dist/derive.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Total digits used when building a `numeric(total, scale)` type. */
|
|
2
|
-
export declare const NUMERIC_TOTAL = 18;
|
|
3
|
-
export interface DeriveOptions {
|
|
4
|
-
/** Author-specified max length; overrides the field type's default. */
|
|
5
|
-
maxLen?: number | null;
|
|
6
|
-
/** Author-specified numeric scale; overrides the field type's default. */
|
|
7
|
-
precision?: number | null;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Derive the PostgreSQL `dbDatatype` for a field type. Returns `null` for
|
|
11
|
-
* field types backed by relationships/sets (lookup, grid) that have no physical
|
|
12
|
-
* column of their own. Unknown field types fall back to `varchar`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function deriveDbDatatype(fieldTypeCd: string, options?: DeriveOptions): string | null;
|
|
15
|
-
/** Default `params` to seed a new field of this type with (or `undefined`). */
|
|
16
|
-
export declare function defaultParams(fieldTypeCd: string): Record<string, unknown> | undefined;
|
|
17
|
-
/** The base datatype code a field type maps to (for `baseDatatypeCd` on F columns). */
|
|
18
|
-
export declare function deriveBaseDatatype(fieldTypeCd: string): string | undefined;
|
|
19
|
-
//# sourceMappingURL=derive.d.ts.map
|
package/dist/derive.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AASA,sEAAsE;AACtE,eAAO,MAAM,aAAa,KAAK,CAAC;AAkBhC,MAAM,WAAW,aAAa;IAC7B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,GAAG,IAAI,CA4BhG;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAItF;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1E"}
|