@vrplatform/kysely 1.3.45-6090 → 1.3.45-61

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 (60) hide show
  1. package/build/.data.tar +0 -0
  2. package/build/main/control-plane/index.d.ts +175 -0
  3. package/build/main/control-plane/index.js.map +1 -1
  4. package/build/main/index.d.ts +2 -2
  5. package/build/main/index.js +111 -22
  6. package/build/main/index.js.map +1 -1
  7. package/build/main/local/generate.js +2 -0
  8. package/build/main/local/generate.js.map +1 -1
  9. package/build/main/local/index.js +12 -0
  10. package/build/main/local/index.js.map +1 -1
  11. package/build/main/query/listing/status.js +2 -6
  12. package/build/main/query/listing/status.js.map +1 -1
  13. package/build/main/query/tenant/status.js +2 -2
  14. package/build/main/query/tenant/status.js.map +1 -1
  15. package/build/main/test/index.d.ts +0 -3
  16. package/build/main/test/index.js +0 -9
  17. package/build/main/test/index.js.map +1 -1
  18. package/build/main/v1.generated.d.ts +253 -2
  19. package/build/main/v1.generated.js.map +1 -1
  20. package/build/migrations-v2/0000000000015-durable-flow-events.ts +163 -0
  21. package/build/migrations-v2/0000000000016-billing-listing-facts.ts +539 -0
  22. package/build/migrations-v2/0000000000016-managed-team-access.ts +34 -0
  23. package/build/migrations-v2/0000000000017-drop-trial-until.ts +42 -0
  24. package/build/migrations-v2/0000000000017-webhook-secret-reencryption-failures.ts +18 -0
  25. package/build/migrations-v2/0000000000018-accounting-integrity-monitoring.ts +276 -0
  26. package/build/migrations-v2/0000000000018-durable-flow-event-sensitive-input.ts +28 -0
  27. package/build/migrations-v2/0000000000019-accounting-integrity-run-shards.ts +26 -0
  28. package/build/migrations-v2/0000000000019-asynchronous-operations.ts +736 -0
  29. package/build/migrations-v2/0000000000020-accounting-integrity-case-classification.ts +52 -0
  30. package/build/migrations-v2/0000000000021-payment-line-classification-monitor-indexes.ts +31 -0
  31. package/build/migrations-v2/0000000000022-accounting-integrity-controlled-repairs.ts +281 -0
  32. package/build/migrations-v2/0000000000023-line-classification-usage.ts +325 -0
  33. package/build/migrations-v2/0000000000024-tenant-region-migration.ts +108 -0
  34. package/build/migrations-v2/0000000000025-partner-ach-denial-default.ts +30 -0
  35. package/build/migrations-v2/0000000000026-line-classification-usage-capture.ts +399 -0
  36. package/build/migrations-v2/0000000000027-payout-replacement-chain.ts +27 -0
  37. package/build/migrations-v2/0000000000028-accounting-integrity-operator-workflow.ts +108 -0
  38. package/build/migrations-v2/0000000000029-accounting-integrity-definition-artifacts.ts +40 -0
  39. package/build/migrations-v2/0000000000030-accounting-integrity-review-metadata-compatibility.ts +49 -0
  40. package/build/migrations-v2/0000000000031-ui-permission-role-simplification.ts +70 -0
  41. package/build/migrations-v2/0000000000032-tenant-delete-ownership-cascades.ts +44 -0
  42. package/build/module/control-plane/index.d.ts +175 -0
  43. package/build/module/control-plane/index.js.map +1 -1
  44. package/build/module/index.d.ts +2 -2
  45. package/build/module/index.js +113 -23
  46. package/build/module/index.js.map +1 -1
  47. package/build/module/local/generate.js +2 -0
  48. package/build/module/local/generate.js.map +1 -1
  49. package/build/module/local/index.js +12 -0
  50. package/build/module/local/index.js.map +1 -1
  51. package/build/module/query/listing/status.js +2 -6
  52. package/build/module/query/listing/status.js.map +1 -1
  53. package/build/module/query/tenant/status.js +2 -2
  54. package/build/module/query/tenant/status.js.map +1 -1
  55. package/build/module/test/index.d.ts +0 -3
  56. package/build/module/test/index.js +0 -9
  57. package/build/module/test/index.js.map +1 -1
  58. package/build/module/v1.generated.d.ts +253 -2
  59. package/build/module/v1.generated.js.map +1 -1
  60. package/package.json +1 -1
