@vrplatform/kysely 1.3.45-4459 → 1.3.45-44604174374
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 +421 -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 +1407 -177
- 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/migrations-v2/0000000000138-contact-tax-details-requested-at.ts +24 -0
- package/build/migrations-v2/0000000000139-tax-statement-1099.ts +140 -0
- package/build/migrations-v2/0000000000140-owner-payment-settings.ts +53 -0
- package/build/migrations-v2/0000000000141-owner-payment-requests.ts +100 -0
- package/build/migrations-v2/0000000000148-statement-level-operation-triggers.ts +229 -0
- package/build/migrations-v2/0000000000150-recurring-fee-listing-subscription-listing-index.ts +37 -0
- package/build/migrations-v2/0000000000151-core-change-unused-indexes.ts +85 -0
- package/build/migrations-v2/0000000000152-core-change-pms-sync-failures-index.ts +38 -0
- package/build/migrations-v2/0000000000154-accounting-integrity-backlog-performance.ts +68 -0
- package/build/migrations-v2/0000000000155-source-last-successful-hash.ts +23 -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 +421 -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 +1407 -177
- 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
- package/build/migrations/0000000000047-tenant-status-backfill.ts +0 -40
- package/build/migrations/0000000000048-tenant-status-constraint.ts +0 -24
- package/build/migrations/0000000000049-health-tenant-issues.ts +0 -69
- package/build/migrations/0000000000050-partner-webhooks.ts +0 -135
- package/build/migrations/0000000000051-health-webhook-runtime-grants.ts +0 -42
- package/build/migrations/0000000000052-feature-approval-team-enablement.ts +0 -13
- package/build/migrations/0000000000053-health-webhook-enums.ts +0 -296
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { sql } from 'kysely';
|
|
2
|
+
// Rows never belong to a user, so no authenticated user can claim one through
|
|
3
|
+
// the OAuth state flow that shares the table.
|
|
4
|
+
const handoffUserId = '00000000-0000-0000-0000-000000000000';
|
|
5
|
+
const handoffRefPattern = /^handoff_[A-Za-z0-9_-]{22}$/;
|
|
6
|
+
async function hashRef(ref) {
|
|
7
|
+
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(ref));
|
|
8
|
+
return [...new Uint8Array(digest)]
|
|
9
|
+
.map((byte) => byte.toString(16).padStart(2, '0'))
|
|
10
|
+
.join('');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Passes secrets between the API and Trigger.dev tasks through the tenant's
|
|
14
|
+
* database, so connect credentials never enter Trigger.dev payloads or outputs.
|
|
15
|
+
* Rows expire after one hour, the lifetime of a reused connect run. Reads do not
|
|
16
|
+
* consume the row: a retried or reused run must still find it.
|
|
17
|
+
*/
|
|
18
|
+
export function useConnectHandoff(kysely, tenantId) {
|
|
19
|
+
return {
|
|
20
|
+
async put(appId, value) {
|
|
21
|
+
const bytes = crypto.getRandomValues(new Uint8Array(16));
|
|
22
|
+
const ref = `handoff_${btoa(String.fromCharCode(...bytes))
|
|
23
|
+
.replaceAll('+', '-')
|
|
24
|
+
.replaceAll('/', '_')
|
|
25
|
+
.replaceAll('=', '')}`;
|
|
26
|
+
await kysely
|
|
27
|
+
.deleteFrom('public.connectionOauthState')
|
|
28
|
+
.where('stateHash', 'in', kysely
|
|
29
|
+
.selectFrom('public.connectionOauthState')
|
|
30
|
+
.select('stateHash')
|
|
31
|
+
.where('expiresAt', '<=', sql `clock_timestamp()`)
|
|
32
|
+
.orderBy('expiresAt')
|
|
33
|
+
.limit(100)
|
|
34
|
+
.forUpdate()
|
|
35
|
+
.skipLocked())
|
|
36
|
+
.execute();
|
|
37
|
+
// Transient authentication coordination is excluded from business audit:
|
|
38
|
+
// references, setup parameters and credentials must never be audited.
|
|
39
|
+
await kysely
|
|
40
|
+
.insertInto('public.connectionOauthState')
|
|
41
|
+
.values({
|
|
42
|
+
stateHash: await hashRef(ref),
|
|
43
|
+
tenantId,
|
|
44
|
+
userId: handoffUserId,
|
|
45
|
+
appId,
|
|
46
|
+
connectionId: null,
|
|
47
|
+
params: value,
|
|
48
|
+
redirectUri: '',
|
|
49
|
+
expiresAt: sql `clock_timestamp() + interval '1 hour'`,
|
|
50
|
+
})
|
|
51
|
+
.execute();
|
|
52
|
+
return ref;
|
|
53
|
+
},
|
|
54
|
+
async get(ref, appId) {
|
|
55
|
+
if (!handoffRefPattern.test(ref))
|
|
56
|
+
return undefined;
|
|
57
|
+
const row = await kysely
|
|
58
|
+
.selectFrom('public.connectionOauthState')
|
|
59
|
+
.select('params')
|
|
60
|
+
.where('stateHash', '=', await hashRef(ref))
|
|
61
|
+
.where('tenantId', '=', tenantId)
|
|
62
|
+
.where('appId', '=', appId)
|
|
63
|
+
.where('userId', '=', handoffUserId)
|
|
64
|
+
.where('expiresAt', '>', sql `clock_timestamp()`)
|
|
65
|
+
.executeTakeFirst();
|
|
66
|
+
return row?.params;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=connect-handoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-handoff.js","sourceRoot":"src/","sources":["connect-handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAI7B,8EAA8E;AAC9E,8CAA8C;AAC9C,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAC7D,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAExD,KAAK,UAAU,OAAO,CAAC,GAAW;IAChC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CACvC,SAAS,EACT,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAC9B,CAAC;IACF,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SAC/B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SACjD,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,QAAgB;IAChE,OAAO;QACL,KAAK,CAAC,GAAG,CAAC,KAAa,EAAE,KAAiB;YACxC,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;YACzD,MAAM,GAAG,GAAG,WAAW,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,CAAC;iBACvD,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;iBACpB,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;iBACpB,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC;YACzB,MAAM,MAAM;iBACT,UAAU,CAAC,6BAA6B,CAAC;iBACzC,KAAK,CACJ,WAAW,EACX,IAAI,EACJ,MAAM;iBACH,UAAU,CAAC,6BAA6B,CAAC;iBACzC,MAAM,CAAC,WAAW,CAAC;iBACnB,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,GAAG,CAAQ,mBAAmB,CAAC;iBACxD,OAAO,CAAC,WAAW,CAAC;iBACpB,KAAK,CAAC,GAAG,CAAC;iBACV,SAAS,EAAE;iBACX,UAAU,EAAE,CAChB;iBACA,OAAO,EAAE,CAAC;YACb,yEAAyE;YACzE,sEAAsE;YACtE,MAAM,MAAM;iBACT,UAAU,CAAC,6BAA6B,CAAC;iBACzC,MAAM,CAAC;gBACN,SAAS,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC7B,QAAQ;gBACR,MAAM,EAAE,aAAa;gBACrB,KAAK;gBACL,YAAY,EAAE,IAAI;gBAClB,MAAM,EAAE,KAAK;gBACb,WAAW,EAAE,EAAE;gBACf,SAAS,EAAE,GAAG,CAAA,uCAAuC;aACtD,CAAC;iBACD,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,CAAC;QACb,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAa;YAClC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC;gBAAE,OAAO,SAAS,CAAC;YACnD,MAAM,GAAG,GAAG,MAAM,MAAM;iBACrB,UAAU,CAAC,6BAA6B,CAAC;iBACzC,MAAM,CAAC,QAAQ,CAAC;iBAChB,KAAK,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;iBAC3C,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,CAAC;iBAChC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC;iBAC1B,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,CAAC;iBACnC,KAAK,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,CAAQ,mBAAmB,CAAC;iBACvD,gBAAgB,EAAE,CAAC;YACtB,OAAO,GAAG,EAAE,MAAM,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { sql } from 'kysely';\nimport type { Kysely } from './index';\nimport type { JsonObject } from './v1.generated';\n\n// Rows never belong to a user, so no authenticated user can claim one through\n// the OAuth state flow that shares the table.\nconst handoffUserId = '00000000-0000-0000-0000-000000000000';\nconst handoffRefPattern = /^handoff_[A-Za-z0-9_-]{22}$/;\n\nasync function hashRef(ref: string) {\n const digest = await crypto.subtle.digest(\n 'SHA-256',\n new TextEncoder().encode(ref)\n );\n return [...new Uint8Array(digest)]\n .map((byte) => byte.toString(16).padStart(2, '0'))\n .join('');\n}\n\n/**\n * Passes secrets between the API and Trigger.dev tasks through the tenant's\n * database, so connect credentials never enter Trigger.dev payloads or outputs.\n * Rows expire after one hour, the lifetime of a reused connect run. Reads do not\n * consume the row: a retried or reused run must still find it.\n */\nexport function useConnectHandoff(kysely: Kysely, tenantId: string) {\n return {\n async put(appId: string, value: JsonObject) {\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n const ref = `handoff_${btoa(String.fromCharCode(...bytes))\n .replaceAll('+', '-')\n .replaceAll('/', '_')\n .replaceAll('=', '')}`;\n await kysely\n .deleteFrom('public.connectionOauthState')\n .where(\n 'stateHash',\n 'in',\n kysely\n .selectFrom('public.connectionOauthState')\n .select('stateHash')\n .where('expiresAt', '<=', sql<string>`clock_timestamp()`)\n .orderBy('expiresAt')\n .limit(100)\n .forUpdate()\n .skipLocked()\n )\n .execute();\n // Transient authentication coordination is excluded from business audit:\n // references, setup parameters and credentials must never be audited.\n await kysely\n .insertInto('public.connectionOauthState')\n .values({\n stateHash: await hashRef(ref),\n tenantId,\n userId: handoffUserId,\n appId,\n connectionId: null,\n params: value,\n redirectUri: '',\n expiresAt: sql`clock_timestamp() + interval '1 hour'`,\n })\n .execute();\n return ref;\n },\n async get(ref: string, appId: string) {\n if (!handoffRefPattern.test(ref)) return undefined;\n const row = await kysely\n .selectFrom('public.connectionOauthState')\n .select('params')\n .where('stateHash', '=', await hashRef(ref))\n .where('tenantId', '=', tenantId)\n .where('appId', '=', appId)\n .where('userId', '=', handoffUserId)\n .where('expiresAt', '>', sql<string>`clock_timestamp()`)\n .executeTakeFirst();\n return row?.params;\n },\n };\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ColumnType, type Kysely } from 'kysely';
|
|
2
|
+
import type { TenantDataRegion } from '../regional';
|
|
2
3
|
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
|
|
3
4
|
export type Json = JsonValue;
|
|
4
5
|
export type JsonArray = JsonValue[];
|
|
@@ -7,7 +8,13 @@ export type JsonObject = {
|
|
|
7
8
|
};
|
|
8
9
|
export type JsonPrimitive = boolean | number | string | null;
|
|
9
10
|
export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
|
|
11
|
+
export type Int8 = ColumnType<string, number | string | bigint, number | string | bigint>;
|
|
10
12
|
export type Timestamp = ColumnType<Date | string, Date | string, Date | string>;
|
|
13
|
+
export type ControlPlaneOperationStatus = 'completed' | 'failed' | 'queued' | 'running';
|
|
14
|
+
export type ControlPlaneOperationType = 'ach-verification' | 'advanced-deposits-update' | 'bank-rule-run' | 'calendar-block' | 'calendar-unblock' | 'connection-archive' | 'connection-connect' | 'connection-extract' | 'connection-sync' | 'csv-import' | 'csv-import-preview' | 'export' | 'flow-run' | 'historical-gl-import' | 'historical-statement-import' | 'listing-journal-refresh' | 'plaid-initial-sync' | 'pms-cutover' | 'pms-cutover-preview' | 'provider-payment' | 'provider-payment-recovery' | 'recurring-transaction-run' | 'reservation-journal-refresh' | 'reservation-line-mapping-update' | 'statement-payout' | 'statement-payout-preview' | 'team-delete' | 'team-demo-data' | 'team-duplicate' | 'team-initialize' | 'transaction-journal-refresh' | 'vri-statement-import' | 'vri-team-migration' | 'webhook-test';
|
|
15
|
+
export type ControlPlaneOperationResourceRole = 'result' | 'source' | 'target';
|
|
16
|
+
export type ControlPlaneOperationResourceType = 'bank-rule' | 'connection' | 'contact' | 'file' | 'flow' | 'listing' | 'recurring-fee' | 'recurring-transaction-template' | 'reservation' | 'statement' | 'team' | 'transaction' | 'webhook';
|
|
17
|
+
export type ControlPlaneOperationSourceType = 'destructive-job' | 'regional-operation';
|
|
11
18
|
export interface ControlPlaneApp {
|
|
12
19
|
authentication: Generated<Json>;
|
|
13
20
|
category: string | null;
|
|
@@ -21,6 +28,56 @@ export interface ControlPlaneApp {
|
|
|
21
28
|
type: string;
|
|
22
29
|
version: Generated<number>;
|
|
23
30
|
}
|
|
31
|
+
export interface ControlPlaneAccountingIntegrityEvaluation {
|
|
32
|
+
caseCount: Generated<Int8>;
|
|
33
|
+
completedAt: Timestamp | null;
|
|
34
|
+
completedRunCount: Generated<number>;
|
|
35
|
+
createdAt: Generated<Timestamp>;
|
|
36
|
+
environment: string;
|
|
37
|
+
error: Json | null;
|
|
38
|
+
expectedRunCount: number;
|
|
39
|
+
failedRunCount: Generated<number>;
|
|
40
|
+
findingRowCount: Generated<Int8>;
|
|
41
|
+
gitRevision: string;
|
|
42
|
+
id: string;
|
|
43
|
+
results: Generated<Json>;
|
|
44
|
+
rowsScanned: Generated<Int8>;
|
|
45
|
+
skippedRunCount: Generated<number>;
|
|
46
|
+
source: string;
|
|
47
|
+
startedAt: Timestamp;
|
|
48
|
+
status: string;
|
|
49
|
+
updatedAt: Generated<Timestamp>;
|
|
50
|
+
}
|
|
51
|
+
export interface ControlPlaneAccountingIntegrityDefinitionDraft {
|
|
52
|
+
artifact: Json;
|
|
53
|
+
artifactHash: string;
|
|
54
|
+
code: string;
|
|
55
|
+
createdAt: Generated<Timestamp>;
|
|
56
|
+
id: Generated<string>;
|
|
57
|
+
ownerId: string;
|
|
58
|
+
previewResult: Json | null;
|
|
59
|
+
rationale: string;
|
|
60
|
+
revision: Generated<number>;
|
|
61
|
+
status: string;
|
|
62
|
+
templateId: string;
|
|
63
|
+
templateVersion: number;
|
|
64
|
+
title: string;
|
|
65
|
+
updatedAt: Generated<Timestamp>;
|
|
66
|
+
validationResult: Json | null;
|
|
67
|
+
}
|
|
68
|
+
export interface ControlPlaneAccountingIntegrityDefinitionVersion {
|
|
69
|
+
artifact: Json;
|
|
70
|
+
artifactHash: string;
|
|
71
|
+
code: string;
|
|
72
|
+
draftId: string;
|
|
73
|
+
id: Generated<string>;
|
|
74
|
+
publishedAt: Generated<Timestamp>;
|
|
75
|
+
publishedBy: string;
|
|
76
|
+
rollout: string;
|
|
77
|
+
templateId: string;
|
|
78
|
+
templateVersion: number;
|
|
79
|
+
version: number;
|
|
80
|
+
}
|
|
24
81
|
export interface ControlPlaneBookingChannel {
|
|
25
82
|
channelRef: string | null;
|
|
26
83
|
color: string | null;
|
|
@@ -36,9 +93,141 @@ export interface ControlPlaneBookingChannel {
|
|
|
36
93
|
uniqueRef: string;
|
|
37
94
|
updatedAt: Generated<Timestamp>;
|
|
38
95
|
}
|
|
96
|
+
export interface ControlPlaneBookingChannelIconCandidate {
|
|
97
|
+
bookingChannelId: string;
|
|
98
|
+
cloudflareImageId: string | null;
|
|
99
|
+
color: string | null;
|
|
100
|
+
comment: string | null;
|
|
101
|
+
createdAt: Generated<Timestamp>;
|
|
102
|
+
externalIcon: string | null;
|
|
103
|
+
height: number | null;
|
|
104
|
+
id: Generated<string>;
|
|
105
|
+
provider: Generated<string>;
|
|
106
|
+
source: string | null;
|
|
107
|
+
updatedAt: Generated<Timestamp>;
|
|
108
|
+
width: number | null;
|
|
109
|
+
}
|
|
39
110
|
export interface ControlPlaneCurrency {
|
|
40
111
|
name: string;
|
|
41
112
|
}
|
|
113
|
+
export type DestructiveJobStep = 'completed' | 'completion_effects' | 'control_plane_deleted' | 'control_plane_deleting' | 'queued' | 'regional_deleted' | 'regional_deleting' | 'validated';
|
|
114
|
+
export interface ControlPlaneDestructiveJob {
|
|
115
|
+
attempts: Generated<number>;
|
|
116
|
+
authorizedByTenantId: string;
|
|
117
|
+
availableAt: Generated<Timestamp>;
|
|
118
|
+
claimedAt: Timestamp | null;
|
|
119
|
+
claimedBy: string | null;
|
|
120
|
+
completedAt: Timestamp | null;
|
|
121
|
+
completionData: Json | null;
|
|
122
|
+
completionWarningCode: string | null;
|
|
123
|
+
completionWarningDetails: Json | null;
|
|
124
|
+
createdAt: Generated<Timestamp>;
|
|
125
|
+
dataRegion: TenantDataRegion;
|
|
126
|
+
failureCode: string | null;
|
|
127
|
+
failureDetails: Json | null;
|
|
128
|
+
force: Generated<boolean>;
|
|
129
|
+
id: Generated<string>;
|
|
130
|
+
jobType: 'tenant.delete';
|
|
131
|
+
maxAttempts: Generated<number>;
|
|
132
|
+
requestId: string | null;
|
|
133
|
+
requestedByActorType: 'api_key' | 'system' | 'user';
|
|
134
|
+
requestedByTenantId: string;
|
|
135
|
+
requestedByUserId: string | null;
|
|
136
|
+
startedAt: Timestamp | null;
|
|
137
|
+
status: Generated<'canceled' | 'completed' | 'failed' | 'queued' | 'running'>;
|
|
138
|
+
step: Generated<DestructiveJobStep>;
|
|
139
|
+
targetId: string;
|
|
140
|
+
triggerRunId: string | null;
|
|
141
|
+
updatedAt: Generated<Timestamp>;
|
|
142
|
+
}
|
|
143
|
+
export interface ControlPlaneDestructiveJobAttempt {
|
|
144
|
+
attemptNumber: number;
|
|
145
|
+
failureCode: string | null;
|
|
146
|
+
failureDetails: Json | null;
|
|
147
|
+
finishedAt: Timestamp | null;
|
|
148
|
+
id: Generated<string>;
|
|
149
|
+
jobId: string;
|
|
150
|
+
startedAt: Generated<Timestamp>;
|
|
151
|
+
status: Generated<'completed' | 'failed' | 'running' | 'superseded'>;
|
|
152
|
+
step: DestructiveJobStep;
|
|
153
|
+
triggerRunId: string | null;
|
|
154
|
+
}
|
|
155
|
+
export interface ControlPlaneDestructiveJobOperation {
|
|
156
|
+
action: 'abandon' | 'cancel' | 'retry';
|
|
157
|
+
actor: string;
|
|
158
|
+
createdAt: Generated<Timestamp>;
|
|
159
|
+
id: Generated<string>;
|
|
160
|
+
jobId: string;
|
|
161
|
+
previousStatus: string;
|
|
162
|
+
previousStep: string;
|
|
163
|
+
reasonCode: string;
|
|
164
|
+
}
|
|
165
|
+
export interface ControlPlaneOperation {
|
|
166
|
+
createdAt: Generated<Timestamp>;
|
|
167
|
+
failureCode: string | null;
|
|
168
|
+
failureMessage: string | null;
|
|
169
|
+
finishedAt: Timestamp | null;
|
|
170
|
+
id: Generated<string>;
|
|
171
|
+
initiatedByUserId: string | null;
|
|
172
|
+
requesterTenantId: string;
|
|
173
|
+
retainUntil: Timestamp | null;
|
|
174
|
+
sourceRegion: TenantDataRegion | null;
|
|
175
|
+
sourceVersion: Generated<number>;
|
|
176
|
+
startedAt: Timestamp | null;
|
|
177
|
+
status: Generated<ControlPlaneOperationStatus>;
|
|
178
|
+
type: ControlPlaneOperationType;
|
|
179
|
+
updatedAt: Generated<Timestamp>;
|
|
180
|
+
}
|
|
181
|
+
export interface ControlPlaneOperationResource {
|
|
182
|
+
createdAt: Generated<Timestamp>;
|
|
183
|
+
isPrimary: Generated<boolean>;
|
|
184
|
+
operationId: string;
|
|
185
|
+
resourceId: string;
|
|
186
|
+
resourceType: ControlPlaneOperationResourceType;
|
|
187
|
+
role: ControlPlaneOperationResourceRole;
|
|
188
|
+
}
|
|
189
|
+
export interface ControlPlaneOperationSource {
|
|
190
|
+
finishedAt: Timestamp | null;
|
|
191
|
+
operationId: string;
|
|
192
|
+
required: Generated<boolean>;
|
|
193
|
+
sourceId: string;
|
|
194
|
+
sourceType: ControlPlaneOperationSourceType;
|
|
195
|
+
sourceVersion: Generated<number>;
|
|
196
|
+
startedAt: Timestamp | null;
|
|
197
|
+
status: Generated<ControlPlaneOperationStatus>;
|
|
198
|
+
}
|
|
199
|
+
export interface ControlPlaneEvent {
|
|
200
|
+
createdAt: Generated<Timestamp>;
|
|
201
|
+
id: Generated<string>;
|
|
202
|
+
name: string;
|
|
203
|
+
packageName: string;
|
|
204
|
+
props: Json;
|
|
205
|
+
tenantId: string | null;
|
|
206
|
+
timestamp: Generated<Timestamp>;
|
|
207
|
+
trackedAt: Generated<Timestamp | null>;
|
|
208
|
+
userId: string | null;
|
|
209
|
+
}
|
|
210
|
+
export interface ControlPlaneTrackingQueueFailure {
|
|
211
|
+
bodyFingerprint: string | null;
|
|
212
|
+
capturedAt: Generated<Timestamp>;
|
|
213
|
+
dispositionAt: Timestamp | null;
|
|
214
|
+
dispositionHistory: Generated<Json[]>;
|
|
215
|
+
dispositionReasonCode: string | null;
|
|
216
|
+
dispositionActor: string | null;
|
|
217
|
+
environment: 'production' | 'staging';
|
|
218
|
+
event: Json | null;
|
|
219
|
+
eventId: string | null;
|
|
220
|
+
expiresAt: Timestamp;
|
|
221
|
+
failureCode: string;
|
|
222
|
+
id: Generated<string>;
|
|
223
|
+
lastReplayedAt: Timestamp | null;
|
|
224
|
+
queueMessageId: string;
|
|
225
|
+
replayCount: Generated<number>;
|
|
226
|
+
recurrenceCount: Generated<number>;
|
|
227
|
+
status: Generated<'captured' | 'discarded' | 'replayed'>;
|
|
228
|
+
updatedAt: Generated<Timestamp>;
|
|
229
|
+
validationIssues: Json | null;
|
|
230
|
+
}
|
|
42
231
|
export interface ControlPlaneConnectionRoute {
|
|
43
232
|
connectionId: string;
|
|
44
233
|
createdAt: Generated<Timestamp>;
|
|
@@ -65,6 +254,116 @@ export interface ControlPlaneFeatureEnabledTeam {
|
|
|
65
254
|
tenantId: string;
|
|
66
255
|
updatedAt: Generated<Timestamp>;
|
|
67
256
|
}
|
|
257
|
+
export interface ControlPlaneFeatureApproval {
|
|
258
|
+
createdAt: Generated<Timestamp>;
|
|
259
|
+
featureId: string;
|
|
260
|
+
id: Generated<string>;
|
|
261
|
+
status: Generated<string | null>;
|
|
262
|
+
updatedAt: Generated<Timestamp>;
|
|
263
|
+
userId: string;
|
|
264
|
+
}
|
|
265
|
+
export interface ControlPlaneFlow {
|
|
266
|
+
appId: string;
|
|
267
|
+
createdAt: Generated<Timestamp>;
|
|
268
|
+
description: string | null;
|
|
269
|
+
eventListening: Generated<Json>;
|
|
270
|
+
id: Generated<string>;
|
|
271
|
+
isPublic: Generated<boolean>;
|
|
272
|
+
leftType: string | null;
|
|
273
|
+
mappingSchema: Generated<Json>;
|
|
274
|
+
revision: Generated<number>;
|
|
275
|
+
rightType: string | null;
|
|
276
|
+
runSchema: Generated<Json>;
|
|
277
|
+
settingSchema: Generated<Json>;
|
|
278
|
+
title: string;
|
|
279
|
+
type: 'pull' | 'push' | null;
|
|
280
|
+
uniqueRef: string;
|
|
281
|
+
updatedAt: Generated<Timestamp>;
|
|
282
|
+
useGlobalMapping: Generated<boolean>;
|
|
283
|
+
}
|
|
284
|
+
export interface ControlPlaneIssueMessageOverwrite {
|
|
285
|
+
createdAt: Generated<Timestamp>;
|
|
286
|
+
id: Generated<string>;
|
|
287
|
+
message: string;
|
|
288
|
+
pattern: string;
|
|
289
|
+
updatedAt: Generated<Timestamp>;
|
|
290
|
+
}
|
|
291
|
+
export interface ControlPlaneLineClassification {
|
|
292
|
+
appConflict: Generated<boolean>;
|
|
293
|
+
appId: string | null;
|
|
294
|
+
createdAt: Generated<Timestamp>;
|
|
295
|
+
firstSeenAt: Timestamp;
|
|
296
|
+
id: Generated<string>;
|
|
297
|
+
kind: string;
|
|
298
|
+
lastSeenAt: Timestamp;
|
|
299
|
+
name: string;
|
|
300
|
+
updatedAt: Generated<Timestamp>;
|
|
301
|
+
}
|
|
302
|
+
export interface ControlPlaneLineClassificationTeamUsage {
|
|
303
|
+
classificationId: string;
|
|
304
|
+
createdAt: Generated<Timestamp>;
|
|
305
|
+
dataRegion: string;
|
|
306
|
+
firstSeenAt: Timestamp;
|
|
307
|
+
lastSeenAt: Timestamp;
|
|
308
|
+
mappingStatus: string | null;
|
|
309
|
+
revision: number;
|
|
310
|
+
tenantId: string;
|
|
311
|
+
updatedAt: Generated<Timestamp>;
|
|
312
|
+
}
|
|
313
|
+
export interface ControlPlaneMcpUsageDay {
|
|
314
|
+
calls: number;
|
|
315
|
+
day: Timestamp;
|
|
316
|
+
id: Generated<string>;
|
|
317
|
+
tenantId: string | null;
|
|
318
|
+
userId: string | null;
|
|
319
|
+
}
|
|
320
|
+
export interface ControlPlaneReservationLineDefault {
|
|
321
|
+
accountKey: string | null;
|
|
322
|
+
bookingChannel: string | null;
|
|
323
|
+
bookingChannelKey: Generated<string>;
|
|
324
|
+
classificationId: string;
|
|
325
|
+
createdAt: Generated<Timestamp>;
|
|
326
|
+
id: Generated<string>;
|
|
327
|
+
partnerTenantId: string | null;
|
|
328
|
+
revenueRecognition: string | null;
|
|
329
|
+
revision: Generated<number>;
|
|
330
|
+
updatedAt: Generated<Timestamp>;
|
|
331
|
+
}
|
|
332
|
+
export interface ControlPlaneRolloutMonitorSnapshot {
|
|
333
|
+
monitorName: string;
|
|
334
|
+
result: Json;
|
|
335
|
+
snapshotDate: Timestamp;
|
|
336
|
+
}
|
|
337
|
+
export interface ControlPlaneTransactionLineMapping {
|
|
338
|
+
accountAssignmentType: string | null;
|
|
339
|
+
createdAt: Generated<Timestamp>;
|
|
340
|
+
deletedAt: Timestamp | null;
|
|
341
|
+
id: Generated<string>;
|
|
342
|
+
lineType: string;
|
|
343
|
+
revision: Generated<number>;
|
|
344
|
+
updatedAt: Generated<Timestamp>;
|
|
345
|
+
}
|
|
346
|
+
export interface ControlPlaneGeneralLedgerDefaultSet {
|
|
347
|
+
createdAt: Generated<Timestamp>;
|
|
348
|
+
id: Generated<string>;
|
|
349
|
+
partnerTenantId: string | null;
|
|
350
|
+
publishedVersion: number | null;
|
|
351
|
+
sourceDataRegion: string;
|
|
352
|
+
sourceDigest: string | null;
|
|
353
|
+
sourceTenantId: string;
|
|
354
|
+
templateKey: string;
|
|
355
|
+
updatedAt: Generated<Timestamp>;
|
|
356
|
+
}
|
|
357
|
+
export interface ControlPlaneGeneralLedgerDefaultVersion {
|
|
358
|
+
dataJson: Json;
|
|
359
|
+
defaultSetId: string;
|
|
360
|
+
id: Generated<string>;
|
|
361
|
+
publishedAt: Generated<Timestamp>;
|
|
362
|
+
sourceDigest: string;
|
|
363
|
+
sourceTenantId: string;
|
|
364
|
+
version: number;
|
|
365
|
+
}
|
|
366
|
+
export declare const CONTROL_PLANE_OUTBOX_MAX_ATTEMPTS = 25;
|
|
68
367
|
export interface ControlPlaneOutbox {
|
|
69
368
|
aggregateId: string;
|
|
70
369
|
aggregateType: string;
|
|
@@ -78,23 +377,69 @@ export interface ControlPlaneOutbox {
|
|
|
78
377
|
payload: Generated<Json>;
|
|
79
378
|
publishedAt: Timestamp | null;
|
|
80
379
|
}
|
|
380
|
+
export interface ControlPlanePartnerManagedTeamAssignment {
|
|
381
|
+
createdAt: Generated<Timestamp>;
|
|
382
|
+
managedTeamId: string;
|
|
383
|
+
partnerTenantId: string;
|
|
384
|
+
userId: string;
|
|
385
|
+
}
|
|
386
|
+
export interface ControlPlaneOwnerPortal {
|
|
387
|
+
hostname: string;
|
|
388
|
+
tenantId: string;
|
|
389
|
+
status: Generated<'pending' | 'active' | 'disabled'>;
|
|
390
|
+
name: string;
|
|
391
|
+
logo: string | null;
|
|
392
|
+
colorPrimary: string;
|
|
393
|
+
showPlatformBranding: Generated<boolean>;
|
|
394
|
+
linksEnabled: Generated<boolean>;
|
|
395
|
+
sender: {
|
|
396
|
+
from: string;
|
|
397
|
+
replyTo: string;
|
|
398
|
+
} | null;
|
|
399
|
+
revision: Generated<number>;
|
|
400
|
+
updatedAt: Generated<Timestamp>;
|
|
401
|
+
createdAt: Generated<Timestamp>;
|
|
402
|
+
wentLiveAt: Timestamp | null;
|
|
403
|
+
}
|
|
81
404
|
export interface ControlPlaneTenant {
|
|
405
|
+
billingPartnerId: string | null;
|
|
82
406
|
billingPlan: string | null;
|
|
83
407
|
createdAt: Generated<Timestamp>;
|
|
84
408
|
dataRegion: Generated<string>;
|
|
85
409
|
id: Generated<string>;
|
|
410
|
+
lockedAt: Timestamp | null;
|
|
411
|
+
migrationStatus: Generated<string>;
|
|
86
412
|
name: string;
|
|
87
413
|
partnerId: string | null;
|
|
414
|
+
partnerDeniedPermissions: Generated<string[]>;
|
|
88
415
|
slug: string;
|
|
89
416
|
status: Generated<string | null>;
|
|
90
417
|
storageRealm: Generated<string>;
|
|
91
418
|
type: Generated<string | null>;
|
|
419
|
+
uniqueRef: string | null;
|
|
92
420
|
updatedAt: Generated<Timestamp | null>;
|
|
93
421
|
}
|
|
422
|
+
export interface ControlPlaneTenantRegionMigration {
|
|
423
|
+
actor: string;
|
|
424
|
+
completedAt: Timestamp | null;
|
|
425
|
+
error: Json | null;
|
|
426
|
+
id: string;
|
|
427
|
+
reason: string;
|
|
428
|
+
sourceManifest: Json | null;
|
|
429
|
+
sourceRegion: string;
|
|
430
|
+
startedAt: Generated<Timestamp>;
|
|
431
|
+
status: Generated<string>;
|
|
432
|
+
targetManifest: Json | null;
|
|
433
|
+
targetRegion: string;
|
|
434
|
+
tenantId: string;
|
|
435
|
+
updatedAt: Generated<Timestamp>;
|
|
436
|
+
}
|
|
94
437
|
export interface ControlPlaneTenantUser {
|
|
95
438
|
createdAt: Generated<Timestamp | null>;
|
|
96
439
|
id: Generated<string>;
|
|
97
440
|
lastInvitedAt: Timestamp | null;
|
|
441
|
+
managedTeamAccess: Generated<'all' | 'assigned'>;
|
|
442
|
+
permissionBundles: Generated<string[]>;
|
|
98
443
|
role: Generated<string | null>;
|
|
99
444
|
status: Generated<string | null>;
|
|
100
445
|
tenantId: string;
|
|
@@ -107,36 +452,98 @@ export interface ControlPlaneToken {
|
|
|
107
452
|
id: Generated<string>;
|
|
108
453
|
nanoId: Generated<string>;
|
|
109
454
|
payload: Generated<Json>;
|
|
455
|
+
secretHash: string | null;
|
|
110
456
|
tenantId: string | null;
|
|
111
457
|
type: string | null;
|
|
112
458
|
userId: string | null;
|
|
113
459
|
}
|
|
114
460
|
export interface ControlPlaneUser {
|
|
461
|
+
appSettings: Generated<Json>;
|
|
115
462
|
clerkId: string | null;
|
|
116
463
|
createdAt: Generated<Timestamp | null>;
|
|
117
464
|
email: string | null;
|
|
118
465
|
firstName: string | null;
|
|
119
466
|
id: Generated<string>;
|
|
467
|
+
internalOperationGrants: Generated<string[]>;
|
|
120
468
|
isAdmin: Generated<boolean>;
|
|
121
469
|
lastName: string | null;
|
|
470
|
+
lastSeen: Timestamp | null;
|
|
122
471
|
name: string | null;
|
|
123
472
|
partnerId: string | null;
|
|
473
|
+
phone: string | null;
|
|
474
|
+
secondaryEmails: Generated<Json>;
|
|
124
475
|
status: Generated<string | null>;
|
|
125
476
|
sub: string | null;
|
|
126
477
|
type: Generated<string | null>;
|
|
127
478
|
updatedAt: Generated<Timestamp | null>;
|
|
128
479
|
}
|
|
480
|
+
export type ControlPlaneWebhookSubscriptionEventType = 'audit.event.changed' | 'connection.changed' | 'listing.changed' | 'reservation.changed' | 'statement.status.changed' | 'sync.status.changed' | 'team.issues.changed' | 'transaction.changed';
|
|
481
|
+
export interface ControlPlaneWebhookSubscription {
|
|
482
|
+
apiVersion: '2026-07-01';
|
|
483
|
+
createdAt: Generated<Timestamp>;
|
|
484
|
+
description: string | null;
|
|
485
|
+
disabledAt: Timestamp | null;
|
|
486
|
+
eventTypes: ControlPlaneWebhookSubscriptionEventType[];
|
|
487
|
+
id: Generated<string>;
|
|
488
|
+
ownerTenantId: string;
|
|
489
|
+
revision: Generated<Int8>;
|
|
490
|
+
scope: 'managedTeams' | 'self';
|
|
491
|
+
status: Generated<'active' | 'disabled' | 'pending'>;
|
|
492
|
+
updatedAt: Generated<Timestamp>;
|
|
493
|
+
url: string;
|
|
494
|
+
verifiedAt: Timestamp | null;
|
|
495
|
+
}
|
|
496
|
+
export interface ControlPlaneWebhookSubscriptionSecret {
|
|
497
|
+
activeFrom: Generated<Timestamp>;
|
|
498
|
+
createdAt: Generated<Timestamp>;
|
|
499
|
+
encryptedSecret: string;
|
|
500
|
+
encryptionKeyId: string;
|
|
501
|
+
expiresAt: Timestamp | null;
|
|
502
|
+
id: Generated<string>;
|
|
503
|
+
reencryptionFailedAt: Timestamp | null;
|
|
504
|
+
reencryptionFailureCode: string | null;
|
|
505
|
+
revokedAt: Timestamp | null;
|
|
506
|
+
subscriptionId: string;
|
|
507
|
+
}
|
|
129
508
|
export interface ControlPlaneDB {
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
'
|
|
137
|
-
'
|
|
138
|
-
'
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
|
|
142
|
-
|
|
509
|
+
'controlPlane.accountingIntegrityDefinitionDraft': ControlPlaneAccountingIntegrityDefinitionDraft;
|
|
510
|
+
'controlPlane.accountingIntegrityDefinitionVersion': ControlPlaneAccountingIntegrityDefinitionVersion;
|
|
511
|
+
'controlPlane.accountingIntegrityEvaluation': ControlPlaneAccountingIntegrityEvaluation;
|
|
512
|
+
'controlPlane.app': ControlPlaneApp;
|
|
513
|
+
'controlPlane.bookingChannel': ControlPlaneBookingChannel;
|
|
514
|
+
'controlPlane.bookingChannelIconCandidate': ControlPlaneBookingChannelIconCandidate;
|
|
515
|
+
'controlPlane.connectionRoute': ControlPlaneConnectionRoute;
|
|
516
|
+
'controlPlane.controlPlaneOutbox': ControlPlaneOutbox;
|
|
517
|
+
'controlPlane.currency': ControlPlaneCurrency;
|
|
518
|
+
'controlPlane.destructiveJob': ControlPlaneDestructiveJob;
|
|
519
|
+
'controlPlane.destructiveJobAttempt': ControlPlaneDestructiveJobAttempt;
|
|
520
|
+
'controlPlane.destructiveJobOperation': ControlPlaneDestructiveJobOperation;
|
|
521
|
+
'controlPlane.events': ControlPlaneEvent;
|
|
522
|
+
'controlPlane.feature': ControlPlaneFeature;
|
|
523
|
+
'controlPlane.featureApproval': ControlPlaneFeatureApproval;
|
|
524
|
+
'controlPlane.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;
|
|
525
|
+
'controlPlane.generalLedgerDefaultSet': ControlPlaneGeneralLedgerDefaultSet;
|
|
526
|
+
'controlPlane.generalLedgerDefaultVersion': ControlPlaneGeneralLedgerDefaultVersion;
|
|
527
|
+
'controlPlane.lineClassification': ControlPlaneLineClassification;
|
|
528
|
+
'controlPlane.lineClassificationTeamUsage': ControlPlaneLineClassificationTeamUsage;
|
|
529
|
+
'controlPlane.mcpUsageDay': ControlPlaneMcpUsageDay;
|
|
530
|
+
'controlPlane.operation': ControlPlaneOperation;
|
|
531
|
+
'controlPlane.operationResource': ControlPlaneOperationResource;
|
|
532
|
+
'controlPlane.operationSource': ControlPlaneOperationSource;
|
|
533
|
+
'controlPlane.partnerManagedTeamAssignment': ControlPlanePartnerManagedTeamAssignment;
|
|
534
|
+
'controlPlane.reservationLineDefault': ControlPlaneReservationLineDefault;
|
|
535
|
+
'controlPlane.rolloutMonitorSnapshot': ControlPlaneRolloutMonitorSnapshot;
|
|
536
|
+
'controlPlane.ownerPortal': ControlPlaneOwnerPortal;
|
|
537
|
+
'controlPlane.tenant': ControlPlaneTenant;
|
|
538
|
+
'controlPlane.tenantRegionMigration': ControlPlaneTenantRegionMigration;
|
|
539
|
+
'controlPlane.tenantUser': ControlPlaneTenantUser;
|
|
540
|
+
'controlPlane.trackingQueueFailure': ControlPlaneTrackingQueueFailure;
|
|
541
|
+
'controlPlane.token': ControlPlaneToken;
|
|
542
|
+
'controlPlane.transactionLineMapping': ControlPlaneTransactionLineMapping;
|
|
543
|
+
'controlPlane.user': ControlPlaneUser;
|
|
544
|
+
'controlPlane.webhookSubscription': ControlPlaneWebhookSubscription;
|
|
545
|
+
'controlPlane.webhookSubscriptionSecret': ControlPlaneWebhookSubscriptionSecret;
|
|
546
|
+
'controlPlaneCore.flow': ControlPlaneFlow;
|
|
547
|
+
'controlPlaneCore.issueMessageOverwrite': ControlPlaneIssueMessageOverwrite;
|
|
548
|
+
}
|
|
549
|
+
export declare function withControlPlaneSchema(kysely: Kysely<ControlPlaneDB>, schema: string, issueMessageOverwriteSchema?: string): Kysely<ControlPlaneDB>;
|
|
@@ -1,2 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
import { IdentifierNode, OperationNodeTransformer, } from 'kysely';
|
|
2
|
+
// A poison event (e.g. a user.deleted blocked by a regional foreign key) can
|
|
3
|
+
// never succeed; without a cap it retries every drain tick forever. After this
|
|
4
|
+
// many attempts we stop reprocessing it, leave it unpublished for a human to
|
|
5
|
+
// resolve, and keep it blocking newer versions of the same aggregate. A later
|
|
6
|
+
// terminal delete is an automatic exception because it makes the older event
|
|
7
|
+
// obsolete without repairing regional data. So is a user or membership upsert
|
|
8
|
+
// that exhausted its attempts after the control plane stopped holding the
|
|
9
|
+
// aggregate, and an older feature snapshot that a newer snapshot replaces.
|
|
10
|
+
export const CONTROL_PLANE_OUTBOX_MAX_ATTEMPTS = 25;
|
|
11
|
+
class ControlPlaneSchemaTransformer extends OperationNodeTransformer {
|
|
12
|
+
schema;
|
|
13
|
+
issueMessageOverwriteSchema;
|
|
14
|
+
constructor(schema, issueMessageOverwriteSchema) {
|
|
15
|
+
super();
|
|
16
|
+
this.schema = schema;
|
|
17
|
+
this.issueMessageOverwriteSchema = issueMessageOverwriteSchema;
|
|
18
|
+
}
|
|
19
|
+
transformSchemableIdentifier(node, queryId) {
|
|
20
|
+
const transformed = super.transformSchemableIdentifier(node, queryId);
|
|
21
|
+
if (transformed.schema?.name === 'controlPlane' ||
|
|
22
|
+
transformed.schema?.name === 'control_plane') {
|
|
23
|
+
return { ...transformed, schema: IdentifierNode.create(this.schema) };
|
|
24
|
+
}
|
|
25
|
+
if (transformed.schema?.name === 'controlPlaneCore' ||
|
|
26
|
+
transformed.schema?.name === 'control_plane_core') {
|
|
27
|
+
return {
|
|
28
|
+
...transformed,
|
|
29
|
+
schema: IdentifierNode.create(this.issueMessageOverwriteSchema),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return transformed;
|
|
33
|
+
}
|
|
34
|
+
transformFunction(node, queryId) {
|
|
35
|
+
const transformed = super.transformFunction(node, queryId);
|
|
36
|
+
return node.func.startsWith('controlPlane.')
|
|
37
|
+
? {
|
|
38
|
+
...transformed,
|
|
39
|
+
func: `${this.schema}.${transformed.func.slice('controlPlane.'.length)}`,
|
|
40
|
+
}
|
|
41
|
+
: transformed;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class ControlPlaneSchemaPlugin {
|
|
45
|
+
#transformer;
|
|
46
|
+
constructor(schema, issueMessageOverwriteSchema) {
|
|
47
|
+
this.#transformer = new ControlPlaneSchemaTransformer(schema, issueMessageOverwriteSchema);
|
|
48
|
+
}
|
|
49
|
+
transformQuery(args) {
|
|
50
|
+
return this.#transformer.transformNode(args.node, args.queryId);
|
|
51
|
+
}
|
|
52
|
+
async transformResult(args) {
|
|
53
|
+
return args.result;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function withControlPlaneSchema(kysely, schema, issueMessageOverwriteSchema = 'core') {
|
|
57
|
+
return kysely.withPlugin(new ControlPlaneSchemaPlugin(schema, issueMessageOverwriteSchema));
|
|
58
|
+
}
|
|
2
59
|
//# sourceMappingURL=index.js.map
|