@vrplatform/kysely 1.3.45-stage.119 → 1.3.45-stage.1259

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 (89) hide show
  1. package/build/.data.tar +2 -2
  2. package/build/main/control-plane/index.d.ts +28 -6
  3. package/build/main/control-plane/index.js.map +1 -1
  4. package/build/main/index.d.ts +38 -2
  5. package/build/main/index.js +271 -55
  6. package/build/main/index.js.map +1 -1
  7. package/build/main/local/index.js +115 -8
  8. package/build/main/local/index.js.map +1 -1
  9. package/build/main/migration-source.d.ts +4 -0
  10. package/build/main/migration-source.js +37 -0
  11. package/build/main/migration-source.js.map +1 -0
  12. package/build/main/postgres-error.d.ts +3 -3
  13. package/build/main/postgres-error.js +4 -3
  14. package/build/main/postgres-error.js.map +1 -1
  15. package/build/main/query/listing/status.js +6 -2
  16. package/build/main/query/listing/status.js.map +1 -1
  17. package/build/main/query/tenant/status.d.ts +1 -1
  18. package/build/main/query/tenant/status.js +5 -2
  19. package/build/main/query/tenant/status.js.map +1 -1
  20. package/build/main/regional.d.ts +1 -0
  21. package/build/main/regional.js +1 -0
  22. package/build/main/regional.js.map +1 -1
  23. package/build/main/test/index.d.ts +25 -2
  24. package/build/main/test/index.js +40 -8
  25. package/build/main/test/index.js.map +1 -1
  26. package/build/main/v1.generated.d.ts +195 -19
  27. package/build/main/v1.generated.js.map +1 -1
  28. package/build/migrations-v2/0000000000033-plaid-connect-session-telemetry.ts +31 -0
  29. package/build/migrations-v2/0000000000033-reservation-issue-seed-bucket-index.ts +19 -0
  30. package/build/migrations-v2/0000000000034-retire-recent-classification-indexes.ts +29 -0
  31. package/build/migrations-v2/0000000000035-core-change-autovacuum.ts +24 -0
  32. package/build/migrations-v2/0000000000036-journal-entry-inactive-reason-constraint.ts +33 -0
  33. package/build/migrations-v2/0000000000037-journal-entry-inactive-reasons.ts +19 -0
  34. package/build/migrations-v2/0000000000038-journal-entry-group-inactive-reason.ts +14 -0
  35. package/build/migrations-v2/0000000000039-reservation-guest-breakdown.ts +19 -0
  36. package/build/migrations-v2/0000000000040-csv-import-source-identity-index.ts +23 -0
  37. package/build/migrations-v2/0000000000041-payment-returns.ts +38 -0
  38. package/build/migrations-v2/0000000000042-operation-resource-types.ts +609 -0
  39. package/build/migrations-v2/0000000000043-reservation-journal-freshness.ts +149 -0
  40. package/build/migrations-v2/0000000000044-reservation-journal-freshness-backfill.ts +254 -0
  41. package/build/migrations-v2/0000000000045-reservation-journal-freshness-revision-repair.ts +83 -0
  42. package/build/migrations-v2/0000000000046-materialized-reservation-journal-operations.ts +709 -0
  43. package/build/migrations-v2/0000000000047-public-audit-completion.ts +77 -0
  44. package/build/migrations-v2/0000000000048-reservation-journal-full-refresh-repair.ts +136 -0
  45. package/build/migrations-v2/0000000000049-queued-journal-operation-failures.ts +60 -0
  46. package/build/migrations-v2/0000000000050-connection-oauth-state.ts +43 -0
  47. package/build/migrations-v2/0000000000051-owner-statement-email-delivery.ts +134 -0
  48. package/build/migrations-v2/0000000000052-fee-journal-lock-skip-operations.ts +59 -0
  49. package/build/migrations-v2/0000000000053-fee-journal-lock-skip-null-attempt.ts +44 -0
  50. package/build/migrations-v2/0000000000054-journal-refresh-issue-codes.ts +16 -0
  51. package/build/migrations-v2/0000000000055-tenant-billing-subscription.ts +8 -0
  52. package/build/migrations-v2/0000000000056-journal-operation-failure-precedence.ts +306 -0
  53. package/build/migrations-v2/0000000000057-journal-invalidation-failure-code.ts +28 -0
  54. package/build/migrations-v2/0000000000058-journal-invalidation-locked-failure.ts +16 -0
  55. package/build/migrations-v2/0000000000059-billing-active-listing-cross-region-partner.ts +135 -0
  56. package/build/migrations-v2/0000000000060-accounting-integrity-change-driven.ts +99 -0
  57. package/build/migrations-v2/0000000000061-tenant-pending-onboarding-status.ts +37 -0
  58. package/build/migrations-v2/0000000000062-statement-payout-operations.ts +16 -0
  59. package/build/migrations-v2/0000000000063-missing-account-assignments-issue-code.ts +13 -0
  60. package/build/migrations-v2/0000000000064-journal-invalidation-source-lookup-index.ts +26 -0
  61. package/build/migrations-v2/0000000000065-hasura-connection-event-credentials.ts +42 -0
  62. package/build/migrations-v2/0000000000066-recurring-fee-listing-subscription-match-by.ts +51 -0
  63. package/build/module/control-plane/index.d.ts +28 -6
  64. package/build/module/control-plane/index.js.map +1 -1
  65. package/build/module/index.d.ts +38 -2
  66. package/build/module/index.js +269 -55
  67. package/build/module/index.js.map +1 -1
  68. package/build/module/local/index.js +115 -8
  69. package/build/module/local/index.js.map +1 -1
  70. package/build/module/migration-source.d.ts +4 -0
  71. package/build/module/migration-source.js +34 -0
  72. package/build/module/migration-source.js.map +1 -0
  73. package/build/module/postgres-error.d.ts +3 -3
  74. package/build/module/postgres-error.js +4 -3
  75. package/build/module/postgres-error.js.map +1 -1
  76. package/build/module/query/listing/status.js +6 -2
  77. package/build/module/query/listing/status.js.map +1 -1
  78. package/build/module/query/tenant/status.d.ts +1 -1
  79. package/build/module/query/tenant/status.js +5 -2
  80. package/build/module/query/tenant/status.js.map +1 -1
  81. package/build/module/regional.d.ts +1 -0
  82. package/build/module/regional.js +1 -0
  83. package/build/module/regional.js.map +1 -1
  84. package/build/module/test/index.d.ts +25 -2
  85. package/build/module/test/index.js +39 -8
  86. package/build/module/test/index.js.map +1 -1
  87. package/build/module/v1.generated.d.ts +195 -19
  88. package/build/module/v1.generated.js.map +1 -1
  89. package/package.json +9 -7
