simetra 0.3.0-next.1 → 0.3.0-next.2
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/dist/compiler/index.d.ts +1 -1
- package/dist/compiler/index.js +45 -0
- package/dist/data/index.js +225 -94
- package/dist/model/index.d.ts +2 -2
- package/dist/schema/index.d.ts +29 -7
- package/dist/schema/index.js +58 -15
- package/package.json +2 -1
package/dist/compiler/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { AttributeCase, CatalogTable, CatalogUnit, ClientCatalog, CustomTable, D
|
|
|
3
3
|
import { Constraint, IndexElem, IndexStmt, Node, Node as Node$1, RangeVar } from "libpg-query";
|
|
4
4
|
type Severity = "error" | "warning";
|
|
5
5
|
/** Коди правил самого компілятора; коди перевірок схем T0 — `SCHEMA_RULES`. */
|
|
6
|
-
export declare const COMPILER_RULES: readonly ["project.missing", "project.timezone-unknown", "project.database-required", "file.unknown-path", "file.orphan", "file.invalid-json", "file.schema", "file.unknown-key", "file.kind-mismatch", "file.name-mismatch", "file.movements-block", "file.movements-marker-indented", "sql.parse", "sql.statement-not-allowed", "sql.unit-duplicate", "sql.namespace-conflict", "sql.generated-grant", "sql.kind-table-verbatim", "sql.function-body-statement", "sql.function-body-session-setting", "sql.function-body-temp-type", "sql.function-body-session-builtin", "sql.platform-function-call", "sql.expression-call-not-allowed", "sql.dependency-cycle", "sql.closed-shell", "sql.command-context-write", "sql.head-not-allowed", "sql.domain-check-not-allowed", "sql.function-settings-shell", "sql.head-settings", "sql.function-overload", "sql.row-rule-grammar", "sql.row-rule-foreign-table", "sql.row-rule-outside-module", "sql.row-rule-name-taken", "sql.bare-current-user", "sql.debt-grows", "sql.debt-stale", "sql.debt-session-write", "sql.debt-extension-schema", "sql.definer-reads-rls", "sql.definer-caller-unchecked", "sql.policy-helper-correlated", "sql.declaration-target-missing", "sql.declaration-overload", "sql.declaration-duplicate", "sql.declaration-platform-form", "sql.declaration-platform-form-widens", "sql.declaration-execute-widened", "sql.declaration-check-missing", "sql.declaration-check-form", "sql.declaration-check-not-applied", "sql.declaration-anonymous-definer", "sql.default-privileges-execute", "sql.function-argument-type-reference", "rewrite.ambiguous-name", "rewrite.unqualified-table", "rewrite.unsupported", "rewrite.trigger-binding", "rewrite.label-literal", "rewrite.dynamic-sql", "rewrite.unresolved-type", "rewrite.body-quoting", "rewrite.verification-failed", "rewrite.contract-change", "rewrite.dynamic-sql-unscoped", "identity.id-missing", "identity.id-duplicate", "identity.physical-name-missing", "identity.kind-label-missing", "identity.kind-label-retained", "identity.kind-label-duplicate", "identity.assigned-once-changed", "identity.name-duplicate", "identity.name-case", "identity.name-reserved", "identity.name-structural", "reference.unresolved", "reference.ambiguous", "customTable.column-unknown", "customTable.index-derived-column", "register.balance-control-resource", "register.balance-control-duplicate", "posting.field-unknown", "posting.register-field-unknown", "posting.tabular-section-unknown", "scope.declaration-missing", "scope.unknown-kind", "scope.attribute-name-collision", "scope.root-duplicate", "scope.root-key", "scope.root-hierarchy", "scope.root-declaration", "scope.root-self-reference", "scope.root-cascade-not-kind", "scope.global-to-scoped", "scope.cross-kind", "scope.recorder-mismatch", "scope.custom-table-column", "scope.cross-scope-redundant", "scope.custom-table-cross-tenant", "scope.set-function-missing", "scope.set-function-signature", "scope.membership-missing", "storage.bucket-duplicate", "storage.scope-kind-unknown", "subscription.source-not-table", "subscription.provider-table-unknown", "subscription.when-changed-unknown", "subscription.when-changed-duplicate", "subscription.source-duplicate", "subscription.name-duplicate", "subscription.when-changed-on-delete", "subscription.handler-missing", "subscription.handler-signature", "subscription.handler-not-closed", "subscription.handler-assigns-mechanics", "subscription.handler-assigns-carrier", "subscription.handler-reads-carrier", "subscription.trigger-name-taken", "subscription.when-changed-mechanics", "users.catalog-duplicate", "users.scope-not-none", "users.description-required", "users.provision-unsafe", "users.catalog-missing", "languages.catalog-duplicate", "languages.scope-not-none", "languages.code-form", "languages.description-required", "languages.public-read", "languages.predefined-items", "languages.seed-unsafe", "languages.primary-missing", "languages.primary-without-catalog", "membership.not-scoped", "membership.user-not-users-ref", "membership.duplicate", "rights.action-unknown", "rights.custom-action-reserved", "rights.custom-action-effects", "rights.requires-cycle", "rights.attribute-unknown", "rights.carrier-not-ref", "rights.carrier-cross-tenant", "rights.carrier-column-taken", "rights.carrier-path-adopted", "rights.carrier-lazy", "rights.register-access-dimension", "rights.dimension-name-reserved", "rights.ownership-target", "rights.container-target", "rights.container-self", "rights.dimension-unknown", "rights.dimension-target", "rights.dimension-relation", "rights.access-target", "rights.access-duplicate", "rights.dimension-function-missing", "rights.dimension-function-signature", "rights.dimension-function-reads-rights", "rights.source-table", "rights.source-forced-rls", "rights.source-member-key", "rights.source-member-unique", "rights.source-column-type", "rights.source-where", "rights.source-role-key", "rights.source-scope-column", "rights.membership-source-duplicate", "rights.source-container-column", "rights.scope-kind-unknown", "rights.users-missing", "rights.public-read-forbidden", "rights.public-read-published-kind", "rights.public-read-published-rights", "rights.public-read-published-read", "rights.include-target", "rights.include-cycle", "rights.scope-without-membership", "rights.full-access-level", "rights.root-creator-level", "rights.root-creator-duplicate", "rights.root-creator-membership", "rights.root-creator-set-function", "rights.root-creator-assignments", "rights.root-creator-assignment-required", "rights.root-creator-subscription", "rights.root-create-author", "rights.root-creator-no-admin", "rights.root-creator-unreachable", "rights.source-unknown", "rights.source-key-level", "rights.source-key-duplicate", "rights.grant-level", "rights.extent-unsupported", "rights.requires-missing", "rights.custom-table-no-contract", "rights.object-without-rights", "rights.custom-action-multi-object", "rights.system-catalog-missing", "rights.system-catalog-duplicate", "rights.system-catalog-scope", "rights.system-catalog-description", "rights.system-catalog-parallel", "rights.system-catalog-custom-action", "rights.adopted-source-writes", "rights.scope-kind-unread", "project.self-sign-up", "rights.snapshot-source-unknown", "rights.snapshot-exempt-writer", "rights.signal-source-unknown", "reference.not-referenceable", "reference.custom-table-key", "reference.custom-table-deferrable-key", "reference.default-to-table", "reference.default-unknown-value", "reference.polymorphic-target-kind", "attribute.unique-within-place", "attribute.row-over-budget", "attribute.lazy-over-budget", "index.attribute-unknown", "index.attribute-duplicate", "index.attribute-rich-text", "search.field-unknown", "search.field-duplicate", "search.field-tabular", "search.field-ref", "search.field-generated", "search.field-rich-text", "catalog.owner-kind", "register.recorder-kind", "posting.register-kind", "posting.register-independent", "posting.register-undeclared", "posting.source-missing", "posting.source-ambiguous", "posting.query-not-select", "posting.query-order-missing", "posting.recorder-not-allowed", "posting.fields-incomplete", "posting.row-in-document-source", "posting.aggregate-in-section-source", "posting.movement-type", "posting.period-not-allowed", "posting.type-mismatch", "physical.table-duplicate", "physical.relation-duplicate", "physical.column-duplicate", "physical.function-duplicate", "physical.reserved-word", "physical.name-too-long", "physical.constraint-name-required", "customTable.foreign-key-arity", "customTable.foreign-key-deferrable-target", "customTable.fk-action-on-kind-table", "customTable.fk-target-not-key", "customTable.generated-conflict", "customTable.key-column-nullable", "presentation.unknown-standard-attribute", "operation.physical-name-too-long", "operation.input-invalid", "operation.target-not-found", "operation.object-exists", "operation.collection-unknown", "operation.delete-referenced", "promote.column-unplaced", "promote.mapping-unknown", "promote.unit-unsupported", "promote.reference-not-promoted", "promote.retired-referenced", "promote.unclassified", "promote.write-path", "promote.debt-writes-table", "promote.cascade-to-restrict", "promote.provider-user-reference", "promote.enum-labels", "promote.type-unsupported", "promote.default-unplaced", "promote.fill-missing", "promote.expression-invalid", "promote.debt-text-reference", "promote.text-conflict", "promote.property-not-equivalent", "engine.diagnostic", "engine.unmodeled-drift", "engine.shadow-load-failed", "engine.shadow-drop-failed", "engine.desired-rejected", "engine.clone-failed", "engine.environment-failed", "engine.preamble-unknown", "engine.unrepresentable", "engine.unmodeled-class", "engine.census-mismatch", "engine.unmodeled-property", "engine.out-of-scope", "engine.owner-not-member", "apply.state-format", "apply.ledger-without-marker", "apply.cascade", "apply.non-transactional", "apply.commit-boundary", "apply.permission-required", "apply.permission-unknown", "apply.first-apply", "apply.drift", "apply.drift-partial", "apply.drift-unverifiable", "apply.versions-changed", "apply.primary-language-changed", "apply.plan-versions", "apply.plan-format", "apply.plan-hash", "apply.plan-stale", "apply.busy", "apply.api-role", "apply.server-unsupported", "apply.role-mismatch", "apply.chain", "apply.target-changed", "apply.verify-failed", "apply.step-failed", "apply.lock-timeout", "apply.lock-privilege", "apply.lock-footprint-exceeded", "apply.connection-lost", "apply.type-narrowing", "apply.type-guard-failed", "apply.preservation-failed", "apply.preservation-measure-failed", "apply.function-check-failed", "apply.function-check-blind", "apply.deferred-constraint-failed", "apply.constraint-invalid", "apply.rehearsal-proof-failed", "apply.rehearsal-required", "apply.rehearsal-stale", "apply.rehearsal-copy-empty", "apply.rehearsal-fewer-rows", "apply.rehearsal-timeout-unbounded", "apply.temp-name-taken", "apply.plpgsql-check-unavailable", "apply.replication-role", "apply.data-step-failed", "apply.data-step-narrowing", "apply.data-write-mismatch", "apply.not-null-violation", "apply.backfill-rows-changed", "apply.backfill-triggers-changed", "plan.unparsable-step", "plan.clone-mismatch", "plan.proof-not-empty", "plan.fingerprint-disagrees", "plan.schema-only-proof", "plan.owner-mismatch", "plan.platform-role-missing", "plan.platform-role-shape", "plan.owner-not-bypassrls", "plan.owner-provider-login", "plan.shadow-base-unsupported", "plan.identity-table-missing", "plan.identity-trigger-locked", "plan.storage-added", "plan.storage-removed", "plan.type-guard-unsupported", "plan.type-change-dependent", "plan.promotion-record-missing", "plan.promotion-record-invalid", "plan.promotion-base", "plan.promotion-record-mismatch", "plan.promotion-record-stale", "plan.promotion-needs-marker", "plan.promotion-multiple", "plan.promotion-unsupported", "plan.promotion-applied", "plan.promotion-not-applicable", "plan.rename-not-realized", "plan.removal-unclassified", "plan.platform-replacement-missing", "plan.property-not-reproduced", "plan.write-path", "plan.service-role-access-lost", "plan.update-of-narrowed", "plan.foreign-exclusive-lock", "plan.plpgsql-check-unavailable", "plan.temp-name-taken", "plan.data-step-volatile", "plan.data-step-function-changed", "plan.temp-privilege", "plan.replication-role", "plan.preservation-type", "plan.provider-trigger-taken", "plan.provider-trigger-undeclared", "plan.trigger-function-unseedable", "plan.row-version-first", "plan.numbering-not-generated", "plan.not-null-violation", "plan.backfill-order", "plan.backfill-unique", "plan.backfill-check", "plan.backfill-carrier-source", "plan.backfill-rights-guard", "plan.backfill-count-failed", "plan.rights-source-access", "plan.rights-source-unknown-keys", "plan.rights-full-access-lost", "plan.rights-orphans", "database.failed", "roles.create-role-denied", "roles.admin-option-missing", "roles.membership-grant-denied", "roles.superuser-required", "roles.unsafe-schema", "roles.unsafe-template", "roles.database-owner", "roles.database-locale", "roles.shared-cluster", "maintenance.model-mismatch", "maintenance.unknown-role", "maintenance.role-level", "maintenance.role-ambiguous", "maintenance.unknown-scope-kind", "maintenance.no-catalog", "maintenance.scope-missing", "maintenance.unknown-user", "maintenance.busy", "maintenance.not-first", "maintenance.holder-exists", "maintenance.not-effective", "maintenance.invalid-member", "maintenance.member-required", "maintenance.refused", "maintenance.outcome-unknown", "introspect.unrepresentable", "introspect.identity-conflict", "introspect.project-mismatch", "introspect.path-collision", "introspect.definer-check-unknown", "introspect.execute-narrowed", "introspect.definer-platform-form-candidate", "introspect.definer-foreign-grant", "introspect.definer-callers-drift", "introspect.definer-acl-changed"];
|
|
6
|
+
export declare const COMPILER_RULES: readonly ["project.missing", "project.timezone-unknown", "project.database-required", "file.unknown-path", "file.orphan", "file.invalid-json", "file.schema", "file.unknown-key", "file.kind-mismatch", "file.name-mismatch", "file.movements-block", "file.movements-marker-indented", "sql.parse", "sql.statement-not-allowed", "sql.unit-duplicate", "sql.namespace-conflict", "sql.generated-grant", "sql.kind-table-verbatim", "sql.function-body-statement", "sql.function-body-session-setting", "sql.function-body-temp-type", "sql.function-body-session-builtin", "sql.platform-function-call", "sql.expression-call-not-allowed", "sql.dependency-cycle", "sql.closed-shell", "sql.command-context-write", "sql.head-not-allowed", "sql.domain-check-not-allowed", "sql.function-settings-shell", "sql.head-settings", "sql.function-overload", "sql.row-rule-grammar", "sql.row-rule-foreign-table", "sql.row-rule-outside-module", "sql.row-rule-name-taken", "sql.bare-current-user", "sql.debt-grows", "sql.debt-stale", "sql.debt-session-write", "sql.debt-extension-schema", "sql.definer-reads-rls", "sql.definer-caller-unchecked", "sql.policy-helper-correlated", "sql.declaration-target-missing", "sql.declaration-overload", "sql.declaration-duplicate", "sql.declaration-platform-form", "sql.declaration-platform-form-widens", "sql.declaration-execute-widened", "sql.declaration-check-missing", "sql.declaration-check-form", "sql.declaration-check-not-applied", "sql.declaration-anonymous-definer", "sql.default-privileges-execute", "sql.function-argument-type-reference", "rewrite.ambiguous-name", "rewrite.unqualified-table", "rewrite.unsupported", "rewrite.trigger-binding", "rewrite.label-literal", "rewrite.dynamic-sql", "rewrite.unresolved-type", "rewrite.body-quoting", "rewrite.verification-failed", "rewrite.contract-change", "rewrite.dynamic-sql-unscoped", "identity.id-missing", "identity.id-duplicate", "identity.physical-name-missing", "identity.kind-label-missing", "identity.kind-label-retained", "identity.kind-label-duplicate", "identity.assigned-once-changed", "identity.name-duplicate", "identity.name-case", "identity.name-reserved", "identity.name-structural", "reference.unresolved", "reference.ambiguous", "customTable.column-unknown", "customTable.index-derived-column", "register.balance-control-resource", "register.balance-control-duplicate", "posting.field-unknown", "posting.register-field-unknown", "posting.tabular-section-unknown", "scope.declaration-missing", "scope.unknown-kind", "scope.attribute-name-collision", "scope.root-duplicate", "scope.root-key", "scope.root-hierarchy", "scope.root-declaration", "scope.root-self-reference", "scope.root-cascade-not-kind", "scope.global-to-scoped", "scope.cross-kind", "scope.recorder-mismatch", "scope.custom-table-column", "scope.cross-scope-redundant", "scope.custom-table-cross-tenant", "scope.set-function-missing", "scope.set-function-signature", "scope.membership-missing", "storage.bucket-duplicate", "storage.scope-kind-unknown", "subscription.source-not-table", "subscription.provider-table-unknown", "subscription.when-changed-unknown", "subscription.when-changed-duplicate", "subscription.source-duplicate", "subscription.name-duplicate", "subscription.when-changed-on-delete", "subscription.handler-missing", "subscription.handler-signature", "subscription.handler-not-closed", "subscription.handler-assigns-mechanics", "subscription.handler-assigns-carrier", "subscription.handler-reads-carrier", "subscription.trigger-name-taken", "subscription.when-changed-mechanics", "users.catalog-duplicate", "users.scope-not-none", "users.description-required", "users.provision-unsafe", "users.catalog-missing", "languages.catalog-duplicate", "languages.scope-not-none", "languages.code-form", "languages.description-required", "languages.public-read", "languages.predefined-items", "languages.seed-unsafe", "languages.primary-missing", "languages.primary-without-catalog", "membership.not-scoped", "membership.user-not-users-ref", "membership.duplicate", "rights.action-unknown", "rights.custom-action-reserved", "rights.custom-action-effects", "rights.requires-cycle", "rights.attribute-unknown", "rights.carrier-not-ref", "rights.carrier-cross-tenant", "rights.carrier-column-taken", "rights.carrier-path-adopted", "rights.carrier-lazy", "rights.register-access-dimension", "rights.dimension-name-reserved", "rights.ownership-target", "rights.container-target", "rights.container-self", "rights.dimension-unknown", "rights.dimension-target", "rights.dimension-relation", "rights.access-target", "rights.access-duplicate", "rights.dimension-function-missing", "rights.dimension-function-signature", "rights.dimension-function-reads-rights", "rights.source-table", "rights.source-forced-rls", "rights.source-member-key", "rights.source-member-unique", "rights.source-column-type", "rights.source-where", "rights.source-role-key", "rights.source-scope-column", "rights.membership-source-duplicate", "rights.source-container-column", "rights.scope-kind-unknown", "rights.users-missing", "rights.public-read-forbidden", "rights.public-read-published-kind", "rights.public-read-published-rights", "rights.public-read-published-read", "rights.include-target", "rights.include-cycle", "rights.scope-without-membership", "rights.full-access-level", "rights.root-creator-level", "rights.root-creator-duplicate", "rights.root-creator-membership", "rights.root-creator-set-function", "rights.root-creator-assignments", "rights.root-creator-assignment-required", "rights.root-creator-subscription", "rights.root-create-author", "rights.root-creator-no-admin", "rights.root-creator-unreachable", "rights.source-unknown", "rights.source-key-level", "rights.source-key-duplicate", "rights.grant-level", "rights.extent-unsupported", "rights.requires-missing", "rights.custom-table-no-contract", "rights.object-without-rights", "rights.custom-action-multi-object", "rights.system-catalog-missing", "rights.system-catalog-duplicate", "rights.system-catalog-scope", "rights.system-catalog-description", "rights.system-catalog-parallel", "rights.system-catalog-custom-action", "rights.adopted-source-writes", "rights.scope-kind-unread", "project.self-sign-up", "rights.snapshot-source-unknown", "rights.snapshot-exempt-writer", "rights.signal-source-unknown", "reference.not-referenceable", "reference.custom-table-key", "reference.custom-table-deferrable-key", "reference.default-to-table", "reference.default-unknown-value", "reference.polymorphic-target-kind", "attribute.unique-within-place", "attribute.row-over-budget", "attribute.lazy-over-budget", "index.attribute-unknown", "index.attribute-duplicate", "index.attribute-rich-text", "search.field-unknown", "search.field-duplicate", "search.field-tabular", "search.field-ref", "search.field-generated", "search.field-rich-text", "catalog.owner-kind", "register.recorder-kind", "posting.register-kind", "posting.register-independent", "posting.register-undeclared", "posting.source-missing", "posting.source-ambiguous", "posting.query-not-select", "posting.query-order-missing", "posting.recorder-not-allowed", "posting.fields-incomplete", "posting.row-in-document-source", "posting.aggregate-in-section-source", "posting.movement-type", "posting.period-not-allowed", "posting.type-mismatch", "physical.table-duplicate", "physical.relation-duplicate", "physical.column-duplicate", "physical.function-duplicate", "physical.reserved-word", "physical.name-too-long", "physical.constraint-name-required", "customTable.foreign-key-arity", "customTable.foreign-key-deferrable-target", "customTable.fk-action-on-kind-table", "customTable.fk-target-not-key", "customTable.generated-conflict", "customTable.key-column-nullable", "presentation.unknown-standard-attribute", "operation.physical-name-too-long", "operation.input-invalid", "operation.target-not-found", "operation.object-exists", "operation.collection-unknown", "operation.delete-referenced", "promote.column-unplaced", "promote.mapping-unknown", "promote.unit-unsupported", "promote.reference-not-promoted", "promote.retired-referenced", "promote.unclassified", "promote.write-path", "promote.debt-writes-table", "promote.cascade-to-restrict", "promote.provider-user-reference", "promote.enum-labels", "promote.type-unsupported", "promote.default-unplaced", "promote.fill-missing", "promote.expression-invalid", "promote.debt-text-reference", "promote.text-conflict", "promote.property-not-equivalent", "engine.diagnostic", "engine.unmodeled-drift", "engine.shadow-load-failed", "engine.shadow-drop-failed", "engine.desired-rejected", "engine.clone-failed", "engine.environment-failed", "engine.preamble-unknown", "engine.unrepresentable", "engine.unmodeled-class", "engine.census-mismatch", "engine.unmodeled-property", "engine.out-of-scope", "engine.owner-not-member", "apply.state-format", "apply.ledger-without-marker", "apply.cascade", "apply.non-transactional", "apply.commit-boundary", "apply.permission-required", "apply.permission-unknown", "apply.first-apply", "apply.drift", "apply.drift-partial", "apply.drift-unverifiable", "apply.versions-changed", "apply.primary-language-changed", "apply.plan-versions", "apply.plan-format", "apply.plan-hash", "apply.plan-stale", "apply.busy", "apply.api-role", "apply.server-unsupported", "apply.role-mismatch", "apply.chain", "apply.target-changed", "apply.verify-failed", "apply.step-failed", "apply.lock-timeout", "apply.lock-privilege", "apply.lock-footprint-exceeded", "apply.connection-lost", "apply.type-narrowing", "apply.type-guard-failed", "apply.preservation-failed", "apply.preservation-measure-failed", "apply.function-check-failed", "apply.function-check-blind", "apply.deferred-constraint-failed", "apply.constraint-invalid", "apply.rehearsal-proof-failed", "apply.rehearsal-required", "apply.rehearsal-stale", "apply.rehearsal-copy-empty", "apply.rehearsal-fewer-rows", "apply.rehearsal-timeout-unbounded", "apply.temp-name-taken", "apply.plpgsql-check-unavailable", "apply.extension-unavailable", "apply.replication-role", "apply.data-step-failed", "apply.data-step-narrowing", "apply.data-write-mismatch", "apply.not-null-violation", "apply.backfill-rows-changed", "apply.backfill-triggers-changed", "plan.unparsable-step", "plan.clone-mismatch", "plan.proof-not-empty", "plan.fingerprint-disagrees", "plan.schema-only-proof", "plan.owner-mismatch", "plan.platform-role-missing", "plan.platform-role-shape", "plan.owner-not-bypassrls", "plan.owner-provider-login", "plan.shadow-base-unsupported", "plan.identity-table-missing", "plan.identity-trigger-locked", "plan.storage-added", "plan.storage-removed", "plan.type-guard-unsupported", "plan.type-change-dependent", "plan.promotion-record-missing", "plan.promotion-record-invalid", "plan.promotion-base", "plan.promotion-record-mismatch", "plan.promotion-record-stale", "plan.promotion-needs-marker", "plan.promotion-multiple", "plan.promotion-unsupported", "plan.promotion-applied", "plan.promotion-not-applicable", "plan.rename-not-realized", "plan.removal-unclassified", "plan.platform-replacement-missing", "plan.property-not-reproduced", "plan.write-path", "plan.service-role-access-lost", "plan.update-of-narrowed", "plan.foreign-exclusive-lock", "plan.plpgsql-check-unavailable", "plan.temp-name-taken", "plan.data-step-volatile", "plan.data-step-function-changed", "plan.temp-privilege", "plan.replication-role", "plan.preservation-type", "plan.provider-trigger-taken", "plan.provider-trigger-undeclared", "plan.trigger-function-unseedable", "plan.row-version-first", "plan.numbering-not-generated", "plan.not-null-violation", "plan.backfill-order", "plan.backfill-unique", "plan.backfill-check", "plan.backfill-carrier-source", "plan.backfill-rights-guard", "plan.backfill-count-failed", "plan.rights-source-access", "plan.rights-source-unknown-keys", "plan.rights-full-access-lost", "plan.rights-orphans", "database.failed", "roles.create-role-denied", "roles.admin-option-missing", "roles.membership-grant-denied", "roles.superuser-required", "roles.unsafe-schema", "roles.unsafe-template", "roles.database-owner", "roles.database-locale", "roles.shared-cluster", "roles.extension-unavailable", "roles.dev-passwords-unsupported", "roles.dev-password-missing", "roles.dev-passwords-remote", "maintenance.model-mismatch", "maintenance.unknown-role", "maintenance.role-level", "maintenance.role-ambiguous", "maintenance.unknown-scope-kind", "maintenance.no-catalog", "maintenance.scope-missing", "maintenance.unknown-user", "maintenance.busy", "maintenance.not-first", "maintenance.holder-exists", "maintenance.not-effective", "maintenance.invalid-member", "maintenance.member-required", "maintenance.refused", "maintenance.outcome-unknown", "introspect.unrepresentable", "introspect.identity-conflict", "introspect.project-mismatch", "introspect.path-collision", "introspect.definer-check-unknown", "introspect.execute-narrowed", "introspect.definer-platform-form-candidate", "introspect.definer-foreign-grant", "introspect.definer-callers-drift", "introspect.definer-acl-changed"];
|
|
7
7
|
type CompilerRule = (typeof COMPILER_RULES)[number];
|
|
8
8
|
type RuleCode = SchemaRule | CompilerRule;
|
|
9
9
|
type DiagnosticParams = Record<string, string | number>;
|
package/dist/compiler/index.js
CHANGED
|
@@ -3981,6 +3981,14 @@ const MESSAGES = {
|
|
|
3981
3981
|
uk: "Нічого не записано. Поверніть ролі застосування те, що план застав (право поставити plpgsql_check чи USAGE на схему встановленого розширення), або сплануйте знову."
|
|
3982
3982
|
}
|
|
3983
3983
|
},
|
|
3984
|
+
"apply.extension-unavailable": {
|
|
3985
|
+
en: (p) => `The plan checks function bodies with ${p.extension}, but the server has no such extension: it is neither installed in the database nor listed in pg_available_extensions. Nothing was written`,
|
|
3986
|
+
uk: (p) => `План перевіряє тіла функцій через ${p.extension}, але на сервері такого розширення немає: його немає ні в базі, ні в pg_available_extensions. Нічого не записано`,
|
|
3987
|
+
hint: {
|
|
3988
|
+
en: (p) => `Install the package of the extension ${p.extension} on the database server (for a Debian-based Postgres image from the PGDG repository it is postgresql-<major>-${String(p.extension).replaceAll("_", "-")}), then apply again. A rehearsal copy on another server needs the package there too. When the plan found the extension installed, put it back into the database as well (\`simetra roles\` on the postgres profile), or plan again.`,
|
|
3989
|
+
uk: (p) => `Поставте пакет розширення ${p.extension} на сервер бази (для образу Postgres на Debian з репозиторію PGDG це postgresql-<major>-${String(p.extension).replaceAll("_", "-")}) і застосуйте знову. Копії репетиції на іншому сервері пакет потрібен і там. Коли план застав розширення встановленим, поверніть його й у базу (\`simetra roles\` у профілі postgres) або сплануйте знову.`
|
|
3990
|
+
}
|
|
3991
|
+
},
|
|
3984
3992
|
"apply.replication-role": {
|
|
3985
3993
|
en: (p) => `The apply transaction runs with session_replication_role = ${p.value}, and the plan's data steps need origin: otherwise foreign key triggers do not fire and the written values bypass the reference checks. Nothing was written`,
|
|
3986
3994
|
uk: (p) => `Транзакція застосування має session_replication_role = ${p.value}, а кроки даних плану потребують origin: інакше тригери зовнішніх ключів не спрацьовують, і записані значення обходять перевірку посилань. Нічого не записано`,
|
|
@@ -4553,6 +4561,38 @@ const MESSAGES = {
|
|
|
4553
4561
|
uk: "Нічого не створено. Ролі входу кластерні з фіксованими іменами, тож той самий логін мав би свої права в базі іншого застосунку. Використайте окремий кластер для кожного застосунку або відкличте явний CONNECT на ці бази, якщо вони не застосунки Simetra."
|
|
4554
4562
|
}
|
|
4555
4563
|
},
|
|
4564
|
+
"roles.extension-unavailable": {
|
|
4565
|
+
en: (p) => `The server has no extension ${p.extension}: it is not listed in pg_available_extensions, so \`simetra roles\` cannot install it into the database or the template`,
|
|
4566
|
+
uk: (p) => `На сервері немає розширення ${p.extension}: його немає в pg_available_extensions, тож \`simetra roles\` не може поставити його в базу чи шаблон`,
|
|
4567
|
+
hint: {
|
|
4568
|
+
en: (p) => `Nothing was written. Install the package of the extension on the database server (for a Debian-based Postgres image from the PGDG repository it is postgresql-<major>-${String(p.extension).replaceAll("_", "-")}), then run \`simetra roles\` again.`,
|
|
4569
|
+
uk: (p) => `Нічого не записано. Поставте пакет розширення на сервер бази (для образу Postgres на Debian з репозиторію PGDG це postgresql-<major>-${String(p.extension).replaceAll("_", "-")}) і запустіть \`simetra roles\` знову.`
|
|
4570
|
+
}
|
|
4571
|
+
},
|
|
4572
|
+
"roles.dev-passwords-unsupported": {
|
|
4573
|
+
en: (p) => p.provider === void 0 ? "devPasswords needs the provider postgres, and the directory has no project.meta.json" : `devPasswords needs the provider postgres, and the project has ${p.provider}`,
|
|
4574
|
+
uk: (p) => p.provider === void 0 ? "devPasswords потребує провайдера postgres, а в теці немає project.meta.json" : `devPasswords потребує провайдера postgres, а проєкт має ${p.provider}`,
|
|
4575
|
+
hint: {
|
|
4576
|
+
en: "Nothing was written. Only the postgres profile creates its login roles in `simetra roles`; drop devPasswords, or run the command in a metadata directory whose project file selects postgres.",
|
|
4577
|
+
uk: "Нічого не записано. Лише профіль postgres створює свої ролі входу в `simetra roles`; приберіть devPasswords або запустіть команду в теці метаданих, файл проєкту якої обирає postgres."
|
|
4578
|
+
}
|
|
4579
|
+
},
|
|
4580
|
+
"roles.dev-password-missing": {
|
|
4581
|
+
en: (p) => `devPasswords reads the password of a login role from the environment variable ${p.variable}, and it is not set or empty`,
|
|
4582
|
+
uk: (p) => `devPasswords читає пароль ролі входу зі змінної середовища ${p.variable}, а вона не задана чи порожня`,
|
|
4583
|
+
hint: {
|
|
4584
|
+
en: "Nothing was written. Set every SIMETRA_*_DEV_PASSWORD variable the diagnostics name in the environment of the command, then run it again.",
|
|
4585
|
+
uk: "Нічого не записано. Задайте в середовищі команди кожну змінну SIMETRA_*_DEV_PASSWORD, яку називають діагностики, і запустіть її знову."
|
|
4586
|
+
}
|
|
4587
|
+
},
|
|
4588
|
+
"roles.dev-passwords-remote": {
|
|
4589
|
+
en: (p) => `devPasswords sets known passwords only on a database of this machine, and the database host is ${p.host}`,
|
|
4590
|
+
uk: (p) => `devPasswords ставить відомі паролі лише в базі цієї машини, а хост бази — ${p.host}`,
|
|
4591
|
+
hint: {
|
|
4592
|
+
en: "Nothing was written. Use devPasswords only with localhost, a 127.0.0.0/8 or ::1 address, or a unix socket; on any other server set the passwords of the login roles yourself.",
|
|
4593
|
+
uk: "Нічого не записано. Використовуйте devPasswords лише з localhost, адресою 127.0.0.0/8 чи ::1 або unix-сокетом; на іншому сервері паролі ролей входу ставте самі."
|
|
4594
|
+
}
|
|
4595
|
+
},
|
|
4556
4596
|
"maintenance.model-mismatch": {
|
|
4557
4597
|
en: (p) => `The applied model (${p.applied}) is not the compiled one (${p.compiled}): rights maintenance works only on the database state the project describes`,
|
|
4558
4598
|
uk: (p) => `Застосована модель (${p.applied}) не збігається зі скомпільованою (${p.compiled}): обслуговування прав працює лише зі станом бази, який описує проєкт`,
|
|
@@ -5150,6 +5190,7 @@ const COMPILER_RULES = [
|
|
|
5150
5190
|
"apply.rehearsal-timeout-unbounded",
|
|
5151
5191
|
"apply.temp-name-taken",
|
|
5152
5192
|
"apply.plpgsql-check-unavailable",
|
|
5193
|
+
"apply.extension-unavailable",
|
|
5153
5194
|
"apply.replication-role",
|
|
5154
5195
|
"apply.data-step-failed",
|
|
5155
5196
|
"apply.data-step-narrowing",
|
|
@@ -5225,6 +5266,10 @@ const COMPILER_RULES = [
|
|
|
5225
5266
|
"roles.database-owner",
|
|
5226
5267
|
"roles.database-locale",
|
|
5227
5268
|
"roles.shared-cluster",
|
|
5269
|
+
"roles.extension-unavailable",
|
|
5270
|
+
"roles.dev-passwords-unsupported",
|
|
5271
|
+
"roles.dev-password-missing",
|
|
5272
|
+
"roles.dev-passwords-remote",
|
|
5228
5273
|
"maintenance.model-mismatch",
|
|
5229
5274
|
"maintenance.unknown-role",
|
|
5230
5275
|
"maintenance.role-level",
|
package/dist/data/index.js
CHANGED
|
@@ -4037,6 +4037,62 @@ function reopenedPairs(prev, next, entry) {
|
|
|
4037
4037
|
const kind = entry.scopeKindId;
|
|
4038
4038
|
return [...new Set(next.scopeSets.filter((s) => s.scopeKind === kind).map((s) => s.scope))].filter(reopened);
|
|
4039
4039
|
}
|
|
4040
|
+
// src/data/store/sync/key-queue.ts
|
|
4041
|
+
function frozen$1(queue) {
|
|
4042
|
+
Object.freeze(queue.pending);
|
|
4043
|
+
if (queue.flying !== void 0) Object.freeze(queue.flying);
|
|
4044
|
+
return Object.freeze(queue);
|
|
4045
|
+
}
|
|
4046
|
+
/** Порожня черга: перший запис об'єкта. */
|
|
4047
|
+
function createKeyQueue() {
|
|
4048
|
+
return frozen$1({
|
|
4049
|
+
pending: [],
|
|
4050
|
+
flying: void 0,
|
|
4051
|
+
gen: 0
|
|
4052
|
+
});
|
|
4053
|
+
}
|
|
4054
|
+
/** Ключі стали в чергу; ключ, що вже чекає, не зсувається. */
|
|
4055
|
+
function keysQueued(queue, keys) {
|
|
4056
|
+
return frozen$1({
|
|
4057
|
+
...queue,
|
|
4058
|
+
pending: [.../* @__PURE__ */ new Set([...queue.pending, ...keys])]
|
|
4059
|
+
});
|
|
4060
|
+
}
|
|
4061
|
+
/** Політ забирає все, що чекало; порожня черга лишається як є. */
|
|
4062
|
+
function keysTaken(queue) {
|
|
4063
|
+
if (queue.pending.length === 0) return queue;
|
|
4064
|
+
return frozen$1({
|
|
4065
|
+
...queue,
|
|
4066
|
+
pending: [],
|
|
4067
|
+
flying: queue.pending
|
|
4068
|
+
});
|
|
4069
|
+
}
|
|
4070
|
+
/** Політ осів: місце вільне, покоління лишається. */
|
|
4071
|
+
function flightSettled(queue) {
|
|
4072
|
+
return frozen$1({
|
|
4073
|
+
...queue,
|
|
4074
|
+
flying: void 0
|
|
4075
|
+
});
|
|
4076
|
+
}
|
|
4077
|
+
/**
|
|
4078
|
+
* Відповідь у польоті могла не нести рядка, якого на мить `purge` у сховищі не
|
|
4079
|
+
* було (П12): покоління зростає, ключі польоту повертаються в чергу.
|
|
4080
|
+
*/
|
|
4081
|
+
function flightInvalidated(queue) {
|
|
4082
|
+
return frozen$1({
|
|
4083
|
+
...queue,
|
|
4084
|
+
gen: queue.gen + 1,
|
|
4085
|
+
pending: [.../* @__PURE__ */ new Set([...queue.pending, ...queue.flying ?? []])]
|
|
4086
|
+
});
|
|
4087
|
+
}
|
|
4088
|
+
/** Ключ чекає польоту чи в польоті. */
|
|
4089
|
+
function isKeyQueued(queue, key) {
|
|
4090
|
+
return queue !== void 0 && (queue.pending.includes(key) || queue.flying?.includes(key) === true);
|
|
4091
|
+
}
|
|
4092
|
+
/** Число ключів у черзі й польоті (діагностика розмірів). */
|
|
4093
|
+
function queuedKeyCount(queue) {
|
|
4094
|
+
return (queue?.pending.length ?? 0) + (queue?.flying?.length ?? 0);
|
|
4095
|
+
}
|
|
4040
4096
|
// src/data/store/sync/flight-kinds.ts
|
|
4041
4097
|
const FLIGHT_KIND_RULES = {
|
|
4042
4098
|
load: {
|
|
@@ -4166,6 +4222,9 @@ function evidenceOf(flight) {
|
|
|
4166
4222
|
epoch: flight.epoch
|
|
4167
4223
|
};
|
|
4168
4224
|
}
|
|
4225
|
+
const WRITELESS_SCOPE = { assert() {
|
|
4226
|
+
throw new Error("a writeless pass has no write scope");
|
|
4227
|
+
} };
|
|
4169
4228
|
/**
|
|
4170
4229
|
* Один прохід: синхронний, коли жоден політ не чекає залежності. Оренда
|
|
4171
4230
|
* кожного польоту знімається рівно раз — і тоді, коли гачок кидає.
|
|
@@ -4180,7 +4239,10 @@ function settlePass(session, entries, hooks) {
|
|
|
4180
4239
|
if (hooks.quiet?.(entry) === true || entry.failure !== void 0 && hooks.refused?.(entry.failure.error)) outcomes[i] = "closed";
|
|
4181
4240
|
else live.push(i);
|
|
4182
4241
|
});
|
|
4183
|
-
if (live.length > 0) {
|
|
4242
|
+
if (live.length > 0 && hooks.writeless === true) {
|
|
4243
|
+
if (hooks.token.valid) region(WRITELESS_SCOPE, live);
|
|
4244
|
+
else for (const i of live) outcomes[i] = hooks.lost?.(entries[i]) ?? "closed";
|
|
4245
|
+
} else if (live.length > 0) {
|
|
4184
4246
|
if (!session.commit((scope) => region(scope, live), hooks.token, hooks.what)) for (const i of live) outcomes[i] = hooks.lost?.(entries[i]) ?? "closed";
|
|
4185
4247
|
}
|
|
4186
4248
|
entries.forEach((entry, i) => hooks.settled?.(entry, outcomes[i], details[i]));
|
|
@@ -4331,6 +4393,7 @@ function startFlight(state, start) {
|
|
|
4331
4393
|
return frozen(startedFlight(state, start));
|
|
4332
4394
|
}
|
|
4333
4395
|
function startedFlight(state, start) {
|
|
4396
|
+
if (start.sentAt !== void 0 && (start.kind !== "service" || start.retry !== true)) throw new Error("only an attempt of a service flight is sent with a deadline");
|
|
4334
4397
|
switch (start.kind) {
|
|
4335
4398
|
case "page": return state;
|
|
4336
4399
|
case "reread":
|
|
@@ -4356,7 +4419,8 @@ function startedFlight(state, start) {
|
|
|
4356
4419
|
...start.proofAtStart === true && start.headerRevision !== void 0 ? {
|
|
4357
4420
|
readRevision: start.headerRevision,
|
|
4358
4421
|
readStart: start.epoch
|
|
4359
|
-
} : {}
|
|
4422
|
+
} : {},
|
|
4423
|
+
...start.sentAt === void 0 ? {} : { refreshedAt: start.sentAt }
|
|
4360
4424
|
};
|
|
4361
4425
|
if (state.flight !== void 0) return {
|
|
4362
4426
|
...state,
|
|
@@ -5289,20 +5353,26 @@ function requirementHold(s) {
|
|
|
5289
5353
|
*/
|
|
5290
5354
|
function settleTarget(s, flight, outcome, failure, context) {
|
|
5291
5355
|
const rules = rulesOf(flight);
|
|
5292
|
-
const
|
|
5356
|
+
const loadedBefore = "part" in s ? true : s.loaded;
|
|
5357
|
+
const counts = (applied) => applied ? rules.successMovesDeadline : context.readFailed && (rules.failureCounts === "always" || rules.failureCounts === "if-loaded" && loadedBefore);
|
|
5358
|
+
const sentAt = "part" in s && s.part === "rights" ? s.targetState.refreshedAt : void 0;
|
|
5293
5359
|
const settle = (applied) => ({
|
|
5294
5360
|
outcome: applied ? "applied" : "failed",
|
|
5295
5361
|
flight: required(flight.kind, "its kind"),
|
|
5296
5362
|
evidence: applied ? {
|
|
5297
|
-
kind: "session-start",
|
|
5363
|
+
kind: flight.kind === "service" ? "service-sent" : "session-start",
|
|
5298
5364
|
epoch: required(flight.epoch, "its start epoch")
|
|
5299
5365
|
} : void 0,
|
|
5300
5366
|
own: true,
|
|
5301
|
-
startedAt: counts(applied) ? required(flight.startedAt, "its start time") : flight.startedAt ?? 0,
|
|
5302
|
-
loaded:
|
|
5367
|
+
startedAt: sentAt ?? (counts(applied) ? required(flight.startedAt, "its start time") : flight.startedAt ?? 0),
|
|
5368
|
+
loaded: loadedBefore,
|
|
5303
5369
|
applyFailed: !context.readFailed,
|
|
5304
5370
|
...context.report?.sectionRead === void 0 ? {} : { sectionRead: context.report.sectionRead }
|
|
5305
5371
|
});
|
|
5372
|
+
if ("part" in s) {
|
|
5373
|
+
if (outcome === "applied" || outcome === "failed") s.targetState = settleFlight(s.targetState, settle(outcome === "applied"));
|
|
5374
|
+
return false;
|
|
5375
|
+
}
|
|
5306
5376
|
if (outcome === "applied") {
|
|
5307
5377
|
if (rules.successMovesDeadline && rules.confirms === "view-with-composition") s.loaded = true;
|
|
5308
5378
|
s.targetState = settleFlight(s.targetState, settle(true));
|
|
@@ -7070,7 +7140,6 @@ async function rereadKey(ctx, object, key, options) {
|
|
|
7070
7140
|
}, "K4");
|
|
7071
7141
|
if (!isPermit(admitted)) return;
|
|
7072
7142
|
const o = ctx.objectOf(object);
|
|
7073
|
-
const token = session.token();
|
|
7074
7143
|
const limit = new AbortController();
|
|
7075
7144
|
const requester = (outcome, scope) => {
|
|
7076
7145
|
if (outcome.kind !== "read" && unconfirmed !== void 0) {
|
|
@@ -7083,6 +7152,7 @@ async function rereadKey(ctx, object, key, options) {
|
|
|
7083
7152
|
const flight = admitted.flight({
|
|
7084
7153
|
lease,
|
|
7085
7154
|
kind: "keys",
|
|
7155
|
+
token: session.token(),
|
|
7086
7156
|
requester,
|
|
7087
7157
|
deadlineMs: REREAD_TIMEOUT_MS,
|
|
7088
7158
|
done: { fired: false }
|
|
@@ -7095,6 +7165,7 @@ async function rereadKey(ctx, object, key, options) {
|
|
|
7095
7165
|
required(flight.requester, "its requester")(outcome, scope);
|
|
7096
7166
|
};
|
|
7097
7167
|
session.sleep(required(flight.deadlineMs, "its deadline"), limit.signal).then(() => {
|
|
7168
|
+
const token = required(flight.token, "its token");
|
|
7098
7169
|
if (required(flight.done, "its reply mark").fired || !token.valid) return;
|
|
7099
7170
|
session.commit((scope) => reply({ kind: "failed" }, scope), token, "reread timeout");
|
|
7100
7171
|
});
|
|
@@ -7110,9 +7181,9 @@ async function rereadKey(ctx, object, key, options) {
|
|
|
7110
7181
|
flight,
|
|
7111
7182
|
...rows === void 0 ? { failure: { error: void 0 } } : {}
|
|
7112
7183
|
}], {
|
|
7113
|
-
token,
|
|
7184
|
+
token: required(flight.token, "its token"),
|
|
7114
7185
|
what: `reread ${o.name}`,
|
|
7115
|
-
quiet: () => !token.valid,
|
|
7186
|
+
quiet: () => !required(flight.token, "its token").valid,
|
|
7116
7187
|
gate: () => {
|
|
7117
7188
|
const epochs = new Set(read.epochs);
|
|
7118
7189
|
for (const row of required(rows, "its answer")) epochs.add(row.versionEpoch ?? null);
|
|
@@ -7962,6 +8033,20 @@ const RIGHTS_UNCONFIRMED = {
|
|
|
7962
8033
|
reason: "requirement",
|
|
7963
8034
|
requirement: "rights-unconfirmed"
|
|
7964
8035
|
};
|
|
8036
|
+
const VERSION_UNCONFIRMED = {
|
|
8037
|
+
reason: "requirement",
|
|
8038
|
+
requirement: "version-unconfirmed"
|
|
8039
|
+
};
|
|
8040
|
+
/**
|
|
8041
|
+
* Причина читання з даних польоту: політ — це причина плюс запис шлюзу, тож
|
|
8042
|
+
* копії причини службова ціль не тримає.
|
|
8043
|
+
*/
|
|
8044
|
+
function causeOfFlight(flight) {
|
|
8045
|
+
return flight.reason === "requirement" ? {
|
|
8046
|
+
reason: "requirement",
|
|
8047
|
+
requirement: flight.requirement
|
|
8048
|
+
} : { reason: flight.reason };
|
|
8049
|
+
}
|
|
7965
8050
|
const HYDRATION_TRUST = {
|
|
7966
8051
|
reason: "requirement",
|
|
7967
8052
|
requirement: "hydration-trust",
|
|
@@ -8023,12 +8108,29 @@ function createCore(options) {
|
|
|
8023
8108
|
now,
|
|
8024
8109
|
defects
|
|
8025
8110
|
});
|
|
8111
|
+
const services = {
|
|
8112
|
+
rights: {
|
|
8113
|
+
part: "rights",
|
|
8114
|
+
targetState: createTargetState()
|
|
8115
|
+
},
|
|
8116
|
+
version: {
|
|
8117
|
+
part: "version",
|
|
8118
|
+
targetState: createTargetState()
|
|
8119
|
+
}
|
|
8120
|
+
};
|
|
8026
8121
|
const batcher = createBatcher(options.source, {
|
|
8027
8122
|
ownFlight: gate.issued,
|
|
8028
8123
|
staleObject: gate.staleObject,
|
|
8029
8124
|
sleep: session.sleep,
|
|
8030
8125
|
onRightsSent: () => {
|
|
8031
|
-
|
|
8126
|
+
const state = services.rights.targetState;
|
|
8127
|
+
services.rights.targetState = startFlight(state, {
|
|
8128
|
+
kind: "service",
|
|
8129
|
+
cause: state.flightCause ?? RIGHTS_UNCONFIRMED,
|
|
8130
|
+
retry: true,
|
|
8131
|
+
epoch: state.flightEpoch,
|
|
8132
|
+
sentAt: now()
|
|
8133
|
+
});
|
|
8032
8134
|
},
|
|
8033
8135
|
onRead: (event) => {
|
|
8034
8136
|
for (const listener of [...readListeners]) try {
|
|
@@ -8038,7 +8140,10 @@ function createCore(options) {
|
|
|
8038
8140
|
onVersion(version) {
|
|
8039
8141
|
if (session.token().valid) applyVersion(version.objects);
|
|
8040
8142
|
},
|
|
8041
|
-
onRights: (item) =>
|
|
8143
|
+
onRights: (item) => {
|
|
8144
|
+
const outcome = acceptRights(item);
|
|
8145
|
+
if (rightsFlight !== void 0) settleService("rights", rightsFlight, outcome);
|
|
8146
|
+
}
|
|
8042
8147
|
});
|
|
8043
8148
|
const pendingWrites = /* @__PURE__ */ new Map();
|
|
8044
8149
|
const source = {
|
|
@@ -8143,38 +8248,42 @@ function createCore(options) {
|
|
|
8143
8248
|
const origins = forward.map(() => flight);
|
|
8144
8249
|
if (injected) {
|
|
8145
8250
|
forward.unshift({ type: "rights" });
|
|
8146
|
-
origins.unshift(rightsFirst.flight());
|
|
8251
|
+
origins.unshift(rightsFirst.flight({ kind: "service" }));
|
|
8147
8252
|
}
|
|
8148
8253
|
const rightsAt = forward.findIndex((part) => part.type === "rights");
|
|
8149
8254
|
let answered = { items: [] };
|
|
8150
8255
|
if (rightsAt < 0) {
|
|
8151
8256
|
if (forward.length > 0) answered = await batcher.read(forward, origins);
|
|
8152
8257
|
} else {
|
|
8153
|
-
const
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
}
|
|
8158
|
-
forward[rightsAt] = sentRights.known === void 0 ? { type: "rights" } : {
|
|
8258
|
+
const sentEpoch = session.epochs.next();
|
|
8259
|
+
const flying = origins[rightsAt];
|
|
8260
|
+
rightsFlight = flying;
|
|
8261
|
+
rightsKnown = rights?.rightsVersion;
|
|
8262
|
+
forward[rightsAt] = rightsKnown === void 0 ? { type: "rights" } : {
|
|
8159
8263
|
type: "rights",
|
|
8160
|
-
known:
|
|
8264
|
+
known: rightsKnown
|
|
8161
8265
|
};
|
|
8162
8266
|
rightsFirstSent = true;
|
|
8163
|
-
|
|
8164
|
-
|
|
8267
|
+
services.rights.targetState = startFlight(services.rights.targetState, {
|
|
8268
|
+
kind: "service",
|
|
8269
|
+
epoch: sentEpoch,
|
|
8270
|
+
cause: causeOfFlight(flying)
|
|
8271
|
+
});
|
|
8165
8272
|
try {
|
|
8166
8273
|
answered = await batcher.read(forward, origins);
|
|
8167
8274
|
} catch (error) {
|
|
8168
|
-
if (
|
|
8275
|
+
if (session.token().valid) log({ kind: "rights-failed" });
|
|
8276
|
+
if (services.rights.targetState.answerPending) settleService("rights", flying, "failed");
|
|
8169
8277
|
throw error;
|
|
8170
8278
|
} finally {
|
|
8171
|
-
|
|
8279
|
+
rightsFlight = void 0;
|
|
8280
|
+
const tail = services.rights.targetState.trailing;
|
|
8281
|
+
services.rights.targetState = slotChanged(services.rights.targetState, {
|
|
8282
|
+
kind: "freed",
|
|
8283
|
+
alive: true
|
|
8284
|
+
});
|
|
8172
8285
|
if (!defects.has("scheduler-no-reschedule")) scheduler.request();
|
|
8173
|
-
|
|
8174
|
-
if (tail !== void 0) {
|
|
8175
|
-
rightsTail = void 0;
|
|
8176
|
-
requestRightsFor(tail);
|
|
8177
|
-
}
|
|
8286
|
+
if (tail !== void 0) requestRightsFor(tail);
|
|
8178
8287
|
}
|
|
8179
8288
|
if (injected) answered = { items: answered.items.slice(1) };
|
|
8180
8289
|
}
|
|
@@ -8190,10 +8299,8 @@ function createCore(options) {
|
|
|
8190
8299
|
const rightsEnabled = options.rightsSnapshot === true;
|
|
8191
8300
|
let rights;
|
|
8192
8301
|
let rightsFirstSent = false;
|
|
8193
|
-
let
|
|
8194
|
-
let
|
|
8195
|
-
let rightsSentAt;
|
|
8196
|
-
let rightsSent;
|
|
8302
|
+
let rightsKnown;
|
|
8303
|
+
let rightsFlight;
|
|
8197
8304
|
let firstRights;
|
|
8198
8305
|
const beforeFirst = {
|
|
8199
8306
|
views: /* @__PURE__ */ new Set(),
|
|
@@ -8260,34 +8367,34 @@ function createCore(options) {
|
|
|
8260
8367
|
if (session.token().valid) core.close("session-changed");
|
|
8261
8368
|
}
|
|
8262
8369
|
function acceptRights(item) {
|
|
8263
|
-
const
|
|
8264
|
-
if (
|
|
8370
|
+
const sentEpoch = services.rights.targetState.flightEpoch;
|
|
8371
|
+
if (sentEpoch === void 0 || !session.token().valid) return "closed";
|
|
8265
8372
|
if (!item.ok || !("type" in item) || item.type !== "rights") {
|
|
8266
8373
|
log({ kind: "rights-failed" });
|
|
8267
|
-
return;
|
|
8374
|
+
return "failed";
|
|
8268
8375
|
}
|
|
8269
8376
|
const { rightsVersion, snapshot } = item.value;
|
|
8270
8377
|
const current = rights;
|
|
8271
8378
|
if (snapshot === void 0) {
|
|
8272
|
-
if (current === void 0 ||
|
|
8379
|
+
if (current === void 0 || rightsKnown !== current.rightsVersion || rightsVersion !== current.rightsVersion) {
|
|
8273
8380
|
log({ kind: "rights-failed" });
|
|
8274
|
-
return;
|
|
8381
|
+
return "failed";
|
|
8275
8382
|
}
|
|
8276
8383
|
rights = {
|
|
8277
8384
|
...current,
|
|
8278
8385
|
rightsVersion
|
|
8279
8386
|
};
|
|
8280
|
-
return;
|
|
8387
|
+
return "applied";
|
|
8281
8388
|
}
|
|
8282
8389
|
if (current !== void 0 && current.snapshot.userId !== null && snapshot.userId !== null && current.snapshot.userId !== snapshot.userId) {
|
|
8283
8390
|
rightsSessionChanged();
|
|
8284
|
-
return;
|
|
8391
|
+
return "closed";
|
|
8285
8392
|
}
|
|
8286
|
-
if (current !== void 0 &&
|
|
8393
|
+
if (current !== void 0 && sentEpoch <= current.rightsEpoch) return "discarded-by-epoch";
|
|
8287
8394
|
const next = {
|
|
8288
8395
|
snapshot,
|
|
8289
8396
|
rightsVersion,
|
|
8290
|
-
rightsEpoch:
|
|
8397
|
+
rightsEpoch: sentEpoch,
|
|
8291
8398
|
appliedEpoch: session.epochs.next()
|
|
8292
8399
|
};
|
|
8293
8400
|
rights = next;
|
|
@@ -8302,6 +8409,7 @@ function createCore(options) {
|
|
|
8302
8409
|
});
|
|
8303
8410
|
}
|
|
8304
8411
|
receiver?.snapshotReplaced();
|
|
8412
|
+
return "applied";
|
|
8305
8413
|
}
|
|
8306
8414
|
function replaceRights(prev, next, item) {
|
|
8307
8415
|
rightsPassListener?.();
|
|
@@ -8369,7 +8477,8 @@ function createCore(options) {
|
|
|
8369
8477
|
object: name,
|
|
8370
8478
|
session,
|
|
8371
8479
|
rows
|
|
8372
|
-
})
|
|
8480
|
+
}),
|
|
8481
|
+
keyQueue: void 0
|
|
8373
8482
|
});
|
|
8374
8483
|
}
|
|
8375
8484
|
const objectOf = (name) => {
|
|
@@ -8482,10 +8591,9 @@ function createCore(options) {
|
|
|
8482
8591
|
let hydration = "none";
|
|
8483
8592
|
let visible = options.visible ?? true;
|
|
8484
8593
|
let lastResumeAt;
|
|
8485
|
-
const tails = /* @__PURE__ */ new Map();
|
|
8486
8594
|
function runTail(o) {
|
|
8487
|
-
const
|
|
8488
|
-
if (
|
|
8595
|
+
const queue = o.keyQueue;
|
|
8596
|
+
if (queue === void 0 || queue.flying !== void 0) return;
|
|
8489
8597
|
const tailCause = {
|
|
8490
8598
|
reason: "requirement",
|
|
8491
8599
|
requirement: "row-unfinished"
|
|
@@ -8496,12 +8604,12 @@ function createCore(options) {
|
|
|
8496
8604
|
};
|
|
8497
8605
|
const admitted = source.admit(tailCause, tailTarget, "K3");
|
|
8498
8606
|
if (!isPermit(admitted)) return;
|
|
8499
|
-
const
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
const gen =
|
|
8504
|
-
const token = session.childToken(() =>
|
|
8607
|
+
const taken = keysTaken(queue);
|
|
8608
|
+
o.keyQueue = taken;
|
|
8609
|
+
const keys = taken.flying;
|
|
8610
|
+
if (keys === void 0) return;
|
|
8611
|
+
const gen = taken.gen;
|
|
8612
|
+
const token = session.childToken(() => o.keyQueue?.gen === gen);
|
|
8505
8613
|
const extras = {
|
|
8506
8614
|
lease: source.lease(),
|
|
8507
8615
|
kind: "keys",
|
|
@@ -8545,18 +8653,12 @@ function createCore(options) {
|
|
|
8545
8653
|
flight.lease?.release();
|
|
8546
8654
|
}
|
|
8547
8655
|
readKeys(read.source, o.entry, keys, { keysPerRequest: limits.keysPerRequest }).then((rows) => defects.has("settle-bypasses-pass") ? settleBypassingPass(rows) : settleTail(rows), () => settleTail(void 0)).finally(() => {
|
|
8548
|
-
|
|
8656
|
+
if (o.keyQueue !== void 0) o.keyQueue = flightSettled(o.keyQueue);
|
|
8549
8657
|
runTail(o);
|
|
8550
8658
|
});
|
|
8551
8659
|
}
|
|
8552
8660
|
function scheduleTail(o, keys) {
|
|
8553
|
-
|
|
8554
|
-
pending: /* @__PURE__ */ new Set(),
|
|
8555
|
-
flying: void 0,
|
|
8556
|
-
gen: 0
|
|
8557
|
-
};
|
|
8558
|
-
tails.set(o, tail);
|
|
8559
|
-
for (const key of keys) tail.pending.add(key);
|
|
8661
|
+
o.keyQueue = keysQueued(o.keyQueue ?? createKeyQueue(), keys);
|
|
8560
8662
|
runTail(o);
|
|
8561
8663
|
}
|
|
8562
8664
|
session.onFlush(() => {
|
|
@@ -8606,7 +8708,7 @@ function createCore(options) {
|
|
|
8606
8708
|
rowViews.clear();
|
|
8607
8709
|
dirtySections.clear();
|
|
8608
8710
|
dirtyObjects.clear();
|
|
8609
|
-
|
|
8711
|
+
for (const o of objects.values()) o.keyQueue = void 0;
|
|
8610
8712
|
purges.clear();
|
|
8611
8713
|
scheduled.clear();
|
|
8612
8714
|
wave = void 0;
|
|
@@ -8615,10 +8717,7 @@ function createCore(options) {
|
|
|
8615
8717
|
receiver?.stop();
|
|
8616
8718
|
});
|
|
8617
8719
|
function invalidateTail(o) {
|
|
8618
|
-
|
|
8619
|
-
if (tail === void 0) return;
|
|
8620
|
-
tail.gen++;
|
|
8621
|
-
for (const key of tail.flying ?? []) tail.pending.add(key);
|
|
8720
|
+
if (o.keyQueue !== void 0) o.keyQueue = flightInvalidated(o.keyQueue);
|
|
8622
8721
|
}
|
|
8623
8722
|
const purges = /* @__PURE__ */ new Map();
|
|
8624
8723
|
const hiddenKeys = /* @__PURE__ */ new Map();
|
|
@@ -8873,10 +8972,11 @@ function createCore(options) {
|
|
|
8873
8972
|
return due;
|
|
8874
8973
|
}
|
|
8875
8974
|
function rightsDueAt() {
|
|
8876
|
-
|
|
8877
|
-
if (
|
|
8975
|
+
const state = services.rights.targetState;
|
|
8976
|
+
if (!rightsEnabled || gate.tabHidden() || inFlight$1(state)) return void 0;
|
|
8977
|
+
if (state.refreshedAt === void 0) return void 0;
|
|
8878
8978
|
if (![...objects.values()].some((o) => o.rows.size > 0)) return void 0;
|
|
8879
|
-
return
|
|
8979
|
+
return state.refreshedAt + limits.revalidateIntervalMs;
|
|
8880
8980
|
}
|
|
8881
8981
|
let lastTickAt;
|
|
8882
8982
|
const scheduler = createScheduler({
|
|
@@ -8984,20 +9084,46 @@ function createCore(options) {
|
|
|
8984
9084
|
}, token, "version");
|
|
8985
9085
|
for (const object of turned) notifyStaleClient(object);
|
|
8986
9086
|
}
|
|
8987
|
-
|
|
8988
|
-
|
|
9087
|
+
function settleService(part, flight, outcome) {
|
|
9088
|
+
const target = services[part];
|
|
9089
|
+
settlePass(session, [{
|
|
9090
|
+
flight,
|
|
9091
|
+
outcome,
|
|
9092
|
+
...outcome === "failed" ? { failure: { error: void 0 } } : {}
|
|
9093
|
+
}], {
|
|
9094
|
+
token: session.token(),
|
|
9095
|
+
what: `service ${part}`,
|
|
9096
|
+
writeless: true,
|
|
9097
|
+
quiet: (entry) => entry.outcome === "closed",
|
|
9098
|
+
gate: (entry) => entry.outcome === "discarded-by-epoch" ? "discard" : "apply",
|
|
9099
|
+
settleTarget: (settled, result, _evidence, failure) => {
|
|
9100
|
+
settleTarget(target, settled, result, failure, { readFailed: false });
|
|
9101
|
+
}
|
|
9102
|
+
});
|
|
9103
|
+
target.targetState = slotChanged(target.targetState, { kind: "answered" });
|
|
9104
|
+
}
|
|
8989
9105
|
function startVersion(permit) {
|
|
8990
|
-
|
|
9106
|
+
services.version.targetState = startFlight(services.version.targetState, {
|
|
9107
|
+
kind: "service",
|
|
9108
|
+
cause: VERSION_UNCONFIRMED
|
|
9109
|
+
});
|
|
8991
9110
|
const token = session.token();
|
|
8992
|
-
|
|
9111
|
+
const flight = permit.flight({ kind: "service" });
|
|
9112
|
+
source.read([{ type: "version" }], flight).then(({ items }) => {
|
|
9113
|
+
settleService("version", flight, items[0]?.ok === true ? "applied" : "failed");
|
|
9114
|
+
}, (error) => {
|
|
8993
9115
|
if (token.valid) log({
|
|
8994
9116
|
kind: "listener-failed",
|
|
8995
9117
|
error
|
|
8996
9118
|
});
|
|
9119
|
+
settleService("version", flight, "failed");
|
|
8997
9120
|
}).finally(() => {
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9121
|
+
const tail = services.version.targetState.trailing;
|
|
9122
|
+
services.version.targetState = slotChanged(services.version.targetState, {
|
|
9123
|
+
kind: "freed",
|
|
9124
|
+
alive: true
|
|
9125
|
+
});
|
|
9126
|
+
if (tail === void 0) return;
|
|
9001
9127
|
core.requestVersion();
|
|
9002
9128
|
});
|
|
9003
9129
|
}
|
|
@@ -9008,8 +9134,11 @@ function createCore(options) {
|
|
|
9008
9134
|
service: "rights"
|
|
9009
9135
|
}, "S2");
|
|
9010
9136
|
if (!isPermit(admitted)) return;
|
|
9011
|
-
if (!
|
|
9012
|
-
else if (!batcher.hasQueuedRights())
|
|
9137
|
+
if (!inFlight$1(services.rights.targetState)) source.read([{ type: "rights" }], admitted.flight({ kind: "service" })).catch(() => {});
|
|
9138
|
+
else if (!batcher.hasQueuedRights()) services.rights.targetState = startFlight(services.rights.targetState, {
|
|
9139
|
+
kind: "service",
|
|
9140
|
+
cause
|
|
9141
|
+
});
|
|
9013
9142
|
}
|
|
9014
9143
|
function reconcile(why, reconcileOptions = {}, snapshotViews, services = ["version", "rights"], rightsCause = RIGHTS_UNCONFIRMED) {
|
|
9015
9144
|
if (services.includes("version")) core.requestVersion();
|
|
@@ -9056,16 +9185,16 @@ function createCore(options) {
|
|
|
9056
9185
|
}, token, "writer");
|
|
9057
9186
|
},
|
|
9058
9187
|
requestVersion() {
|
|
9059
|
-
const admitted = source.admit({
|
|
9060
|
-
reason: "requirement",
|
|
9061
|
-
requirement: "version-unconfirmed"
|
|
9062
|
-
}, {
|
|
9188
|
+
const admitted = source.admit(VERSION_UNCONFIRMED, {
|
|
9063
9189
|
kind: "service",
|
|
9064
9190
|
service: "version"
|
|
9065
9191
|
}, "S1");
|
|
9066
9192
|
if (!isPermit(admitted)) return;
|
|
9067
|
-
if (!
|
|
9068
|
-
else if (!batcher.hasQueuedVersion())
|
|
9193
|
+
if (!inFlight$1(services.version.targetState)) startVersion(admitted);
|
|
9194
|
+
else if (!batcher.hasQueuedVersion()) services.version.targetState = startFlight(services.version.targetState, {
|
|
9195
|
+
kind: "service",
|
|
9196
|
+
cause: VERSION_UNCONFIRMED
|
|
9197
|
+
});
|
|
9069
9198
|
},
|
|
9070
9199
|
requestRights: () => requestRightsFor(RIGHTS_UNCONFIRMED),
|
|
9071
9200
|
rights: () => rights,
|
|
@@ -9305,13 +9434,13 @@ function createCore(options) {
|
|
|
9305
9434
|
const waitingKeys = new Set((receiver?.waitingKeys() ?? []).map((w) => `${w.object}\u0000${w.key.toLowerCase()}`));
|
|
9306
9435
|
const retries = new Map((receiver?.minVersionRetries() ?? []).map((r) => [`${r.object}\u0000${r.key.toLowerCase()}`, r]));
|
|
9307
9436
|
for (const o of objects.values()) {
|
|
9308
|
-
const
|
|
9309
|
-
const flying = new Set(
|
|
9437
|
+
const queue = o.keyQueue;
|
|
9438
|
+
const flying = new Set(queue?.flying ?? []);
|
|
9310
9439
|
const holders = [...registry.subsets()].filter((s) => s.alive && !s.purged && s.form.object === o);
|
|
9311
9440
|
for (const key of o.rows.keys()) {
|
|
9312
9441
|
const e = o.rows.get(key);
|
|
9313
9442
|
const retry = retries.get(`${o.name}\u0000${key.toLowerCase()}`);
|
|
9314
|
-
const inTail =
|
|
9443
|
+
const inTail = isKeyQueued(queue, key);
|
|
9315
9444
|
const requirements = [];
|
|
9316
9445
|
const { minVersion, hidden, epoch } = e.stale;
|
|
9317
9446
|
if (minVersion !== void 0) requirements.push({
|
|
@@ -9329,7 +9458,7 @@ function createCore(options) {
|
|
|
9329
9458
|
if (requirements.length === 0) continue;
|
|
9330
9459
|
const tabGated = (r) => r.kind === "version-epoch-switched" || r.kind === "min-version" && retry !== void 0;
|
|
9331
9460
|
const flights = flying.has(key) ? [{ kind: "keys" }] : [];
|
|
9332
|
-
const queued =
|
|
9461
|
+
const queued = queue?.pending.includes(key) === true ? [{
|
|
9333
9462
|
kind: "keys",
|
|
9334
9463
|
cause: {
|
|
9335
9464
|
reason: "requirement",
|
|
@@ -9352,9 +9481,10 @@ function createCore(options) {
|
|
|
9352
9481
|
}
|
|
9353
9482
|
}
|
|
9354
9483
|
{
|
|
9355
|
-
const
|
|
9356
|
-
const
|
|
9357
|
-
const
|
|
9484
|
+
const state = services.version.targetState;
|
|
9485
|
+
const requirements = state.trailing === void 0 ? [] : [{ kind: "version-unconfirmed" }];
|
|
9486
|
+
const flights = inFlight$1(state) ? [{ kind: "service" }] : [];
|
|
9487
|
+
const queued = state.trailing === void 0 ? [] : [{ kind: "service" }];
|
|
9358
9488
|
record({
|
|
9359
9489
|
target: {
|
|
9360
9490
|
kind: "service",
|
|
@@ -9368,13 +9498,14 @@ function createCore(options) {
|
|
|
9368
9498
|
if (rightsEnabled) {
|
|
9369
9499
|
const requirements = [];
|
|
9370
9500
|
if (rights === void 0) requirements.push({ kind: "rights-unconfirmed" });
|
|
9371
|
-
const
|
|
9501
|
+
const state = services.rights.targetState;
|
|
9502
|
+
const flights = inFlight$1(state) ? [state.flightEpoch === void 0 ? { kind: "service" } : {
|
|
9372
9503
|
kind: "service",
|
|
9373
|
-
epoch:
|
|
9504
|
+
epoch: state.flightEpoch
|
|
9374
9505
|
}] : [];
|
|
9375
|
-
const queued =
|
|
9506
|
+
const queued = state.trailing === void 0 ? [] : [{
|
|
9376
9507
|
kind: "service",
|
|
9377
|
-
cause:
|
|
9508
|
+
cause: state.trailing
|
|
9378
9509
|
}];
|
|
9379
9510
|
record(withOptional({
|
|
9380
9511
|
target: {
|
|
@@ -9441,7 +9572,7 @@ function createCore(options) {
|
|
|
9441
9572
|
...session.epochs.sizes(),
|
|
9442
9573
|
revisions: views.revisions,
|
|
9443
9574
|
rowViews: views.views,
|
|
9444
|
-
tails: [...
|
|
9575
|
+
tails: [...objects.values()].reduce((n, o) => n + queuedKeyCount(o.keyQueue), 0),
|
|
9445
9576
|
purges: purges.size,
|
|
9446
9577
|
releaseTimers: subs.filter((s) => s.releaseTimer !== void 0).length,
|
|
9447
9578
|
preloadTimers: subs.reduce((n, s) => n + s.preloadTimers.size, 0),
|
package/dist/model/index.d.ts
CHANGED
|
@@ -3892,11 +3892,11 @@ export declare const pgEnumSchema: z.ZodObject<{
|
|
|
3892
3892
|
en: z.ZodOptional<z.ZodString>;
|
|
3893
3893
|
}, z.core.$strict>>;
|
|
3894
3894
|
id: z.ZodOptional<z.ZodUUID>;
|
|
3895
|
-
name: z.ZodString;
|
|
3896
3895
|
description: z.ZodOptional<z.ZodObject<{
|
|
3897
3896
|
uk: z.ZodOptional<z.ZodString>;
|
|
3898
3897
|
en: z.ZodOptional<z.ZodString>;
|
|
3899
3898
|
}, z.core.$strict>>;
|
|
3899
|
+
name: z.ZodString;
|
|
3900
3900
|
schema: z.ZodOptional<z.ZodString>;
|
|
3901
3901
|
$schema: z.ZodOptional<z.ZodString>;
|
|
3902
3902
|
physicalName: z.ZodOptional<z.ZodString>;
|
|
@@ -3952,11 +3952,11 @@ export declare const eventSubscriptionSchema: z.ZodObject<{
|
|
|
3952
3952
|
en: z.ZodOptional<z.ZodString>;
|
|
3953
3953
|
}, z.core.$strict>>;
|
|
3954
3954
|
id: z.ZodOptional<z.ZodUUID>;
|
|
3955
|
-
name: z.ZodString;
|
|
3956
3955
|
description: z.ZodOptional<z.ZodObject<{
|
|
3957
3956
|
uk: z.ZodOptional<z.ZodString>;
|
|
3958
3957
|
en: z.ZodOptional<z.ZodString>;
|
|
3959
3958
|
}, z.core.$strict>>;
|
|
3959
|
+
name: z.ZodString;
|
|
3960
3960
|
$schema: z.ZodOptional<z.ZodString>;
|
|
3961
3961
|
physicalName: z.ZodOptional<z.ZodString>;
|
|
3962
3962
|
}, z.core.$strict>;
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1021,7 +1021,7 @@ export declare function checkOwnerAttributes(tx: ApplyTransaction, provider: Dat
|
|
|
1021
1021
|
* тримає тест, а не читання маніфесту під час виконання: ярус не звертається
|
|
1022
1022
|
* до файлової системи.
|
|
1023
1023
|
*/
|
|
1024
|
-
export declare const PLATFORM_VERSION = "0.3.0-next.
|
|
1024
|
+
export declare const PLATFORM_VERSION = "0.3.0-next.2";
|
|
1025
1025
|
/**
|
|
1026
1026
|
* Структурний ключ таблиці для множин і мап: ім'я з крапкою не злипається зі
|
|
1027
1027
|
* схемою, як злиплося б у `schema.name`. Складені ключі підоб'єктів — так
|
|
@@ -2080,10 +2080,19 @@ export declare function readBlindFunctions(tx: ApplyTransaction, plpgsqlCheck: "
|
|
|
2080
2080
|
export declare const PLPGSQL_CHECK_MODES: readonly ["installed", "transient", "unavailable"];
|
|
2081
2081
|
type PlpgsqlCheckMode = (typeof PLPGSQL_CHECK_MODES)[number];
|
|
2082
2082
|
/**
|
|
2083
|
-
*
|
|
2084
|
-
*
|
|
2083
|
+
* Whether `plpgsql_check` is in `pg_extension` of this database (whatever
|
|
2084
|
+
* rights the role has on it) and whether the server offers it in
|
|
2085
|
+
* `pg_available_extensions`.
|
|
2085
2086
|
*/
|
|
2086
|
-
|
|
2087
|
+
interface PlpgsqlCheckPresence {
|
|
2088
|
+
installed: boolean;
|
|
2089
|
+
available: boolean;
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Наявність розширення незалежно від прав ролі на нього: звірка цілі з планом
|
|
2093
|
+
* питає лише, чи воно є в базі й чи сервер його пропонує.
|
|
2094
|
+
*/
|
|
2095
|
+
export declare function readPlpgsqlCheckPresence(tx: ApplyTransaction): Promise<PlpgsqlCheckPresence>;
|
|
2087
2096
|
/** Режим `plpgsql_check` цієї бази; `installable` — перелік пресету провайдера. */
|
|
2088
2097
|
export declare function readPlpgsqlCheckMode(tx: ApplyTransaction, installable: readonly string[]): Promise<PlpgsqlCheckMode>;
|
|
2089
2098
|
/**
|
|
@@ -3292,6 +3301,16 @@ interface PostgresClusterSet {
|
|
|
3292
3301
|
name: string;
|
|
3293
3302
|
};
|
|
3294
3303
|
}
|
|
3304
|
+
/**
|
|
3305
|
+
* Options of `ensurePostgresCluster`. `passwords` maps a login role of the set
|
|
3306
|
+
* (the owner, `auth` or a login role of `roles`) to the password that the
|
|
3307
|
+
* call sets on it, in the same transaction, only when the call creates that
|
|
3308
|
+
* role: an existing role keeps its password. The values never reach the
|
|
3309
|
+
* outcome or a diagnostic.
|
|
3310
|
+
*/
|
|
3311
|
+
interface PostgresClusterOptions {
|
|
3312
|
+
passwords?: ReadonlyMap<string, string>;
|
|
3313
|
+
}
|
|
3295
3314
|
/**
|
|
3296
3315
|
* What a call created, what it only found, and what it could not do yet.
|
|
3297
3316
|
* Roles and databases by name; the identity grants as `<schema>:USAGE` and
|
|
@@ -3309,6 +3328,8 @@ interface PostgresClusterOutcome {
|
|
|
3309
3328
|
role: string;
|
|
3310
3329
|
parents: string[];
|
|
3311
3330
|
}[];
|
|
3331
|
+
/** Created login roles that got a password from `passwords`; absent when none. */
|
|
3332
|
+
passwords?: string[];
|
|
3312
3333
|
}
|
|
3313
3334
|
/** Result of `ensurePostgresCluster`: nothing was written when it is a refusal. */
|
|
3314
3335
|
type PostgresClusterResult = {
|
|
@@ -3349,9 +3370,10 @@ interface ClusterConnections {
|
|
|
3349
3370
|
* Фаза читання нічого не пише й збирає всі відмови; фаза запису не відмовляє
|
|
3350
3371
|
* вибірково (окрім повторної перевірки `extensions` перед
|
|
3351
3372
|
* `CREATE EXTENSION`) і діє за знімком читання. Повторний виклик нічого не
|
|
3352
|
-
* створює.
|
|
3373
|
+
* створює. Розширення, якого сервер не пропонує, — відмова фази читання
|
|
3374
|
+
* `roles.extension-unavailable`, а не сира помилка `CREATE EXTENSION`.
|
|
3353
3375
|
*/
|
|
3354
|
-
export declare function ensurePostgresCluster(dbs: ApplyDatabase, conns: ClusterConnections, set: PostgresClusterSet): Promise<PostgresClusterResult>;
|
|
3376
|
+
export declare function ensurePostgresCluster(dbs: ApplyDatabase, conns: ClusterConnections, set: PostgresClusterSet, options?: PostgresClusterOptions): Promise<PostgresClusterResult>;
|
|
3355
3377
|
/** One maintenance action of the `rights-maintenance` tool (P4 spec §6.12). */
|
|
3356
3378
|
type RightsMaintenanceRequest = {
|
|
3357
3379
|
action: "firstGlobalAssignment";
|
|
@@ -4021,4 +4043,4 @@ interface StepChange {
|
|
|
4021
4043
|
* більше за `unproven`.
|
|
4022
4044
|
*/
|
|
4023
4045
|
export declare function planChange(steps: readonly Pick<PlanStep, "id" | "sql" | "verb" | "produced" | "destroyed" | "consumed">[], used: UsedObject, parse: SqlParser): StepChange | undefined;
|
|
4024
|
-
export type { AccessChange, AppliedCatalog, ApplyDatabase, ApplyDesired, ApplyRecord, ApplyState, ApplyStateObjects, ApplyTimeouts, ApplyTransaction, BackfillAction, BackfillCounts, BackfillFacts, BackfillInput, BackfillResult, BackfillTarget, BlindFunctions, CanonicalRename, CatalogFingerprint, CensusClass, CensusCount, CheckResult, ClassCoverage, ColumnName, CreatedByPlan, DataFacts, DataOrigin, DataStepKind, DataTable, DataWriter, DbConnection, DesiredComparison, DesiredState, DriftReport, DriftVerdict, EngineAction, EngineCatalog, EngineCoverage, EngineDiagnostic, EngineIdentity, EngineObjectRef, EnginePlan, EngineScope, EngineSetting, EquivalenceObject, ExecutablePlan, ExecuteAclEntry, ExecuteCrossCheckFailure, ExecuteFacts, ExecuteOptions, ExecuteOutcome, Extracted, FingerprintComparison, FingerprintSection, FolderReference, FootprintModels, FunctionError, FunctionExecuteFact, GlobalDefaultPrivilege, GuardForm, GuardProblem, GuardResult, IdentityTableFacts, ImplicitLock, LiveForeignKey, LiveTrigger, LockedTable, MarkerRecord, ModelScope, NotNullColumn, OwnerRefusalCode, ParsedPlan, PendingCarrierCopies, PermissionItem, PermissionSubject, PlanAction, PlanArtifact, PlanDatabases, PlanOutcome, PlanStep, PlannedDataTable, PlatformLoginRole, PlatformRoleOutcome, PlatformRoleRow, PlatformRoleSet, PlpgsqlCheckMode, PostgresClusterOutcome, PostgresClusterResult, PostgresClusterSet, PreservedTable, PromotionInput, PromotionSection, PropertyCount, ProviderLockSet, ProviderLockSource, ProviderLockStatement, ProviderLocks, ProviderSurface, ProviderTableName, RehearsalEvidence, RehearsalPhase, RehearsalProof, RehearsalReport, RehearsalTimings, Removal, RemovalCover, RenameIntent, RenderedStatement, ReverseOptions, ReverseResult, RightsMaintenanceDone, RightsMaintenanceRequest, RightsOrphans, RoleServer, SchemaEngine, SectionTable, SeedTargetRows, SeedVerdict, ServerFacts, ShadowEnvironment, ShadowOptions, ShadowOutcome, StatementSubject, StepChange, StepClass, StepFootprint, TableLock, TableLockMode, TransitionVerdict, TypeChange, TypeChangeDependent, TypePresence, UsedObject, WriteFacts, WritePath, WriteTable };
|
|
4046
|
+
export type { AccessChange, AppliedCatalog, ApplyDatabase, ApplyDesired, ApplyRecord, ApplyState, ApplyStateObjects, ApplyTimeouts, ApplyTransaction, BackfillAction, BackfillCounts, BackfillFacts, BackfillInput, BackfillResult, BackfillTarget, BlindFunctions, CanonicalRename, CatalogFingerprint, CensusClass, CensusCount, CheckResult, ClassCoverage, ColumnName, CreatedByPlan, DataFacts, DataOrigin, DataStepKind, DataTable, DataWriter, DbConnection, DesiredComparison, DesiredState, DriftReport, DriftVerdict, EngineAction, EngineCatalog, EngineCoverage, EngineDiagnostic, EngineIdentity, EngineObjectRef, EnginePlan, EngineScope, EngineSetting, EquivalenceObject, ExecutablePlan, ExecuteAclEntry, ExecuteCrossCheckFailure, ExecuteFacts, ExecuteOptions, ExecuteOutcome, Extracted, FingerprintComparison, FingerprintSection, FolderReference, FootprintModels, FunctionError, FunctionExecuteFact, GlobalDefaultPrivilege, GuardForm, GuardProblem, GuardResult, IdentityTableFacts, ImplicitLock, LiveForeignKey, LiveTrigger, LockedTable, MarkerRecord, ModelScope, NotNullColumn, OwnerRefusalCode, ParsedPlan, PendingCarrierCopies, PermissionItem, PermissionSubject, PlanAction, PlanArtifact, PlanDatabases, PlanOutcome, PlanStep, PlannedDataTable, PlatformLoginRole, PlatformRoleOutcome, PlatformRoleRow, PlatformRoleSet, PlpgsqlCheckMode, PlpgsqlCheckPresence, PostgresClusterOptions, PostgresClusterOutcome, PostgresClusterResult, PostgresClusterSet, PreservedTable, PromotionInput, PromotionSection, PropertyCount, ProviderLockSet, ProviderLockSource, ProviderLockStatement, ProviderLocks, ProviderSurface, ProviderTableName, RehearsalEvidence, RehearsalPhase, RehearsalProof, RehearsalReport, RehearsalTimings, Removal, RemovalCover, RenameIntent, RenderedStatement, ReverseOptions, ReverseResult, RightsMaintenanceDone, RightsMaintenanceRequest, RightsOrphans, RoleServer, SchemaEngine, SectionTable, SeedTargetRows, SeedVerdict, ServerFacts, ShadowEnvironment, ShadowOptions, ShadowOutcome, StatementSubject, StepChange, StepClass, StepFootprint, TableLock, TableLockMode, TransitionVerdict, TypeChange, TypeChangeDependent, TypePresence, UsedObject, WriteFacts, WritePath, WriteTable };
|
package/dist/schema/index.js
CHANGED
|
@@ -3893,7 +3893,7 @@ async function readSessionSearchPath(tx) {
|
|
|
3893
3893
|
* тримає тест, а не читання маніфесту під час виконання: ярус не звертається
|
|
3894
3894
|
* до файлової системи.
|
|
3895
3895
|
*/
|
|
3896
|
-
const PLATFORM_VERSION = "0.3.0-next.
|
|
3896
|
+
const PLATFORM_VERSION = "0.3.0-next.2";
|
|
3897
3897
|
// src/schema/apply/state.ts
|
|
3898
3898
|
/**
|
|
3899
3899
|
* Форма стану застосування (платформна спека §6.1). Читач приймає лише її:
|
|
@@ -9225,7 +9225,10 @@ const PLPGSQL_CHECK_MODES = [
|
|
|
9225
9225
|
"transient",
|
|
9226
9226
|
"unavailable"
|
|
9227
9227
|
];
|
|
9228
|
-
/**
|
|
9228
|
+
/**
|
|
9229
|
+
* The extension that checks function bodies when it is there; `roles` of the
|
|
9230
|
+
* postgres profile installs it (spec of the profile §3.5).
|
|
9231
|
+
*/
|
|
9229
9232
|
const PLPGSQL_CHECK = "plpgsql_check";
|
|
9230
9233
|
/** Схема тимчасового розширення й точка збереження, у якій воно живе. */
|
|
9231
9234
|
const CHECK_SCHEMA = "simetra_plpgsql_check";
|
|
@@ -9258,14 +9261,18 @@ async function readPlpgsqlCheckFacts(tx) {
|
|
|
9258
9261
|
*/
|
|
9259
9262
|
function modeOf(f, installable) {
|
|
9260
9263
|
if (f.installed) return f.schemaUsage && f.functionExecute ? "installed" : "unavailable";
|
|
9261
|
-
return f.available && f.createOnDatabase && (f.trusted || f.superuser || installable.includes(
|
|
9264
|
+
return f.available && f.createOnDatabase && (f.trusted || f.superuser || installable.includes("plpgsql_check")) ? "transient" : "unavailable";
|
|
9262
9265
|
}
|
|
9263
9266
|
/**
|
|
9264
|
-
*
|
|
9265
|
-
*
|
|
9267
|
+
* Наявність розширення незалежно від прав ролі на нього: звірка цілі з планом
|
|
9268
|
+
* питає лише, чи воно є в базі й чи сервер його пропонує.
|
|
9266
9269
|
*/
|
|
9267
|
-
async function
|
|
9268
|
-
|
|
9270
|
+
async function readPlpgsqlCheckPresence(tx) {
|
|
9271
|
+
const { installed, available } = await readPlpgsqlCheckFacts(tx);
|
|
9272
|
+
return {
|
|
9273
|
+
installed,
|
|
9274
|
+
available
|
|
9275
|
+
};
|
|
9269
9276
|
}
|
|
9270
9277
|
/** Режим `plpgsql_check` цієї бази; `installable` — перелік пресету провайдера. */
|
|
9271
9278
|
async function readPlpgsqlCheckMode(tx, installable) {
|
|
@@ -11471,7 +11478,11 @@ async function runAttempt(raw, plan, o, timeouts, applyId, parse, report) {
|
|
|
11471
11478
|
const live = await readLiveForeignKeys(tx, plan.foreignKeys.subjects);
|
|
11472
11479
|
if (canonicalize(live) !== canonicalize(plan.foreignKeys.live)) throw stop("refused", "apply.target-changed", { sections: "foreignKeys" });
|
|
11473
11480
|
}
|
|
11474
|
-
if (o.mode !== "proof" && plan.plpgsqlCheck
|
|
11481
|
+
if (o.mode !== "proof" && plan.plpgsqlCheck !== "unavailable") {
|
|
11482
|
+
const presence = await readPlpgsqlCheckPresence(tx);
|
|
11483
|
+
if (!presence.installed && !presence.available) throw stop("refused", "apply.extension-unavailable", { extension: PLPGSQL_CHECK });
|
|
11484
|
+
if (plan.plpgsqlCheck === "installed" && !presence.installed) throw stop("refused", "apply.target-changed", { sections: "plpgsqlCheck" });
|
|
11485
|
+
}
|
|
11475
11486
|
let identity;
|
|
11476
11487
|
if (o.mode !== "proof") {
|
|
11477
11488
|
const copy = o.mode === "rehearse";
|
|
@@ -13155,7 +13166,7 @@ function templateState(found) {
|
|
|
13155
13166
|
}
|
|
13156
13167
|
const EXTENSIONS_SCHEMA = "extensions";
|
|
13157
13168
|
const AUTH_SCHEMA = PROVIDER_IDENTITY_SOURCES.postgres.table.schema;
|
|
13158
|
-
const CHECK_EXTENSION =
|
|
13169
|
+
const CHECK_EXTENSION = PLPGSQL_CHECK;
|
|
13159
13170
|
/**
|
|
13160
13171
|
* The session timeouts that every transaction or session of the schema engine
|
|
13161
13172
|
* resets to 0 (off) before its own work: the target database or role may set
|
|
@@ -13211,6 +13222,26 @@ async function enterSession(tx) {
|
|
|
13211
13222
|
}
|
|
13212
13223
|
const q$1 = quoteIdent;
|
|
13213
13224
|
const literal$1 = (value) => `'${value.replaceAll("'", "''")}'`;
|
|
13225
|
+
/**
|
|
13226
|
+
* `ALTER ROLE … PASSWORD` з рядком `E'…'`, де кожен зворотний слеш і лапку
|
|
13227
|
+
* подвоєно: текст той самий за будь-якого `standard_conforming_strings`
|
|
13228
|
+
* (прелюдія його не закріплює, а звичайний рядок зі слешем він тлумачив би
|
|
13229
|
+
* по-різному).
|
|
13230
|
+
* Параметр запиту тут неможливий: `ALTER ROLE` — утиліта без параметрів.
|
|
13231
|
+
*/
|
|
13232
|
+
function rolePasswordSql(role, password) {
|
|
13233
|
+
const escaped = password.replaceAll("\\", "\\\\").replaceAll("'", "''");
|
|
13234
|
+
return `ALTER ROLE ${q$1(role)} PASSWORD E'${escaped}'`;
|
|
13235
|
+
}
|
|
13236
|
+
/**
|
|
13237
|
+
* Whether the server offers the extension `name` in `pg_available_extensions`
|
|
13238
|
+
* (its control file is on the server). The view is the same in every database
|
|
13239
|
+
* of the cluster, so the maintenance session reads it.
|
|
13240
|
+
*/
|
|
13241
|
+
async function readExtensionAvailable(tx, name) {
|
|
13242
|
+
const [row] = await tx.query(["SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_available_extensions a", " WHERE a.name = $1::text) AS available"].join("\n"), [name]);
|
|
13243
|
+
return row?.available === true;
|
|
13244
|
+
}
|
|
13214
13245
|
const CREATE_DATABASE_OPTIONS = [
|
|
13215
13246
|
`TEMPLATE ${q$1("template0")}`,
|
|
13216
13247
|
`LOCALE_PROVIDER ${DATABASE_LOCALE.provider}`,
|
|
@@ -13512,6 +13543,7 @@ async function readPhase(dbs, conns, set, maintenance) {
|
|
|
13512
13543
|
};
|
|
13513
13544
|
}
|
|
13514
13545
|
}
|
|
13546
|
+
if ((target?.checkInstalled !== true || template.state !== "sealed" && templateFacts?.checkInstalled !== true) && !await readExtensionAvailable(maintenance, CHECK_EXTENSION)) refusal.push(applyDiagnostic("roles.extension-unavailable", "error", { extension: CHECK_EXTENSION }));
|
|
13515
13547
|
if (refusal.length > 0) return {
|
|
13516
13548
|
ok: false,
|
|
13517
13549
|
error: refusal
|
|
@@ -13560,11 +13592,12 @@ async function write(dbs, conn, fn) {
|
|
|
13560
13592
|
* наступного кроку, що від нього залежить, бо інше з'єднання незакомічених
|
|
13561
13593
|
* ролей і баз не бачить.
|
|
13562
13594
|
*/
|
|
13563
|
-
async function writePhase(dbs, conns, set, snapshot) {
|
|
13595
|
+
async function writePhase(dbs, conns, set, snapshot, passwords) {
|
|
13564
13596
|
const created = [];
|
|
13565
13597
|
const present = [];
|
|
13566
13598
|
const skipped = [];
|
|
13567
13599
|
const added = [];
|
|
13600
|
+
const passworded = [];
|
|
13568
13601
|
const planned = plannedRoles(set);
|
|
13569
13602
|
const missing = planned.filter((r) => !snapshot.roles.has(r.name));
|
|
13570
13603
|
for (const r of planned) if (snapshot.roles.has(r.name)) present.push(r.name);
|
|
@@ -13572,6 +13605,11 @@ async function writePhase(dbs, conns, set, snapshot) {
|
|
|
13572
13605
|
await tx.query("SET LOCAL createrole_self_grant = ''");
|
|
13573
13606
|
for (const r of missing) {
|
|
13574
13607
|
for (const sql of r.create) await tx.query(sql);
|
|
13608
|
+
const password = passwords.get(r.name);
|
|
13609
|
+
if (password !== void 0) {
|
|
13610
|
+
await tx.query(rolePasswordSql(r.name, password));
|
|
13611
|
+
passworded.push(r.name);
|
|
13612
|
+
}
|
|
13575
13613
|
created.push(r.name);
|
|
13576
13614
|
}
|
|
13577
13615
|
for (const l of set.roles.login) {
|
|
@@ -13635,7 +13673,8 @@ async function writePhase(dbs, conns, set, snapshot) {
|
|
|
13635
13673
|
created,
|
|
13636
13674
|
present,
|
|
13637
13675
|
skipped,
|
|
13638
|
-
...added.length > 0 ? { added } : {}
|
|
13676
|
+
...added.length > 0 ? { added } : {},
|
|
13677
|
+
...passworded.length > 0 ? { passwords: passworded } : {}
|
|
13639
13678
|
};
|
|
13640
13679
|
}
|
|
13641
13680
|
/**
|
|
@@ -13645,9 +13684,13 @@ async function writePhase(dbs, conns, set, snapshot) {
|
|
|
13645
13684
|
* Фаза читання нічого не пише й збирає всі відмови; фаза запису не відмовляє
|
|
13646
13685
|
* вибірково (окрім повторної перевірки `extensions` перед
|
|
13647
13686
|
* `CREATE EXTENSION`) і діє за знімком читання. Повторний виклик нічого не
|
|
13648
|
-
* створює.
|
|
13687
|
+
* створює. Розширення, якого сервер не пропонує, — відмова фази читання
|
|
13688
|
+
* `roles.extension-unavailable`, а не сира помилка `CREATE EXTENSION`.
|
|
13649
13689
|
*/
|
|
13650
|
-
async function ensurePostgresCluster(dbs, conns, set) {
|
|
13690
|
+
async function ensurePostgresCluster(dbs, conns, set, options = {}) {
|
|
13691
|
+
const passwords = options.passwords ?? /* @__PURE__ */ new Map();
|
|
13692
|
+
const logins = new Set(simetraLogins(set).concat(set.owner));
|
|
13693
|
+
for (const role of passwords.keys()) if (!logins.has(role)) throw new Error(`a password is given for ${role}, not a login role of the set`);
|
|
13651
13694
|
try {
|
|
13652
13695
|
return await dbs.transaction(conns.maintenance, "rollback", async (maintenance) => {
|
|
13653
13696
|
const denied = await enterSession(maintenance);
|
|
@@ -13665,7 +13708,7 @@ async function ensurePostgresCluster(dbs, conns, set) {
|
|
|
13665
13708
|
if (!read.ok) return read;
|
|
13666
13709
|
return {
|
|
13667
13710
|
ok: true,
|
|
13668
|
-
value: await writePhase(dbs, conns, set, read.snapshot)
|
|
13711
|
+
value: await writePhase(dbs, conns, set, read.snapshot, passwords)
|
|
13669
13712
|
};
|
|
13670
13713
|
});
|
|
13671
13714
|
} catch (error) {
|
|
@@ -16503,4 +16546,4 @@ function cloneMismatch(engine, scope, live, copy) {
|
|
|
16503
16546
|
if (sections.length > 0) out.push(mismatch("fingerprint", sections.join(", ")));
|
|
16504
16547
|
return out;
|
|
16505
16548
|
}
|
|
16506
|
-
export { ALL_PRIVILEGES, APPLY_ADVISORY_LOCK, APPLY_STATE_FORMAT, ApplyConnectionLost, ApplyDbError, BACKFILL_SETTINGS, CANONICAL_NAME_KINDS, CLUSTER_ADVISORY_LOCK, CheckNameTaken, DATA_SETTINGS, DATA_TRIGGER_MODES, DEFAULT_APPLY_TIMEOUTS, DEFAULT_PRIVILEGE_OBJTYPES, DRIFT_PERMISSION, DRIFT_REASONS, ENGINE_ACTION_VERBS, ENGINE_PREAMBLE_ALLOWED, ENGINE_SESSION_TIMEOUTS, ENGINE_TRANSACTIONALITIES, FINGERPRINT_SECTIONS, FINGERPRINT_VERSION, FUNCTION_ERROR_LIMIT, FUNCTION_SCOPE_SQL, GUARD_PAIR_SQLSTATES, LOCK_MODE_SQL, PLAN_FORMAT, PLATFORM_VERSION, PLPGSQL_CHECK_MODES, PROVIDER_ASSUMED_SCHEMAS, PROVIDER_BASE_EXTENSIONS, PROVIDER_EVENT_TRIGGERS, PROVIDER_EXPECTED_BLIND_FUNCTIONS, PROVIDER_IDENTITY_TRIGGER_LOCKED, PROVIDER_INSTALLABLE_EXTENSIONS, PROVIDER_LOCKS, PROVIDER_LOCK_STATEMENTS, PROVIDER_PUBLIC_SCHEMA_GRANTS, PROVIDER_SHADOW_TEMPLATES, PROVIDER_SURFACES, PROVIDER_SYSTEM_ROLES, PROVIDER_UNMANAGED_EXTENSIONS, PlpgsqlCheckUnavailable, REHEARSAL_FORMAT, REHEARSAL_PHASES, RETRYABLE_SQLSTATES, STEP_CLASSES, TABLE_LOCK_MODES, UNAPPLIED_FUNCTION_SETTINGS, accessChanges, adoptedReplacements, appliedCatalog, applyStateOf, applyStateOwnership, backfillAction, backfillStepRefusals, backfillTargetKey, backfillTargets, backfillTriggers, backfillWriteTables, buildPlan, canonicalRenames, carrierBackfillSteps, castGuardForms, castProbeQuery, censusDiagnostics, checkGuardCasts, checkOwnerAttributes, checkOwnerMembership, checkPermissions, checkPlatformRoles, classifyRemovals, classifySteps, columnKey, compareFingerprints, comparePermissionItems, compareWithDesired, conditionalToPlain, copiesShadowFromTemplate, countOf, coversMode, createdByPlan, dataComputeSql, dataCountSql, dataFactRefusals, dataGuardSql, dataPlan, dataStepRefusals, dataTableStep, dataWriteSql, defaultsBeforeNotNull, desiredForApply, driftGate, engineScope, ensurePlatformRoles, ensurePostgresCluster, environmentMismatch, environmentSteps, executePlan, findApply, folderReference, footprintSubjects, footprintTables, foreignChanges, foreignSequenceRefusals, functionChangeRefusals, hasIdentityTriggers, identityTableRefusal, identityTriggerLocks, intentStep, isPlatformTrigger, isRetryable, joinModes, lintSteps, lockPrivileges, lockRightsSql, newFunctionErrors, notNullColumns, numberingNotGenerated, ownerRefusal, parsePlan, parseRehearsal, pendingCarrierCopies, planArtifactSchema, planBackfills, planChange, planFileName, planFootprint, planFunctionChecks, planLocks, planPlatformFunctions, platformReplacements, platformRoleGate, platformRoleRefusals, platformRoleSet,
|
|
16549
|
+
export { ALL_PRIVILEGES, APPLY_ADVISORY_LOCK, APPLY_STATE_FORMAT, ApplyConnectionLost, ApplyDbError, BACKFILL_SETTINGS, CANONICAL_NAME_KINDS, CLUSTER_ADVISORY_LOCK, CheckNameTaken, DATA_SETTINGS, DATA_TRIGGER_MODES, DEFAULT_APPLY_TIMEOUTS, DEFAULT_PRIVILEGE_OBJTYPES, DRIFT_PERMISSION, DRIFT_REASONS, ENGINE_ACTION_VERBS, ENGINE_PREAMBLE_ALLOWED, ENGINE_SESSION_TIMEOUTS, ENGINE_TRANSACTIONALITIES, FINGERPRINT_SECTIONS, FINGERPRINT_VERSION, FUNCTION_ERROR_LIMIT, FUNCTION_SCOPE_SQL, GUARD_PAIR_SQLSTATES, LOCK_MODE_SQL, PLAN_FORMAT, PLATFORM_VERSION, PLPGSQL_CHECK_MODES, PROVIDER_ASSUMED_SCHEMAS, PROVIDER_BASE_EXTENSIONS, PROVIDER_EVENT_TRIGGERS, PROVIDER_EXPECTED_BLIND_FUNCTIONS, PROVIDER_IDENTITY_TRIGGER_LOCKED, PROVIDER_INSTALLABLE_EXTENSIONS, PROVIDER_LOCKS, PROVIDER_LOCK_STATEMENTS, PROVIDER_PUBLIC_SCHEMA_GRANTS, PROVIDER_SHADOW_TEMPLATES, PROVIDER_SURFACES, PROVIDER_SYSTEM_ROLES, PROVIDER_UNMANAGED_EXTENSIONS, PlpgsqlCheckUnavailable, REHEARSAL_FORMAT, REHEARSAL_PHASES, RETRYABLE_SQLSTATES, STEP_CLASSES, TABLE_LOCK_MODES, UNAPPLIED_FUNCTION_SETTINGS, accessChanges, adoptedReplacements, appliedCatalog, applyStateOf, applyStateOwnership, backfillAction, backfillStepRefusals, backfillTargetKey, backfillTargets, backfillTriggers, backfillWriteTables, buildPlan, canonicalRenames, carrierBackfillSteps, castGuardForms, castProbeQuery, censusDiagnostics, checkGuardCasts, checkOwnerAttributes, checkOwnerMembership, checkPermissions, checkPlatformRoles, classifyRemovals, classifySteps, columnKey, compareFingerprints, comparePermissionItems, compareWithDesired, conditionalToPlain, copiesShadowFromTemplate, countOf, coversMode, createdByPlan, dataComputeSql, dataCountSql, dataFactRefusals, dataGuardSql, dataPlan, dataStepRefusals, dataTableStep, dataWriteSql, defaultsBeforeNotNull, desiredForApply, driftGate, engineScope, ensurePlatformRoles, ensurePostgresCluster, environmentMismatch, environmentSteps, executePlan, findApply, folderReference, footprintSubjects, footprintTables, foreignChanges, foreignSequenceRefusals, functionChangeRefusals, hasIdentityTriggers, identityTableRefusal, identityTriggerLocks, intentStep, isPlatformTrigger, isRetryable, joinModes, lintSteps, lockPrivileges, lockRightsSql, newFunctionErrors, notNullColumns, numberingNotGenerated, ownerRefusal, parsePlan, parseRehearsal, pendingCarrierCopies, planArtifactSchema, planBackfills, planChange, planFileName, planFootprint, planFunctionChecks, planLocks, planPlatformFunctions, platformReplacements, platformRoleGate, platformRoleRefusals, platformRoleSet, postgresClusterSet, predefinedSeedSql, predefinedSeedSteps, preservationPlan, preservationQuery, preservationTypeRefusals, preservationTypeStepRefusals, promotionPermissionItems, promotionTransition, propertyReproductions, providerStatement, providerStatements, providerTableNames, providerTriggerConflicts, providerTriggerInBoundarySql, providerTriggerKey, readAccessDependents, readAppliedPromotions, readApplyState, readBackfillCounts, readBlindFunctions, readDataFacts, readEquivalenceObjects, readFingerprint, readGlobalDefaultPrivileges, readLedgerHead, readLiveForeignKeys, readLiveTriggers, readLockRights, readPlatformRoles, readPlpgsqlCheckMode, readPlpgsqlCheckPresence, readPlpgsqlErrors, readProviderLocks, readSeedTargetRows, readServerFacts, readServiceAccess, readSessionSearchPath, readShadowEnvironment, readTypeChangeDependents, readTypePresence, readUserTriggers, readValidatorErrors, readWriteFacts, readWritePath, reconcileCensus, rehearsalFileName, rehearsalHash, rehearsalRefusals, rehearsalReport, rehearsalReportSchema, renameIntent, renderApplyState, renderComments, renderDesiredState, renderEnumType, renderForeignKeys, renderGlobalDefaultPrivileges, renderIndexes, renderProviderSeed, renderRowLevelSecurity, renderTable, requiredPermissions, requiredPlatformRoles, revalidationSettings, reverseGenerate, runRightsMaintenance, sameDefault, seedVerdict, serializePlan, serializeRehearsal, stampPlan, statementSubjects, statementTimeoutFromReport, stepConversions, stepFootprint, tableKey, triggerReplacements, triggerSql, typeChangeRefusals, typeGuards, typeIdentity, unclassifiedRemovals, unmodeledClasses, unrealizedRenames, updateOfNarrowings, valueElementColumns, verifyPlanHash, withLocalSettings, withNotNullChecks, withShownTriggers, withTempNames, withTriggers, writeApplyStateStatements, writeFactRefusals };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simetra",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.2",
|
|
4
4
|
"description": "Metadata-driven platform for business applications on Postgres: metamodel, compiler and schema engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"metadata",
|
|
@@ -135,6 +135,7 @@
|
|
|
135
135
|
"publishConfig": {
|
|
136
136
|
"access": "public"
|
|
137
137
|
},
|
|
138
|
+
"gitHead": "bd2da08175642d706b7879ed34da1619e20c4951",
|
|
138
139
|
"scripts": {
|
|
139
140
|
"build": "tsc --noEmit",
|
|
140
141
|
"build:package": "tsdown",
|