@@ -0,0 +1,276 @@
1
+ import { type Kysely, sql } from 'kysely';
2
+
3
+ export async function up(db: Kysely<unknown>): Promise<void> {
4
+ await sql`
5
+ create type health.accounting_integrity_run_status as enum (
6
+ 'running',
7
+ 'completed',
8
+ 'failed',
9
+ 'skipped'
10
+ )
11
+ `.execute(db);
12
+ await sql`
13
+ create type health.accounting_integrity_case_status as enum (
14
+ 'open',
15
+ 'resolved'
16
+ )
17
+ `.execute(db);
18
+ await sql`
19
+ create type health.accounting_integrity_review_status as enum (
20
+ 'unreviewed',
21
+ 'confirmed_issue',
22
+ 'expected',
23
+ 'false_positive'
24
+ )
25
+ `.execute(db);
26
+ await sql`
27
+ create type health.accounting_integrity_actionability as enum (
28
+ 'automatically_repairable',
29
+ 'manual_repair',
30
+ 'blocked',
31
+ 'code_fix_required',
32
+ 'unknown'
33
+ )
34
+ `.execute(db);
35
+ await sql`
36
+ create type health.accounting_integrity_resolution_classification as enum (
37
+ 'code_fix',
38
+ 'configuration',
39
+ 'data_repair',
40
+ 'expected',
41
+ 'false_positive',
42
+ 'monitor_fix',
43
+ 'unknown'
44
+ )
45
+ `.execute(db);
46
+ await sql`
47
+ create type health.accounting_integrity_severity as enum (
48
+ 'info',
49
+ 'warning',
50
+ 'error',
51
+ 'critical'
52
+ )
53
+ `.execute(db);
54
+ await sql`
55
+ create type health.accounting_integrity_transition_type as enum (
56
+ 'opened',
57
+ 'changed',
58
+ 'reopened',
59
+ 'resolved',
60
+ 'reviewed'
61
+ )
62
+ `.execute(db);
63
+ await sql`
64
+ create type health.accounting_integrity_delivery_channel as enum (
65
+ 'sentry',
66
+ 'slack'
67
+ )
68
+ `.execute(db);
69
+ await sql`
70
+ create type health.accounting_integrity_delivery_status as enum (
71
+ 'suppressed',
72
+ 'pending',
73
+ 'processing',
74
+ 'delivered',
75
+ 'failed',
76
+ 'dead_letter'
77
+ )
78
+ `.execute(db);
79
+
80
+ await sql`
81
+ create table health.accounting_integrity_run (
82
+ id uuid primary key default gen_random_uuid(),
83
+ evaluation_id uuid not null,
84
+ code text not null,
85
+ definition_version integer not null,
86
+ git_revision text not null,
87
+ environment text not null,
88
+ data_region text not null,
89
+ status health.accounting_integrity_run_status not null,
90
+ started_at timestamptz not null,
91
+ completed_at timestamptz,
92
+ rows_scanned bigint not null default 0,
93
+ finding_row_count bigint not null default 0,
94
+ case_count bigint not null default 0,
95
+ opened_case_count bigint not null default 0,
96
+ changed_case_count bigint not null default 0,
97
+ reopened_case_count bigint not null default 0,
98
+ resolved_case_count bigint not null default 0,
99
+ unchanged_case_count bigint not null default 0,
100
+ error jsonb,
101
+ created_at timestamptz not null default now(),
102
+ updated_at timestamptz not null default now(),
103
+ constraint accounting_integrity_run_evaluation_region_code_key
104
+ unique (evaluation_id, data_region, code)
105
+ );
106
+ `.execute(db);
107
+
108
+ await sql`
109
+ create index accounting_integrity_run_metrics_idx
110
+ on health.accounting_integrity_run (
111
+ environment,
112
+ started_at desc
113
+ );
114
+ `.execute(db);
115
+
116
+ await sql`
117
+ create table health.accounting_integrity_case (
118
+ id uuid primary key default gen_random_uuid(),
119
+ data_region text not null,
120
+ code text not null,
121
+ tenant_id uuid not null references public.tenant(id) on delete cascade,
122
+ case_key text not null,
123
+ version bigint not null default 1,
124
+ status health.accounting_integrity_case_status not null,
125
+ review_status health.accounting_integrity_review_status
126
+ not null default 'unreviewed',
127
+ actionability health.accounting_integrity_actionability not null,
128
+ resolution_classification
129
+ health.accounting_integrity_resolution_classification not null,
130
+ severity health.accounting_integrity_severity not null,
131
+ title text not null,
132
+ root_cause text not null,
133
+ expected jsonb not null,
134
+ actual jsonb not null,
135
+ impact jsonb not null,
136
+ lock_assessment jsonb not null,
137
+ evidence jsonb not null,
138
+ evidence_complete boolean not null,
139
+ portal_urls jsonb not null,
140
+ historical_issue_refs jsonb not null,
141
+ verification jsonb not null,
142
+ repair jsonb not null,
143
+ content_hash text not null,
144
+ run_id uuid not null
145
+ references health.accounting_integrity_run(id) on delete restrict,
146
+ definition_version integer not null,
147
+ git_revision text not null,
148
+ first_seen_at timestamptz not null,
149
+ last_seen_at timestamptz not null,
150
+ last_changed_at timestamptz not null,
151
+ resolved_at timestamptz,
152
+ created_at timestamptz not null default now(),
153
+ updated_at timestamptz not null default now(),
154
+ constraint accounting_integrity_case_identity_key
155
+ unique (data_region, code, tenant_id, case_key),
156
+ constraint accounting_integrity_case_version_check check (version > 0)
157
+ );
158
+ `.execute(db);
159
+
160
+ await sql`
161
+ create index accounting_integrity_case_tenant_idx
162
+ on health.accounting_integrity_case (tenant_id)
163
+ `.execute(db);
164
+ await sql`
165
+ create index accounting_integrity_case_run_idx
166
+ on health.accounting_integrity_case (run_id)
167
+ `.execute(db);
168
+ await sql`
169
+ create index accounting_integrity_case_open_idx
170
+ on health.accounting_integrity_case (
171
+ data_region,
172
+ code,
173
+ severity,
174
+ tenant_id,
175
+ last_changed_at desc
176
+ )
177
+ where status = 'open';
178
+ `.execute(db);
179
+
180
+ await sql`
181
+ create table health.accounting_integrity_transition (
182
+ id uuid primary key default gen_random_uuid(),
183
+ run_id uuid not null
184
+ references health.accounting_integrity_run(id) on delete cascade,
185
+ case_id uuid not null
186
+ references health.accounting_integrity_case(id) on delete cascade,
187
+ case_version bigint not null,
188
+ type health.accounting_integrity_transition_type not null,
189
+ payload jsonb not null,
190
+ created_at timestamptz not null default now(),
191
+ constraint accounting_integrity_transition_case_version_type_key
192
+ unique (case_id, case_version, type)
193
+ );
194
+ `.execute(db);
195
+
196
+ await sql`
197
+ create index accounting_integrity_transition_run_idx
198
+ on health.accounting_integrity_transition (run_id)
199
+ `.execute(db);
200
+ await sql`
201
+ create table health.accounting_integrity_delivery (
202
+ id uuid primary key default gen_random_uuid(),
203
+ run_id uuid not null
204
+ references health.accounting_integrity_run(id) on delete cascade,
205
+ case_id uuid
206
+ references health.accounting_integrity_case(id) on delete cascade,
207
+ channel health.accounting_integrity_delivery_channel not null,
208
+ event_type text not null,
209
+ dedupe_key text not null unique,
210
+ payload jsonb not null,
211
+ status health.accounting_integrity_delivery_status
212
+ not null default 'pending',
213
+ attempts integer not null default 0,
214
+ claim_id uuid,
215
+ claimed_at timestamptz,
216
+ next_attempt_at timestamptz not null default now(),
217
+ delivered_at timestamptz,
218
+ result jsonb,
219
+ last_error jsonb,
220
+ created_at timestamptz not null default now(),
221
+ updated_at timestamptz not null default now()
222
+ );
223
+ `.execute(db);
224
+
225
+ await sql`
226
+ create index accounting_integrity_delivery_run_idx
227
+ on health.accounting_integrity_delivery (run_id)
228
+ `.execute(db);
229
+ await sql`
230
+ create index accounting_integrity_delivery_case_idx
231
+ on health.accounting_integrity_delivery (case_id)
232
+ `.execute(db);
233
+ await sql`
234
+ create index accounting_integrity_delivery_pending_idx
235
+ on health.accounting_integrity_delivery (next_attempt_at, created_at, id)
236
+ where status in ('pending', 'processing', 'failed');
237
+ `.execute(db);
238
+ }
239
+
240
+ export async function down(db: Kysely<unknown>): Promise<void> {
241
+ await sql`drop table if exists health.accounting_integrity_delivery;`.execute(
242
+ db
243
+ );
244
+ await sql`drop table if exists health.accounting_integrity_transition;`.execute(
245
+ db
246
+ );
247
+ await sql`drop table if exists health.accounting_integrity_case;`.execute(db);
248
+ await sql`drop table if exists health.accounting_integrity_run;`.execute(db);
249
+ await sql`drop type if exists health.accounting_integrity_delivery_status`.execute(
250
+ db
251
+ );
252
+ await sql`drop type if exists health.accounting_integrity_delivery_channel`.execute(
253
+ db
254
+ );
255
+ await sql`drop type if exists health.accounting_integrity_transition_type`.execute(
256
+ db
257
+ );
258
+ await sql`drop type if exists health.accounting_integrity_severity`.execute(
259
+ db
260
+ );
261
+ await sql`drop type if exists health.accounting_integrity_resolution_classification`.execute(
262
+ db
263
+ );
264
+ await sql`drop type if exists health.accounting_integrity_actionability`.execute(
265
+ db
266
+ );
267
+ await sql`drop type if exists health.accounting_integrity_review_status`.execute(
268
+ db
269
+ );
270
+ await sql`drop type if exists health.accounting_integrity_case_status`.execute(
271
+ db
272
+ );
273
+ await sql`drop type if exists health.accounting_integrity_run_status`.execute(
274
+ db
275
+ );
276
+ }
@@ -0,0 +1,28 @@
1
+ import type { Kysely } from 'kysely';
2
+ import { sql } from 'kysely';
3
+
4
+ export async function up(db: Kysely<unknown>): Promise<void> {
5
+ await sql`
6
+ alter table core.flow_event
7
+ add column requires_sensitive_input boolean not null default false
8
+ `.execute(db);
9
+ await sql`drop index core.flow_event_sync_idx`.execute(db);
10
+ await sql`
11
+ create index flow_event_sync_idx
12
+ on core.flow_event (sync_id, status)
13
+ where sync_id is not null
14
+ `.execute(db);
15
+ }
16
+
17
+ export async function down(db: Kysely<unknown>): Promise<void> {
18
+ await sql`drop index core.flow_event_sync_idx`.execute(db);
19
+ await sql`
20
+ create index flow_event_sync_idx
21
+ on core.flow_event (tenant_id, sync_id)
22
+ where sync_id is not null
23
+ `.execute(db);
24
+ await sql`
25
+ alter table core.flow_event
26
+ drop column requires_sensitive_input
27
+ `.execute(db);
28
+ }
@@ -0,0 +1,26 @@
1
+ import { type Kysely, sql } from 'kysely';
2
+
3
+ export async function up(db: Kysely<unknown>): Promise<void> {
4
+ await sql`
5
+ alter table health.accounting_integrity_run
6
+ add column shard_key text not null default 'regional'
7
+ `.execute(db);
8
+
9
+ await sql`
10
+ alter table health.accounting_integrity_run
11
+ drop constraint accounting_integrity_run_evaluation_region_code_key,
12
+ add constraint accounting_integrity_run_evaluation_region_code_shard_key
13
+ unique (evaluation_id, data_region, code, shard_key)
14
+ `.execute(db);
15
+ }
16
+
17
+ export async function down(db: Kysely<unknown>): Promise<void> {
18
+ await sql`
19
+ alter table health.accounting_integrity_run
20
+ drop constraint
21
+ accounting_integrity_run_evaluation_region_code_shard_key,
22
+ drop column shard_key,
23
+ add constraint accounting_integrity_run_evaluation_region_code_key
24
+ unique (evaluation_id, data_region, code)
25
+ `.execute(db);
26
+ }