@geekmidas/testkit 10.0.0-alpha.98 → 10.0.0
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/CHANGELOG.md +160 -0
- package/README.md +0 -74
- package/dist/Factory-BFVnMMCC.mjs +51 -0
- package/dist/Factory-BFVnMMCC.mjs.map +1 -0
- package/dist/Factory-BOX312yd.d.cts +147 -0
- package/dist/Factory-BOX312yd.d.cts.map +1 -0
- package/dist/Factory-BhjUOBWN.cjs +57 -0
- package/dist/Factory-BhjUOBWN.cjs.map +1 -0
- package/dist/Factory-SFupxRC2.d.mts +147 -0
- package/dist/Factory-SFupxRC2.d.mts.map +1 -0
- package/dist/Factory.cjs +2 -51
- package/dist/Factory.d.cts +3 -143
- package/dist/Factory.d.mts +3 -143
- package/dist/Factory.mjs +2 -50
- package/dist/KyselyFactory-BFqVIn_0.cjs +246 -0
- package/dist/KyselyFactory-BFqVIn_0.cjs.map +1 -0
- package/dist/KyselyFactory-DMswpwji.mjs +241 -0
- package/dist/KyselyFactory-DMswpwji.mjs.map +1 -0
- package/dist/KyselyFactory-Dy5zzV4B.d.cts +228 -0
- package/dist/KyselyFactory-Dy5zzV4B.d.cts.map +1 -0
- package/dist/KyselyFactory-vAxYodck.d.mts +228 -0
- package/dist/KyselyFactory-vAxYodck.d.mts.map +1 -0
- package/dist/KyselyFactory.cjs +4 -237
- package/dist/KyselyFactory.d.cts +4 -224
- package/dist/KyselyFactory.d.mts +4 -224
- package/dist/KyselyFactory.mjs +4 -236
- package/dist/ObjectionFactory-BWjB49-i.d.mts +241 -0
- package/dist/ObjectionFactory-BWjB49-i.d.mts.map +1 -0
- package/dist/ObjectionFactory-BeFBYcan.cjs +272 -0
- package/dist/ObjectionFactory-BeFBYcan.cjs.map +1 -0
- package/dist/ObjectionFactory-CD-WFuMJ.d.cts +241 -0
- package/dist/ObjectionFactory-CD-WFuMJ.d.cts.map +1 -0
- package/dist/ObjectionFactory-QCJ7u0Ql.mjs +267 -0
- package/dist/ObjectionFactory-QCJ7u0Ql.mjs.map +1 -0
- package/dist/ObjectionFactory.cjs +4 -265
- package/dist/ObjectionFactory.d.cts +4 -237
- package/dist/ObjectionFactory.d.mts +4 -237
- package/dist/ObjectionFactory.mjs +4 -264
- package/dist/PostgresKyselyMigrator-B2M6Gjvv.d.cts +84 -0
- package/dist/PostgresKyselyMigrator-B2M6Gjvv.d.cts.map +1 -0
- package/dist/PostgresKyselyMigrator-BGBxjnFv.cjs +101 -0
- package/dist/PostgresKyselyMigrator-BGBxjnFv.cjs.map +1 -0
- package/dist/PostgresKyselyMigrator-CvwXycJE.d.mts +84 -0
- package/dist/PostgresKyselyMigrator-CvwXycJE.d.mts.map +1 -0
- package/dist/PostgresKyselyMigrator-PI0QhvB1.mjs +95 -0
- package/dist/PostgresKyselyMigrator-PI0QhvB1.mjs.map +1 -0
- package/dist/PostgresKyselyMigrator.cjs +3 -94
- package/dist/PostgresKyselyMigrator.d.cts +3 -80
- package/dist/PostgresKyselyMigrator.d.mts +3 -80
- package/dist/PostgresKyselyMigrator.mjs +3 -93
- package/dist/{PostgresMigrator-CDPnnwMJ.d.cts → PostgresMigrator-C_QQ6q35.d.mts} +5 -11
- package/dist/PostgresMigrator-C_QQ6q35.d.mts.map +1 -0
- package/dist/{PostgresMigrator-CDPnnwMJ.d.mts → PostgresMigrator-CeYy-eHF.d.cts} +5 -11
- package/dist/PostgresMigrator-CeYy-eHF.d.cts.map +1 -0
- package/dist/PostgresMigrator-DVAY04qN.mjs +166 -0
- package/dist/PostgresMigrator-DVAY04qN.mjs.map +1 -0
- package/dist/PostgresMigrator-M9jpzOvN.cjs +172 -0
- package/dist/PostgresMigrator-M9jpzOvN.cjs.map +1 -0
- package/dist/PostgresMigrator.cjs +2 -178
- package/dist/PostgresMigrator.d.cts +1 -1
- package/dist/PostgresMigrator.d.mts +1 -1
- package/dist/PostgresMigrator.mjs +2 -175
- package/dist/PostgresObjectionMigrator-1j6YIB1c.d.mts +79 -0
- package/dist/PostgresObjectionMigrator-1j6YIB1c.d.mts.map +1 -0
- package/dist/PostgresObjectionMigrator-DHVC9h_P.d.cts +79 -0
- package/dist/PostgresObjectionMigrator-DHVC9h_P.d.cts.map +1 -0
- package/dist/PostgresObjectionMigrator-DSaPhwjY.cjs +123 -0
- package/dist/PostgresObjectionMigrator-DSaPhwjY.cjs.map +1 -0
- package/dist/PostgresObjectionMigrator-DjPKdUbm.mjs +118 -0
- package/dist/PostgresObjectionMigrator-DjPKdUbm.mjs.map +1 -0
- package/dist/PostgresObjectionMigrator.cjs +3 -118
- package/dist/PostgresObjectionMigrator.d.cts +3 -75
- package/dist/PostgresObjectionMigrator.d.mts +3 -75
- package/dist/PostgresObjectionMigrator.mjs +3 -117
- package/dist/VitestKyselyTransactionIsolator-0CqOsuc9.cjs +65 -0
- package/dist/VitestKyselyTransactionIsolator-0CqOsuc9.cjs.map +1 -0
- package/dist/VitestKyselyTransactionIsolator-CduJlHoT.d.cts +59 -0
- package/dist/VitestKyselyTransactionIsolator-CduJlHoT.d.cts.map +1 -0
- package/dist/VitestKyselyTransactionIsolator-CfSMOFlN.mjs +60 -0
- package/dist/VitestKyselyTransactionIsolator-CfSMOFlN.mjs.map +1 -0
- package/dist/VitestKyselyTransactionIsolator-Cswnnj0k.d.mts +59 -0
- package/dist/VitestKyselyTransactionIsolator-Cswnnj0k.d.mts.map +1 -0
- package/dist/VitestKyselyTransactionIsolator.cjs +3 -66
- package/dist/VitestKyselyTransactionIsolator.d.cts +3 -60
- package/dist/VitestKyselyTransactionIsolator.d.mts +3 -60
- package/dist/VitestKyselyTransactionIsolator.mjs +3 -65
- package/dist/VitestObjectionTransactionIsolator-B5J9jjKq.cjs +68 -0
- package/dist/VitestObjectionTransactionIsolator-B5J9jjKq.cjs.map +1 -0
- package/dist/VitestObjectionTransactionIsolator-BXoR6xdG.d.cts +60 -0
- package/dist/VitestObjectionTransactionIsolator-BXoR6xdG.d.cts.map +1 -0
- package/dist/VitestObjectionTransactionIsolator-CNo40EdC.mjs +63 -0
- package/dist/VitestObjectionTransactionIsolator-CNo40EdC.mjs.map +1 -0
- package/dist/VitestObjectionTransactionIsolator-x6hY5j4u.d.mts +60 -0
- package/dist/VitestObjectionTransactionIsolator-x6hY5j4u.d.mts.map +1 -0
- package/dist/VitestObjectionTransactionIsolator.cjs +3 -62
- package/dist/VitestObjectionTransactionIsolator.d.cts +3 -56
- package/dist/VitestObjectionTransactionIsolator.d.mts +3 -56
- package/dist/VitestObjectionTransactionIsolator.mjs +3 -61
- package/dist/VitestTransactionIsolator-BNWJqh9f.d.mts +207 -0
- package/dist/VitestTransactionIsolator-BNWJqh9f.d.mts.map +1 -0
- package/dist/VitestTransactionIsolator-CSroc7Df.d.cts +207 -0
- package/dist/VitestTransactionIsolator-CSroc7Df.d.cts.map +1 -0
- package/dist/VitestTransactionIsolator-CtZaOUjH.cjs +193 -0
- package/dist/VitestTransactionIsolator-CtZaOUjH.cjs.map +1 -0
- package/dist/VitestTransactionIsolator-D6ZxLWys.mjs +175 -0
- package/dist/VitestTransactionIsolator-D6ZxLWys.mjs.map +1 -0
- package/dist/VitestTransactionIsolator.cjs +4 -187
- package/dist/VitestTransactionIsolator.d.cts +2 -219
- package/dist/VitestTransactionIsolator.d.mts +2 -219
- package/dist/VitestTransactionIsolator.mjs +2 -184
- package/dist/aws.cjs +4 -3
- package/dist/aws.cjs.map +1 -1
- package/dist/aws.d.cts +8 -3
- package/dist/aws.d.cts.map +1 -1
- package/dist/aws.d.mts +8 -3
- package/dist/aws.d.mts.map +1 -1
- package/dist/aws.mjs +2 -1
- package/dist/aws.mjs.map +1 -1
- package/dist/benchmark.cjs +2 -2
- package/dist/benchmark.cjs.map +1 -1
- package/dist/benchmark.d.cts +6 -4
- package/dist/benchmark.d.cts.map +1 -1
- package/dist/benchmark.d.mts +6 -4
- package/dist/benchmark.d.mts.map +1 -1
- package/dist/benchmark.mjs +1 -1
- package/dist/benchmark.mjs.map +1 -1
- package/dist/better-auth.cjs +15 -31
- package/dist/better-auth.cjs.map +1 -1
- package/dist/better-auth.d.cts +4 -13142
- package/dist/better-auth.d.cts.map +1 -1
- package/dist/better-auth.d.mts +4 -13142
- package/dist/better-auth.d.mts.map +1 -1
- package/dist/better-auth.mjs +13 -29
- package/dist/better-auth.mjs.map +1 -1
- package/dist/{rolldown-runtime-VH7oDXx4.cjs → chunk-CUT6urMc.cjs} +10 -8
- package/dist/directory-Bpz5c5pj.d.cts +13 -0
- package/dist/directory-Bpz5c5pj.d.cts.map +1 -0
- package/dist/directory-BxjqmtCT.mjs +27 -0
- package/dist/directory-BxjqmtCT.mjs.map +1 -0
- package/dist/directory-CVrfTq1I.d.mts +13 -0
- package/dist/directory-CVrfTq1I.d.mts.map +1 -0
- package/dist/directory-DD_xQoSh.cjs +33 -0
- package/dist/directory-DD_xQoSh.cjs.map +1 -0
- package/dist/faker-B14IEMIN.cjs +304 -0
- package/dist/faker-B14IEMIN.cjs.map +1 -0
- package/dist/faker-BGKYFoCT.mjs +262 -0
- package/dist/faker-BGKYFoCT.mjs.map +1 -0
- package/dist/faker-Cg76aFNO.d.cts +166 -0
- package/dist/faker-Cg76aFNO.d.cts.map +1 -0
- package/dist/faker-DHh7xs4u.d.mts +166 -0
- package/dist/faker-DHh7xs4u.d.mts.map +1 -0
- package/dist/faker.cjs +8 -313
- package/dist/faker.d.cts +2 -169
- package/dist/faker.d.mts +2 -169
- package/dist/faker.mjs +2 -305
- package/dist/helpers.cjs +5 -6
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +5 -1
- package/dist/helpers.d.cts.map +1 -1
- package/dist/helpers.d.mts +5 -1
- package/dist/helpers.d.mts.map +1 -1
- package/dist/helpers.mjs +2 -1
- package/dist/helpers.mjs.map +1 -1
- package/dist/initScript.cjs +15 -15
- package/dist/initScript.cjs.map +1 -1
- package/dist/initScript.d.cts +4 -2
- package/dist/initScript.d.cts.map +1 -1
- package/dist/initScript.d.mts +4 -2
- package/dist/initScript.d.mts.map +1 -1
- package/dist/initScript.mjs +12 -10
- package/dist/initScript.mjs.map +1 -1
- package/dist/kysely.cjs +13 -10
- package/dist/kysely.cjs.map +1 -1
- package/dist/kysely.d.cts +14 -10
- package/dist/kysely.d.cts.map +1 -1
- package/dist/kysely.d.mts +14 -10
- package/dist/kysely.d.mts.map +1 -1
- package/dist/kysely.mjs +14 -10
- package/dist/kysely.mjs.map +1 -1
- package/dist/logger.cjs +4 -3
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.d.cts +5 -1
- package/dist/logger.d.cts.map +1 -1
- package/dist/logger.d.mts +5 -1
- package/dist/logger.d.mts.map +1 -1
- package/dist/logger.mjs +2 -1
- package/dist/logger.mjs.map +1 -1
- package/dist/objection.cjs +13 -10
- package/dist/objection.cjs.map +1 -1
- package/dist/objection.d.cts +14 -10
- package/dist/objection.d.cts.map +1 -1
- package/dist/objection.d.mts +14 -10
- package/dist/objection.d.mts.map +1 -1
- package/dist/objection.mjs +14 -10
- package/dist/objection.mjs.map +1 -1
- package/dist/os/directory.cjs +2 -31
- package/dist/os/directory.d.cts +2 -9
- package/dist/os/directory.d.mts +2 -9
- package/dist/os/directory.mjs +2 -25
- package/dist/os/index.cjs +3 -3
- package/dist/os/index.d.cts +1 -1
- package/dist/os/index.d.mts +1 -1
- package/dist/os/index.mjs +3 -2
- package/dist/requestContext.cjs +11 -10
- package/dist/requestContext.cjs.map +1 -1
- package/dist/requestContext.d.cts +9 -5
- package/dist/requestContext.d.cts.map +1 -1
- package/dist/requestContext.d.mts +9 -5
- package/dist/requestContext.d.mts.map +1 -1
- package/dist/requestContext.mjs +3 -2
- package/dist/requestContext.mjs.map +1 -1
- package/dist/timer.cjs +2 -2
- package/dist/timer.cjs.map +1 -1
- package/dist/timer.d.cts +4 -1
- package/dist/timer.d.cts.map +1 -1
- package/dist/timer.d.mts +4 -1
- package/dist/timer.d.mts.map +1 -1
- package/dist/timer.mjs +1 -1
- package/dist/timer.mjs.map +1 -1
- package/package.json +25 -65
- package/src/Factory.ts +174 -0
- package/src/KyselyFactory.ts +391 -0
- package/src/ObjectionFactory.ts +412 -0
- package/src/PostgresKyselyMigrator.ts +104 -0
- package/src/PostgresMigrator.ts +193 -0
- package/src/PostgresObjectionMigrator.ts +138 -0
- package/src/VitestKyselyTransactionIsolator.ts +72 -0
- package/src/VitestObjectionTransactionIsolator.ts +75 -0
- package/src/VitestTransactionIsolator.ts +348 -0
- package/src/__tests__/Factory.spec.ts +178 -0
- package/src/__tests__/KyselyFactory.spec.ts +458 -0
- package/src/__tests__/ObjectionFactory.spec.ts +586 -0
- package/src/__tests__/PostgresKyselyMigrator.spec.ts +794 -0
- package/src/__tests__/PostgresMigrator.spec.ts +471 -0
- package/src/__tests__/PostgresObjectionMigrator.spec.ts +634 -0
- package/src/__tests__/VitestObjectionTransactionIsolator.spec.ts +138 -0
- package/src/__tests__/benchmark.spec.ts +140 -0
- package/src/__tests__/better-auth.spec.ts +21 -0
- package/src/__tests__/faker.spec.ts +231 -0
- package/src/__tests__/initScript.spec.ts +332 -0
- package/src/__tests__/integration.spec.ts +610 -0
- package/src/__tests__/requestContext.spec.ts +113 -0
- package/src/__tests__/utilities.spec.ts +211 -0
- package/src/aws.ts +131 -0
- package/src/benchmark.ts +48 -0
- package/src/better-auth.ts +310 -0
- package/src/faker.ts +349 -0
- package/src/helpers.ts +45 -0
- package/src/initScript.ts +122 -0
- package/src/kysely.ts +166 -0
- package/src/logger.ts +18 -0
- package/src/objection.ts +157 -0
- package/src/os/directory.ts +26 -0
- package/src/os/index.ts +1 -0
- package/src/requestContext.ts +119 -0
- package/src/timer.ts +3 -0
- package/test/globalSetup.ts +54 -0
- package/test/helpers.ts +268 -0
- package/test/migrations/1749664623372_user.ts +22 -0
- package/tsconfig.json +9 -0
- package/vitest.config.ts +8 -0
- package/dist/Factory.cjs.map +0 -1
- package/dist/Factory.d.cts.map +0 -1
- package/dist/Factory.d.mts.map +0 -1
- package/dist/Factory.mjs.map +0 -1
- package/dist/KyselyFactory.cjs.map +0 -1
- package/dist/KyselyFactory.d.cts.map +0 -1
- package/dist/KyselyFactory.d.mts.map +0 -1
- package/dist/KyselyFactory.mjs.map +0 -1
- package/dist/ObjectionFactory.cjs.map +0 -1
- package/dist/ObjectionFactory.d.cts.map +0 -1
- package/dist/ObjectionFactory.d.mts.map +0 -1
- package/dist/ObjectionFactory.mjs.map +0 -1
- package/dist/PostgresKyselyMigrator.cjs.map +0 -1
- package/dist/PostgresKyselyMigrator.d.cts.map +0 -1
- package/dist/PostgresKyselyMigrator.d.mts.map +0 -1
- package/dist/PostgresKyselyMigrator.mjs.map +0 -1
- package/dist/PostgresMigrator-CDPnnwMJ.d.cts.map +0 -1
- package/dist/PostgresMigrator-CDPnnwMJ.d.mts.map +0 -1
- package/dist/PostgresMigrator.cjs.map +0 -1
- package/dist/PostgresMigrator.mjs.map +0 -1
- package/dist/PostgresObjectionMigrator.cjs.map +0 -1
- package/dist/PostgresObjectionMigrator.d.cts.map +0 -1
- package/dist/PostgresObjectionMigrator.d.mts.map +0 -1
- package/dist/PostgresObjectionMigrator.mjs.map +0 -1
- package/dist/VitestKyselyTransactionIsolator.cjs.map +0 -1
- package/dist/VitestKyselyTransactionIsolator.d.cts.map +0 -1
- package/dist/VitestKyselyTransactionIsolator.d.mts.map +0 -1
- package/dist/VitestKyselyTransactionIsolator.mjs.map +0 -1
- package/dist/VitestObjectionTransactionIsolator.cjs.map +0 -1
- package/dist/VitestObjectionTransactionIsolator.d.cts.map +0 -1
- package/dist/VitestObjectionTransactionIsolator.d.mts.map +0 -1
- package/dist/VitestObjectionTransactionIsolator.mjs.map +0 -1
- package/dist/VitestTransactionIsolator.cjs.map +0 -1
- package/dist/VitestTransactionIsolator.d.cts.map +0 -1
- package/dist/VitestTransactionIsolator.d.mts.map +0 -1
- package/dist/VitestTransactionIsolator.mjs.map +0 -1
- package/dist/browser.cjs +0 -149
- package/dist/browser.cjs.map +0 -1
- package/dist/browser.d.cts +0 -62
- package/dist/browser.d.cts.map +0 -1
- package/dist/browser.d.mts +0 -62
- package/dist/browser.d.mts.map +0 -1
- package/dist/browser.mjs +0 -147
- package/dist/browser.mjs.map +0 -1
- package/dist/context.cjs +0 -80
- package/dist/context.cjs.map +0 -1
- package/dist/context.d.cts +0 -55
- package/dist/context.d.cts.map +0 -1
- package/dist/context.d.mts +0 -55
- package/dist/context.d.mts.map +0 -1
- package/dist/context.mjs +0 -73
- package/dist/context.mjs.map +0 -1
- package/dist/faker.cjs.map +0 -1
- package/dist/faker.d.cts.map +0 -1
- package/dist/faker.d.mts.map +0 -1
- package/dist/faker.mjs.map +0 -1
- package/dist/mailbox.cjs +0 -95
- package/dist/mailbox.cjs.map +0 -1
- package/dist/mailbox.d.cts +0 -58
- package/dist/mailbox.d.cts.map +0 -1
- package/dist/mailbox.d.mts +0 -58
- package/dist/mailbox.d.mts.map +0 -1
- package/dist/mailbox.mjs +0 -92
- package/dist/mailbox.mjs.map +0 -1
- package/dist/os/directory.cjs.map +0 -1
- package/dist/os/directory.d.cts.map +0 -1
- package/dist/os/directory.d.mts.map +0 -1
- package/dist/os/directory.mjs.map +0 -1
- package/dist/transactions.cjs +0 -239
- package/dist/transactions.cjs.map +0 -1
- package/dist/transactions.d.cts +0 -44
- package/dist/transactions.d.cts.map +0 -1
- package/dist/transactions.d.mts +0 -44
- package/dist/transactions.d.mts.map +0 -1
- package/dist/transactions.mjs +0 -234
- package/dist/transactions.mjs.map +0 -1
package/dist/objection.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import "./Factory-BFVnMMCC.mjs";
|
|
2
|
+
import { faker } from "./faker-BGKYFoCT.mjs";
|
|
3
|
+
import { ObjectionFactory } from "./ObjectionFactory-QCJ7u0Ql.mjs";
|
|
4
|
+
import "./PostgresMigrator-DVAY04qN.mjs";
|
|
5
|
+
import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-DjPKdUbm.mjs";
|
|
6
|
+
import { IsolationLevel, extendWithFixtures } from "./VitestTransactionIsolator-D6ZxLWys.mjs";
|
|
7
|
+
import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-CNo40EdC.mjs";
|
|
8
|
+
|
|
6
9
|
//#region src/objection.ts
|
|
7
10
|
/**
|
|
8
11
|
* Creates a wrapped Vitest test API with automatic transaction rollback for Objection.js.
|
|
@@ -49,7 +52,8 @@ import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransaction
|
|
|
49
52
|
* ```
|
|
50
53
|
*/
|
|
51
54
|
function wrapVitestObjectionTransaction(api, options) {
|
|
52
|
-
|
|
55
|
+
const wrapper = new VitestObjectionTransactionIsolator(api);
|
|
56
|
+
return wrapper.wrapVitestWithTransaction(options);
|
|
53
57
|
}
|
|
54
58
|
/**
|
|
55
59
|
* Extends an Objection.js transaction-wrapped test with additional fixtures.
|
|
@@ -99,10 +103,10 @@ function wrapVitestObjectionTransaction(api, options) {
|
|
|
99
103
|
* });
|
|
100
104
|
* ```
|
|
101
105
|
*/
|
|
102
|
-
function extendWithFixtures(wrappedTest, fixtures) {
|
|
103
|
-
return extendWithFixtures
|
|
106
|
+
function extendWithFixtures$1(wrappedTest, fixtures) {
|
|
107
|
+
return extendWithFixtures(wrappedTest, fixtures);
|
|
104
108
|
}
|
|
105
|
-
//#endregion
|
|
106
|
-
export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, extendWithFixtures, faker, wrapVitestObjectionTransaction };
|
|
107
109
|
|
|
110
|
+
//#endregion
|
|
111
|
+
export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, extendWithFixtures$1 as extendWithFixtures, faker, wrapVitestObjectionTransaction };
|
|
108
112
|
//# sourceMappingURL=objection.mjs.map
|
package/dist/objection.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objection.mjs","names":["
|
|
1
|
+
{"version":3,"file":"objection.mjs","names":["api: TestAPI","options: ObjectionTransactionOptions<Extended>","extendWithFixtures","wrappedTest: T","fixtures: FixtureCreators<Knex.Transaction, Extended>"],"sources":["../src/objection.ts"],"sourcesContent":["import type { Knex } from 'knex';\nimport type { TestAPI } from 'vitest';\nimport { VitestObjectionTransactionIsolator } from './VitestObjectionTransactionIsolator';\nimport {\n\textendWithFixtures as baseExtendWithFixtures,\n\ttype DatabaseConnection,\n\ttype FixtureCreators,\n\ttype IsolationLevel,\n} from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific exports for test utilities.\n * Provides factory implementation for creating test data with Objection.js ORM\n * and transaction isolation for test suites.\n */\n\nexport type { ExtractSeedAttrs, FactorySeed } from './Factory';\nexport { ObjectionFactory } from './ObjectionFactory';\nexport { PostgresObjectionMigrator } from './PostgresObjectionMigrator';\nexport { VitestObjectionTransactionIsolator } from './VitestObjectionTransactionIsolator';\nexport type {\n\tDatabaseFixtures,\n\tExtendedDatabaseFixtures,\n\tFixtureCreators,\n\tTestWithExtendedFixtures,\n\tTransactionWrapperOptions,\n} from './VitestTransactionIsolator';\nexport { IsolationLevel } from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific options for transaction wrapping.\n */\nexport interface ObjectionTransactionOptions<\n\tExtended extends Record<string, unknown> = {},\n> {\n\t/** Function that creates or returns a Knex database connection */\n\tconnection: DatabaseConnection<Knex>;\n\t/** Optional setup function to run within the transaction before each test */\n\tsetup?: (trx: Knex.Transaction) => Promise<void>;\n\t/** Transaction isolation level (defaults to REPEATABLE_READ) */\n\tisolationLevel?: IsolationLevel;\n\t/** Additional fixtures that depend on the transaction */\n\tfixtures?: FixtureCreators<Knex.Transaction, Extended>;\n}\n\n// Re-export faker and FakerFactory for type portability in declaration files\nexport { type FakerFactory, faker } from './faker';\n\n/**\n * Creates a wrapped Vitest test API with automatic transaction rollback for Objection.js.\n * Each test runs in an isolated database transaction that is rolled back after completion.\n * This ensures tests don't affect each other's data and run faster than truncating tables.\n *\n * @template Extended - Additional fixtures to provide\n * @param api - The Vitest test API (usually `test` from vitest)\n * @param options - Configuration options for transaction wrapping\n * @returns A wrapped test API that provides transaction isolation\n *\n * @example\n * ```typescript\n * import { test } from 'vitest';\n * import { wrapVitestObjectionTransaction } from '@geekmidas/testkit/objection';\n * import { knex } from './database';\n * import { User } from './models';\n *\n * // Create isolated test with automatic rollback\n * const isolatedTest = wrapVitestObjectionTransaction(test, {\n * connection: knex,\n * });\n *\n * // Use in tests - each test gets its own transaction\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await User.query(trx)\n * .insert({ name: 'Test User', email: 'test@example.com' });\n *\n * expect(user).toBeDefined();\n * });\n *\n * // With fixtures for factories\n * const it = wrapVitestObjectionTransaction<{ factory: Factory }>(test, {\n * connection: knex,\n * fixtures: {\n * factory: (trx) => new Factory(trx),\n * },\n * });\n *\n * it('should create user with factory', async ({ trx, factory }) => {\n * const user = await factory.insert('user', { name: 'Test' });\n * expect(user.id).toBeDefined();\n * });\n * ```\n */\nexport function wrapVitestObjectionTransaction<\n\tExtended extends Record<string, unknown> = {},\n>(api: TestAPI, options: ObjectionTransactionOptions<Extended>) {\n\tconst wrapper = new VitestObjectionTransactionIsolator(api);\n\n\treturn wrapper.wrapVitestWithTransaction(options);\n}\n\n/**\n * Extends an Objection.js transaction-wrapped test with additional fixtures.\n * Each fixture receives the transaction and can create dependencies like factories or repositories.\n *\n * @template Extended - The type of additional fixtures to provide\n * @param wrappedTest - The base wrapped test from wrapVitestObjectionTransaction\n * @param fixtures - Object mapping fixture names to creator functions\n * @returns An extended test API with both trx and the additional fixtures\n *\n * @example\n * ```typescript\n * import { test } from 'vitest';\n * import { wrapVitestObjectionTransaction, extendWithFixtures, ObjectionFactory } from '@geekmidas/testkit/objection';\n * import { User } from './models';\n *\n * // Define your builders\n * const builders = {\n * user: ObjectionFactory.createBuilder(User, ({ faker }) => ({\n * name: faker.person.fullName(),\n * email: faker.internet.email(),\n * })),\n * };\n *\n * // Create base wrapped test\n * const baseTest = wrapVitestObjectionTransaction(test, {\n * connection: knex,\n * setup: createTestTables,\n * });\n *\n * // Extend with fixtures - each fixture receives the transaction\n * const it = extendWithFixtures<{ factory: ObjectionFactory<typeof builders, {}> }>(\n * baseTest,\n * {\n * factory: (trx) => new ObjectionFactory(builders, {}, trx),\n * }\n * );\n *\n * // Use in tests - both trx and factory are available\n * it('should create user with factory', async ({ trx, factory }) => {\n * const user = await factory.insert('user', { name: 'Test User' });\n * expect(user.id).toBeDefined();\n *\n * // Verify in database\n * const found = await User.query(trx).findById(user.id);\n * expect(found?.name).toBe('Test User');\n * });\n * ```\n */\nexport function extendWithFixtures<\n\tExtended extends Record<string, unknown>,\n\tT extends ReturnType<TestAPI['extend']> = ReturnType<TestAPI['extend']>,\n>(wrappedTest: T, fixtures: FixtureCreators<Knex.Transaction, Extended>) {\n\treturn baseExtendWithFixtures<Knex.Transaction, Extended, T>(\n\t\twrappedTest,\n\t\tfixtures,\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,SAAgB,+BAEdA,KAAcC,SAAgD;CAC/D,MAAM,UAAU,IAAI,mCAAmC;AAEvD,QAAO,QAAQ,0BAA0B,QAAQ;AACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDD,SAAgBC,qBAGdC,aAAgBC,UAAuD;AACxE,QAAO,mBACN,aACA,SACA;AACD"}
|
package/dist/os/directory.cjs
CHANGED
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
const require_rolldown_runtime = require("../rolldown-runtime-VH7oDXx4.cjs");
|
|
3
|
-
let vitest = require("vitest");
|
|
4
|
-
let node_crypto = require("node:crypto");
|
|
5
|
-
node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
|
|
6
|
-
let node_fs_promises = require("node:fs/promises");
|
|
7
|
-
node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
|
|
8
|
-
let node_os = require("node:os");
|
|
9
|
-
node_os = require_rolldown_runtime.__toESM(node_os, 1);
|
|
10
|
-
let node_path = require("node:path");
|
|
11
|
-
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
12
|
-
//#region src/os/directory.ts
|
|
13
|
-
const itWithDir = vitest.it.extend({ dir: async ({}, use) => {
|
|
14
|
-
const tempDir = node_os.default.tmpdir();
|
|
15
|
-
const directoryName = node_crypto.default.randomUUID().replace(/-/g, "").toUpperCase();
|
|
16
|
-
const dir = node_path.default.join(tempDir, directoryName);
|
|
17
|
-
await node_fs_promises.default.mkdir(dir, { recursive: true });
|
|
18
|
-
await use(dir);
|
|
19
|
-
await node_fs_promises.default.rm(dir, {
|
|
20
|
-
recursive: true,
|
|
21
|
-
force: true
|
|
22
|
-
});
|
|
23
|
-
const keystoreDir = node_path.default.join(node_os.default.homedir(), ".gkm", directoryName);
|
|
24
|
-
await node_fs_promises.default.rm(keystoreDir, {
|
|
25
|
-
recursive: true,
|
|
26
|
-
force: true
|
|
27
|
-
});
|
|
28
|
-
} });
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.itWithDir = itWithDir;
|
|
1
|
+
const require_directory = require('../directory-DD_xQoSh.cjs');
|
|
31
2
|
|
|
32
|
-
|
|
3
|
+
exports.itWithDir = require_directory.itWithDir;
|
package/dist/os/directory.d.cts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
dir: string;
|
|
4
|
-
}>;
|
|
5
|
-
export interface DirectoryFixtures {
|
|
6
|
-
dir: string;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//# sourceMappingURL=directory.d.cts.map
|
|
1
|
+
import { DirectoryFixtures, itWithDir } from "../directory-Bpz5c5pj.cjs";
|
|
2
|
+
export { DirectoryFixtures, itWithDir };
|
package/dist/os/directory.d.mts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
dir: string;
|
|
4
|
-
}>;
|
|
5
|
-
export interface DirectoryFixtures {
|
|
6
|
-
dir: string;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//# sourceMappingURL=directory.d.mts.map
|
|
1
|
+
import { DirectoryFixtures, itWithDir } from "../directory-CVrfTq1I.mjs";
|
|
2
|
+
export { DirectoryFixtures, itWithDir };
|
package/dist/os/directory.mjs
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import crypto from "node:crypto";
|
|
3
|
-
import fs from "node:fs/promises";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
//#region src/os/directory.ts
|
|
7
|
-
const itWithDir = it.extend({ dir: async ({}, use) => {
|
|
8
|
-
const tempDir = os.tmpdir();
|
|
9
|
-
const directoryName = crypto.randomUUID().replace(/-/g, "").toUpperCase();
|
|
10
|
-
const dir = path.join(tempDir, directoryName);
|
|
11
|
-
await fs.mkdir(dir, { recursive: true });
|
|
12
|
-
await use(dir);
|
|
13
|
-
await fs.rm(dir, {
|
|
14
|
-
recursive: true,
|
|
15
|
-
force: true
|
|
16
|
-
});
|
|
17
|
-
const keystoreDir = path.join(os.homedir(), ".gkm", directoryName);
|
|
18
|
-
await fs.rm(keystoreDir, {
|
|
19
|
-
recursive: true,
|
|
20
|
-
force: true
|
|
21
|
-
});
|
|
22
|
-
} });
|
|
23
|
-
//#endregion
|
|
24
|
-
export { itWithDir };
|
|
1
|
+
import { itWithDir } from "../directory-BxjqmtCT.mjs";
|
|
25
2
|
|
|
26
|
-
|
|
3
|
+
export { itWithDir };
|
package/dist/os/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.itWithDir =
|
|
1
|
+
const require_directory = require('../directory-DD_xQoSh.cjs');
|
|
2
|
+
|
|
3
|
+
exports.itWithDir = require_directory.itWithDir;
|
package/dist/os/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { itWithDir } from "
|
|
1
|
+
import { itWithDir } from "../directory-Bpz5c5pj.cjs";
|
|
2
2
|
export { itWithDir };
|
package/dist/os/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { itWithDir } from "
|
|
1
|
+
import { itWithDir } from "../directory-CVrfTq1I.mjs";
|
|
2
2
|
export { itWithDir };
|
package/dist/os/index.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { itWithDir } from "
|
|
2
|
-
|
|
1
|
+
import { itWithDir } from "../directory-BxjqmtCT.mjs";
|
|
2
|
+
|
|
3
|
+
export { itWithDir };
|
package/dist/requestContext.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
const node_crypto = require_chunk.__toESM(require("node:crypto"));
|
|
3
|
+
const __geekmidas_logger_console = require_chunk.__toESM(require("@geekmidas/logger/console"));
|
|
4
|
+
const __geekmidas_services = require_chunk.__toESM(require("@geekmidas/services"));
|
|
5
|
+
|
|
5
6
|
//#region src/requestContext.ts
|
|
6
7
|
function resolveContext(opts = {}) {
|
|
7
8
|
return {
|
|
8
|
-
logger: opts.logger ?? new
|
|
9
|
+
logger: opts.logger ?? new __geekmidas_logger_console.ConsoleLogger({ app: "test" }),
|
|
9
10
|
requestId: opts.requestId ?? (0, node_crypto.randomUUID)(),
|
|
10
11
|
startTime: opts.startTime ?? Date.now()
|
|
11
12
|
};
|
|
@@ -23,7 +24,7 @@ function resolveContext(opts = {}) {
|
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
26
|
function runInRequestContext(fn, opts = {}) {
|
|
26
|
-
return (0,
|
|
27
|
+
return (0, __geekmidas_services.runWithRequestContext)(resolveContext(opts), fn);
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Vitest fixture creator. Spread the result into `.extend()` and every test
|
|
@@ -42,11 +43,11 @@ function runInRequestContext(fn, opts = {}) {
|
|
|
42
43
|
*/
|
|
43
44
|
function requestContextFixture(opts = {}) {
|
|
44
45
|
return { requestContext: [async ({}, use) => {
|
|
45
|
-
(0,
|
|
46
|
+
(0, __geekmidas_services.enterRequestContext)(resolveContext(opts));
|
|
46
47
|
try {
|
|
47
|
-
await use(
|
|
48
|
+
await use(__geekmidas_services.serviceContext);
|
|
48
49
|
} finally {
|
|
49
|
-
(0,
|
|
50
|
+
(0, __geekmidas_services.exitRequestContext)();
|
|
50
51
|
}
|
|
51
52
|
}, { auto: true }] };
|
|
52
53
|
}
|
|
@@ -71,9 +72,9 @@ function requestContextFixture(opts = {}) {
|
|
|
71
72
|
function withRequestContext(testApi, opts = {}) {
|
|
72
73
|
return testApi.extend(requestContextFixture(opts));
|
|
73
74
|
}
|
|
75
|
+
|
|
74
76
|
//#endregion
|
|
75
77
|
exports.requestContextFixture = requestContextFixture;
|
|
76
78
|
exports.runInRequestContext = runInRequestContext;
|
|
77
79
|
exports.withRequestContext = withRequestContext;
|
|
78
|
-
|
|
79
80
|
//# sourceMappingURL=requestContext.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestContext.cjs","names":["ConsoleLogger","
|
|
1
|
+
{"version":3,"file":"requestContext.cjs","names":["opts: RequestContextOptions","ConsoleLogger","fn: () => T | Promise<T>","use: (value: ServiceContext) => Promise<void>","serviceContext","testApi: T"],"sources":["../src/requestContext.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport type { Logger } from '@geekmidas/logger';\nimport { ConsoleLogger } from '@geekmidas/logger/console';\nimport {\n\tenterRequestContext,\n\texitRequestContext,\n\trunWithRequestContext,\n\ttype ServiceContext,\n\tserviceContext,\n} from '@geekmidas/services';\nimport type { TestAPI } from 'vitest';\n\n/**\n * Options for setting up a request context in tests. Any field omitted\n * is filled with a test-friendly default (ConsoleLogger, random UUID,\n * Date.now()).\n */\nexport interface RequestContextOptions {\n\t/** Logger exposed via serviceContext.getLogger(). */\n\tlogger?: Logger;\n\t/** Request id exposed via serviceContext.getRequestId(). */\n\trequestId?: string;\n\t/** Start time exposed via serviceContext.getRequestStartTime(). */\n\tstartTime?: number;\n}\n\nfunction resolveContext(opts: RequestContextOptions = {}) {\n\treturn {\n\t\tlogger: opts.logger ?? new ConsoleLogger({ app: 'test' }),\n\t\trequestId: opts.requestId ?? randomUUID(),\n\t\tstartTime: opts.startTime ?? Date.now(),\n\t};\n}\n\n/**\n * Run a function inside a request context with test-friendly defaults.\n * Useful when you need `serviceContext` to be available for a single call\n * (e.g. invoking `Service.register({ context })` outside a wrapped test).\n *\n * @example\n * ```ts\n * await runInRequestContext(() =>\n * discovery.register([databaseService]),\n * );\n * ```\n */\nexport function runInRequestContext<T>(\n\tfn: () => T | Promise<T>,\n\topts: RequestContextOptions = {},\n): T | Promise<T> {\n\treturn runWithRequestContext(resolveContext(opts), fn);\n}\n\n/**\n * Vitest fixture creator. Spread the result into `.extend()` and every test\n * runs inside `runWithRequestContext`, even tests that don't destructure\n * `requestContext` directly (the fixture is registered as `auto`).\n *\n * @example\n * ```ts\n * const it = test.extend({ ...requestContextFixture() });\n *\n * it('registers services with context', async ({ requestContext }) => {\n * await discovery.register([databaseService]);\n * expect(requestContext.getRequestId()).toBeDefined();\n * });\n * ```\n */\nexport function requestContextFixture(opts: RequestContextOptions = {}) {\n\treturn {\n\t\trequestContext: [\n\t\t\tasync (\n\t\t\t\t// biome-ignore lint/correctness/noEmptyPattern: vitest fixture signature\n\t\t\t\t{}: {},\n\t\t\t\tuse: (value: ServiceContext) => Promise<void>,\n\t\t\t) => {\n\t\t\t\t// Vitest suspends the fixture on `await use(...)` and runs the test\n\t\t\t\t// body in a continuation of the runner's async context. A scoped\n\t\t\t\t// `runWithRequestContext` callback ends as soon as we hand control\n\t\t\t\t// to the runner, so the test body would see no context. Instead,\n\t\t\t\t// mutate the current task's store with `enterRequestContext` —\n\t\t\t\t// async/await preserves that store across the suspension, so the\n\t\t\t\t// test body sees it. We restore on the way out so subsequent tests\n\t\t\t\t// don't inherit the value.\n\t\t\t\tenterRequestContext(resolveContext(opts));\n\t\t\t\ttry {\n\t\t\t\t\tawait use(serviceContext);\n\t\t\t\t} finally {\n\t\t\t\t\texitRequestContext();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ auto: true },\n\t\t] as const,\n\t};\n}\n\n/**\n * Wrap any Vitest `TestAPI` (including the one returned by\n * `wrapVitestKyselyTransaction`) so every test runs inside\n * `runWithRequestContext`. Compose with the transaction wrappers:\n *\n * @example\n * ```ts\n * import { wrapVitestKyselyTransaction } from '@geekmidas/testkit/kysely';\n * import { withRequestContext } from '@geekmidas/testkit/request-context';\n *\n * const baseIt = wrapVitestKyselyTransaction<DB>(it, { connection: db });\n * const itWithCtx = withRequestContext(baseIt);\n *\n * itWithCtx('runs inside trx + context', async ({ trx, requestContext }) => {\n * // serviceContext is set up; Service.register({ context }) works here.\n * });\n * ```\n */\nexport function withRequestContext<\n\tT extends TestAPI | ReturnType<TestAPI['extend']>,\n>(testApi: T, opts: RequestContextOptions = {}): T {\n\treturn (testApi as any).extend(requestContextFixture(opts));\n}\n"],"mappings":";;;;;;AA0BA,SAAS,eAAeA,OAA8B,CAAE,GAAE;AACzD,QAAO;EACN,QAAQ,KAAK,UAAU,IAAIC,yCAAc,EAAE,KAAK,OAAQ;EACxD,WAAW,KAAK,aAAa,6BAAY;EACzC,WAAW,KAAK,aAAa,KAAK,KAAK;CACvC;AACD;;;;;;;;;;;;;AAcD,SAAgB,oBACfC,IACAF,OAA8B,CAAE,GACf;AACjB,QAAO,gDAAsB,eAAe,KAAK,EAAE,GAAG;AACtD;;;;;;;;;;;;;;;;AAiBD,SAAgB,sBAAsBA,OAA8B,CAAE,GAAE;AACvE,QAAO,EACN,gBAAgB,CACf,OAEC,EAAM,EACNG,QACI;AASJ,gDAAoB,eAAe,KAAK,CAAC;AACzC,MAAI;AACH,SAAM,IAAIC,oCAAe;EACzB,UAAS;AACT,iDAAoB;EACpB;CACD,GACD,EAAE,MAAM,KAAM,CACd,EACD;AACD;;;;;;;;;;;;;;;;;;;AAoBD,SAAgB,mBAEdC,SAAYL,OAA8B,CAAE,GAAK;AAClD,QAAO,AAAC,QAAgB,OAAO,sBAAsB,KAAK,CAAC;AAC3D"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { ServiceContext } from "@geekmidas/services";
|
|
2
1
|
import { TestAPI } from "vitest";
|
|
3
2
|
import { Logger } from "@geekmidas/logger";
|
|
3
|
+
import { ServiceContext } from "@geekmidas/services";
|
|
4
|
+
|
|
4
5
|
//#region src/requestContext.d.ts
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Options for setting up a request context in tests. Any field omitted
|
|
7
9
|
* is filled with a test-friendly default (ConsoleLogger, random UUID,
|
|
8
10
|
* Date.now()).
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
interface RequestContextOptions {
|
|
11
13
|
/** Logger exposed via serviceContext.getLogger(). */
|
|
12
14
|
logger?: Logger;
|
|
13
15
|
/** Request id exposed via serviceContext.getRequestId(). */
|
|
@@ -27,7 +29,7 @@ export interface RequestContextOptions {
|
|
|
27
29
|
* );
|
|
28
30
|
* ```
|
|
29
31
|
*/
|
|
30
|
-
|
|
32
|
+
declare function runInRequestContext<T>(fn: () => T | Promise<T>, opts?: RequestContextOptions): T | Promise<T>;
|
|
31
33
|
/**
|
|
32
34
|
* Vitest fixture creator. Spread the result into `.extend()` and every test
|
|
33
35
|
* runs inside `runWithRequestContext`, even tests that don't destructure
|
|
@@ -43,7 +45,7 @@ export declare function runInRequestContext<T>(fn: () => T | Promise<T>, opts?:
|
|
|
43
45
|
* });
|
|
44
46
|
* ```
|
|
45
47
|
*/
|
|
46
|
-
|
|
48
|
+
declare function requestContextFixture(opts?: RequestContextOptions): {
|
|
47
49
|
requestContext: readonly [({}: {}, use: (value: ServiceContext) => Promise<void>) => Promise<void>, {
|
|
48
50
|
readonly auto: true;
|
|
49
51
|
}];
|
|
@@ -66,6 +68,8 @@ export declare function requestContextFixture(opts?: RequestContextOptions): {
|
|
|
66
68
|
* });
|
|
67
69
|
* ```
|
|
68
70
|
*/
|
|
69
|
-
|
|
71
|
+
declare function withRequestContext<T extends TestAPI | ReturnType<TestAPI['extend']>>(testApi: T, opts?: RequestContextOptions): T;
|
|
72
|
+
//# sourceMappingURL=requestContext.d.ts.map
|
|
70
73
|
//#endregion
|
|
74
|
+
export { RequestContextOptions, requestContextFixture, runInRequestContext, withRequestContext };
|
|
71
75
|
//# sourceMappingURL=requestContext.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestContext.d.cts","names":[],"sources":["../src/requestContext.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestContext.d.cts","names":[],"sources":["../src/requestContext.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAiBA;AA6BA;;AACW,UA9BM,qBAAA,CA8BN;EAAC;EAAY,MAAT,CAAA,EA5BL,MA4BK;EAAO;EACW,SAC9B,CAAA,EAAA,MAAA;EAAC;EAAY,SAAT,CAAA,EAAA,MAAA;AAAO;AAmBd;;;;;;AAMiD;AAwCjD;;;;;AAEW,iBAtEK,mBAsEL,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,GAAA,GArEA,CAqEA,GArEI,OAqEJ,CArEY,CAqEZ,CAAA,EAAA,IAAA,CAAA,EApEJ,qBAoEI,CAAA,EAnER,CAmEQ,GAnEJ,OAmEI,CAnEI,CAmEJ,CAAA;;;AAAuC;;;;;;;;;;;;;iBAhDlC,qBAAA,QAA4B;kDAM3B,mBAAmB,kBAAa;;;;;;;;;;;;;;;;;;;;;;iBAwCjC,6BACL,UAAU,WAAW,6BACrB,UAAS,wBAA6B"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { ServiceContext } from "@geekmidas/services";
|
|
2
1
|
import { TestAPI } from "vitest";
|
|
2
|
+
import { ServiceContext } from "@geekmidas/services";
|
|
3
3
|
import { Logger } from "@geekmidas/logger";
|
|
4
|
+
|
|
4
5
|
//#region src/requestContext.d.ts
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Options for setting up a request context in tests. Any field omitted
|
|
7
9
|
* is filled with a test-friendly default (ConsoleLogger, random UUID,
|
|
8
10
|
* Date.now()).
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
interface RequestContextOptions {
|
|
11
13
|
/** Logger exposed via serviceContext.getLogger(). */
|
|
12
14
|
logger?: Logger;
|
|
13
15
|
/** Request id exposed via serviceContext.getRequestId(). */
|
|
@@ -27,7 +29,7 @@ export interface RequestContextOptions {
|
|
|
27
29
|
* );
|
|
28
30
|
* ```
|
|
29
31
|
*/
|
|
30
|
-
|
|
32
|
+
declare function runInRequestContext<T>(fn: () => T | Promise<T>, opts?: RequestContextOptions): T | Promise<T>;
|
|
31
33
|
/**
|
|
32
34
|
* Vitest fixture creator. Spread the result into `.extend()` and every test
|
|
33
35
|
* runs inside `runWithRequestContext`, even tests that don't destructure
|
|
@@ -43,7 +45,7 @@ export declare function runInRequestContext<T>(fn: () => T | Promise<T>, opts?:
|
|
|
43
45
|
* });
|
|
44
46
|
* ```
|
|
45
47
|
*/
|
|
46
|
-
|
|
48
|
+
declare function requestContextFixture(opts?: RequestContextOptions): {
|
|
47
49
|
requestContext: readonly [({}: {}, use: (value: ServiceContext) => Promise<void>) => Promise<void>, {
|
|
48
50
|
readonly auto: true;
|
|
49
51
|
}];
|
|
@@ -66,6 +68,8 @@ export declare function requestContextFixture(opts?: RequestContextOptions): {
|
|
|
66
68
|
* });
|
|
67
69
|
* ```
|
|
68
70
|
*/
|
|
69
|
-
|
|
71
|
+
declare function withRequestContext<T extends TestAPI | ReturnType<TestAPI['extend']>>(testApi: T, opts?: RequestContextOptions): T;
|
|
72
|
+
//# sourceMappingURL=requestContext.d.ts.map
|
|
70
73
|
//#endregion
|
|
74
|
+
export { RequestContextOptions, requestContextFixture, runInRequestContext, withRequestContext };
|
|
71
75
|
//# sourceMappingURL=requestContext.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestContext.d.mts","names":[],"sources":["../src/requestContext.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestContext.d.mts","names":[],"sources":["../src/requestContext.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAiBA;AA6BA;;AACW,UA9BM,qBAAA,CA8BN;EAAC;EAAY,MAAT,CAAA,EA5BL,MA4BK;EAAO;EACW,SAC9B,CAAA,EAAA,MAAA;EAAC;EAAY,SAAT,CAAA,EAAA,MAAA;AAAO;AAmBd;;;;;;AAMiD;AAwCjD;;;;;AAEW,iBAtEK,mBAsEL,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,GAAA,GArEA,CAqEA,GArEI,OAqEJ,CArEY,CAqEZ,CAAA,EAAA,IAAA,CAAA,EApEJ,qBAoEI,CAAA,EAnER,CAmEQ,GAnEJ,OAmEI,CAnEI,CAmEJ,CAAA;;;AAAuC;;;;;;;;;;;;;iBAhDlC,qBAAA,QAA4B;kDAM3B,mBAAmB,kBAAa;;;;;;;;;;;;;;;;;;;;;;iBAwCjC,6BACL,UAAU,WAAW,6BACrB,UAAS,wBAA6B"}
|
package/dist/requestContext.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { enterRequestContext, exitRequestContext, runWithRequestContext, serviceContext } from "@geekmidas/services";
|
|
2
1
|
import { randomUUID } from "node:crypto";
|
|
3
2
|
import { ConsoleLogger } from "@geekmidas/logger/console";
|
|
3
|
+
import { enterRequestContext, exitRequestContext, runWithRequestContext, serviceContext } from "@geekmidas/services";
|
|
4
|
+
|
|
4
5
|
//#region src/requestContext.ts
|
|
5
6
|
function resolveContext(opts = {}) {
|
|
6
7
|
return {
|
|
@@ -70,7 +71,7 @@ function requestContextFixture(opts = {}) {
|
|
|
70
71
|
function withRequestContext(testApi, opts = {}) {
|
|
71
72
|
return testApi.extend(requestContextFixture(opts));
|
|
72
73
|
}
|
|
74
|
+
|
|
73
75
|
//#endregion
|
|
74
76
|
export { requestContextFixture, runInRequestContext, withRequestContext };
|
|
75
|
-
|
|
76
77
|
//# sourceMappingURL=requestContext.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestContext.mjs","names":[],"sources":["../src/requestContext.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport type { Logger } from '@geekmidas/logger';\nimport { ConsoleLogger } from '@geekmidas/logger/console';\nimport {\n\tenterRequestContext,\n\texitRequestContext,\n\trunWithRequestContext,\n\ttype ServiceContext,\n\tserviceContext,\n} from '@geekmidas/services';\nimport type { TestAPI } from 'vitest';\n\n/**\n * Options for setting up a request context in tests. Any field omitted\n * is filled with a test-friendly default (ConsoleLogger, random UUID,\n * Date.now()).\n */\nexport interface RequestContextOptions {\n\t/** Logger exposed via serviceContext.getLogger(). */\n\tlogger?: Logger;\n\t/** Request id exposed via serviceContext.getRequestId(). */\n\trequestId?: string;\n\t/** Start time exposed via serviceContext.getRequestStartTime(). */\n\tstartTime?: number;\n}\n\nfunction resolveContext(opts: RequestContextOptions = {}) {\n\treturn {\n\t\tlogger: opts.logger ?? new ConsoleLogger({ app: 'test' }),\n\t\trequestId: opts.requestId ?? randomUUID(),\n\t\tstartTime: opts.startTime ?? Date.now(),\n\t};\n}\n\n/**\n * Run a function inside a request context with test-friendly defaults.\n * Useful when you need `serviceContext` to be available for a single call\n * (e.g. invoking `Service.register({ context })` outside a wrapped test).\n *\n * @example\n * ```ts\n * await runInRequestContext(() =>\n * discovery.register([databaseService]),\n * );\n * ```\n */\nexport function runInRequestContext<T>(\n\tfn: () => T | Promise<T>,\n\topts: RequestContextOptions = {},\n): T | Promise<T> {\n\treturn runWithRequestContext(resolveContext(opts), fn);\n}\n\n/**\n * Vitest fixture creator. Spread the result into `.extend()` and every test\n * runs inside `runWithRequestContext`, even tests that don't destructure\n * `requestContext` directly (the fixture is registered as `auto`).\n *\n * @example\n * ```ts\n * const it = test.extend({ ...requestContextFixture() });\n *\n * it('registers services with context', async ({ requestContext }) => {\n * await discovery.register([databaseService]);\n * expect(requestContext.getRequestId()).toBeDefined();\n * });\n * ```\n */\nexport function requestContextFixture(opts: RequestContextOptions = {}) {\n\treturn {\n\t\trequestContext: [\n\t\t\tasync (\n\t\t\t\t// biome-ignore lint/correctness/noEmptyPattern: vitest fixture signature\n\t\t\t\t{}: {},\n\t\t\t\tuse: (value: ServiceContext) => Promise<void>,\n\t\t\t) => {\n\t\t\t\t// Vitest suspends the fixture on `await use(...)` and runs the test\n\t\t\t\t// body in a continuation of the runner's async context. A scoped\n\t\t\t\t// `runWithRequestContext` callback ends as soon as we hand control\n\t\t\t\t// to the runner, so the test body would see no context. Instead,\n\t\t\t\t// mutate the current task's store with `enterRequestContext` —\n\t\t\t\t// async/await preserves that store across the suspension, so the\n\t\t\t\t// test body sees it. We restore on the way out so subsequent tests\n\t\t\t\t// don't inherit the value.\n\t\t\t\tenterRequestContext(resolveContext(opts));\n\t\t\t\ttry {\n\t\t\t\t\tawait use(serviceContext);\n\t\t\t\t} finally {\n\t\t\t\t\texitRequestContext();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ auto: true },\n\t\t] as const,\n\t};\n}\n\n/**\n * Wrap any Vitest `TestAPI` (including the one returned by\n * `wrapVitestKyselyTransaction`) so every test runs inside\n * `runWithRequestContext`. Compose with the transaction wrappers:\n *\n * @example\n * ```ts\n * import { wrapVitestKyselyTransaction } from '@geekmidas/testkit/kysely';\n * import { withRequestContext } from '@geekmidas/testkit/request-context';\n *\n * const baseIt = wrapVitestKyselyTransaction<DB>(it, { connection: db });\n * const itWithCtx = withRequestContext(baseIt);\n *\n * itWithCtx('runs inside trx + context', async ({ trx, requestContext }) => {\n * // serviceContext is set up; Service.register({ context }) works here.\n * });\n * ```\n */\nexport function withRequestContext<\n\tT extends TestAPI | ReturnType<TestAPI['extend']>,\n>(testApi: T, opts: RequestContextOptions = {}): T {\n\treturn (testApi as any).extend(requestContextFixture(opts));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestContext.mjs","names":["opts: RequestContextOptions","fn: () => T | Promise<T>","use: (value: ServiceContext) => Promise<void>","testApi: T"],"sources":["../src/requestContext.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport type { Logger } from '@geekmidas/logger';\nimport { ConsoleLogger } from '@geekmidas/logger/console';\nimport {\n\tenterRequestContext,\n\texitRequestContext,\n\trunWithRequestContext,\n\ttype ServiceContext,\n\tserviceContext,\n} from '@geekmidas/services';\nimport type { TestAPI } from 'vitest';\n\n/**\n * Options for setting up a request context in tests. Any field omitted\n * is filled with a test-friendly default (ConsoleLogger, random UUID,\n * Date.now()).\n */\nexport interface RequestContextOptions {\n\t/** Logger exposed via serviceContext.getLogger(). */\n\tlogger?: Logger;\n\t/** Request id exposed via serviceContext.getRequestId(). */\n\trequestId?: string;\n\t/** Start time exposed via serviceContext.getRequestStartTime(). */\n\tstartTime?: number;\n}\n\nfunction resolveContext(opts: RequestContextOptions = {}) {\n\treturn {\n\t\tlogger: opts.logger ?? new ConsoleLogger({ app: 'test' }),\n\t\trequestId: opts.requestId ?? randomUUID(),\n\t\tstartTime: opts.startTime ?? Date.now(),\n\t};\n}\n\n/**\n * Run a function inside a request context with test-friendly defaults.\n * Useful when you need `serviceContext` to be available for a single call\n * (e.g. invoking `Service.register({ context })` outside a wrapped test).\n *\n * @example\n * ```ts\n * await runInRequestContext(() =>\n * discovery.register([databaseService]),\n * );\n * ```\n */\nexport function runInRequestContext<T>(\n\tfn: () => T | Promise<T>,\n\topts: RequestContextOptions = {},\n): T | Promise<T> {\n\treturn runWithRequestContext(resolveContext(opts), fn);\n}\n\n/**\n * Vitest fixture creator. Spread the result into `.extend()` and every test\n * runs inside `runWithRequestContext`, even tests that don't destructure\n * `requestContext` directly (the fixture is registered as `auto`).\n *\n * @example\n * ```ts\n * const it = test.extend({ ...requestContextFixture() });\n *\n * it('registers services with context', async ({ requestContext }) => {\n * await discovery.register([databaseService]);\n * expect(requestContext.getRequestId()).toBeDefined();\n * });\n * ```\n */\nexport function requestContextFixture(opts: RequestContextOptions = {}) {\n\treturn {\n\t\trequestContext: [\n\t\t\tasync (\n\t\t\t\t// biome-ignore lint/correctness/noEmptyPattern: vitest fixture signature\n\t\t\t\t{}: {},\n\t\t\t\tuse: (value: ServiceContext) => Promise<void>,\n\t\t\t) => {\n\t\t\t\t// Vitest suspends the fixture on `await use(...)` and runs the test\n\t\t\t\t// body in a continuation of the runner's async context. A scoped\n\t\t\t\t// `runWithRequestContext` callback ends as soon as we hand control\n\t\t\t\t// to the runner, so the test body would see no context. Instead,\n\t\t\t\t// mutate the current task's store with `enterRequestContext` —\n\t\t\t\t// async/await preserves that store across the suspension, so the\n\t\t\t\t// test body sees it. We restore on the way out so subsequent tests\n\t\t\t\t// don't inherit the value.\n\t\t\t\tenterRequestContext(resolveContext(opts));\n\t\t\t\ttry {\n\t\t\t\t\tawait use(serviceContext);\n\t\t\t\t} finally {\n\t\t\t\t\texitRequestContext();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ auto: true },\n\t\t] as const,\n\t};\n}\n\n/**\n * Wrap any Vitest `TestAPI` (including the one returned by\n * `wrapVitestKyselyTransaction`) so every test runs inside\n * `runWithRequestContext`. Compose with the transaction wrappers:\n *\n * @example\n * ```ts\n * import { wrapVitestKyselyTransaction } from '@geekmidas/testkit/kysely';\n * import { withRequestContext } from '@geekmidas/testkit/request-context';\n *\n * const baseIt = wrapVitestKyselyTransaction<DB>(it, { connection: db });\n * const itWithCtx = withRequestContext(baseIt);\n *\n * itWithCtx('runs inside trx + context', async ({ trx, requestContext }) => {\n * // serviceContext is set up; Service.register({ context }) works here.\n * });\n * ```\n */\nexport function withRequestContext<\n\tT extends TestAPI | ReturnType<TestAPI['extend']>,\n>(testApi: T, opts: RequestContextOptions = {}): T {\n\treturn (testApi as any).extend(requestContextFixture(opts));\n}\n"],"mappings":";;;;;AA0BA,SAAS,eAAeA,OAA8B,CAAE,GAAE;AACzD,QAAO;EACN,QAAQ,KAAK,UAAU,IAAI,cAAc,EAAE,KAAK,OAAQ;EACxD,WAAW,KAAK,aAAa,YAAY;EACzC,WAAW,KAAK,aAAa,KAAK,KAAK;CACvC;AACD;;;;;;;;;;;;;AAcD,SAAgB,oBACfC,IACAD,OAA8B,CAAE,GACf;AACjB,QAAO,sBAAsB,eAAe,KAAK,EAAE,GAAG;AACtD;;;;;;;;;;;;;;;;AAiBD,SAAgB,sBAAsBA,OAA8B,CAAE,GAAE;AACvE,QAAO,EACN,gBAAgB,CACf,OAEC,EAAM,EACNE,QACI;AASJ,sBAAoB,eAAe,KAAK,CAAC;AACzC,MAAI;AACH,SAAM,IAAI,eAAe;EACzB,UAAS;AACT,uBAAoB;EACpB;CACD,GACD,EAAE,MAAM,KAAM,CACd,EACD;AACD;;;;;;;;;;;;;;;;;;;AAoBD,SAAgB,mBAEdC,SAAYH,OAA8B,CAAE,GAAK;AAClD,QAAO,AAAC,QAAgB,OAAO,sBAAsB,KAAK,CAAC;AAC3D"}
|
package/dist/timer.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
//#region src/timer.ts
|
|
3
3
|
function waitFor(ms) {
|
|
4
4
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
5
5
|
}
|
|
6
|
+
|
|
6
7
|
//#endregion
|
|
7
8
|
exports.waitFor = waitFor;
|
|
8
|
-
|
|
9
9
|
//# sourceMappingURL=timer.cjs.map
|
package/dist/timer.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.cjs","names":[],"sources":["../src/timer.ts"],"sourcesContent":["export function waitFor(ms: number) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";;AAAA,SAAgB,
|
|
1
|
+
{"version":3,"file":"timer.cjs","names":["ms: number"],"sources":["../src/timer.ts"],"sourcesContent":["export function waitFor(ms: number) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";;AAAA,SAAgB,QAAQA,IAAY;AACnC,QAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;AACvD"}
|
package/dist/timer.d.cts
CHANGED
package/dist/timer.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.d.cts","names":[],"sources":["../src/timer.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"timer.d.cts","names":[],"sources":["../src/timer.ts"],"sourcesContent":[],"mappings":";iBAAgB,OAAA,cAAkB;AAAlC"}
|
package/dist/timer.d.mts
CHANGED
package/dist/timer.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.d.mts","names":[],"sources":["../src/timer.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"timer.d.mts","names":[],"sources":["../src/timer.ts"],"sourcesContent":[],"mappings":";iBAAgB,OAAA,cAAkB;AAAlC"}
|
package/dist/timer.mjs
CHANGED
package/dist/timer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.mjs","names":[],"sources":["../src/timer.ts"],"sourcesContent":["export function waitFor(ms: number) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";AAAA,SAAgB,
|
|
1
|
+
{"version":3,"file":"timer.mjs","names":["ms: number"],"sources":["../src/timer.ts"],"sourcesContent":["export function waitFor(ms: number) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";AAAA,SAAgB,QAAQA,IAAY;AACnC,QAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;AACvD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/testkit",
|
|
3
|
-
"version": "10.0.0
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -113,65 +113,16 @@
|
|
|
113
113
|
"types": "./dist/requestContext.d.cts",
|
|
114
114
|
"default": "./dist/requestContext.cjs"
|
|
115
115
|
}
|
|
116
|
-
},
|
|
117
|
-
"./browser": {
|
|
118
|
-
"import": {
|
|
119
|
-
"types": "./dist/browser.d.mts",
|
|
120
|
-
"default": "./dist/browser.mjs"
|
|
121
|
-
},
|
|
122
|
-
"require": {
|
|
123
|
-
"types": "./dist/browser.d.cts",
|
|
124
|
-
"default": "./dist/browser.cjs"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"./context": {
|
|
128
|
-
"import": {
|
|
129
|
-
"types": "./dist/context.d.mts",
|
|
130
|
-
"default": "./dist/context.mjs"
|
|
131
|
-
},
|
|
132
|
-
"require": {
|
|
133
|
-
"types": "./dist/context.d.cts",
|
|
134
|
-
"default": "./dist/context.cjs"
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"./mailbox": {
|
|
138
|
-
"import": {
|
|
139
|
-
"types": "./dist/mailbox.d.mts",
|
|
140
|
-
"default": "./dist/mailbox.mjs"
|
|
141
|
-
},
|
|
142
|
-
"require": {
|
|
143
|
-
"types": "./dist/mailbox.d.cts",
|
|
144
|
-
"default": "./dist/mailbox.cjs"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
"./transactions": {
|
|
148
|
-
"import": {
|
|
149
|
-
"types": "./dist/transactions.d.mts",
|
|
150
|
-
"default": "./dist/transactions.mjs"
|
|
151
|
-
},
|
|
152
|
-
"require": {
|
|
153
|
-
"types": "./dist/transactions.d.cts",
|
|
154
|
-
"default": "./dist/transactions.cjs"
|
|
155
|
-
}
|
|
156
116
|
}
|
|
157
117
|
},
|
|
158
|
-
"files": [
|
|
159
|
-
"dist"
|
|
160
|
-
],
|
|
161
118
|
"dependencies": {
|
|
162
|
-
"@faker-js/faker": "~
|
|
163
|
-
"tough-cookie": "~6.0.2",
|
|
164
|
-
"@geekmidas/envkit": "^10.0.0-alpha.98",
|
|
165
|
-
"@geekmidas/logger": "^10.0.0-alpha.98",
|
|
166
|
-
"@geekmidas/services": "^10.0.0-alpha.98"
|
|
119
|
+
"@faker-js/faker": "~9.9.0"
|
|
167
120
|
},
|
|
168
121
|
"devDependencies": {
|
|
169
|
-
"@
|
|
170
|
-
"@
|
|
171
|
-
"
|
|
172
|
-
"@geekmidas/
|
|
173
|
-
"@geekmidas/logger": "^10.0.0-alpha.98",
|
|
174
|
-
"@geekmidas/services": "^10.0.0-alpha.98"
|
|
122
|
+
"@types/pg": "~8.15.4",
|
|
123
|
+
"@geekmidas/envkit": "^10.0.0",
|
|
124
|
+
"@geekmidas/services": "^10.0.0",
|
|
125
|
+
"@geekmidas/logger": "^10.0.0"
|
|
175
126
|
},
|
|
176
127
|
"repository": {
|
|
177
128
|
"type": "git",
|
|
@@ -182,16 +133,28 @@
|
|
|
182
133
|
"access": "public"
|
|
183
134
|
},
|
|
184
135
|
"peerDependencies": {
|
|
185
|
-
"kysely": "~0.29.
|
|
186
|
-
"pg": "
|
|
187
|
-
"knex": "
|
|
188
|
-
"objection": "
|
|
136
|
+
"kysely": "~0.29.4",
|
|
137
|
+
"pg": "~8.16.3",
|
|
138
|
+
"knex": "~3.1.0",
|
|
139
|
+
"objection": "~3.1.5",
|
|
189
140
|
"db-errors": "~0.2.3",
|
|
190
|
-
"vitest": "~
|
|
191
|
-
"@types/aws-lambda": ">=8.10.
|
|
192
|
-
"better-auth": ">=1.
|
|
141
|
+
"vitest": "~3.2.4",
|
|
142
|
+
"@types/aws-lambda": ">=8.10.92",
|
|
143
|
+
"better-auth": ">=1.3.34",
|
|
144
|
+
"@geekmidas/envkit": "^10.0.0",
|
|
145
|
+
"@geekmidas/logger": "^10.0.0",
|
|
146
|
+
"@geekmidas/services": "^10.0.0"
|
|
193
147
|
},
|
|
194
148
|
"peerDependenciesMeta": {
|
|
149
|
+
"@geekmidas/envkit": {
|
|
150
|
+
"optional": true
|
|
151
|
+
},
|
|
152
|
+
"@geekmidas/logger": {
|
|
153
|
+
"optional": true
|
|
154
|
+
},
|
|
155
|
+
"@geekmidas/services": {
|
|
156
|
+
"optional": true
|
|
157
|
+
},
|
|
195
158
|
"kysely": {
|
|
196
159
|
"optional": true
|
|
197
160
|
},
|
|
@@ -216,8 +179,5 @@
|
|
|
216
179
|
"better-auth": {
|
|
217
180
|
"optional": true
|
|
218
181
|
}
|
|
219
|
-
},
|
|
220
|
-
"scripts": {
|
|
221
|
-
"build": "tsdown --config ../../tsdown.config.ts --filter ."
|
|
222
182
|
}
|
|
223
183
|
}
|