@vrplatform/kysely 1.3.45-stage.4380 → 1.3.45-stage.43806806421

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.
Files changed (338) hide show
  1. package/build/.data.tar +2 -2
  2. package/build/main/camel-case/index.d.ts +4 -4
  3. package/build/main/camel-case/index.js +3 -2
  4. package/build/main/camel-case/index.js.map +1 -1
  5. package/build/main/connect-handoff.d.ts +12 -0
  6. package/build/main/connect-handoff.js +73 -0
  7. package/build/main/connect-handoff.js.map +1 -0
  8. package/build/main/control-plane/index.d.ts +413 -14
  9. package/build/main/control-plane/index.js +71 -0
  10. package/build/main/control-plane/index.js.map +1 -1
  11. package/build/main/domain.d.ts +4 -0
  12. package/build/main/domain.js +3 -0
  13. package/build/main/domain.js.map +1 -0
  14. package/build/main/error.d.ts +2 -1
  15. package/build/main/error.js +2 -1
  16. package/build/main/error.js.map +1 -1
  17. package/build/main/index.d.ts +57 -15
  18. package/build/main/index.js +498 -66
  19. package/build/main/index.js.map +1 -1
  20. package/build/main/isomorphic.d.ts +6 -6
  21. package/build/main/isomorphic.js +4 -8
  22. package/build/main/isomorphic.js.map +1 -1
  23. package/build/main/local/digest.d.ts +3 -3
  24. package/build/main/local/digest.js.map +1 -1
  25. package/build/main/local/generate.js +15 -13
  26. package/build/main/local/generate.js.map +1 -1
  27. package/build/main/local/index.d.ts +5 -1
  28. package/build/main/local/index.js +346 -12
  29. package/build/main/local/index.js.map +1 -1
  30. package/build/main/local/prune-pulled-schema.js +4 -1
  31. package/build/main/local/prune-pulled-schema.js.map +1 -1
  32. package/build/main/migration-source.d.ts +4 -0
  33. package/build/main/migration-source.js +45 -0
  34. package/build/main/migration-source.js.map +1 -0
  35. package/build/main/migration.d.ts +7 -0
  36. package/build/main/migration.js +11 -0
  37. package/build/main/migration.js.map +1 -0
  38. package/build/main/pganalyze-comment-plugin/comment-transformer.js +3 -1
  39. package/build/main/pganalyze-comment-plugin/comment-transformer.js.map +1 -1
  40. package/build/main/pganalyze-comment-plugin/index.js.map +1 -1
  41. package/build/main/plugins.d.ts +2 -2
  42. package/build/main/plugins.js.map +1 -1
  43. package/build/main/postgres-error.d.ts +9 -0
  44. package/build/main/postgres-error.js +28 -0
  45. package/build/main/postgres-error.js.map +1 -0
  46. package/build/main/query/index.d.ts +1 -0
  47. package/build/main/query/index.js +1 -0
  48. package/build/main/query/index.js.map +1 -1
  49. package/build/main/query/listing/status.d.ts +2 -12
  50. package/build/main/query/listing/status.js +35 -20
  51. package/build/main/query/listing/status.js.map +1 -1
  52. package/build/main/query/tenant/billing-partner.d.ts +4 -0
  53. package/build/main/query/tenant/billing-partner.js +8 -0
  54. package/build/main/query/tenant/billing-partner.js.map +1 -0
  55. package/build/main/query/tenant/feature-enabled.d.ts +6 -0
  56. package/build/main/query/tenant/feature-enabled.js +30 -0
  57. package/build/main/query/tenant/feature-enabled.js.map +1 -0
  58. package/build/main/query/tenant/index.d.ts +4 -0
  59. package/build/main/query/tenant/index.js +21 -0
  60. package/build/main/query/tenant/index.js.map +1 -0
  61. package/build/main/query/tenant/status.d.ts +9 -0
  62. package/build/main/query/tenant/status.js +32 -0
  63. package/build/main/query/tenant/status.js.map +1 -0
  64. package/build/main/query/tenant/where-uuid-in.d.ts +2 -0
  65. package/build/main/query/tenant/where-uuid-in.js +14 -0
  66. package/build/main/query/tenant/where-uuid-in.js.map +1 -0
  67. package/build/main/regional.d.ts +31 -4
  68. package/build/main/regional.js +69 -8
  69. package/build/main/regional.js.map +1 -1
  70. package/build/main/test/index.d.ts +21 -11
  71. package/build/main/test/index.js +31 -26
  72. package/build/main/test/index.js.map +1 -1
  73. package/build/main/transaction.d.ts +3 -3
  74. package/build/main/transaction.js.map +1 -1
  75. package/build/main/v1.generated.d.ts +1335 -90
  76. package/build/main/v1.generated.js.map +1 -1
  77. package/build/migrations-v2/0000000000000-baseline.ts +5 -0
  78. package/build/migrations-v2/0000000000001-public-audit-events-v2.ts +137 -0
  79. package/build/migrations-v2/0000000000002-audit-recovery-watermarks.ts +30 -0
  80. package/build/migrations-v2/0000000000003-audit-effect-recovery-watermark.ts +13 -0
  81. package/build/migrations-v2/0000000000004-audit-event-projected-at.ts +15 -0
  82. package/build/migrations-v2/0000000000005-audit-recovery-indexes.ts +63 -0
  83. package/build/migrations-v2/0000000000006-audit-action-public-event-projected-at.ts +22 -0
  84. package/build/migrations-v2/0000000000007-audit-action-public-event-projected-at-backfill.ts +35 -0
  85. package/build/migrations-v2/0000000000008-global-user-attribution.ts +33 -0
  86. package/build/migrations-v2/0000000000008-team-issue-rule-state.ts +52 -0
  87. package/build/migrations-v2/0000000000009-reservation-issue-projections.ts +45 -0
  88. package/build/migrations-v2/0000000000010-bank-rule-application-bank-record-delete-cascade.ts +26 -0
  89. package/build/migrations-v2/0000000000011-guest-balance-journal-entry-lookup-index.ts +25 -0
  90. package/build/migrations-v2/0000000000012-trial-free-analytics-billing-status.ts +72 -0
  91. package/build/migrations-v2/0000000000013-ui-permission-bundles.ts +45 -0
  92. package/build/migrations-v2/0000000000014-ui-permission-bundle-top-up.ts +32 -0
  93. package/build/migrations-v2/0000000000015-durable-flow-events.ts +163 -0
  94. package/build/migrations-v2/0000000000016-billing-listing-facts.ts +539 -0
  95. package/build/migrations-v2/0000000000016-managed-team-access.ts +34 -0
  96. package/build/migrations-v2/0000000000017-drop-trial-until.ts +42 -0
  97. package/build/migrations-v2/0000000000017-webhook-secret-reencryption-failures.ts +18 -0
  98. package/build/migrations-v2/0000000000018-accounting-integrity-monitoring.ts +276 -0
  99. package/build/migrations-v2/0000000000018-durable-flow-event-sensitive-input.ts +28 -0
  100. package/build/migrations-v2/0000000000019-accounting-integrity-run-shards.ts +26 -0
  101. package/build/migrations-v2/0000000000019-asynchronous-operations.ts +736 -0
  102. package/build/migrations-v2/0000000000020-accounting-integrity-case-classification.ts +52 -0
  103. package/build/migrations-v2/0000000000021-payment-line-classification-monitor-indexes.ts +31 -0
  104. package/build/migrations-v2/0000000000022-accounting-integrity-controlled-repairs.ts +281 -0
  105. package/build/migrations-v2/0000000000023-line-classification-usage.ts +325 -0
  106. package/build/migrations-v2/0000000000024-tenant-region-migration.ts +108 -0
  107. package/build/migrations-v2/0000000000025-partner-ach-denial-default.ts +30 -0
  108. package/build/migrations-v2/0000000000026-line-classification-usage-capture.ts +399 -0
  109. package/build/migrations-v2/0000000000027-payout-replacement-chain.ts +27 -0
  110. package/build/migrations-v2/0000000000028-accounting-integrity-operator-workflow.ts +108 -0
  111. package/build/migrations-v2/0000000000029-accounting-integrity-definition-artifacts.ts +40 -0
  112. package/build/migrations-v2/0000000000030-accounting-integrity-review-metadata-compatibility.ts +49 -0
  113. package/build/migrations-v2/0000000000031-ui-permission-role-simplification.ts +70 -0
  114. package/build/migrations-v2/0000000000032-tenant-delete-ownership-cascades.ts +44 -0
  115. package/build/migrations-v2/0000000000033-plaid-connect-session-telemetry.ts +31 -0
  116. package/build/migrations-v2/0000000000033-reservation-issue-seed-bucket-index.ts +19 -0
  117. package/build/migrations-v2/0000000000034-retire-recent-classification-indexes.ts +29 -0
  118. package/build/migrations-v2/0000000000035-core-change-autovacuum.ts +24 -0
  119. package/build/migrations-v2/0000000000036-journal-entry-inactive-reason-constraint.ts +33 -0
  120. package/build/migrations-v2/0000000000037-journal-entry-inactive-reasons.ts +19 -0
  121. package/build/{migrations/0000000000023-journal-entry-currency-mismatch-reason.ts → migrations-v2/0000000000038-journal-entry-group-inactive-reason.ts} +4 -4
  122. package/build/migrations-v2/0000000000039-reservation-guest-breakdown.ts +19 -0
  123. package/build/migrations-v2/0000000000040-csv-import-source-identity-index.ts +23 -0
  124. package/build/migrations-v2/0000000000041-payment-returns.ts +38 -0
  125. package/build/migrations-v2/0000000000042-operation-resource-types.ts +609 -0
  126. package/build/migrations-v2/0000000000043-reservation-journal-freshness.ts +149 -0
  127. package/build/migrations-v2/0000000000044-reservation-journal-freshness-backfill.ts +254 -0
  128. package/build/migrations-v2/0000000000045-reservation-journal-freshness-revision-repair.ts +83 -0
  129. package/build/migrations-v2/0000000000046-materialized-reservation-journal-operations.ts +709 -0
  130. package/build/migrations-v2/0000000000047-public-audit-completion.ts +77 -0
  131. package/build/migrations-v2/0000000000048-reservation-journal-full-refresh-repair.ts +136 -0
  132. package/build/migrations-v2/0000000000049-queued-journal-operation-failures.ts +60 -0
  133. package/build/migrations-v2/0000000000050-connection-oauth-state.ts +43 -0
  134. package/build/migrations-v2/0000000000051-owner-statement-email-delivery.ts +134 -0
  135. package/build/migrations-v2/0000000000052-fee-journal-lock-skip-operations.ts +59 -0
  136. package/build/migrations-v2/0000000000053-fee-journal-lock-skip-null-attempt.ts +44 -0
  137. package/build/migrations-v2/0000000000054-journal-refresh-issue-codes.ts +16 -0
  138. package/build/migrations-v2/0000000000055-tenant-billing-subscription.ts +8 -0
  139. package/build/migrations-v2/0000000000056-journal-operation-failure-precedence.ts +306 -0
  140. package/build/migrations-v2/0000000000057-journal-invalidation-failure-code.ts +28 -0
  141. package/build/migrations-v2/0000000000058-journal-invalidation-locked-failure.ts +16 -0
  142. package/build/migrations-v2/0000000000059-billing-active-listing-cross-region-partner.ts +135 -0
  143. package/build/migrations-v2/0000000000060-accounting-integrity-change-driven.ts +99 -0
  144. package/build/migrations-v2/0000000000061-tenant-pending-onboarding-status.ts +37 -0
  145. package/build/migrations-v2/0000000000062-statement-payout-operations.ts +16 -0
  146. package/build/migrations-v2/0000000000063-missing-account-assignments-issue-code.ts +13 -0
  147. package/build/migrations-v2/0000000000064-journal-invalidation-source-lookup-index.ts +26 -0
  148. package/build/migrations-v2/0000000000065-hasura-connection-event-credentials.ts +42 -0
  149. package/build/migrations-v2/0000000000066-recurring-fee-listing-subscription-match-by.ts +51 -0
  150. package/build/migrations-v2/0000000000067-connection-credential-metadata.ts +60 -0
  151. package/build/migrations-v2/0000000000068-connection-credential-version.ts +34 -0
  152. package/build/migrations-v2/0000000000069-owner-statement-contact-email-delivery.ts +84 -0
  153. package/build/migrations-v2/0000000000070-payment-writer-compatibility.ts +69 -0
  154. package/build/migrations-v2/0000000000071-payments.ts +532 -0
  155. package/build/migrations-v2/0000000000072-journal-entry-payment-index.ts +21 -0
  156. package/build/migrations-v2/0000000000073-batch-invalidation-operation-registration.ts +74 -0
  157. package/build/migrations-v2/0000000000074-owner-statement-email-history.ts +34 -0
  158. package/build/migrations-v2/0000000000075-tenant-deletion-lookup-indexes.ts +46 -0
  159. package/build/migrations-v2/0000000000076-tenant-onboarding-not-null.ts +23 -0
  160. package/build/migrations-v2/0000000000077-payment-writer-statement-attachment.ts +92 -0
  161. package/build/migrations-v2/0000000000078-trigger-timeout-indexes.ts +44 -0
  162. package/build/migrations-v2/0000000000079-core-change-tenant-statistics.ts +26 -0
  163. package/build/migrations-v2/0000000000080-drop-legacy-tracking-event.ts +60 -0
  164. package/build/migrations-v2/0000000000081-recurring-fee-planner-operation-status.ts +35 -0
  165. package/build/migrations-v2/0000000000082-reservation-search-trigram-indexes.ts +54 -0
  166. package/build/migrations-v2/0000000000083-journal-entry-deposit-lookup-index.ts +31 -0
  167. package/build/migrations-v2/0000000000084-journal-entry-reservation-revenue-indexes.ts +57 -0
  168. package/build/migrations-v2/0000000000085-owner-statement-link-email-template.ts +23 -0
  169. package/build/migrations-v2/0000000000086-contact-payment-setup.ts +72 -0
  170. package/build/migrations-v2/0000000000087-address-delete-fk-indexes.ts +30 -0
  171. package/build/migrations-v2/0000000000088-owner-statement-email-switch.ts +76 -0
  172. package/build/migrations-v2/0000000000089-contact-bank-details-requested-at.ts +21 -0
  173. package/build/migrations-v2/0000000000090-contact-bank-account-api-key.ts +22 -0
  174. package/build/migrations-v2/0000000000091-contact-bank-details-request.ts +78 -0
  175. package/build/migrations-v2/0000000000092-payment-provider-reference.ts +22 -0
  176. package/build/migrations-v2/0000000000093-payment-reversal-offline-undo.ts +18 -0
  177. package/build/migrations-v2/0000000000094-reservation-status-checkout-index.ts +37 -0
  178. package/build/migrations-v2/0000000000095-payment-batches.ts +196 -0
  179. package/build/migrations-v2/0000000000096-guide-ongoing-tasks-issue-codes.ts +26 -0
  180. package/build/migrations-v2/0000000000097-reservation-line-mapping-suggestions.ts +53 -0
  181. package/build/migrations-v2/0000000000098-cancelled-reservation-balances-issue-code.ts +13 -0
  182. package/build/migrations-v2/0000000000099-contact-bank-account-request-source.ts +28 -0
  183. package/build/migrations-v2/0000000000100-drop-regional-feature-flags.ts +105 -0
  184. package/build/migrations-v2/0000000000101-bank-record-match-source.ts +45 -0
  185. package/build/migrations-v2/0000000000102-owner-statement-email-one-template.ts +63 -0
  186. package/build/migrations-v2/0000000000103-reservation-line-mapping-update-operation.ts +10 -0
  187. package/build/migrations-v2/0000000000104-export-job-payment-batch-pdf.ts +12 -0
  188. package/build/migrations-v2/0000000000105-drop-regional-token.ts +60 -0
  189. package/build/migrations-v2/0000000000106-incremental-audit-action-source.ts +158 -0
  190. package/build/migrations-v2/0000000000107-audit-mutation-transaction-insert-index.ts +44 -0
  191. package/build/migrations-v2/0000000000108-reservation-stay-type.ts +24 -0
  192. package/build/migrations-v2/0000000000109-long-term-liabilities-category-order.ts +21 -0
  193. package/build/migrations-v2/0000000000110-pms-sync-failures-issue-code.ts +13 -0
  194. package/build/migrations-v2/0000000000110-reservation-line-type-taxable.ts +21 -0
  195. package/build/migrations-v2/0000000000111-reservation-line-type-suggestion-taxable.ts +20 -0
  196. package/build/migrations-v2/0000000000112-contact-payment-method-outside-default.ts +44 -0
  197. package/build/migrations-v2/0000000000113-merchant-fee-reference-assignment.ts +25 -0
  198. package/build/migrations-v2/0000000000114-recurring-fee-nights-filter.ts +32 -0
  199. package/build/migrations-v2/0000000000115-bank-records-with-suggested-rule-issue-code.ts +13 -0
  200. package/build/migrations-v2/0000000000116-guest-review.ts +45 -0
  201. package/build/migrations-v2/0000000000117-ramp-external-funding-accounts.ts +91 -0
  202. package/build/migrations-v2/0000000000118-pm-payout-assignment.ts +25 -0
  203. package/build/migrations-v2/0000000000119-chart-of-accounts-classifications.ts +46 -0
  204. package/build/migrations-v2/0000000000120-feedback.ts +41 -0
  205. package/build/migrations-v2/0000000000121-source-owner-block-calendar-index.ts +43 -0
  206. package/build/migrations-v2/0000000000122-recurring-fee-stay-types-filter.ts +20 -0
  207. package/build/migrations-v2/0000000000123-reservation-owner-stay-type-index.ts +40 -0
  208. package/build/migrations-v2/0000000000124-remove-tenant-test-and-billable-columns.ts +63 -0
  209. package/build/migrations-v2/0000000000125-ramp-application.ts +56 -0
  210. package/build/migrations-v2/0000000000126-advanced-deposits-update-operation.ts +10 -0
  211. package/build/migrations-v2/0000000000127-contact-1099-tax-details.ts +46 -0
  212. package/build/migrations-v2/0000000000128-tax-1099-email-templates.ts +36 -0
  213. package/build/migrations-v2/0000000000129-tenant-locked-at.ts +18 -0
  214. package/build/migrations-v2/0000000000130-second-factor-reset.ts +65 -0
  215. package/build/migrations-v2/0000000000131-payout-hold.ts +49 -0
  216. package/build/migrations-v2/0000000000132-member-invite-approval.ts +62 -0
  217. package/build/migrations-v2/0000000000133-audit-action-client-ip.ts +38 -0
  218. package/build/migrations-v2/0000000000134-drop-orphaned-hasura-triggers.ts +39 -0
  219. package/build/migrations-v2/0000000000135-drop-orphaned-hasura-triggers-literal.ts +42 -0
  220. package/build/migrations-v2/0000000000136-drop-all-hasura-triggers.ts +43 -0
  221. package/build/migrations-v2/0000000000137-webhook-event.ts +57 -0
  222. package/build/migrations-v2/0000000000138-contact-tax-details-requested-at.ts +24 -0
  223. package/build/module/camel-case/index.d.ts +4 -4
  224. package/build/module/camel-case/index.js +4 -3
  225. package/build/module/camel-case/index.js.map +1 -1
  226. package/build/module/connect-handoff.d.ts +12 -0
  227. package/build/module/connect-handoff.js +70 -0
  228. package/build/module/connect-handoff.js.map +1 -0
  229. package/build/module/control-plane/index.d.ts +413 -14
  230. package/build/module/control-plane/index.js +58 -1
  231. package/build/module/control-plane/index.js.map +1 -1
  232. package/build/module/domain.d.ts +4 -0
  233. package/build/module/domain.js +2 -0
  234. package/build/module/domain.js.map +1 -0
  235. package/build/module/error.d.ts +2 -1
  236. package/build/module/error.js +3 -1
  237. package/build/module/error.js.map +1 -1
  238. package/build/module/index.d.ts +57 -15
  239. package/build/module/index.js +496 -64
  240. package/build/module/index.js.map +1 -1
  241. package/build/module/isomorphic.d.ts +6 -6
  242. package/build/module/isomorphic.js +2 -7
  243. package/build/module/isomorphic.js.map +1 -1
  244. package/build/module/local/digest.d.ts +3 -3
  245. package/build/module/local/digest.js.map +1 -1
  246. package/build/module/local/generate.js +15 -13
  247. package/build/module/local/generate.js.map +1 -1
  248. package/build/module/local/index.d.ts +5 -1
  249. package/build/module/local/index.js +347 -13
  250. package/build/module/local/index.js.map +1 -1
  251. package/build/module/local/prune-pulled-schema.js +4 -1
  252. package/build/module/local/prune-pulled-schema.js.map +1 -1
  253. package/build/module/migration-source.d.ts +4 -0
  254. package/build/module/migration-source.js +42 -0
  255. package/build/module/migration-source.js.map +1 -0
  256. package/build/module/migration.d.ts +7 -0
  257. package/build/module/migration.js +8 -0
  258. package/build/module/migration.js.map +1 -0
  259. package/build/module/pganalyze-comment-plugin/comment-transformer.js +3 -1
  260. package/build/module/pganalyze-comment-plugin/comment-transformer.js.map +1 -1
  261. package/build/module/plugins.d.ts +2 -2
  262. package/build/module/plugins.js.map +1 -1
  263. package/build/module/postgres-error.d.ts +9 -0
  264. package/build/module/postgres-error.js +24 -0
  265. package/build/module/postgres-error.js.map +1 -0
  266. package/build/module/query/index.d.ts +1 -0
  267. package/build/module/query/index.js +1 -0
  268. package/build/module/query/index.js.map +1 -1
  269. package/build/module/query/listing/status.d.ts +2 -12
  270. package/build/module/query/listing/status.js +35 -18
  271. package/build/module/query/listing/status.js.map +1 -1
  272. package/build/module/query/tenant/billing-partner.d.ts +4 -0
  273. package/build/module/query/tenant/billing-partner.js +5 -0
  274. package/build/module/query/tenant/billing-partner.js.map +1 -0
  275. package/build/module/query/tenant/feature-enabled.d.ts +6 -0
  276. package/build/module/query/tenant/feature-enabled.js +27 -0
  277. package/build/module/query/tenant/feature-enabled.js.map +1 -0
  278. package/build/module/query/tenant/index.d.ts +4 -0
  279. package/build/module/query/tenant/index.js +5 -0
  280. package/build/module/query/tenant/index.js.map +1 -0
  281. package/build/module/query/tenant/status.d.ts +9 -0
  282. package/build/module/query/tenant/status.js +28 -0
  283. package/build/module/query/tenant/status.js.map +1 -0
  284. package/build/module/query/tenant/where-uuid-in.d.ts +2 -0
  285. package/build/module/query/tenant/where-uuid-in.js +11 -0
  286. package/build/module/query/tenant/where-uuid-in.js.map +1 -0
  287. package/build/module/regional.d.ts +31 -4
  288. package/build/module/regional.js +68 -8
  289. package/build/module/regional.js.map +1 -1
  290. package/build/module/test/index.d.ts +21 -11
  291. package/build/module/test/index.js +31 -26
  292. package/build/module/test/index.js.map +1 -1
  293. package/build/module/transaction.d.ts +3 -3
  294. package/build/module/transaction.js.map +1 -1
  295. package/build/module/v1.generated.d.ts +1335 -90
  296. package/build/module/v1.generated.js.map +1 -1
  297. package/package.json +19 -16
  298. package/build/migrations/0000000000001-init.ts +0 -5
  299. package/build/migrations/0000000000009-drop-store-schema.ts +0 -14
  300. package/build/migrations/0000000000010-bank-rules.ts +0 -190
  301. package/build/migrations/0000000000011-bank-rule-line-adjustments.ts +0 -65
  302. package/build/migrations/0000000000012-bank-rule-conditions.ts +0 -45
  303. package/build/migrations/0000000000013-bank-rule-name-unique.ts +0 -15
  304. package/build/migrations/0000000000014-bank-rule-drop-legacy-conditions.ts +0 -41
  305. package/build/migrations/0000000000015-booking-channel-logo-dev-provider.ts +0 -70
  306. package/build/migrations/0000000000016-owner-statement-draft-status.ts +0 -22
  307. package/build/migrations/0000000000017-tenant-migration-markers.ts +0 -18
  308. package/build/migrations/0000000000018-security-deposits-payable-category.ts +0 -63
  309. package/build/migrations/0000000000019-tenant-app-settings.ts +0 -76
  310. package/build/migrations/0000000000020-operating-opening-trial-balance.ts +0 -36
  311. package/build/migrations/0000000000021-audit-foreign-key-indexes.ts +0 -77
  312. package/build/migrations/0000000000022-opening-trial-balance-combined-columns.ts +0 -30
  313. package/build/migrations/0000000000024-listing-parent.ts +0 -37
  314. package/build/migrations/0000000000025-journal-entry-parent-listing.ts +0 -26
  315. package/build/migrations/0000000000026-booking-channel-logo-slots.ts +0 -89
  316. package/build/migrations/0000000000027-list-browse-performance-indexes.ts +0 -52
  317. package/build/migrations/0000000000028-flow-setting-status-jsonb.ts +0 -20
  318. package/build/migrations/0000000000029-tenant-slug.ts +0 -328
  319. package/build/migrations/0000000000030-pms-accounting-windows.ts +0 -50
  320. package/build/migrations/0000000000031-owner-statement-projection-listing-revision.ts +0 -20
  321. package/build/migrations/0000000000032-flow-event-listening.ts +0 -28
  322. package/build/migrations/0000000000033-opening-trial-balance-transaction.ts +0 -272
  323. package/build/migrations/0000000000034-historic-general-ledger.ts +0 -24
  324. package/build/migrations/0000000000035-tenant-regional-placement.ts +0 -37
  325. package/build/migrations/0000000000036-control-plane-projection-events.ts +0 -43
  326. package/build/migrations/0000000000037-tenant-guide-onboarding.ts +0 -21
  327. package/build/migrations/0000000000038-tracking-event-analytics-sink.ts +0 -31
  328. package/build/migrations/0000000000039-crunchy-region.ts +0 -86
  329. package/build/migrations/0000000000040-hostaway-region.ts +0 -72
  330. package/build/migrations/0000000000041-audit-tenant-fk.ts +0 -66
  331. package/build/migrations/0000000000042-ramp-staging-connect-params.ts +0 -35
  332. package/build/migrations/0000000000043-gl-pms-accounting-window-guard.ts +0 -125
  333. package/build/migrations/0000000000044-tenant-cross-region-fks.ts +0 -45
  334. package/build/migrations/0000000000045-cloudflare-region-env.ts +0 -100
  335. package/build/migrations/0000000000046-control-plane-outbox-alias.ts +0 -46
  336. package/build/migrations/0000000000047-ramp-contact-last-4-digits.ts +0 -16
  337. package/build/migrations/0000000000047-tenant-status-backfill.ts +0 -40
  338. package/build/migrations/0000000000048-tenant-status-constraint.ts +0 -24
