@vrplatform/kysely 1.3.45-6198 → 1.3.45-6205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/.data.tar +0 -0
- package/build/main/control-plane/index.d.ts +22 -0
- package/build/main/control-plane/index.js.map +1 -1
- package/build/main/v1.generated.d.ts +105 -2
- package/build/main/v1.generated.js.map +1 -1
- package/build/migrations-v2/0000000000017-drop-trial-until.ts +42 -0
- package/build/migrations-v2/0000000000018-accounting-integrity-monitoring.ts +276 -0
- package/build/migrations-v2/0000000000019-accounting-integrity-run-shards.ts +26 -0
- package/build/migrations-v2/0000000000020-accounting-integrity-case-classification.ts +52 -0
- package/build/module/control-plane/index.d.ts +22 -0
- package/build/module/control-plane/index.js.map +1 -1
- package/build/module/v1.generated.d.ts +105 -2
- package/build/module/v1.generated.js.map +1 -1
- 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,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
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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_urgency as enum (
|
|
6
|
+
'immediate',
|
|
7
|
+
'next_triage',
|
|
8
|
+
'backlog',
|
|
9
|
+
'none'
|
|
10
|
+
)
|
|
11
|
+
`.execute(db);
|
|
12
|
+
await sql`
|
|
13
|
+
create type health.accounting_integrity_confidence as enum (
|
|
14
|
+
'proven',
|
|
15
|
+
'probable',
|
|
16
|
+
'unknown'
|
|
17
|
+
)
|
|
18
|
+
`.execute(db);
|
|
19
|
+
await sql`
|
|
20
|
+
alter table health.accounting_integrity_case
|
|
21
|
+
add column urgency health.accounting_integrity_urgency,
|
|
22
|
+
add column confidence health.accounting_integrity_confidence
|
|
23
|
+
`.execute(db);
|
|
24
|
+
await sql`
|
|
25
|
+
update health.accounting_integrity_case
|
|
26
|
+
set
|
|
27
|
+
urgency = case
|
|
28
|
+
when severity = 'info'
|
|
29
|
+
then 'none'::health.accounting_integrity_urgency
|
|
30
|
+
when nullif(impact -> 'modifiedAt' ->> 'latest', '')::timestamptz >=
|
|
31
|
+
now() - interval '28 days'
|
|
32
|
+
then 'next_triage'::health.accounting_integrity_urgency
|
|
33
|
+
else 'backlog'::health.accounting_integrity_urgency
|
|
34
|
+
end,
|
|
35
|
+
confidence = 'probable'::health.accounting_integrity_confidence
|
|
36
|
+
`.execute(db);
|
|
37
|
+
await sql`
|
|
38
|
+
alter table health.accounting_integrity_case
|
|
39
|
+
alter column urgency set not null,
|
|
40
|
+
alter column confidence set not null
|
|
41
|
+
`.execute(db);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
45
|
+
await sql`
|
|
46
|
+
alter table health.accounting_integrity_case
|
|
47
|
+
drop column confidence,
|
|
48
|
+
drop column urgency
|
|
49
|
+
`.execute(db);
|
|
50
|
+
await sql`drop type health.accounting_integrity_confidence`.execute(db);
|
|
51
|
+
await sql`drop type health.accounting_integrity_urgency`.execute(db);
|
|
52
|
+
}
|
|
@@ -7,6 +7,7 @@ export type JsonObject = {
|
|
|
7
7
|
};
|
|
8
8
|
export type JsonPrimitive = boolean | number | string | null;
|
|
9
9
|
export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
|
|
10
|
+
export type Int8 = ColumnType<string, number | string | bigint, number | string | bigint>;
|
|
10
11
|
export type Timestamp = ColumnType<Date | string, Date | string, Date | string>;
|
|
11
12
|
export interface ControlPlaneApp {
|
|
12
13
|
authentication: Generated<Json>;
|
|
@@ -21,6 +22,26 @@ export interface ControlPlaneApp {
|
|
|
21
22
|
type: string;
|
|
22
23
|
version: Generated<number>;
|
|
23
24
|
}
|
|
25
|
+
export interface ControlPlaneAccountingIntegrityEvaluation {
|
|
26
|
+
caseCount: Generated<Int8>;
|
|
27
|
+
completedAt: Timestamp | null;
|
|
28
|
+
completedRunCount: Generated<number>;
|
|
29
|
+
createdAt: Generated<Timestamp>;
|
|
30
|
+
environment: string;
|
|
31
|
+
error: Json | null;
|
|
32
|
+
expectedRunCount: number;
|
|
33
|
+
failedRunCount: Generated<number>;
|
|
34
|
+
findingRowCount: Generated<Int8>;
|
|
35
|
+
gitRevision: string;
|
|
36
|
+
id: string;
|
|
37
|
+
results: Generated<Json>;
|
|
38
|
+
rowsScanned: Generated<Int8>;
|
|
39
|
+
skippedRunCount: Generated<number>;
|
|
40
|
+
source: string;
|
|
41
|
+
startedAt: Timestamp;
|
|
42
|
+
status: string;
|
|
43
|
+
updatedAt: Generated<Timestamp>;
|
|
44
|
+
}
|
|
24
45
|
export interface ControlPlaneBookingChannel {
|
|
25
46
|
channelRef: string | null;
|
|
26
47
|
color: string | null;
|
|
@@ -175,6 +196,7 @@ export interface ControlPlaneUser {
|
|
|
175
196
|
updatedAt: Generated<Timestamp | null>;
|
|
176
197
|
}
|
|
177
198
|
export interface ControlPlaneDB {
|
|
199
|
+
'controlPlane.accountingIntegrityEvaluation': ControlPlaneAccountingIntegrityEvaluation;
|
|
178
200
|
'controlPlane.app': ControlPlaneApp;
|
|
179
201
|
'controlPlane.bookingChannel': ControlPlaneBookingChannel;
|
|
180
202
|
'controlPlane.bookingChannelIconCandidate': ControlPlaneBookingChannelIconCandidate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAGd,wBAAwB,GAQzB,MAAM,QAAQ,CAAC;AA4NhB,MAAM,6BAA8B,SAAQ,wBAAwB;IAEvD;IACA;IAFX,YACW,MAAc,EACd,2BAAmC;QAE5C,KAAK,EAAE,CAAC;QAHC,WAAM,GAAN,MAAM,CAAQ;QACd,gCAA2B,GAA3B,2BAA2B,CAAQ;IAG9C,CAAC;IAEkB,4BAA4B,CAC7C,IAA6B,EAC7B,OAAgB;QAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtE,IACE,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,cAAc;YAC3C,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,eAAe,EAC5C,CAAC;YACD,OAAO,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,CAAC;QACD,IACE,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,kBAAkB;YAC/C,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,oBAAoB,EACjD,CAAC;YACD,OAAO;gBACL,GAAG,WAAW;gBACd,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;aAChE,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEkB,iBAAiB,CAClC,IAAkB,EAClB,OAAgB;QAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YAC1C,CAAC,CAAC;gBACE,GAAG,WAAW;gBACd,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE;aACzE;YACH,CAAC,CAAC,WAAW,CAAC;IAClB,CAAC;CACF;AAED,MAAM,wBAAwB;IACnB,YAAY,CAAgC;IAErD,YAAY,MAAc,EAAE,2BAAmC;QAC7D,IAAI,CAAC,YAAY,GAAG,IAAI,6BAA6B,CACnD,MAAM,EACN,2BAA2B,CAC5B,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,IAA8B;QAC3C,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,IAA+B;QAE/B,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAED,MAAM,UAAU,sBAAsB,CACpC,MAA8B,EAC9B,MAAc,EACd,2BAA2B,GAAG,MAAM;IAEpC,OAAO,MAAM,CAAC,UAAU,CACtB,IAAI,wBAAwB,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAClE,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ColumnType,\n type FunctionNode,\n IdentifierNode,\n type Kysely,\n type KyselyPlugin,\n OperationNodeTransformer,\n type PluginTransformQueryArgs,\n type PluginTransformResultArgs,\n type QueryId,\n type QueryResult,\n type RootOperationNode,\n type SchemableIdentifierNode,\n type UnknownRow,\n} from 'kysely';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneBookingChannelIconCandidate {\n bookingChannelId: string;\n cloudflareImageId: string | null;\n color: string | null;\n comment: string | null;\n createdAt: Generated<Timestamp>;\n externalIcon: string | null;\n height: number | null;\n id: Generated<string>;\n provider: Generated<string>;\n source: string | null;\n updatedAt: Generated<Timestamp>;\n width: number | null;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport interface ControlPlaneEvent {\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n name: string;\n packageName: string;\n props: Json;\n tenantId: string | null;\n timestamp: Generated<Timestamp>;\n trackedAt: Generated<Timestamp | null>;\n userId: string | null;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeatureApproval {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n updatedAt: Generated<Timestamp>;\n userId: string;\n}\n\nexport interface ControlPlaneIssueMessageOverwrite {\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n message: string;\n pattern: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n billingPartnerId: string | null;\n billingPlan: string | null;\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n name: string;\n partnerId: string | null;\n partnerDeniedPermissions: Generated<string[]>;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n uniqueRef: string | null;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n managedTeamAccess: Generated<'all' | 'assigned'>;\n permissionBundles: Generated<string[]>;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n lastSeen: Timestamp | null;\n name: string | null;\n partnerId: string | null;\n phone: string | null;\n secondaryEmails: Generated<Json>;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneDB {\n 'controlPlane.app': ControlPlaneApp;\n 'controlPlane.bookingChannel': ControlPlaneBookingChannel;\n 'controlPlane.bookingChannelIconCandidate': ControlPlaneBookingChannelIconCandidate;\n 'controlPlane.connectionRoute': ControlPlaneConnectionRoute;\n 'controlPlane.controlPlaneOutbox': ControlPlaneOutbox;\n 'controlPlane.currency': ControlPlaneCurrency;\n 'controlPlane.events': ControlPlaneEvent;\n 'controlPlane.feature': ControlPlaneFeature;\n 'controlPlane.featureApproval': ControlPlaneFeatureApproval;\n 'controlPlane.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'controlPlane.tenant': ControlPlaneTenant;\n 'controlPlane.tenantUser': ControlPlaneTenantUser;\n 'controlPlane.token': ControlPlaneToken;\n 'controlPlane.user': ControlPlaneUser;\n 'controlPlaneCore.issueMessageOverwrite': ControlPlaneIssueMessageOverwrite;\n}\n\nclass ControlPlaneSchemaTransformer extends OperationNodeTransformer {\n constructor(\n readonly schema: string,\n readonly issueMessageOverwriteSchema: string\n ) {\n super();\n }\n\n protected override transformSchemableIdentifier(\n node: SchemableIdentifierNode,\n queryId: QueryId\n ): SchemableIdentifierNode {\n const transformed = super.transformSchemableIdentifier(node, queryId);\n if (\n transformed.schema?.name === 'controlPlane' ||\n transformed.schema?.name === 'control_plane'\n ) {\n return { ...transformed, schema: IdentifierNode.create(this.schema) };\n }\n if (\n transformed.schema?.name === 'controlPlaneCore' ||\n transformed.schema?.name === 'control_plane_core'\n ) {\n return {\n ...transformed,\n schema: IdentifierNode.create(this.issueMessageOverwriteSchema),\n };\n }\n return transformed;\n }\n\n protected override transformFunction(\n node: FunctionNode,\n queryId: QueryId\n ): FunctionNode {\n const transformed = super.transformFunction(node, queryId);\n return node.func.startsWith('controlPlane.')\n ? {\n ...transformed,\n func: `${this.schema}.${transformed.func.slice('controlPlane.'.length)}`,\n }\n : transformed;\n }\n}\n\nclass ControlPlaneSchemaPlugin implements KyselyPlugin {\n readonly #transformer: ControlPlaneSchemaTransformer;\n\n constructor(schema: string, issueMessageOverwriteSchema: string) {\n this.#transformer = new ControlPlaneSchemaTransformer(\n schema,\n issueMessageOverwriteSchema\n );\n }\n\n transformQuery(args: PluginTransformQueryArgs): RootOperationNode {\n return this.#transformer.transformNode(args.node, args.queryId);\n }\n\n async transformResult(\n args: PluginTransformResultArgs\n ): Promise<QueryResult<UnknownRow>> {\n return args.result;\n }\n}\n\nexport function withControlPlaneSchema(\n kysely: Kysely<ControlPlaneDB>,\n schema: string,\n issueMessageOverwriteSchema = 'core'\n) {\n return kysely.withPlugin(\n new ControlPlaneSchemaPlugin(schema, issueMessageOverwriteSchema)\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["control-plane/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAGd,wBAAwB,GAQzB,MAAM,QAAQ,CAAC;AAwPhB,MAAM,6BAA8B,SAAQ,wBAAwB;IAEvD;IACA;IAFX,YACW,MAAc,EACd,2BAAmC;QAE5C,KAAK,EAAE,CAAC;QAHC,WAAM,GAAN,MAAM,CAAQ;QACd,gCAA2B,GAA3B,2BAA2B,CAAQ;IAG9C,CAAC;IAEkB,4BAA4B,CAC7C,IAA6B,EAC7B,OAAgB;QAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtE,IACE,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,cAAc;YAC3C,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,eAAe,EAC5C,CAAC;YACD,OAAO,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,CAAC;QACD,IACE,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,kBAAkB;YAC/C,WAAW,CAAC,MAAM,EAAE,IAAI,KAAK,oBAAoB,EACjD,CAAC;YACD,OAAO;gBACL,GAAG,WAAW;gBACd,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;aAChE,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEkB,iBAAiB,CAClC,IAAkB,EAClB,OAAgB;QAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YAC1C,CAAC,CAAC;gBACE,GAAG,WAAW;gBACd,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE;aACzE;YACH,CAAC,CAAC,WAAW,CAAC;IAClB,CAAC;CACF;AAED,MAAM,wBAAwB;IACnB,YAAY,CAAgC;IAErD,YAAY,MAAc,EAAE,2BAAmC;QAC7D,IAAI,CAAC,YAAY,GAAG,IAAI,6BAA6B,CACnD,MAAM,EACN,2BAA2B,CAC5B,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,IAA8B;QAC3C,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,IAA+B;QAE/B,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAED,MAAM,UAAU,sBAAsB,CACpC,MAA8B,EAC9B,MAAc,EACd,2BAA2B,GAAG,MAAM;IAEpC,OAAO,MAAM,CAAC,UAAU,CACtB,IAAI,wBAAwB,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAClE,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ColumnType,\n type FunctionNode,\n IdentifierNode,\n type Kysely,\n type KyselyPlugin,\n OperationNodeTransformer,\n type PluginTransformQueryArgs,\n type PluginTransformResultArgs,\n type QueryId,\n type QueryResult,\n type RootOperationNode,\n type SchemableIdentifierNode,\n type UnknownRow,\n} from 'kysely';\n\nexport type Generated<T> =\n T extends ColumnType<infer S, infer I, infer U>\n ? ColumnType<S, I | undefined, U>\n : ColumnType<T, T | undefined, T>;\n\nexport type Json = JsonValue;\n\nexport type JsonArray = JsonValue[];\n\nexport type JsonObject = {\n [x: string]: JsonValue | undefined;\n};\n\nexport type JsonPrimitive = boolean | number | string | null;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type Int8 = ColumnType<\n string,\n number | string | bigint,\n number | string | bigint\n>;\n\nexport type Timestamp = ColumnType<Date | string, Date | string, Date | string>;\n\nexport interface ControlPlaneApp {\n authentication: Generated<Json>;\n category: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconRound: string | null;\n id: Generated<string>;\n info: Json | null;\n name: string;\n type: string;\n version: Generated<number>;\n}\n\nexport interface ControlPlaneAccountingIntegrityEvaluation {\n caseCount: Generated<Int8>;\n completedAt: Timestamp | null;\n completedRunCount: Generated<number>;\n createdAt: Generated<Timestamp>;\n environment: string;\n error: Json | null;\n expectedRunCount: number;\n failedRunCount: Generated<number>;\n findingRowCount: Generated<Int8>;\n gitRevision: string;\n id: string;\n results: Generated<Json>;\n rowsScanned: Generated<Int8>;\n skippedRunCount: Generated<number>;\n source: string;\n startedAt: Timestamp;\n status: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneBookingChannel {\n channelRef: string | null;\n color: string | null;\n createdAt: Generated<Timestamp>;\n icon: string | null;\n iconProvider: string | null;\n id: Generated<string>;\n lastGenerateRun: Timestamp | null;\n logo: string | null;\n logoProvider: string | null;\n selectedBookingChannelIconCandidateId: string | null;\n selectedBookingChannelLogoCandidateId: string | null;\n uniqueRef: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneBookingChannelIconCandidate {\n bookingChannelId: string;\n cloudflareImageId: string | null;\n color: string | null;\n comment: string | null;\n createdAt: Generated<Timestamp>;\n externalIcon: string | null;\n height: number | null;\n id: Generated<string>;\n provider: Generated<string>;\n source: string | null;\n updatedAt: Generated<Timestamp>;\n width: number | null;\n}\n\nexport interface ControlPlaneCurrency {\n name: string;\n}\n\nexport interface ControlPlaneEvent {\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n name: string;\n packageName: string;\n props: Json;\n tenantId: string | null;\n timestamp: Generated<Timestamp>;\n trackedAt: Generated<Timestamp | null>;\n userId: string | null;\n}\n\nexport interface ControlPlaneConnectionRoute {\n connectionId: string;\n createdAt: Generated<Timestamp>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeature {\n createdAt: Generated<Timestamp>;\n description: string | null;\n id: Generated<string>;\n issueUrl: string | null;\n requiredApprovals: Generated<Json | null>;\n status: Generated<string | null>;\n tenantId: string | null;\n title: string;\n updatedAt: Generated<Timestamp>;\n url: string | null;\n}\n\nexport interface ControlPlaneFeatureEnabledTeam {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneFeatureApproval {\n createdAt: Generated<Timestamp>;\n featureId: string;\n id: Generated<string>;\n status: Generated<string | null>;\n updatedAt: Generated<Timestamp>;\n userId: string;\n}\n\nexport interface ControlPlaneIssueMessageOverwrite {\n createdAt: Generated<Timestamp>;\n id: Generated<string>;\n message: string;\n pattern: string;\n updatedAt: Generated<Timestamp>;\n}\n\nexport interface ControlPlaneOutbox {\n aggregateId: string;\n aggregateType: string;\n attempts: Generated<number>;\n createdAt: Generated<Timestamp>;\n dataRegion: string | null;\n eventType: string;\n eventVersion: number;\n id: Generated<string>;\n lastError: string | null;\n payload: Generated<Json>;\n publishedAt: Timestamp | null;\n}\n\nexport interface ControlPlaneTenant {\n billingPartnerId: string | null;\n billingPlan: string | null;\n createdAt: Generated<Timestamp>;\n dataRegion: Generated<string>;\n id: Generated<string>;\n name: string;\n partnerId: string | null;\n partnerDeniedPermissions: Generated<string[]>;\n slug: string;\n status: Generated<string | null>;\n storageRealm: Generated<string>;\n type: Generated<string | null>;\n uniqueRef: string | null;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneTenantUser {\n createdAt: Generated<Timestamp | null>;\n id: Generated<string>;\n lastInvitedAt: Timestamp | null;\n managedTeamAccess: Generated<'all' | 'assigned'>;\n permissionBundles: Generated<string[]>;\n role: Generated<string | null>;\n status: Generated<string | null>;\n tenantId: string;\n updatedAt: Generated<Timestamp | null>;\n userId: string;\n}\n\nexport interface ControlPlaneToken {\n createdAt: Generated<Timestamp>;\n expiresAt: Timestamp | null;\n id: Generated<string>;\n nanoId: Generated<string>;\n payload: Generated<Json>;\n tenantId: string | null;\n type: string | null;\n userId: string | null;\n}\n\nexport interface ControlPlaneUser {\n clerkId: string | null;\n createdAt: Generated<Timestamp | null>;\n email: string | null;\n firstName: string | null;\n id: Generated<string>;\n isAdmin: Generated<boolean>;\n lastName: string | null;\n lastSeen: Timestamp | null;\n name: string | null;\n partnerId: string | null;\n phone: string | null;\n secondaryEmails: Generated<Json>;\n status: Generated<string | null>;\n sub: string | null;\n type: Generated<string | null>;\n updatedAt: Generated<Timestamp | null>;\n}\n\nexport interface ControlPlaneDB {\n 'controlPlane.accountingIntegrityEvaluation': ControlPlaneAccountingIntegrityEvaluation;\n 'controlPlane.app': ControlPlaneApp;\n 'controlPlane.bookingChannel': ControlPlaneBookingChannel;\n 'controlPlane.bookingChannelIconCandidate': ControlPlaneBookingChannelIconCandidate;\n 'controlPlane.connectionRoute': ControlPlaneConnectionRoute;\n 'controlPlane.controlPlaneOutbox': ControlPlaneOutbox;\n 'controlPlane.currency': ControlPlaneCurrency;\n 'controlPlane.events': ControlPlaneEvent;\n 'controlPlane.feature': ControlPlaneFeature;\n 'controlPlane.featureApproval': ControlPlaneFeatureApproval;\n 'controlPlane.featureEnabledTeam': ControlPlaneFeatureEnabledTeam;\n 'controlPlane.tenant': ControlPlaneTenant;\n 'controlPlane.tenantUser': ControlPlaneTenantUser;\n 'controlPlane.token': ControlPlaneToken;\n 'controlPlane.user': ControlPlaneUser;\n 'controlPlaneCore.issueMessageOverwrite': ControlPlaneIssueMessageOverwrite;\n}\n\nclass ControlPlaneSchemaTransformer extends OperationNodeTransformer {\n constructor(\n readonly schema: string,\n readonly issueMessageOverwriteSchema: string\n ) {\n super();\n }\n\n protected override transformSchemableIdentifier(\n node: SchemableIdentifierNode,\n queryId: QueryId\n ): SchemableIdentifierNode {\n const transformed = super.transformSchemableIdentifier(node, queryId);\n if (\n transformed.schema?.name === 'controlPlane' ||\n transformed.schema?.name === 'control_plane'\n ) {\n return { ...transformed, schema: IdentifierNode.create(this.schema) };\n }\n if (\n transformed.schema?.name === 'controlPlaneCore' ||\n transformed.schema?.name === 'control_plane_core'\n ) {\n return {\n ...transformed,\n schema: IdentifierNode.create(this.issueMessageOverwriteSchema),\n };\n }\n return transformed;\n }\n\n protected override transformFunction(\n node: FunctionNode,\n queryId: QueryId\n ): FunctionNode {\n const transformed = super.transformFunction(node, queryId);\n return node.func.startsWith('controlPlane.')\n ? {\n ...transformed,\n func: `${this.schema}.${transformed.func.slice('controlPlane.'.length)}`,\n }\n : transformed;\n }\n}\n\nclass ControlPlaneSchemaPlugin implements KyselyPlugin {\n readonly #transformer: ControlPlaneSchemaTransformer;\n\n constructor(schema: string, issueMessageOverwriteSchema: string) {\n this.#transformer = new ControlPlaneSchemaTransformer(\n schema,\n issueMessageOverwriteSchema\n );\n }\n\n transformQuery(args: PluginTransformQueryArgs): RootOperationNode {\n return this.#transformer.transformNode(args.node, args.queryId);\n }\n\n async transformResult(\n args: PluginTransformResultArgs\n ): Promise<QueryResult<UnknownRow>> {\n return args.result;\n }\n}\n\nexport function withControlPlaneSchema(\n kysely: Kysely<ControlPlaneDB>,\n schema: string,\n issueMessageOverwriteSchema = 'core'\n) {\n return kysely.withPlugin(\n new ControlPlaneSchemaPlugin(schema, issueMessageOverwriteSchema)\n );\n}\n"]}
|
|
@@ -16,6 +16,17 @@ export type AuditPublicEventAccountingStatus = "blocked" | "changed" | "failed"
|
|
|
16
16
|
export type AuditPublicEventOperation = "archive" | "create" | "delete" | "execute" | "recalculate" | "restore" | "update";
|
|
17
17
|
export type AuditSourceType = "api" | "automation" | "integration" | "portal" | "sync" | "system";
|
|
18
18
|
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
|
|
19
|
+
export type HealthAccountingIntegrityActionability = "automatically_repairable" | "blocked" | "code_fix_required" | "manual_repair" | "unknown";
|
|
20
|
+
export type HealthAccountingIntegrityCaseStatus = "open" | "resolved";
|
|
21
|
+
export type HealthAccountingIntegrityConfidence = "probable" | "proven" | "unknown";
|
|
22
|
+
export type HealthAccountingIntegrityDeliveryChannel = "sentry" | "slack";
|
|
23
|
+
export type HealthAccountingIntegrityDeliveryStatus = "dead_letter" | "delivered" | "failed" | "pending" | "processing" | "suppressed";
|
|
24
|
+
export type HealthAccountingIntegrityResolutionClassification = "code_fix" | "configuration" | "data_repair" | "expected" | "false_positive" | "monitor_fix" | "unknown";
|
|
25
|
+
export type HealthAccountingIntegrityReviewStatus = "confirmed_issue" | "expected" | "false_positive" | "unreviewed";
|
|
26
|
+
export type HealthAccountingIntegrityRunStatus = "completed" | "failed" | "running" | "skipped";
|
|
27
|
+
export type HealthAccountingIntegritySeverity = "critical" | "error" | "info" | "warning";
|
|
28
|
+
export type HealthAccountingIntegrityTransitionType = "changed" | "opened" | "reopened" | "resolved" | "reviewed";
|
|
29
|
+
export type HealthAccountingIntegrityUrgency = "backlog" | "immediate" | "next_triage" | "none";
|
|
19
30
|
export type HealthTenantIssueCategory = "criticalToSystem" | "criticalToUser";
|
|
20
31
|
export type HealthTenantIssueCode = "brokenConnections" | "cancelledReservationPaidWithoutAdjustment" | "closedPeriodUnattachedJournalEntries" | "duplicatedPayments" | "endedOwnershipNonZeroBalance" | "listingOwnershipPeriodNotFoundOnActiveJournals" | "missingOwnershipOrDeactivation" | "operatingBankAccountsWithoutOpex" | "outdatedConnections" | "partnerBillingInactive" | "partnerInactive" | "pmsMissingAccountingStart" | "publishedStatementUnpaid" | "reservationCurrencyMismatch" | "reservationGuestTotalsMismatch" | "reservationPaymentProjectionMismatch" | "teamInactive" | "unbalancedJournalEntries" | "unbalancedTransactionJournalEntries" | "unpaidReservations";
|
|
21
32
|
export type HealthTenantIssueSeverity = "error" | "warning";
|
|
@@ -876,6 +887,95 @@ export interface HdbCatalogHdbVersion {
|
|
|
876
887
|
upgradedOn: Timestamp;
|
|
877
888
|
version: string;
|
|
878
889
|
}
|
|
890
|
+
export interface HealthAccountingIntegrityCase {
|
|
891
|
+
actionability: HealthAccountingIntegrityActionability;
|
|
892
|
+
actual: Json;
|
|
893
|
+
caseKey: string;
|
|
894
|
+
code: string;
|
|
895
|
+
confidence: HealthAccountingIntegrityConfidence;
|
|
896
|
+
contentHash: string;
|
|
897
|
+
createdAt: Generated<Timestamp>;
|
|
898
|
+
dataRegion: string;
|
|
899
|
+
definitionVersion: number;
|
|
900
|
+
evidence: Json;
|
|
901
|
+
evidenceComplete: boolean;
|
|
902
|
+
expected: Json;
|
|
903
|
+
firstSeenAt: Timestamp;
|
|
904
|
+
gitRevision: string;
|
|
905
|
+
historicalIssueRefs: Json;
|
|
906
|
+
id: Generated<string>;
|
|
907
|
+
impact: Json;
|
|
908
|
+
lastChangedAt: Timestamp;
|
|
909
|
+
lastSeenAt: Timestamp;
|
|
910
|
+
lockAssessment: Json;
|
|
911
|
+
portalUrls: Json;
|
|
912
|
+
repair: Json;
|
|
913
|
+
resolutionClassification: HealthAccountingIntegrityResolutionClassification;
|
|
914
|
+
resolvedAt: Timestamp | null;
|
|
915
|
+
reviewStatus: Generated<HealthAccountingIntegrityReviewStatus>;
|
|
916
|
+
rootCause: string;
|
|
917
|
+
runId: string;
|
|
918
|
+
severity: HealthAccountingIntegritySeverity;
|
|
919
|
+
status: HealthAccountingIntegrityCaseStatus;
|
|
920
|
+
tenantId: string;
|
|
921
|
+
title: string;
|
|
922
|
+
updatedAt: Generated<Timestamp>;
|
|
923
|
+
urgency: HealthAccountingIntegrityUrgency;
|
|
924
|
+
verification: Json;
|
|
925
|
+
version: Generated<Int8>;
|
|
926
|
+
}
|
|
927
|
+
export interface HealthAccountingIntegrityDelivery {
|
|
928
|
+
attempts: Generated<number>;
|
|
929
|
+
caseId: string | null;
|
|
930
|
+
channel: HealthAccountingIntegrityDeliveryChannel;
|
|
931
|
+
claimedAt: Timestamp | null;
|
|
932
|
+
claimId: string | null;
|
|
933
|
+
createdAt: Generated<Timestamp>;
|
|
934
|
+
dedupeKey: string;
|
|
935
|
+
deliveredAt: Timestamp | null;
|
|
936
|
+
eventType: string;
|
|
937
|
+
id: Generated<string>;
|
|
938
|
+
lastError: Json | null;
|
|
939
|
+
nextAttemptAt: Generated<Timestamp>;
|
|
940
|
+
payload: Json;
|
|
941
|
+
result: Json | null;
|
|
942
|
+
runId: string;
|
|
943
|
+
status: Generated<HealthAccountingIntegrityDeliveryStatus>;
|
|
944
|
+
updatedAt: Generated<Timestamp>;
|
|
945
|
+
}
|
|
946
|
+
export interface HealthAccountingIntegrityRun {
|
|
947
|
+
caseCount: Generated<Int8>;
|
|
948
|
+
changedCaseCount: Generated<Int8>;
|
|
949
|
+
code: string;
|
|
950
|
+
completedAt: Timestamp | null;
|
|
951
|
+
createdAt: Generated<Timestamp>;
|
|
952
|
+
dataRegion: string;
|
|
953
|
+
definitionVersion: number;
|
|
954
|
+
environment: string;
|
|
955
|
+
error: Json | null;
|
|
956
|
+
evaluationId: string;
|
|
957
|
+
findingRowCount: Generated<Int8>;
|
|
958
|
+
gitRevision: string;
|
|
959
|
+
id: Generated<string>;
|
|
960
|
+
openedCaseCount: Generated<Int8>;
|
|
961
|
+
reopenedCaseCount: Generated<Int8>;
|
|
962
|
+
resolvedCaseCount: Generated<Int8>;
|
|
963
|
+
rowsScanned: Generated<Int8>;
|
|
964
|
+
shardKey: Generated<string>;
|
|
965
|
+
startedAt: Timestamp;
|
|
966
|
+
status: HealthAccountingIntegrityRunStatus;
|
|
967
|
+
unchangedCaseCount: Generated<Int8>;
|
|
968
|
+
updatedAt: Generated<Timestamp>;
|
|
969
|
+
}
|
|
970
|
+
export interface HealthAccountingIntegrityTransition {
|
|
971
|
+
caseId: string;
|
|
972
|
+
caseVersion: Int8;
|
|
973
|
+
createdAt: Generated<Timestamp>;
|
|
974
|
+
id: Generated<string>;
|
|
975
|
+
payload: Json;
|
|
976
|
+
runId: string;
|
|
977
|
+
type: HealthAccountingIntegrityTransitionType;
|
|
978
|
+
}
|
|
879
979
|
export interface HealthReservationIssueSnapshot {
|
|
880
980
|
computedAt: Timestamp | null;
|
|
881
981
|
computedVersion: Generated<Int8>;
|
|
@@ -1853,8 +1953,8 @@ export interface PublicTenant {
|
|
|
1853
1953
|
migratedFromTenantId: string | null;
|
|
1854
1954
|
name: string;
|
|
1855
1955
|
ownerPortalShowDraftStatements: boolean | null;
|
|
1856
|
-
partnerId: Generated<string | null>;
|
|
1857
1956
|
partnerDeniedPermissions: Generated<string[]>;
|
|
1957
|
+
partnerId: Generated<string | null>;
|
|
1858
1958
|
/**
|
|
1859
1959
|
* JSON column to hold team settings like "owner_portal_show_reservation_totals" or "owner_portal_show_draft_statements
|
|
1860
1960
|
*/
|
|
@@ -1872,7 +1972,6 @@ export interface PublicTenant {
|
|
|
1872
1972
|
supportEmail: string | null;
|
|
1873
1973
|
supportPhone: string | null;
|
|
1874
1974
|
svixEndpoints: boolean | null;
|
|
1875
|
-
trialUntil: Timestamp | null;
|
|
1876
1975
|
type: Generated<string | null>;
|
|
1877
1976
|
uniqueRef: string | null;
|
|
1878
1977
|
updatedAt: Generated<Timestamp | null>;
|
|
@@ -2209,6 +2308,10 @@ export interface DB {
|
|
|
2209
2308
|
"hdbCatalog.hdbSchemaNotifications": HdbCatalogHdbSchemaNotifications;
|
|
2210
2309
|
"hdbCatalog.hdbSourceCatalogVersion": HdbCatalogHdbSourceCatalogVersion;
|
|
2211
2310
|
"hdbCatalog.hdbVersion": HdbCatalogHdbVersion;
|
|
2311
|
+
"health.accountingIntegrityCase": HealthAccountingIntegrityCase;
|
|
2312
|
+
"health.accountingIntegrityDelivery": HealthAccountingIntegrityDelivery;
|
|
2313
|
+
"health.accountingIntegrityRun": HealthAccountingIntegrityRun;
|
|
2314
|
+
"health.accountingIntegrityTransition": HealthAccountingIntegrityTransition;
|
|
2212
2315
|
"health.reservationIssueSnapshot": HealthReservationIssueSnapshot;
|
|
2213
2316
|
"health.tenantIssue": HealthTenantIssue;
|
|
2214
2317
|
"health.tenantIssueRuleState": HealthTenantIssueRuleState;
|