@@ -1,33 +1,65 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveSharedKysely = resolveSharedKysely;
3
4
  exports.useTestAutoCleanupKysely = useTestAutoCleanupKysely;
4
5
  exports.useLocalKyselyResource = useLocalKyselyResource;
5
6
  const bun_test_1 = require("bun:test");
6
7
  const local_1 = require("../local");
8
+ /**
9
+ * Locally each worker process shares one database, because specs isolate by
10
+ * tenant and the faster suite is what makes running it before a push realistic.
11
+ *
12
+ * CI keeps a database per spec file. It retries nothing, so a badly scoped spec
13
+ * would surface there as a red build in an unrelated file rather than as a
14
+ * local failure the author can reproduce.
15
+ *
16
+ * VR_TEST_SHARED_KYSELY overrides either way; `isolated: true` opts a single
17
+ * call out when a spec genuinely needs two physical databases at once.
18
+ */
19
+ function resolveSharedKysely(env) {
20
+ if (env.VR_TEST_SHARED_KYSELY)
21
+ return env.VR_TEST_SHARED_KYSELY !== '0';
22
+ return !(env.CI || env.GITHUB_ACTIONS);
23
+ }
24
+ const sharedKysely = resolveSharedKysely(process.env);
25
+ function acquireKysely(args) {
26
+ if (!sharedKysely || args?.isolated)
27
+ return (0, local_1.useLocalKysely)(args);
28
+ globalThis.__vrplatformSharedKysely ?? (globalThis.__vrplatformSharedKysely = (0, local_1.useLocalKysely)(args));
29
+ return globalThis.__vrplatformSharedKysely;
30
+ }
31
+ function ownsKysely(args) {
32
+ return !sharedKysely || Boolean(args?.isolated);
33
+ }
7
34
  async function useTestAutoCleanupKysely(args) {
8
- const kysely = await (0, local_1.useLocalKysely)(args);
9
- (0, bun_test_1.afterAll)(async () => {
10
- await kysely.destroy();
11
- });
35
+ const kysely = await acquireKysely(args);
36
+ if (ownsKysely(args)) {
37
+ (0, bun_test_1.afterAll)(async () => {
38
+ await kysely.destroy();
39
+ });
40
+ }
12
41
  return kysely;
13
42
  }
