@vrplatform/kysely 1.3.45-stage.820 → 1.3.45-stage.872
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/main/test/index.js +4 -3
- package/build/main/test/index.js.map +1 -1
- package/build/main/v1.generated.d.ts +41 -0
- package/build/main/v1.generated.js.map +1 -1
- package/build/migrations-v2/0000000000060-accounting-integrity-change-driven.ts +99 -0
- package/build/module/test/index.js +4 -3
- package/build/module/test/index.js.map +1 -1
- package/build/module/v1.generated.d.ts +41 -0
- package/build/module/v1.generated.js.map +1 -1
- package/package.json +3 -3
package/build/main/test/index.js
CHANGED
|
@@ -55,10 +55,11 @@ async function useLocalKyselyResource(args) {
|
|
|
55
55
|
if (prop === 'kysely') {
|
|
56
56
|
return kysely;
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
const member = Reflect.get(kysely, prop);
|
|
59
|
+
if (typeof member === 'function') {
|
|
60
|
+
return member.bind(kysely);
|
|
60
61
|
}
|
|
61
|
-
return
|
|
62
|
+
return member;
|
|
62
63
|
},
|
|
63
64
|
});
|
|
64
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["test/index.ts"],"names":[],"mappings":";;AA+BA,kDAKC;AAcD,4DAUC;AAMD,
|
|
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,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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"]}
|
|
@@ -38,6 +38,7 @@ export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? Col
|
|
|
38
38
|
export type HealthAccountingIntegrityActionability = "automatically_repairable" | "blocked" | "code_fix_required" | "manual_repair" | "unknown";
|
|
39
39
|
export type HealthAccountingIntegrityCaseStatus = "open" | "resolved";
|
|
40
40
|
export type HealthAccountingIntegrityConfidence = "probable" | "proven" | "unknown";
|
|
41
|
+
export type HealthAccountingIntegrityDirtyRecordType = "reservation" | "transaction";
|
|
41
42
|
export type HealthAccountingIntegrityDeliveryChannel = "sentry" | "slack";
|
|
42
43
|
export type HealthAccountingIntegrityDeliveryStatus = "dead_letter" | "delivered" | "failed" | "pending" | "processing" | "suppressed";
|
|
43
44
|
export type HealthAccountingIntegrityRepairPlanStatus = "active" | "canceled" | "completed" | "draft" | "failed" | "paused";
|
|
@@ -1202,6 +1203,20 @@ export interface HealthAccountingIntegrityCase {
|
|
|
1202
1203
|
verification: Json;
|
|
1203
1204
|
version: Generated<Int8>;
|
|
1204
1205
|
}
|
|
1206
|
+
export interface HealthAccountingIntegrityComparisonFinding {
|
|
1207
|
+
caseKey: string;
|
|
1208
|
+
code: string;
|
|
1209
|
+
contentHash: string;
|
|
1210
|
+
createdAt: Generated<Timestamp>;
|
|
1211
|
+
dataRegion: string;
|
|
1212
|
+
firstSeenAt: Timestamp;
|
|
1213
|
+
id: Generated<string>;
|
|
1214
|
+
recordId: string;
|
|
1215
|
+
recordType: HealthAccountingIntegrityDirtyRecordType;
|
|
1216
|
+
severity: HealthAccountingIntegritySeverity;
|
|
1217
|
+
tenantId: string;
|
|
1218
|
+
updatedAt: Generated<Timestamp>;
|
|
1219
|
+
}
|
|
1205
1220
|
export interface HealthAccountingIntegrityDelivery {
|
|
1206
1221
|
attempts: Generated<number>;
|
|
1207
1222
|
caseId: string | null;
|
|
@@ -1221,6 +1236,19 @@ export interface HealthAccountingIntegrityDelivery {
|
|
|
1221
1236
|
status: Generated<HealthAccountingIntegrityDeliveryStatus>;
|
|
1222
1237
|
updatedAt: Generated<Timestamp>;
|
|
1223
1238
|
}
|
|
1239
|
+
export interface HealthAccountingIntegrityDirtyRecord {
|
|
1240
|
+
claimToken: string | null;
|
|
1241
|
+
claimedUntil: Timestamp | null;
|
|
1242
|
+
computedAt: Timestamp | null;
|
|
1243
|
+
computedVersion: Generated<Int8>;
|
|
1244
|
+
createdAt: Generated<Timestamp>;
|
|
1245
|
+
dirtyAt: Generated<Timestamp>;
|
|
1246
|
+
dirtyVersion: Generated<Int8>;
|
|
1247
|
+
recordId: string;
|
|
1248
|
+
recordType: HealthAccountingIntegrityDirtyRecordType;
|
|
1249
|
+
tenantId: string;
|
|
1250
|
+
updatedAt: Generated<Timestamp>;
|
|
1251
|
+
}
|
|
1224
1252
|
export interface HealthAccountingIntegrityOperatorEvent {
|
|
1225
1253
|
actorId: string;
|
|
1226
1254
|
caseId: string | null;
|
|
@@ -1340,6 +1368,16 @@ export interface HealthAccountingIntegrityRun {
|
|
|
1340
1368
|
unchangedCaseCount: Generated<Int8>;
|
|
1341
1369
|
updatedAt: Generated<Timestamp>;
|
|
1342
1370
|
}
|
|
1371
|
+
export interface HealthAccountingIntegritySweepCursor {
|
|
1372
|
+
createdAt: Generated<Timestamp>;
|
|
1373
|
+
cycleStartedAt: Generated<Timestamp>;
|
|
1374
|
+
definitionsHash: string | null;
|
|
1375
|
+
lastCycleCompletedAt: Timestamp | null;
|
|
1376
|
+
lastRecordId: string | null;
|
|
1377
|
+
lastTenantId: string | null;
|
|
1378
|
+
recordType: HealthAccountingIntegrityDirtyRecordType;
|
|
1379
|
+
updatedAt: Generated<Timestamp>;
|
|
1380
|
+
}
|
|
1343
1381
|
export interface HealthAccountingIntegrityTransition {
|
|
1344
1382
|
caseId: string;
|
|
1345
1383
|
caseVersion: Int8;
|
|
@@ -2758,8 +2796,11 @@ export interface DB {
|
|
|
2758
2796
|
"hdbCatalog.hdbSourceCatalogVersion": HdbCatalogHdbSourceCatalogVersion;
|
|
2759
2797
|
"hdbCatalog.hdbVersion": HdbCatalogHdbVersion;
|
|
2760
2798
|
"health.accountingIntegrityCase": HealthAccountingIntegrityCase;
|
|
2799
|
+
"health.accountingIntegrityComparisonFinding": HealthAccountingIntegrityComparisonFinding;
|
|
2761
2800
|
"health.accountingIntegrityDelivery": HealthAccountingIntegrityDelivery;
|
|
2801
|
+
"health.accountingIntegrityDirtyRecord": HealthAccountingIntegrityDirtyRecord;
|
|
2762
2802
|
"health.accountingIntegrityOperatorEvent": HealthAccountingIntegrityOperatorEvent;
|
|
2803
|
+
"health.accountingIntegritySweepCursor": HealthAccountingIntegritySweepCursor;
|
|
2763
2804
|
"health.accountingIntegrityRepairPlan": HealthAccountingIntegrityRepairPlan;
|
|
2764
2805
|
"health.accountingIntegrityRepairStage": HealthAccountingIntegrityRepairStage;
|
|
2765
2806
|
"health.accountingIntegrityRepairTarget": HealthAccountingIntegrityRepairTarget;
|