@vrplatform/kysely 1.3.45-stage.4368 → 1.3.45-stage.43703848639
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/build/.data.tar +2 -2
- package/build/main/camel-case/index.d.ts +4 -4
- package/build/main/camel-case/index.js +3 -2
- package/build/main/camel-case/index.js.map +1 -1
- package/build/main/connect-handoff.d.ts +12 -0
- package/build/main/connect-handoff.js +73 -0
- package/build/main/connect-handoff.js.map +1 -0
- package/build/main/control-plane/index.d.ts +413 -14
- package/build/main/control-plane/index.js +71 -0
- package/build/main/control-plane/index.js.map +1 -1
- package/build/main/domain.d.ts +4 -0
- package/build/main/domain.js +3 -0
- package/build/main/domain.js.map +1 -0
- package/build/main/error.d.ts +2 -1
- package/build/main/error.js +2 -1
- package/build/main/error.js.map +1 -1
- package/build/main/index.d.ts +57 -15
- package/build/main/index.js +498 -66
- package/build/main/index.js.map +1 -1
- package/build/main/isomorphic.d.ts +6 -6
- package/build/main/isomorphic.js +4 -8
- package/build/main/isomorphic.js.map +1 -1
- package/build/main/local/digest.d.ts +3 -3
- package/build/main/local/digest.js.map +1 -1
- package/build/main/local/generate.js +15 -13
- package/build/main/local/generate.js.map +1 -1
- package/build/main/local/index.d.ts +5 -1
- package/build/main/local/index.js +346 -12
- package/build/main/local/index.js.map +1 -1
- package/build/main/local/prune-pulled-schema.js +4 -1
- package/build/main/local/prune-pulled-schema.js.map +1 -1
- package/build/main/migration-source.d.ts +4 -0
- package/build/main/migration-source.js +45 -0
- package/build/main/migration-source.js.map +1 -0
- package/build/main/migration.d.ts +7 -0
- package/build/main/migration.js +11 -0
- package/build/main/migration.js.map +1 -0
- package/build/main/pganalyze-comment-plugin/comment-transformer.js +3 -1
- package/build/main/pganalyze-comment-plugin/comment-transformer.js.map +1 -1
- package/build/main/pganalyze-comment-plugin/index.js.map +1 -1
- package/build/main/plugins.d.ts +2 -2
- package/build/main/plugins.js.map +1 -1
- package/build/main/postgres-error.d.ts +9 -0
- package/build/main/postgres-error.js +28 -0
- package/build/main/postgres-error.js.map +1 -0
- package/build/main/query/index.d.ts +1 -0
- package/build/main/query/index.js +1 -0
- package/build/main/query/index.js.map +1 -1
- package/build/main/query/listing/status.d.ts +2 -12
- package/build/main/query/listing/status.js +35 -20
- package/build/main/query/listing/status.js.map +1 -1
- package/build/main/query/tenant/billing-partner.d.ts +4 -0
- package/build/main/query/tenant/billing-partner.js +8 -0
- package/build/main/query/tenant/billing-partner.js.map +1 -0
- package/build/main/query/tenant/feature-enabled.d.ts +6 -0
- package/build/main/query/tenant/feature-enabled.js +30 -0
- package/build/main/query/tenant/feature-enabled.js.map +1 -0
- package/build/main/query/tenant/index.d.ts +4 -0
- package/build/main/query/tenant/index.js +21 -0
- package/build/main/query/tenant/index.js.map +1 -0
- package/build/main/query/tenant/status.d.ts +9 -0
- package/build/main/query/tenant/status.js +32 -0
- package/build/main/query/tenant/status.js.map +1 -0
- package/build/main/query/tenant/where-uuid-in.d.ts +2 -0
- package/build/main/query/tenant/where-uuid-in.js +14 -0
- package/build/main/query/tenant/where-uuid-in.js.map +1 -0
- package/build/main/regional.d.ts +31 -4
- package/build/main/regional.js +69 -8
- package/build/main/regional.js.map +1 -1
- package/build/main/test/index.d.ts +21 -11
- package/build/main/test/index.js +31 -26
- package/build/main/test/index.js.map +1 -1
- package/build/main/transaction.d.ts +3 -3
- package/build/main/transaction.js.map +1 -1
- package/build/main/v1.generated.d.ts +1333 -90
- package/build/main/v1.generated.js.map +1 -1
- package/build/migrations-v2/0000000000000-baseline.ts +5 -0
- package/build/migrations-v2/0000000000001-public-audit-events-v2.ts +137 -0
- package/build/migrations-v2/0000000000002-audit-recovery-watermarks.ts +30 -0
- package/build/migrations-v2/0000000000003-audit-effect-recovery-watermark.ts +13 -0
- package/build/migrations-v2/0000000000004-audit-event-projected-at.ts +15 -0
- package/build/migrations-v2/0000000000005-audit-recovery-indexes.ts +63 -0
- package/build/migrations-v2/0000000000006-audit-action-public-event-projected-at.ts +22 -0
- package/build/migrations-v2/0000000000007-audit-action-public-event-projected-at-backfill.ts +35 -0
- package/build/migrations-v2/0000000000008-global-user-attribution.ts +33 -0
- package/build/migrations-v2/0000000000008-team-issue-rule-state.ts +52 -0
- package/build/migrations-v2/0000000000009-reservation-issue-projections.ts +45 -0
- package/build/migrations-v2/0000000000010-bank-rule-application-bank-record-delete-cascade.ts +26 -0
- package/build/migrations-v2/0000000000011-guest-balance-journal-entry-lookup-index.ts +25 -0
- package/build/migrations-v2/0000000000012-trial-free-analytics-billing-status.ts +72 -0
- package/build/migrations-v2/0000000000013-ui-permission-bundles.ts +45 -0
- package/build/migrations-v2/0000000000014-ui-permission-bundle-top-up.ts +32 -0
- package/build/migrations-v2/0000000000015-durable-flow-events.ts +163 -0
- package/build/migrations-v2/0000000000016-billing-listing-facts.ts +539 -0
- package/build/migrations-v2/0000000000016-managed-team-access.ts +34 -0
- package/build/migrations-v2/0000000000017-drop-trial-until.ts +42 -0
- package/build/migrations-v2/0000000000017-webhook-secret-reencryption-failures.ts +18 -0
- package/build/migrations-v2/0000000000018-accounting-integrity-monitoring.ts +276 -0
- package/build/migrations-v2/0000000000018-durable-flow-event-sensitive-input.ts +28 -0
- package/build/migrations-v2/0000000000019-accounting-integrity-run-shards.ts +26 -0
- package/build/migrations-v2/0000000000019-asynchronous-operations.ts +736 -0
- package/build/migrations-v2/0000000000020-accounting-integrity-case-classification.ts +52 -0
- package/build/migrations-v2/0000000000021-payment-line-classification-monitor-indexes.ts +31 -0
- package/build/migrations-v2/0000000000022-accounting-integrity-controlled-repairs.ts +281 -0
- package/build/migrations-v2/0000000000023-line-classification-usage.ts +325 -0
- package/build/migrations-v2/0000000000024-tenant-region-migration.ts +108 -0
- package/build/migrations-v2/0000000000025-partner-ach-denial-default.ts +30 -0
- package/build/migrations-v2/0000000000026-line-classification-usage-capture.ts +399 -0
- package/build/migrations-v2/0000000000027-payout-replacement-chain.ts +27 -0
- package/build/migrations-v2/0000000000028-accounting-integrity-operator-workflow.ts +108 -0
- package/build/migrations-v2/0000000000029-accounting-integrity-definition-artifacts.ts +40 -0
- package/build/migrations-v2/0000000000030-accounting-integrity-review-metadata-compatibility.ts +49 -0
- package/build/migrations-v2/0000000000031-ui-permission-role-simplification.ts +70 -0
- package/build/migrations-v2/0000000000032-tenant-delete-ownership-cascades.ts +44 -0
- package/build/migrations-v2/0000000000033-plaid-connect-session-telemetry.ts +31 -0
- package/build/migrations-v2/0000000000033-reservation-issue-seed-bucket-index.ts +19 -0
- package/build/migrations-v2/0000000000034-retire-recent-classification-indexes.ts +29 -0
- package/build/migrations-v2/0000000000035-core-change-autovacuum.ts +24 -0
- package/build/migrations-v2/0000000000036-journal-entry-inactive-reason-constraint.ts +33 -0
- package/build/migrations-v2/0000000000037-journal-entry-inactive-reasons.ts +19 -0
- package/build/{migrations/0000000000023-journal-entry-currency-mismatch-reason.ts → migrations-v2/0000000000038-journal-entry-group-inactive-reason.ts} +4 -4
- package/build/migrations-v2/0000000000039-reservation-guest-breakdown.ts +19 -0
- package/build/migrations-v2/0000000000040-csv-import-source-identity-index.ts +23 -0
- package/build/migrations-v2/0000000000041-payment-returns.ts +38 -0
- package/build/migrations-v2/0000000000042-operation-resource-types.ts +609 -0
- package/build/migrations-v2/0000000000043-reservation-journal-freshness.ts +149 -0
- package/build/migrations-v2/0000000000044-reservation-journal-freshness-backfill.ts +254 -0
- package/build/migrations-v2/0000000000045-reservation-journal-freshness-revision-repair.ts +83 -0
- package/build/migrations-v2/0000000000046-materialized-reservation-journal-operations.ts +709 -0
- package/build/migrations-v2/0000000000047-public-audit-completion.ts +77 -0
- package/build/migrations-v2/0000000000048-reservation-journal-full-refresh-repair.ts +136 -0
- package/build/migrations-v2/0000000000049-queued-journal-operation-failures.ts +60 -0
- package/build/migrations-v2/0000000000050-connection-oauth-state.ts +43 -0
- package/build/migrations-v2/0000000000051-owner-statement-email-delivery.ts +134 -0
- package/build/migrations-v2/0000000000052-fee-journal-lock-skip-operations.ts +59 -0
- package/build/migrations-v2/0000000000053-fee-journal-lock-skip-null-attempt.ts +44 -0
- package/build/migrations-v2/0000000000054-journal-refresh-issue-codes.ts +16 -0
- package/build/migrations-v2/0000000000055-tenant-billing-subscription.ts +8 -0
- package/build/migrations-v2/0000000000056-journal-operation-failure-precedence.ts +306 -0
- package/build/migrations-v2/0000000000057-journal-invalidation-failure-code.ts +28 -0
- package/build/migrations-v2/0000000000058-journal-invalidation-locked-failure.ts +16 -0
- package/build/migrations-v2/0000000000059-billing-active-listing-cross-region-partner.ts +135 -0
- package/build/migrations-v2/0000000000060-accounting-integrity-change-driven.ts +99 -0
- package/build/migrations-v2/0000000000061-tenant-pending-onboarding-status.ts +37 -0
- package/build/migrations-v2/0000000000062-statement-payout-operations.ts +16 -0
- package/build/migrations-v2/0000000000063-missing-account-assignments-issue-code.ts +13 -0
- package/build/migrations-v2/0000000000064-journal-invalidation-source-lookup-index.ts +26 -0
- package/build/migrations-v2/0000000000065-hasura-connection-event-credentials.ts +42 -0
- package/build/migrations-v2/0000000000066-recurring-fee-listing-subscription-match-by.ts +51 -0
- package/build/migrations-v2/0000000000067-connection-credential-metadata.ts +60 -0
- package/build/migrations-v2/0000000000068-connection-credential-version.ts +34 -0
- package/build/migrations-v2/0000000000069-owner-statement-contact-email-delivery.ts +84 -0
- package/build/migrations-v2/0000000000070-payment-writer-compatibility.ts +69 -0
- package/build/migrations-v2/0000000000071-payments.ts +532 -0
- package/build/migrations-v2/0000000000072-journal-entry-payment-index.ts +21 -0
- package/build/migrations-v2/0000000000073-batch-invalidation-operation-registration.ts +74 -0
- package/build/migrations-v2/0000000000074-owner-statement-email-history.ts +34 -0
- package/build/migrations-v2/0000000000075-tenant-deletion-lookup-indexes.ts +46 -0
- package/build/migrations-v2/0000000000076-tenant-onboarding-not-null.ts +23 -0
- package/build/migrations-v2/0000000000077-payment-writer-statement-attachment.ts +92 -0
- package/build/migrations-v2/0000000000078-trigger-timeout-indexes.ts +44 -0
- package/build/migrations-v2/0000000000079-core-change-tenant-statistics.ts +26 -0
- package/build/migrations-v2/0000000000080-drop-legacy-tracking-event.ts +60 -0
- package/build/migrations-v2/0000000000081-recurring-fee-planner-operation-status.ts +35 -0
- package/build/migrations-v2/0000000000082-reservation-search-trigram-indexes.ts +54 -0
- package/build/migrations-v2/0000000000083-journal-entry-deposit-lookup-index.ts +31 -0
- package/build/migrations-v2/0000000000084-journal-entry-reservation-revenue-indexes.ts +57 -0
- package/build/migrations-v2/0000000000085-owner-statement-link-email-template.ts +23 -0
- package/build/migrations-v2/0000000000086-contact-payment-setup.ts +72 -0
- package/build/migrations-v2/0000000000087-address-delete-fk-indexes.ts +30 -0
- package/build/migrations-v2/0000000000088-owner-statement-email-switch.ts +76 -0
- package/build/migrations-v2/0000000000089-contact-bank-details-requested-at.ts +21 -0
- package/build/migrations-v2/0000000000090-contact-bank-account-api-key.ts +22 -0
- package/build/migrations-v2/0000000000091-contact-bank-details-request.ts +78 -0
- package/build/migrations-v2/0000000000092-payment-provider-reference.ts +22 -0
- package/build/migrations-v2/0000000000093-payment-reversal-offline-undo.ts +18 -0
- package/build/migrations-v2/0000000000094-reservation-status-checkout-index.ts +37 -0
- package/build/migrations-v2/0000000000095-payment-batches.ts +196 -0
- package/build/migrations-v2/0000000000096-guide-ongoing-tasks-issue-codes.ts +26 -0
- package/build/migrations-v2/0000000000097-reservation-line-mapping-suggestions.ts +53 -0
- package/build/migrations-v2/0000000000098-cancelled-reservation-balances-issue-code.ts +13 -0
- package/build/migrations-v2/0000000000099-contact-bank-account-request-source.ts +28 -0
- package/build/migrations-v2/0000000000100-drop-regional-feature-flags.ts +105 -0
- package/build/migrations-v2/0000000000101-bank-record-match-source.ts +45 -0
- package/build/migrations-v2/0000000000102-owner-statement-email-one-template.ts +63 -0
- package/build/migrations-v2/0000000000103-reservation-line-mapping-update-operation.ts +10 -0
- package/build/migrations-v2/0000000000104-export-job-payment-batch-pdf.ts +12 -0
- package/build/migrations-v2/0000000000105-drop-regional-token.ts +60 -0
- package/build/migrations-v2/0000000000106-incremental-audit-action-source.ts +158 -0
- package/build/migrations-v2/0000000000107-audit-mutation-transaction-insert-index.ts +44 -0
- package/build/migrations-v2/0000000000108-reservation-stay-type.ts +24 -0
- package/build/migrations-v2/0000000000109-long-term-liabilities-category-order.ts +21 -0
- package/build/migrations-v2/0000000000110-pms-sync-failures-issue-code.ts +13 -0
- package/build/migrations-v2/0000000000110-reservation-line-type-taxable.ts +21 -0
- package/build/migrations-v2/0000000000111-reservation-line-type-suggestion-taxable.ts +20 -0
- package/build/migrations-v2/0000000000112-contact-payment-method-outside-default.ts +44 -0
- package/build/migrations-v2/0000000000113-merchant-fee-reference-assignment.ts +25 -0
- package/build/migrations-v2/0000000000114-recurring-fee-nights-filter.ts +32 -0
- package/build/migrations-v2/0000000000115-bank-records-with-suggested-rule-issue-code.ts +13 -0
- package/build/migrations-v2/0000000000116-guest-review.ts +45 -0
- package/build/migrations-v2/0000000000117-ramp-external-funding-accounts.ts +91 -0
- package/build/migrations-v2/0000000000118-pm-payout-assignment.ts +25 -0
- package/build/migrations-v2/0000000000119-chart-of-accounts-classifications.ts +46 -0
- package/build/migrations-v2/0000000000120-feedback.ts +41 -0
- package/build/migrations-v2/0000000000121-source-owner-block-calendar-index.ts +43 -0
- package/build/migrations-v2/0000000000122-recurring-fee-stay-types-filter.ts +20 -0
- package/build/migrations-v2/0000000000123-reservation-owner-stay-type-index.ts +40 -0
- package/build/migrations-v2/0000000000124-remove-tenant-test-and-billable-columns.ts +63 -0
- package/build/migrations-v2/0000000000125-ramp-application.ts +56 -0
- package/build/migrations-v2/0000000000126-advanced-deposits-update-operation.ts +10 -0
- package/build/migrations-v2/0000000000127-contact-1099-tax-details.ts +46 -0
- package/build/migrations-v2/0000000000128-tax-1099-email-templates.ts +36 -0
- package/build/migrations-v2/0000000000129-tenant-locked-at.ts +18 -0
- package/build/migrations-v2/0000000000130-second-factor-reset.ts +65 -0
- package/build/migrations-v2/0000000000131-payout-hold.ts +49 -0
- package/build/migrations-v2/0000000000132-member-invite-approval.ts +62 -0
- package/build/migrations-v2/0000000000133-audit-action-client-ip.ts +38 -0
- package/build/migrations-v2/0000000000134-drop-orphaned-hasura-triggers.ts +39 -0
- package/build/migrations-v2/0000000000135-drop-orphaned-hasura-triggers-literal.ts +42 -0
- package/build/migrations-v2/0000000000136-drop-all-hasura-triggers.ts +43 -0
- package/build/migrations-v2/0000000000137-webhook-event.ts +57 -0
- package/build/module/camel-case/index.d.ts +4 -4
- package/build/module/camel-case/index.js +4 -3
- package/build/module/camel-case/index.js.map +1 -1
- package/build/module/connect-handoff.d.ts +12 -0
- package/build/module/connect-handoff.js +70 -0
- package/build/module/connect-handoff.js.map +1 -0
- package/build/module/control-plane/index.d.ts +413 -14
- package/build/module/control-plane/index.js +58 -1
- package/build/module/control-plane/index.js.map +1 -1
- package/build/module/domain.d.ts +4 -0
- package/build/module/domain.js +2 -0
- package/build/module/domain.js.map +1 -0
- package/build/module/error.d.ts +2 -1
- package/build/module/error.js +3 -1
- package/build/module/error.js.map +1 -1
- package/build/module/index.d.ts +57 -15
- package/build/module/index.js +496 -64
- package/build/module/index.js.map +1 -1
- package/build/module/isomorphic.d.ts +6 -6
- package/build/module/isomorphic.js +2 -7
- package/build/module/isomorphic.js.map +1 -1
- package/build/module/local/digest.d.ts +3 -3
- package/build/module/local/digest.js.map +1 -1
- package/build/module/local/generate.js +15 -13
- package/build/module/local/generate.js.map +1 -1
- package/build/module/local/index.d.ts +5 -1
- package/build/module/local/index.js +347 -13
- package/build/module/local/index.js.map +1 -1
- package/build/module/local/prune-pulled-schema.js +4 -1
- package/build/module/local/prune-pulled-schema.js.map +1 -1
- package/build/module/migration-source.d.ts +4 -0
- package/build/module/migration-source.js +42 -0
- package/build/module/migration-source.js.map +1 -0
- package/build/module/migration.d.ts +7 -0
- package/build/module/migration.js +8 -0
- package/build/module/migration.js.map +1 -0
- package/build/module/pganalyze-comment-plugin/comment-transformer.js +3 -1
- package/build/module/pganalyze-comment-plugin/comment-transformer.js.map +1 -1
- package/build/module/plugins.d.ts +2 -2
- package/build/module/plugins.js.map +1 -1
- package/build/module/postgres-error.d.ts +9 -0
- package/build/module/postgres-error.js +24 -0
- package/build/module/postgres-error.js.map +1 -0
- package/build/module/query/index.d.ts +1 -0
- package/build/module/query/index.js +1 -0
- package/build/module/query/index.js.map +1 -1
- package/build/module/query/listing/status.d.ts +2 -12
- package/build/module/query/listing/status.js +35 -18
- package/build/module/query/listing/status.js.map +1 -1
- package/build/module/query/tenant/billing-partner.d.ts +4 -0
- package/build/module/query/tenant/billing-partner.js +5 -0
- package/build/module/query/tenant/billing-partner.js.map +1 -0
- package/build/module/query/tenant/feature-enabled.d.ts +6 -0
- package/build/module/query/tenant/feature-enabled.js +27 -0
- package/build/module/query/tenant/feature-enabled.js.map +1 -0
- package/build/module/query/tenant/index.d.ts +4 -0
- package/build/module/query/tenant/index.js +5 -0
- package/build/module/query/tenant/index.js.map +1 -0
- package/build/module/query/tenant/status.d.ts +9 -0
- package/build/module/query/tenant/status.js +28 -0
- package/build/module/query/tenant/status.js.map +1 -0
- package/build/module/query/tenant/where-uuid-in.d.ts +2 -0
- package/build/module/query/tenant/where-uuid-in.js +11 -0
- package/build/module/query/tenant/where-uuid-in.js.map +1 -0
- package/build/module/regional.d.ts +31 -4
- package/build/module/regional.js +68 -8
- package/build/module/regional.js.map +1 -1
- package/build/module/test/index.d.ts +21 -11
- package/build/module/test/index.js +31 -26
- package/build/module/test/index.js.map +1 -1
- package/build/module/transaction.d.ts +3 -3
- package/build/module/transaction.js.map +1 -1
- package/build/module/v1.generated.d.ts +1333 -90
- package/build/module/v1.generated.js.map +1 -1
- package/package.json +19 -16
- package/build/migrations/0000000000001-init.ts +0 -5
- package/build/migrations/0000000000009-drop-store-schema.ts +0 -14
- package/build/migrations/0000000000010-bank-rules.ts +0 -190
- package/build/migrations/0000000000011-bank-rule-line-adjustments.ts +0 -65
- package/build/migrations/0000000000012-bank-rule-conditions.ts +0 -45
- package/build/migrations/0000000000013-bank-rule-name-unique.ts +0 -15
- package/build/migrations/0000000000014-bank-rule-drop-legacy-conditions.ts +0 -41
- package/build/migrations/0000000000015-booking-channel-logo-dev-provider.ts +0 -70
- package/build/migrations/0000000000016-owner-statement-draft-status.ts +0 -22
- package/build/migrations/0000000000017-tenant-migration-markers.ts +0 -18
- package/build/migrations/0000000000018-security-deposits-payable-category.ts +0 -63
- package/build/migrations/0000000000019-tenant-app-settings.ts +0 -76
- package/build/migrations/0000000000020-operating-opening-trial-balance.ts +0 -36
- package/build/migrations/0000000000021-audit-foreign-key-indexes.ts +0 -77
- package/build/migrations/0000000000022-opening-trial-balance-combined-columns.ts +0 -30
- package/build/migrations/0000000000024-listing-parent.ts +0 -37
- package/build/migrations/0000000000025-journal-entry-parent-listing.ts +0 -26
- package/build/migrations/0000000000026-booking-channel-logo-slots.ts +0 -89
- package/build/migrations/0000000000027-list-browse-performance-indexes.ts +0 -52
- package/build/migrations/0000000000028-flow-setting-status-jsonb.ts +0 -20
- package/build/migrations/0000000000029-tenant-slug.ts +0 -328
- package/build/migrations/0000000000030-pms-accounting-windows.ts +0 -50
- package/build/migrations/0000000000031-owner-statement-projection-listing-revision.ts +0 -20
- package/build/migrations/0000000000032-flow-event-listening.ts +0 -28
- package/build/migrations/0000000000033-opening-trial-balance-transaction.ts +0 -272
- package/build/migrations/0000000000034-historic-general-ledger.ts +0 -24
- package/build/migrations/0000000000035-tenant-regional-placement.ts +0 -37
- package/build/migrations/0000000000036-control-plane-projection-events.ts +0 -43
- package/build/migrations/0000000000037-tenant-guide-onboarding.ts +0 -21
- package/build/migrations/0000000000038-tracking-event-analytics-sink.ts +0 -31
- package/build/migrations/0000000000039-crunchy-region.ts +0 -86
- package/build/migrations/0000000000040-hostaway-region.ts +0 -72
- package/build/migrations/0000000000041-audit-tenant-fk.ts +0 -66
- package/build/migrations/0000000000042-ramp-staging-connect-params.ts +0 -35
- package/build/migrations/0000000000043-gl-pms-accounting-window-guard.ts +0 -125
- package/build/migrations/0000000000044-tenant-cross-region-fks.ts +0 -45
- package/build/migrations/0000000000045-cloudflare-region-env.ts +0 -100
- package/build/migrations/0000000000046-control-plane-outbox-alias.ts +0 -46
- package/build/migrations/0000000000047-ramp-contact-last-4-digits.ts +0 -16
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
// Hasura's tracking_connection trigger copies the whole connection row,
|
|
5
|
+
// including credentials, into hdb_catalog.event_log. Hasura regenerates its own
|
|
6
|
+
// trigger functions from metadata, so the credentials are stripped on the
|
|
7
|
+
// event_log insert instead. The webhook consumer reads id, tenant_id, app_id and
|
|
8
|
+
// status only.
|
|
9
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
10
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
11
|
+
|
|
12
|
+
await sql`
|
|
13
|
+
create or replace function public.strip_connection_event_credentials()
|
|
14
|
+
returns trigger
|
|
15
|
+
language plpgsql
|
|
16
|
+
as $$
|
|
17
|
+
begin
|
|
18
|
+
new.payload := new.payload #- '{data,old,credentials}' #- '{data,new,credentials}';
|
|
19
|
+
return new;
|
|
20
|
+
end;
|
|
21
|
+
$$
|
|
22
|
+
`.execute(db);
|
|
23
|
+
await sql`
|
|
24
|
+
drop trigger if exists strip_connection_credentials on hdb_catalog.event_log
|
|
25
|
+
`.execute(db);
|
|
26
|
+
await sql`
|
|
27
|
+
create trigger strip_connection_credentials
|
|
28
|
+
before insert on hdb_catalog.event_log
|
|
29
|
+
for each row
|
|
30
|
+
when (new.schema_name = 'public' and new.table_name = 'connection')
|
|
31
|
+
execute function public.strip_connection_event_credentials()
|
|
32
|
+
`.execute(db);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
36
|
+
await sql`
|
|
37
|
+
drop trigger if exists strip_connection_credentials on hdb_catalog.event_log
|
|
38
|
+
`.execute(db);
|
|
39
|
+
await sql`
|
|
40
|
+
drop function if exists public.strip_connection_event_credentials()
|
|
41
|
+
`.execute(db);
|
|
42
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
// Each listing period of a recurring fee chooses whether reservations match its
|
|
5
|
+
// dates by stay date (posting date of the fee) or by booked date. Expand only:
|
|
6
|
+
// existing rows default to stay date, which is today's behavior. A stay date
|
|
7
|
+
// and a booked date period of one fee and listing may start on the same date,
|
|
8
|
+
// so the unique start date includes the basis.
|
|
9
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
10
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
11
|
+
await sql`set local statement_timeout = '120s'`.execute(db);
|
|
12
|
+
|
|
13
|
+
await sql`
|
|
14
|
+
do $$
|
|
15
|
+
begin
|
|
16
|
+
create type public.recurring_fee_listing_subscription_match_by
|
|
17
|
+
as enum ('stayDate', 'bookedDate');
|
|
18
|
+
exception when duplicate_object then null;
|
|
19
|
+
end $$
|
|
20
|
+
`.execute(db);
|
|
21
|
+
|
|
22
|
+
await sql`
|
|
23
|
+
alter table public.recurring_fee_listing_subscription
|
|
24
|
+
add column if not exists match_by
|
|
25
|
+
public.recurring_fee_listing_subscription_match_by
|
|
26
|
+
not null default 'stayDate'
|
|
27
|
+
`.execute(db);
|
|
28
|
+
|
|
29
|
+
await sql`
|
|
30
|
+
alter table public.recurring_fee_listing_subscription
|
|
31
|
+
drop constraint recurring_fee_listing_subscription_recurring_fee_id_listing_id_,
|
|
32
|
+
add constraint recurring_fee_listing_subscription_recurring_fee_id_listing_id_
|
|
33
|
+
unique (recurring_fee_id, listing_id, match_by, start_at)
|
|
34
|
+
`.execute(db);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
38
|
+
await sql`
|
|
39
|
+
alter table public.recurring_fee_listing_subscription
|
|
40
|
+
drop constraint recurring_fee_listing_subscription_recurring_fee_id_listing_id_,
|
|
41
|
+
add constraint recurring_fee_listing_subscription_recurring_fee_id_listing_id_
|
|
42
|
+
unique (recurring_fee_id, listing_id, start_at)
|
|
43
|
+
`.execute(db);
|
|
44
|
+
await sql`
|
|
45
|
+
alter table public.recurring_fee_listing_subscription
|
|
46
|
+
drop column if exists match_by
|
|
47
|
+
`.execute(db);
|
|
48
|
+
await sql`
|
|
49
|
+
drop type if exists public.recurring_fee_listing_subscription_match_by
|
|
50
|
+
`.execute(db);
|
|
51
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type Kysely, sql } from 'kysely';
|
|
2
|
+
|
|
3
|
+
export async function up(kysely: Kysely<unknown>) {
|
|
4
|
+
await sql`set local lock_timeout = '5s'`.execute(kysely);
|
|
5
|
+
await sql`alter table public.connection add column if not exists credential_metadata jsonb`.execute(
|
|
6
|
+
kysely
|
|
7
|
+
);
|
|
8
|
+
// The trigger covers deployed writers during the reader cutover. Only known
|
|
9
|
+
// environment labels and numeric expiry are metadata; provider payloads stay private.
|
|
10
|
+
await sql`
|
|
11
|
+
create or replace function public.connection_credential_metadata(value jsonb)
|
|
12
|
+
returns jsonb language sql immutable parallel safe as $function$
|
|
13
|
+
select case when value is null then null else jsonb_strip_nulls(jsonb_build_object(
|
|
14
|
+
'environment', case when value ->> 'environment' in ('sandbox', 'development', 'production', 'demo')
|
|
15
|
+
then value -> 'environment' else null end,
|
|
16
|
+
'invalidEnvironment', case when value ->> 'environment' is not null
|
|
17
|
+
and value ->> 'environment' not in ('sandbox', 'development', 'production', 'demo') then true else null end,
|
|
18
|
+
'_exposix', case when jsonb_typeof(value -> '_exposix') = 'number'
|
|
19
|
+
then value -> '_exposix' else null end
|
|
20
|
+
)) end
|
|
21
|
+
$function$
|
|
22
|
+
`.execute(kysely);
|
|
23
|
+
await sql`
|
|
24
|
+
create or replace function public.mirror_connection_credential_metadata()
|
|
25
|
+
returns trigger language plpgsql as $function$
|
|
26
|
+
begin
|
|
27
|
+
new.credential_metadata := public.connection_credential_metadata(new.credentials);
|
|
28
|
+
return new;
|
|
29
|
+
end;
|
|
30
|
+
$function$
|
|
31
|
+
`.execute(kysely);
|
|
32
|
+
await sql`drop trigger if exists mirror_connection_credential_metadata on public.connection`.execute(
|
|
33
|
+
kysely
|
|
34
|
+
);
|
|
35
|
+
await sql`create trigger mirror_connection_credential_metadata
|
|
36
|
+
before insert or update of credentials on public.connection
|
|
37
|
+
for each row execute function public.mirror_connection_credential_metadata()`.execute(
|
|
38
|
+
kysely
|
|
39
|
+
);
|
|
40
|
+
await sql`update public.connection
|
|
41
|
+
set credential_metadata = public.connection_credential_metadata(credentials)
|
|
42
|
+
where credential_metadata is distinct from public.connection_credential_metadata(credentials)`.execute(
|
|
43
|
+
kysely
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function down(kysely: Kysely<unknown>) {
|
|
48
|
+
await sql`drop trigger if exists mirror_connection_credential_metadata on public.connection`.execute(
|
|
49
|
+
kysely
|
|
50
|
+
);
|
|
51
|
+
await sql`drop function if exists public.mirror_connection_credential_metadata()`.execute(
|
|
52
|
+
kysely
|
|
53
|
+
);
|
|
54
|
+
await sql`drop function if exists public.connection_credential_metadata(jsonb)`.execute(
|
|
55
|
+
kysely
|
|
56
|
+
);
|
|
57
|
+
await sql`alter table public.connection drop column if exists credential_metadata`.execute(
|
|
58
|
+
kysely
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Kysely, sql } from 'kysely';
|
|
2
|
+
|
|
3
|
+
export async function up(kysely: Kysely<unknown>) {
|
|
4
|
+
await sql`set local lock_timeout = '5s'`.execute(kysely);
|
|
5
|
+
await sql`alter table public.connection add column if not exists credential_version bigint not null default 0`.execute(
|
|
6
|
+
kysely
|
|
7
|
+
);
|
|
8
|
+
await sql`create or replace function public.advance_connection_credential_version()
|
|
9
|
+
returns trigger language plpgsql as $function$
|
|
10
|
+
begin
|
|
11
|
+
new.credential_version := old.credential_version + 1;
|
|
12
|
+
return new;
|
|
13
|
+
end;
|
|
14
|
+
$function$`.execute(kysely);
|
|
15
|
+
await sql`drop trigger if exists advance_connection_credential_version on public.connection`.execute(
|
|
16
|
+
kysely
|
|
17
|
+
);
|
|
18
|
+
await sql`create trigger advance_connection_credential_version before update of credentials on public.connection
|
|
19
|
+
for each row execute function public.advance_connection_credential_version()`.execute(
|
|
20
|
+
kysely
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function down(kysely: Kysely<unknown>) {
|
|
25
|
+
await sql`drop trigger if exists advance_connection_credential_version on public.connection`.execute(
|
|
26
|
+
kysely
|
|
27
|
+
);
|
|
28
|
+
await sql`drop function if exists public.advance_connection_credential_version()`.execute(
|
|
29
|
+
kysely
|
|
30
|
+
);
|
|
31
|
+
await sql`alter table public.connection drop column if exists credential_version`.execute(
|
|
32
|
+
kysely
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
// Expand only: deliveries can target an owner contact instead of a portal user,
|
|
5
|
+
// skipped owners get a terminal record, and contacts can opt out of statement
|
|
6
|
+
// emails. Every existing writer keeps setting user_id, which the new checks
|
|
7
|
+
// accept. The checks avoid the new enum values, which PostgreSQL forbids in
|
|
8
|
+
// the transaction that adds them.
|
|
9
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
10
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
11
|
+
await sql`set local statement_timeout = '60s'`.execute(db);
|
|
12
|
+
|
|
13
|
+
await sql`
|
|
14
|
+
alter type core.email_delivery_status add value if not exists 'skipped'
|
|
15
|
+
`.execute(db);
|
|
16
|
+
await sql`
|
|
17
|
+
alter type core.email_delivery_failure_code
|
|
18
|
+
add value if not exists 'missing_email'
|
|
19
|
+
`.execute(db);
|
|
20
|
+
await sql`
|
|
21
|
+
alter type core.email_delivery_failure_code
|
|
22
|
+
add value if not exists 'unsubscribed'
|
|
23
|
+
`.execute(db);
|
|
24
|
+
|
|
25
|
+
await sql`
|
|
26
|
+
alter table core.email_delivery
|
|
27
|
+
alter column user_id drop not null,
|
|
28
|
+
add column if not exists contact_id uuid,
|
|
29
|
+
add column if not exists recipient_email text,
|
|
30
|
+
add constraint email_delivery_recipient_check check (
|
|
31
|
+
num_nonnulls(user_id, contact_id) = 1
|
|
32
|
+
),
|
|
33
|
+
drop constraint email_delivery_terminal_check,
|
|
34
|
+
add constraint email_delivery_terminal_check check (
|
|
35
|
+
(status in ('queued', 'sending', 'retrying')) = (finished_at is null)
|
|
36
|
+
),
|
|
37
|
+
drop constraint email_delivery_failure_check,
|
|
38
|
+
add constraint email_delivery_failure_check check (
|
|
39
|
+
status in ('queued', 'sending', 'retrying', 'accepted', 'canceled')
|
|
40
|
+
or failure_code is not null
|
|
41
|
+
)
|
|
42
|
+
`.execute(db);
|
|
43
|
+
await sql`
|
|
44
|
+
create unique index if not exists email_delivery_notification_contact_key
|
|
45
|
+
on core.email_delivery (notification_id, contact_id)
|
|
46
|
+
where contact_id is not null
|
|
47
|
+
`.execute(db);
|
|
48
|
+
|
|
49
|
+
await sql`
|
|
50
|
+
alter table accounting.contact
|
|
51
|
+
add column if not exists statement_email_unsubscribed_at timestamptz
|
|
52
|
+
`.execute(db);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Enum additions are retained so historical deliveries remain readable.
|
|
56
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
57
|
+
await sql`
|
|
58
|
+
alter table accounting.contact
|
|
59
|
+
drop column if exists statement_email_unsubscribed_at
|
|
60
|
+
`.execute(db);
|
|
61
|
+
await sql`
|
|
62
|
+
drop index if exists core.email_delivery_notification_contact_key
|
|
63
|
+
`.execute(db);
|
|
64
|
+
await sql`
|
|
65
|
+
delete from core.email_delivery where user_id is null
|
|
66
|
+
`.execute(db);
|
|
67
|
+
await sql`
|
|
68
|
+
alter table core.email_delivery
|
|
69
|
+
drop constraint email_delivery_failure_check,
|
|
70
|
+
add constraint email_delivery_failure_check check (
|
|
71
|
+
status not in ('rejected', 'failed') or failure_code is not null
|
|
72
|
+
),
|
|
73
|
+
drop constraint email_delivery_terminal_check,
|
|
74
|
+
add constraint email_delivery_terminal_check check (
|
|
75
|
+
(status in ('accepted', 'rejected', 'failed', 'canceled')
|
|
76
|
+
and finished_at is not null)
|
|
77
|
+
or (status in ('queued', 'sending', 'retrying') and finished_at is null)
|
|
78
|
+
),
|
|
79
|
+
drop constraint email_delivery_recipient_check,
|
|
80
|
+
drop column if exists recipient_email,
|
|
81
|
+
drop column if exists contact_id,
|
|
82
|
+
alter column user_id set not null
|
|
83
|
+
`.execute(db);
|
|
84
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
6
|
+
await sql`set local statement_timeout = '60s'`.execute(db);
|
|
7
|
+
await sql`
|
|
8
|
+
create function accounting.require_payment_writer() returns trigger
|
|
9
|
+
language plpgsql as $$
|
|
10
|
+
declare
|
|
11
|
+
target record;
|
|
12
|
+
has_payments boolean;
|
|
13
|
+
begin
|
|
14
|
+
if current_setting('accounting.payment_writer_version', true) = '1'
|
|
15
|
+
or to_regclass('accounting.payment') is null then
|
|
16
|
+
if tg_op = 'DELETE' then return old; else return new; end if;
|
|
17
|
+
end if;
|
|
18
|
+
for target in
|
|
19
|
+
select distinct (value ->> 'tenant_id')::uuid as tenant_id,
|
|
20
|
+
(case when tg_table_name = 'transaction' then value ->> 'id'
|
|
21
|
+
else value ->> 'transaction_id' end)::uuid as transaction_id
|
|
22
|
+
from jsonb_array_elements(jsonb_build_array(to_jsonb(old), to_jsonb(new)))
|
|
23
|
+
where value is not null and value <> 'null'::jsonb
|
|
24
|
+
order by tenant_id, transaction_id
|
|
25
|
+
loop
|
|
26
|
+
if target.transaction_id is null then continue; end if;
|
|
27
|
+
-- Payment creation locks this same row before inserting its evidence.
|
|
28
|
+
perform id from accounting.transaction
|
|
29
|
+
where id = target.transaction_id and tenant_id = target.tenant_id for update;
|
|
30
|
+
execute 'select exists (select 1 from accounting.payment
|
|
31
|
+
where tenant_id = $1 and transaction_id = $2)'
|
|
32
|
+
into has_payments using target.tenant_id, target.transaction_id;
|
|
33
|
+
if has_payments then
|
|
34
|
+
raise exception using errcode = '23514', constraint = 'payment_writer_compatibility',
|
|
35
|
+
message = 'This transaction requires a deployment with payments support',
|
|
36
|
+
detail = jsonb_build_object('tenantId', target.tenant_id,
|
|
37
|
+
'transactionId', target.transaction_id)::text;
|
|
38
|
+
end if;
|
|
39
|
+
end loop;
|
|
40
|
+
if tg_op = 'DELETE' then return old; else return new; end if;
|
|
41
|
+
end $$
|
|
42
|
+
`.execute(db);
|
|
43
|
+
for (const table of [
|
|
44
|
+
'transaction',
|
|
45
|
+
'transaction_line',
|
|
46
|
+
'journal_entry',
|
|
47
|
+
'bank_record_transaction_payment',
|
|
48
|
+
]) {
|
|
49
|
+
await sql`
|
|
50
|
+
create trigger payment_writer_compatibility before insert or update or delete
|
|
51
|
+
on ${sql.table(`accounting.${table}`)}
|
|
52
|
+
for each row execute function accounting.require_payment_writer()
|
|
53
|
+
`.execute(db);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
58
|
+
for (const table of [
|
|
59
|
+
'transaction',
|
|
60
|
+
'transaction_line',
|
|
61
|
+
'journal_entry',
|
|
62
|
+
'bank_record_transaction_payment',
|
|
63
|
+
]) {
|
|
64
|
+
await sql`drop trigger payment_writer_compatibility on ${sql.table(`accounting.${table}`)}`.execute(
|
|
65
|
+
db
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
await sql`drop function accounting.require_payment_writer()`.execute(db);
|
|
69
|
+
}
|