14
43
  async function useLocalKyselyResource(args) {
15
- const kysely = await (0, local_1.useLocalKysely)(args);
44
+ const kysely = await acquireKysely(args);
16
45
  return new Proxy({}, {
17
46
  get(_target, prop) {
18
47
  // somehow not working if using Symbol.dispose
19
48
  if (prop === Symbol.asyncDispose) {
20
49
  return async () => {
50
+ if (!ownsKysely(args))
51
+ return;
21
52
  await kysely.destroy();
22
53
  };
23
54
  }
24
55
  if (prop === 'kysely') {
25
56
  return kysely;
26
57
  }
27
- if (typeof kysely[prop] === 'function') {
28
- return kysely[prop].bind(kysely);
58
+ const member = Reflect.get(kysely, prop);
59
+ if (typeof member === 'function') {
60
+ return member.bind(kysely);
29
61
  }
30
- return kysely[prop];
62
+ return member;
31
63
  },
32
64
  });
33
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["test/index.ts"],"names":[],"mappings":";;AAOA,4DAQC;AAMD,wDAyBC;AA9CD,uCAAoC;AACpC,oCAIkB;AAEX,KAAK,UAAU,wBAAwB,CAAC,IAA4B;IACzE,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC,IAAI,CAAC,CAAC;IAE1C,IAAA,mBAAQ,EAAC,KAAK,IAAI,EAAE;QAClB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAMM,KAAK,UAAU,sBAAsB,CAC1C,IAA4B;IAE5B,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC,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 {\n type LocalKysely,\n type UseLocalKyselyOptions,\n useLocalKysely,\n} from '../local';\n\nexport async function useTestAutoCleanupKysely(args?: UseLocalKyselyOptions) {\n const kysely = await useLocalKysely(args);\n\n afterAll(async () => {\n await kysely.destroy();\n });\n\n return kysely;\n}\n\ntype ReturnType = LocalKysely & {\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":";;AA+BA,kDAKC;AAcD,4DAUC;AAMD,wDA2BC;AA7FD,uCAAoC;AACpC,oCAIkB;AAelB;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB,CACjC,GAAuC;IAEvC,IAAI,GAAG,CAAC,qBAAqB;QAAE,OAAO,GAAG,CAAC,qBAAqB,KAAK,GAAG,CAAC;IACxE,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC;AACzC,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,IAAA,sBAAc,EAAC,IAAI,CAAC,CAAC;IACjE,UAAU,CAAC,wBAAwB,KAAnC,UAAU,CAAC,wBAAwB,GAAK,IAAA,sBAAc,EAAC,IAAI,CAAC,EAAC;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;AAEM,KAAK,UAAU,wBAAwB,CAAC,IAA2B;IACxE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAEzC,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,IAAA,mBAAQ,EAAC,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAMM,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.\n */\n isolated?: boolean;\n};\n\ndeclare global {\n var __vrplatformSharedKysely: Promise<LocalKysely> | undefined;\n}\n\n/**\n * Locally each worker process shares one database, because specs isolate by\n * tenant and the faster suite is what makes running it before a push realistic.\n *\n * CI keeps a database per spec file. It retries nothing, so a badly scoped spec\n * would surface there as a red build in an unrelated file rather than as a\n * local failure the author can reproduce.\n *\n * VR_TEST_SHARED_KYSELY overrides either way; `isolated: true` opts a single\n * call out when a spec genuinely needs two physical databases at once.\n */\nexport function resolveSharedKysely(\n env: Record<string, string | undefined>\n): boolean {\n if (env.VR_TEST_SHARED_KYSELY) return env.VR_TEST_SHARED_KYSELY !== '0';\n return !(env.CI || env.GITHUB_ACTIONS);\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"]}
@@ -3,8 +3,9 @@
3
3
  * Please do not edit it manually.
4
4
  */
5
5
  import type { ColumnType } from "kysely";
6
- export type AccountingJournalEntryInactiveReason = "cancelledReservationLine" | "currencyMismatch" | "generalLedgerStartAt" | "inactiveAccount" | "listingInactive" | "nonPostingAccount" | "reservationGeneralLedgerStatusInactive" | "transactionInactive" | "unknownInactiveReason";
6
+ export type AccountingJournalEntryInactiveReason = "cancelledReservationLine" | "currencyMismatch" | "generalLedgerStartAt" | "historicalLedger" | "inactiveAccount" | "listingInactive" | "listingOwnershipPeriodNotFound" | "nonPostingAccount" | "reservationGeneralLedgerStatusInactive" | "transactionInactive" | "unbalancedGroupInactiveLeg" | "unknownInactiveReason";
7
7
  export type AccountingJournalEntryLedger = "historical" | "operating" | "trust";
8
+ export type AccountingReservationJournalInvalidationFailure = "journal_configuration_invalid" | "journal_locked";
8
9
  export type AccountingTransactionAttachmentStatus = "attached" | "deleting" | "ready" | "uploading";
9
10
  export type ArrayType<T> = ArrayTypeImpl<T> extends (infer U)[] ? U[] : ArrayTypeImpl<T>;
10
11
  export type ArrayTypeImpl<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S[], I[], U[]> : T[];
@@ -14,14 +15,30 @@ export type AuditEffectStatus = "claimed" | "completed" | "dead_letter" | "faile
14
15
  export type AuditJournalDeltaOperation = "delete" | "insert" | "update";
15
16
  export type AuditPublicEventAccountingStatus = "blocked" | "changed" | "failed" | "mixed" | "not_applicable" | "pending" | "unchanged";
16
17
  export type AuditPublicEventOperation = "archive" | "create" | "delete" | "execute" | "recalculate" | "restore" | "update";
17
- export type AuditSourceType = "api" | "automation" | "integration" | "portal" | "sync" | "system";
18
+ export type AuditActorOrganizationType = "partner" | "system" | "team" | "vrplatform";
19
+ export type AuditSourceType = "api" | "automation" | "embedded" | "integration" | "portal" | "sync" | "system";
18
20
  export type BillingListingFactSourceType = "baseline_backfill" | "daily_reconciliation" | "legacy_tracking_import" | "listing_delete" | "listing_insert" | "listing_update" | "ownership_delete" | "ownership_insert" | "ownership_update" | "tenant_delete" | "tenant_insert" | "tenant_update";
