@dads-framework/spicedb-access 0.0.0-stage → 0.4.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/LICENSE.md +21 -0
- package/README.md +80 -2
- package/bin/dads-import-spicedb.mjs +139 -0
- package/dist/authz-journal/index.d.ts +3 -0
- package/dist/authz-journal/index.d.ts.map +1 -0
- package/dist/authz-journal/index.js +3 -0
- package/dist/authz-journal/index.js.map +1 -0
- package/dist/authz-journal/migration-journal.access.d.ts +11 -0
- package/dist/authz-journal/migration-journal.access.d.ts.map +1 -0
- package/dist/authz-journal/migration-journal.access.js +16 -0
- package/dist/authz-journal/migration-journal.access.js.map +1 -0
- package/dist/authz-journal/migration-version.access.d.ts +7 -0
- package/dist/authz-journal/migration-version.access.d.ts.map +1 -0
- package/dist/authz-journal/migration-version.access.js +11 -0
- package/dist/authz-journal/migration-version.access.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/access/check-all.d.ts +8 -0
- package/dist/lib/access/check-all.d.ts.map +1 -0
- package/dist/lib/access/check-all.js +11 -0
- package/dist/lib/access/check-all.js.map +1 -0
- package/dist/lib/access/guarded-authorization.d.ts +71 -0
- package/dist/lib/access/guarded-authorization.d.ts.map +1 -0
- package/dist/lib/access/guarded-authorization.js +162 -0
- package/dist/lib/access/guarded-authorization.js.map +1 -0
- package/dist/lib/access/list-only-visible.d.ts +23 -0
- package/dist/lib/access/list-only-visible.d.ts.map +1 -0
- package/dist/lib/access/list-only-visible.js +21 -0
- package/dist/lib/access/list-only-visible.js.map +1 -0
- package/dist/lib/access/logic/spice-db-empty-schema.d.ts +3 -0
- package/dist/lib/access/logic/spice-db-empty-schema.d.ts.map +1 -0
- package/dist/lib/access/logic/spice-db-empty-schema.js +17 -0
- package/dist/lib/access/logic/spice-db-empty-schema.js.map +1 -0
- package/dist/lib/access/logic/spice-db-security.d.ts +4 -0
- package/dist/lib/access/logic/spice-db-security.d.ts.map +1 -0
- package/dist/lib/access/logic/spice-db-security.js +8 -0
- package/dist/lib/access/logic/spice-db-security.js.map +1 -0
- package/dist/lib/access/logic/spice-db-write-retry.d.ts +22 -0
- package/dist/lib/access/logic/spice-db-write-retry.d.ts.map +1 -0
- package/dist/lib/access/logic/spice-db-write-retry.js +35 -0
- package/dist/lib/access/logic/spice-db-write-retry.js.map +1 -0
- package/dist/lib/access/missing-ownership-tuples.d.ts +19 -0
- package/dist/lib/access/missing-ownership-tuples.d.ts.map +1 -0
- package/dist/lib/access/missing-ownership-tuples.js +12 -0
- package/dist/lib/access/missing-ownership-tuples.js.map +1 -0
- package/dist/lib/access/newest-written-token.d.ts +37 -0
- package/dist/lib/access/newest-written-token.d.ts.map +1 -0
- package/dist/lib/access/newest-written-token.js +56 -0
- package/dist/lib/access/newest-written-token.js.map +1 -0
- package/dist/lib/access/one-write-at-a-time.d.ts +14 -0
- package/dist/lib/access/one-write-at-a-time.d.ts.map +1 -0
- package/dist/lib/access/one-write-at-a-time.js +18 -0
- package/dist/lib/access/one-write-at-a-time.js.map +1 -0
- package/dist/lib/access/spice-db-authorization.d.ts +102 -0
- package/dist/lib/access/spice-db-authorization.d.ts.map +1 -0
- package/dist/lib/access/spice-db-authorization.js +275 -0
- package/dist/lib/access/spice-db-authorization.js.map +1 -0
- package/dist/lib/access/spice-db-clients.d.ts +19 -0
- package/dist/lib/access/spice-db-clients.d.ts.map +1 -0
- package/dist/lib/access/spice-db-clients.js +27 -0
- package/dist/lib/access/spice-db-clients.js.map +1 -0
- package/dist/lib/access/spice-db-consistency.d.ts +24 -0
- package/dist/lib/access/spice-db-consistency.d.ts.map +1 -0
- package/dist/lib/access/spice-db-consistency.js +44 -0
- package/dist/lib/access/spice-db-consistency.js.map +1 -0
- package/dist/lib/access/spice-db-permission-checks.d.ts +21 -0
- package/dist/lib/access/spice-db-permission-checks.d.ts.map +1 -0
- package/dist/lib/access/spice-db-permission-checks.js +102 -0
- package/dist/lib/access/spice-db-permission-checks.js.map +1 -0
- package/dist/lib/access/spice-db-relationship-read.d.ts +5 -0
- package/dist/lib/access/spice-db-relationship-read.d.ts.map +1 -0
- package/dist/lib/access/spice-db-relationship-read.js +21 -0
- package/dist/lib/access/spice-db-relationship-read.js.map +1 -0
- package/dist/lib/access/spice-db-write-deadline.d.ts +23 -0
- package/dist/lib/access/spice-db-write-deadline.d.ts.map +1 -0
- package/dist/lib/access/spice-db-write-deadline.js +41 -0
- package/dist/lib/access/spice-db-write-deadline.js.map +1 -0
- package/dist/lib/access/tallied-authorization.d.ts +31 -0
- package/dist/lib/access/tallied-authorization.d.ts.map +1 -0
- package/dist/lib/access/tallied-authorization.js +62 -0
- package/dist/lib/access/tallied-authorization.js.map +1 -0
- package/dist/lib/access/testing/acting-company-fixture.d.ts +46 -0
- package/dist/lib/access/testing/acting-company-fixture.d.ts.map +1 -0
- package/dist/lib/access/testing/acting-company-fixture.js +74 -0
- package/dist/lib/access/testing/acting-company-fixture.js.map +1 -0
- package/dist/lib/access-changes/access-change.ids.d.ts +5 -0
- package/dist/lib/access-changes/access-change.ids.d.ts.map +1 -0
- package/dist/lib/access-changes/access-change.ids.js +4 -0
- package/dist/lib/access-changes/access-change.ids.js.map +1 -0
- package/dist/lib/access-changes/apply-after-commit.d.ts +25 -0
- package/dist/lib/access-changes/apply-after-commit.d.ts.map +1 -0
- package/dist/lib/access-changes/apply-after-commit.js +91 -0
- package/dist/lib/access-changes/apply-after-commit.js.map +1 -0
- package/dist/lib/access-changes/apply.d.ts +60 -0
- package/dist/lib/access-changes/apply.d.ts.map +1 -0
- package/dist/lib/access-changes/apply.js +133 -0
- package/dist/lib/access-changes/apply.js.map +1 -0
- package/dist/lib/access-changes/claim.d.ts +79 -0
- package/dist/lib/access-changes/claim.d.ts.map +1 -0
- package/dist/lib/access-changes/claim.js +3 -0
- package/dist/lib/access-changes/claim.js.map +1 -0
- package/dist/lib/access-changes/complete.d.ts +38 -0
- package/dist/lib/access-changes/complete.d.ts.map +1 -0
- package/dist/lib/access-changes/complete.js +129 -0
- package/dist/lib/access-changes/complete.js.map +1 -0
- package/dist/lib/access-changes/completion-status.d.ts +21 -0
- package/dist/lib/access-changes/completion-status.d.ts.map +1 -0
- package/dist/lib/access-changes/completion-status.js +7 -0
- package/dist/lib/access-changes/completion-status.js.map +1 -0
- package/dist/lib/access-changes/enqueue.d.ts +14 -0
- package/dist/lib/access-changes/enqueue.d.ts.map +1 -0
- package/dist/lib/access-changes/enqueue.js +5 -0
- package/dist/lib/access-changes/enqueue.js.map +1 -0
- package/dist/lib/access-changes/logic/claim-rules.d.ts +49 -0
- package/dist/lib/access-changes/logic/claim-rules.d.ts.map +1 -0
- package/dist/lib/access-changes/logic/claim-rules.js +48 -0
- package/dist/lib/access-changes/logic/claim-rules.js.map +1 -0
- package/dist/lib/access-changes/postgres/access-changes.tables.d.ts +342 -0
- package/dist/lib/access-changes/postgres/access-changes.tables.d.ts.map +1 -0
- package/dist/lib/access-changes/postgres/access-changes.tables.js +36 -0
- package/dist/lib/access-changes/postgres/access-changes.tables.js.map +1 -0
- package/dist/lib/access-changes/postgres/claim.d.ts +43 -0
- package/dist/lib/access-changes/postgres/claim.d.ts.map +1 -0
- package/dist/lib/access-changes/postgres/claim.js +132 -0
- package/dist/lib/access-changes/postgres/claim.js.map +1 -0
- package/dist/lib/access-changes/postgres/completion-status.d.ts +27 -0
- package/dist/lib/access-changes/postgres/completion-status.d.ts.map +1 -0
- package/dist/lib/access-changes/postgres/completion-status.js +64 -0
- package/dist/lib/access-changes/postgres/completion-status.js.map +1 -0
- package/dist/lib/access-changes/postgres/enqueue.d.ts +30 -0
- package/dist/lib/access-changes/postgres/enqueue.d.ts.map +1 -0
- package/dist/lib/access-changes/postgres/enqueue.js +92 -0
- package/dist/lib/access-changes/postgres/enqueue.js.map +1 -0
- package/dist/lib/access-changes/postgres/migrations/20260828163001_authorization_outbox.migration.d.ts +4 -0
- package/dist/lib/access-changes/postgres/migrations/20260828163001_authorization_outbox.migration.d.ts.map +1 -0
- package/dist/lib/access-changes/postgres/migrations/20260828163001_authorization_outbox.migration.js +43 -0
- package/dist/lib/access-changes/postgres/migrations/20260828163001_authorization_outbox.migration.js.map +1 -0
- package/dist/lib/access-changes/postgres/owner-lock.d.ts +85 -0
- package/dist/lib/access-changes/postgres/owner-lock.d.ts.map +1 -0
- package/dist/lib/access-changes/postgres/owner-lock.js +219 -0
- package/dist/lib/access-changes/postgres/owner-lock.js.map +1 -0
- package/dist/lib/access-changes/postgres/requeue-failed.d.ts +17 -0
- package/dist/lib/access-changes/postgres/requeue-failed.d.ts.map +1 -0
- package/dist/lib/access-changes/postgres/requeue-failed.js +25 -0
- package/dist/lib/access-changes/postgres/requeue-failed.js.map +1 -0
- package/dist/lib/access-changes/revoke.d.ts +104 -0
- package/dist/lib/access-changes/revoke.d.ts.map +1 -0
- package/dist/lib/access-changes/revoke.js +48 -0
- package/dist/lib/access-changes/revoke.js.map +1 -0
- package/dist/lib/access-changes/synced-row-relationships.d.ts +56 -0
- package/dist/lib/access-changes/synced-row-relationships.d.ts.map +1 -0
- package/dist/lib/access-changes/synced-row-relationships.js +111 -0
- package/dist/lib/access-changes/synced-row-relationships.js.map +1 -0
- package/dist/lib/catalog-sizes/audit-catalog-sizes.job.d.ts +41 -0
- package/dist/lib/catalog-sizes/audit-catalog-sizes.job.d.ts.map +1 -0
- package/dist/lib/catalog-sizes/audit-catalog-sizes.job.js +77 -0
- package/dist/lib/catalog-sizes/audit-catalog-sizes.job.js.map +1 -0
- package/dist/lib/catalog-sizes/catalog-size-reader.d.ts +15 -0
- package/dist/lib/catalog-sizes/catalog-size-reader.d.ts.map +1 -0
- package/dist/lib/catalog-sizes/catalog-size-reader.js +41 -0
- package/dist/lib/catalog-sizes/catalog-size-reader.js.map +1 -0
- package/dist/lib/catalog-sizes/catalog-tables.d.ts +38 -0
- package/dist/lib/catalog-sizes/catalog-tables.d.ts.map +1 -0
- package/dist/lib/catalog-sizes/catalog-tables.js +52 -0
- package/dist/lib/catalog-sizes/catalog-tables.js.map +1 -0
- package/dist/lib/schema-migrate/clone-spice-db-datastore.d.ts +9 -0
- package/dist/lib/schema-migrate/clone-spice-db-datastore.d.ts.map +1 -0
- package/dist/lib/schema-migrate/clone-spice-db-datastore.js +47 -0
- package/dist/lib/schema-migrate/clone-spice-db-datastore.js.map +1 -0
- package/dist/lib/schema-migrate/parse-authorization-schema-migration-environment.d.ts +31 -0
- package/dist/lib/schema-migrate/parse-authorization-schema-migration-environment.d.ts.map +1 -0
- package/dist/lib/schema-migrate/parse-authorization-schema-migration-environment.js +26 -0
- package/dist/lib/schema-migrate/parse-authorization-schema-migration-environment.js.map +1 -0
- package/dist/lib/scoped-lists/keep-permitted.d.ts +24 -0
- package/dist/lib/scoped-lists/keep-permitted.d.ts.map +1 -0
- package/dist/lib/scoped-lists/keep-permitted.js +29 -0
- package/dist/lib/scoped-lists/keep-permitted.js.map +1 -0
- package/dist/lib/scoped-lists/scope-predicate.d.ts +18 -0
- package/dist/lib/scoped-lists/scope-predicate.d.ts.map +1 -0
- package/dist/lib/scoped-lists/scope-predicate.js +96 -0
- package/dist/lib/scoped-lists/scope-predicate.js.map +1 -0
- package/dist/lib/scoped-lists/scope-sql-bindings.d.ts +64 -0
- package/dist/lib/scoped-lists/scope-sql-bindings.d.ts.map +1 -0
- package/dist/lib/scoped-lists/scope-sql-bindings.js +45 -0
- package/dist/lib/scoped-lists/scope-sql-bindings.js.map +1 -0
- package/dist/lib/scoped-lists/testing/scoped-list-fixture.d.ts +369 -0
- package/dist/lib/scoped-lists/testing/scoped-list-fixture.d.ts.map +1 -0
- package/dist/lib/scoped-lists/testing/scoped-list-fixture.js +145 -0
- package/dist/lib/scoped-lists/testing/scoped-list-fixture.js.map +1 -0
- package/dist/migration/definition-changes.d.mts +28 -0
- package/dist/migration/definition-changes.d.mts.map +1 -0
- package/dist/migration/definition-changes.mjs +282 -0
- package/dist/migration/definition-changes.mjs.map +1 -0
- package/dist/migration/index.d.ts +15 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +14 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/migration/lib/access-migrations/assert-access-migrations-up-to-date.d.ts +26 -0
- package/dist/migration/lib/access-migrations/assert-access-migrations-up-to-date.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/assert-access-migrations-up-to-date.js +57 -0
- package/dist/migration/lib/access-migrations/assert-access-migrations-up-to-date.js.map +1 -0
- package/dist/migration/lib/access-migrations/define-access-migration.d.ts +51 -0
- package/dist/migration/lib/access-migrations/define-access-migration.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/define-access-migration.js +63 -0
- package/dist/migration/lib/access-migrations/define-access-migration.js.map +1 -0
- package/dist/migration/lib/access-migrations/diff-access-models-format.d.ts +12 -0
- package/dist/migration/lib/access-migrations/diff-access-models-format.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/diff-access-models-format.js +81 -0
- package/dist/migration/lib/access-migrations/diff-access-models-format.js.map +1 -0
- package/dist/migration/lib/access-migrations/diff-access-models.d.ts +79 -0
- package/dist/migration/lib/access-migrations/diff-access-models.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/diff-access-models.js +197 -0
- package/dist/migration/lib/access-migrations/diff-access-models.js.map +1 -0
- package/dist/migration/lib/access-migrations/index.d.ts +8 -0
- package/dist/migration/lib/access-migrations/index.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/index.js +8 -0
- package/dist/migration/lib/access-migrations/index.js.map +1 -0
- package/dist/migration/lib/access-migrations/run-postgres-access-migrations.d.ts +17 -0
- package/dist/migration/lib/access-migrations/run-postgres-access-migrations.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/run-postgres-access-migrations.js +105 -0
- package/dist/migration/lib/access-migrations/run-postgres-access-migrations.js.map +1 -0
- package/dist/migration/lib/access-migrations/run-spicedb-access-migrations.d.ts +21 -0
- package/dist/migration/lib/access-migrations/run-spicedb-access-migrations.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/run-spicedb-access-migrations.js +64 -0
- package/dist/migration/lib/access-migrations/run-spicedb-access-migrations.js.map +1 -0
- package/dist/migration/lib/access-migrations/run-sqlite-access-migrations.d.ts +18 -0
- package/dist/migration/lib/access-migrations/run-sqlite-access-migrations.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/run-sqlite-access-migrations.js +102 -0
- package/dist/migration/lib/access-migrations/run-sqlite-access-migrations.js.map +1 -0
- package/dist/migration/lib/access-migrations/sql-migration-types.d.ts +52 -0
- package/dist/migration/lib/access-migrations/sql-migration-types.d.ts.map +1 -0
- package/dist/migration/lib/access-migrations/sql-migration-types.js +57 -0
- package/dist/migration/lib/access-migrations/sql-migration-types.js.map +1 -0
- package/dist/migration/lib/journal/authorization-change-files.d.ts +7 -0
- package/dist/migration/lib/journal/authorization-change-files.d.ts.map +1 -0
- package/dist/migration/lib/journal/authorization-change-files.js +94 -0
- package/dist/migration/lib/journal/authorization-change-files.js.map +1 -0
- package/dist/migration/lib/journal/journal-entry.d.ts +47 -0
- package/dist/migration/lib/journal/journal-entry.d.ts.map +1 -0
- package/dist/migration/lib/journal/journal-entry.js +2 -0
- package/dist/migration/lib/journal/journal-entry.js.map +1 -0
- package/dist/migration/lib/journal/load-authorization-changes.d.ts +9 -0
- package/dist/migration/lib/journal/load-authorization-changes.d.ts.map +1 -0
- package/dist/migration/lib/journal/load-authorization-changes.js +32 -0
- package/dist/migration/lib/journal/load-authorization-changes.js.map +1 -0
- package/dist/migration/lib/journal/load-journal.d.ts +21 -0
- package/dist/migration/lib/journal/load-journal.d.ts.map +1 -0
- package/dist/migration/lib/journal/load-journal.js +73 -0
- package/dist/migration/lib/journal/load-journal.js.map +1 -0
- package/dist/migration/lib/journal/read-authorization-migration-status.d.ts +10 -0
- package/dist/migration/lib/journal/read-authorization-migration-status.d.ts.map +1 -0
- package/dist/migration/lib/journal/read-authorization-migration-status.js +64 -0
- package/dist/migration/lib/journal/read-authorization-migration-status.js.map +1 -0
- package/dist/migration/lib/logic/authorization-change-history.d.ts +22 -0
- package/dist/migration/lib/logic/authorization-change-history.d.ts.map +1 -0
- package/dist/migration/lib/logic/authorization-change-history.js +103 -0
- package/dist/migration/lib/logic/authorization-change-history.js.map +1 -0
- package/dist/migration/lib/logic/classify-schema-diff.d.ts +26 -0
- package/dist/migration/lib/logic/classify-schema-diff.d.ts.map +1 -0
- package/dist/migration/lib/logic/classify-schema-diff.js +104 -0
- package/dist/migration/lib/logic/classify-schema-diff.js.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/authzed-target-adapter.d.ts +62 -0
- package/dist/migration/lib/postgres-to-spicedb/authzed-target-adapter.d.ts.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/authzed-target-adapter.js +63 -0
- package/dist/migration/lib/postgres-to-spicedb/authzed-target-adapter.js.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/column-relation-outbox-triggers.d.ts +45 -0
- package/dist/migration/lib/postgres-to-spicedb/column-relation-outbox-triggers.d.ts.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/column-relation-outbox-triggers.js +140 -0
- package/dist/migration/lib/postgres-to-spicedb/column-relation-outbox-triggers.js.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/index.d.ts +4 -0
- package/dist/migration/lib/postgres-to-spicedb/index.d.ts.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/index.js +4 -0
- package/dist/migration/lib/postgres-to-spicedb/index.js.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/migrate-postgres-to-spicedb.d.ts +47 -0
- package/dist/migration/lib/postgres-to-spicedb/migrate-postgres-to-spicedb.d.ts.map +1 -0
- package/dist/migration/lib/postgres-to-spicedb/migrate-postgres-to-spicedb.js +199 -0
- package/dist/migration/lib/postgres-to-spicedb/migrate-postgres-to-spicedb.js.map +1 -0
- package/dist/migration/lib/run-authorization-changes.d.ts +5 -0
- package/dist/migration/lib/run-authorization-changes.d.ts.map +1 -0
- package/dist/migration/lib/run-authorization-changes.js +159 -0
- package/dist/migration/lib/run-authorization-changes.js.map +1 -0
- package/dist/migration/lib/run-authorization-migrations.d.ts +47 -0
- package/dist/migration/lib/run-authorization-migrations.d.ts.map +1 -0
- package/dist/migration/lib/run-authorization-migrations.js +202 -0
- package/dist/migration/lib/run-authorization-migrations.js.map +1 -0
- package/dist/migration/lib/scaffold/build-migration-bridge-schema.d.ts +7 -0
- package/dist/migration/lib/scaffold/build-migration-bridge-schema.d.ts.map +1 -0
- package/dist/migration/lib/scaffold/build-migration-bridge-schema.js +83 -0
- package/dist/migration/lib/scaffold/build-migration-bridge-schema.js.map +1 -0
- package/dist/migration/lib/scaffold/renumber-migration.d.ts +69 -0
- package/dist/migration/lib/scaffold/renumber-migration.d.ts.map +1 -0
- package/dist/migration/lib/scaffold/renumber-migration.js +170 -0
- package/dist/migration/lib/scaffold/renumber-migration.js.map +1 -0
- package/dist/migration/lib/scaffold/scaffold-authorization-change.d.ts +19 -0
- package/dist/migration/lib/scaffold/scaffold-authorization-change.d.ts.map +1 -0
- package/dist/migration/lib/scaffold/scaffold-authorization-change.js +47 -0
- package/dist/migration/lib/scaffold/scaffold-authorization-change.js.map +1 -0
- package/dist/migration/lib/scaffold/scaffold-migration.d.ts +32 -0
- package/dist/migration/lib/scaffold/scaffold-migration.d.ts.map +1 -0
- package/dist/migration/lib/scaffold/scaffold-migration.js +89 -0
- package/dist/migration/lib/scaffold/scaffold-migration.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/access-model-from-ir.d.ts +8 -0
- package/dist/migration/lib/spicedb-to-postgres/access-model-from-ir.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/access-model-from-ir.js +10 -0
- package/dist/migration/lib/spicedb-to-postgres/access-model-from-ir.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/authzed-client-adapter.d.ts +94 -0
- package/dist/migration/lib/spicedb-to-postgres/authzed-client-adapter.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/authzed-client-adapter.js +100 -0
- package/dist/migration/lib/spicedb-to-postgres/authzed-client-adapter.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-args.d.ts +30 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-args.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-args.js +208 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-args.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-format.d.ts +16 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-format.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-format.js +77 -0
- package/dist/migration/lib/spicedb-to-postgres/cli-format.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/cli.d.ts +47 -0
- package/dist/migration/lib/spicedb-to-postgres/cli.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/cli.js +165 -0
- package/dist/migration/lib/spicedb-to-postgres/cli.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/index.d.ts +8 -0
- package/dist/migration/lib/spicedb-to-postgres/index.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/index.js +8 -0
- package/dist/migration/lib/spicedb-to-postgres/index.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/migrate-spicedb-to-postgres.d.ts +36 -0
- package/dist/migration/lib/spicedb-to-postgres/migrate-spicedb-to-postgres.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/migrate-spicedb-to-postgres.js +129 -0
- package/dist/migration/lib/spicedb-to-postgres/migrate-spicedb-to-postgres.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/postgres-relationship-ddl.d.ts +13 -0
- package/dist/migration/lib/spicedb-to-postgres/postgres-relationship-ddl.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/postgres-relationship-ddl.js +60 -0
- package/dist/migration/lib/spicedb-to-postgres/postgres-relationship-ddl.js.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/verify-parity.d.ts +51 -0
- package/dist/migration/lib/spicedb-to-postgres/verify-parity.d.ts.map +1 -0
- package/dist/migration/lib/spicedb-to-postgres/verify-parity.js +174 -0
- package/dist/migration/lib/spicedb-to-postgres/verify-parity.js.map +1 -0
- package/dist/migration/testing/fake-schema-store.d.ts +31 -0
- package/dist/migration/testing/fake-schema-store.d.ts.map +1 -0
- package/dist/migration/testing/fake-schema-store.js +79 -0
- package/dist/migration/testing/fake-schema-store.js.map +1 -0
- package/dist/spicedb-access.tsbuildinfo +1 -0
- package/dist/testing/create-shared-test-spice-db.d.ts +4 -0
- package/dist/testing/create-shared-test-spice-db.d.ts.map +1 -0
- package/dist/testing/create-shared-test-spice-db.js +9 -0
- package/dist/testing/create-shared-test-spice-db.js.map +1 -0
- package/dist/testing/fake-apply-after-commit.d.ts +29 -0
- package/dist/testing/fake-apply-after-commit.d.ts.map +1 -0
- package/dist/testing/fake-apply-after-commit.js +50 -0
- package/dist/testing/fake-apply-after-commit.js.map +1 -0
- package/dist/testing/fake-claim.d.ts +50 -0
- package/dist/testing/fake-claim.d.ts.map +1 -0
- package/dist/testing/fake-claim.js +187 -0
- package/dist/testing/fake-claim.js.map +1 -0
- package/dist/testing/fake-enqueue.d.ts +37 -0
- package/dist/testing/fake-enqueue.d.ts.map +1 -0
- package/dist/testing/fake-enqueue.js +84 -0
- package/dist/testing/fake-enqueue.js.map +1 -0
- package/dist/testing/in-memory-owner-lock.d.ts +7 -0
- package/dist/testing/in-memory-owner-lock.d.ts.map +1 -0
- package/dist/testing/in-memory-owner-lock.js +25 -0
- package/dist/testing/in-memory-owner-lock.js.map +1 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +11 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/prove-scope-matches-lookup.d.ts +22 -0
- package/dist/testing/prove-scope-matches-lookup.d.ts.map +1 -0
- package/dist/testing/prove-scope-matches-lookup.js +67 -0
- package/dist/testing/prove-scope-matches-lookup.js.map +1 -0
- package/dist/testing/start-test-spice-db.d.ts +31 -0
- package/dist/testing/start-test-spice-db.d.ts.map +1 -0
- package/dist/testing/start-test-spice-db.js +73 -0
- package/dist/testing/start-test-spice-db.js.map +1 -0
- package/dist/testing/tuned-spice-db-benchmark.d.ts +22 -0
- package/dist/testing/tuned-spice-db-benchmark.d.ts.map +1 -0
- package/dist/testing/tuned-spice-db-benchmark.js +148 -0
- package/dist/testing/tuned-spice-db-benchmark.js.map +1 -0
- package/package.json +73 -4
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tiny world for proving the scoped-list seam: one scope (`site`), two
|
|
3
|
+
* records (`folder`, and `sheet`, which walks into its folder). Between them
|
|
4
|
+
* the `view` rules reach every plan operator — a scope column, a child-table
|
|
5
|
+
* join, a derived role, a tag, a sparse direct grant, any, all, not, and via.
|
|
6
|
+
*
|
|
7
|
+
* The tables are throwaway: `createFixtureTables` makes them in a private test
|
|
8
|
+
* database; they are not part of any migration.
|
|
9
|
+
*/
|
|
10
|
+
import { type SQL } from "drizzle-orm";
|
|
11
|
+
import type { DrizzleHandle } from "@dads-framework/postgres";
|
|
12
|
+
export declare const Member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
13
|
+
export declare const site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
14
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
15
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
16
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
17
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
18
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
19
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
20
|
+
export declare const Site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
21
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
22
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
23
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
24
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
25
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
26
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
27
|
+
export declare const folder: import("@dads-framework/access").DslResource<"listfixture/folder", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
28
|
+
readonly home_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
29
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
30
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
31
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
32
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
33
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
34
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
35
|
+
readonly shared_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
36
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
37
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
38
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
39
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
40
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
41
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
42
|
+
readonly fallback_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
43
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
44
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
45
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
46
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
47
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
48
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
49
|
+
readonly archived: import("@dads-framework/access").DslWildcardActorHolder<"listfixture/member">;
|
|
50
|
+
readonly assignee: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
51
|
+
}>, "view", Record<never, never>>;
|
|
52
|
+
export declare const Folder: import("@dads-framework/access").DslResource<"listfixture/folder", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
53
|
+
readonly home_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
54
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
55
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
56
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
57
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
58
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
59
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
60
|
+
readonly shared_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
61
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
62
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
63
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
64
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
65
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
66
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
67
|
+
readonly fallback_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
68
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
69
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
70
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
71
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
72
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
73
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
74
|
+
readonly archived: import("@dads-framework/access").DslWildcardActorHolder<"listfixture/member">;
|
|
75
|
+
readonly assignee: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
76
|
+
}>, "view", Record<never, never>>;
|
|
77
|
+
export declare const sheet: import("@dads-framework/access").DslResource<"listfixture/sheet", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
78
|
+
readonly folder: import("@dads-framework/access").DslResource<"listfixture/folder", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
79
|
+
readonly home_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
80
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
81
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
82
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
83
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
84
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
85
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
86
|
+
readonly shared_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
87
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
88
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
89
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
90
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
91
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
92
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
93
|
+
readonly fallback_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
94
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
95
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
96
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
97
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
98
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
99
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
100
|
+
readonly archived: import("@dads-framework/access").DslWildcardActorHolder<"listfixture/member">;
|
|
101
|
+
readonly assignee: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
102
|
+
}>, "view", Record<never, never>>;
|
|
103
|
+
readonly site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
104
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
105
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
106
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
107
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
108
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
109
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
110
|
+
}>, "view", Record<never, never>>;
|
|
111
|
+
export declare const Sheet: import("@dads-framework/access").DslResource<"listfixture/sheet", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
112
|
+
readonly folder: import("@dads-framework/access").DslResource<"listfixture/folder", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
113
|
+
readonly home_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
114
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
115
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
116
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
117
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
118
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
119
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
120
|
+
readonly shared_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
121
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
122
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
123
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
124
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
125
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
126
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
127
|
+
readonly fallback_site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
128
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
129
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
130
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
131
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
132
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
133
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
134
|
+
readonly archived: import("@dads-framework/access").DslWildcardActorHolder<"listfixture/member">;
|
|
135
|
+
readonly assignee: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
136
|
+
}>, "view", Record<never, never>>;
|
|
137
|
+
readonly site: import("@dads-framework/access").DslResource<"listfixture/site", import("@dads-framework/access").SubjectMapFromRoles<{
|
|
138
|
+
readonly member: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
139
|
+
readonly manager: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
140
|
+
readonly auditor: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
141
|
+
readonly archivist: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
142
|
+
readonly blocked: import("@dads-framework/access").DslActor<"listfixture/member">;
|
|
143
|
+
}>, "archive_records" | "audit_records" | "blocked_here" | "manage_records" | "view_records", Record<never, never>>;
|
|
144
|
+
}>, "view", Record<never, never>>;
|
|
145
|
+
export declare const folderScope: import("@dads-framework/access/scopes").ScopeBindings<{
|
|
146
|
+
readonly home_site: {
|
|
147
|
+
readonly kind: "scope-column";
|
|
148
|
+
};
|
|
149
|
+
readonly shared_site: {
|
|
150
|
+
readonly kind: "scope-join";
|
|
151
|
+
};
|
|
152
|
+
readonly fallback_site: {
|
|
153
|
+
readonly kind: "derived";
|
|
154
|
+
};
|
|
155
|
+
readonly archived: {
|
|
156
|
+
readonly kind: "tag";
|
|
157
|
+
};
|
|
158
|
+
readonly assignee: {
|
|
159
|
+
readonly kind: "sparse-direct";
|
|
160
|
+
};
|
|
161
|
+
}>;
|
|
162
|
+
export declare const sheetScope: import("@dads-framework/access/scopes").ScopeBindings<{
|
|
163
|
+
readonly folder: {
|
|
164
|
+
readonly kind: "scope-column";
|
|
165
|
+
};
|
|
166
|
+
readonly site: {
|
|
167
|
+
readonly kind: "scope-column";
|
|
168
|
+
};
|
|
169
|
+
}>;
|
|
170
|
+
export declare const fixtureAccess: import("@dads-framework/access").AccessModel;
|
|
171
|
+
/** The SpiceDB schema for the fixture's definitions alone. */
|
|
172
|
+
export declare function fixtureZed(): string;
|
|
173
|
+
export declare const folders: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
174
|
+
name: "scoped_list_folders";
|
|
175
|
+
schema: undefined;
|
|
176
|
+
columns: {
|
|
177
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
178
|
+
name: "id";
|
|
179
|
+
tableName: "scoped_list_folders";
|
|
180
|
+
dataType: "string";
|
|
181
|
+
columnType: "PgUUID";
|
|
182
|
+
data: string;
|
|
183
|
+
driverParam: string;
|
|
184
|
+
notNull: true;
|
|
185
|
+
hasDefault: false;
|
|
186
|
+
isPrimaryKey: true;
|
|
187
|
+
isAutoincrement: false;
|
|
188
|
+
hasRuntimeDefault: false;
|
|
189
|
+
enumValues: undefined;
|
|
190
|
+
baseColumn: never;
|
|
191
|
+
identity: undefined;
|
|
192
|
+
generated: undefined;
|
|
193
|
+
}, {}, {}>;
|
|
194
|
+
homeSiteId: import("drizzle-orm/pg-core").PgColumn<{
|
|
195
|
+
name: "home_site_id";
|
|
196
|
+
tableName: "scoped_list_folders";
|
|
197
|
+
dataType: "string";
|
|
198
|
+
columnType: "PgUUID";
|
|
199
|
+
data: string;
|
|
200
|
+
driverParam: string;
|
|
201
|
+
notNull: false;
|
|
202
|
+
hasDefault: false;
|
|
203
|
+
isPrimaryKey: false;
|
|
204
|
+
isAutoincrement: false;
|
|
205
|
+
hasRuntimeDefault: false;
|
|
206
|
+
enumValues: undefined;
|
|
207
|
+
baseColumn: never;
|
|
208
|
+
identity: undefined;
|
|
209
|
+
generated: undefined;
|
|
210
|
+
}, {}, {}>;
|
|
211
|
+
archived: import("drizzle-orm/pg-core").PgColumn<{
|
|
212
|
+
name: "archived";
|
|
213
|
+
tableName: "scoped_list_folders";
|
|
214
|
+
dataType: "boolean";
|
|
215
|
+
columnType: "PgBoolean";
|
|
216
|
+
data: boolean;
|
|
217
|
+
driverParam: boolean;
|
|
218
|
+
notNull: true;
|
|
219
|
+
hasDefault: false;
|
|
220
|
+
isPrimaryKey: false;
|
|
221
|
+
isAutoincrement: false;
|
|
222
|
+
hasRuntimeDefault: false;
|
|
223
|
+
enumValues: undefined;
|
|
224
|
+
baseColumn: never;
|
|
225
|
+
identity: undefined;
|
|
226
|
+
generated: undefined;
|
|
227
|
+
}, {}, {}>;
|
|
228
|
+
};
|
|
229
|
+
dialect: 'pg';
|
|
230
|
+
}>;
|
|
231
|
+
export declare const folderShares: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
232
|
+
name: "scoped_list_folder_shares";
|
|
233
|
+
schema: undefined;
|
|
234
|
+
columns: {
|
|
235
|
+
folderId: import("drizzle-orm/pg-core").PgColumn<{
|
|
236
|
+
name: "folder_id";
|
|
237
|
+
tableName: "scoped_list_folder_shares";
|
|
238
|
+
dataType: "string";
|
|
239
|
+
columnType: "PgUUID";
|
|
240
|
+
data: string;
|
|
241
|
+
driverParam: string;
|
|
242
|
+
notNull: true;
|
|
243
|
+
hasDefault: false;
|
|
244
|
+
isPrimaryKey: false;
|
|
245
|
+
isAutoincrement: false;
|
|
246
|
+
hasRuntimeDefault: false;
|
|
247
|
+
enumValues: undefined;
|
|
248
|
+
baseColumn: never;
|
|
249
|
+
identity: undefined;
|
|
250
|
+
generated: undefined;
|
|
251
|
+
}, {}, {}>;
|
|
252
|
+
siteId: import("drizzle-orm/pg-core").PgColumn<{
|
|
253
|
+
name: "site_id";
|
|
254
|
+
tableName: "scoped_list_folder_shares";
|
|
255
|
+
dataType: "string";
|
|
256
|
+
columnType: "PgUUID";
|
|
257
|
+
data: string;
|
|
258
|
+
driverParam: string;
|
|
259
|
+
notNull: true;
|
|
260
|
+
hasDefault: false;
|
|
261
|
+
isPrimaryKey: false;
|
|
262
|
+
isAutoincrement: false;
|
|
263
|
+
hasRuntimeDefault: false;
|
|
264
|
+
enumValues: undefined;
|
|
265
|
+
baseColumn: never;
|
|
266
|
+
identity: undefined;
|
|
267
|
+
generated: undefined;
|
|
268
|
+
}, {}, {}>;
|
|
269
|
+
};
|
|
270
|
+
dialect: 'pg';
|
|
271
|
+
}>;
|
|
272
|
+
export declare const sheets: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
273
|
+
name: "scoped_list_sheets";
|
|
274
|
+
schema: undefined;
|
|
275
|
+
columns: {
|
|
276
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
277
|
+
name: "id";
|
|
278
|
+
tableName: "scoped_list_sheets";
|
|
279
|
+
dataType: "string";
|
|
280
|
+
columnType: "PgUUID";
|
|
281
|
+
data: string;
|
|
282
|
+
driverParam: string;
|
|
283
|
+
notNull: true;
|
|
284
|
+
hasDefault: false;
|
|
285
|
+
isPrimaryKey: true;
|
|
286
|
+
isAutoincrement: false;
|
|
287
|
+
hasRuntimeDefault: false;
|
|
288
|
+
enumValues: undefined;
|
|
289
|
+
baseColumn: never;
|
|
290
|
+
identity: undefined;
|
|
291
|
+
generated: undefined;
|
|
292
|
+
}, {}, {}>;
|
|
293
|
+
folderId: import("drizzle-orm/pg-core").PgColumn<{
|
|
294
|
+
name: "folder_id";
|
|
295
|
+
tableName: "scoped_list_sheets";
|
|
296
|
+
dataType: "string";
|
|
297
|
+
columnType: "PgUUID";
|
|
298
|
+
data: string;
|
|
299
|
+
driverParam: string;
|
|
300
|
+
notNull: true;
|
|
301
|
+
hasDefault: false;
|
|
302
|
+
isPrimaryKey: false;
|
|
303
|
+
isAutoincrement: false;
|
|
304
|
+
hasRuntimeDefault: false;
|
|
305
|
+
enumValues: undefined;
|
|
306
|
+
baseColumn: never;
|
|
307
|
+
identity: undefined;
|
|
308
|
+
generated: undefined;
|
|
309
|
+
}, {}, {}>;
|
|
310
|
+
siteId: import("drizzle-orm/pg-core").PgColumn<{
|
|
311
|
+
name: "site_id";
|
|
312
|
+
tableName: "scoped_list_sheets";
|
|
313
|
+
dataType: "string";
|
|
314
|
+
columnType: "PgUUID";
|
|
315
|
+
data: string;
|
|
316
|
+
driverParam: string;
|
|
317
|
+
notNull: false;
|
|
318
|
+
hasDefault: false;
|
|
319
|
+
isPrimaryKey: false;
|
|
320
|
+
isAutoincrement: false;
|
|
321
|
+
hasRuntimeDefault: false;
|
|
322
|
+
enumValues: undefined;
|
|
323
|
+
baseColumn: never;
|
|
324
|
+
identity: undefined;
|
|
325
|
+
generated: undefined;
|
|
326
|
+
}, {}, {}>;
|
|
327
|
+
};
|
|
328
|
+
dialect: 'pg';
|
|
329
|
+
}>;
|
|
330
|
+
export declare function createFixtureTables(db: DrizzleHandle): Promise<void>;
|
|
331
|
+
declare function sharedWithAny(ids: SQL): SQL;
|
|
332
|
+
export declare const folderSqlRoles: {
|
|
333
|
+
home_site: {
|
|
334
|
+
kind: "scope-column";
|
|
335
|
+
column: import("drizzle-orm/pg-core").PgColumn<{
|
|
336
|
+
name: "home_site_id";
|
|
337
|
+
tableName: "scoped_list_folders";
|
|
338
|
+
dataType: "string";
|
|
339
|
+
columnType: "PgUUID";
|
|
340
|
+
data: string;
|
|
341
|
+
driverParam: string;
|
|
342
|
+
notNull: false;
|
|
343
|
+
hasDefault: false;
|
|
344
|
+
isPrimaryKey: false;
|
|
345
|
+
isAutoincrement: false;
|
|
346
|
+
hasRuntimeDefault: false;
|
|
347
|
+
enumValues: undefined;
|
|
348
|
+
baseColumn: never;
|
|
349
|
+
identity: undefined;
|
|
350
|
+
generated: undefined;
|
|
351
|
+
}, {}, {}>;
|
|
352
|
+
};
|
|
353
|
+
shared_site: {
|
|
354
|
+
kind: "scope-join";
|
|
355
|
+
matches: typeof sharedWithAny;
|
|
356
|
+
};
|
|
357
|
+
fallback_site: {
|
|
358
|
+
kind: "derived";
|
|
359
|
+
matches: (ids: SQL) => SQL<unknown>;
|
|
360
|
+
};
|
|
361
|
+
archived: {
|
|
362
|
+
kind: "tag";
|
|
363
|
+
condition: SQL<unknown>;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
export declare const folderSql: import("../scope-sql-bindings.js").ScopeSqlBindings;
|
|
367
|
+
export declare const sheetSql: import("../scope-sql-bindings.js").ScopeSqlBindings;
|
|
368
|
+
export {};
|
|
369
|
+
//# sourceMappingURL=scoped-list-fixture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-list-fixture.d.ts","sourceRoot":"","sources":["../../../../src/lib/scoped-lists/testing/scoped-list-fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAO,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,eAAO,MAAM,MAAM,iEAAgD,CAAC;AAEpE,eAAO,MAAM,IAAI;;;;;;mHAgBf,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;mHAAO,CAAC;AAEzB,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;iCAmBjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;iCAAS,CAAC;AAE7B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAMhB,CAAC;AAEH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAQ,CAAC;AAE3B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;EAMtB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;EAGrB,CAAC;AAEH,eAAO,MAAM,aAAa,8CAGxB,CAAC;AAEH,8DAA8D;AAC9D,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAID,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIjB,CAAC;AAEH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB1E;AAID,iBAAS,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAEpC;AAID,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAKR,GAAG;;;;;;CAG6B,CAAC;AAEpD,eAAO,MAAM,SAAS,qDAIpB,CAAC;AAEH,eAAO,MAAM,QAAQ,qDAOnB,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tiny world for proving the scoped-list seam: one scope (`site`), two
|
|
3
|
+
* records (`folder`, and `sheet`, which walks into its folder). Between them
|
|
4
|
+
* the `view` rules reach every plan operator — a scope column, a child-table
|
|
5
|
+
* join, a derived role, a tag, a sparse direct grant, any, all, not, and via.
|
|
6
|
+
*
|
|
7
|
+
* The tables are throwaway: `createFixtureTables` makes them in a private test
|
|
8
|
+
* database; they are not part of any migration.
|
|
9
|
+
*/
|
|
10
|
+
import { sql } from "drizzle-orm";
|
|
11
|
+
import { boolean, pgTable, uuid } from "drizzle-orm/pg-core";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { actor, allOf, compileAccess, emitAccessIr, emitZedForDefinitions, resource } from "@dads-framework/access";
|
|
14
|
+
import { scopeBindings } from "@dads-framework/access/scopes";
|
|
15
|
+
import { scopeSqlBindings } from "../scope-sql-bindings.js";
|
|
16
|
+
const idSchema = z.string();
|
|
17
|
+
// ─── Access rules ────────────────────────────────────────────────────────────
|
|
18
|
+
export const Member = actor("listfixture/member", { id: idSchema });
|
|
19
|
+
export const site = resource("listfixture/site", {
|
|
20
|
+
id: idSchema,
|
|
21
|
+
roles: {
|
|
22
|
+
member: Member,
|
|
23
|
+
manager: Member,
|
|
24
|
+
auditor: Member,
|
|
25
|
+
archivist: Member,
|
|
26
|
+
blocked: Member,
|
|
27
|
+
},
|
|
28
|
+
can: ({ member, manager, auditor, archivist, blocked }) => ({
|
|
29
|
+
view_records: [member, manager],
|
|
30
|
+
manage_records: manager,
|
|
31
|
+
audit_records: auditor,
|
|
32
|
+
archive_records: archivist,
|
|
33
|
+
blocked_here: blocked,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
export const Site = site;
|
|
37
|
+
export const folder = resource("listfixture/folder", {
|
|
38
|
+
id: idSchema,
|
|
39
|
+
roles: {
|
|
40
|
+
home_site: site,
|
|
41
|
+
shared_site: site,
|
|
42
|
+
// The home site while the folder is shared nowhere.
|
|
43
|
+
fallback_site: site,
|
|
44
|
+
archived: Member.anyone,
|
|
45
|
+
assignee: Member,
|
|
46
|
+
},
|
|
47
|
+
can: ({ home_site, shared_site, fallback_site, archived, assignee }) => ({
|
|
48
|
+
view: [
|
|
49
|
+
home_site.view_records,
|
|
50
|
+
shared_site.view_records,
|
|
51
|
+
allOf(fallback_site.archive_records, archived),
|
|
52
|
+
shared_site.audit_records.unless(shared_site.blocked_here),
|
|
53
|
+
assignee,
|
|
54
|
+
],
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
export const Folder = folder;
|
|
58
|
+
export const sheet = resource("listfixture/sheet", {
|
|
59
|
+
id: idSchema,
|
|
60
|
+
roles: { folder, site },
|
|
61
|
+
can: ({ folder: parentFolder, site: parentSite }) => ({
|
|
62
|
+
view: [parentFolder.view.unless(parentSite.blocked_here), parentSite.manage_records],
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
export const Sheet = sheet;
|
|
66
|
+
export const folderScope = scopeBindings(folder, {
|
|
67
|
+
home_site: { kind: "scope-column" },
|
|
68
|
+
shared_site: { kind: "scope-join" },
|
|
69
|
+
fallback_site: { kind: "derived" },
|
|
70
|
+
archived: { kind: "tag" },
|
|
71
|
+
assignee: { kind: "sparse-direct" },
|
|
72
|
+
});
|
|
73
|
+
export const sheetScope = scopeBindings(sheet, {
|
|
74
|
+
folder: { kind: "scope-column" },
|
|
75
|
+
site: { kind: "scope-column" },
|
|
76
|
+
});
|
|
77
|
+
export const fixtureAccess = compileAccess([Member, site, folder, sheet], {
|
|
78
|
+
bindings: [folderScope, sheetScope],
|
|
79
|
+
allowLookupResourcesOn: [site],
|
|
80
|
+
});
|
|
81
|
+
/** The SpiceDB schema for the fixture's definitions alone. */
|
|
82
|
+
export function fixtureZed() {
|
|
83
|
+
return emitZedForDefinitions(emitAccessIr(fixtureAccess));
|
|
84
|
+
}
|
|
85
|
+
// ─── Storage ─────────────────────────────────────────────────────────────────
|
|
86
|
+
export const folders = pgTable("scoped_list_folders", {
|
|
87
|
+
id: uuid("id").primaryKey(),
|
|
88
|
+
homeSiteId: uuid("home_site_id"),
|
|
89
|
+
archived: boolean("archived").notNull(),
|
|
90
|
+
});
|
|
91
|
+
export const folderShares = pgTable("scoped_list_folder_shares", {
|
|
92
|
+
folderId: uuid("folder_id").notNull(),
|
|
93
|
+
siteId: uuid("site_id").notNull(),
|
|
94
|
+
});
|
|
95
|
+
export const sheets = pgTable("scoped_list_sheets", {
|
|
96
|
+
id: uuid("id").primaryKey(),
|
|
97
|
+
folderId: uuid("folder_id").notNull(),
|
|
98
|
+
siteId: uuid("site_id"),
|
|
99
|
+
});
|
|
100
|
+
export async function createFixtureTables(db) {
|
|
101
|
+
await db.execute(sql `
|
|
102
|
+
CREATE TABLE scoped_list_folders (
|
|
103
|
+
id uuid PRIMARY KEY,
|
|
104
|
+
home_site_id uuid,
|
|
105
|
+
archived boolean NOT NULL
|
|
106
|
+
);
|
|
107
|
+
CREATE TABLE scoped_list_folder_shares (
|
|
108
|
+
folder_id uuid NOT NULL REFERENCES scoped_list_folders (id),
|
|
109
|
+
site_id uuid NOT NULL
|
|
110
|
+
);
|
|
111
|
+
CREATE TABLE scoped_list_sheets (
|
|
112
|
+
id uuid PRIMARY KEY,
|
|
113
|
+
folder_id uuid NOT NULL REFERENCES scoped_list_folders (id),
|
|
114
|
+
site_id uuid
|
|
115
|
+
);
|
|
116
|
+
`);
|
|
117
|
+
}
|
|
118
|
+
// ─── SQL bindings ────────────────────────────────────────────────────────────
|
|
119
|
+
function sharedWithAny(ids) {
|
|
120
|
+
return sql `EXISTS (SELECT 1 FROM ${folderShares} WHERE ${folderShares.folderId} = ${folders.id} AND ${folderShares.siteId} = ANY(${ids}))`;
|
|
121
|
+
}
|
|
122
|
+
const sharedNowhere = sql `NOT EXISTS (SELECT 1 FROM ${folderShares} WHERE ${folderShares.folderId} = ${folders.id})`;
|
|
123
|
+
export const folderSqlRoles = {
|
|
124
|
+
home_site: { kind: "scope-column", column: folders.homeSiteId },
|
|
125
|
+
shared_site: { kind: "scope-join", matches: sharedWithAny },
|
|
126
|
+
fallback_site: {
|
|
127
|
+
kind: "derived",
|
|
128
|
+
matches: (ids) => sql `${folders.homeSiteId} = ANY(${ids}) AND ${sharedNowhere}`,
|
|
129
|
+
},
|
|
130
|
+
archived: { kind: "tag", condition: sql `${folders.archived}` },
|
|
131
|
+
};
|
|
132
|
+
export const folderSql = scopeSqlBindings(folderScope, {
|
|
133
|
+
table: folders,
|
|
134
|
+
id: folders.id,
|
|
135
|
+
roles: folderSqlRoles,
|
|
136
|
+
});
|
|
137
|
+
export const sheetSql = scopeSqlBindings(sheetScope, {
|
|
138
|
+
table: sheets,
|
|
139
|
+
id: sheets.id,
|
|
140
|
+
roles: {
|
|
141
|
+
folder: { kind: "scope-column", column: sheets.folderId },
|
|
142
|
+
site: { kind: "scope-column", column: sheets.siteId },
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=scoped-list-fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-list-fixture.js","sourceRoot":"","sources":["../../../../src/lib/scoped-lists/testing/scoped-list-fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,GAAG,EAAY,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACpH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,OAAO,EAAE,gBAAgB,EAAsB,MAAM,0BAA0B,CAAC;AAEhF,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE5B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,oBAAoB,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AAEpE,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,kBAAkB,EAAE;IAC/C,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE;QACL,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,MAAM;KAChB;IACD,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SA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aAAa,EAAE;KACrF;IACD,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAA,GAAG,OAAO,CAAC,QAAQ,EAAE,EAAE;CACb,CAAC;AAEpD,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC,WAAW,EAAE;IACrD,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,OAAO,CAAC,EAAE;IACd,KAAK,EAAE,cAAc;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,UAAU,EAAE;IACnD,KAAK,EAAE,MAAM;IACb,EAAE,EAAE,MAAM,CAAC,EAAE;IACb,KAAK,EAAE;QACL,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;QACzD,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;KACtD;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type AuthorizationDefinitionPatch = {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly before: string | null;
|
|
4
|
+
readonly after: string | null;
|
|
5
|
+
};
|
|
6
|
+
export type AuthorizationSchemaChange = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly legacyHead: string;
|
|
9
|
+
readonly dependsOn: readonly string[];
|
|
10
|
+
readonly definitions: readonly AuthorizationDefinitionPatch[];
|
|
11
|
+
};
|
|
12
|
+
export type AuthorizationChangeErrorCode = "AUTHZ_CHANGE_INVALID" | "AUTHZ_CHANGE_DEPENDENCY" | "AUTHZ_CHANGE_CONFLICT" | "AUTHZ_CHANGE_CHECKSUM" | "AUTHZ_CHANGE_HISTORY" | "AUTHZ_CHANGE_RELATIONSHIPS" | "AUTHZ_CHANGE_DRIFT";
|
|
13
|
+
export declare class AuthorizationChangeError extends Error {
|
|
14
|
+
readonly code: AuthorizationChangeErrorCode;
|
|
15
|
+
constructor(code: AuthorizationChangeErrorCode, message: string);
|
|
16
|
+
}
|
|
17
|
+
export declare const AUTHORIZATION_CHANGE_ID: RegExp;
|
|
18
|
+
/** Canonical definitions absorb SpiceDB's formatting and equivalent permission grouping. */
|
|
19
|
+
export declare function authorizationSchemaDefinitions(schema: string): ReadonlyMap<string, string>;
|
|
20
|
+
export declare function canonicalAuthorizationSchema(schema: string): string;
|
|
21
|
+
export declare function authorizationSchemaFingerprint(schema: string): string;
|
|
22
|
+
export declare function applyAuthorizationDefinitionPatches(schema: string, change: AuthorizationSchemaChange): string;
|
|
23
|
+
/** Stable identities order only independent ready entries; prerequisites own causality. */
|
|
24
|
+
export declare function orderAuthorizationChanges<T extends AuthorizationSchemaChange>(changes: readonly T[], legacyHead: string): readonly T[];
|
|
25
|
+
export declare function composeAuthorizationChanges(baseline: string, ordered: readonly AuthorizationSchemaChange[]): string;
|
|
26
|
+
export declare function authorizationChangeFrontier(changes: readonly AuthorizationSchemaChange[], legacyHead: string): readonly string[];
|
|
27
|
+
export declare function diffAuthorizationDefinitions(beforeSchema: string, afterSchema: string): readonly AuthorizationDefinitionPatch[];
|
|
28
|
+
//# sourceMappingURL=definition-changes.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-changes.d.mts","sourceRoot":"","sources":["../../src/migration/definition-changes.mts"],"names":[],"mappings":"AAEA,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,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