@sequenceholdings/pipeline-spec 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/README.md +114 -0
- package/dist/authoring/per-table-ingestion.d.ts +74 -0
- package/dist/authoring/per-table-ingestion.d.ts.map +1 -0
- package/dist/authoring/per-table-ingestion.js +122 -0
- package/dist/authoring/per-table-ingestion.js.map +1 -0
- package/dist/authoring/yaml.d.ts +6 -0
- package/dist/authoring/yaml.d.ts.map +1 -0
- package/dist/authoring/yaml.js +15 -0
- package/dist/authoring/yaml.js.map +1 -0
- package/dist/binding-gaps.d.ts +21 -0
- package/dist/binding-gaps.d.ts.map +1 -0
- package/dist/binding-gaps.js +74 -0
- package/dist/binding-gaps.js.map +1 -0
- package/dist/bodies/ingestion.d.ts +359 -0
- package/dist/bodies/ingestion.d.ts.map +1 -0
- package/dist/bodies/ingestion.js +446 -0
- package/dist/bodies/ingestion.js.map +1 -0
- package/dist/bodies/serving.d.ts +316 -0
- package/dist/bodies/serving.d.ts.map +1 -0
- package/dist/bodies/serving.js +290 -0
- package/dist/bodies/serving.js.map +1 -0
- package/dist/bodies/transformation.d.ts +397 -0
- package/dist/bodies/transformation.d.ts.map +1 -0
- package/dist/bodies/transformation.js +278 -0
- package/dist/bodies/transformation.js.map +1 -0
- package/dist/catalog-binding.d.ts +15 -0
- package/dist/catalog-binding.d.ts.map +1 -0
- package/dist/catalog-binding.js +15 -0
- package/dist/catalog-binding.js.map +1 -0
- package/dist/columns.d.ts +177 -0
- package/dist/columns.d.ts.map +1 -0
- package/dist/columns.js +89 -0
- package/dist/columns.js.map +1 -0
- package/dist/compatibility.d.ts +25 -0
- package/dist/compatibility.d.ts.map +1 -0
- package/dist/compatibility.js +108 -0
- package/dist/compatibility.js.map +1 -0
- package/dist/constants.d.ts +95 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +105 -0
- package/dist/constants.js.map +1 -0
- package/dist/diff.d.ts +36 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +300 -0
- package/dist/diff.js.map +1 -0
- package/dist/documentation.d.ts +22 -0
- package/dist/documentation.d.ts.map +1 -0
- package/dist/documentation.js +43 -0
- package/dist/documentation.js.map +1 -0
- package/dist/envelope.d.ts +1241 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/envelope.js +163 -0
- package/dist/envelope.js.map +1 -0
- package/dist/errors.d.ts +30 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +47 -0
- package/dist/errors.js.map +1 -0
- package/dist/graph-references.d.ts +34 -0
- package/dist/graph-references.d.ts.map +1 -0
- package/dist/graph-references.js +81 -0
- package/dist/graph-references.js.map +1 -0
- package/dist/graph.d.ts +112 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +546 -0
- package/dist/graph.js.map +1 -0
- package/dist/hash.d.ts +28 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +91 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/issues.d.ts +14 -0
- package/dist/issues.d.ts.map +1 -0
- package/dist/issues.js +27 -0
- package/dist/issues.js.map +1 -0
- package/dist/loader.d.ts +50 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +241 -0
- package/dist/loader.js.map +1 -0
- package/dist/migrations/contracts.d.ts +38 -0
- package/dist/migrations/contracts.d.ts.map +1 -0
- package/dist/migrations/contracts.js +175 -0
- package/dist/migrations/contracts.js.map +1 -0
- package/dist/migrations/manifest.d.ts +137 -0
- package/dist/migrations/manifest.d.ts.map +1 -0
- package/dist/migrations/manifest.js +137 -0
- package/dist/migrations/manifest.js.map +1 -0
- package/dist/operations.d.ts +214 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +275 -0
- package/dist/operations.js.map +1 -0
- package/dist/orm-satisfies.d.ts +132 -0
- package/dist/orm-satisfies.d.ts.map +1 -0
- package/dist/orm-satisfies.js +119 -0
- package/dist/orm-satisfies.js.map +1 -0
- package/dist/primitives.d.ts +11 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +20 -0
- package/dist/primitives.js.map +1 -0
- package/dist/resolve.d.ts +124 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +194 -0
- package/dist/resolve.js.map +1 -0
- package/dist/secret-scan.d.ts +34 -0
- package/dist/secret-scan.d.ts.map +1 -0
- package/dist/secret-scan.js +98 -0
- package/dist/secret-scan.js.map +1 -0
- package/dist/serving-compatibility.d.ts +14 -0
- package/dist/serving-compatibility.d.ts.map +1 -0
- package/dist/serving-compatibility.js +19 -0
- package/dist/serving-compatibility.js.map +1 -0
- package/dist/snapshot-transport.d.ts +83 -0
- package/dist/snapshot-transport.d.ts.map +1 -0
- package/dist/snapshot-transport.js +42 -0
- package/dist/snapshot-transport.js.map +1 -0
- package/dist/suggestions.d.ts +3 -0
- package/dist/suggestions.d.ts.map +1 -0
- package/dist/suggestions.js +26 -0
- package/dist/suggestions.js.map +1 -0
- package/dist/types.d.ts +72 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +119 -0
- package/dist/types.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformation.js","sourceRoot":"","sources":["../../src/bodies/transformation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAuB,MAAM,uBAAuB,CAAA;AACjF,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,GAEnB,MAAM,eAAe,CAAA;AACtB,OAA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CAAC,WAAW;QAAE,OAAM;IAC/B,IAAI,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClD,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,aAAa,CAAC;YACpE,OAAO,EAAE,6EAA6E,EAAE,CAAC,CAAA;IAC7F,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC;QAAE,OAAM;IACvC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IACxD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC3D,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,aAAa,CAAC;YACpE,OAAO,EAAE,kEAAkE,EAAE,CAAC,CAAA;IAClF,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9E,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,CAAC;YAC7E,OAAO,EAAE,kEAAkE,EAAE,CAAC,CAAA;IAClF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const targetAwareCatalogSchema: z.ZodObject<{
|
|
3
|
+
default: z.ZodString;
|
|
4
|
+
by_target: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const catalogBindingSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
7
|
+
default: z.ZodString;
|
|
8
|
+
by_target: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
9
|
+
}, z.core.$strict>]>;
|
|
10
|
+
export type CatalogBinding = z.infer<typeof catalogBindingSchema>;
|
|
11
|
+
export declare function resolveCatalogBinding({ binding, deployTarget, }: {
|
|
12
|
+
binding: CatalogBinding | undefined;
|
|
13
|
+
deployTarget?: string;
|
|
14
|
+
}): string | undefined;
|
|
15
|
+
//# sourceMappingURL=catalog-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-binding.d.ts","sourceRoot":"","sources":["../src/catalog-binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB,eAAO,MAAM,wBAAwB;;;kBAGnC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;oBAAwD,CAAA;AAEzF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,YAAY,GACb,EAAE;IACD,OAAO,EAAE,cAAc,GAAG,SAAS,CAAA;IACnC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,MAAM,GAAG,SAAS,CAGrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { identifierSchema } from './columns.js';
|
|
3
|
+
import { DEPLOY_TARGET_PATTERN } from './constants.js';
|
|
4
|
+
const targetCatalogsSchema = z.record(z.string().regex(DEPLOY_TARGET_PATTERN, 'must be a lowercase deploy-target slug'), identifierSchema).refine((catalogs) => Object.keys(catalogs).length > 0, 'by_target must declare at least one target catalog');
|
|
5
|
+
export const targetAwareCatalogSchema = z.strictObject({
|
|
6
|
+
default: identifierSchema,
|
|
7
|
+
by_target: targetCatalogsSchema,
|
|
8
|
+
});
|
|
9
|
+
export const catalogBindingSchema = z.union([identifierSchema, targetAwareCatalogSchema]);
|
|
10
|
+
export function resolveCatalogBinding({ binding, deployTarget, }) {
|
|
11
|
+
if (binding === undefined || typeof binding === 'string')
|
|
12
|
+
return binding;
|
|
13
|
+
return (deployTarget ? binding.by_target[deployTarget] : undefined) ?? binding.default;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=catalog-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-binding.js","sourceRoot":"","sources":["../src/catalog-binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CACnC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,wCAAwC,CAAC,EACjF,gBAAgB,CACjB,CAAC,MAAM,CACN,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAC9C,oDAAoD,CACrD,CAAA;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,OAAO,EAAE,gBAAgB;IACzB,SAAS,EAAE,oBAAoB;CAChC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,wBAAwB,CAAC,CAAC,CAAA;AAIzF,MAAM,UAAU,qBAAqB,CAAC,EACpC,OAAO,EACP,YAAY,GAIb;IACC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAA;IACxE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,OAAO,CAAA;AACxF,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const identifierSchema: z.ZodString;
|
|
3
|
+
/** Existing source columns can have one leading underscore; asset names cannot. */
|
|
4
|
+
export declare const columnIdentifierSchema: z.ZodString;
|
|
5
|
+
/**
|
|
6
|
+
* One column of a typed contract (transformation output, serving projection,
|
|
7
|
+
* or CDF input). `on_violation` declares what happens to a ROW that violates
|
|
8
|
+
* this column's contract at runtime: `fail` the batch (default), `quarantine`
|
|
9
|
+
* the row into the platform-derived `<output>__quarantine` sibling, or `warn`
|
|
10
|
+
* and let it through.
|
|
11
|
+
*/
|
|
12
|
+
export declare const columnSchema: z.ZodObject<{
|
|
13
|
+
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
14
|
+
string: "string";
|
|
15
|
+
boolean: "boolean";
|
|
16
|
+
uuid: "uuid";
|
|
17
|
+
int: "int";
|
|
18
|
+
long: "long";
|
|
19
|
+
numeric: "numeric";
|
|
20
|
+
double: "double";
|
|
21
|
+
timestamp: "timestamp";
|
|
22
|
+
date: "date";
|
|
23
|
+
json: "json";
|
|
24
|
+
}>, z.ZodEnum<{
|
|
25
|
+
float: "float";
|
|
26
|
+
timestamp_ntz: "timestamp_ntz";
|
|
27
|
+
array: "array";
|
|
28
|
+
map: "map";
|
|
29
|
+
struct: "struct";
|
|
30
|
+
binary: "binary";
|
|
31
|
+
}>, z.ZodString]>;
|
|
32
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
key: z.ZodDefault<z.ZodBoolean>;
|
|
34
|
+
domain: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
on_violation: z.ZodDefault<z.ZodEnum<{
|
|
37
|
+
fail: "fail";
|
|
38
|
+
quarantine: "quarantine";
|
|
39
|
+
warn: "warn";
|
|
40
|
+
}>>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export type Column = z.infer<typeof columnSchema>;
|
|
43
|
+
export type ColumnInput = z.input<typeof columnSchema>;
|
|
44
|
+
/** A validated column map — the resolved shape every columns position ends up in. */
|
|
45
|
+
export declare const columnMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
46
|
+
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
47
|
+
string: "string";
|
|
48
|
+
boolean: "boolean";
|
|
49
|
+
uuid: "uuid";
|
|
50
|
+
int: "int";
|
|
51
|
+
long: "long";
|
|
52
|
+
numeric: "numeric";
|
|
53
|
+
double: "double";
|
|
54
|
+
timestamp: "timestamp";
|
|
55
|
+
date: "date";
|
|
56
|
+
json: "json";
|
|
57
|
+
}>, z.ZodEnum<{
|
|
58
|
+
float: "float";
|
|
59
|
+
timestamp_ntz: "timestamp_ntz";
|
|
60
|
+
array: "array";
|
|
61
|
+
map: "map";
|
|
62
|
+
struct: "struct";
|
|
63
|
+
binary: "binary";
|
|
64
|
+
}>, z.ZodString]>;
|
|
65
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
+
key: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
+
domain: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
68
|
+
description: z.ZodOptional<z.ZodString>;
|
|
69
|
+
on_violation: z.ZodDefault<z.ZodEnum<{
|
|
70
|
+
fail: "fail";
|
|
71
|
+
quarantine: "quarantine";
|
|
72
|
+
warn: "warn";
|
|
73
|
+
}>>;
|
|
74
|
+
}, z.core.$strict>>;
|
|
75
|
+
export type ColumnMap = z.infer<typeof columnMapSchema>;
|
|
76
|
+
/**
|
|
77
|
+
* Reference to a named schema artifact defined once in the Pipeline repo at
|
|
78
|
+
* `schemas/<name>.schema.yml`. The loader resolves refs so two consumers of
|
|
79
|
+
* one ref share the same validated column-map instance — identity, not copies.
|
|
80
|
+
*/
|
|
81
|
+
export declare const schemaRefSchema: z.ZodObject<{
|
|
82
|
+
schema_ref: z.ZodString;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
export type SchemaRef = z.infer<typeof schemaRefSchema>;
|
|
85
|
+
/**
|
|
86
|
+
* A columns position as authored: inline columns (sugar for an anonymous
|
|
87
|
+
* schema) or a `schema_ref` to a named artifact. Both produce identical
|
|
88
|
+
* validated structures after the loader resolves refs.
|
|
89
|
+
*/
|
|
90
|
+
export declare const columnsOrRefSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
91
|
+
schema_ref: z.ZodString;
|
|
92
|
+
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
93
|
+
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
94
|
+
string: "string";
|
|
95
|
+
boolean: "boolean";
|
|
96
|
+
uuid: "uuid";
|
|
97
|
+
int: "int";
|
|
98
|
+
long: "long";
|
|
99
|
+
numeric: "numeric";
|
|
100
|
+
double: "double";
|
|
101
|
+
timestamp: "timestamp";
|
|
102
|
+
date: "date";
|
|
103
|
+
json: "json";
|
|
104
|
+
}>, z.ZodEnum<{
|
|
105
|
+
float: "float";
|
|
106
|
+
timestamp_ntz: "timestamp_ntz";
|
|
107
|
+
array: "array";
|
|
108
|
+
map: "map";
|
|
109
|
+
struct: "struct";
|
|
110
|
+
binary: "binary";
|
|
111
|
+
}>, z.ZodString]>;
|
|
112
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
113
|
+
key: z.ZodDefault<z.ZodBoolean>;
|
|
114
|
+
domain: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
115
|
+
description: z.ZodOptional<z.ZodString>;
|
|
116
|
+
on_violation: z.ZodDefault<z.ZodEnum<{
|
|
117
|
+
fail: "fail";
|
|
118
|
+
quarantine: "quarantine";
|
|
119
|
+
warn: "warn";
|
|
120
|
+
}>>;
|
|
121
|
+
}, z.core.$strict>>]>;
|
|
122
|
+
export type ColumnsOrRef = z.infer<typeof columnsOrRefSchema>;
|
|
123
|
+
export declare function isSchemaRef(value: ColumnsOrRef): value is SchemaRef;
|
|
124
|
+
/**
|
|
125
|
+
* A named schema artifact (`schemas/<name>.schema.yml`). Its `columns` may
|
|
126
|
+
* itself be a ref to another named schema (an alias); the loader resolves
|
|
127
|
+
* chains and rejects cycles.
|
|
128
|
+
*/
|
|
129
|
+
export declare const namedSchemaFileSchema: z.ZodObject<{
|
|
130
|
+
description: z.ZodOptional<z.ZodString>;
|
|
131
|
+
columns: z.ZodUnion<readonly [z.ZodObject<{
|
|
132
|
+
schema_ref: z.ZodString;
|
|
133
|
+
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
134
|
+
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
135
|
+
string: "string";
|
|
136
|
+
boolean: "boolean";
|
|
137
|
+
uuid: "uuid";
|
|
138
|
+
int: "int";
|
|
139
|
+
long: "long";
|
|
140
|
+
numeric: "numeric";
|
|
141
|
+
double: "double";
|
|
142
|
+
timestamp: "timestamp";
|
|
143
|
+
date: "date";
|
|
144
|
+
json: "json";
|
|
145
|
+
}>, z.ZodEnum<{
|
|
146
|
+
float: "float";
|
|
147
|
+
timestamp_ntz: "timestamp_ntz";
|
|
148
|
+
array: "array";
|
|
149
|
+
map: "map";
|
|
150
|
+
struct: "struct";
|
|
151
|
+
binary: "binary";
|
|
152
|
+
}>, z.ZodString]>;
|
|
153
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
154
|
+
key: z.ZodDefault<z.ZodBoolean>;
|
|
155
|
+
domain: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
156
|
+
description: z.ZodOptional<z.ZodString>;
|
|
157
|
+
on_violation: z.ZodDefault<z.ZodEnum<{
|
|
158
|
+
fail: "fail";
|
|
159
|
+
quarantine: "quarantine";
|
|
160
|
+
warn: "warn";
|
|
161
|
+
}>>;
|
|
162
|
+
}, z.core.$strict>>]>;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
export type NamedSchemaFile = z.infer<typeof namedSchemaFileSchema>;
|
|
165
|
+
/**
|
|
166
|
+
* Columns whose `key: true` must be non-nullable. Shared by the transformation
|
|
167
|
+
* output and serving projection refinements — returns the offending names so
|
|
168
|
+
* errors can cite them.
|
|
169
|
+
*/
|
|
170
|
+
export declare function nullableKeyColumns(columns: ColumnMap): string[];
|
|
171
|
+
/**
|
|
172
|
+
* Loaded specs always have refs resolved; direct programmatic callers passing
|
|
173
|
+
* unresolved refs to graph/diff functions get a precise failure instead of a
|
|
174
|
+
* silent skip. `context` names the offending position (stage + path).
|
|
175
|
+
*/
|
|
176
|
+
export declare function requireResolvedColumns(columns: ColumnsOrRef, context: string): ColumnMap;
|
|
177
|
+
//# sourceMappingURL=columns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../src/columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,gBAAgB,aAG+C,CAAA;AAE5E,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,aAMhC,CAAA;AAKH;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUvB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AACjD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEtD,qFAAqF;AACrF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAE+D,CAAA;AAE3F,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,eAAe;;kBAK1B,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA8C,CAAA;AAE7E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,IAAI,SAAS,CAInE;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGhC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,EAAE,CAI/D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAOxF"}
|
package/dist/columns.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { COLUMN_IDENTIFIER_PATTERN, IDENTIFIER_PATTERN, MAX_IDENTIFIER_LENGTH } from './constants.js';
|
|
3
|
+
import { pipelineTypeSchema } from './types.js';
|
|
4
|
+
export const identifierSchema = z
|
|
5
|
+
.string()
|
|
6
|
+
.max(MAX_IDENTIFIER_LENGTH)
|
|
7
|
+
.regex(IDENTIFIER_PATTERN, 'must be a lowercase identifier (a-z, 0-9, _)');
|
|
8
|
+
/** Existing source columns can have one leading underscore; asset names cannot. */
|
|
9
|
+
export const columnIdentifierSchema = z
|
|
10
|
+
.string()
|
|
11
|
+
.max(MAX_IDENTIFIER_LENGTH)
|
|
12
|
+
.regex(COLUMN_IDENTIFIER_PATTERN, 'must be a lowercase column identifier with at most one leading underscore');
|
|
13
|
+
/** Enum-domain values are scalars; the domain is part of the column's contract. */
|
|
14
|
+
const domainValueSchema = z.union([z.string(), z.number(), z.boolean()]);
|
|
15
|
+
/**
|
|
16
|
+
* One column of a typed contract (transformation output, serving projection,
|
|
17
|
+
* or CDF input). `on_violation` declares what happens to a ROW that violates
|
|
18
|
+
* this column's contract at runtime: `fail` the batch (default), `quarantine`
|
|
19
|
+
* the row into the platform-derived `<output>__quarantine` sibling, or `warn`
|
|
20
|
+
* and let it through.
|
|
21
|
+
*/
|
|
22
|
+
export const columnSchema = z.strictObject({
|
|
23
|
+
type: pipelineTypeSchema,
|
|
24
|
+
/** Columns are nullable unless the contract says otherwise. */
|
|
25
|
+
nullable: z.boolean().default(true),
|
|
26
|
+
/** Natural/primary key participation. Key columns must be non-nullable. */
|
|
27
|
+
key: z.boolean().default(false),
|
|
28
|
+
/** Closed set of legal values (enum domain) — shrinking it later is a breaking change. */
|
|
29
|
+
domain: z.array(domainValueSchema).min(1).optional(),
|
|
30
|
+
description: z.string().optional(),
|
|
31
|
+
on_violation: z.enum(['fail', 'quarantine', 'warn']).default('fail'),
|
|
32
|
+
});
|
|
33
|
+
/** A validated column map — the resolved shape every columns position ends up in. */
|
|
34
|
+
export const columnMapSchema = z
|
|
35
|
+
.record(columnIdentifierSchema, columnSchema)
|
|
36
|
+
.refine((columns) => Object.keys(columns).length > 0, 'must declare at least one column');
|
|
37
|
+
/**
|
|
38
|
+
* Reference to a named schema artifact defined once in the Pipeline repo at
|
|
39
|
+
* `schemas/<name>.schema.yml`. The loader resolves refs so two consumers of
|
|
40
|
+
* one ref share the same validated column-map instance — identity, not copies.
|
|
41
|
+
*/
|
|
42
|
+
export const schemaRefSchema = z.strictObject({
|
|
43
|
+
schema_ref: z
|
|
44
|
+
.string()
|
|
45
|
+
.max(MAX_IDENTIFIER_LENGTH)
|
|
46
|
+
.regex(IDENTIFIER_PATTERN, 'must be the schema artifact name (lowercase identifier)'),
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* A columns position as authored: inline columns (sugar for an anonymous
|
|
50
|
+
* schema) or a `schema_ref` to a named artifact. Both produce identical
|
|
51
|
+
* validated structures after the loader resolves refs.
|
|
52
|
+
*/
|
|
53
|
+
export const columnsOrRefSchema = z.union([schemaRefSchema, columnMapSchema]);
|
|
54
|
+
export function isSchemaRef(value) {
|
|
55
|
+
// A column map may legitimately contain a column NAMED `schema_ref` (whose
|
|
56
|
+
// value is a column definition object) — only a string value marks a ref.
|
|
57
|
+
return 'schema_ref' in value && typeof value.schema_ref === 'string';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A named schema artifact (`schemas/<name>.schema.yml`). Its `columns` may
|
|
61
|
+
* itself be a ref to another named schema (an alias); the loader resolves
|
|
62
|
+
* chains and rejects cycles.
|
|
63
|
+
*/
|
|
64
|
+
export const namedSchemaFileSchema = z.strictObject({
|
|
65
|
+
description: z.string().optional(),
|
|
66
|
+
columns: columnsOrRefSchema,
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Columns whose `key: true` must be non-nullable. Shared by the transformation
|
|
70
|
+
* output and serving projection refinements — returns the offending names so
|
|
71
|
+
* errors can cite them.
|
|
72
|
+
*/
|
|
73
|
+
export function nullableKeyColumns(columns) {
|
|
74
|
+
return Object.entries(columns)
|
|
75
|
+
.filter(([, column]) => column.key && column.nullable)
|
|
76
|
+
.map(([name]) => name);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Loaded specs always have refs resolved; direct programmatic callers passing
|
|
80
|
+
* unresolved refs to graph/diff functions get a precise failure instead of a
|
|
81
|
+
* silent skip. `context` names the offending position (stage + path).
|
|
82
|
+
*/
|
|
83
|
+
export function requireResolvedColumns(columns, context) {
|
|
84
|
+
if (isSchemaRef(columns)) {
|
|
85
|
+
throw new Error(`${context} is an unresolved schema_ref ('${columns.schema_ref}') — load specs through parseSpecSources/loadSpecDirectory first`);
|
|
86
|
+
}
|
|
87
|
+
return columns;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=columns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../src/columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,EAAE;KACR,GAAG,CAAC,qBAAqB,CAAC;KAC1B,KAAK,CAAC,kBAAkB,EAAE,8CAA8C,CAAC,CAAA;AAE5E,mFAAmF;AACnF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,EAAE;KACR,GAAG,CAAC,qBAAqB,CAAC;KAC1B,KAAK,CACJ,yBAAyB,EACzB,2EAA2E,CAC5E,CAAA;AAEH,mFAAmF;AACnF,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;AAExE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;IACzC,IAAI,EAAE,kBAAkB;IACxB,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACnC,2EAA2E;IAC3E,GAAG,EAAE,CAAC,CAAC,OA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E;IAClC,OAAO,EAAE,kBAAkB;CAC5B,CAAC,CAAA;AAIF;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAkB;IACnD,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC;SACrD,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAqB,EAAE,OAAe;IAC3E,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,GAAG,OAAO,kCAAkC,OAAO,CAAC,UAAU,kEAAkE,CACjI,CAAA;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ColumnMap } from './columns.js';
|
|
2
|
+
/**
|
|
3
|
+
* The compatibility engine: does a producer's schema satisfy a consumer's
|
|
4
|
+
* requirement? Pure and reusable — the offline CI gate runs it repo-locally
|
|
5
|
+
* (`validateSpecGraph`), and later milestones wire it to the live registry
|
|
6
|
+
* and the serving supply/demand/ORM checks.
|
|
7
|
+
*/
|
|
8
|
+
export declare const COMPATIBILITY_FINDING_CODES: readonly ["missing_column", "type_incompatible", "nullability_violation", "domain_violation", "domain_shrunk"];
|
|
9
|
+
export type CompatibilityFindingCode = (typeof COMPATIBILITY_FINDING_CODES)[number];
|
|
10
|
+
export interface CompatibilityFinding {
|
|
11
|
+
readonly code: CompatibilityFindingCode;
|
|
12
|
+
readonly severity: 'error' | 'warning';
|
|
13
|
+
readonly column: string;
|
|
14
|
+
readonly message: string;
|
|
15
|
+
}
|
|
16
|
+
/** Domain values compare by type + rendering so 1 and '1' stay distinct. */
|
|
17
|
+
export declare const domainKey: (value: string | number | boolean) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Does `producer` satisfy `consumerRequirement`? Column presence, type
|
|
20
|
+
* compatibility (widening allowed, narrowing rejected), nullability, and
|
|
21
|
+
* domain checks — with `domain_shrunk` detection as a warning when the
|
|
22
|
+
* producer no longer emits values the consumer expects to see.
|
|
23
|
+
*/
|
|
24
|
+
export declare function checkCompatibility(producer: ColumnMap, consumerRequirement: ColumnMap): CompatibilityFinding[];
|
|
25
|
+
//# sourceMappingURL=compatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;GAKG;AAEH,eAAO,MAAM,2BAA2B,gHAM9B,CAAA;AAEV,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAA;IACvC,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAwBD,4EAA4E;AAC5E,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,OAAO,KAAG,MAA4C,CAAA;AAEzG;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,EACnB,mBAAmB,EAAE,SAAS,GAC7B,oBAAoB,EAAE,CAmExB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compatibility engine: does a producer's schema satisfy a consumer's
|
|
3
|
+
* requirement? Pure and reusable — the offline CI gate runs it repo-locally
|
|
4
|
+
* (`validateSpecGraph`), and later milestones wire it to the live registry
|
|
5
|
+
* and the serving supply/demand/ORM checks.
|
|
6
|
+
*/
|
|
7
|
+
export const COMPATIBILITY_FINDING_CODES = [
|
|
8
|
+
'missing_column',
|
|
9
|
+
'type_incompatible',
|
|
10
|
+
'nullability_violation',
|
|
11
|
+
'domain_violation',
|
|
12
|
+
'domain_shrunk',
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Types a producer type may satisfy beyond itself — the consumer reads the
|
|
16
|
+
* wider type losslessly (int fits in long/numeric; int fits double exactly
|
|
17
|
+
* since a 32-bit int is within the 53-bit mantissa; long→double is lossy and
|
|
18
|
+
* deliberately absent).
|
|
19
|
+
*/
|
|
20
|
+
const WIDENINGS = {
|
|
21
|
+
int: ['long', 'numeric', 'double'],
|
|
22
|
+
long: ['numeric'],
|
|
23
|
+
float: ['double'],
|
|
24
|
+
};
|
|
25
|
+
const DECIMAL_PREFIX = 'decimal(';
|
|
26
|
+
function typeSatisfies(producerType, requiredType) {
|
|
27
|
+
if (producerType === requiredType)
|
|
28
|
+
return true;
|
|
29
|
+
if (WIDENINGS[producerType]?.includes(requiredType))
|
|
30
|
+
return true;
|
|
31
|
+
// A parameterized decimal is a bounded numeric.
|
|
32
|
+
if (producerType.startsWith(DECIMAL_PREFIX) && requiredType === 'numeric')
|
|
33
|
+
return true;
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
/** Domain values compare by type + rendering so 1 and '1' stay distinct. */
|
|
37
|
+
export const domainKey = (value) => `${typeof value}:${String(value)}`;
|
|
38
|
+
/**
|
|
39
|
+
* Does `producer` satisfy `consumerRequirement`? Column presence, type
|
|
40
|
+
* compatibility (widening allowed, narrowing rejected), nullability, and
|
|
41
|
+
* domain checks — with `domain_shrunk` detection as a warning when the
|
|
42
|
+
* producer no longer emits values the consumer expects to see.
|
|
43
|
+
*/
|
|
44
|
+
export function checkCompatibility(producer, consumerRequirement) {
|
|
45
|
+
const findings = [];
|
|
46
|
+
for (const [name, required] of Object.entries(consumerRequirement)) {
|
|
47
|
+
const produced = producer[name];
|
|
48
|
+
if (!produced) {
|
|
49
|
+
findings.push({
|
|
50
|
+
code: 'missing_column',
|
|
51
|
+
severity: 'error',
|
|
52
|
+
column: name,
|
|
53
|
+
message: `column '${name}' is not produced`,
|
|
54
|
+
});
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (!typeSatisfies(produced.type, required.type)) {
|
|
58
|
+
findings.push({
|
|
59
|
+
code: 'type_incompatible',
|
|
60
|
+
severity: 'error',
|
|
61
|
+
column: name,
|
|
62
|
+
message: `column '${name}' is produced as '${produced.type}' but required as '${required.type}' (narrowing is rejected; widening like int→long is allowed)`,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (!required.nullable && produced.nullable) {
|
|
66
|
+
findings.push({
|
|
67
|
+
code: 'nullability_violation',
|
|
68
|
+
severity: 'error',
|
|
69
|
+
column: name,
|
|
70
|
+
message: `column '${name}' is produced nullable but required non-null`,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (required.domain) {
|
|
74
|
+
if (!produced.domain) {
|
|
75
|
+
findings.push({
|
|
76
|
+
code: 'domain_violation',
|
|
77
|
+
severity: 'error',
|
|
78
|
+
column: name,
|
|
79
|
+
message: `column '${name}' is required to stay within a domain of ${required.domain.length} values but is produced unconstrained`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const requiredDomain = new Set(required.domain.map(domainKey));
|
|
84
|
+
const outside = produced.domain.filter((value) => !requiredDomain.has(domainKey(value)));
|
|
85
|
+
if (outside.length > 0) {
|
|
86
|
+
findings.push({
|
|
87
|
+
code: 'domain_violation',
|
|
88
|
+
severity: 'error',
|
|
89
|
+
column: name,
|
|
90
|
+
message: `column '${name}' may produce values outside the required domain: ${outside.map(String).join(', ')}`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const producedDomain = new Set(produced.domain.map(domainKey));
|
|
94
|
+
const vanished = required.domain.filter((value) => !producedDomain.has(domainKey(value)));
|
|
95
|
+
if (outside.length === 0 && vanished.length > 0) {
|
|
96
|
+
findings.push({
|
|
97
|
+
code: 'domain_shrunk',
|
|
98
|
+
severity: 'warning',
|
|
99
|
+
column: name,
|
|
100
|
+
message: `column '${name}' no longer produces expected domain values: ${vanished.map(String).join(', ')} — consumers relying on their presence may break`,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return findings;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,kBAAkB;IAClB,eAAe;CACP,CAAA;AAWV;;;;;GAKG;AACH,MAAM,SAAS,GAAgD;IAC7D,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;IAClC,IAAI,EAAE,CAAC,SAAS,CAAC;IACjB,KAAK,EAAE,CAAC,QAAQ,CAAC;CAClB,CAAA;AAED,MAAM,cAAc,GAAG,UAAU,CAAA;AAEjC,SAAS,aAAa,CAAC,YAAoB,EAAE,YAAoB;IAC/D,IAAI,YAAY,KAAK,YAAY;QAAE,OAAO,IAAI,CAAA;IAC9C,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAA;IAChE,gDAAgD;IAChD,IAAI,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACtF,OAAO,KAAK,CAAA;AACd,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MA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,CAAC;oBAChD,QAAQ,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE,eAAe;wBACrB,QAAQ,EAAE,SAAS;wBACnB,MAAM,EAAE,IAAI;wBACZ,OAAO,EAAE,WAAW,IAAI,gDAAgD,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,kDAAkD;qBAC1J,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage ids are kebab-case slugs — they become file basenames
|
|
3
|
+
* (`<stage>.stage.yml`), registry keys, and halves of logical asset ids
|
|
4
|
+
* (`<stage>.<asset>`), so the grammar is deliberately tight.
|
|
5
|
+
*/
|
|
6
|
+
export declare const STAGE_ID_PATTERN: RegExp;
|
|
7
|
+
/** Logical names such as feeds, assets, stages, and namespaces. */
|
|
8
|
+
export declare const IDENTIFIER_PATTERN: RegExp;
|
|
9
|
+
/** Physical column names may preserve source-system leading underscores. */
|
|
10
|
+
export declare const COLUMN_IDENTIFIER_PATTERN: RegExp;
|
|
11
|
+
export declare const MAX_IDENTIFIER_LENGTH = 63;
|
|
12
|
+
/** Transformation output assets live in the medallion layers or report lane. */
|
|
13
|
+
export declare const OUTPUT_ASSET_PATTERN: RegExp;
|
|
14
|
+
/** Raw report passthrough assets are isolated from ontology silver/gold assets. */
|
|
15
|
+
export declare const REPORT_ASSET_PATTERN: RegExp;
|
|
16
|
+
/** ORM-bound serving sources are restricted to the gold layer (mirrors the ORM's `SYNCED_SOURCE_PATTERN`). */
|
|
17
|
+
export declare const GOLD_ASSET_PATTERN: RegExp;
|
|
18
|
+
/** Serving views are exposed in the Lakebase `public` schema. */
|
|
19
|
+
export declare const PUBLIC_VIEW_PATTERN: RegExp;
|
|
20
|
+
/** FIS compatibility relations are isolated to the dedicated reporting schema. */
|
|
21
|
+
export declare const REPORTING_TABLE_PATTERN: RegExp;
|
|
22
|
+
/** `<schema>.<table>` reference for Lakebase CDF source tables (e.g. `manual.retail_customers`). */
|
|
23
|
+
export declare const QUALIFIED_TABLE_PATTERN: RegExp;
|
|
24
|
+
/**
|
|
25
|
+
* Symbolic registry references (credential families, alert channels, worker
|
|
26
|
+
* machines, source systems). Names only — the tight slug grammar is one of the
|
|
27
|
+
* two layers that keep literal secrets/URLs out of specs (the other is the
|
|
28
|
+
* credential scan in the envelope).
|
|
29
|
+
*/
|
|
30
|
+
export declare const SYMBOLIC_REF_PATTERN: RegExp;
|
|
31
|
+
/** Deploy-target slugs (environment names) — no path separators or dots. */
|
|
32
|
+
export declare const DEPLOY_TARGET_PATTERN: RegExp;
|
|
33
|
+
/** ISO-8601 duration (`PT4H`, `P1D`, `PT30M`) — used by SLOs, freshness, and retention. */
|
|
34
|
+
export declare const ISO_DURATION_PATTERN: RegExp;
|
|
35
|
+
/** 5–7 whitespace-separated cron fields; semantic validation belongs to the scheduler. */
|
|
36
|
+
export declare const CRON_PATTERN: RegExp;
|
|
37
|
+
/** IANA timezone shape (`America/New_York`) or `UTC`. */
|
|
38
|
+
export declare const TIMEZONE_PATTERN: RegExp;
|
|
39
|
+
/** Stage spec files: `<stage>.stage.yml` in the Pipeline repo root. */
|
|
40
|
+
export declare const STAGE_FILE_SUFFIXES: readonly [".stage.yml", ".stage.yaml"];
|
|
41
|
+
/** Named schema artifacts: `schemas/<name>.schema.yml` in the Pipeline repo. */
|
|
42
|
+
export declare const SCHEMA_FILE_SUFFIXES: readonly [".schema.yml", ".schema.yaml"];
|
|
43
|
+
/** Directory (relative to the Pipeline root) holding named schema artifacts. */
|
|
44
|
+
export declare const SCHEMAS_DIRECTORY = "schemas";
|
|
45
|
+
/** Per-feed documentation sidecars, kept separate from typed schema contracts. */
|
|
46
|
+
export declare const DOCUMENTATION_FILE_SUFFIXES: readonly [".documentation.yml", ".documentation.yaml"];
|
|
47
|
+
export declare const DOCUMENTATION_DIRECTORY = "documentation";
|
|
48
|
+
/**
|
|
49
|
+
* Platform-defined operation names. The platform owns these verbs (they get
|
|
50
|
+
* platform semantics, ledgers, and UI affordances) — author-declared
|
|
51
|
+
* operations may not shadow them.
|
|
52
|
+
*/
|
|
53
|
+
export declare const RESERVED_OPERATION_NAMES: ReadonlySet<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Bronze envelope columns the materializer stamps onto every row —
|
|
56
|
+
* `stamp_envelope`'s `_ENVELOPE_COLUMN_NAMES` in
|
|
57
|
+
* `databricks/pipeline_runtime/materializer.py` is the single source of
|
|
58
|
+
* truth this is derived from (not guessed). A SOURCE column sharing one of
|
|
59
|
+
* these names is silently overwritten by `stamp_envelope` and permanently
|
|
60
|
+
* lost, so they're reserved for the only column-name-bearing fields an
|
|
61
|
+
* ingestion feed declares about its own source columns: `natural_key` and
|
|
62
|
+
* `cursor.column` (`refineFeed` in `bodies/ingestion.ts`).
|
|
63
|
+
*
|
|
64
|
+
* Deliberately NOT reserved on transformation `outputs`/CDF `columns`/
|
|
65
|
+
* serving `projection.columns` (`columnMapSchema` in `columns.ts`) — those
|
|
66
|
+
* are silver/gold/CDF-envelope business columns on a completely different
|
|
67
|
+
* write path the materializer never touches, and real specs legitimately
|
|
68
|
+
* use `ingested_at`/`source_system` there (see
|
|
69
|
+
* `fixtures/billing/billing-silver.stage.yml`,
|
|
70
|
+
* `fixtures/er/entity-resolution.stage.yml`).
|
|
71
|
+
*
|
|
72
|
+
* MUST match `RESERVED_ENVELOPE_COLUMNS` in
|
|
73
|
+
* `databricks/pipeline_runtime/materializer.py` byte-for-byte — Python
|
|
74
|
+
* can't import TS, only a shared naming convention (a parity test on each
|
|
75
|
+
* side pins the two lists literally equal).
|
|
76
|
+
*/
|
|
77
|
+
export declare const RESERVED_ENVELOPE_COLUMNS: ReadonlySet<string>;
|
|
78
|
+
/**
|
|
79
|
+
* Quarantine table name derivation: rows failing a `quarantine`-posture check
|
|
80
|
+
* land in a platform-derived sibling table. Defined here (M1) so the M6
|
|
81
|
+
* compiler and every doc derive the same name.
|
|
82
|
+
*/
|
|
83
|
+
export declare const QUARANTINE_SUFFIX = "__quarantine";
|
|
84
|
+
export declare const quarantineAssetName: (outputAsset: string) => string;
|
|
85
|
+
/** Domain-separation prefixes so spec and contract hashes can never collide. */
|
|
86
|
+
export declare const SPEC_HASH_DOMAIN = "sequence-pipeline-spec\0";
|
|
87
|
+
export declare const CONTRACT_HASH_DOMAIN = "sequence-pipeline-contract\0";
|
|
88
|
+
/**
|
|
89
|
+
* Per-file byte cap where the loader reads untrusted YAML into memory (same
|
|
90
|
+
* posture as the ORM loader) — a real failure mode, not a product limit.
|
|
91
|
+
*/
|
|
92
|
+
export declare const MAX_SPEC_FILE_BYTES: number;
|
|
93
|
+
/** Stage files may embed full source dictionaries; stay within Git Service's blob cap. */
|
|
94
|
+
export declare const MAX_STAGE_SPEC_FILE_BYTES: number;
|
|
95
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAkC,CAAA;AAE/D,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,QAAsB,CAAA;AAErD,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,QAAwB,CAAA;AAE9D,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAEvC,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,QAA4C,CAAA;AAE7E,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,QAA8B,CAAA;AAE/D,8GAA8G;AAC9G,eAAO,MAAM,kBAAkB,QAA4B,CAAA;AAE3D,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,QAA8B,CAAA;AAE9D,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,QAAmC,CAAA;AAEvE,oGAAoG;AACpG,eAAO,MAAM,uBAAuB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