@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,18 +1,28 @@
1
- import type { Kysely } from 'kysely';
2
- import { type UseLocalKyselyOptions } from '../local';
3
- import type { DB } from '../v1.generated';
1
+ import { type LocalKysely, type UseLocalKyselyOptions } from '../local';
2
+ type UseTestKyselyOptions = UseLocalKyselyOptions & {
3
+ /**
4
+ * Force a private database even when the worker shares one. Required by specs
5
+ * that model several regions at once, where two handles must be two distinct
6
+ * physical databases, or that run a worker over every tenant's rows.
7
+ */
8
+ isolated?: boolean;
9
+ };
4
10
  declare global {
5
- var __vrplatform_testSharedKysely: Promise<Kysely<DB>> | Kysely<DB> | undefined;
11
+ var __vrplatformSharedKysely: Promise<LocalKysely> | undefined;
6
12
  }
7
13
  /**
8
- * @deprecated Use `useLocalKyselyResource` instead.
14
+ * Each worker process shares one database, locally and on CI: specs isolate by
15
+ * tenant, and booting PGlite per spec file made the suite about 65 % slower.
16
+ * A spec that reads rows of other tenants is a bug in that spec.
17
+ *
18
+ * VR_TEST_SHARED_KYSELY=0 restores one database per file; `isolated: true` opts
19
+ * a single call out when a spec genuinely needs its own physical database, such
20
+ * as two regions at once or a worker that drains every tenant.
9
21
  */
