@happyvertical/smrt-users 0.52.0 → 0.53.5
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/AGENTS.md +43 -2
- package/README.md +227 -2
- package/agents/permissions.md +12 -1
- package/agents/retention.md +14 -7
- package/dist/chunks/{TerminalAuthService-Br64vHtd.js → TerminalAuthService-BdB_0vDA.js} +3492 -2172
- package/dist/chunks/TerminalAuthService-BdB_0vDA.js.map +1 -0
- package/dist/collections/CliAuthApproveLimitCollection.d.ts +4 -0
- package/dist/collections/CliAuthApproveLimitCollection.d.ts.map +1 -1
- package/dist/collections/CliAuthRequestCollection.d.ts.map +1 -1
- package/dist/collections/LoginAttemptCollection.d.ts +105 -0
- package/dist/collections/LoginAttemptCollection.d.ts.map +1 -0
- package/dist/collections/LoginAuditEventCollection.d.ts +19 -0
- package/dist/collections/LoginAuditEventCollection.d.ts.map +1 -0
- package/dist/collections/PinCredentialCollection.d.ts +26 -0
- package/dist/collections/PinCredentialCollection.d.ts.map +1 -0
- package/dist/collections/RoleCollection.d.ts.map +1 -1
- package/dist/collections/RolePermissionCollection.d.ts +4 -0
- package/dist/collections/RolePermissionCollection.d.ts.map +1 -1
- package/dist/collections/SessionCollection.d.ts +33 -1
- package/dist/collections/SessionCollection.d.ts.map +1 -1
- package/dist/collections/index.d.ts +3 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/collections/seeding-transaction.d.ts +43 -0
- package/dist/collections/seeding-transaction.d.ts.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +180 -32
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +3281 -2018
- package/dist/migrations/deduplicateRolePermissions.d.ts +23 -0
- package/dist/migrations/deduplicateRolePermissions.d.ts.map +1 -0
- package/dist/models/CliAuthApproveLimit.d.ts +8 -1
- package/dist/models/CliAuthApproveLimit.d.ts.map +1 -1
- package/dist/models/LoginAttempt.d.ts +59 -0
- package/dist/models/LoginAttempt.d.ts.map +1 -0
- package/dist/models/LoginAuditEvent.d.ts +49 -0
- package/dist/models/LoginAuditEvent.d.ts.map +1 -0
- package/dist/models/PinCredential.d.ts +31 -0
- package/dist/models/PinCredential.d.ts.map +1 -0
- package/dist/models/RolePermission.d.ts.map +1 -1
- package/dist/models/Session.d.ts +69 -1
- package/dist/models/Session.d.ts.map +1 -1
- package/dist/models/index.d.ts +4 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/retention.d.ts +7 -1
- package/dist/retention.d.ts.map +1 -1
- package/dist/services/DeviceCredentialService.d.ts +348 -0
- package/dist/services/DeviceCredentialService.d.ts.map +1 -0
- package/dist/services/LoginAttemptLimiter.d.ts +227 -0
- package/dist/services/LoginAttemptLimiter.d.ts.map +1 -0
- package/dist/services/MobileAuthService.d.ts.map +1 -1
- package/dist/services/OperationPermissionService.d.ts.map +1 -1
- package/dist/services/PermissionCatalogService.d.ts.map +1 -1
- package/dist/services/SessionPermissionContext.d.ts.map +1 -1
- package/dist/services/SessionService.d.ts +56 -1
- package/dist/services/SessionService.d.ts.map +1 -1
- package/dist/services/TerminalAuthService.d.ts +18 -3
- package/dist/services/TerminalAuthService.d.ts.map +1 -1
- package/dist/services/index.d.ts +4 -2
- package/dist/services/index.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +685 -11
- package/dist/sveltekit/device-credential-handlers.d.ts +60 -0
- package/dist/sveltekit/device-credential-handlers.d.ts.map +1 -0
- package/dist/sveltekit/index.d.ts +10 -0
- package/dist/sveltekit/index.d.ts.map +1 -1
- package/dist/sveltekit/types.d.ts +6 -0
- package/dist/sveltekit/types.d.ts.map +1 -1
- package/dist/sveltekit.js +184 -4
- package/dist/sveltekit.js.map +1 -1
- package/package.json +13 -13
- package/dist/__tests__/helpers/oidc-test-server.d.ts +0 -45
- package/dist/__tests__/helpers/oidc-test-server.d.ts.map +0 -1
- package/dist/__tests__/helpers/postgres-rls-reset.d.ts +0 -15
- package/dist/__tests__/helpers/postgres-rls-reset.d.ts.map +0 -1
- package/dist/chunks/TerminalAuthService-Br64vHtd.js.map +0 -1
- package/dist/svelte/components/__tests__/InviteUserModal.test.js +0 -65
- package/dist/svelte/components/__tests__/UserAvatar.test.js +0 -31
- package/dist/svelte/components/__tests__/UserCard.test.js +0 -39
- package/dist/svelte/components/__tests__/UserForm.test.js +0 -50
- package/dist/svelte/components/__tests__/UserList.test.js +0 -48
- package/dist/svelte/components/__tests__/UserMenu.test.js +0 -83
- package/dist/svelte/components/__tests__/UserStatus.test.js +0 -36
|
@@ -12,6 +12,10 @@ export type CliAuthApproveReservation = {
|
|
|
12
12
|
allowed: false;
|
|
13
13
|
retryAfterSeconds: number;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Since #3273. Use {@link UsersLoginAttemptCollection} through
|
|
17
|
+
* `LoginAttemptLimiter`. Kept for schema and cleanup compatibility only.
|
|
18
|
+
*/
|
|
15
19
|
export declare class UsersCliAuthApproveLimitCollection extends SmrtCollection<UsersCliAuthApproveLimit> {
|
|
16
20
|
static readonly _itemClass: typeof UsersCliAuthApproveLimit;
|
|
17
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliAuthApproveLimitCollection.d.ts","sourceRoot":"","sources":["../../src/collections/CliAuthApproveLimitCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,MAAM,yBAAyB,GACjC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,qBAAa,kCAAmC,SAAQ,cAAc,CAAC,wBAAwB,CAAC;IAC9F,MAAM,CAAC,QAAQ,CAAC,UAAU,kCAA4B;IAEtD;;;OAGG;IACG,cAAc,CAAC,KAAK,EAAE;QAC1B,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAmEtC,+EAA+E;IACzE,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB7E"}
|
|
1
|
+
{"version":3,"file":"CliAuthApproveLimitCollection.d.ts","sourceRoot":"","sources":["../../src/collections/CliAuthApproveLimitCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,MAAM,yBAAyB,GACjC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD;;;GAGG;AACH,qBAAa,kCAAmC,SAAQ,cAAc,CAAC,wBAAwB,CAAC;IAC9F,MAAM,CAAC,QAAQ,CAAC,UAAU,kCAA4B;IAEtD;;;OAGG;IACG,cAAc,CAAC,KAAK,EAAE;QAC1B,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAmEtC,+EAA+E;IACzE,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliAuthRequestCollection.d.ts","sourceRoot":"","sources":["../../src/collections/CliAuthRequestCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,MAAM,WAAW,iCAAiC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,IAAI,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,mBAAmB,CAAC;IACpF,MAAM,CAAC,QAAQ,CAAC,UAAU,6BAAuB;IAEjD;;;;;;;OAOG;IACG,qBAAqB,CACzB,KAAK,EAAE,iCAAiC,GACvC,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"CliAuthRequestCollection.d.ts","sourceRoot":"","sources":["../../src/collections/CliAuthRequestCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,MAAM,WAAW,iCAAiC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,IAAI,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,mBAAmB,CAAC;IACpF,MAAM,CAAC,QAAQ,CAAC,UAAU,6BAAuB;IAEjD;;;;;;;OAOG;IACG,qBAAqB,CACzB,KAAK,EAAE,iCAAiC,GACvC,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAAC;IAiEjD;;;;;;;OAOG;IACG,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAiC5E;;OAEG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAQ3E;;OAEG;IACG,oBAAoB,CACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAQtC;;;;;;;;;OASG;IACG,aAAa,CAAC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CAyBzE;AAED,OAAO,EAAE,6BAA6B,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atomic shared-storage primitives behind {@link LoginAttemptLimiter}.
|
|
3
|
+
*
|
|
4
|
+
* Every mutation here is a single conditional statement so concurrent
|
|
5
|
+
* attempts across replicas cannot all pass the budget check before any one
|
|
6
|
+
* of them records its failure. Keys arrive already hashed.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
11
|
+
import { type LoginAttemptScope, UsersLoginAttempt } from '../models/LoginAttempt.js';
|
|
12
|
+
/** Result of {@link UsersLoginAttemptCollection.reserveAttempt}. */
|
|
13
|
+
export type LoginAttemptReservation = {
|
|
14
|
+
allowed: true;
|
|
15
|
+
attemptCount: number;
|
|
16
|
+
windowStartedAt: string;
|
|
17
|
+
} | {
|
|
18
|
+
allowed: false;
|
|
19
|
+
retryAfterSeconds: number;
|
|
20
|
+
lockedOut: boolean;
|
|
21
|
+
};
|
|
22
|
+
export interface ReserveLoginAttemptInput {
|
|
23
|
+
limiterKey: string;
|
|
24
|
+
scope: LoginAttemptScope;
|
|
25
|
+
maxAttempts: number;
|
|
26
|
+
windowMs: number;
|
|
27
|
+
/**
|
|
28
|
+
* A key whose last failure is older than this has its failure streak
|
|
29
|
+
* forgiven on the next reservation, so an old lockout history does not
|
|
30
|
+
* haunt a key forever.
|
|
31
|
+
*/
|
|
32
|
+
streakResetMs: number;
|
|
33
|
+
/** How long after this write the row must survive the retention sweep. */
|
|
34
|
+
retainMs: number;
|
|
35
|
+
}
|
|
36
|
+
export interface RecordLoginFailureInput {
|
|
37
|
+
limiterKey: string;
|
|
38
|
+
maxAttempts: number;
|
|
39
|
+
/** How long after this write the row must survive the retention sweep. */
|
|
40
|
+
retainMs: number;
|
|
41
|
+
/**
|
|
42
|
+
* When positive, one earlier failure is forgiven for each full interval of
|
|
43
|
+
* this length since the key's last failure, before this one is counted.
|
|
44
|
+
* Used for shared sources so ordinary, spaced-out mistakes never accumulate
|
|
45
|
+
* while a burst still escalates.
|
|
46
|
+
*/
|
|
47
|
+
streakDecayMs?: number;
|
|
48
|
+
/** Returns the lockout length for the n-th consecutive exhausted budget (0-based), or 0 for none. */
|
|
49
|
+
lockoutMsFor: (exhaustedBudgets: number) => number;
|
|
50
|
+
}
|
|
51
|
+
export interface RecordedLoginFailure {
|
|
52
|
+
failureStreak: number;
|
|
53
|
+
lockedUntil: string | null;
|
|
54
|
+
}
|
|
55
|
+
export declare class UsersLoginAttemptCollection extends SmrtCollection<UsersLoginAttempt> {
|
|
56
|
+
static readonly _itemClass: typeof UsersLoginAttempt;
|
|
57
|
+
/**
|
|
58
|
+
* Atomically reserve one attempt for a key across every process using this
|
|
59
|
+
* database. Failed attempts retain their reservation (see
|
|
60
|
+
* {@link recordFailure}); successful or aborted attempts release it.
|
|
61
|
+
*/
|
|
62
|
+
reserveAttempt(input: ReserveLoginAttemptInput): Promise<LoginAttemptReservation>;
|
|
63
|
+
/**
|
|
64
|
+
* Record that a reserved attempt failed authentication. The reservation is
|
|
65
|
+
* kept (it already counts against the window); the streak advances, and if
|
|
66
|
+
* this failure exhausted the window's budget or completed another
|
|
67
|
+
* `maxAttempts` consecutive failures the key is locked for the backoff the
|
|
68
|
+
* caller computes from how many budgets in a row have been exhausted.
|
|
69
|
+
*/
|
|
70
|
+
recordFailure(input: RecordLoginFailureInput): Promise<RecordedLoginFailure>;
|
|
71
|
+
/** Count one more consecutive failure for a key. */
|
|
72
|
+
private advanceStreak;
|
|
73
|
+
/**
|
|
74
|
+
* Count one more failure after forgiving one earlier failure per full
|
|
75
|
+
* `streakDecayMs` since the key's last failure. The elapsed time is
|
|
76
|
+
* computed here rather than in SQL so it is identical on every engine. When
|
|
77
|
+
* nothing is forgiven the write is the plain atomic increment. Otherwise it
|
|
78
|
+
* is a compare-and-set on BOTH values the forgiveness was computed from —
|
|
79
|
+
* the streak and the last-failure time — so concurrent failures cannot
|
|
80
|
+
* each apply the same forgiveness: the loser re-reads, finds the last
|
|
81
|
+
* failure is now, forgives nothing and increments. (The streak alone is not
|
|
82
|
+
* a sufficient guard: forgiving one and adding one writes the same number
|
|
83
|
+
* back.) After repeated conflicts it falls back to the plain increment.
|
|
84
|
+
*/
|
|
85
|
+
private advanceDecayedStreak;
|
|
86
|
+
/**
|
|
87
|
+
* Release the reservation for an attempt that did not fail authentication.
|
|
88
|
+
* Deliberately leaves in-window failures in place — a success must not
|
|
89
|
+
* refill the budget mid-window (see the terminal-auth tests).
|
|
90
|
+
*/
|
|
91
|
+
releaseAttempt(limiterKey: string, windowStartedAt: string, options?: {
|
|
92
|
+
resetStreak?: boolean;
|
|
93
|
+
}): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Delete rows that are not locked out and are past the horizon the limiter
|
|
96
|
+
* that last wrote them recorded in `retain_until` (retention sweep), so a
|
|
97
|
+
* limiter configured with a longer window or streak horizon than the
|
|
98
|
+
* defaults never has a live budget erased. Returns the number removed (or,
|
|
99
|
+
* under `dryRun`, matched).
|
|
100
|
+
*/
|
|
101
|
+
deleteIdle(options?: {
|
|
102
|
+
dryRun?: boolean;
|
|
103
|
+
}): Promise<number>;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=LoginAttemptCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginAttemptCollection.d.ts","sourceRoot":"","sources":["../../src/collections/LoginAttemptCollection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,KAAK,iBAAiB,EACtB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAC/B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtE,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qGAAqG;IACrG,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAeD,qBAAa,2BAA4B,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,UAAU,2BAAqB;IAE/C;;;;OAIG;IACG,cAAc,CAClB,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAsGnC;;;;;;OAMG;IACG,aAAa,CACjB,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,oBAAoB,CAAC;IA6DhC,oDAAoD;YACtC,aAAa;IAmB3B;;;;;;;;;;;OAWG;YACW,oBAAoB;IA2ClC;;;;OAIG;IACG,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAO,GACtC,OAAO,CAAC,IAAI,CAAC;IA0BhB;;;;;;OAMG;IACG,UAAU,CAAC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CAoBtE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection for {@link UsersLoginAuditEvent} — the default login audit sink's
|
|
3
|
+
* storage, plus the retention primitive.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
8
|
+
import { UsersLoginAuditEvent } from '../models/LoginAuditEvent.js';
|
|
9
|
+
export declare class UsersLoginAuditEventCollection extends SmrtCollection<UsersLoginAuditEvent> {
|
|
10
|
+
static readonly _itemClass: typeof UsersLoginAuditEvent;
|
|
11
|
+
/**
|
|
12
|
+
* Delete events older than `maxAgeMs` (retention sweep). Returns the number
|
|
13
|
+
* removed (or, under `dryRun`, matched).
|
|
14
|
+
*/
|
|
15
|
+
deleteOlderThan(maxAgeMs: number, options?: {
|
|
16
|
+
dryRun?: boolean;
|
|
17
|
+
}): Promise<number>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=LoginAuditEventCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginAuditEventCollection.d.ts","sourceRoot":"","sources":["../../src/collections/LoginAuditEventCollection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,qBAAa,8BAA+B,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IACtF,MAAM,CAAC,QAAQ,CAAC,UAAU,8BAAwB;IAElD;;;OAGG;IACG,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GACjC,OAAO,CAAC,MAAM,CAAC;CAgBnB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection for {@link UsersPinCredential} (#3276).
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
7
|
+
import { UsersPinCredential } from '../models/PinCredential.js';
|
|
8
|
+
export interface PinCredentialWrite {
|
|
9
|
+
pinHash: string;
|
|
10
|
+
mustReset: boolean;
|
|
11
|
+
rotatedAt: Date;
|
|
12
|
+
rotatedBy: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class UsersPinCredentialCollection extends SmrtCollection<UsersPinCredential> {
|
|
15
|
+
static readonly _itemClass: typeof UsersPinCredential;
|
|
16
|
+
findByUserId(userId: string): Promise<UsersPinCredential | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Create or replace the one credential row for `userId`, bumping `version`
|
|
19
|
+
* on replace. Save conflicts from a concurrent set are retried once by
|
|
20
|
+
* re-reading; the last writer wins, which is the intended semantics for a
|
|
21
|
+
* credential rotation.
|
|
22
|
+
*/
|
|
23
|
+
upsertForUser(userId: string, write: PinCredentialWrite): Promise<UsersPinCredential>;
|
|
24
|
+
deleteByUserId(userId: string): Promise<boolean>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=PinCredentialCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinCredentialCollection.d.ts","sourceRoot":"","sources":["../../src/collections/PinCredentialCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IAClF,MAAM,CAAC,QAAQ,CAAC,UAAU,4BAAsB;IAE1C,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAKtE;;;;;OAKG;IACG,aAAa,CACjB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,kBAAkB,CAAC;IAoCxB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAMvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoleCollection.d.ts","sourceRoot":"","sources":["../../src/collections/RoleCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"RoleCollection.d.ts","sourceRoot":"","sources":["../../src/collections/RoleCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,cAAc,EAEf,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,0BAA0B,EAAE,SAAS,CAAC;IACnD,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,cAAc,CAAC,IAAI,CAAC;IACtD,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAQ;IAElC;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAOxC;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IASrD;;OAEG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAOxD;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAoBvE,4EAA4E;IACtE,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAQ9D;;OAEG;IACG,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAmF7E"}
|
|
@@ -84,6 +84,10 @@ export declare class RolePermissionCollection extends SmrtCollection<RolePermiss
|
|
|
84
84
|
* Defaults to the system owner/admin/member/viewer matrix. Re-running is
|
|
85
85
|
* idempotent: existing mappings are reported as `unchanged`, new catalog
|
|
86
86
|
* slugs are added, and stale mappings are only removed when `prune` is true.
|
|
87
|
+
*
|
|
88
|
+
* Grants and revocations are planned from one read per role, then committed
|
|
89
|
+
* in batches rather than one durable commit per row (#3323). Inside a
|
|
90
|
+
* caller transaction, pass that transaction's handle.
|
|
87
91
|
*/
|
|
88
92
|
seedRolePermissions(matrix?: RolePermissionPatternMatrix, options?: SeedRolePermissionsOptions): Promise<SeedRolePermissionsResult>;
|
|
89
93
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RolePermissionCollection.d.ts","sourceRoot":"","sources":["../../src/collections/RolePermissionCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"RolePermissionCollection.d.ts","sourceRoot":"","sources":["../../src/collections/RolePermissionCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAK7E,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAClC,CAAC;AAEF,MA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AAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,CAAC;IAa1B;;;;;;;;;;;;;;OAcG;YACW,eAAe;IAO7B;;OAEG;IACG,gBAAgB,CACpB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC;IAanB;;OAEG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAWzD;;;;;;;;;;OAUG;IACG,mBAAmB,CACvB,MAAM,GAAE,2BAA8D,EACtE,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,yBAAyB,CAAC;IA0IrC;;;;;OAKG;IACG,yCAAyC,CAC7C,OAAO,GAAE,IAAI,CAAC,0BAA0B,EAAE,OAAO,CAAM,GACtD,OAAO,CAAC,yBAAyB,CAAC;CAWtC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
6
|
-
import { Session } from '../models/Session.js';
|
|
6
|
+
import { Session, type SessionAuthMethod } from '../models/Session.js';
|
|
7
7
|
/**
|
|
8
8
|
* Options for creating a new session
|
|
9
9
|
*/
|
|
@@ -20,6 +20,10 @@ export interface CreateSessionOptions {
|
|
|
20
20
|
ipAddress?: string;
|
|
21
21
|
/** Custom session data */
|
|
22
22
|
data?: Record<string, unknown>;
|
|
23
|
+
/** How the session was established (server-set; see {@link SessionAuthMethod}). */
|
|
24
|
+
authMethod?: SessionAuthMethod | null;
|
|
25
|
+
/** Parent session this one is layered on; the child is valid only while the parent is. */
|
|
26
|
+
parentSessionId?: string | null;
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
29
|
* Collection for managing Session objects
|
|
@@ -31,6 +35,34 @@ export declare class SessionCollection extends SmrtCollection<Session> {
|
|
|
31
35
|
* Create a new session with a secure ID
|
|
32
36
|
*/
|
|
33
37
|
createSession(options: CreateSessionOptions): Promise<Session>;
|
|
38
|
+
/**
|
|
39
|
+
* Active sessions layered on `parentSessionId` (e.g. every person signed in
|
|
40
|
+
* on one enrolled device). Expired rows are filtered out.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Ids of ACTIVE sessions matching `column = value`, read with raw SQL so a
|
|
44
|
+
* caller's `defaultListLimit`/`maxListLimit` can never truncate a
|
|
45
|
+
* revocation sweep: a dropped row is a session left authorized.
|
|
46
|
+
*/
|
|
47
|
+
private activeSessionIds;
|
|
48
|
+
findChildren(parentSessionId: string): Promise<Session[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Revoke every active session layered on `parentSessionId`. Children are
|
|
51
|
+
* already invalid once the parent is gone (liveness rule), so this is a
|
|
52
|
+
* tidy-up that makes "manage sessions" views and audits truthful. With
|
|
53
|
+
* `exceptSessionId` it ends every *other* child — how a single-occupant
|
|
54
|
+
* device hands over from one person to the next.
|
|
55
|
+
*/
|
|
56
|
+
revokeChildren(parentSessionId: string, options?: {
|
|
57
|
+
exceptSessionId?: string;
|
|
58
|
+
}): Promise<number>;
|
|
59
|
+
/**
|
|
60
|
+
* Revoke a user's active sessions established through one auth method
|
|
61
|
+
* (e.g. every `pin` session after an admin PIN reset).
|
|
62
|
+
*/
|
|
63
|
+
revokeUserSessionsByAuthMethod(userId: string, authMethod: SessionAuthMethod, options?: {
|
|
64
|
+
exceptSessionId?: string;
|
|
65
|
+
}): Promise<number>;
|
|
34
66
|
/**
|
|
35
67
|
* Find a valid session by ID
|
|
36
68
|
* Returns null if session doesn't exist, is expired, or is revoked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionCollection.d.ts","sourceRoot":"","sources":["../../src/collections/SessionCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"SessionCollection.d.ts","sour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"}
|
|
@@ -8,10 +8,13 @@ export { CliAuthRequestCollection, UsersCliAuthRequestCollection, } from './CliA
|
|
|
8
8
|
export { GroupCollection } from './GroupCollection.js';
|
|
9
9
|
export { GroupMemberCollection } from './GroupMemberCollection.js';
|
|
10
10
|
export { GroupRoleCollection } from './GroupRoleCollection.js';
|
|
11
|
+
export { type LoginAttemptReservation, type RecordedLoginFailure, type RecordLoginFailureInput, type ReserveLoginAttemptInput, UsersLoginAttemptCollection, } from './LoginAttemptCollection.js';
|
|
12
|
+
export { UsersLoginAuditEventCollection } from './LoginAuditEventCollection.js';
|
|
11
13
|
export { MagicLinkTokenCollection, UsersMagicLinkTokenCollection, } from './MagicLinkTokenCollection.js';
|
|
12
14
|
export { MembershipCollection } from './MembershipCollection.js';
|
|
13
15
|
export { MembershipOverrideCollection } from './MembershipOverrideCollection.js';
|
|
14
16
|
export { PermissionCollection } from './PermissionCollection.js';
|
|
17
|
+
export { type PinCredentialWrite, UsersPinCredentialCollection, } from './PinCredentialCollection.js';
|
|
15
18
|
export { ResourceGrantCollection } from './ResourceGrantCollection.js';
|
|
16
19
|
export { RoleCollection, type SeedSystemRolesOptions, } from './RoleCollection.js';
|
|
17
20
|
export { DEFAULT_ROLE_PERMISSION_PATTERNS, RolePermissionCollection, type RolePermissionPatternMatrix, type SeedRolePermissionsOptions, type SeedRolePermissionsResult, } from './RolePermissionCollection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EACL,KAAK,yBAAyB,EAC9B,kCAAkC,GACnC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OA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4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,cAAc,EACd,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gCAAgC,EAChC,wBAAwB,EACxB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,GAC/B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,KAAK,oBAAoB,EACzB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,wBAAwB,EAC7B,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EACL,kCAAkC,EAClC,KAAK,8BAA8B,GACpC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,iCAAiC,EACtC,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,cAAc,GACf,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batched commits for permission-catalog and role-permission seeding.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
import type { DatabaseInterface } from '@happyvertical/sql';
|
|
6
|
+
/**
|
|
7
|
+
* Rows a seeding pass writes per transaction (#3323).
|
|
8
|
+
*
|
|
9
|
+
* A cold seed writes every catalog permission and every default grant, each
|
|
10
|
+
* with a change-feed append: thousands of rows on a real registry. When every
|
|
11
|
+
* row autocommits, each is a separate durable commit. On a file-backed SQLite
|
|
12
|
+
* database with `synchronous = FULL` (the local runtime profile), that is an
|
|
13
|
+
* `fsync` per row, and disk flushes, not queries, set the bootstrap's wall
|
|
14
|
+
* clock. Batching cuts the commits by this factor.
|
|
15
|
+
*
|
|
16
|
+
* The batch is bounded, not the whole seed, because a transaction scope in
|
|
17
|
+
* `@happyvertical/sql` tracks every promise created while it is open and
|
|
18
|
+
* keeps each statement's rejection observation until the transaction ends,
|
|
19
|
+
* so its per-statement cost grows with the statements already issued. On the
|
|
20
|
+
* local owner claim, one catalog-wide transaction took ~17s against ~4.5s for
|
|
21
|
+
* batches of 25-100 rows (and ~30s for per-row commits on a real disk).
|
|
22
|
+
*/
|
|
23
|
+
export declare const SEEDING_BATCH_SIZE = 50;
|
|
24
|
+
/**
|
|
25
|
+
* Write `items` in transactions of at most {@link SEEDING_BATCH_SIZE} rows.
|
|
26
|
+
*
|
|
27
|
+
* Seeding is idempotent and additive, so committing per batch keeps the
|
|
28
|
+
* semantics of the previous per-row commits: an interrupted pass leaves only
|
|
29
|
+
* complete rows behind, and re-running converges. `write` receives the handle
|
|
30
|
+
* bound to its batch's transaction and must issue every write through it.
|
|
31
|
+
*
|
|
32
|
+
* Nesting follows `@happyvertical/sql`'s rules. Given a transaction handle,
|
|
33
|
+
* SQLite and PostgreSQL re-enter it under a SAVEPOINT, and adapters without
|
|
34
|
+
* savepoints (DuckDB/JSON) reuse the caller's transaction directly. A handle
|
|
35
|
+
* with no `transaction()` keeps per-statement commits. A caller already inside
|
|
36
|
+
* a transaction must pass that transaction's handle: on a single-connection
|
|
37
|
+
* adapter the root handle waits for the open transaction instead of joining
|
|
38
|
+
* it.
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare function writeInSeedingBatches<T>(db: DatabaseInterface, items: readonly T[], write: (database: DatabaseInterface, batch: readonly T[]) => Promise<void>): Promise<void>;
|
|
43
|
+
//# sourceMappingURL=seeding-transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeding-transaction.d.ts","sourceRoot":"","sources":["../../src/collections/seeding-transaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,EAC3C,EAAE,EAAE,iBAAiB,EACrB,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GACzE,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
package/dist/index.d.ts
CHANGED
|
@@ -54,13 +54,14 @@
|
|
|
54
54
|
* @packageDocumentation
|
|
55
55
|
*/
|
|
56
56
|
import './__smrt-register__.js';
|
|
57
|
-
export { AccessRequestCollection, type CliAuthApproveReservation, CliAuthRequestCollection, type CreateChildTenantOptions, type CreateSessionOptions, DEFAULT_ROLE_PERMISSION_PATTERNS, type GetOrCreateFromOidcOptions, GroupCollection, GroupMemberCollection, GroupRoleCollection, MagicLinkTokenCollection, MembershipCollection, MembershipOverrideCollection, type NormalizedOidcClaims, type OidcClaims, type OidcIdentityResult, type OidcProfileOwnerAuthorization, type OidcProfileOwnerAuthorizer, type OidcProfileOwnerAuthorizerContext, type OidcProfileResolver, type OidcProfileResolverContext, OidcProvisioningError, type OidcProvisioningErrorCode, PermissionCollection, ResourceGrantCollection, RoleCollection, RolePermissionCollection, type RolePermissionPatternMatrix, type SeedRolePermissionsOptions, type SeedRolePermissionsResult, type SeedSystemRolesOptions, SessionCollection, TenantCollection, TenantHierarchyError, TenantIntegrationCollection, TenantPermissionOverrideCollection, type TenantPermissionOverrideResult, UserCollection, UsersCliAuthApproveLimitCollection, UsersCliAuthRequestCollection, UsersMagicLinkTokenCollection, } from './collections/index.js';
|
|
57
|
+
export { AccessRequestCollection, type CliAuthApproveReservation, CliAuthRequestCollection, type CreateChildTenantOptions, type CreateSessionOptions, DEFAULT_ROLE_PERMISSION_PATTERNS, type GetOrCreateFromOidcOptions, GroupCollection, GroupMemberCollection, GroupRoleCollection, MagicLinkTokenCollection, MembershipCollection, MembershipOverrideCollection, type NormalizedOidcClaims, type OidcClaims, type OidcIdentityResult, type OidcProfileOwnerAuthorization, type OidcProfileOwnerAuthorizer, type OidcProfileOwnerAuthorizerContext, type OidcProfileResolver, type OidcProfileResolverContext, OidcProvisioningError, type OidcProvisioningErrorCode, PermissionCollection, ResourceGrantCollection, RoleCollection, RolePermissionCollection, type RolePermissionPatternMatrix, type SeedRolePermissionsOptions, type SeedRolePermissionsResult, type SeedSystemRolesOptions, SessionCollection, TenantCollection, TenantHierarchyError, TenantIntegrationCollection, TenantPermissionOverrideCollection, type TenantPermissionOverrideResult, UserCollection, UsersCliAuthApproveLimitCollection, UsersCliAuthRequestCollection, UsersLoginAttemptCollection, UsersLoginAuditEventCollection, UsersMagicLinkTokenCollection, UsersPinCredentialCollection, } from './collections/index.js';
|
|
58
58
|
export { type BackfillLegacyUserProfilesResult, backfillLegacyUserProfiles, LEGACY_USER_PROFILE_BACKFILL_NAME, LegacyUserProfileBackfillError, type LegacyUserProfileBackfillErrorCode, } from './migrations/backfillLegacyUserProfiles.js';
|
|
59
59
|
export { type BackfillUserEmailKeysResult, backfillUserEmailKeys, type DuplicateUserEmailKey, UserEmailKeyBackfillError, type UserEmailKeyBackfillErrorCode, } from './migrations/backfillUserEmailKeys.js';
|
|
60
|
+
export { type DeduplicateRolePermissionsOptions, type DeduplicateRolePermissionsResult, deduplicateRolePermissions, } from './migrations/deduplicateRolePermissions.js';
|
|
60
61
|
export { type MaterializeTenantHierarchyOptions, type MaterializeTenantHierarchyResult, materializeTenantHierarchy, TenantHierarchyMaterializationError, } from './migrations/materializeTenantHierarchy.js';
|
|
61
|
-
export { AccessRequest, type AccessRequestOptions, CliAuthRequest, type CliAuthRequestStatus, DEFAULT_SESSION_TTL, DEFAULT_TOKEN_EXPIRY_SECONDS, Group, GroupMember, GroupRole, generateSessionId, MAX_TENANT_HIERARCHY_DEPTH, MagicLinkToken, Membership, MembershipOverride, Permission, ResourceGrant, type ResourceGrantEffect, type ResourceGrantOptions, Role, RolePermission, Session, Tenant, TenantIntegration, type TenantIntegrationCheckSummary, type TenantIntegrationOptions, type TenantIntegrationProvider, type TenantIntegrationStatus, TenantPermissionOverride, User, UsersCliAuthApproveLimit, UsersCliAuthRequest, UsersMagicLinkToken, } from './models/index.js';
|
|
62
|
+
export { AccessRequest, type AccessRequestOptions, CliAuthRequest, type CliAuthRequestStatus, DEFAULT_SESSION_TTL, DEFAULT_TOKEN_EXPIRY_SECONDS, Group, GroupMember, GroupRole, generateSessionId, MAX_TENANT_HIERARCHY_DEPTH, MagicLinkToken, Membership, MembershipOverride, Permission, ResourceGrant, type ResourceGrantEffect, type ResourceGrantOptions, Role, RolePermission, SESSION_DATA_KEYS, Session, type SessionAuthMethod, Tenant, TenantIntegration, type TenantIntegrationCheckSummary, type TenantIntegrationOptions, type TenantIntegrationProvider, type TenantIntegrationStatus, TenantPermissionOverride, User, UsersCliAuthApproveLimit, UsersCliAuthRequest, UsersLoginAttempt, UsersLoginAuditEvent, UsersMagicLinkToken, UsersPinCredential, } from './models/index.js';
|
|
62
63
|
export { planTenantHierarchy, type TenantHierarchyChange, type TenantHierarchyErrorCode, type TenantHierarchyPlan, type TenantHierarchyProblem, type TenantHierarchyRow, } from './models/tenant-hierarchy.js';
|
|
63
|
-
export { CLI_AUTH_RETENTION_TASK, MAGIC_LINK_RETENTION_TASK, registerUserRetentionTasks, SESSIONS_RETENTION_TASK, USER_RETENTION_TASKS, unregisterUserRetentionTasks, } from './retention.js';
|
|
64
|
-
export { ACCESS_REQUEST_CAPABILITIES, type AccessRequestAuthorizationContext, type AccessRequestAuthorizer, type AccessRequestCapability, AccessRequestError, type AccessRequestErrorCode, type AccessRequestEvent, type AccessRequestEventHandler, type AccessRequestEventType, AccessRequestService, type AccessRequestServiceOptions, ANCESTOR_READ_ACTION, type AncestorReadPackageConfig, type AncestorReadPolicy, type ApproveAccessRequestOptions, type ApproveCliAuthRequestInput, applyPostgresPermissionPolicies, assertOperationPermission, type CancelAccessRequestOptions, type CliAuthStartResult, type CliAuthTokenResult, type CreateAccessRequestInput, type CreateAuthorizationUrlOptions, type CreateResourceGrantOptions, checkOperationPermission, checkResourceOperationPermission, DEFAULT_ANCESTOR_READ_MAX_DEPTH, DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, DEFAULT_CLI_SESSION_TTL_SECONDS, type DeclineAccessRequestOptions, decodeOidcTransaction, deriveOperationPermissionCollectionName, deriveOperationPermissionSlug, type EnsureTenantResult, encodeOidcTransaction, type GeneratePostgresPermissionSqlResult, type GraduateAccessRequestOptions, type GraduateAccessRequestResult, type GraduateExistingTenantOption, type GraduateNewTenantOption, type GraduateTenantOption, generatePostgresPermissionSql, getConfiguredAncestorReadPolicy, getCurrentSessionPermissionContext, getRequestScopedDatabase, getUsersOidcConfig, hasOperationPermission, isAncestorReadableSlug, type ListAccessRequestsFilter, MAX_RESOURCE_GRANT_DELEGATION_DEPTH, MagicLinkError, type MagicLinkResult, MagicLinkService, type MagicLinkServiceOptions, type MagicLinkVerifyResult, MobileAuthError, type MobileAuthErrorCode, MobileAuthService, type MobileAuthServiceOptions, type MobileBootstrapContext, type MobileLoginContext, type MobileLogoutResult, type MobileRequestMeta, type MobileResolvedUser, type MobileTenantContext, type NormalizedAncestorReadPolicy, normalizeAncestorReadPolicy, normalizeOperationPermissionAction, type OidcCallbackResult, OidcLoginError, type OidcLoginResult, OidcLoginService, type OidcLoginServiceOptions, type OidcProviderConfig, type OidcProviderKind, type OidcProviderMetadata, type OidcProviderResolution, type OidcProviderResolutionOptions, type OidcTokenEndpointAuthMethod, type OidcTokenSet, type OidcTransaction, type OperationPermissionAllowReason, type OperationPermissionCollectionInput, type OperationPermissionDecision, type OperationPermissionDenyReason, OperationPermissionError, type OperationPermissionOptions, type PermissionCatalog, PermissionCatalogService, type PermissionCatalogSource, type PermissionCatalogSyncResult, type PermissionDefinition, type PermissionResolutionOptions, type PermissionResolutionResult, PermissionResolver, type PermissionResolverOptions, type PostgresPermissionAction, type PostgresPermissionBinding, type PostgresPermissionPolicyReportItem, type PostgresPermissionPolicyTarget, type PrincipalPermissionRuntimeOptions, type ResolvedOidcProviderConfig, type ResourceGrantDecision, ResourceGrantService, type ResourceIdentity, type ResourceIdentityVerifier, type ResourceOperationPermissionOptions, type RevokeResourceGrantOptions, readMobileBearerToken, registerPermissionDefinitions, resolveOidcProviderConfig, type SessionContext, type SessionPermissionRuntimeContext, type SessionPermissionRuntimeOptions, SessionService, type SessionServiceOptions, type SwitchTenantResult, syncPermissionCatalog, type TenantPermissionInheritanceResult, TenantService, type TenantWithOwnershipResult, TerminalAuthError, TerminalAuthRateLimitError, TerminalAuthService, type TerminalAuthServiceOptions, type UsersConfig, type UsersOidcConfig, validateMobileRedirectUri, withPrincipalPermissionContext, withSessionPermissionContext, } from './services/index.js';
|
|
64
|
+
export { CLI_AUTH_RETENTION_TASK, DEFAULT_LOGIN_AUDIT_RETENTION_DAYS, LOGIN_ATTEMPTS_RETENTION_TASK, LOGIN_AUDIT_RETENTION_TASK, MAGIC_LINK_RETENTION_TASK, registerUserRetentionTasks, SESSIONS_RETENTION_TASK, USER_RETENTION_TASKS, unregisterUserRetentionTasks, } from './retention.js';
|
|
65
|
+
export { ACCESS_REQUEST_CAPABILITIES, type AccessRequestAuthorizationContext, type AccessRequestAuthorizer, type AccessRequestCapability, AccessRequestError, type AccessRequestErrorCode, type AccessRequestEvent, type AccessRequestEventHandler, type AccessRequestEventType, AccessRequestService, type AccessRequestServiceOptions, ANCESTOR_READ_ACTION, type AncestorReadPackageConfig, type AncestorReadPolicy, type ApproveAccessRequestOptions, type ApproveCliAuthRequestInput, applyPostgresPermissionPolicies, assertOperationPermission, type CancelAccessRequestOptions, type ClearPinInput, type CliAuthStartResult, type CliAuthTokenResult, type CreateAccessRequestInput, type CreateAuthorizationUrlOptions, type CreateResourceGrantOptions, checkOperationPermission, checkResourceOperationPermission, DEFAULT_ANCESTOR_READ_MAX_DEPTH, DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, DEFAULT_CLI_SESSION_TTL_SECONDS, DEFAULT_DEVICE_PERSON_IDLE_SECONDS, DEFAULT_LOGIN_ATTEMPT_WINDOW_SECONDS, DEFAULT_LOGIN_LOCKOUT_BASE_SECONDS, DEFAULT_LOGIN_LOCKOUT_FACTOR, DEFAULT_LOGIN_LOCKOUT_MAX_SECONDS, DEFAULT_LOGIN_MAX_ATTEMPTS, DEFAULT_PIN_MANAGE_PERMISSION, type DeclineAccessRequestOptions, DeviceCredentialError, DeviceCredentialForbiddenError, DeviceCredentialPolicyError, DeviceCredentialService, type DeviceCredentialServiceOptions, type DeviceCredentialVerification, type DeviceCredentialVerifier, type DeviceSignInContext, type DeviceSignInInput, type DeviceSignInResult, DurableLoginAuditSink, decodeOidcTransaction, deriveOperationPermissionCollectionName, deriveOperationPermissionSlug, type EnsureTenantResult, encodeOidcTransaction, ensurePinPermissionsRegistered, type GeneratePostgresPermissionSqlResult, type GraduateAccessRequestOptions, type GraduateAccessRequestResult, type GraduateExistingTenantOption, type GraduateNewTenantOption, type GraduateTenantOption, generatePostgresPermissionSql, getConfiguredAncestorReadPolicy, getCurrentSessionPermissionContext, getRequestScopedDatabase, getUsersOidcConfig, hasOperationPermission, InvalidCredentialsError, isAncestorReadableSlug, type ListAccessRequestsFilter, type LoginAttemptDecision, type LoginAttemptDenied, type LoginAttemptLease, LoginAttemptLimiter, type LoginAttemptLimiterOptions, type LoginAuditEntry, type LoginAuditSink, type LoginFailureOutcome, type LoginLockoutOptions, LoginRateLimitError, MAX_RESOURCE_GRANT_DELEGATION_DEPTH, MagicLinkError, type MagicLinkResult, MagicLinkService, type MagicLinkServiceOptions, type MagicLinkVerifyResult, MobileAuthError, type MobileAuthErrorCode, MobileAuthService, type MobileAuthServiceOptions, type MobileBootstrapContext, type MobileLoginContext, type MobileLogoutResult, type MobileRequestMeta, type MobileResolvedUser, type MobileTenantContext, type NormalizedAncestorReadPolicy, normalizeAncestorReadPolicy, normalizeOperationPermissionAction, type OidcCallbackResult, OidcLoginError, type OidcLoginResult, OidcLoginService, type OidcLoginServiceOptions, type OidcProviderConfig, type OidcProviderKind, type OidcProviderMetadata, type OidcProviderResolution, type OidcProviderResolutionOptions, type OidcTokenEndpointAuthMethod, type OidcTokenSet, type OidcTransaction, type OperationPermissionAllowReason, type OperationPermissionCollectionInput, type OperationPermissionDecision, type OperationPermissionDenyReason, OperationPermissionError, type OperationPermissionOptions, type PermissionCatalog, PermissionCatalogService, type PermissionCatalogSource, type PermissionCatalogSyncResult, type PermissionDefinition, type PermissionResolutionOptions, type PermissionResolutionResult, PermissionResolver, type PermissionResolverOptions, PIN_LOGIN_KIND, PIN_PERMISSION_DEFINITIONS, type PinPolicyOptions, type PinSignInInput, PinVerifier, type PostgresPermissionAction, type PostgresPermissionBinding, type PostgresPermissionPolicyReportItem, type PostgresPermissionPolicyTarget, type PrincipalPermissionRuntimeOptions, type ReserveLoginAttemptOptions, type ResetPinInput, type ResolvedOidcProviderConfig, type ResourceGrantDecision, ResourceGrantService, type ResourceIdentity, type ResourceIdentityVerifier, type ResourceOperationPermissionOptions, type RevokeResourceGrantOptions, readMobileBearerToken, registerPermissionDefinitions, resolveOidcProviderConfig, type SessionContext, type SessionParentContext, type SessionPermissionRuntimeContext, type SessionPermissionRuntimeOptions, SessionService, type SessionServiceOptions, type SetPinInput, type SwitchTenantResult, syncPermissionCatalog, TERMINAL_APPROVE_LOGIN_KIND, type TenantPermissionInheritanceResult, TenantService, type TenantWithOwnershipResult, TerminalAuthError, TerminalAuthRateLimitError, TerminalAuthService, type TerminalAuthServiceOptions, type UsersConfig, type UsersOidcConfig, validateMobileRedirectUri, withPrincipalPermissionContext, withSessionPermissionContext, } from './services/index.js';
|
|
65
66
|
export { AccessRequestStatus, DEFAULT_ROLE_SLUGS, DEFAULT_ROLES, DEFAULT_TENANT_POLICY, type DefaultRoleSlug, MembershipStatus, OverrideEffect, SessionStatus, TenantPermissionEffect, type TenantPolicy, type TenantPolicyMode, TenantStatus, UserStatus, } from './types/index.js';
|
|
66
67
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAKH,OAAO,wBAAwB,CAAC;AAWhC,OAAO,EACL,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,gCAAgC,EAChC,KAAK,0BAA0B,EAC/B,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,4BAA4B,EAC5B,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,iCAAiC,EACtC,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,wBAAwB,EACxB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAC3B,kCAAkC,EAClC,KAAK,8BAA8B,EACnC,cAAc,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