@@ -1,4 +1,5 @@
1
- import type { ColumnType, Kysely as K } from 'kysely';
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,109 @@ 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 ControlPlaneReservationLineDefault {
314
+ accountKey: string | null;
315
+ bookingChannel: string | null;
316
+ bookingChannelKey: Generated<string>;
317
+ classificationId: string;
318
+ createdAt: Generated<Timestamp>;
319
+ id: Generated<string>;
320
+ partnerTenantId: string | null;
321
+ revenueRecognition: string | null;
322
+ revision: Generated<number>;
323
+ updatedAt: Generated<Timestamp>;
324
+ }
325
+ export interface ControlPlaneRolloutMonitorSnapshot {
326
+ monitorName: string;
327
+ result: Json;
328
+ snapshotDate: Timestamp;
329
+ }
330
+ export interface ControlPlaneTransactionLineMapping {
331
+ accountAssignmentType: string | null;
332
+ createdAt: Generated<Timestamp>;
333
+ deletedAt: Timestamp | null;
334
+ id: Generated<string>;
335
+ lineType: string;
336
+ revision: Generated<number>;
337
+ updatedAt: Generated<Timestamp>;
338
+ }
339
+ export interface ControlPlaneGeneralLedgerDefaultSet {
340
+ createdAt: Generated<Timestamp>;
341
+ id: Generated<string>;
342
+ partnerTenantId: string | null;
343
+ publishedVersion: number | null;
344
+ sourceDataRegion: string;
345
+ sourceDigest: string | null;
346
+ sourceTenantId: string;
347
+ templateKey: string;
348
+ updatedAt: Generated<Timestamp>;
349
+ }
350
+ export interface ControlPlaneGeneralLedgerDefaultVersion {
351
+ dataJson: Json;
352
+ defaultSetId: string;
353
+ id: Generated<string>;
354
+ publishedAt: Generated<Timestamp>;
355
+ sourceDigest: string;
356
+ sourceTenantId: string;
357
+ version: number;
358
+ }
359
+ export declare const CONTROL_PLANE_OUTBOX_MAX_ATTEMPTS = 25;
68
360
  export interface ControlPlaneOutbox {
69
361
  aggregateId: string;
70
362
  aggregateType: string;
@@ -78,23 +370,69 @@ export interface ControlPlaneOutbox {
78
370
  payload: Generated<Json>;
79
371
  publishedAt: Timestamp | null;
80
372
  }
373
+ export interface ControlPlanePartnerManagedTeamAssignment {
374
+ createdAt: Generated<Timestamp>;
375
+ managedTeamId: string;
376
+ partnerTenantId: string;
377
+ userId: string;
378
+ }
379
+ export interface ControlPlaneOwnerPortal {
380
+ hostname: string;
381
+ tenantId: string;
382
+ status: Generated<'pending' | 'active' | 'disabled'>;
383
+ name: string;
384
+ logo: string | null;
385
+ colorPrimary: string;
386
+ showPlatformBranding: Generated<boolean>;
387
+ linksEnabled: Generated<boolean>;
388
+ sender: {
389
+ from: string;
390
+ replyTo: string;
391
+ } | null;
392
+ revision: Generated<number>;
393
+ updatedAt: Generated<Timestamp>;
394
+ createdAt: Generated<Timestamp>;
395
+ wentLiveAt: Timestamp | null;
396
+ }
81
397
  export interface ControlPlaneTenant {
398
+ billingPartnerId: string | null;
82
399
  billingPlan: string | null;
83
400
  createdAt: Generated<Timestamp>;
84
401
  dataRegion: Generated<string>;
85
402
  id: Generated<string>;
403
+ lockedAt: Timestamp | null;
404
+ migrationStatus: Generated<string>;
86
405
  name: string;
87
406
  partnerId: string | null;
407
+ partnerDeniedPermissions: Generated<string[]>;
88
408
  slug: string;
89
409
  status: Generated<string | null>;
90
410
  storageRealm: Generated<string>;
91
411
  type: Generated<string | null>;
412
+ uniqueRef: string | null;
92
413
  updatedAt: Generated<Timestamp | null>;
93
414
  }
415
+ export interface ControlPlaneTenantRegionMigration {
416
+ actor: string;
417
+ completedAt: Timestamp | null;
418
+ error: Json | null;
419
+ id: string;
420
+ reason: string;
421
+ sourceManifest: Json | null;
422
+ sourceRegion: string;
423
+ startedAt: Generated<Timestamp>;
424
+ status: Generated<string>;
425
+ targetManifest: Json | null;
426
+ targetRegion: string;
427
+ tenantId: string;
428
+ updatedAt: Generated<Timestamp>;
429
+ }
94
430
  export interface ControlPlaneTenantUser {
95
431
  createdAt: Generated<Timestamp | null>;
96
432
  id: Generated<string>;
97
433
  lastInvitedAt: Timestamp | null;
434
+ managedTeamAccess: Generated<'all' | 'assigned'>;
435
+ permissionBundles: Generated<string[]>;
98
436
  role: Generated<string | null>;
99
437
  status: Generated<string | null>;
100
438
  tenantId: string;
@@ -107,36 +445,97 @@ export interface ControlPlaneToken {
107
445
  id: Generated<string>;
108
446
  nanoId: Generated<string>;
109
447
  payload: Generated<Json>;
448
+ secretHash: string | null;
110
449
  tenantId: string | null;
111
450
  type: string | null;
112
451
  userId: string | null;
113
452
  }
114
453
  export interface ControlPlaneUser {
454
+ appSettings: Generated<Json>;
115
455
  clerkId: string | null;
116
456
  createdAt: Generated<Timestamp | null>;
117
457
  email: string | null;
118
458
  firstName: string | null;
119
459
  id: Generated<string>;
460
+ internalOperationGrants: Generated<string[]>;
120
461
  isAdmin: Generated<boolean>;
121
462
  lastName: string | null;
463
+ lastSeen: Timestamp | null;
122
464
  name: string | null;
123
465
  partnerId: string | null;
466
+ phone: string | null;
467
+ secondaryEmails: Generated<Json>;
124
468
  status: Generated<string | null>;
125
469
  sub: string | null;
126
470
  type: Generated<string | null>;
127
471
  updatedAt: Generated<Timestamp | null>;
128
472
  }
473
+ export type ControlPlaneWebhookSubscriptionEventType = 'audit.event.changed' | 'connection.changed' | 'listing.changed' | 'reservation.changed' | 'statement.status.changed' | 'sync.status.changed' | 'team.issues.changed' | 'transaction.changed';
474
+ export interface ControlPlaneWebhookSubscription {
475
+ apiVersion: '2026-07-01';
476
+ createdAt: Generated<Timestamp>;
477
+ description: string | null;
478
+ disabledAt: Timestamp | null;
479
+ eventTypes: ControlPlaneWebhookSubscriptionEventType[];
480
+ id: Generated<string>;
481
+ ownerTenantId: string;
482
+ revision: Generated<Int8>;
483
+ scope: 'managedTeams' | 'self';
484
+ status: Generated<'active' | 'disabled' | 'pending'>;
485
+ updatedAt: Generated<Timestamp>;
486
+ url: string;
487
+ verifiedAt: Timestamp | null;
488
+ }
489
+ export interface ControlPlaneWebhookSubscriptionSecret {
490
+ activeFrom: Generated<Timestamp>;
491
+ createdAt: Generated<Timestamp>;
492
+ encryptedSecret: string;
493
+ encryptionKeyId: string;
494
+ expiresAt: Timestamp | null;
495
+ id: Generated<string>;
496
+ reencryptionFailedAt: Timestamp | null;
497
+ reencryptionFailureCode: string | null;
498
+ revokedAt: Timestamp | null;
499
+ subscriptionId: string;
500
+ }
129
501
  export interface ControlPlaneDB {
130
- 'public.app': ControlPlaneApp;
131
- 'public.bookingChannel': ControlPlaneBookingChannel;
132
- 'public.connectionRoute': ControlPlaneConnectionRoute;
133
- 'public.currency': ControlPlaneCurrency;
134
- 'public.feature': ControlPlaneFeature;
135
- 'public.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;
136
- 'public.controlPlaneOutbox': ControlPlaneOutbox;
137
- 'public.tenant': ControlPlaneTenant;
138
- 'public.tenantUser': ControlPlaneTenantUser;
139
- 'public.token': ControlPlaneToken;
140
- 'public.user': ControlPlaneUser;
141
- }
142
- export type ControlPlaneKysely = K<ControlPlaneDB>;
502
+ 'controlPlane.accountingIntegrityDefinitionDraft': ControlPlaneAccountingIntegrityDefinitionDraft;
503
+ 'controlPlane.accountingIntegrityDefinitionVersion': ControlPlaneAccountingIntegrityDefinitionVersion;
504
+ 'controlPlane.accountingIntegrityEvaluation': ControlPlaneAccountingIntegrityEvaluation;
505
+ 'controlPlane.app': ControlPlaneApp;
506
+ 'controlPlane.bookingChannel': ControlPlaneBookingChannel;
507
+ 'controlPlane.bookingChannelIconCandidate': ControlPlaneBookingChannelIconCandidate;
508
+ 'controlPlane.connectionRoute': ControlPlaneConnectionRoute;
509
+ 'controlPlane.controlPlaneOutbox': ControlPlaneOutbox;
510
+ 'controlPlane.currency': ControlPlaneCurrency;
511
+ 'controlPlane.destructiveJob': ControlPlaneDestructiveJob;
512
+ 'controlPlane.destructiveJobAttempt': ControlPlaneDestructiveJobAttempt;
513
+ 'controlPlane.destructiveJobOperation': ControlPlaneDestructiveJobOperation;
514
+ 'controlPlane.events': ControlPlaneEvent;
515
+ 'controlPlane.feature': ControlPlaneFeature;
516
+ 'controlPlane.featureApproval': ControlPlaneFeatureApproval;
517
+ 'controlPlane.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;
518
+ 'controlPlane.generalLedgerDefaultSet': ControlPlaneGeneralLedgerDefaultSet;
519
+ 'controlPlane.generalLedgerDefaultVersion': ControlPlaneGeneralLedgerDefaultVersion;
520
+ 'controlPlane.lineClassification': ControlPlaneLineClassification;
521
+ 'controlPlane.lineClassificationTeamUsage': ControlPlaneLineClassificationTeamUsage;
522
+ 'controlPlane.operation': ControlPlaneOperation;
523
+ 'controlPlane.operationResource': ControlPlaneOperationResource;
524
+ 'controlPlane.operationSource': ControlPlaneOperationSource;
525
+ 'controlPlane.partnerManagedTeamAssignment': ControlPlanePartnerManagedTeamAssignment;
526
+ 'controlPlane.reservationLineDefault': ControlPlaneReservationLineDefault;
527
+ 'controlPlane.rolloutMonitorSnapshot': ControlPlaneRolloutMonitorSnapshot;
528
+ 'controlPlane.ownerPortal': ControlPlaneOwnerPortal;
529
+ 'controlPlane.tenant': ControlPlaneTenant;
530
+ 'controlPlane.tenantRegionMigration': ControlPlaneTenantRegionMigration;
531
+ 'controlPlane.tenantUser': ControlPlaneTenantUser;
532
+ 'controlPlane.trackingQueueFailure': ControlPlaneTrackingQueueFailure;
533
+ 'controlPlane.token': ControlPlaneToken;
534
+ 'controlPlane.transactionLineMapping': ControlPlaneTransactionLineMapping;
535
+ 'controlPlane.user': ControlPlaneUser;
536
+ 'controlPlane.webhookSubscription': ControlPlaneWebhookSubscription;
537
+ 'controlPlane.webhookSubscriptionSecret': ControlPlaneWebhookSubscriptionSecret;
538
+ 'controlPlaneCore.flow': ControlPlaneFlow;
539
+ 'controlPlaneCore.issueMessageOverwrite': ControlPlaneIssueMessageOverwrite;
540
+ }
541
+ export declare function withControlPlaneSchema(kysely: Kysely<ControlPlaneDB>, schema: string, issueMessageOverwriteSchema?: string): Kysely<ControlPlaneDB>;
@@ -1,2 +1,59 @@
1
- export {};
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColumnType, Kysely as K } from 'kysely';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n billingPlan: string | null;\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n name: string;\n partnerId: string | null;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n name: string | null;\n partnerId: string | null;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneDB {\n 'public.app': ControlPlaneApp;\n 'public.bookingChannel': ControlPlaneBookingChannel;\n 'public.connectionRoute': ControlPlaneConnectionRoute;\n 'public.currency': ControlPlaneCurrency;\n 'public.feature': ControlPlaneFeature;\n 'public.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'public.controlPlaneOutbox': ControlPlaneOutbox;\n 'public.tenant': ControlPlaneTenant;\n 'public.tenantUser': ControlPlaneTenantUser;\n 'public.token': ControlPlaneToken;\n 'public.user': ControlPlaneUser;\n}\n\nexport type ControlPlaneKysely = K<ControlPlaneDB>;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAGd,wBAAwB,GAQzB,MAAM,QAAQ,CAAC;AAqdhB,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,0EAA0E;AAC1E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAwMpD,MAAM,6BAA8B,SAAQ,wBAAwB;IAEvD,MAAM;IACN,2BAA2B;IAFtC,YACW,MAAc,EACd,2BAAmC;QAE5C,KAAK,EAAE,CAAC;sBAHC,MAAM;2CACN,2BAA2B;IAGtC,CAAC;IAEkB,4BAA4B,CAC7C,IAA6B,EAC7B,OAAgB;QAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtE,IACE,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,cAAc;YAC3C,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,eAAe,EAC5C,CAAC;YACD,OAAO,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,CAAC;QACD,IACE,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,kBAAkB;YAC/C,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,oBAAoB,EACjD,CAAC;YACD,OAAO;gBACL,GAAG,WAAW;gBACd,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;aAChE,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEkB,iBAAiB,CAClC,IAAkB,EAClB,OAAgB;QAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YAC1C,CAAC,CAAC;gBACE,GAAG,WAAW;gBACd,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE;aACzE;YACH,CAAC,CAAC,WAAW,CAAC;IAClB,CAAC;CACF;AAED,MAAM,wBAAwB;IACnB,YAAY,CAAgC;IAErD,YAAY,MAAc,EAAE,2BAAmC;QAC7D,IAAI,CAAC,YAAY,GAAG,IAAI,6BAA6B,CACnD,MAAM,EACN,2BAA2B,CAC5B,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,IAA8B;QAC3C,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,IAA+B;QAE/B,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAED,MAAM,UAAU,sBAAsB,CACpC,MAA8B,EAC9B,MAAc,EACd,2BAA2B,GAAG,MAAM;IAEpC,OAAO,MAAM,CAAC,UAAU,CACtB,IAAI,wBAAwB,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAClE,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ColumnType,\n type FunctionNode,\n IdentifierNode,\n type Kysely,\n type KyselyPlugin,\n OperationNodeTransformer,\n type PluginTransformQueryArgs,\n type PluginTransformResultArgs,\n type QueryId,\n type QueryResult,\n type RootOperationNode,\n type SchemableIdentifierNode,\n type UnknownRow,\n} from 'kysely';\nimport type { TenantDataRegion } from '../regional';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Int8 = ColumnType<\n string,\n number | string | bigint,\n number | string | bigint\n>;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport type ControlPlaneOperationStatus =\n | 'completed'\n | 'failed'\n | 'queued'\n | 'running';\n\nexport type ControlPlaneOperationType =\n | 'ach-verification'\n | 'advanced-deposits-update'\n | 'bank-rule-run'\n | 'calendar-block'\n | 'calendar-unblock'\n | 'connection-archive'\n | 'connection-connect'\n | 'connection-extract'\n | 'connection-sync'\n | 'csv-import'\n | 'csv-import-preview'\n | 'export'\n | 'flow-run'\n | 'historical-gl-import'\n | 'historical-statement-import'\n | 'listing-journal-refresh'\n | 'plaid-initial-sync'\n | 'pms-cutover'\n | 'pms-cutover-preview'\n | 'provider-payment'\n | 'provider-payment-recovery'\n | 'recurring-transaction-run'\n | 'reservation-journal-refresh'\n | 'reservation-line-mapping-update'\n | 'statement-payout'\n | 'statement-payout-preview'\n | 'team-delete'\n | 'team-demo-data'\n | 'team-duplicate'\n | 'team-initialize'\n | 'transaction-journal-refresh'\n | 'vri-statement-import'\n | 'vri-team-migration'\n | 'webhook-test';\n\nexport type ControlPlaneOperationResourceRole = 'result' | 'source' | 'target';\n\nexport type ControlPlaneOperationResourceType =\n | 'bank-rule'\n | 'connection'\n | 'contact'\n | 'file'\n | 'flow'\n | 'listing'\n | 'recurring-fee'\n | 'recurring-transaction-template'\n | 'reservation'\n | 'statement'\n | 'team'\n | 'transaction'\n | 'webhook';\n\nexport type ControlPlaneOperationSourceType =\n | 'destructive-job'\n | 'regional-operation';\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneAccountingIntegrityEvaluation {\n caseCount: Generated<Int8>;\n completedAt: Timestamp | null;\n completedRunCount: Generated<number>;\n createdAt: Generated<Timestamp>;\n environment: string;\n error: Json | null;\n expectedRunCount: number;\n failedRunCount: Generated<number>;\n findingRowCount: Generated<Int8>;\n gitRevision: string;\n id: string;\n results: Generated<Json>;\n rowsScanned: Generated<Int8>;\n skippedRunCount: Generated<number>;\n source: string;\n startedAt: Timestamp;\n status: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneAccountingIntegrityDefinitionDraft {\n artifact: Json;\n artifactHash: string;\n code: string;\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n ownerId: string;\n previewResult: Json | null;\n rationale: string;\n revision: Generated<number>;\n status: string;\n templateId: string;\n templateVersion: number;\n title: string;\n updatedAt: Generated<Timestamp>;\n validationResult: Json | null;\n}\n\nexport interface ControlPlaneAccountingIntegrityDefinitionVersion {\n artifact: Json;\n artifactHash: string;\n code: string;\n draftId: string;\n id: Generated<string>;\n publishedAt: Generated<Timestamp>;\n publishedBy: string;\n rollout: string;\n templateId: string;\n templateVersion: number;\n version: number;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneBookingChannelIconCandidate {\n bookingChannelId: string;\n cloudflareImageId: string | null;\n color: string | null;\n comment: string | null;\n createdAt: Generated<Timestamp>;\n externalIcon: string | null;\n height: number | null;\n id: Generated<string>;\n provider: Generated<string>;\n source: string | null;\n updatedAt: Generated<Timestamp>;\n width: number | null;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport type DestructiveJobStep =\n | 'completed'\n | 'completion_effects'\n | 'control_plane_deleted'\n | 'control_plane_deleting'\n | 'queued'\n | 'regional_deleted'\n | 'regional_deleting'\n | 'validated';\n\nexport interface ControlPlaneDestructiveJob {\n attempts: Generated<number>;\n authorizedByTenantId: string;\n availableAt: Generated<Timestamp>;\n claimedAt: Timestamp | null;\n claimedBy: string | null;\n completedAt: Timestamp | null;\n completionData: Json | null;\n completionWarningCode: string | null;\n completionWarningDetails: Json | null;\n createdAt: Generated<Timestamp>;\n dataRegion: TenantDataRegion;\n failureCode: string | null;\n failureDetails: Json | null;\n force: Generated<boolean>;\n id: Generated<string>;\n jobType: 'tenant.delete';\n maxAttempts: Generated<number>;\n requestId: string | null;\n requestedByActorType: 'api_key' | 'system' | 'user';\n requestedByTenantId: string;\n requestedByUserId: string | null;\n startedAt: Timestamp | null;\n status: Generated<'canceled' | 'completed' | 'failed' | 'queued' | 'running'>;\n step: Generated<DestructiveJobStep>;\n targetId: string;\n triggerRunId: string | null;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneDestructiveJobAttempt {\n attemptNumber: number;\n failureCode: string | null;\n failureDetails: Json | null;\n finishedAt: Timestamp | null;\n id: Generated<string>;\n jobId: string;\n startedAt: Generated<Timestamp>;\n status: Generated<'completed' | 'failed' | 'running' | 'superseded'>;\n step: DestructiveJobStep;\n triggerRunId: string | null;\n}\n\nexport interface ControlPlaneDestructiveJobOperation {\n action: 'abandon' | 'cancel' | 'retry';\n actor: string;\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n jobId: string;\n previousStatus: string;\n previousStep: string;\n reasonCode: string;\n}\n\nexport interface ControlPlaneOperation {\n createdAt: Generated<Timestamp>;\n failureCode: string | null;\n failureMessage: string | null;\n finishedAt: Timestamp | null;\n id: Generated<string>;\n initiatedByUserId: string | null;\n requesterTenantId: string;\n retainUntil: Timestamp | null;\n sourceRegion: TenantDataRegion | null;\n sourceVersion: Generated<number>;\n startedAt: Timestamp | null;\n status: Generated<ControlPlaneOperationStatus>;\n type: ControlPlaneOperationType;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOperationResource {\n createdAt: Generated<Timestamp>;\n isPrimary: Generated<boolean>;\n operationId: string;\n resourceId: string;\n resourceType: ControlPlaneOperationResourceType;\n role: ControlPlaneOperationResourceRole;\n}\n\nexport interface ControlPlaneOperationSource {\n finishedAt: Timestamp | null;\n operationId: string;\n required: Generated<boolean>;\n sourceId: string;\n sourceType: ControlPlaneOperationSourceType;\n sourceVersion: Generated<number>;\n startedAt: Timestamp | null;\n status: Generated<ControlPlaneOperationStatus>;\n}\n\nexport interface ControlPlaneEvent {\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n name: string;\n packageName: string;\n props: Json;\n tenantId: string | null;\n timestamp: Generated<Timestamp>;\n trackedAt: Generated<Timestamp | null>;\n userId: string | null;\n}\n\nexport interface ControlPlaneTrackingQueueFailure {\n bodyFingerprint: string | null;\n capturedAt: Generated<Timestamp>;\n dispositionAt: Timestamp | null;\n dispositionHistory: Generated<Json[]>;\n dispositionReasonCode: string | null;\n dispositionActor: string | null;\n environment: 'production' | 'staging';\n event: Json | null;\n eventId: string | null;\n expiresAt: Timestamp;\n failureCode: string;\n id: Generated<string>;\n lastReplayedAt: Timestamp | null;\n queueMessageId: string;\n replayCount: Generated<number>;\n recurrenceCount: Generated<number>;\n status: Generated<'captured' | 'discarded' | 'replayed'>;\n updatedAt: Generated<Timestamp>;\n validationIssues: Json | null;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeatureApproval {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n updatedAt: Generated<Timestamp>;\n userId: string;\n}\n\nexport interface ControlPlaneFlow {\n appId: string;\n createdAt: Generated<Timestamp>;\n description: string | null;\n eventListening: Generated<Json>;\n id: Generated<string>;\n isPublic: Generated<boolean>;\n leftType: string | null;\n mappingSchema: Generated<Json>;\n revision: Generated<number>;\n rightType: string | null;\n runSchema: Generated<Json>;\n settingSchema: Generated<Json>;\n title: string;\n type: 'pull' | 'push' | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n useGlobalMapping: Generated<boolean>;\n}\n\nexport interface ControlPlaneIssueMessageOverwrite {\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n message: string;\n pattern: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneLineClassification {\n appConflict: Generated<boolean>;\n appId: string | null;\n createdAt: Generated<Timestamp>;\n firstSeenAt: Timestamp;\n id: Generated<string>;\n kind: string;\n lastSeenAt: Timestamp;\n name: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneLineClassificationTeamUsage {\n classificationId: string;\n createdAt: Generated<Timestamp>;\n dataRegion: string;\n firstSeenAt: Timestamp;\n lastSeenAt: Timestamp;\n mappingStatus: string | null;\n revision: number;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneReservationLineDefault {\n accountKey: string | null;\n bookingChannel: string | null;\n bookingChannelKey: Generated<string>;\n classificationId: string;\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n partnerTenantId: string | null;\n revenueRecognition: string | null;\n revision: Generated<number>;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneRolloutMonitorSnapshot {\n monitorName: string;\n result: Json;\n snapshotDate: Timestamp;\n}\n\nexport interface ControlPlaneTransactionLineMapping {\n accountAssignmentType: string | null;\n createdAt: Generated<Timestamp>;\n deletedAt: Timestamp | null;\n id: Generated<string>;\n lineType: string;\n revision: Generated<number>;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneGeneralLedgerDefaultSet {\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n partnerTenantId: string | null;\n publishedVersion: number | null;\n sourceDataRegion: string;\n sourceDigest: string | null;\n sourceTenantId: string;\n templateKey: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneGeneralLedgerDefaultVersion {\n dataJson: Json;\n defaultSetId: string;\n id: Generated<string>;\n publishedAt: Generated<Timestamp>;\n sourceDigest: string;\n sourceTenantId: string;\n version: number;\n}\n\n// A poison event (e.g. a user.deleted blocked by a regional foreign key) can\n// never succeed; without a cap it retries every drain tick forever. After this\n// many attempts we stop reprocessing it, leave it unpublished for a human to\n// resolve, and keep it blocking newer versions of the same aggregate. A later\n// terminal delete is an automatic exception because it makes the older event\n// obsolete without repairing regional data. So is a user or membership upsert\n// that exhausted its attempts after the control plane stopped holding the\n// aggregate, and an older feature snapshot that a newer snapshot replaces.\nexport const CONTROL_PLANE_OUTBOX_MAX_ATTEMPTS = 25;\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlanePartnerManagedTeamAssignment {\n createdAt: Generated<Timestamp>;\n managedTeamId: string;\n partnerTenantId: string;\n userId: string;\n}\n\nexport interface ControlPlaneOwnerPortal {\n hostname: string;\n tenantId: string;\n status: Generated<'pending' | 'active' | 'disabled'>;\n name: string;\n logo: string | null;\n colorPrimary: string;\n showPlatformBranding: Generated<boolean>;\n linksEnabled: Generated<boolean>;\n sender: { from: string; replyTo: string } | null;\n revision: Generated<number>;\n updatedAt: Generated<Timestamp>;\n createdAt: Generated<Timestamp>;\n wentLiveAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n billingPartnerId: string | null;\n billingPlan: string | null;\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n lockedAt: Timestamp | null;\n migrationStatus: Generated<string>;\n name: string;\n partnerId: string | null;\n partnerDeniedPermissions: Generated<string[]>;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n uniqueRef: string | null;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantRegionMigration {\n actor: string;\n completedAt: Timestamp | null;\n error: Json | null;\n id: string;\n reason: string;\n sourceManifest: Json | null;\n sourceRegion: string;\n startedAt: Generated<Timestamp>;\n status: Generated<string>;\n targetManifest: Json | null;\n targetRegion: string;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n managedTeamAccess: Generated<'all' | 'assigned'>;\n permissionBundles: Generated<string[]>;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n secretHash: string | null;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n appSettings: Generated<Json>;\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n internalOperationGrants: Generated<string[]>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n lastSeen: Timestamp | null;\n name: string | null;\n partnerId: string | null;\n phone: string | null;\n secondaryEmails: Generated<Json>;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport type ControlPlaneWebhookSubscriptionEventType =\n | 'audit.event.changed'\n | 'connection.changed'\n | 'listing.changed'\n | 'reservation.changed'\n | 'statement.status.changed'\n | 'sync.status.changed'\n | 'team.issues.changed'\n | 'transaction.changed';\n\nexport interface ControlPlaneWebhookSubscription {\n apiVersion: '2026-07-01';\n createdAt: Generated<Timestamp>;\n description: string | null;\n disabledAt: Timestamp | null;\n eventTypes: ControlPlaneWebhookSubscriptionEventType[];\n id: Generated<string>;\n ownerTenantId: string;\n revision: Generated<Int8>;\n scope: 'managedTeams' | 'self';\n status: Generated<'active' | 'disabled' | 'pending'>;\n updatedAt: Generated<Timestamp>;\n url: string;\n verifiedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneWebhookSubscriptionSecret {\n activeFrom: Generated<Timestamp>;\n createdAt: Generated<Timestamp>;\n encryptedSecret: string;\n encryptionKeyId: string;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n reencryptionFailedAt: Timestamp | null;\n reencryptionFailureCode: string | null;\n revokedAt: Timestamp | null;\n subscriptionId: string;\n}\n\nexport interface ControlPlaneDB {\n 'controlPlane.accountingIntegrityDefinitionDraft': ControlPlaneAccountingIntegrityDefinitionDraft;\n 'controlPlane.accountingIntegrityDefinitionVersion': ControlPlaneAccountingIntegrityDefinitionVersion;\n 'controlPlane.accountingIntegrityEvaluation': ControlPlaneAccountingIntegrityEvaluation;\n 'controlPlane.app': ControlPlaneApp;\n 'controlPlane.bookingChannel': ControlPlaneBookingChannel;\n 'controlPlane.bookingChannelIconCandidate': ControlPlaneBookingChannelIconCandidate;\n 'controlPlane.connectionRoute': ControlPlaneConnectionRoute;\n 'controlPlane.controlPlaneOutbox': ControlPlaneOutbox;\n 'controlPlane.currency': ControlPlaneCurrency;\n 'controlPlane.destructiveJob': ControlPlaneDestructiveJob;\n 'controlPlane.destructiveJobAttempt': ControlPlaneDestructiveJobAttempt;\n 'controlPlane.destructiveJobOperation': ControlPlaneDestructiveJobOperation;\n 'controlPlane.events': ControlPlaneEvent;\n 'controlPlane.feature': ControlPlaneFeature;\n 'controlPlane.featureApproval': ControlPlaneFeatureApproval;\n 'controlPlane.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'controlPlane.generalLedgerDefaultSet': ControlPlaneGeneralLedgerDefaultSet;\n 'controlPlane.generalLedgerDefaultVersion': ControlPlaneGeneralLedgerDefaultVersion;\n 'controlPlane.lineClassification': ControlPlaneLineClassification;\n 'controlPlane.lineClassificationTeamUsage': ControlPlaneLineClassificationTeamUsage;\n 'controlPlane.operation': ControlPlaneOperation;\n 'controlPlane.operationResource': ControlPlaneOperationResource;\n 'controlPlane.operationSource': ControlPlaneOperationSource;\n 'controlPlane.partnerManagedTeamAssignment': ControlPlanePartnerManagedTeamAssignment;\n 'controlPlane.reservationLineDefault': ControlPlaneReservationLineDefault;\n 'controlPlane.rolloutMonitorSnapshot': ControlPlaneRolloutMonitorSnapshot;\n 'controlPlane.ownerPortal': ControlPlaneOwnerPortal;\n 'controlPlane.tenant': ControlPlaneTenant;\n 'controlPlane.tenantRegionMigration': ControlPlaneTenantRegionMigration;\n 'controlPlane.tenantUser': ControlPlaneTenantUser;\n 'controlPlane.trackingQueueFailure': ControlPlaneTrackingQueueFailure;\n 'controlPlane.token': ControlPlaneToken;\n 'controlPlane.transactionLineMapping': ControlPlaneTransactionLineMapping;\n 'controlPlane.user': ControlPlaneUser;\n 'controlPlane.webhookSubscription': ControlPlaneWebhookSubscription;\n 'controlPlane.webhookSubscriptionSecret': ControlPlaneWebhookSubscriptionSecret;\n 'controlPlaneCore.flow': ControlPlaneFlow;\n 'controlPlaneCore.issueMessageOverwrite': ControlPlaneIssueMessageOverwrite;\n}\n\nclass ControlPlaneSchemaTransformer extends OperationNodeTransformer {\n constructor(\n readonly schema: string,\n readonly issueMessageOverwriteSchema: string\n ) {\n super();\n }\n\n protected override transformSchemableIdentifier(\n node: SchemableIdentifierNode,\n queryId: QueryId\n ): SchemableIdentifierNode {\n const transformed = super.transformSchemableIdentifier(node, queryId);\n if (\n transformed.schema?.name === 'controlPlane' ||\n transformed.schema?.name === 'control_plane'\n ) {\n return { ...transformed, schema: IdentifierNode.create(this.schema) };\n }\n if (\n transformed.schema?.name === 'controlPlaneCore' ||\n transformed.schema?.name === 'control_plane_core'\n ) {\n return {\n ...transformed,\n schema: IdentifierNode.create(this.issueMessageOverwriteSchema),\n };\n }\n return transformed;\n }\n\n protected override transformFunction(\n node: FunctionNode,\n queryId: QueryId\n ): FunctionNode {\n const transformed = super.transformFunction(node, queryId);\n return node.func.startsWith('controlPlane.')\n ? {\n ...transformed,\n func: `${this.schema}.${transformed.func.slice('controlPlane.'.length)}`,\n }\n : transformed;\n }\n}\n\nclass ControlPlaneSchemaPlugin implements KyselyPlugin {\n readonly #transformer: ControlPlaneSchemaTransformer;\n\n constructor(schema: string, issueMessageOverwriteSchema: string) {\n this.#transformer = new ControlPlaneSchemaTransformer(\n schema,\n issueMessageOverwriteSchema\n );\n }\n\n transformQuery(args: PluginTransformQueryArgs): RootOperationNode {\n return this.#transformer.transformNode(args.node, args.queryId);\n }\n\n async transformResult(\n args: PluginTransformResultArgs\n ): Promise<QueryResult<UnknownRow>> {\n return args.result;\n }\n}\n\nexport function withControlPlaneSchema(\n kysely: Kysely<ControlPlaneDB>,\n schema: string,\n issueMessageOverwriteSchema = 'core'\n) {\n return kysely.withPlugin(\n new ControlPlaneSchemaPlugin(schema, issueMessageOverwriteSchema)\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ /** Values seeded in public.currency for database and API contracts. */
2
+ export type CurrencyCode = 'aed' | 'afn' | 'all' | 'amd' | 'ang' | 'aoa' | 'ars' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bhd' | 'bif' | 'bmd' | 'bnd' | 'bob' | 'bov' | 'brl' | 'bsd' | 'btn' | 'bwp' | 'byn' | 'byr' | 'bzd' | 'cad' | 'cdf' | 'che' | 'chf' | 'chw' | 'clf' | 'clp' | 'cny' | 'cop' | 'cou' | 'crc' | 'cuc' | 'cup' | 'cve' | 'czk' | 'djf' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'ern' | 'etb' | 'eur' | 'fjd' | 'fkp' | 'gbp' | 'gel' | 'ghs' | 'gip' | 'gmd' | 'gnf' | 'gtq' | 'gyd' | 'hkd' | 'hnl' | 'hrk' | 'htg' | 'huf' | 'idr' | 'ils' | 'inr' | 'iqd' | 'irr' | 'isk' | 'jmd' | 'jod' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'kpw' | 'krw' | 'kwd' | 'kyd' | 'kzt' | 'lak' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'ltl' | 'lvl' | 'lyd' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mur' | 'mvr' | 'mwk' | 'mxn' | 'mxv' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nio' | 'nok' | 'npr' | 'nzd' | 'omr' | 'pab' | 'pen' | 'pgk' | 'php' | 'pkr' | 'pln' | 'pyg' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sdg' | 'sek' | 'sgd' | 'shp' | 'sll' | 'sos' | 'srd' | 'ssp' | 'std' | 'syp' | 'szl' | 'thb' | 'tjs' | 'tmt' | 'tnd' | 'top' | 'try' | 'ttd' | 'twd' | 'tzs' | 'uah' | 'ugx' | 'usd' | 'usn' | 'uss' | 'uyi' | 'uyu' | 'uzs' | 'vef' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xag' | 'xau' | 'xba' | 'xbb' | 'xbc' | 'xbd' | 'xcd' | 'xdr' | 'xfu' | 'xof' | 'xpd' | 'xpf' | 'xpt' | 'xts' | 'xxx' | 'yer' | 'zar' | 'zmw' | 'zwl';
3
+ /** Values seeded in public.listing_ownership_period_business_model. */
4
+ export type ListingOwnershipPeriodBusinessModel = 'co_host' | 'co_host_airbnb' | 'managed';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=domain.js.map