21
+ export type CoreAsyncOperationResultStatus = "completed" | "failed" | "queued";
22
+ export type CoreCsvOperationResultKind = "import" | "preview";
23
+ export type CoreCsvOperationResultStatus = "completed" | "failed" | "processing" | "queued";
24
+ export type CoreEmailDeliveryFailureCode = "inactive_recipient" | "invalid_provider_response" | "postmark_not_configured" | "provider_rejected" | "task_failed" | "transport_failed";
25
+ export type CoreEmailDeliveryStatus = "accepted" | "canceled" | "failed" | "queued" | "rejected" | "retrying" | "sending";
26
+ export type CoreEmailNotificationStatus = "canceled" | "completed" | "failed" | "processing" | "queued";
27
+ export type CoreExportJobFormat = "csv" | "pdf" | "zip";
28
+ export type CoreExportJobTaskId = "api/export-journal-entries-csv" | "api/export-manager-statement-pdf" | "api/export-owner-statement-combined-csv" | "api/export-owner-statement-pdf" | "api/export-owner-statement-pdf-batch-zip" | "api/export-owner-statement-summary-pdf" | "api/export-owner-statement-summary-pdf-batch-zip" | "api/export-route" | "api/export-trust-reconciliation-pdf";
19
29
  export type CoreFlowEventOperationAction = "abandon" | "replay";
20
30
  export type CoreFlowEventStatus = "canceled" | "dead" | "pending" | "processing" | "succeeded";
31
+ export type CoreOperationResourceRole = "result" | "source" | "target";
32
+ export type CoreOperationResourceType = "bank-rule" | "connection" | "contact" | "file" | "flow" | "listing" | "recurring-fee" | "recurring-transaction-template" | "reservation" | "statement" | "team" | "transaction" | "webhook";
33
+ export type CoreOperationPublicIdFormat = "action" | "legacy";
34
+ export type CoreOperationSourceType = "audit-action" | "export-job" | "sync" | "webhook-delivery";
35
+ export type CoreOperationStatus = "completed" | "failed" | "queued" | "running";
36
+ export type CoreOperationType = "statement-payout" | "statement-payout-preview" | "ach-verification" | "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" | "team-delete" | "team-demo-data" | "team-duplicate" | "team-initialize" | "transaction-journal-refresh" | "vri-statement-import" | "vri-team-migration" | "webhook-test";
21
37
  export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
22
38
  export type HealthAccountingIntegrityActionability = "automatically_repairable" | "blocked" | "code_fix_required" | "manual_repair" | "unknown";
23
39
  export type HealthAccountingIntegrityCaseStatus = "open" | "resolved";
24
40
  export type HealthAccountingIntegrityConfidence = "probable" | "proven" | "unknown";
41
+ export type HealthAccountingIntegrityDirtyRecordType = "reservation" | "transaction";
25
42
  export type HealthAccountingIntegrityDeliveryChannel = "sentry" | "slack";
26
43
  export type HealthAccountingIntegrityDeliveryStatus = "dead_letter" | "delivered" | "failed" | "pending" | "processing" | "suppressed";
27
44
  export type HealthAccountingIntegrityRepairPlanStatus = "active" | "canceled" | "completed" | "draft" | "failed" | "paused";
@@ -36,7 +53,7 @@ export type HealthAccountingIntegritySeverity = "critical" | "error" | "info" |
36
53
  export type HealthAccountingIntegrityTransitionType = "changed" | "opened" | "reopened" | "resolved" | "reviewed";
37
54
  export type HealthAccountingIntegrityUrgency = "backlog" | "immediate" | "next_triage" | "none";
38
55
  export type HealthTenantIssueCategory = "criticalToSystem" | "criticalToUser";
39
- export type HealthTenantIssueCode = "brokenConnections" | "cancelledReservationPaidWithoutAdjustment" | "closedPeriodUnattachedJournalEntries" | "duplicatedPayments" | "endedOwnershipNonZeroBalance" | "listingOwnershipPeriodNotFoundOnActiveJournals" | "missingOwnershipOrDeactivation" | "operatingBankAccountsWithoutOpex" | "outdatedConnections" | "partnerBillingInactive" | "partnerInactive" | "pmsMissingAccountingStart" | "publishedStatementUnpaid" | "reservationCurrencyMismatch" | "reservationGuestTotalsMismatch" | "reservationPaymentProjectionMismatch" | "teamInactive" | "unbalancedJournalEntries" | "unbalancedTransactionJournalEntries" | "unpaidReservations";
56
+ export type HealthTenantIssueCode = "brokenConnections" | "cancelledReservationPaidWithoutAdjustment" | "closedPeriodUnattachedJournalEntries" | "duplicatedPayments" | "endedOwnershipNonZeroBalance" | "journalConfigurationInvalid" | "journalLocked" | "journalUnbalanced" | "listingOwnershipPeriodNotFoundOnActiveJournals" | "missingAccountAssignments" | "missingOwnershipOrDeactivation" | "operatingBankAccountsWithoutOpex" | "outdatedConnections" | "partnerBillingInactive" | "partnerInactive" | "pmsMissingAccountingStart" | "publishedStatementUnpaid" | "reservationCurrencyMismatch" | "reservationGuestTotalsMismatch" | "reservationPaymentProjectionMismatch" | "teamInactive" | "unbalancedJournalEntries" | "unbalancedTransactionJournalEntries" | "unpaidReservations";
40
57
  export type HealthTenantIssueSeverity = "error" | "warning";
41
58
  export type HealthTenantIssueStatus = "open" | "resolved";
42
59
  export type Int8 = ColumnType<string, bigint | number | string, bigint | number | string>;
@@ -55,9 +72,9 @@ export type PublicRecurringFeeConditionOperator = "<" | "<=" | "=" | ">" | ">=";
55
72
  export type Timestamp = ColumnType<Date | string, Date | string, Date | string>;
