@rocicorp/zero 0.6.2024112101 → 0.7.2024112700
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/out/advanced.js +1 -1
- package/out/{chunk-5UY46OAF.js → chunk-C7M3BJ3Z.js} +16 -8
- package/out/chunk-C7M3BJ3Z.js.map +7 -0
- package/out/{chunk-MPEWBBGZ.js → chunk-HDEKBM3G.js} +686 -660
- package/out/{chunk-MPEWBBGZ.js.map → chunk-HDEKBM3G.js.map} +4 -4
- package/out/shared/src/expand.js +2 -0
- package/out/shared/src/expand.js.map +1 -0
- package/out/shared/src/immutable.js +2 -0
- package/out/shared/src/immutable.js.map +1 -0
- package/out/{zero-cache/src/config/config.d.ts → shared/src/options.d.ts} +3 -5
- package/out/shared/src/options.d.ts.map +1 -0
- package/out/{zero-cache/src/config/config.js → shared/src/options.js} +26 -26
- package/out/shared/src/options.js.map +1 -0
- package/out/shared/src/sorted-entries.js +6 -0
- package/out/shared/src/sorted-entries.js.map +1 -0
- package/out/shared/src/writable.js +2 -0
- package/out/shared/src/writable.js.map +1 -0
- package/out/solid.js +2 -2
- package/out/zero/src/build-schema.d.ts +3 -0
- package/out/zero/src/build-schema.d.ts.map +1 -0
- package/out/zero/src/build-schema.js +3 -0
- package/out/zero/src/build-schema.js.map +1 -0
- package/out/zero-cache/src/auth/load-schema.d.ts +8 -0
- package/out/zero-cache/src/auth/load-schema.d.ts.map +1 -0
- package/out/zero-cache/src/auth/load-schema.js +34 -0
- package/out/zero-cache/src/auth/load-schema.js.map +1 -0
- package/out/zero-cache/src/auth/write-authorizer.d.ts +20 -0
- package/out/zero-cache/src/auth/write-authorizer.d.ts.map +1 -0
- package/out/zero-cache/src/auth/write-authorizer.js +320 -0
- package/out/zero-cache/src/auth/write-authorizer.js.map +1 -0
- package/out/zero-cache/src/config/zero-config.d.ts +14 -4
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +27 -14
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/server/main.js +7 -0
- package/out/zero-cache/src/server/main.js.map +1 -1
- package/out/zero-cache/src/server/replicator.d.ts.map +1 -1
- package/out/zero-cache/src/server/replicator.js +4 -3
- package/out/zero-cache/src/server/replicator.js.map +1 -1
- package/out/zero-cache/src/server/runtime.d.ts +3 -0
- package/out/zero-cache/src/server/runtime.d.ts.map +1 -0
- package/out/zero-cache/src/server/runtime.js +19 -0
- package/out/zero-cache/src/server/runtime.js.map +1 -0
- package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.js +7 -6
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.js +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts +6 -5
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +19 -33
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/replicator/replicator.d.ts +1 -1
- package/out/zero-cache/src/services/replicator/replicator.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/replicator.js +2 -2
- package/out/zero-cache/src/services/replicator/replicator.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.js +11 -8
- package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +17 -8
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.js +357 -94
- package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts +6 -9
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.js +36 -22
- package/out/zero-cache/src/services/view-syncer/cvr.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +2 -2
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +22 -0
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/cvr.js +33 -7
- package/out/zero-cache/src/services/view-syncer/schema/cvr.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.js +44 -5
- package/out/zero-cache/src/services/view-syncer/schema/init.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +1 -0
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/types.js +3 -0
- package/out/zero-cache/src/services/view-syncer/schema/types.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.js +5 -0
- package/out/zero-cache/src/services/view-syncer/snapshotter.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +69 -19
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/row-key.d.ts +6 -0
- package/out/zero-cache/src/types/row-key.d.ts.map +1 -1
- package/out/zero-cache/src/types/row-key.js +16 -1
- package/out/zero-cache/src/types/row-key.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +1 -1
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-cache/src/workers/replicator.d.ts +3 -1
- package/out/zero-cache/src/workers/replicator.d.ts.map +1 -1
- package/out/zero-cache/src/workers/replicator.js +2 -0
- package/out/zero-cache/src/workers/replicator.js.map +1 -1
- package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer.js +8 -3
- package/out/zero-cache/src/workers/syncer.js.map +1 -1
- package/out/zero-client/src/client/options.d.ts +37 -8
- package/out/zero-client/src/client/options.d.ts.map +1 -1
- package/out/zero-client/src/client/reload-error-handler.d.ts +16 -1
- package/out/zero-client/src/client/reload-error-handler.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.d.ts +7 -55
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/mod.d.ts +1 -1
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-protocol/src/ast-hash.js +14 -0
- package/out/zero-protocol/src/ast-hash.js.map +1 -0
- package/out/zero-protocol/src/down.d.ts +4 -4
- package/out/zero-protocol/src/poke.d.ts +16 -8
- package/out/zero-protocol/src/poke.d.ts.map +1 -1
- package/out/zero-protocol/src/poke.js +8 -2
- package/out/zero-protocol/src/poke.js.map +1 -1
- package/out/zero-schema/src/authorization.d.ts +12 -5
- package/out/zero-schema/src/authorization.d.ts.map +1 -1
- package/out/zero-schema/src/build-schema.d.ts +14 -0
- package/out/zero-schema/src/build-schema.d.ts.map +1 -0
- package/out/zero-schema/src/build-schema.js +55 -0
- package/out/zero-schema/src/build-schema.js.map +1 -0
- package/out/zero-schema/src/compiled-authorization.d.ts +213 -294
- package/out/zero-schema/src/compiled-authorization.d.ts.map +1 -1
- package/out/zero-schema/src/compiled-authorization.js +9 -4
- package/out/zero-schema/src/compiled-authorization.js.map +1 -1
- package/out/zero-schema/src/normalize-table-schema.d.ts +2 -11
- package/out/zero-schema/src/normalize-table-schema.d.ts.map +1 -1
- package/out/zero-schema/src/normalize-table-schema.js +108 -0
- package/out/zero-schema/src/normalize-table-schema.js.map +1 -0
- package/out/zero-schema/src/normalized-schema.js +31 -0
- package/out/zero-schema/src/normalized-schema.js.map +1 -0
- package/out/zero-schema/src/schema-config.d.ts +325 -0
- package/out/zero-schema/src/schema-config.d.ts.map +1 -0
- package/out/zero-schema/src/schema-config.js +41 -0
- package/out/zero-schema/src/schema-config.js.map +1 -0
- package/out/zero-schema/src/schema.js +4 -0
- package/out/zero-schema/src/schema.js.map +1 -0
- package/out/zero-schema/src/table-schema.d.ts +6 -15
- package/out/zero-schema/src/table-schema.d.ts.map +1 -1
- package/out/zero-schema/src/table-schema.js.map +1 -1
- package/out/zero.js +2 -2
- package/out/zql/src/builder/builder.d.ts +2 -2
- package/out/zql/src/builder/builder.d.ts.map +1 -1
- package/out/zql/src/builder/builder.js +19 -20
- package/out/zql/src/builder/builder.js.map +1 -1
- package/out/zql/src/builder/filter.d.ts +25 -2
- package/out/zql/src/builder/filter.d.ts.map +1 -1
- package/out/zql/src/builder/filter.js +91 -1
- package/out/zql/src/builder/filter.js.map +1 -1
- package/out/zql/src/ivm/array-view.js +70 -0
- package/out/zql/src/ivm/array-view.js.map +1 -0
- package/out/zql/src/ivm/change.d.ts +18 -6
- package/out/zql/src/ivm/change.d.ts.map +1 -1
- package/out/zql/src/ivm/change.js +1 -1
- package/out/zql/src/ivm/change.js.map +1 -1
- package/out/zql/src/ivm/constraint.d.ts +14 -0
- package/out/zql/src/ivm/constraint.d.ts.map +1 -0
- package/out/zql/src/ivm/constraint.js +60 -0
- package/out/zql/src/ivm/constraint.js.map +1 -0
- package/out/zql/src/ivm/exists.d.ts.map +1 -1
- package/out/zql/src/ivm/exists.js +19 -2
- package/out/zql/src/ivm/exists.js.map +1 -1
- package/out/zql/src/ivm/join.d.ts +11 -5
- package/out/zql/src/ivm/join.d.ts.map +1 -1
- package/out/zql/src/ivm/join.js +49 -95
- package/out/zql/src/ivm/join.js.map +1 -1
- package/out/zql/src/ivm/maybe-split-and-push-edit-change.d.ts.map +1 -1
- package/out/zql/src/ivm/maybe-split-and-push-edit-change.js +4 -13
- package/out/zql/src/ivm/maybe-split-and-push-edit-change.js.map +1 -1
- package/out/zql/src/ivm/memory-source.d.ts +5 -22
- package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
- package/out/zql/src/ivm/memory-source.js +58 -80
- package/out/zql/src/ivm/memory-source.js.map +1 -1
- package/out/zql/src/ivm/operator.d.ts +7 -10
- package/out/zql/src/ivm/operator.d.ts.map +1 -1
- package/out/zql/src/ivm/operator.js +1 -1
- package/out/zql/src/ivm/operator.js.map +1 -1
- package/out/zql/src/ivm/take.d.ts +3 -1
- package/out/zql/src/ivm/take.d.ts.map +1 -1
- package/out/zql/src/ivm/take.js +95 -95
- package/out/zql/src/ivm/take.js.map +1 -1
- package/out/zql/src/ivm/view-apply-change.d.ts.map +1 -1
- package/out/zql/src/ivm/view-apply-change.js +168 -0
- package/out/zql/src/ivm/view-apply-change.js.map +1 -0
- package/out/zql/src/ivm/view.js +2 -0
- package/out/zql/src/ivm/view.js.map +1 -0
- package/out/zql/src/query/auth-query.d.ts +3 -1
- package/out/zql/src/query/auth-query.d.ts.map +1 -1
- package/out/zql/src/query/auth-query.js +34 -0
- package/out/zql/src/query/auth-query.js.map +1 -0
- package/out/zql/src/query/dnf.js +57 -0
- package/out/zql/src/query/dnf.js.map +1 -0
- package/out/zql/src/query/expression.js +155 -0
- package/out/zql/src/query/expression.js.map +1 -0
- package/out/zql/src/query/query-impl.d.ts +4 -1
- package/out/zql/src/query/query-impl.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.js +359 -0
- package/out/zql/src/query/query-impl.js.map +1 -0
- package/out/zql/src/query/query-internal.js +2 -0
- package/out/zql/src/query/query-internal.js.map +1 -0
- package/out/zql/src/query/query.js +3 -0
- package/out/zql/src/query/query.js.map +1 -0
- package/out/zql/src/query/typed-view.js +2 -0
- package/out/zql/src/query/typed-view.js.map +1 -0
- package/out/zqlite/src/table-source.d.ts +2 -11
- package/out/zqlite/src/table-source.d.ts.map +1 -1
- package/out/zqlite/src/table-source.js +28 -80
- package/out/zqlite/src/table-source.js.map +1 -1
- package/package.json +5 -3
- package/out/chunk-5UY46OAF.js.map +0 -7
- package/out/zero-cache/src/auth/load-authorization.d.ts +0 -4
- package/out/zero-cache/src/auth/load-authorization.d.ts.map +0 -1
- package/out/zero-cache/src/auth/load-authorization.js +0 -20
- package/out/zero-cache/src/auth/load-authorization.js.map +0 -1
- package/out/zero-cache/src/config/config.d.ts.map +0 -1
- package/out/zero-cache/src/config/config.js.map +0 -1
- package/out/zero-cache/src/services/mutagen/write-authorizer.d.ts +0 -21
- package/out/zero-cache/src/services/mutagen/write-authorizer.d.ts.map +0 -1
- package/out/zero-cache/src/services/mutagen/write-authorizer.js +0 -168
- package/out/zero-cache/src/services/mutagen/write-authorizer.js.map +0 -1
|
@@ -31,17 +31,8 @@ type NormalizedFieldRelationship = {
|
|
|
31
31
|
schema: NormalizedTableSchema;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
type NormalizedJunctionRelationship = {
|
|
35
|
-
|
|
36
|
-
junction: {
|
|
37
|
-
sourceField: string;
|
|
38
|
-
destField: string;
|
|
39
|
-
schema: NormalizedTableSchema;
|
|
40
|
-
};
|
|
41
|
-
dest: {
|
|
42
|
-
field: string;
|
|
43
|
-
schema: NormalizedTableSchema;
|
|
44
|
-
};
|
|
34
|
+
type NormalizedJunctionRelationship = NormalizedFieldRelationship & {
|
|
35
|
+
junction: NormalizedFieldRelationship;
|
|
45
36
|
};
|
|
46
37
|
export {};
|
|
47
38
|
//# sourceMappingURL=normalize-table-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-table-schema.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/normalize-table-schema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,wCAA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AAG,EAAE,UAAU,GAAG,oBAAoB,CAQzE;AA+CD,KAAK,sBAAsB,GACvB,2BAA2B,GAC3B,8BAA8B,CAAC;AAcnC,KAAK,2BAA2B,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,qBAAqB,CAAC;KAC/B,CAAC;CACH,CAAC;AAkBF,KAAK,8BAA8B,GAAG,2BAA2B,GAAG;IAClE,QAAQ,EAAE,2BAA2B,CAAC;CACvC,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { assert } from '../../shared/src/asserts.js';
|
|
2
|
+
import { sortedEntries } from '../../shared/src/sorted-entries.js';
|
|
3
|
+
import { isFieldRelationship, } from './table-schema.js';
|
|
4
|
+
export class NormalizedTableSchema {
|
|
5
|
+
tableName;
|
|
6
|
+
primaryKey;
|
|
7
|
+
columns;
|
|
8
|
+
relationships;
|
|
9
|
+
constructor(tableSchema, tableSchemaCache) {
|
|
10
|
+
this.tableName = tableSchema.tableName;
|
|
11
|
+
const primaryKey = normalizePrimaryKey(tableSchema.primaryKey);
|
|
12
|
+
this.primaryKey = primaryKey;
|
|
13
|
+
this.columns = normalizeColumns(tableSchema.columns, primaryKey);
|
|
14
|
+
tableSchemaCache.set(tableSchema, this);
|
|
15
|
+
this.relationships = normalizeRelationships(tableSchema.relationships, tableSchemaCache);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function normalizeTableSchema(tableSchema) {
|
|
19
|
+
return normalizeTableSchemaWithCache(tableSchema, tableSchema.tableName, new Map());
|
|
20
|
+
}
|
|
21
|
+
export function normalizeTableSchemaWithCache(tableSchema, expectedName, tableSchemaCache) {
|
|
22
|
+
if (tableSchema instanceof NormalizedTableSchema) {
|
|
23
|
+
return tableSchema;
|
|
24
|
+
}
|
|
25
|
+
assert(tableSchema.tableName === expectedName, `Table name mismatch: "${tableSchema.tableName}" !== "${expectedName}"`);
|
|
26
|
+
let normalizedTableSchema = tableSchemaCache.get(tableSchema);
|
|
27
|
+
if (normalizedTableSchema) {
|
|
28
|
+
return normalizedTableSchema;
|
|
29
|
+
}
|
|
30
|
+
normalizedTableSchema = new NormalizedTableSchema(tableSchema, tableSchemaCache);
|
|
31
|
+
return normalizedTableSchema;
|
|
32
|
+
}
|
|
33
|
+
function isSorted(arr) {
|
|
34
|
+
for (let i = 1; i < arr.length; i++) {
|
|
35
|
+
if (arr[i - 1] >= arr[i]) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
function assertNoDuplicates(arr) {
|
|
42
|
+
// arr is already sorted.
|
|
43
|
+
for (let i = 1; i < arr.length; i++) {
|
|
44
|
+
assert(arr[i - 1] !== arr[i], 'Primary key must not contain duplicates');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function normalizePrimaryKey(arr) {
|
|
48
|
+
if (isSorted(arr)) {
|
|
49
|
+
return arr;
|
|
50
|
+
}
|
|
51
|
+
arr = [...arr].sort();
|
|
52
|
+
assertNoDuplicates(arr);
|
|
53
|
+
return arr;
|
|
54
|
+
}
|
|
55
|
+
function normalizeColumns(columns, primaryKey) {
|
|
56
|
+
const rv = {};
|
|
57
|
+
for (const pk of primaryKey) {
|
|
58
|
+
const schemaValue = columns[pk];
|
|
59
|
+
assert(schemaValue, `Primary key column "${pk}" not found`);
|
|
60
|
+
const { type, optional } = schemaValue;
|
|
61
|
+
assert(!optional, `Primary key column "${pk}" cannot be optional`);
|
|
62
|
+
assert(type === 'string' || type === 'number' || type === 'boolean', `Primary key column "${pk}" must be a string, number, or boolean. Got ${type}`);
|
|
63
|
+
}
|
|
64
|
+
for (const [name, column] of sortedEntries(columns)) {
|
|
65
|
+
rv[name] = normalizeSchemaValue(column);
|
|
66
|
+
}
|
|
67
|
+
return rv;
|
|
68
|
+
}
|
|
69
|
+
function normalizeSchemaValue(value) {
|
|
70
|
+
return {
|
|
71
|
+
type: value.type,
|
|
72
|
+
optional: value.optional ?? false,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function normalizeRelationships(relationships, tableSchemaCache) {
|
|
76
|
+
const rv = {};
|
|
77
|
+
for (const [name, relationship] of sortedEntries(relationships)) {
|
|
78
|
+
rv[name] = normalizeRelationship(relationship, tableSchemaCache);
|
|
79
|
+
}
|
|
80
|
+
return rv;
|
|
81
|
+
}
|
|
82
|
+
function normalizeRelationship(relationship, tableSchemaCache) {
|
|
83
|
+
if (isFieldRelationship(relationship)) {
|
|
84
|
+
return normalizeFieldRelationship(relationship, tableSchemaCache);
|
|
85
|
+
}
|
|
86
|
+
return normalizeJunctionRelationship(relationship, tableSchemaCache);
|
|
87
|
+
}
|
|
88
|
+
function normalizeFieldRelationship(relationship, tableSchemaCache) {
|
|
89
|
+
return {
|
|
90
|
+
source: relationship.source,
|
|
91
|
+
dest: {
|
|
92
|
+
field: relationship.dest.field,
|
|
93
|
+
schema: normalizeLazyTableSchema(relationship.dest.schema, tableSchemaCache),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function normalizeJunctionRelationship(relationship, tableSchemaCache) {
|
|
98
|
+
return {
|
|
99
|
+
...normalizeFieldRelationship(relationship, tableSchemaCache),
|
|
100
|
+
junction: normalizeFieldRelationship(relationship.junction, tableSchemaCache),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function normalizeLazyTableSchema(tableSchema, buildCache) {
|
|
104
|
+
const tableSchemaInstance = typeof tableSchema === 'function' ? tableSchema() : tableSchema;
|
|
105
|
+
return normalizeTableSchemaWithCache(tableSchemaInstance, tableSchemaInstance.tableName, // Don't care about name here.
|
|
106
|
+
buildCache);
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=normalize-table-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-table-schema.js","sourceRoot":"","sources":["../../../../zero-sch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AACvE,CAAC;AAUD,SAAS,0BAA0B,CACjC,YAAyD,EACzD,gBAAkC;IAElC,OAAO;QACL,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK;YAC9B,MAAM,EAAE,wBAAwB,CAC9B,YAAY,CAAC,IAAI,CAAC,MAAM,EACxB,gBAAgB,CACjB;SACF;KACF,CAAC;AACJ,CAAC;AAMD,SAAS,6BAA6B,CACpC,YAAyE,EACzE,gBAAkC;IAElC,OAAO;QACL,GAAG,0BAA0B,CAAC,YAAY,EAAE,gBAAgB,CAAC;QAC7D,QAAQ,EAAE,0BAA0B,CAClC,YAAY,CAAC,QAAQ,EACrB,gBAAgB,CACjB;KACF,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAC/B,WAA4B,EAC5B,UAA4B;IAE5B,MAAM,mBAAmB,GACvB,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAClE,OAAO,6BAA6B,CAClC,mBAAmB,EACnB,mBAAmB,CAAC,SAAS,EAAE,8BAA8B;IAC7D,UAAU,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { sortedEntries } from '../../shared/src/sorted-entries.js';
|
|
2
|
+
import { normalizeTableSchemaWithCache, } from './normalize-table-schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a normalized schema from a schema.
|
|
5
|
+
*
|
|
6
|
+
* A normalized schema has all the keys sorted and the primary key and the
|
|
7
|
+
* primary key columns are checked to be valid.
|
|
8
|
+
*/
|
|
9
|
+
export function normalizeSchema(schema) {
|
|
10
|
+
if (schema instanceof NormalizedSchema) {
|
|
11
|
+
return schema;
|
|
12
|
+
}
|
|
13
|
+
return new NormalizedSchema(schema);
|
|
14
|
+
}
|
|
15
|
+
export class NormalizedSchema {
|
|
16
|
+
version;
|
|
17
|
+
tables;
|
|
18
|
+
constructor(schema) {
|
|
19
|
+
this.version = schema.version;
|
|
20
|
+
this.tables = normalizeTables(schema.tables);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function normalizeTables(tables) {
|
|
24
|
+
const rv = {};
|
|
25
|
+
const tableSchemaCache = new Map();
|
|
26
|
+
for (const [name, table] of sortedEntries(tables)) {
|
|
27
|
+
rv[name] = normalizeTableSchemaWithCache(table, name, tableSchemaCache);
|
|
28
|
+
}
|
|
29
|
+
return rv;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=normalized-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalized-schema.js","sourceRoot":"","sources":["../../../../zero-schema/src/normalized-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EACL,6BAA6B,GAG9B,MAAM,6BAA6B,CAAC;AAGrC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,IAAI,MAAM,YAAY,gBAAgB,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,OAAO,gBAAgB;IAClB,OAAO,CAAS;IAChB,MAAM,CAEb;IAEF,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF;AAED,SAAS,eAAe,CAAC,MAAwB;IAG/C,MAAM,EAAE,GAEH,EAAE,CAAC;IACR,MAAM,gBAAgB,GAAqB,IAAI,GAAG,EAAE,CAAC;IACrD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,EAAE,CAAC,IAAI,CAAC,GAAG,6BAA6B,CAAC,KAAK,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { type AuthorizationConfig } from './compiled-authorization.js';
|
|
2
|
+
import type { Schema } from './schema.js';
|
|
3
|
+
import * as v from '../../shared/src/valita.js';
|
|
4
|
+
import type { TableSchema } from './table-schema.js';
|
|
5
|
+
export type SchemaConfig = {
|
|
6
|
+
schema: Schema;
|
|
7
|
+
authorization: AuthorizationConfig;
|
|
8
|
+
};
|
|
9
|
+
export declare const relationshipSchema: v.ObjectType<{
|
|
10
|
+
source: v.Type<string>;
|
|
11
|
+
junction: v.Optional<{
|
|
12
|
+
schema: TableSchema;
|
|
13
|
+
sourceField: string;
|
|
14
|
+
destField: string;
|
|
15
|
+
}>;
|
|
16
|
+
dest: v.ObjectType<{
|
|
17
|
+
field: v.Type<string>;
|
|
18
|
+
schema: v.Type<TableSchema>;
|
|
19
|
+
}, undefined>;
|
|
20
|
+
}, undefined>;
|
|
21
|
+
export declare const schemaValueSchema: v.ObjectType<{
|
|
22
|
+
type: v.UnionType<[v.Type<"string">, v.Type<"number">, v.Type<"boolean">, v.Type<"null">, v.Type<"json">]>;
|
|
23
|
+
optional: v.Optional<boolean>;
|
|
24
|
+
}, undefined>;
|
|
25
|
+
export declare const sourceOrTableSchemaSchema: v.ObjectType<{
|
|
26
|
+
tableName: v.Type<string>;
|
|
27
|
+
columns: v.Type<Record<string, {
|
|
28
|
+
optional?: boolean | undefined;
|
|
29
|
+
type: "string" | "number" | "boolean" | "null" | "json";
|
|
30
|
+
}>>;
|
|
31
|
+
primaryKey: v.Type<readonly [string, ...string[]]>;
|
|
32
|
+
}, undefined>;
|
|
33
|
+
export declare const tableSchemaSchema: v.Type<TableSchema>;
|
|
34
|
+
export declare const schemaSchema: v.ObjectType<{
|
|
35
|
+
version: v.Type<number>;
|
|
36
|
+
tables: v.Type<Record<string, TableSchema>>;
|
|
37
|
+
}, undefined>;
|
|
38
|
+
export declare const schemaConfigSchema: v.ObjectType<{
|
|
39
|
+
schema: v.ObjectType<{
|
|
40
|
+
version: v.Type<number>;
|
|
41
|
+
tables: v.Type<Record<string, TableSchema>>;
|
|
42
|
+
}, undefined>;
|
|
43
|
+
authorization: v.Type<Record<string, {
|
|
44
|
+
row?: {
|
|
45
|
+
select?: ["allow", {
|
|
46
|
+
type: "simple";
|
|
47
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
48
|
+
left: {
|
|
49
|
+
type: "literal";
|
|
50
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
51
|
+
} | {
|
|
52
|
+
type: "column";
|
|
53
|
+
name: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: "static";
|
|
56
|
+
anchor: "authData" | "preMutationRow";
|
|
57
|
+
field: string;
|
|
58
|
+
};
|
|
59
|
+
right: {
|
|
60
|
+
type: "literal";
|
|
61
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
62
|
+
} | {
|
|
63
|
+
type: "static";
|
|
64
|
+
anchor: "authData" | "preMutationRow";
|
|
65
|
+
field: string;
|
|
66
|
+
};
|
|
67
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
68
|
+
readonly type: "correlatedSubquery";
|
|
69
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
70
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
71
|
+
}][] | undefined;
|
|
72
|
+
insert?: ["allow", {
|
|
73
|
+
type: "simple";
|
|
74
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
75
|
+
left: {
|
|
76
|
+
type: "literal";
|
|
77
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
78
|
+
} | {
|
|
79
|
+
type: "column";
|
|
80
|
+
name: string;
|
|
81
|
+
} | {
|
|
82
|
+
type: "static";
|
|
83
|
+
anchor: "authData" | "preMutationRow";
|
|
84
|
+
field: string;
|
|
85
|
+
};
|
|
86
|
+
right: {
|
|
87
|
+
type: "literal";
|
|
88
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
89
|
+
} | {
|
|
90
|
+
type: "static";
|
|
91
|
+
anchor: "authData" | "preMutationRow";
|
|
92
|
+
field: string;
|
|
93
|
+
};
|
|
94
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
95
|
+
readonly type: "correlatedSubquery";
|
|
96
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
97
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
98
|
+
}][] | undefined;
|
|
99
|
+
update?: {
|
|
100
|
+
preMutation?: ["allow", {
|
|
101
|
+
type: "simple";
|
|
102
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
103
|
+
left: {
|
|
104
|
+
type: "literal";
|
|
105
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
106
|
+
} | {
|
|
107
|
+
type: "column";
|
|
108
|
+
name: string;
|
|
109
|
+
} | {
|
|
110
|
+
type: "static";
|
|
111
|
+
anchor: "authData" | "preMutationRow";
|
|
112
|
+
field: string;
|
|
113
|
+
};
|
|
114
|
+
right: {
|
|
115
|
+
type: "literal";
|
|
116
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
117
|
+
} | {
|
|
118
|
+
type: "static";
|
|
119
|
+
anchor: "authData" | "preMutationRow";
|
|
120
|
+
field: string;
|
|
121
|
+
};
|
|
122
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
123
|
+
readonly type: "correlatedSubquery";
|
|
124
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
125
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
126
|
+
}][] | undefined;
|
|
127
|
+
postProposedMutation?: ["allow", {
|
|
128
|
+
type: "simple";
|
|
129
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
130
|
+
left: {
|
|
131
|
+
type: "literal";
|
|
132
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
133
|
+
} | {
|
|
134
|
+
type: "column";
|
|
135
|
+
name: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "static";
|
|
138
|
+
anchor: "authData" | "preMutationRow";
|
|
139
|
+
field: string;
|
|
140
|
+
};
|
|
141
|
+
right: {
|
|
142
|
+
type: "literal";
|
|
143
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
144
|
+
} | {
|
|
145
|
+
type: "static";
|
|
146
|
+
anchor: "authData" | "preMutationRow";
|
|
147
|
+
field: string;
|
|
148
|
+
};
|
|
149
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
150
|
+
readonly type: "correlatedSubquery";
|
|
151
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
152
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
153
|
+
}][] | undefined;
|
|
154
|
+
} | undefined;
|
|
155
|
+
delete?: ["allow", {
|
|
156
|
+
type: "simple";
|
|
157
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
158
|
+
left: {
|
|
159
|
+
type: "literal";
|
|
160
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
161
|
+
} | {
|
|
162
|
+
type: "column";
|
|
163
|
+
name: string;
|
|
164
|
+
} | {
|
|
165
|
+
type: "static";
|
|
166
|
+
anchor: "authData" | "preMutationRow";
|
|
167
|
+
field: string;
|
|
168
|
+
};
|
|
169
|
+
right: {
|
|
170
|
+
type: "literal";
|
|
171
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
172
|
+
} | {
|
|
173
|
+
type: "static";
|
|
174
|
+
anchor: "authData" | "preMutationRow";
|
|
175
|
+
field: string;
|
|
176
|
+
};
|
|
177
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
178
|
+
readonly type: "correlatedSubquery";
|
|
179
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
180
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
181
|
+
}][] | undefined;
|
|
182
|
+
} | undefined;
|
|
183
|
+
cell?: Record<string, {
|
|
184
|
+
select?: ["allow", {
|
|
185
|
+
type: "simple";
|
|
186
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
187
|
+
left: {
|
|
188
|
+
type: "literal";
|
|
189
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
190
|
+
} | {
|
|
191
|
+
type: "column";
|
|
192
|
+
name: string;
|
|
193
|
+
} | {
|
|
194
|
+
type: "static";
|
|
195
|
+
anchor: "authData" | "preMutationRow";
|
|
196
|
+
field: string;
|
|
197
|
+
};
|
|
198
|
+
right: {
|
|
199
|
+
type: "literal";
|
|
200
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
201
|
+
} | {
|
|
202
|
+
type: "static";
|
|
203
|
+
anchor: "authData" | "preMutationRow";
|
|
204
|
+
field: string;
|
|
205
|
+
};
|
|
206
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
207
|
+
readonly type: "correlatedSubquery";
|
|
208
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
209
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
210
|
+
}][] | undefined;
|
|
211
|
+
insert?: ["allow", {
|
|
212
|
+
type: "simple";
|
|
213
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
214
|
+
left: {
|
|
215
|
+
type: "literal";
|
|
216
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
217
|
+
} | {
|
|
218
|
+
type: "column";
|
|
219
|
+
name: string;
|
|
220
|
+
} | {
|
|
221
|
+
type: "static";
|
|
222
|
+
anchor: "authData" | "preMutationRow";
|
|
223
|
+
field: string;
|
|
224
|
+
};
|
|
225
|
+
right: {
|
|
226
|
+
type: "literal";
|
|
227
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
228
|
+
} | {
|
|
229
|
+
type: "static";
|
|
230
|
+
anchor: "authData" | "preMutationRow";
|
|
231
|
+
field: string;
|
|
232
|
+
};
|
|
233
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
234
|
+
readonly type: "correlatedSubquery";
|
|
235
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
236
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
237
|
+
}][] | undefined;
|
|
238
|
+
update?: {
|
|
239
|
+
preMutation?: ["allow", {
|
|
240
|
+
type: "simple";
|
|
241
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
242
|
+
left: {
|
|
243
|
+
type: "literal";
|
|
244
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
245
|
+
} | {
|
|
246
|
+
type: "column";
|
|
247
|
+
name: string;
|
|
248
|
+
} | {
|
|
249
|
+
type: "static";
|
|
250
|
+
anchor: "authData" | "preMutationRow";
|
|
251
|
+
field: string;
|
|
252
|
+
};
|
|
253
|
+
right: {
|
|
254
|
+
type: "literal";
|
|
255
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
256
|
+
} | {
|
|
257
|
+
type: "static";
|
|
258
|
+
anchor: "authData" | "preMutationRow";
|
|
259
|
+
field: string;
|
|
260
|
+
};
|
|
261
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
262
|
+
readonly type: "correlatedSubquery";
|
|
263
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
264
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
265
|
+
}][] | undefined;
|
|
266
|
+
postProposedMutation?: ["allow", {
|
|
267
|
+
type: "simple";
|
|
268
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
269
|
+
left: {
|
|
270
|
+
type: "literal";
|
|
271
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
272
|
+
} | {
|
|
273
|
+
type: "column";
|
|
274
|
+
name: string;
|
|
275
|
+
} | {
|
|
276
|
+
type: "static";
|
|
277
|
+
anchor: "authData" | "preMutationRow";
|
|
278
|
+
field: string;
|
|
279
|
+
};
|
|
280
|
+
right: {
|
|
281
|
+
type: "literal";
|
|
282
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
283
|
+
} | {
|
|
284
|
+
type: "static";
|
|
285
|
+
anchor: "authData" | "preMutationRow";
|
|
286
|
+
field: string;
|
|
287
|
+
};
|
|
288
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
289
|
+
readonly type: "correlatedSubquery";
|
|
290
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
291
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
292
|
+
}][] | undefined;
|
|
293
|
+
} | undefined;
|
|
294
|
+
delete?: ["allow", {
|
|
295
|
+
type: "simple";
|
|
296
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
297
|
+
left: {
|
|
298
|
+
type: "literal";
|
|
299
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
300
|
+
} | {
|
|
301
|
+
type: "column";
|
|
302
|
+
name: string;
|
|
303
|
+
} | {
|
|
304
|
+
type: "static";
|
|
305
|
+
anchor: "authData" | "preMutationRow";
|
|
306
|
+
field: string;
|
|
307
|
+
};
|
|
308
|
+
right: {
|
|
309
|
+
type: "literal";
|
|
310
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
311
|
+
} | {
|
|
312
|
+
type: "static";
|
|
313
|
+
anchor: "authData" | "preMutationRow";
|
|
314
|
+
field: string;
|
|
315
|
+
};
|
|
316
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
317
|
+
readonly type: "correlatedSubquery";
|
|
318
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
319
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
320
|
+
}][] | undefined;
|
|
321
|
+
}> | undefined;
|
|
322
|
+
}>>;
|
|
323
|
+
}, undefined>;
|
|
324
|
+
export declare function isSchemaConfig(value: unknown): value is SchemaConfig;
|
|
325
|
+
//# sourceMappingURL=schema-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-config.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/schema-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAEhD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,mBAAmB,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;aAa7B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;aAS5B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;aAIpC,CAAC;AAEH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAG9C,CAAC;AAEL,eAAO,MAAM,YAAY;;;aAGvB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAG7B,CAAC;AAEH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { authorizationConfigSchema, } from './compiled-authorization.js';
|
|
2
|
+
import * as v from '../../shared/src/valita.js';
|
|
3
|
+
import { primaryKeySchema } from '../../zero-protocol/src/primary-key.js';
|
|
4
|
+
export const relationshipSchema = v.object({
|
|
5
|
+
source: v.string(),
|
|
6
|
+
junction: v
|
|
7
|
+
.object({
|
|
8
|
+
schema: v.lazy(() => tableSchemaSchema),
|
|
9
|
+
sourceField: v.string(),
|
|
10
|
+
destField: v.string(),
|
|
11
|
+
})
|
|
12
|
+
.optional(),
|
|
13
|
+
dest: v.object({
|
|
14
|
+
field: v.string(),
|
|
15
|
+
schema: v.lazy(() => tableSchemaSchema),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
export const schemaValueSchema = v.object({
|
|
19
|
+
type: v.union(v.literal('string'), v.literal('number'), v.literal('boolean'), v.literal('null'), v.literal('json')),
|
|
20
|
+
optional: v.boolean().optional(),
|
|
21
|
+
});
|
|
22
|
+
export const sourceOrTableSchemaSchema = v.object({
|
|
23
|
+
tableName: v.string(),
|
|
24
|
+
columns: v.record(schemaValueSchema),
|
|
25
|
+
primaryKey: primaryKeySchema,
|
|
26
|
+
});
|
|
27
|
+
export const tableSchemaSchema = sourceOrTableSchemaSchema.extend({
|
|
28
|
+
relationships: v.record(relationshipSchema),
|
|
29
|
+
});
|
|
30
|
+
export const schemaSchema = v.object({
|
|
31
|
+
version: v.number(),
|
|
32
|
+
tables: v.record(tableSchemaSchema),
|
|
33
|
+
});
|
|
34
|
+
export const schemaConfigSchema = v.object({
|
|
35
|
+
schema: schemaSchema,
|
|
36
|
+
authorization: authorizationConfigSchema,
|
|
37
|
+
});
|
|
38
|
+
export function isSchemaConfig(value) {
|
|
39
|
+
return v.is(value, schemaConfigSchema);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=schema-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sch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;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC;IACpC,UAAU,EAAE,gBAAgB;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAC5B,yBAAyB,CAAC,MAAM,CAAC;IAC/B,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC;CAC5C,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,YAAY;IACpB,aAAa,EAAE,yBAAyB;CACzC,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../zero-schema/src/schema.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,YAAY,CAAyB,MAAS;IAC5D,OAAO,MAAW,CAAC;AACrB,CAAC"}
|
|
@@ -6,7 +6,7 @@ export type ValueType = 'string' | 'number' | 'boolean' | 'null' | 'json';
|
|
|
6
6
|
*/
|
|
7
7
|
export type SchemaValue = {
|
|
8
8
|
type: ValueType;
|
|
9
|
-
optional?: boolean;
|
|
9
|
+
optional?: boolean | undefined;
|
|
10
10
|
};
|
|
11
11
|
export type SourceOrTableSchema = {
|
|
12
12
|
readonly tableName: string;
|
|
@@ -61,9 +61,9 @@ export type Supertype<TSchemas extends TableSchema[]> = {
|
|
|
61
61
|
/**
|
|
62
62
|
* A schema might have a relationship to itself.
|
|
63
63
|
* Given we cannot reference a variable in the same statement we initialize
|
|
64
|
-
* the variable, we use a function to get around this.
|
|
64
|
+
* the variable, we allow use of a function to get around this.
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
type Lazy<T> = T | (() => T);
|
|
67
67
|
export type Relationship = FieldRelationship<TableSchema, TableSchema> | JunctionRelationship<TableSchema, TableSchema, TableSchema>;
|
|
68
68
|
/**
|
|
69
69
|
* A relationship between two entities where
|
|
@@ -73,24 +73,15 @@ export type FieldRelationship<TSourceSchema extends TableSchema, TDestSchema ext
|
|
|
73
73
|
source: keyof TSourceSchema['columns'];
|
|
74
74
|
dest: {
|
|
75
75
|
field: keyof TDestSchema['columns'];
|
|
76
|
-
schema:
|
|
76
|
+
schema: Lazy<TDestSchema>;
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
80
80
|
* A relationship between two entities where
|
|
81
81
|
* that relationship is defined via a junction table.
|
|
82
82
|
*/
|
|
83
|
-
export type JunctionRelationship<TSourceSchema extends TableSchema, TJunctionSchema extends TableSchema, TDestSchema extends TableSchema> = {
|
|
84
|
-
|
|
85
|
-
junction: {
|
|
86
|
-
sourceField: keyof TJunctionSchema['columns'];
|
|
87
|
-
destField: keyof TJunctionSchema['columns'];
|
|
88
|
-
schema: TDestSchema | Lazy<TJunctionSchema>;
|
|
89
|
-
};
|
|
90
|
-
dest: {
|
|
91
|
-
field: keyof TDestSchema['columns'];
|
|
92
|
-
schema: TDestSchema | Lazy<TJunctionSchema>;
|
|
93
|
-
};
|
|
83
|
+
export type JunctionRelationship<TSourceSchema extends TableSchema, TJunctionSchema extends TableSchema, TDestSchema extends TableSchema> = FieldRelationship<TSourceSchema, TDestSchema> & {
|
|
84
|
+
junction: FieldRelationship<TJunctionSchema, TJunctionSchema>;
|
|
94
85
|
};
|
|
95
86
|
export declare function isFieldRelationship(relationship: Relationship): relationship is FieldRelationship<TableSchema, TableSchema>;
|
|
96
87
|
export declare function isJunctionRelationship(relationship: Relationship): relationship is JunctionRelationship<TableSchema, TableSchema, TableSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-schema.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/table-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,wCAAwC,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"table-schema.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/table-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,wCAAwC,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG;IAC9C,QAAQ,CAAC,aAAa,EAAE;QAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;KAAC,CAAC;CACjE,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,EAAE,CAAC,GACrD,CAA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CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,SAAS,iBAAiB,CACnE,WAAW,EACX,MAAM,OAAO,CACd,GACG,OAAO,GACP,OAAO,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,SAAS,oBAAoB,CAClE,WAAW,EACX,WAAW,EACX,MAAM,OAAO,CACd,GACD,OAAO,GACP,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-schema.js","sourceRoot":"","sources":["../../../../zero-schema/src/table-schema.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,iBAAiB,CAA8B,MAAS;IACtE,OAAO,MAAW,CAAC;AACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"table-schema.js","sourceRoot":"","sources":["../../../../zero-schema/src/table-schema.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,iBAAiB,CAA8B,MAAS;IACtE,OAAO,MAAW,CAAC;AACrB,CAAC;AA2FD,MAAM,UAAU,mBAAmB,CACjC,YAA0B;IAE1B,OAAO,CAEH,YAKD,CAAC,QAAQ,KAAK,SAAS,CACzB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,YAA0B;IAE1B,OAAO,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC"}
|