@rocicorp/zero 0.6.2024112102 → 0.7.2024120100
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-QB7G63C6.js → chunk-4XX2NVJ7.js} +737 -738
- package/out/{chunk-QB7G63C6.js.map → chunk-4XX2NVJ7.js.map} +4 -4
- package/out/{chunk-5UY46OAF.js → chunk-C7M3BJ3Z.js} +16 -8
- package/out/chunk-C7M3BJ3Z.js.map +7 -0
- 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 +35 -0
- package/out/zero-cache/src/auth/load-schema.js.map +1 -0
- package/out/zero-cache/src/auth/read-authorizer.d.ts +25 -0
- package/out/zero-cache/src/auth/read-authorizer.d.ts.map +1 -0
- package/out/zero-cache/src/auth/read-authorizer.js +126 -0
- package/out/zero-cache/src/auth/read-authorizer.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 +7 -6
- 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 +15 -10
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.js +42 -23
- 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 +9 -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 +167 -50
- 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 +2 -3
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +4 -3
- 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 +13 -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 +2 -2
- 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/ast.d.ts +9 -9
- package/out/zero-protocol/src/ast.d.ts.map +1 -1
- package/out/zero-protocol/src/ast.js +11 -12
- package/out/zero-protocol/src/ast.js.map +1 -1
- 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/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-permissions.d.ts +480 -0
- package/out/zero-schema/src/compiled-permissions.d.ts.map +1 -0
- package/out/zero-schema/src/compiled-permissions.js +20 -0
- package/out/zero-schema/src/compiled-permissions.js.map +1 -0
- package/out/zero-schema/src/mod.d.ts +1 -1
- package/out/zero-schema/src/mod.d.ts.map +1 -1
- package/out/zero-schema/src/normalize-table-schema.d.ts +19 -17
- package/out/zero-schema/src/normalize-table-schema.d.ts.map +1 -1
- package/out/zero-schema/src/normalize-table-schema.js +92 -0
- package/out/zero-schema/src/normalize-table-schema.js.map +1 -0
- package/out/zero-schema/src/normalized-schema.d.ts +6 -1
- package/out/zero-schema/src/normalized-schema.d.ts.map +1 -1
- 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/permissions.d.ts +32 -0
- package/out/zero-schema/src/permissions.d.ts.map +1 -0
- package/out/zero-schema/src/schema-config.d.ts +43 -0
- package/out/zero-schema/src/schema-config.d.ts.map +1 -0
- package/out/zero-schema/src/schema-config.js +79 -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 +15 -20
- package/out/zero-schema/src/table-schema.d.ts.map +1 -1
- package/out/zero-schema/src/table-schema.js +15 -2
- package/out/zero-schema/src/table-schema.js.map +1 -1
- package/out/zero.js +4 -4
- 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 +15 -17
- 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 +61 -83
- 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 -5
- package/out/zql/src/query/auth-query.d.ts.map +1 -1
- package/out/zql/src/query/auth-query.js +30 -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 +353 -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 +33 -82
- 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
- package/out/zero-schema/src/authorization.d.ts +0 -25
- package/out/zero-schema/src/authorization.d.ts.map +0 -1
- package/out/zero-schema/src/compiled-authorization.d.ts +0 -561
- package/out/zero-schema/src/compiled-authorization.d.ts.map +0 -1
- package/out/zero-schema/src/compiled-authorization.js +0 -15
- package/out/zero-schema/src/compiled-authorization.js.map +0 -1
|
@@ -27,10 +27,14 @@ export declare const pokeStartBodySchema: v.ObjectType<{
|
|
|
27
27
|
pokeID: v.Type<string>;
|
|
28
28
|
baseCookie: v.UnionType<[v.Type<string>, v.Type<null>]>;
|
|
29
29
|
cookie: v.Type<string>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
/**
|
|
31
|
+
* This field is always set if the poke contains a `rowsPatch`.
|
|
32
|
+
* It may be absent for patches that only update clients and queries.
|
|
33
|
+
*/
|
|
34
|
+
schemaVersions: v.Optional<{
|
|
35
|
+
minSupportedVersion: number;
|
|
36
|
+
maxSupportedVersion: number;
|
|
37
|
+
}>;
|
|
34
38
|
timestamp: v.Optional<number>;
|
|
35
39
|
}, undefined>;
|
|
36
40
|
export declare const pokePartBodySchema: v.ObjectType<{
|
|
@@ -167,10 +171,14 @@ export declare const pokeStartMessageSchema: v.TupleType<[v.Type<"pokeStart">, v
|
|
|
167
171
|
pokeID: v.Type<string>;
|
|
168
172
|
baseCookie: v.UnionType<[v.Type<string>, v.Type<null>]>;
|
|
169
173
|
cookie: v.Type<string>;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
+
/**
|
|
175
|
+
* This field is always set if the poke contains a `rowsPatch`.
|
|
176
|
+
* It may be absent for patches that only update clients and queries.
|
|
177
|
+
*/
|
|
178
|
+
schemaVersions: v.Optional<{
|
|
179
|
+
minSupportedVersion: number;
|
|
180
|
+
maxSupportedVersion: number;
|
|
181
|
+
}>;
|
|
174
182
|
timestamp: v.Optional<number>;
|
|
175
183
|
}, undefined>]>;
|
|
176
184
|
export declare const pokePartMessageSchema: v.TupleType<[v.Type<"pokePart">, v.ObjectType<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poke.d.ts","sourceRoot":"","sources":["../../../../zero-protocol/src/poke.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -34,10 +34,16 @@ export const pokeStartBodySchema = v.object({
|
|
|
34
34
|
// able to send a base cookie with value `null` to match that state.
|
|
35
35
|
baseCookie: nullableVersionSchema,
|
|
36
36
|
cookie: versionSchema,
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* This field is always set if the poke contains a `rowsPatch`.
|
|
39
|
+
* It may be absent for patches that only update clients and queries.
|
|
40
|
+
*/
|
|
41
|
+
schemaVersions: v
|
|
42
|
+
.object({
|
|
38
43
|
minSupportedVersion: v.number(),
|
|
39
44
|
maxSupportedVersion: v.number(),
|
|
40
|
-
})
|
|
45
|
+
})
|
|
46
|
+
.optional(),
|
|
41
47
|
timestamp: v.number().optional(),
|
|
42
48
|
});
|
|
43
49
|
export const pokePartBodySchema = v.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poke.js","sourceRoot":"","sources":["../../../../zero-protocol/src/poke.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,qBAAqB,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,2EAA2E;IAC3E,yEAAyE;IACzE,oEAAoE;IACpE,UAAU,EAAE,qBAAqB;IACjC,MAAM,EAAE,aAAa;IACrB,cAAc,EAAE,CAA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D,iEAAiE;IACjE,aAAa;IACb,eAAe,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAC9C,2BAA2B;IAC3B,SAAS,EAAE,eAAe,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,mEAAmE;IACnE,eAAe;IACf,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACtB,mBAAmB;CACpB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3C,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACrB,kBAAkB;CACnB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACpB,iBAAiB;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as v from '../../shared/src/valita.js';
|
|
2
|
+
export declare const schemaOptions: {
|
|
3
|
+
path: {
|
|
4
|
+
type: v.Type<string>;
|
|
5
|
+
desc: string[];
|
|
6
|
+
alias: string;
|
|
7
|
+
};
|
|
8
|
+
output: {
|
|
9
|
+
type: v.Type<string>;
|
|
10
|
+
desc: string[];
|
|
11
|
+
alias: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=build-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-schema.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/build-schema.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAQhD,eAAO,MAAM,aAAa;;;;;;;;;;;CAmBzB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { tsImport } from 'tsx/esm/api';
|
|
4
|
+
import { writeFile } from 'node:fs/promises';
|
|
5
|
+
import { permissionsConfigSchema } from './compiled-permissions.js';
|
|
6
|
+
import * as v from '../../shared/src/valita.js';
|
|
7
|
+
import { parseOptions } from '../../shared/src/options.js';
|
|
8
|
+
import { normalizeSchema } from './normalized-schema.js';
|
|
9
|
+
import { isSchemaConfig, replacePointersWithSchemaNames, } from './schema-config.js';
|
|
10
|
+
export const schemaOptions = {
|
|
11
|
+
path: {
|
|
12
|
+
type: v.string().default('schema.ts'),
|
|
13
|
+
desc: [
|
|
14
|
+
'Relative path to the file containing the schema definition.',
|
|
15
|
+
'The file must have a default export of type SchemaConfig.',
|
|
16
|
+
],
|
|
17
|
+
alias: 'p',
|
|
18
|
+
},
|
|
19
|
+
output: {
|
|
20
|
+
type: v.string().default('zero-schema.json'),
|
|
21
|
+
desc: [
|
|
22
|
+
'Output path for the generated schema JSON file.',
|
|
23
|
+
'',
|
|
24
|
+
'The schema will be written as a JSON file containing the compiled',
|
|
25
|
+
'permission rules derived from your schema definition.',
|
|
26
|
+
],
|
|
27
|
+
alias: 'o',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
async function main() {
|
|
31
|
+
const config = parseOptions(schemaOptions, process.argv.slice(2), 'ZERO_SCHEMA_');
|
|
32
|
+
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
const absoluteConfigPath = path.resolve(config.path);
|
|
34
|
+
const relativePath = path.join(path.relative(dirname, path.dirname(absoluteConfigPath)), path.basename(absoluteConfigPath));
|
|
35
|
+
try {
|
|
36
|
+
const module = await tsImport(relativePath, import.meta.url);
|
|
37
|
+
if (!isSchemaConfig(module)) {
|
|
38
|
+
throw new Error('Schema file must have a export `schema` and `permissions`.');
|
|
39
|
+
}
|
|
40
|
+
const schemaConfig = module;
|
|
41
|
+
const permissions = v.parse(await schemaConfig.permissions, permissionsConfigSchema);
|
|
42
|
+
const cycleFreeNormalizedSchema = replacePointersWithSchemaNames(normalizeSchema(schemaConfig.schema));
|
|
43
|
+
const output = {
|
|
44
|
+
permissions,
|
|
45
|
+
schema: cycleFreeNormalizedSchema,
|
|
46
|
+
};
|
|
47
|
+
await writeFile(config.output, JSON.stringify(output, undefined, 2));
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
console.error(`Failed to load zero schema from ${absoluteConfigPath}:`, e);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
void main();
|
|
55
|
+
//# sourceMappingURL=build-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-schema.js","sourceRoot":"","sources":["../../../../zero-schema/src/build-schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,cAAc,EACd,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;QACrC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AAY,CAAC,MAAM,CAAC,CACrC,CAAC;QAEF,MAAM,MAAM,GAAG;YACb,WAAW;YACX,MAAM,EAAE,yBAAyB;SAClC,CAAC;QAEF,MAAM,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,mCAAmC,kBAAkB,GAAG,EAAE,CAAC,CAAC,CAAC;QAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
import * as v from '../../shared/src/valita.js';
|
|
2
|
+
declare const ruleSchema: v.TupleType<[v.Type<"allow">, v.UnionType<[v.ObjectType<{
|
|
3
|
+
type: v.Type<"simple">;
|
|
4
|
+
op: v.UnionType<[v.UnionType<[v.Type<"=">, v.Type<"!=">, v.Type<"IS">, v.Type<"IS NOT">]>, v.UnionType<[v.Type<"<">, v.Type<">">, v.Type<"<=">, v.Type<">=">]>, v.UnionType<[v.Type<"LIKE">, v.Type<"NOT LIKE">, v.Type<"ILIKE">, v.Type<"NOT ILIKE">]>, v.UnionType<[v.Type<"IN">, v.Type<"NOT IN">]>]>;
|
|
5
|
+
left: v.UnionType<[v.ObjectType<{
|
|
6
|
+
type: v.Type<"literal">;
|
|
7
|
+
value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
|
|
8
|
+
}, undefined>, v.ObjectType<{
|
|
9
|
+
type: v.Type<"column">;
|
|
10
|
+
name: v.Type<string>;
|
|
11
|
+
}, undefined>, v.ObjectType<{
|
|
12
|
+
type: v.Type<"static">;
|
|
13
|
+
anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
|
|
14
|
+
field: v.Type<string>;
|
|
15
|
+
}, undefined>]>;
|
|
16
|
+
right: v.UnionType<[v.ObjectType<{
|
|
17
|
+
type: v.Type<"static">;
|
|
18
|
+
anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
|
|
19
|
+
field: v.Type<string>;
|
|
20
|
+
}, undefined>, v.ObjectType<{
|
|
21
|
+
type: v.Type<"literal">;
|
|
22
|
+
value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
|
|
23
|
+
}, undefined>]>;
|
|
24
|
+
}, undefined>, v.Type<import("../../zero-protocol/src/ast.js").Conjunction>, v.Type<import("../../zero-protocol/src/ast.js").Disjunction>, v.ObjectType<Readonly<{
|
|
25
|
+
type: v.Type<"correlatedSubquery">;
|
|
26
|
+
related: v.Type<import("../../zero-protocol/src/ast.js").CorrelatedSubquery>;
|
|
27
|
+
op: v.UnionType<[v.Type<"EXISTS">, v.Type<"NOT EXISTS">]>;
|
|
28
|
+
}>, undefined>]>]>;
|
|
29
|
+
export type Rule = v.Infer<typeof ruleSchema>;
|
|
30
|
+
declare const policySchema: v.ArrayType<v.TupleType<[v.Type<"allow">, v.UnionType<[v.ObjectType<{
|
|
31
|
+
type: v.Type<"simple">;
|
|
32
|
+
op: v.UnionType<[v.UnionType<[v.Type<"=">, v.Type<"!=">, v.Type<"IS">, v.Type<"IS NOT">]>, v.UnionType<[v.Type<"<">, v.Type<">">, v.Type<"<=">, v.Type<">=">]>, v.UnionType<[v.Type<"LIKE">, v.Type<"NOT LIKE">, v.Type<"ILIKE">, v.Type<"NOT ILIKE">]>, v.UnionType<[v.Type<"IN">, v.Type<"NOT IN">]>]>;
|
|
33
|
+
left: v.UnionType<[v.ObjectType<{
|
|
34
|
+
type: v.Type<"literal">;
|
|
35
|
+
value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
|
|
36
|
+
}, undefined>, v.ObjectType<{
|
|
37
|
+
type: v.Type<"column">;
|
|
38
|
+
name: v.Type<string>;
|
|
39
|
+
}, undefined>, v.ObjectType<{
|
|
40
|
+
type: v.Type<"static">;
|
|
41
|
+
anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
|
|
42
|
+
field: v.Type<string>;
|
|
43
|
+
}, undefined>]>;
|
|
44
|
+
right: v.UnionType<[v.ObjectType<{
|
|
45
|
+
type: v.Type<"static">;
|
|
46
|
+
anchor: v.UnionType<[v.Type<"authData">, v.Type<"preMutationRow">]>;
|
|
47
|
+
field: v.Type<string>;
|
|
48
|
+
}, undefined>, v.ObjectType<{
|
|
49
|
+
type: v.Type<"literal">;
|
|
50
|
+
value: v.UnionType<[v.Type<string>, v.Type<number>, v.Type<boolean>, v.Type<null>, v.Type<readonly (string | number | boolean)[]>]>;
|
|
51
|
+
}, undefined>]>;
|
|
52
|
+
}, undefined>, v.Type<import("../../zero-protocol/src/ast.js").Conjunction>, v.Type<import("../../zero-protocol/src/ast.js").Disjunction>, v.ObjectType<Readonly<{
|
|
53
|
+
type: v.Type<"correlatedSubquery">;
|
|
54
|
+
related: v.Type<import("../../zero-protocol/src/ast.js").CorrelatedSubquery>;
|
|
55
|
+
op: v.UnionType<[v.Type<"EXISTS">, v.Type<"NOT EXISTS">]>;
|
|
56
|
+
}>, undefined>]>]>>;
|
|
57
|
+
export type Policy = v.Infer<typeof policySchema>;
|
|
58
|
+
declare const assetSchema: v.ObjectType<{
|
|
59
|
+
select: v.Optional<["allow", {
|
|
60
|
+
type: "simple";
|
|
61
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
62
|
+
left: {
|
|
63
|
+
type: "literal";
|
|
64
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
65
|
+
} | {
|
|
66
|
+
type: "column";
|
|
67
|
+
name: string;
|
|
68
|
+
} | {
|
|
69
|
+
type: "static";
|
|
70
|
+
anchor: "authData" | "preMutationRow";
|
|
71
|
+
field: string;
|
|
72
|
+
};
|
|
73
|
+
right: {
|
|
74
|
+
type: "literal";
|
|
75
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
76
|
+
} | {
|
|
77
|
+
type: "static";
|
|
78
|
+
anchor: "authData" | "preMutationRow";
|
|
79
|
+
field: string;
|
|
80
|
+
};
|
|
81
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
82
|
+
readonly type: "correlatedSubquery";
|
|
83
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
84
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
85
|
+
}][]>;
|
|
86
|
+
insert: v.Optional<["allow", {
|
|
87
|
+
type: "simple";
|
|
88
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
89
|
+
left: {
|
|
90
|
+
type: "literal";
|
|
91
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
92
|
+
} | {
|
|
93
|
+
type: "column";
|
|
94
|
+
name: string;
|
|
95
|
+
} | {
|
|
96
|
+
type: "static";
|
|
97
|
+
anchor: "authData" | "preMutationRow";
|
|
98
|
+
field: string;
|
|
99
|
+
};
|
|
100
|
+
right: {
|
|
101
|
+
type: "literal";
|
|
102
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
103
|
+
} | {
|
|
104
|
+
type: "static";
|
|
105
|
+
anchor: "authData" | "preMutationRow";
|
|
106
|
+
field: string;
|
|
107
|
+
};
|
|
108
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
109
|
+
readonly type: "correlatedSubquery";
|
|
110
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
111
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
112
|
+
}][]>;
|
|
113
|
+
update: v.Optional<{
|
|
114
|
+
preMutation?: ["allow", {
|
|
115
|
+
type: "simple";
|
|
116
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
117
|
+
left: {
|
|
118
|
+
type: "literal";
|
|
119
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
120
|
+
} | {
|
|
121
|
+
type: "column";
|
|
122
|
+
name: string;
|
|
123
|
+
} | {
|
|
124
|
+
type: "static";
|
|
125
|
+
anchor: "authData" | "preMutationRow";
|
|
126
|
+
field: string;
|
|
127
|
+
};
|
|
128
|
+
right: {
|
|
129
|
+
type: "literal";
|
|
130
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
131
|
+
} | {
|
|
132
|
+
type: "static";
|
|
133
|
+
anchor: "authData" | "preMutationRow";
|
|
134
|
+
field: string;
|
|
135
|
+
};
|
|
136
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
137
|
+
readonly type: "correlatedSubquery";
|
|
138
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
139
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
140
|
+
}][] | undefined;
|
|
141
|
+
postProposedMutation?: ["allow", {
|
|
142
|
+
type: "simple";
|
|
143
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
144
|
+
left: {
|
|
145
|
+
type: "literal";
|
|
146
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
147
|
+
} | {
|
|
148
|
+
type: "column";
|
|
149
|
+
name: string;
|
|
150
|
+
} | {
|
|
151
|
+
type: "static";
|
|
152
|
+
anchor: "authData" | "preMutationRow";
|
|
153
|
+
field: string;
|
|
154
|
+
};
|
|
155
|
+
right: {
|
|
156
|
+
type: "literal";
|
|
157
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
158
|
+
} | {
|
|
159
|
+
type: "static";
|
|
160
|
+
anchor: "authData" | "preMutationRow";
|
|
161
|
+
field: string;
|
|
162
|
+
};
|
|
163
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
164
|
+
readonly type: "correlatedSubquery";
|
|
165
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
166
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
167
|
+
}][] | undefined;
|
|
168
|
+
}>;
|
|
169
|
+
delete: v.Optional<["allow", {
|
|
170
|
+
type: "simple";
|
|
171
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
172
|
+
left: {
|
|
173
|
+
type: "literal";
|
|
174
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
175
|
+
} | {
|
|
176
|
+
type: "column";
|
|
177
|
+
name: string;
|
|
178
|
+
} | {
|
|
179
|
+
type: "static";
|
|
180
|
+
anchor: "authData" | "preMutationRow";
|
|
181
|
+
field: string;
|
|
182
|
+
};
|
|
183
|
+
right: {
|
|
184
|
+
type: "literal";
|
|
185
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
186
|
+
} | {
|
|
187
|
+
type: "static";
|
|
188
|
+
anchor: "authData" | "preMutationRow";
|
|
189
|
+
field: string;
|
|
190
|
+
};
|
|
191
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
192
|
+
readonly type: "correlatedSubquery";
|
|
193
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
194
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
195
|
+
}][]>;
|
|
196
|
+
}, undefined>;
|
|
197
|
+
export type AssetPermissions = v.Infer<typeof assetSchema>;
|
|
198
|
+
export declare const permissionsConfigSchema: v.Type<Record<string, {
|
|
199
|
+
row?: {
|
|
200
|
+
select?: ["allow", {
|
|
201
|
+
type: "simple";
|
|
202
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
203
|
+
left: {
|
|
204
|
+
type: "literal";
|
|
205
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
206
|
+
} | {
|
|
207
|
+
type: "column";
|
|
208
|
+
name: string;
|
|
209
|
+
} | {
|
|
210
|
+
type: "static";
|
|
211
|
+
anchor: "authData" | "preMutationRow";
|
|
212
|
+
field: string;
|
|
213
|
+
};
|
|
214
|
+
right: {
|
|
215
|
+
type: "literal";
|
|
216
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
217
|
+
} | {
|
|
218
|
+
type: "static";
|
|
219
|
+
anchor: "authData" | "preMutationRow";
|
|
220
|
+
field: string;
|
|
221
|
+
};
|
|
222
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
223
|
+
readonly type: "correlatedSubquery";
|
|
224
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
225
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
226
|
+
}][] | undefined;
|
|
227
|
+
insert?: ["allow", {
|
|
228
|
+
type: "simple";
|
|
229
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
230
|
+
left: {
|
|
231
|
+
type: "literal";
|
|
232
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
233
|
+
} | {
|
|
234
|
+
type: "column";
|
|
235
|
+
name: string;
|
|
236
|
+
} | {
|
|
237
|
+
type: "static";
|
|
238
|
+
anchor: "authData" | "preMutationRow";
|
|
239
|
+
field: string;
|
|
240
|
+
};
|
|
241
|
+
right: {
|
|
242
|
+
type: "literal";
|
|
243
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
244
|
+
} | {
|
|
245
|
+
type: "static";
|
|
246
|
+
anchor: "authData" | "preMutationRow";
|
|
247
|
+
field: string;
|
|
248
|
+
};
|
|
249
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
250
|
+
readonly type: "correlatedSubquery";
|
|
251
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
252
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
253
|
+
}][] | undefined;
|
|
254
|
+
update?: {
|
|
255
|
+
preMutation?: ["allow", {
|
|
256
|
+
type: "simple";
|
|
257
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
258
|
+
left: {
|
|
259
|
+
type: "literal";
|
|
260
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
261
|
+
} | {
|
|
262
|
+
type: "column";
|
|
263
|
+
name: string;
|
|
264
|
+
} | {
|
|
265
|
+
type: "static";
|
|
266
|
+
anchor: "authData" | "preMutationRow";
|
|
267
|
+
field: string;
|
|
268
|
+
};
|
|
269
|
+
right: {
|
|
270
|
+
type: "literal";
|
|
271
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
272
|
+
} | {
|
|
273
|
+
type: "static";
|
|
274
|
+
anchor: "authData" | "preMutationRow";
|
|
275
|
+
field: string;
|
|
276
|
+
};
|
|
277
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
278
|
+
readonly type: "correlatedSubquery";
|
|
279
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
280
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
281
|
+
}][] | undefined;
|
|
282
|
+
postProposedMutation?: ["allow", {
|
|
283
|
+
type: "simple";
|
|
284
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
285
|
+
left: {
|
|
286
|
+
type: "literal";
|
|
287
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
288
|
+
} | {
|
|
289
|
+
type: "column";
|
|
290
|
+
name: string;
|
|
291
|
+
} | {
|
|
292
|
+
type: "static";
|
|
293
|
+
anchor: "authData" | "preMutationRow";
|
|
294
|
+
field: string;
|
|
295
|
+
};
|
|
296
|
+
right: {
|
|
297
|
+
type: "literal";
|
|
298
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
299
|
+
} | {
|
|
300
|
+
type: "static";
|
|
301
|
+
anchor: "authData" | "preMutationRow";
|
|
302
|
+
field: string;
|
|
303
|
+
};
|
|
304
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
305
|
+
readonly type: "correlatedSubquery";
|
|
306
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
307
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
308
|
+
}][] | undefined;
|
|
309
|
+
} | undefined;
|
|
310
|
+
delete?: ["allow", {
|
|
311
|
+
type: "simple";
|
|
312
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
313
|
+
left: {
|
|
314
|
+
type: "literal";
|
|
315
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
316
|
+
} | {
|
|
317
|
+
type: "column";
|
|
318
|
+
name: string;
|
|
319
|
+
} | {
|
|
320
|
+
type: "static";
|
|
321
|
+
anchor: "authData" | "preMutationRow";
|
|
322
|
+
field: string;
|
|
323
|
+
};
|
|
324
|
+
right: {
|
|
325
|
+
type: "literal";
|
|
326
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
327
|
+
} | {
|
|
328
|
+
type: "static";
|
|
329
|
+
anchor: "authData" | "preMutationRow";
|
|
330
|
+
field: string;
|
|
331
|
+
};
|
|
332
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
333
|
+
readonly type: "correlatedSubquery";
|
|
334
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
335
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
336
|
+
}][] | undefined;
|
|
337
|
+
} | undefined;
|
|
338
|
+
cell?: Record<string, {
|
|
339
|
+
select?: ["allow", {
|
|
340
|
+
type: "simple";
|
|
341
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
342
|
+
left: {
|
|
343
|
+
type: "literal";
|
|
344
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
345
|
+
} | {
|
|
346
|
+
type: "column";
|
|
347
|
+
name: string;
|
|
348
|
+
} | {
|
|
349
|
+
type: "static";
|
|
350
|
+
anchor: "authData" | "preMutationRow";
|
|
351
|
+
field: string;
|
|
352
|
+
};
|
|
353
|
+
right: {
|
|
354
|
+
type: "literal";
|
|
355
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
356
|
+
} | {
|
|
357
|
+
type: "static";
|
|
358
|
+
anchor: "authData" | "preMutationRow";
|
|
359
|
+
field: string;
|
|
360
|
+
};
|
|
361
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
362
|
+
readonly type: "correlatedSubquery";
|
|
363
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
364
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
365
|
+
}][] | undefined;
|
|
366
|
+
insert?: ["allow", {
|
|
367
|
+
type: "simple";
|
|
368
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
369
|
+
left: {
|
|
370
|
+
type: "literal";
|
|
371
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
372
|
+
} | {
|
|
373
|
+
type: "column";
|
|
374
|
+
name: string;
|
|
375
|
+
} | {
|
|
376
|
+
type: "static";
|
|
377
|
+
anchor: "authData" | "preMutationRow";
|
|
378
|
+
field: string;
|
|
379
|
+
};
|
|
380
|
+
right: {
|
|
381
|
+
type: "literal";
|
|
382
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
383
|
+
} | {
|
|
384
|
+
type: "static";
|
|
385
|
+
anchor: "authData" | "preMutationRow";
|
|
386
|
+
field: string;
|
|
387
|
+
};
|
|
388
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
389
|
+
readonly type: "correlatedSubquery";
|
|
390
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
391
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
392
|
+
}][] | undefined;
|
|
393
|
+
update?: {
|
|
394
|
+
preMutation?: ["allow", {
|
|
395
|
+
type: "simple";
|
|
396
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
397
|
+
left: {
|
|
398
|
+
type: "literal";
|
|
399
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
400
|
+
} | {
|
|
401
|
+
type: "column";
|
|
402
|
+
name: string;
|
|
403
|
+
} | {
|
|
404
|
+
type: "static";
|
|
405
|
+
anchor: "authData" | "preMutationRow";
|
|
406
|
+
field: string;
|
|
407
|
+
};
|
|
408
|
+
right: {
|
|
409
|
+
type: "literal";
|
|
410
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
411
|
+
} | {
|
|
412
|
+
type: "static";
|
|
413
|
+
anchor: "authData" | "preMutationRow";
|
|
414
|
+
field: string;
|
|
415
|
+
};
|
|
416
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
417
|
+
readonly type: "correlatedSubquery";
|
|
418
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
419
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
420
|
+
}][] | undefined;
|
|
421
|
+
postProposedMutation?: ["allow", {
|
|
422
|
+
type: "simple";
|
|
423
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
424
|
+
left: {
|
|
425
|
+
type: "literal";
|
|
426
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
427
|
+
} | {
|
|
428
|
+
type: "column";
|
|
429
|
+
name: string;
|
|
430
|
+
} | {
|
|
431
|
+
type: "static";
|
|
432
|
+
anchor: "authData" | "preMutationRow";
|
|
433
|
+
field: string;
|
|
434
|
+
};
|
|
435
|
+
right: {
|
|
436
|
+
type: "literal";
|
|
437
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
438
|
+
} | {
|
|
439
|
+
type: "static";
|
|
440
|
+
anchor: "authData" | "preMutationRow";
|
|
441
|
+
field: string;
|
|
442
|
+
};
|
|
443
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
444
|
+
readonly type: "correlatedSubquery";
|
|
445
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
446
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
447
|
+
}][] | undefined;
|
|
448
|
+
} | undefined;
|
|
449
|
+
delete?: ["allow", {
|
|
450
|
+
type: "simple";
|
|
451
|
+
op: "=" | "!=" | "IS" | "IS NOT" | "<" | ">" | "<=" | ">=" | "LIKE" | "NOT LIKE" | "ILIKE" | "NOT ILIKE" | "IN" | "NOT IN";
|
|
452
|
+
left: {
|
|
453
|
+
type: "literal";
|
|
454
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
455
|
+
} | {
|
|
456
|
+
type: "column";
|
|
457
|
+
name: string;
|
|
458
|
+
} | {
|
|
459
|
+
type: "static";
|
|
460
|
+
anchor: "authData" | "preMutationRow";
|
|
461
|
+
field: string;
|
|
462
|
+
};
|
|
463
|
+
right: {
|
|
464
|
+
type: "literal";
|
|
465
|
+
value: string | number | boolean | readonly (string | number | boolean)[] | null;
|
|
466
|
+
} | {
|
|
467
|
+
type: "static";
|
|
468
|
+
anchor: "authData" | "preMutationRow";
|
|
469
|
+
field: string;
|
|
470
|
+
};
|
|
471
|
+
} | import("../../zero-protocol/src/ast.js").Conjunction | import("../../zero-protocol/src/ast.js").Disjunction | {
|
|
472
|
+
readonly type: "correlatedSubquery";
|
|
473
|
+
readonly related: import("../../zero-protocol/src/ast.js").CorrelatedSubquery;
|
|
474
|
+
readonly op: "EXISTS" | "NOT EXISTS";
|
|
475
|
+
}][] | undefined;
|
|
476
|
+
}> | undefined;
|
|
477
|
+
}>>;
|
|
478
|
+
export type PermissionsConfig = v.Infer<typeof permissionsConfigSchema>;
|
|
479
|
+
export {};
|
|
480
|
+
//# sourceMappingURL=compiled-permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiled-permissions.d.ts","sourceRoot":"","sources":["../../../../zero-schema/src/compiled-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAGhD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAiD,CAAC;AAClE,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAsB,CAAC;AACzC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAUf,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE3D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|