56
73
  export type WebhookApiVersion = "2026-07-01";
57
74
  export type WebhookDeliveryStatus = "canceled" | "delivering" | "failed" | "queued" | "retrying" | "succeeded";
58
- export type WebhookEventType = "connection.changed" | "listing.changed" | "reservation.changed" | "statement.status.changed" | "sync.status.changed" | "team.issues.changed" | "transaction.changed" | "webhook.test";
59
- export type WebhookResourceType = "connection" | "listing" | "reservation" | "statement" | "sync" | "team" | "transaction" | "webhook";
60
- export type WebhookSubscriptionEventType = "connection.changed" | "listing.changed" | "reservation.changed" | "statement.status.changed" | "sync.status.changed" | "team.issues.changed" | "transaction.changed";
75
+ export type WebhookEventType = "audit.event.changed" | "connection.changed" | "listing.changed" | "reservation.changed" | "statement.status.changed" | "sync.status.changed" | "team.issues.changed" | "transaction.changed" | "webhook.test";
76
+ export type WebhookResourceType = "auditEvent" | "connection" | "listing" | "reservation" | "statement" | "sync" | "team" | "transaction" | "webhook";
77
+ export type WebhookSubscriptionEventType = "audit.event.changed" | "connection.changed" | "listing.changed" | "reservation.changed" | "statement.status.changed" | "sync.status.changed" | "team.issues.changed" | "transaction.changed";
61
78
  export type WebhookSubscriptionScope = "managedTeams" | "self";
62
79
  export type WebhookSubscriptionStatus = "active" | "disabled" | "pending";
