@gatwech/auth 1.0.0-beta.19 → 1.0.0-beta.21
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/dist/adapters/drizzle-adapter/index.mjs +11 -2
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/kysely-adapter/index.mjs +1 -1
- package/dist/adapters/memory-adapter/index.d.mts +1 -1
- package/dist/adapters/memory-adapter/index.mjs +2 -2
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.mjs +1 -1
- package/dist/{audit-log-DKsUWR8O.mjs → audit-log-DgqHJ-uv.mjs} +132 -63
- package/dist/{auth-vfCyIIeV.mjs → auth-BoEA9bN7.mjs} +14 -1
- package/dist/client/index.d.mts +18 -18
- package/dist/client/plugins/index.d.mts +28 -28
- package/dist/client/plugins/index.mjs +2 -2
- package/dist/client/react/index.d.mts +16 -16
- package/dist/{client-CSOs1YN7.d.mts → client-B00gkznv.d.mts} +1 -1
- package/dist/{client-4QEb0rUr.mjs → client-CMsC6-rl.mjs} +1 -1
- package/dist/{client-DZHNfxuR.d.mts → client-Da7tq8m6.d.mts} +4 -4
- package/dist/cookies/index.d.mts +3 -3
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +1 -1
- package/dist/{db-7vHnL1XA.mjs → db-CV59HpEF.mjs} +2 -2
- package/dist/{index-mxEUX2Gs.d.mts → index-BECNG13R.d.mts} +13 -13
- package/dist/{index-DRM35ir1.d.mts → index-BKy-8t2n.d.mts} +118 -65
- package/dist/{index-Df0KhQRf-BEa5tdwJ.d.mts → index-BL_t8cRp-C4QYBsac.d.mts} +56 -17
- package/dist/{index-DXVU0HGr.d.mts → index-BWYXZVsV.d.mts} +5 -5
- package/dist/{index-Df4SvZaE.d.mts → index-Bhc37y9F.d.mts} +3 -3
- package/dist/{index-BNhJglHC.d.mts → index-BjCQ3jmE.d.mts} +119 -119
- package/dist/{index-Cv9iMevV.d.mts → index-Bxive_YT.d.mts} +9 -9
- package/dist/{index-CgeC2eGC.d.mts → index-C-IDh5yy.d.mts} +2 -2
- package/dist/{index-COGe8UJx.d.mts → index-CM1rFdwV.d.mts} +9 -9
- package/dist/{index-zBdYQGaS.d.mts → index-CMG4Pnen.d.mts} +6 -6
- package/dist/{index-Blmhq6eA.d.mts → index-CTqynuxm.d.mts} +4 -4
- package/dist/{index-DS-R7st3.d.mts → index-CbBQdS-u.d.mts} +6 -6
- package/dist/{index-Db8jqUq2.d.mts → index-CpH-1sse.d.mts} +10 -10
- package/dist/{index-CUknVRZp.d.mts → index-D1OZ2e4m.d.mts} +14 -14
- package/dist/{index-CaqpCfE5.d.mts → index-Dt2I0G4X.d.mts} +7 -7
- package/dist/{index-EABwA_BH.d.mts → index-IX1to9TB.d.mts} +34 -34
- package/dist/{index-CKnPAS5n.d.mts → index-TrOnY3pM.d.mts} +170 -170
- package/dist/{index-CsxtcAO0.d.mts → index-VUyESU4p.d.mts} +1 -1
- package/dist/{index-CP3FNbOZ.d.mts → index-WV7VzW2H.d.mts} +8 -8
- package/dist/{index-xoYsoOiR.d.mts → index-YeXSxzhX.d.mts} +3 -3
- package/dist/{index-DG-X1PK5.d.mts → index-cPt-00xm.d.mts} +6 -6
- package/dist/{index-BNDRYfTF.d.mts → index-iRoaTsOj.d.mts} +2 -2
- package/dist/{index-BAVzFqII.d.mts → index-jEkJ2Zfk.d.mts} +6 -6
- package/dist/{index-DyH_CgmX.d.mts → index-oNlp4SvD.d.mts} +10 -10
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/integrations/next-js.d.mts +4 -4
- package/dist/integrations/node.d.mts +2 -2
- package/dist/integrations/react-start.d.mts +4 -4
- package/dist/{kysely-adapter-Bkm1liPW.mjs → kysely-adapter-BidlNTiV.mjs} +4 -2
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/oauth2/index.mjs +1 -1
- package/dist/{organization-CkTKs7bx.mjs → organization-D4QMpChF.mjs} +1 -1
- package/dist/plugins/admin/index.d.mts +3 -3
- package/dist/plugins/admin/index.mjs +1 -1
- package/dist/plugins/anonymous/index.d.mts +3 -3
- package/dist/plugins/anonymous/index.mjs +1 -1
- package/dist/plugins/audit-log/client.d.mts +24 -24
- package/dist/plugins/audit-log/index.d.mts +23 -23
- package/dist/plugins/audit-log/index.mjs +2 -2
- package/dist/plugins/bearer/index.d.mts +1 -1
- package/dist/plugins/captcha/index.d.mts +1 -1
- package/dist/plugins/custom-session/index.d.mts +3 -3
- package/dist/plugins/custom-session/index.mjs +1 -1
- package/dist/plugins/device-authorization/index.d.mts +1 -1
- package/dist/plugins/device-authorization/index.mjs +1 -1
- package/dist/plugins/email-otp/index.d.mts +2 -2
- package/dist/plugins/email-otp/index.mjs +1 -1
- package/dist/plugins/generic-oauth/index.d.mts +3 -3
- package/dist/plugins/generic-oauth/index.mjs +1 -1
- package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
- package/dist/plugins/haveibeenpwned/index.mjs +1 -1
- package/dist/plugins/index.d.mts +23 -23
- package/dist/plugins/index.mjs +5 -5
- package/dist/plugins/jwt/index.d.mts +3 -3
- package/dist/plugins/jwt/index.mjs +1 -1
- package/dist/plugins/magic-link/index.d.mts +1 -1
- package/dist/plugins/magic-link/index.mjs +1 -1
- package/dist/plugins/multi-session/index.d.mts +2 -2
- package/dist/plugins/multi-session/index.mjs +1 -1
- package/dist/plugins/oauth-proxy/index.d.mts +1 -1
- package/dist/plugins/oauth-proxy/index.mjs +1 -1
- package/dist/plugins/one-tap/index.d.mts +1 -1
- package/dist/plugins/one-tap/index.mjs +1 -1
- package/dist/plugins/one-time-token/index.d.mts +3 -3
- package/dist/plugins/one-time-token/index.mjs +5 -5
- package/dist/plugins/organization/index.d.mts +3 -3
- package/dist/plugins/organization/index.mjs +2 -2
- package/dist/plugins/passkey/index.d.mts +3 -3
- package/dist/plugins/passkey/index.mjs +1 -1
- package/dist/plugins/phone-number/index.d.mts +3 -3
- package/dist/plugins/phone-number/index.mjs +1 -1
- package/dist/plugins/sentinel/client.d.mts +24 -24
- package/dist/plugins/sentinel/client.mjs +2 -2
- package/dist/plugins/sentinel/index.d.mts +23 -23
- package/dist/plugins/sentinel/index.mjs +3 -3
- package/dist/plugins/two-factor/index.d.mts +3 -3
- package/dist/plugins/two-factor/index.mjs +1 -1
- package/dist/plugins/username/index.d.mts +1 -1
- package/dist/plugins/username/index.mjs +1 -1
- package/dist/{pow-OK01yPG3.mjs → pow-DvkUopsK.mjs} +17 -1
- package/dist/{sentinel-C-D1IHJo.mjs → sentinel-B4Wo79HK.mjs} +326 -92
- package/dist/src/adapters/memory-adapter/memory-adapter.d.ts +1 -1
- package/dist/src/adapters/prisma-adapter/test/auth.d.ts +1 -1
- package/dist/src/adapters/tests/auth-flow.d.ts +3 -3
- package/dist/src/adapters/tests/normal.d.ts +10 -2
- package/dist/src/adapters/tests/number-id.d.ts +4 -4
- package/dist/src/adapters/tests/performance.d.ts +3 -3
- package/dist/src/adapters/tests/transactions.d.ts +3 -3
- package/dist/src/api/index.d.ts +8 -8
- package/dist/src/plugins/admin/admin.d.ts +2 -2
- package/dist/src/plugins/api-key/index.d.ts +2 -2
- package/dist/src/plugins/audit-log/index.d.ts +5 -14
- package/dist/src/plugins/audit-log/remote.d.ts +4 -4
- package/dist/src/plugins/audit-log/types.d.ts +22 -0
- package/dist/src/plugins/email-otp/index.d.ts +1 -1
- package/dist/src/plugins/multi-session/index.d.ts +8 -8
- package/dist/src/plugins/organization/routes/crud-access-control.d.ts +8 -8
- package/dist/src/plugins/organization/routes/crud-invites.d.ts +46 -46
- package/dist/src/plugins/organization/routes/crud-members.d.ts +40 -40
- package/dist/src/plugins/organization/routes/crud-org.d.ts +36 -36
- package/dist/src/plugins/organization/routes/crud-team.d.ts +50 -50
- package/dist/src/plugins/sentinel/email.d.ts +9 -3
- package/dist/src/plugins/sentinel/index.d.ts +10 -1
- package/dist/src/plugins/sentinel/intel.d.ts +8 -1
- package/dist/src/plugins/sentinel/memory-cache.d.ts +12 -0
- package/dist/src/plugins/sentinel/schema.d.ts +4 -0
- package/dist/src/plugins/sentinel/store.d.ts +7 -0
- package/dist/src/plugins/sentinel/types.d.ts +29 -1
- package/dist/src/test-utils/test-instance.d.ts +25 -25
- package/dist/test-utils/index.d.mts +293 -293
- package/dist/test-utils/index.mjs +7 -7
- package/dist/types/index.d.mts +2 -2
- package/package.json +3 -3
|
@@ -6,4 +6,4 @@ export interface MemoryDB {
|
|
|
6
6
|
export interface MemoryAdapterConfig {
|
|
7
7
|
debugLogs?: DBAdapterDebugLogOption | undefined;
|
|
8
8
|
}
|
|
9
|
-
export declare const memoryAdapter: (db: MemoryDB, config?: MemoryAdapterConfig | undefined) => (options: PayvoAuthOptions) => import("packages/core/dist/index-
|
|
9
|
+
export declare const memoryAdapter: (db: MemoryDB, config?: MemoryAdapterConfig | undefined) => (options: PayvoAuthOptions) => import("packages/core/dist/index-BL_t8cRp.mjs").nt<PayvoAuthOptions>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const auth: import("../../..").Auth<{
|
|
2
|
-
database: (options: import("packages/core/dist/index-
|
|
2
|
+
database: (options: import("packages/core/dist/index-BL_t8cRp.mjs").g) => import("packages/core/dist/index-BL_t8cRp.mjs").nt<import("packages/core/dist/index-BL_t8cRp.mjs").g>;
|
|
3
3
|
}>;
|
|
@@ -8,11 +8,11 @@ export declare const authFlowTestSuite: (options?: ({
|
|
|
8
8
|
} & {
|
|
9
9
|
showDB?: () => Promise<void>;
|
|
10
10
|
}) | undefined) => (helpers: {
|
|
11
|
-
adapter: () => Promise<import("packages/core/dist/index-
|
|
11
|
+
adapter: () => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").nt<import("packages/core/dist/index-BL_t8cRp.mjs").g>>;
|
|
12
12
|
log: import("../test-adapter").Logger;
|
|
13
13
|
adapterDisplayName: string;
|
|
14
|
-
getPayvoAuthOptions: () => import("packages/core/dist/index-
|
|
15
|
-
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-
|
|
14
|
+
getPayvoAuthOptions: () => import("packages/core/dist/index-BL_t8cRp.mjs").g;
|
|
15
|
+
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-BL_t8cRp.mjs").g) => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").g>;
|
|
16
16
|
cleanup: () => Promise<void>;
|
|
17
17
|
runMigrations: () => Promise<void>;
|
|
18
18
|
prefixTests?: string | undefined;
|
|
@@ -3,11 +3,11 @@ import { createTestSuite } from "../create-test-suite";
|
|
|
3
3
|
* This test suite tests the basic CRUD operations of the adapter.
|
|
4
4
|
*/
|
|
5
5
|
export declare const normalTestSuite: (options?: {
|
|
6
|
-
disableTests?: Partial<Record<"init - tests" | "create - should create a model" | "create - should always return an id" | "create - should use generateId if provided" | "create - should return null for nullable foreign keys" | "create - should apply default values to fields" | "findOne - should find a model" | "findOne - should not apply defaultValue if value not found" | "findOne - should find a model using a reference field" | "findOne - should not throw on record not found" | "findOne - should find a model without id" | "findOne - should find a model with modified field name" | "findOne - should find a model with modified model name" | "findOne - should find a model with additional fields" | "findOne - should select fields" | "findOne - should find model with date field" | "findMany - should find many models with date fields" | "findMany - should find many models" | "findMany - should return an empty array when no models are found" | "findMany - should find many models with starts_with operator" | "findMany - starts_with should not interpret regex patterns" | "findMany - ends_with should not interpret regex patterns" | "findMany - contains should not interpret regex patterns" | "findMany - should find many models with ends_with operator" | "findMany - should find many models with contains operator" | "findMany - should handle multiple where conditions with different operators" | "findMany - should find many models with contains operator (using symbol)" | "findMany - should find many models with eq operator" | "findMany - should find many models with ne operator" | "findMany - should find many models with ne operator on id field" | "findMany - should find many models with ne operator on _id field (MongoDB)" | "findMany - should handle ne operator with null value on id field" | "findMany - should handle in operator with null value in array" | "findMany - should find many models with gt operator" | "findMany - should find many models with gte operator" | "findMany - should find many models with lte operator" | "findMany - should find many models with lt operator" | "findMany - should find many models with in operator" | "findMany - should find many models with not_in operator" | "findMany - should find many models with sortBy" | "findMany - should find many models with limit" | "findMany - should find many models with offset" | "findMany - should find many models with limit and offset" | "findMany - should find many models with sortBy and offset" | "findMany - should find many models with sortBy and limit" | "findMany - should find many models with sortBy and limit and offset" | "findMany - should find many models with sortBy and limit and offset and where" | "update - should update a model" | "updateMany - should update all models when where is empty" | "updateMany - should update many models with a specific where" | "updateMany - should update many models with a multiple where" | "delete - should delete a model" | "delete - should not throw on record not found" | "deleteMany - should delete many models" | "deleteMany - starts_with should not interpret regex patterns" | "deleteMany - ends_with should not interpret regex patterns" | "deleteMany - contains should not interpret regex patterns" | "deleteMany - should delete many models with numeric values" | "deleteMany - should delete many models with boolean values" | "count - should count many models" | "count - should return 0 with no rows to count" | "count - should count with where clause" | "update - should correctly return record when updating a field used in where clause" | "update - should handle updating multiple fields including where clause field" | "update - should work when updated field is not in where clause", boolean> & {
|
|
6
|
+
disableTests?: Partial<Record<"init - tests" | "create - should create a model" | "create - should always return an id" | "create - should use generateId if provided" | "create - should return null for nullable foreign keys" | "create - should apply default values to fields" | "findOne - should find a model" | "findOne - should not apply defaultValue if value not found" | "findOne - should find a model using a reference field" | "findOne - should not throw on record not found" | "findOne - should find a model without id" | "findOne - should find a model with modified field name" | "findOne - should find a model with modified model name" | "findOne - should find a model with additional fields" | "findOne - should select fields" | "findOne - should find model with date field" | "findMany - should find many models with date fields" | "findMany - should find many models" | "findMany - should return an empty array when no models are found" | "findMany - should find many models with starts_with operator" | "findMany - starts_with should not interpret regex patterns" | "findMany - ends_with should not interpret regex patterns" | "findMany - contains should not interpret regex patterns" | "findMany - should find many models with ends_with operator" | "findMany - should find many models with contains operator" | "findMany - should handle multiple where conditions with different operators" | "findMany - should find many models with contains operator (using symbol)" | "findMany - should find many models with eq operator" | "findMany - should find many models with ne operator" | "findMany - should find many models with ne operator on id field" | "findMany - should find many models with ne operator on _id field (MongoDB)" | "findMany - should handle ne operator with null value on id field" | "findMany - should handle in operator with null value in array" | "findMany - should find many models with gt operator" | "findMany - should find many models with gte operator" | "findMany - should find many models with lte operator" | "findMany - should find many models with lt operator" | "findMany - should find many models with in operator" | "findMany - should find many models with not_in operator" | "findMany - should find many models with sortBy" | "findMany - should find many models with limit" | "findMany - should find many models with offset" | "findMany - should find many models with limit and offset" | "findMany - should find many models with sortBy and offset" | "findMany - should find many models with sortBy and limit" | "findMany - should find many models with sortBy and limit and offset" | "findMany - should find many models with sortBy and limit and offset and where" | "update - should update a model" | "updateMany - should update all models when where is empty" | "updateMany - should update many models with a specific where" | "updateMany - should update many models with a multiple where" | "updateMany - should return the number of updated models" | "delete - should delete a model" | "delete - should not throw on record not found" | "deleteMany - should delete many models" | "deleteMany - should return the number of deleted models" | "deleteMany - starts_with should not interpret regex patterns" | "deleteMany - ends_with should not interpret regex patterns" | "deleteMany - contains should not interpret regex patterns" | "deleteMany - should delete many models with numeric values" | "deleteMany - should delete many models with boolean values" | "count - should count many models" | "count - should return 0 with no rows to count" | "count - should count with where clause" | "update - should correctly return record when updating a field used in where clause" | "update - should handle updating multiple fields including where clause field" | "update - should work when updated field is not in where clause", boolean> & {
|
|
7
7
|
ALL?: boolean;
|
|
8
8
|
}> | undefined;
|
|
9
9
|
} | undefined) => (helpers: {
|
|
10
|
-
adapter: () => Promise<import("packages/core/dist/index-
|
|
10
|
+
adapter: () => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").nt<import("@gatwech/core").PayvoAuthOptions>>;
|
|
11
11
|
log: import("../test-adapter").Logger;
|
|
12
12
|
adapterDisplayName: string;
|
|
13
13
|
getPayvoAuthOptions: () => import("@gatwech/core").PayvoAuthOptions;
|
|
@@ -70,9 +70,17 @@ export declare const getNormalTestSuiteTests: ({ adapter, generate, insertRandom
|
|
|
70
70
|
"updateMany - should update all models when where is empty": () => Promise<void>;
|
|
71
71
|
"updateMany - should update many models with a specific where": () => Promise<void>;
|
|
72
72
|
"updateMany - should update many models with a multiple where": () => Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* @see https://github.com/gatwech-eleven/payvo-auth/issues/19
|
|
75
|
+
*/
|
|
76
|
+
"updateMany - should return the number of updated models": () => Promise<void>;
|
|
73
77
|
"delete - should delete a model": () => Promise<void>;
|
|
74
78
|
"delete - should not throw on record not found": () => Promise<void>;
|
|
75
79
|
"deleteMany - should delete many models": () => Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* @see https://github.com/gatwech-eleven/payvo-auth/issues/19
|
|
82
|
+
*/
|
|
83
|
+
"deleteMany - should return the number of deleted models": () => Promise<void>;
|
|
76
84
|
"deleteMany - starts_with should not interpret regex patterns": () => Promise<void>;
|
|
77
85
|
"deleteMany - ends_with should not interpret regex patterns": () => Promise<void>;
|
|
78
86
|
"deleteMany - contains should not interpret regex patterns": () => Promise<void>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const numberIdTestSuite: (options?: {
|
|
2
|
-
disableTests?: Partial<Record<"init - tests" | "create - should create a model" | "create - should always return an id" | "create - should return null for nullable foreign keys" | "create - should apply default values to fields" | "findOne - should find a model" | "findOne - should not apply defaultValue if value not found" | "findOne - should find a model using a reference field" | "findOne - should not throw on record not found" | "findOne - should find a model without id" | "findOne - should find a model with modified field name" | "findOne - should find a model with modified model name" | "findOne - should find a model with additional fields" | "findOne - should select fields" | "findOne - should find model with date field" | "findMany - should find many models with date fields" | "findMany - should find many models" | "findMany - should return an empty array when no models are found" | "findMany - should find many models with starts_with operator" | "findMany - starts_with should not interpret regex patterns" | "findMany - ends_with should not interpret regex patterns" | "findMany - contains should not interpret regex patterns" | "findMany - should find many models with ends_with operator" | "findMany - should find many models with contains operator" | "findMany - should handle multiple where conditions with different operators" | "findMany - should find many models with contains operator (using symbol)" | "findMany - should find many models with eq operator" | "findMany - should find many models with ne operator" | "findMany - should find many models with ne operator on id field" | "findMany - should find many models with ne operator on _id field (MongoDB)" | "findMany - should handle ne operator with null value on id field" | "findMany - should handle in operator with null value in array" | "findMany - should find many models with gt operator" | "findMany - should find many models with gte operator" | "findMany - should find many models with lte operator" | "findMany - should find many models with lt operator" | "findMany - should find many models with in operator" | "findMany - should find many models with not_in operator" | "findMany - should find many models with sortBy" | "findMany - should find many models with limit" | "findMany - should find many models with offset" | "findMany - should find many models with limit and offset" | "findMany - should find many models with sortBy and offset" | "findMany - should find many models with sortBy and limit" | "findMany - should find many models with sortBy and limit and offset" | "findMany - should find many models with sortBy and limit and offset and where" | "update - should update a model" | "updateMany - should update all models when where is empty" | "updateMany - should update many models with a specific where" | "updateMany - should update many models with a multiple where" | "delete - should delete a model" | "delete - should not throw on record not found" | "deleteMany - should delete many models" | "deleteMany - starts_with should not interpret regex patterns" | "deleteMany - ends_with should not interpret regex patterns" | "deleteMany - contains should not interpret regex patterns" | "deleteMany - should delete many models with numeric values" | "deleteMany - should delete many models with boolean values" | "count - should count many models" | "count - should return 0 with no rows to count" | "count - should count with where clause" | "update - should correctly return record when updating a field used in where clause" | "update - should handle updating multiple fields including where clause field" | "update - should work when updated field is not in where clause" | "create - should return a number id", boolean> & {
|
|
2
|
+
disableTests?: Partial<Record<"init - tests" | "create - should create a model" | "create - should always return an id" | "create - should return null for nullable foreign keys" | "create - should apply default values to fields" | "findOne - should find a model" | "findOne - should not apply defaultValue if value not found" | "findOne - should find a model using a reference field" | "findOne - should not throw on record not found" | "findOne - should find a model without id" | "findOne - should find a model with modified field name" | "findOne - should find a model with modified model name" | "findOne - should find a model with additional fields" | "findOne - should select fields" | "findOne - should find model with date field" | "findMany - should find many models with date fields" | "findMany - should find many models" | "findMany - should return an empty array when no models are found" | "findMany - should find many models with starts_with operator" | "findMany - starts_with should not interpret regex patterns" | "findMany - ends_with should not interpret regex patterns" | "findMany - contains should not interpret regex patterns" | "findMany - should find many models with ends_with operator" | "findMany - should find many models with contains operator" | "findMany - should handle multiple where conditions with different operators" | "findMany - should find many models with contains operator (using symbol)" | "findMany - should find many models with eq operator" | "findMany - should find many models with ne operator" | "findMany - should find many models with ne operator on id field" | "findMany - should find many models with ne operator on _id field (MongoDB)" | "findMany - should handle ne operator with null value on id field" | "findMany - should handle in operator with null value in array" | "findMany - should find many models with gt operator" | "findMany - should find many models with gte operator" | "findMany - should find many models with lte operator" | "findMany - should find many models with lt operator" | "findMany - should find many models with in operator" | "findMany - should find many models with not_in operator" | "findMany - should find many models with sortBy" | "findMany - should find many models with limit" | "findMany - should find many models with offset" | "findMany - should find many models with limit and offset" | "findMany - should find many models with sortBy and offset" | "findMany - should find many models with sortBy and limit" | "findMany - should find many models with sortBy and limit and offset" | "findMany - should find many models with sortBy and limit and offset and where" | "update - should update a model" | "updateMany - should update all models when where is empty" | "updateMany - should update many models with a specific where" | "updateMany - should update many models with a multiple where" | "updateMany - should return the number of updated models" | "delete - should delete a model" | "delete - should not throw on record not found" | "deleteMany - should delete many models" | "deleteMany - should return the number of deleted models" | "deleteMany - starts_with should not interpret regex patterns" | "deleteMany - ends_with should not interpret regex patterns" | "deleteMany - contains should not interpret regex patterns" | "deleteMany - should delete many models with numeric values" | "deleteMany - should delete many models with boolean values" | "count - should count many models" | "count - should return 0 with no rows to count" | "count - should count with where clause" | "update - should correctly return record when updating a field used in where clause" | "update - should handle updating multiple fields including where clause field" | "update - should work when updated field is not in where clause" | "create - should return a number id", boolean> & {
|
|
3
3
|
ALL?: boolean;
|
|
4
4
|
}> | undefined;
|
|
5
5
|
} | undefined) => (helpers: {
|
|
6
|
-
adapter: () => Promise<import("packages/core/dist/index-
|
|
6
|
+
adapter: () => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").nt<import("packages/core/dist/index-BL_t8cRp.mjs").g>>;
|
|
7
7
|
log: import("../test-adapter").Logger;
|
|
8
8
|
adapterDisplayName: string;
|
|
9
|
-
getPayvoAuthOptions: () => import("packages/core/dist/index-
|
|
10
|
-
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-
|
|
9
|
+
getPayvoAuthOptions: () => import("packages/core/dist/index-BL_t8cRp.mjs").g;
|
|
10
|
+
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-BL_t8cRp.mjs").g) => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").g>;
|
|
11
11
|
cleanup: () => Promise<void>;
|
|
12
12
|
runMigrations: () => Promise<void>;
|
|
13
13
|
prefixTests?: string | undefined;
|
|
@@ -10,11 +10,11 @@ export declare const performanceTestSuite: (options?: ({
|
|
|
10
10
|
userSeedCount?: number;
|
|
11
11
|
dialect?: string;
|
|
12
12
|
}) | undefined) => (helpers: {
|
|
13
|
-
adapter: () => Promise<import("packages/core/dist/index-
|
|
13
|
+
adapter: () => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").nt<import("packages/core/dist/index-BL_t8cRp.mjs").g>>;
|
|
14
14
|
log: import("../test-adapter").Logger;
|
|
15
15
|
adapterDisplayName: string;
|
|
16
|
-
getPayvoAuthOptions: () => import("packages/core/dist/index-
|
|
17
|
-
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-
|
|
16
|
+
getPayvoAuthOptions: () => import("packages/core/dist/index-BL_t8cRp.mjs").g;
|
|
17
|
+
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-BL_t8cRp.mjs").g) => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").g>;
|
|
18
18
|
cleanup: () => Promise<void>;
|
|
19
19
|
runMigrations: () => Promise<void>;
|
|
20
20
|
prefixTests?: string | undefined;
|
|
@@ -6,11 +6,11 @@ export declare const transactionsTestSuite: (options?: {
|
|
|
6
6
|
ALL?: boolean;
|
|
7
7
|
}> | undefined;
|
|
8
8
|
} | undefined) => (helpers: {
|
|
9
|
-
adapter: () => Promise<import("packages/core/dist/index-
|
|
9
|
+
adapter: () => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").nt<import("packages/core/dist/index-BL_t8cRp.mjs").g>>;
|
|
10
10
|
log: import("../test-adapter").Logger;
|
|
11
11
|
adapterDisplayName: string;
|
|
12
|
-
getPayvoAuthOptions: () => import("packages/core/dist/index-
|
|
13
|
-
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-
|
|
12
|
+
getPayvoAuthOptions: () => import("packages/core/dist/index-BL_t8cRp.mjs").g;
|
|
13
|
+
modifyPayvoAuthOptions: (options: import("packages/core/dist/index-BL_t8cRp.mjs").g) => Promise<import("packages/core/dist/index-BL_t8cRp.mjs").g>;
|
|
14
14
|
cleanup: () => Promise<void>;
|
|
15
15
|
runMigrations: () => Promise<void>;
|
|
16
16
|
prefixTests?: string | undefined;
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -3305,8 +3305,8 @@ export declare function getEndpoints<Option extends PayvoAuthOptions>(ctx: Promi
|
|
|
3305
3305
|
returnHeaders?: ReturnHeaders | undefined;
|
|
3306
3306
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
3307
3307
|
headers: Headers;
|
|
3308
|
-
response: import("packages/core/dist/index-
|
|
3309
|
-
} : import("packages/core/dist/index-
|
|
3308
|
+
response: import("packages/core/dist/index-BL_t8cRp.mjs").X;
|
|
3309
|
+
} : import("packages/core/dist/index-BL_t8cRp.mjs").X>;
|
|
3310
3310
|
options: {
|
|
3311
3311
|
method: "POST";
|
|
3312
3312
|
body: import("zod").ZodObject<{
|
|
@@ -3480,11 +3480,11 @@ export declare function getEndpoints<Option extends PayvoAuthOptions>(ctx: Promi
|
|
|
3480
3480
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
3481
3481
|
headers: Headers;
|
|
3482
3482
|
response: {
|
|
3483
|
-
user: import("packages/core/dist/index-
|
|
3483
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs").Z;
|
|
3484
3484
|
data: Record<string, any>;
|
|
3485
3485
|
} | null;
|
|
3486
3486
|
} : {
|
|
3487
|
-
user: import("packages/core/dist/index-
|
|
3487
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs").Z;
|
|
3488
3488
|
data: Record<string, any>;
|
|
3489
3489
|
} | null>;
|
|
3490
3490
|
options: {
|
|
@@ -6878,8 +6878,8 @@ export declare const router: <Option extends PayvoAuthOptions>(ctx: AuthContext,
|
|
|
6878
6878
|
returnHeaders?: ReturnHeaders | undefined;
|
|
6879
6879
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
6880
6880
|
headers: Headers;
|
|
6881
|
-
response: import("packages/core/dist/index-
|
|
6882
|
-
} : import("packages/core/dist/index-
|
|
6881
|
+
response: import("packages/core/dist/index-BL_t8cRp.mjs").X;
|
|
6882
|
+
} : import("packages/core/dist/index-BL_t8cRp.mjs").X>;
|
|
6883
6883
|
options: {
|
|
6884
6884
|
method: "POST";
|
|
6885
6885
|
body: import("zod").ZodObject<{
|
|
@@ -7053,11 +7053,11 @@ export declare const router: <Option extends PayvoAuthOptions>(ctx: AuthContext,
|
|
|
7053
7053
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
7054
7054
|
headers: Headers;
|
|
7055
7055
|
response: {
|
|
7056
|
-
user: import("packages/core/dist/index-
|
|
7056
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs").Z;
|
|
7057
7057
|
data: Record<string, any>;
|
|
7058
7058
|
} | null;
|
|
7059
7059
|
} : {
|
|
7060
|
-
user: import("packages/core/dist/index-
|
|
7060
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs").Z;
|
|
7061
7061
|
data: Record<string, any>;
|
|
7062
7062
|
} | null>;
|
|
7063
7063
|
options: {
|
|
@@ -976,11 +976,11 @@ export declare const admin: <O extends AdminOptions>(options?: O | undefined) =>
|
|
|
976
976
|
headers: Headers;
|
|
977
977
|
response: {
|
|
978
978
|
session: Session & Record<string, any>;
|
|
979
|
-
user: import("packages/core/dist/index-
|
|
979
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs")._t & Record<string, any>;
|
|
980
980
|
};
|
|
981
981
|
} : {
|
|
982
982
|
session: Session & Record<string, any>;
|
|
983
|
-
user: import("packages/core/dist/index-
|
|
983
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs")._t & Record<string, any>;
|
|
984
984
|
}>;
|
|
985
985
|
options: {
|
|
986
986
|
method: "POST";
|
|
@@ -1421,8 +1421,8 @@ export declare const apiKey: (options?: ApiKeyOptions | undefined) => {
|
|
|
1421
1421
|
required: false;
|
|
1422
1422
|
input: true;
|
|
1423
1423
|
transform: {
|
|
1424
|
-
input(value: import("packages/core/dist/index-
|
|
1425
|
-
output(value: import("packages/core/dist/index-
|
|
1424
|
+
input(value: import("packages/core/dist/index-BL_t8cRp.mjs").jt): string;
|
|
1425
|
+
output(value: import("packages/core/dist/index-BL_t8cRp.mjs").jt): any;
|
|
1426
1426
|
};
|
|
1427
1427
|
};
|
|
1428
1428
|
};
|
|
@@ -27,7 +27,7 @@ export declare const auditLog: (options?: AuditLogOptions | undefined) => {
|
|
|
27
27
|
} & Record<string, unknown>, context: import("@gatwech/core").GenericEndpointContext<import("@gatwech/core").PayvoAuthOptions> | undefined): Promise<void>;
|
|
28
28
|
};
|
|
29
29
|
update: {
|
|
30
|
-
|
|
30
|
+
after(user: {
|
|
31
31
|
id: string;
|
|
32
32
|
createdAt: Date;
|
|
33
33
|
updatedAt: Date;
|
|
@@ -35,18 +35,7 @@ export declare const auditLog: (options?: AuditLogOptions | undefined) => {
|
|
|
35
35
|
emailVerified: boolean;
|
|
36
36
|
name: string;
|
|
37
37
|
image?: string | null | undefined;
|
|
38
|
-
}
|
|
39
|
-
data: Partial<{
|
|
40
|
-
id: string;
|
|
41
|
-
createdAt: Date;
|
|
42
|
-
updatedAt: Date;
|
|
43
|
-
email: string;
|
|
44
|
-
emailVerified: boolean;
|
|
45
|
-
name: string;
|
|
46
|
-
image?: string | null | undefined;
|
|
47
|
-
}> & Record<string, unknown>;
|
|
48
|
-
}>;
|
|
49
|
-
after(user: {
|
|
38
|
+
} & Record<string, unknown>, context: import("@gatwech/core").GenericEndpointContext<import("@gatwech/core").PayvoAuthOptions> | undefined, data: (Partial<{
|
|
50
39
|
id: string;
|
|
51
40
|
createdAt: Date;
|
|
52
41
|
updatedAt: Date;
|
|
@@ -54,7 +43,7 @@ export declare const auditLog: (options?: AuditLogOptions | undefined) => {
|
|
|
54
43
|
emailVerified: boolean;
|
|
55
44
|
name: string;
|
|
56
45
|
image?: string | null | undefined;
|
|
57
|
-
} & Record<string, unknown
|
|
46
|
+
}> & Record<string, unknown>) | undefined): Promise<void>;
|
|
58
47
|
};
|
|
59
48
|
delete: {
|
|
60
49
|
after(user: {
|
|
@@ -597,6 +586,8 @@ export declare const auditLog: (options?: AuditLogOptions | undefined) => {
|
|
|
597
586
|
database: boolean;
|
|
598
587
|
trackFailedSignIns: boolean;
|
|
599
588
|
adminRoles: string[];
|
|
589
|
+
organizationAdminRoles: string[];
|
|
590
|
+
showAttemptsOnOwnAccount: boolean;
|
|
600
591
|
remote?: {
|
|
601
592
|
apiUrl?: string | undefined;
|
|
602
593
|
apiKey?: string | undefined;
|
|
@@ -13,8 +13,7 @@ export type RemoteQuery = {
|
|
|
13
13
|
organizationIds?: string[] | undefined;
|
|
14
14
|
};
|
|
15
15
|
interface RemoteSink {
|
|
16
|
-
push(event: AuditEvent,
|
|
17
|
-
flush(logger?: AuthContext["logger"]): Promise<void>;
|
|
16
|
+
push(event: AuditEvent, auth: AuthContext): void;
|
|
18
17
|
query(query: RemoteQuery): Promise<{
|
|
19
18
|
events: AuditEvent[];
|
|
20
19
|
total: number;
|
|
@@ -23,8 +22,9 @@ interface RemoteSink {
|
|
|
23
22
|
}>;
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* Sends each event to the hosted backend as it's recorded, in the
|
|
26
|
+
* background, so the auth flow never waits for it. Failures are retried, then
|
|
27
|
+
* logged and dropped.
|
|
28
28
|
*/
|
|
29
29
|
export declare function createRemoteSink(options: AuditLogOptions["remote"]): {
|
|
30
30
|
sink: RemoteSink | null;
|
|
@@ -64,6 +64,10 @@ export interface AuditLogOptions {
|
|
|
64
64
|
headers?: Record<string, string> | undefined;
|
|
65
65
|
/**
|
|
66
66
|
* Configure how events are batched before they are sent
|
|
67
|
+
*
|
|
68
|
+
* @deprecated Ignored: each event is sent as it's recorded, in the
|
|
69
|
+
* background. Use `advanced.backgroundTasks` to keep serverless
|
|
70
|
+
* functions alive until it's sent.
|
|
67
71
|
*/
|
|
68
72
|
batch?: {
|
|
69
73
|
/**
|
|
@@ -110,6 +114,24 @@ export interface AuditLogOptions {
|
|
|
110
114
|
* @default ["admin"]
|
|
111
115
|
*/
|
|
112
116
|
adminRoles?: string[] | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Organization member roles allowed to read the events of their
|
|
119
|
+
* organization through `/audit-log/get-all-audit-logs`
|
|
120
|
+
*
|
|
121
|
+
* @default ["owner", "admin"]
|
|
122
|
+
*/
|
|
123
|
+
organizationAdminRoles?: string[] | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Include failed sign-ins and security decisions made on a user's account
|
|
126
|
+
* before they were signed in in their own events. They are matched by the
|
|
127
|
+
* email that was typed, in lower case or as the user's email is stored, so
|
|
128
|
+
* anyone's attempt shows up; the IP address, user agent, visitor id and
|
|
129
|
+
* details are left out. Only the latest 50 events since the account was
|
|
130
|
+
* created are included.
|
|
131
|
+
*
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
134
|
+
showAttemptsOnOwnAccount?: boolean | undefined;
|
|
113
135
|
/**
|
|
114
136
|
* Custom schema for the audit log plugin
|
|
115
137
|
*/
|
|
@@ -70,7 +70,7 @@ export declare const emailOTP: (options: EmailOTPOptions) => {
|
|
|
70
70
|
options: {
|
|
71
71
|
emailVerification: {
|
|
72
72
|
sendVerificationEmail(data: {
|
|
73
|
-
user: import("packages/core/dist/index-
|
|
73
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs")._t;
|
|
74
74
|
url: string;
|
|
75
75
|
token: string;
|
|
76
76
|
}, request: Request | undefined): Promise<void>;
|
|
@@ -49,12 +49,12 @@ export declare const multiSession: (options?: MultiSessionConfig | undefined) =>
|
|
|
49
49
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
50
50
|
headers: Headers;
|
|
51
51
|
response: {
|
|
52
|
-
session: import("packages/core/dist/index-
|
|
53
|
-
user: import("packages/core/dist/index-
|
|
52
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt;
|
|
53
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs")._t;
|
|
54
54
|
}[];
|
|
55
55
|
} : {
|
|
56
|
-
session: import("packages/core/dist/index-
|
|
57
|
-
user: import("packages/core/dist/index-
|
|
56
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt;
|
|
57
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs")._t;
|
|
58
58
|
}[]>;
|
|
59
59
|
options: {
|
|
60
60
|
method: "GET";
|
|
@@ -105,12 +105,12 @@ export declare const multiSession: (options?: MultiSessionConfig | undefined) =>
|
|
|
105
105
|
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
106
106
|
headers: Headers;
|
|
107
107
|
response: {
|
|
108
|
-
session: import("packages/core/dist/index-
|
|
109
|
-
user: import("packages/core/dist/index-
|
|
108
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & Record<string, any>;
|
|
109
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs")._t & Record<string, any>;
|
|
110
110
|
};
|
|
111
111
|
} : {
|
|
112
|
-
session: import("packages/core/dist/index-
|
|
113
|
-
user: import("packages/core/dist/index-
|
|
112
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & Record<string, any>;
|
|
113
|
+
user: import("packages/core/dist/index-BL_t8cRp.mjs")._t & Record<string, any>;
|
|
114
114
|
}>;
|
|
115
115
|
options: {
|
|
116
116
|
method: "POST";
|
|
@@ -55,7 +55,7 @@ export declare const createOrgRole: <O extends OrganizationOptions>(options: O)
|
|
|
55
55
|
}>)[];
|
|
56
56
|
}>) => Promise<{
|
|
57
57
|
session: {
|
|
58
|
-
session: import("packages/core/dist/index-
|
|
58
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
59
59
|
activeTeamId?: string | undefined;
|
|
60
60
|
activeOrganizationId?: string | undefined;
|
|
61
61
|
};
|
|
@@ -114,7 +114,7 @@ export declare const createOrgRole: <O extends OrganizationOptions>(options: O)
|
|
|
114
114
|
}>)[];
|
|
115
115
|
}>) => Promise<{
|
|
116
116
|
session: {
|
|
117
|
-
session: import("packages/core/dist/index-
|
|
117
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
118
118
|
activeTeamId?: string | undefined;
|
|
119
119
|
activeOrganizationId?: string | undefined;
|
|
120
120
|
};
|
|
@@ -199,7 +199,7 @@ export declare const createOrgRole: <O extends OrganizationOptions>(options: O)
|
|
|
199
199
|
}>)[];
|
|
200
200
|
}>) => Promise<{
|
|
201
201
|
session: {
|
|
202
|
-
session: import("packages/core/dist/index-
|
|
202
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
203
203
|
activeTeamId?: string | undefined;
|
|
204
204
|
activeOrganizationId?: string | undefined;
|
|
205
205
|
};
|
|
@@ -310,7 +310,7 @@ export declare const createOrgRole: <O extends OrganizationOptions>(options: O)
|
|
|
310
310
|
}>)[];
|
|
311
311
|
}>) => Promise<{
|
|
312
312
|
session: {
|
|
313
|
-
session: import("packages/core/dist/index-
|
|
313
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
314
314
|
activeTeamId?: string | undefined;
|
|
315
315
|
activeOrganizationId?: string | undefined;
|
|
316
316
|
};
|
|
@@ -391,7 +391,7 @@ export declare const deleteOrgRole: <O extends OrganizationOptions>(options: O)
|
|
|
391
391
|
}>)[];
|
|
392
392
|
}>) => Promise<{
|
|
393
393
|
session: {
|
|
394
|
-
session: import("packages/core/dist/index-
|
|
394
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
395
395
|
activeTeamId?: string | undefined;
|
|
396
396
|
activeOrganizationId?: string | undefined;
|
|
397
397
|
};
|
|
@@ -481,7 +481,7 @@ export declare const listOrgRoles: <O extends OrganizationOptions>(options: O) =
|
|
|
481
481
|
}>)[];
|
|
482
482
|
}>) => Promise<{
|
|
483
483
|
session: {
|
|
484
|
-
session: import("packages/core/dist/index-
|
|
484
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
485
485
|
activeTeamId?: string | undefined;
|
|
486
486
|
activeOrganizationId?: string | undefined;
|
|
487
487
|
};
|
|
@@ -567,7 +567,7 @@ export declare const getOrgRole: <O extends OrganizationOptions>(options: O) =>
|
|
|
567
567
|
}>)[];
|
|
568
568
|
}>) => Promise<{
|
|
569
569
|
session: {
|
|
570
|
-
session: import("packages/core/dist/index-
|
|
570
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
571
571
|
activeTeamId?: string | undefined;
|
|
572
572
|
activeOrganizationId?: string | undefined;
|
|
573
573
|
};
|
|
@@ -686,7 +686,7 @@ export declare const updateOrgRole: <O extends OrganizationOptions>(options: O)
|
|
|
686
686
|
}>)[];
|
|
687
687
|
}>) => Promise<{
|
|
688
688
|
session: {
|
|
689
|
-
session: import("packages/core/dist/index-
|
|
689
|
+
session: import("packages/core/dist/index-BL_t8cRp.mjs").bt & {
|
|
690
690
|
activeTeamId?: string | undefined;
|
|
691
691
|
activeOrganizationId?: string | undefined;
|
|
692
692
|
};
|