10
- export declare function useTestKysely(cleanupStrategy: 'afterAll', args?: UseLocalKyselyOptions): Promise<{
11
- kysely: Kysely<DB>;
12
- }>;
13
- export declare function useTestAutoCleanupKysely(args?: UseLocalKyselyOptions): Promise<Kysely<DB>>;
14
- type ReturnType = Kysely<DB> & {
22
+ export declare function resolveSharedKysely(env: Record<string, string | undefined>): boolean;
23
+ export declare function useTestAutoCleanupKysely(args?: UseTestKyselyOptions): Promise<LocalKysely>;
24
+ type ReturnType = LocalKysely & {
15
25
  [Symbol.dispose]: () => Promise<void>;
16
26
  };
17
- export declare function useLocalKyselyResource(args?: UseLocalKyselyOptions): Promise<ReturnType>;
27
+ export declare function useLocalKyselyResource(args?: UseTestKyselyOptions): Promise<ReturnType>;
18
28
  export {};
@@ -1,51 +1,56 @@
1
1
  import { afterAll } from 'bun:test';
2
- import { useLocalKysely } from '../local';
2
+ import { useLocalKysely, } from '../local';
3
3
  /**
4
- * @deprecated Use `useLocalKyselyResource` instead.
4
+ * Each worker process shares one database, locally and on CI: specs isolate by
5
+ * tenant, and booting PGlite per spec file made the suite about 65 % slower.
6
+ * A spec that reads rows of other tenants is a bug in that spec.
7
+ *
8
+ * VR_TEST_SHARED_KYSELY=0 restores one database per file; `isolated: true` opts
9
+ * a single call out when a spec genuinely needs its own physical database, such
10
+ * as two regions at once or a worker that drains every tenant.
5
11
  */
6
- export async function useTestKysely(cleanupStrategy, args) {
7
- const kysely = await useLocalKysely(args);
8
- if (cleanupStrategy === 'afterAll')
12
+ export function resolveSharedKysely(env) {
13
+ return env.VR_TEST_SHARED_KYSELY !== '0';
14
+ }
15
+ const sharedKysely = resolveSharedKysely(process.env);
16
+ function acquireKysely(args) {
17
+ if (!sharedKysely || args?.isolated)
18
+ return useLocalKysely(args);
19
+ globalThis.__vrplatformSharedKysely ??= useLocalKysely(args);
20
+ return globalThis.__vrplatformSharedKysely;
21
+ }
22
+ function ownsKysely(args) {
23
+ return !sharedKysely || Boolean(args?.isolated);
24
+ }
25
+ export async function useTestAutoCleanupKysely(args) {
26
+ const kysely = await acquireKysely(args);
27
+ if (ownsKysely(args)) {
9
28
  afterAll(async () => {
10
29
  await kysely.destroy();
11
30
  });
12
- return {
13
- kysely,
14
- };
15
- }
16
- export async function useTestAutoCleanupKysely(args) {
17
- if (process.env.VR_TEST_SHARED_KYSELY === '1') {
18
- const existing = globalThis.__vrplatform_testSharedKysely;
19
- if (!existing) {
20
- const created = useLocalKysely(args);
21
- globalThis.__vrplatform_testSharedKysely = created;
22
- return created;
23
- }
24
- return await existing;
25
31
  }
26
- const kysely = await useLocalKysely(args);
27
- afterAll(async () => {
28
- await kysely.destroy();
29
- });
30
32
  return kysely;
31
33
  }
32
34
  export async function useLocalKyselyResource(args) {
33
- const kysely = await useLocalKysely(args);
35
+ const kysely = await acquireKysely(args);
34
36
  return new Proxy({}, {
35
37
  get(_target, prop) {
36
38
  // somehow not working if using Symbol.dispose
37
39
  if (prop === Symbol.asyncDispose) {
38
40
  return async () => {
41
+ if (!ownsKysely(args))
42
+ return;
39
43
  await kysely.destroy();
40
44
  };
41
45
  }
42
46
  if (prop === 'kysely') {
43
47
  return kysely;
44
48
  }
45
- if (typeof kysely[prop] === 'function') {
46
- return kysely[prop].bind(kysely);
49
+ const member = Reflect.get(kysely, prop);
50
+ if (typeof member === 'function') {
51
+ return member.bind(kysely);
47
52
  }
48
- return kysely[prop];
53
+ return member;
49
54
  },
50
55
  });
51
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAA8B,cAAc,EAAE,MAAM,UAAU,CAAC;AAYtE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,eAA2B,EAC3B,IAA4B;IAE5B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IAE1C,IAAI,eAAe,KAAK,UAAU;QAChC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IAEL,OAAO;QACL,MAAM;KACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAA4B;IACzE,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,GAAG,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,UAAU,CAAC,6BAA6B,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;YACrC,UAAU,CAAC,6BAA6B,GAAG,OAAO,CAAC;YACnD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,MAAM,QAAQ,CAAC;IACxB,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IAE1C,QAAQ,CAAC,KAAK,IAAI,EAAE;QAClB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAMD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAA4B;IAE5B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IAE1C,OAAO,IAAI,KAAK,CACd,EAAE,EACF;QACE,GAAG,CAAC,OAAO,EAAE,IAAI;YACf,8CAA8C;YAC9C,IAAI,IAAI,KAAK,MAAM,CAAC,YAAY,EAAE,CAAC;gBACjC,OAAO,KAAK,IAAI,EAAE;oBAChB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;gBACzB,CAAC,CAAC;YACJ,CAAC;YACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACtB,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;gBACvC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC;YACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;KACF,CACY,CAAC;AAClB,CAAC","sourcesContent":["import { afterAll } from 'bun:test';\nimport type { Kysely } from 'kysely';\nimport { type UseLocalKyselyOptions, useLocalKysely } from '../local';\nimport type { DB } from '../v1.generated';\n\ndeclare global {\n // Shared Kysely instance for test processes that run multiple files in one Bun process.\n // This must be process-global to allow cross-file reuse.\n var __vrplatform_testSharedKysely:\n | Promise<Kysely<DB>>\n | Kysely<DB>\n | undefined;\n}\n\n/**\n * @deprecated Use `useLocalKyselyResource` instead.\n */\nexport async function useTestKysely(\n cleanupStrategy: 'afterAll',\n args?: UseLocalKyselyOptions\n) {\n const kysely = await useLocalKysely(args);\n\n if (cleanupStrategy === 'afterAll')\n afterAll(async () => {\n await kysely.destroy();\n });\n\n return {\n kysely,\n };\n}\n\nexport async function useTestAutoCleanupKysely(args?: UseLocalKyselyOptions) {\n if (process.env.VR_TEST_SHARED_KYSELY === '1') {\n const existing = globalThis.__vrplatform_testSharedKysely;\n if (!existing) {\n const created = useLocalKysely(args);\n globalThis.__vrplatform_testSharedKysely = created;\n return created;\n }\n return await existing;\n }\n\n const kysely = await useLocalKysely(args);\n\n afterAll(async () => {\n await kysely.destroy();\n });\n\n return kysely;\n}\n\ntype ReturnType = Kysely<DB> & {\n [Symbol.dispose]: () => Promise<void>;\n};\n\nexport async function useLocalKyselyResource(\n args?: UseLocalKyselyOptions\n): Promise<ReturnType> {\n const kysely = await useLocalKysely(args);\n\n return new Proxy(\n {},\n {\n get(_target, prop) {\n // somehow not working if using Symbol.dispose\n if (prop === Symbol.asyncDispose) {\n return async () => {\n await kysely.destroy();\n };\n }\n if (prop === 'kysely') {\n return kysely;\n }\n if (typeof kysely[prop] === 'function') {\n return kysely[prop].bind(kysely);\n }\n return kysely[prop];\n },\n }\n ) as ReturnType;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAGL,cAAc,GACf,MAAM,UAAU,CAAC;AAelB;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAuC;IAEvC,OAAO,GAAG,CAAC,qBAAqB,KAAK,GAAG,CAAC;AAC3C,CAAC;AAED,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAEtD,SAAS,aAAa,CAAC,IAA2B;IAChD,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,QAAQ;QAAE,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IACjE,UAAU,CAAC,wBAAwB,KAAK,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7D,OAAO,UAAU,CAAC,wBAAwB,CAAC;AAC7C,CAAC;AAED,SAAS,UAAU,CAAC,IAA2B;IAC7C,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAA2B;IACxE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAEzC,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,QAAQ,CAAC,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAMD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAA2B;IAE3B,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAEzC,OAAO,IAAI,KAAK,CACd,EAAE,EACF;QACE,GAAG,CAAC,OAAO,EAAE,IAAI;YACf,8CAA8C;YAC9C,IAAI,IAAI,KAAK,MAAM,CAAC,YAAY,EAAE,CAAC;gBACjC,OAAO,KAAK,IAAI,EAAE;oBAChB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;wBAAE,OAAO;oBAC9B,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;gBACzB,CAAC,CAAC;YACJ,CAAC;YACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACtB,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,MAAM,MAAM,GAAY,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAClD,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;gBACjC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CACY,CAAC;AAClB,CAAC","sourcesContent":["import { afterAll } from 'bun:test';\nimport {\n type LocalKysely,\n type UseLocalKyselyOptions,\n useLocalKysely,\n} from '../local';\n\ntype UseTestKyselyOptions = UseLocalKyselyOptions & {\n /**\n * Force a private database even when the worker shares one. Required by specs\n * that model several regions at once, where two handles must be two distinct\n * physical databases, or that run a worker over every tenant's rows.\n */\n isolated?: boolean;\n};\n\ndeclare global {\n var __vrplatformSharedKysely: Promise<LocalKysely> | undefined;\n}\n\n/**\n * Each worker process shares one database, locally and on CI: specs isolate by\n * tenant, and booting PGlite per spec file made the suite about 65 % slower.\n * A spec that reads rows of other tenants is a bug in that spec.\n *\n * VR_TEST_SHARED_KYSELY=0 restores one database per file; `isolated: true` opts\n * a single call out when a spec genuinely needs its own physical database, such\n * as two regions at once or a worker that drains every tenant.\n */\nexport function resolveSharedKysely(\n env: Record<string, string | undefined>\n): boolean {\n return env.VR_TEST_SHARED_KYSELY !== '0';\n}\n\nconst sharedKysely = resolveSharedKysely(process.env);\n\nfunction acquireKysely(args?: UseTestKyselyOptions): Promise<LocalKysely> {\n if (!sharedKysely || args?.isolated) return useLocalKysely(args);\n globalThis.__vrplatformSharedKysely ??= useLocalKysely(args);\n return globalThis.__vrplatformSharedKysely;\n}\n\nfunction ownsKysely(args?: UseTestKyselyOptions): boolean {\n return !sharedKysely || Boolean(args?.isolated);\n}\n\nexport async function useTestAutoCleanupKysely(args?: UseTestKyselyOptions) {\n const kysely = await acquireKysely(args);\n\n if (ownsKysely(args)) {\n afterAll(async () => {\n await kysely.destroy();\n });\n }\n\n return kysely;\n}\n\ntype ReturnType = LocalKysely & {\n [Symbol.dispose]: () => Promise<void>;\n};\n\nexport async function useLocalKyselyResource(\n args?: UseTestKyselyOptions\n): Promise<ReturnType> {\n const kysely = await acquireKysely(args);\n\n return new Proxy(\n {},\n {\n get(_target, prop) {\n // somehow not working if using Symbol.dispose\n if (prop === Symbol.asyncDispose) {\n return async () => {\n if (!ownsKysely(args)) return;\n await kysely.destroy();\n };\n }\n if (prop === 'kysely') {\n return kysely;\n }\n const member: unknown = Reflect.get(kysely, prop);\n if (typeof member === 'function') {\n return member.bind(kysely);\n }\n return member;\n },\n }\n ) as ReturnType;\n}\n"]}
@@ -1,7 +1,7 @@
1
- import { type ControlledTransaction, type Kysely, type Transaction } from './isomorphic';
1
+ import { type ControlledTransaction, type DatabaseKysely, type DatabaseTransaction, type Transaction } from './isomorphic';
2
2
  export type ActiveTransaction = Transaction | ControlledTransaction;
3
- export declare function isActiveTransaction(db: Kysely | ActiveTransaction): db is ActiveTransaction;
4
- export declare function startControlledTransaction(db: Kysely): Promise<import("kysely").ControlledTransaction<import("./v1.generated").DB, []>>;
3
+ export declare function isActiveTransaction<Database>(db: DatabaseKysely<Database> | DatabaseTransaction<Database>): db is DatabaseTransaction<Database>;
4
+ export declare function startControlledTransaction<Database>(db: DatabaseKysely<Database>): Promise<import("kysely").ControlledTransaction<Database, []>>;
5
5
  export declare function createTransactionSavepoint(trx: ActiveTransaction, savepointName: string): Promise<ActiveTransaction>;
6
6
  export declare function rollbackTransactionSavepoint(trx: ActiveTransaction, savepointName: string): Promise<ActiveTransaction>;
7
7
  export declare function releaseTransactionSavepoint(trx: ActiveTransaction, savepointName: string): Promise<ActiveTransaction>;
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"src/","sources":["transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,GAAG,GAEJ,MAAM,cAAc,CAAC;AAItB,MAAM,UAAU,mBAAmB,CACjC,EAA8B;IAE9B,OAAO,EAAE,EAAE,aAAa,KAAK,IAAI,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAAU;IACzD,OAAO,EAAE,CAAC,gBAAgB,EAAE,CAAC,OAAO,EAAE,CAAC;AACzC,CAAC;AAED,uEAAuE;AACvE,kDAAkD;AAClD,SAAS,mBAAmB,CAC1B,GAAgB,EAChB,OAAoE,EACpE,aAAqB;IAErB,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,GAAsB,EACtB,aAAqB;IAErB,MAAM,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAC3D,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,GAAsB,EACtB,aAAqB;IAErB,MAAM,mBAAmB,CAAC,GAAG,EAAE,uBAAuB,EAAE,aAAa,CAAC,CAAC;IACvE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,GAAsB,EACtB,aAAqB;IAErB,MAAM,mBAAmB,CAAC,GAAG,EAAE,mBAAmB,EAAE,aAAa,CAAC,CAAC;IACnE,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {\n type ControlledTransaction,\n type Kysely,\n sql,\n type Transaction,\n} from './isomorphic';\n\nexport type ActiveTransaction = Transaction | ControlledTransaction;\n\nexport function isActiveTransaction(\n db: Kysely | ActiveTransaction\n): db is ActiveTransaction {\n return db?.isTransaction === true;\n}\n\nexport async function startControlledTransaction(db: Kysely) {\n return db.startTransaction().execute();\n}\n\n// Our dialect stack supports controlled transactions, but not Kysely's\n// savepoint commands consistently across drivers.\nfunction runSavepointCommand(\n trx: Transaction,\n command: 'savepoint' | 'rollback to savepoint' | 'release savepoint',\n savepointName: string\n) {\n return sql.raw(`${command} ${savepointName}`).execute(trx);\n}\n\nexport async function createTransactionSavepoint(\n trx: ActiveTransaction,\n savepointName: string\n): Promise<ActiveTransaction> {\n await runSavepointCommand(trx, 'savepoint', savepointName);\n return trx;\n}\n\nexport async function rollbackTransactionSavepoint(\n trx: ActiveTransaction,\n savepointName: string\n): Promise<ActiveTransaction> {\n await runSavepointCommand(trx, 'rollback to savepoint', savepointName);\n return trx;\n}\n\nexport async function releaseTransactionSavepoint(\n trx: ActiveTransaction,\n savepointName: string\n): Promise<ActiveTransaction> {\n await runSavepointCommand(trx, 'release savepoint', savepointName);\n return trx;\n}\n"]}
1
+ {"version":3,"file":"transaction.js","sourceRoot":"src/","sources":["transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,GAAG,GAEJ,MAAM,cAAc,CAAC;AAItB,MAAM,UAAU,mBAAmB,CACjC,EAA4D;IAE5D,OAAO,EAAE,EAAE,aAAa,KAAK,IAAI,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,EAA4B;IAE5B,OAAO,EAAE,CAAC,gBAAgB,EAAE,CAAC,OAAO,EAAE,CAAC;AACzC,CAAC;AAED,uEAAuE;AACvE,kDAAkD;AAClD,SAAS,mBAAmB,CAC1B,GAAgB,EAChB,OAAoE,EACpE,aAAqB;IAErB,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,GAAsB,EACtB,aAAqB;IAErB,MAAM,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAC3D,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,GAAsB,EACtB,aAAqB;IAErB,MAAM,mBAAmB,CAAC,GAAG,EAAE,uBAAuB,EAAE,aAAa,CAAC,CAAC;IACvE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,GAAsB,EACtB,aAAqB;IAErB,MAAM,mBAAmB,CAAC,GAAG,EAAE,mBAAmB,EAAE,aAAa,CAAC,CAAC;IACnE,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {\n type ControlledTransaction,\n type DatabaseKysely,\n type DatabaseTransaction,\n sql,\n type Transaction,\n} from './isomorphic';\n\nexport type ActiveTransaction = Transaction | ControlledTransaction;\n\nexport function isActiveTransaction<Database>(\n db: DatabaseKysely<Database> | DatabaseTransaction<Database>\n): db is DatabaseTransaction<Database> {\n return db?.isTransaction === true;\n}\n\nexport async function startControlledTransaction<Database>(\n db: DatabaseKysely<Database>\n) {\n return db.startTransaction().execute();\n}\n\n// Our dialect stack supports controlled transactions, but not Kysely's\n// savepoint commands consistently across drivers.\nfunction runSavepointCommand(\n trx: Transaction,\n command: 'savepoint' | 'rollback to savepoint' | 'release savepoint',\n savepointName: string\n) {\n return sql.raw(`${command} ${savepointName}`).execute(trx);\n}\n\nexport async function createTransactionSavepoint(\n trx: ActiveTransaction,\n savepointName: string\n): Promise<ActiveTransaction> {\n await runSavepointCommand(trx, 'savepoint', savepointName);\n return trx;\n}\n\nexport async function rollbackTransactionSavepoint(\n trx: ActiveTransaction,\n savepointName: string\n): Promise<ActiveTransaction> {\n await runSavepointCommand(trx, 'rollback to savepoint', savepointName);\n return trx;\n}\n\nexport async function releaseTransactionSavepoint(\n trx: ActiveTransaction,\n savepointName: string\n): Promise<ActiveTransaction> {\n await runSavepointCommand(trx, 'release savepoint', savepointName);\n return trx;\n}\n"]}