63
80
  export interface AccountingAccount {
@@ -391,6 +408,45 @@ export interface AccountingRate {
391
408
  export interface AccountingRateType {
392
409
  name: string;
393
410
  }
411
+ export interface AccountingReservationJournalFreshnessControl {
412
+ createdAt: Generated<Timestamp>;
413
+ guardsEnabledAt: Timestamp | null;
414
+ tenantId: string;
415
+ updatedAt: Generated<Timestamp>;
416
+ }
417
+ export interface AccountingReservationJournalInvalidation {
418
+ actionId: string | null;
419
+ appliedAt: Timestamp | null;
420
+ coveredByEffectId: string | null;
421
+ createdAt: Generated<Timestamp>;
422
+ effectId: string | null;
423
+ failureCode: AccountingReservationJournalInvalidationFailure | null;
424
+ id: Generated<string>;
425
+ reservationId: string;
426
+ revision: Int8;
427
+ sourceResourceId: string | null;
428
+ sourceResourceType: CoreOperationResourceType | null;
429
+ tenantId: string;
430
+ }
431
+ export interface AccountingReservationJournalState {
432
+ appliedRevision: Generated<Int8>;
433
+ calculatedAt: Timestamp | null;
434
+ createdAt: Generated<Timestamp>;
435
+ desiredRevision: Generated<Int8>;
436
+ reservationId: string;
437
+ staleSince: Timestamp | null;
438
+ tenantId: string;
439
+ updatedAt: Generated<Timestamp>;
440
+ }
441
+ export interface AccountingReservationJournalStatementImpact {
442
+ createdAt: Generated<Timestamp>;
443
+ currency: string;
444
+ invalidationId: string;
445
+ listingId: string;
446
+ listingOwnershipPeriodId: string;
447
+ month: Timestamp;
448
+ tenantId: string;
449
+ }
394
450
  export interface AccountingTaxBehavior {
395
451
  name: string;
396
452
  }
@@ -417,6 +473,8 @@ export interface AccountingTransaction {
417
473
  recurringFeeId: string | null;
418
474
  recurringPattern: Json | null;
419
475
  recurringTemplateId: string | null;
476
+ returnedFromTransactionId: string | null;
477
+ returnEffectiveAt: Timestamp | null;
420
478
  /**
421
479
  * Human-readable system ID (EXP/DEP/PAY/TRF-XXX-XXXX-XXX depending on transaction.type).
422
480
  */
@@ -480,6 +538,9 @@ export interface AuditAction {
480
538
  actorId: string | null;
481
539
  actorLabel: string | null;
482
540
  actorName: string | null;
541
+ actorOrganizationId: string | null;
542
+ actorOrganizationName: string | null;
543
+ actorOrganizationType: AuditActorOrganizationType | null;
483
544
  actorType: AuditActionActorType;
484
545
  apiVersion: string;
485
546
  createdAt: Generated<Timestamp>;
@@ -585,6 +646,7 @@ export interface AuditMutation {
585
646
  id: Generated<string>;
586
647
  op: string;
587
648
  publicChanges: Generated<Json>;
649
+ publicOutcome: Json | null;
588
650
  rootEntityId: string | null;
589
651
  rootEntityType: string | null;
590
652
  subjectId: string;
@@ -600,8 +662,13 @@ export interface AuditPublicEvent {
600
662
  actorId: string | null;
601
663
  actorLabel: string | null;
602
664
  actorName: string | null;
665
+ actorOrganizationId: string | null;
666
+ actorOrganizationName: string | null;
667
+ actorOrganizationType: AuditActorOrganizationType | null;
603
668
  actorType: AuditActionActorType;
604
669
  affectedAccountIds: Generated<string[]>;
670
+ attemptedEntityChanges: Generated<Json>;
671
+ blockedBy: Generated<Json>;
605
672
  changedEntityTypes: Generated<string[]>;
606
673
  changedPaths: Generated<string[]>;
607
674
  entityChanges: Generated<Json>;
@@ -616,6 +683,7 @@ export interface AuditPublicEvent {
616
683
  projectionFingerprint: string;
617
684
  projectionVersion: Generated<number>;
618
685
  requestId: string | null;
686
+ recovery: Generated<Json>;
619
687
  revision: Generated<number>;
620
688
  rootEntityId: string;
621
689
  rootEntityType: string;
@@ -673,13 +741,14 @@ export interface CoreActiveStatus {
673
741
  name: string;
674
742
  }
675
743
  export interface CoreAsyncOperationResult {
744
+ checkpoint: Json | null;
676
745
  createdAt: Generated<Timestamp>;
677
746
  errorMessage: string | null;
678
747
  operationId: string;
679
748
  result: Json | null;
680
- status: Generated<string>;
749
+ status: Generated<CoreAsyncOperationResultStatus>;
681
750
  tenantId: string;
682
- type: string;
751
+ type: CoreOperationType;
683
752
  updatedAt: Generated<Timestamp>;
684
753
  }
685
754
  export interface CoreChange {
@@ -737,25 +806,55 @@ export interface CoreCsvOperationResult {
737
806
  connectionId: string;
738
807
  createdAt: Generated<Timestamp>;
739
808
  errorMessage: string | null;
740
- kind: string;
809
+ kind: CoreCsvOperationResultKind;
741
810
  result: Json | null;
742
- status: Generated<string>;
811
+ status: Generated<CoreCsvOperationResultStatus>;
743
812
  syncId: string;
744
813
  tenantId: string;
745
814
  updatedAt: Generated<Timestamp>;
746
815
  }
816
+ export interface CoreEmailDelivery {
817
+ attemptCount: Generated<number>;
818
+ createdAt: Generated<Timestamp>;
819
+ failureCode: CoreEmailDeliveryFailureCode | null;
820
+ finishedAt: Timestamp | null;
821
+ httpStatus: number | null;
822
+ id: Generated<string>;
823
+ lastAttemptAt: Timestamp | null;
824
+ notificationId: string;
825
+ postmarkErrorCode: number | null;
826
+ postmarkMessageId: string | null;
827
+ status: Generated<CoreEmailDeliveryStatus>;
828
+ submittedAt: Timestamp | null;
829
+ tenantId: string;
830
+ triggerRunId: string | null;
831
+ updatedAt: Generated<Timestamp>;
832
+ userId: string;
833
+ }
834
+ export interface CoreEmailNotification {
835
+ createdAt: Generated<Timestamp>;
836
+ finishedAt: Timestamp | null;
837
+ id: string;
838
+ ownerStatementId: string;
839
+ recipientsResolvedAt: Timestamp | null;
840
+ startedAt: Timestamp | null;
841
+ status: Generated<CoreEmailNotificationStatus>;
842
+ tenantId: string;
843
+ triggerRunId: string | null;
844
+ updatedAt: Generated<Timestamp>;
845
+ }
747
846
  export interface CoreExportJob {
748
847
  createdAt: Generated<Timestamp>;
749
848
  errorMessage: string | null;
750
849
  fileId: string;
751
850
  filename: string;
752
851
  finishedAt: Timestamp | null;
753
- format: string;
852
+ format: CoreExportJobFormat;
754
853
  id: string;
755
854
  payload: Json;
756
855
  startedAt: Timestamp | null;
757
- status: Generated<string>;
758
- taskId: string;
856
+ status: Generated<CoreOperationStatus>;
857
+ taskId: CoreExportJobTaskId;
759
858
  tenantId: string;
760
859
  updatedAt: Generated<Timestamp>;
761
860
  }
@@ -878,12 +977,19 @@ export interface CoreOperation {
878
977
  finishedAt: Timestamp | null;
879
978
  id: Generated<string>;
880
979
  initiatedByUserId: string | null;
980
+ publicIdFormat: Generated<CoreOperationPublicIdFormat>;
881
981
  retainUntil: Timestamp | null;
882
982
  sourceVersion: Generated<Int8>;
883
983
  startedAt: Timestamp | null;
884
- status: Generated<string>;
984
+ status: Generated<CoreOperationStatus>;
885
985
  tenantId: string;
886
- type: string;
986
+ type: CoreOperationType;
987
+ updatedAt: Generated<Timestamp>;
988
+ }
989
+ export interface CoreOperationBackfill {
990
+ completedAt: Timestamp | null;
991
+ createdAt: Generated<Timestamp>;
992
+ name: string;
887
993
  updatedAt: Generated<Timestamp>;
888
994
  }
889
995
  export interface CoreOperationProjectionOutbox {
@@ -901,18 +1007,18 @@ export interface CoreOperationResource {
901
1007
  isPrimary: Generated<boolean>;
902
1008
  operationId: string;
903
1009
  resourceId: string;
904
- resourceType: string;
905
- role: string;
1010
+ resourceType: CoreOperationResourceType;
1011
+ role: CoreOperationResourceRole;
906
1012
  }
907
1013
  export interface CoreOperationSource {
908
1014
  finishedAt: Timestamp | null;
909
1015
  operationId: string;
910
1016
  required: Generated<boolean>;
911
1017
  sourceId: string;
912
- sourceType: string;
1018
+ sourceType: CoreOperationSourceType;
913
1019
  sourceVersion: Generated<Int8>;
914
1020
  startedAt: Timestamp | null;
915
- status: Generated<string>;
1021
+ status: Generated<CoreOperationStatus>;
916
1022
  }
917
1023
  export interface CoreSync {
918
1024
  automationId: string | null;
@@ -1098,6 +1204,20 @@ export interface HealthAccountingIntegrityCase {
1098
1204
  verification: Json;
1099
1205
  version: Generated<Int8>;
1100
1206
  }
1207
+ export interface HealthAccountingIntegrityComparisonFinding {
1208
+ caseKey: string;
1209
+ code: string;
1210
+ contentHash: string;
1211
+ createdAt: Generated<Timestamp>;
1212
+ dataRegion: string;
1213
+ firstSeenAt: Timestamp;
1214
+ id: Generated<string>;
1215
+ recordId: string;
1216
+ recordType: HealthAccountingIntegrityDirtyRecordType;
1217
+ severity: HealthAccountingIntegritySeverity;
1218
+ tenantId: string;
1219
+ updatedAt: Generated<Timestamp>;
1220
+ }
1101
1221
  export interface HealthAccountingIntegrityDelivery {
1102
1222
  attempts: Generated<number>;
1103
1223
  caseId: string | null;
@@ -1117,6 +1237,19 @@ export interface HealthAccountingIntegrityDelivery {
1117
1237
  status: Generated<HealthAccountingIntegrityDeliveryStatus>;
1118
1238
  updatedAt: Generated<Timestamp>;
1119
1239
  }
1240
+ export interface HealthAccountingIntegrityDirtyRecord {
1241
+ claimToken: string | null;
1242
+ claimedUntil: Timestamp | null;
1243
+ computedAt: Timestamp | null;
1244
+ computedVersion: Generated<Int8>;
1245
+ createdAt: Generated<Timestamp>;
1246
+ dirtyAt: Generated<Timestamp>;
1247
+ dirtyVersion: Generated<Int8>;
1248
+ recordId: string;
1249
+ recordType: HealthAccountingIntegrityDirtyRecordType;
1250
+ tenantId: string;
1251
+ updatedAt: Generated<Timestamp>;
1252
+ }
1120
1253
  export interface HealthAccountingIntegrityOperatorEvent {
1121
1254
  actorId: string;
1122
1255
  caseId: string | null;
@@ -1236,6 +1369,16 @@ export interface HealthAccountingIntegrityRun {
1236
1369
  unchangedCaseCount: Generated<Int8>;
1237
1370
  updatedAt: Generated<Timestamp>;
1238
1371
  }
1372
+ export interface HealthAccountingIntegritySweepCursor {
1373
+ createdAt: Generated<Timestamp>;
1374
+ cycleStartedAt: Generated<Timestamp>;
1375
+ definitionsHash: string | null;
1376
+ lastCycleCompletedAt: Timestamp | null;
1377
+ lastRecordId: string | null;
1378
+ lastTenantId: string | null;
1379
+ recordType: HealthAccountingIntegrityDirtyRecordType;
1380
+ updatedAt: Generated<Timestamp>;
1381
+ }
1239
1382
  export interface HealthAccountingIntegrityTransition {
1240
1383
  caseId: string;
1241
1384
  caseVersion: Int8;
@@ -1938,8 +2081,15 @@ export interface PublicPlaidConnectSession {
1938
2081
  environment: string;
1939
2082
  errorCode: string | null;
1940
2083
  errorRetryable: boolean | null;
2084
+ exitedAt: Timestamp | null;
2085
+ exitErrorCode: string | null;
2086
+ exitErrorType: string | null;
2087
+ exitRequestId: string | null;
2088
+ exitView: string | null;
1941
2089
  expiresAt: Timestamp;
1942
2090
  id: Generated<string>;
2091
+ institutionId: string | null;
2092
+ institutionName: string | null;
1943
2093
  itemId: string | null;
1944
2094
  leaseExpiresAt: Timestamp | null;
1945
2095
  linkSessionId: string | null;
@@ -1989,11 +2139,13 @@ export interface PublicRecurringFeeAccountCondition {
1989
2139
  recurringFeeId: string;
1990
2140
  updatedAt: Generated<Timestamp>;
1991
2141
  }
2142
+ export type PublicRecurringFeeListingSubscriptionMatchBy = "bookedDate" | "stayDate";
1992
2143
  export interface PublicRecurringFeeListingSubscription {
1993
2144
  createdAt: Generated<Timestamp>;
1994
2145
  endAt: Timestamp | null;
1995
2146
  id: Generated<string>;
1996
2147
  listingId: string;
2148
+ matchBy: Generated<PublicRecurringFeeListingSubscriptionMatchBy>;
1997
2149
  rate: number | null;
1998
2150
  rateType: Generated<string | null>;
1999
2151
  recurringFeeId: string;
@@ -2008,6 +2160,7 @@ export interface PublicRecurringFeeType {
2008
2160
  name: string;
2009
2161
  }
2010
2162
  export interface PublicReservation {
2163
+ adults: number | null;
2011
2164
  bookedAt: Generated<Timestamp | null>;
2012
2165
  bookerName: string | null;
2013
2166
  bookingPlatform: string | null;
@@ -2026,6 +2179,7 @@ export interface PublicReservation {
2026
2179
  channelId: string | null;
2027
2180
  checkIn: Timestamp | null;
2028
2181
  checkOut: Timestamp | null;
2182
+ children: number | null;
2029
2183
  confirmationCode: string | null;
2030
2184
  connectionId: string | null;
2031
2185
  createdAt: Generated<Timestamp | null>;
@@ -2212,6 +2366,7 @@ export interface PublicTenant {
2212
2366
  billingAddressData: Json | null;
2213
2367
  billingAddressId: string | null;
2214
2368
  billingCustomerId: string | null;
2369
+ billingSubscriptionId: string | null;
2215
2370
  billingPartnerId: string | null;
2216
2371
  billingPaymentMethodType: string | null;
2217
2372
  billingPlan: string | null;
@@ -2292,6 +2447,16 @@ export interface PublicTenantUser {
2292
2447
  updatedAt: Generated<Timestamp | null>;
2293
2448
  userId: string;
2294
2449
  }
2450
+ export interface PublicConnectionOauthState {
2451
+ appId: string;
2452
+ connectionId: string | null;
2453
+ expiresAt: Timestamp;
2454
+ params: JsonObject;
2455
+ redirectUri: string;
2456
+ stateHash: string;
2457
+ tenantId: string;
2458
+ userId: string;
2459
+ }
2295
2460
  export interface PublicToken {
2296
2461
  createdAt: Generated<Timestamp>;
2297
2462
  expiresAt: Timestamp | null;
@@ -2534,6 +2699,7 @@ export interface WebhookSubscriptionSecret {
2534
2699
  subscriptionId: string;
2535
2700
  }
2536
2701
  export interface DB {
2702
+ "public.connectionOauthState": PublicConnectionOauthState;
2537
2703
  "accounting.account": AccountingAccount;
2538
2704
  "accounting.accountAssignment": AccountingAccountAssignment;
2539
2705
  "accounting.accountAssignmentLineType": AccountingAccountAssignmentLineType;
@@ -2571,6 +2737,10 @@ export interface DB {
2571
2737
  "accounting.party": AccountingParty;
2572
2738
  "accounting.rate": AccountingRate;
2573
2739
  "accounting.rateType": AccountingRateType;
2740
+ "accounting.reservationJournalFreshnessControl": AccountingReservationJournalFreshnessControl;
2741
+ "accounting.reservationJournalInvalidation": AccountingReservationJournalInvalidation;
2742
+ "accounting.reservationJournalState": AccountingReservationJournalState;
2743
+ "accounting.reservationJournalStatementImpact": AccountingReservationJournalStatementImpact;
2574
2744
  "accounting.taxBehavior": AccountingTaxBehavior;
2575
2745
  "accounting.transaction": AccountingTransaction;
2576
2746
  "accounting.transactionAttachment": AccountingTransactionAttachment;
@@ -2596,6 +2766,8 @@ export interface DB {
2596
2766
  "core.changeSyncType": CoreChangeSyncType;
2597
2767
  "core.changeType": CoreChangeType;
2598
2768
  "core.csvOperationResult": CoreCsvOperationResult;
2769
+ "core.emailDelivery": CoreEmailDelivery;
2770
+ "core.emailNotification": CoreEmailNotification;
2599
2771
  "core.exportJob": CoreExportJob;
2600
2772
  "core.flow": CoreFlow;
2601
2773
  "core.flowEvent": CoreFlowEvent;
@@ -2606,6 +2778,7 @@ export interface DB {
2606
2778
  "core.flowSetting": CoreFlowSetting;
2607
2779
  "core.issueMessageOverwrite": CoreIssueMessageOverwrite;
2608
2780
  "core.operation": CoreOperation;
2781
+ "core.operationBackfill": CoreOperationBackfill;
2609
2782
  "core.operationProjectionOutbox": CoreOperationProjectionOutbox;
2610
2783
  "core.operationResource": CoreOperationResource;
2611
2784
  "core.operationSource": CoreOperationSource;
@@ -2626,8 +2799,11 @@ export interface DB {
2626
2799
  "hdbCatalog.hdbSourceCatalogVersion": HdbCatalogHdbSourceCatalogVersion;
2627
2800
  "hdbCatalog.hdbVersion": HdbCatalogHdbVersion;
2628
2801
  "health.accountingIntegrityCase": HealthAccountingIntegrityCase;
2802
+ "health.accountingIntegrityComparisonFinding": HealthAccountingIntegrityComparisonFinding;
2629
2803
  "health.accountingIntegrityDelivery": HealthAccountingIntegrityDelivery;
2804
+ "health.accountingIntegrityDirtyRecord": HealthAccountingIntegrityDirtyRecord;
2630
2805
  "health.accountingIntegrityOperatorEvent": HealthAccountingIntegrityOperatorEvent;
2806
+ "health.accountingIntegritySweepCursor": HealthAccountingIntegritySweepCursor;
2631
2807
  "health.accountingIntegrityRepairPlan": HealthAccountingIntegrityRepairPlan;
2632
2808
  "health.accountingIntegrityRepairStage": HealthAccountingIntegrityRepairStage;
2633
2809
  "health.accountingIntegrityRepairTarget": HealthAccountingIntegrityRepairTarget;