@bymax-one/nest-auth 1.5.15 → 1.5.17
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 +72 -1
- package/README.md +40 -0
- package/dist/client/index.cjs +3 -5
- package/dist/client/index.mjs +3 -5
- package/dist/nextjs/index.cjs +5 -1
- package/dist/nextjs/index.mjs +5 -1
- package/dist/server/index.cjs +3960 -2653
- package/dist/server/index.d.cts +147 -35
- package/dist/server/index.d.ts +147 -35
- package/dist/server/index.mjs +3734 -2432
- package/package.json +7 -3
package/dist/server/index.d.cts
CHANGED
|
@@ -542,6 +542,11 @@ interface IUserRepository {
|
|
|
542
542
|
* The `passwordHash` field must be a hash generated by PasswordService.
|
|
543
543
|
* Never receive or store a plaintext password.
|
|
544
544
|
*
|
|
545
|
+
* A unique index is what stops two requests that both passed the caller's check. When the
|
|
546
|
+
* write hits it, an implementation SHOULD throw `new AuthException(AUTH_ERROR_CODES.EMAIL_ALREADY_EXISTS)`
|
|
547
|
+
* (409). Do not rely on the library to translate another error: it may reach the caller as an
|
|
548
|
+
* unexpected failure (500 `auth.internal` on an HTTP route).
|
|
549
|
+
*
|
|
545
550
|
* @param data - Creation payload. See {@link CreateUserData}.
|
|
546
551
|
* @returns The newly created user record with all fields populated.
|
|
547
552
|
*/
|
|
@@ -639,7 +644,9 @@ interface IUserRepository {
|
|
|
639
644
|
* `1`. A write keyed by id alone can land on another tenant's row. An implementation MUST scope
|
|
640
645
|
* the update by both the id and the tenant, exactly as its read does.
|
|
641
646
|
*
|
|
642
|
-
* @throws
|
|
647
|
+
* @throws `AuthException` `EMAIL_ALREADY_EXISTS`, SHOULD, when the address is taken by the time
|
|
648
|
+
* of the write. Do not rely on the library to translate another error: it may reach the caller
|
|
649
|
+
* as an unexpected failure (500 `auth.internal` on an HTTP route).
|
|
643
650
|
*/
|
|
644
651
|
updateEmail(params: UpdateEmailParams): Promise<void>;
|
|
645
652
|
/**
|
|
@@ -673,6 +680,11 @@ interface IUserRepository {
|
|
|
673
680
|
* Users created via this path have no local password. A password may be
|
|
674
681
|
* set later via {@link updatePassword}.
|
|
675
682
|
*
|
|
683
|
+
* A unique index is what stops two requests that both passed the caller's check. When the
|
|
684
|
+
* write hits it, an implementation SHOULD throw `new AuthException(AUTH_ERROR_CODES.EMAIL_ALREADY_EXISTS)`
|
|
685
|
+
* (409). Do not rely on the library to translate another error: it may reach the caller as an
|
|
686
|
+
* unexpected failure (500 `auth.internal` on an HTTP route).
|
|
687
|
+
*
|
|
676
688
|
* @param data - OAuth creation payload. See {@link CreateWithOAuthData}.
|
|
677
689
|
* @returns The newly created user record with all fields populated.
|
|
678
690
|
*/
|
|
@@ -7398,11 +7410,13 @@ declare class WorkspaceAccessService {
|
|
|
7398
7410
|
/**
|
|
7399
7411
|
* Reads the workspace and the membership together, whatever the first one says.
|
|
7400
7412
|
*
|
|
7401
|
-
* A missing workspace, an inactive one and a non-member then cost the same repository
|
|
7402
|
-
*
|
|
7403
|
-
*
|
|
7413
|
+
* A missing workspace, an inactive one and a non-member then cost the same repository reads, and
|
|
7414
|
+
* a repository that finds nothing is copied for the same work per field as one that finds a row.
|
|
7415
|
+
* That is the same work, not the same time: how long a host's database takes for each row is
|
|
7416
|
+
* outside this library. The pending-deletion answer for an owner is decided from these same two rows.
|
|
7404
7417
|
*/
|
|
7405
7418
|
private readRepositories;
|
|
7419
|
+
private accessFrom;
|
|
7406
7420
|
}
|
|
7407
7421
|
|
|
7408
7422
|
/**
|
|
@@ -9696,6 +9710,11 @@ declare class SessionService {
|
|
|
9696
9710
|
* caller told only that "a hash" was malformed cannot act on it.
|
|
9697
9711
|
*/
|
|
9698
9712
|
rotateSession(oldHash: string, newHash: string, ip: string, userAgent: string): Promise<void>;
|
|
9713
|
+
/**
|
|
9714
|
+
* Reads the creation time of the session being rotated, so that its age is stable across token
|
|
9715
|
+
* rotations; the current time when its detail is missing or unparseable.
|
|
9716
|
+
*/
|
|
9717
|
+
private readRotatedCreatedAt;
|
|
9699
9718
|
/**
|
|
9700
9719
|
* Asserts that a session hash string is a valid 64-character lowercase hex string.
|
|
9701
9720
|
*
|
|
@@ -9736,6 +9755,10 @@ declare class SessionService {
|
|
|
9736
9755
|
* rotation script writes it.
|
|
9737
9756
|
*/
|
|
9738
9757
|
private graceSuccessor;
|
|
9758
|
+
/** Drops the grace pointers that have expired from the index, without making the listing wait for it. */
|
|
9759
|
+
private pruneGracePointers;
|
|
9760
|
+
/** Drops the members of the index that name nothing, without making the listing wait for it. */
|
|
9761
|
+
private pruneDeadPointers;
|
|
9739
9762
|
/**
|
|
9740
9763
|
* The Redis key of this user's session index.
|
|
9741
9764
|
*
|
|
@@ -9801,6 +9824,8 @@ declare class SessionService {
|
|
|
9801
9824
|
* @returns Maximum allowed concurrent sessions for the given user.
|
|
9802
9825
|
*/
|
|
9803
9826
|
private resolveSessionLimit;
|
|
9827
|
+
/** Reads the creation time of every member together; a failed read throws, after the reads before it settled. */
|
|
9828
|
+
private readAges;
|
|
9804
9829
|
}
|
|
9805
9830
|
|
|
9806
9831
|
/**
|
|
@@ -10415,6 +10440,8 @@ declare class AuthService {
|
|
|
10415
10440
|
password: string;
|
|
10416
10441
|
tenantId?: string;
|
|
10417
10442
|
}, req: Request): Promise<AuthResult | MfaChallengeResult>;
|
|
10443
|
+
/** Issues the tokens of a signed-in user and, when sessions are enabled, records the session that holds them. */
|
|
10444
|
+
private openSession;
|
|
10418
10445
|
/**
|
|
10419
10446
|
* Logs out a dashboard user by revoking the access token and deleting the refresh session.
|
|
10420
10447
|
*
|
|
@@ -10760,6 +10787,10 @@ declare class AuthService {
|
|
|
10760
10787
|
* refused login into a different refusal, nor a successful one into a failure.
|
|
10761
10788
|
*/
|
|
10762
10789
|
private fireAndForget;
|
|
10790
|
+
/** Records the time of a login without making the login wait for it; a failure is logged, never raised. */
|
|
10791
|
+
private touchLastLogin;
|
|
10792
|
+
/** Moves the detail of a session to its rotated token without making the refresh wait for it. */
|
|
10793
|
+
private rotateSessionDetail;
|
|
10763
10794
|
/** Writes the event of a password login that reached its end: tokens issued, or an MFA challenge. */
|
|
10764
10795
|
private logLogin;
|
|
10765
10796
|
private assertUserNotBlocked;
|
|
@@ -10891,10 +10922,11 @@ declare class EmailChangeService implements OnModuleInit {
|
|
|
10891
10922
|
/**
|
|
10892
10923
|
* Refuses an address the account already has, or that another account in the tenant holds.
|
|
10893
10924
|
*
|
|
10894
|
-
* Answering `EMAIL_ALREADY_EXISTS`
|
|
10895
|
-
*
|
|
10896
|
-
*
|
|
10897
|
-
*
|
|
10925
|
+
* Answering `EMAIL_ALREADY_EXISTS` discloses that an address is registered in the caller's
|
|
10926
|
+
* tenant. Where `register` is mounted it discloses the same; where accounts are created by
|
|
10927
|
+
* invitation only, this route is itself a way for a signed-in user to learn it, behind that
|
|
10928
|
+
* user's password and the route's throttle. Withholding it would leave a user who typos into
|
|
10929
|
+
* a colleague's address waiting on a message that never comes, with no way to tell why.
|
|
10898
10930
|
*
|
|
10899
10931
|
* The account's own current address is refused through the same code: it is a change that
|
|
10900
10932
|
* changes nothing, and letting it through would send a verification for a move that is not
|
|
@@ -11074,6 +11106,15 @@ declare class MfaRecordService {
|
|
|
11074
11106
|
* @throws {@link AuthException} `MFA_STATE_CONFLICT` when another transition holds the lock.
|
|
11075
11107
|
*/
|
|
11076
11108
|
transition(context: 'dashboard' | 'platform', userId: string, tenantId: string | undefined, mutate: (current: AuthUser | AuthPlatformUser) => MfaRecordUpdate | null): Promise<boolean>;
|
|
11109
|
+
/**
|
|
11110
|
+
* Writes an update inside the lock, to the repository of the plane the account belongs to.
|
|
11111
|
+
*
|
|
11112
|
+
* @param context - Which identity plane the account belongs to.
|
|
11113
|
+
* @param userId - The account being written.
|
|
11114
|
+
* @param tenantId - The account's tenant, required on the dashboard plane.
|
|
11115
|
+
* @param update - What `mutate` asked to be stored.
|
|
11116
|
+
*/
|
|
11117
|
+
private persist;
|
|
11077
11118
|
/**
|
|
11078
11119
|
* Releases the transition lock this call took, whatever the store answers.
|
|
11079
11120
|
*
|
|
@@ -11200,6 +11241,13 @@ declare class MfaChallengeService {
|
|
|
11200
11241
|
* @throws `MFA_INVALID_CODE` if the submitted code is incorrect.
|
|
11201
11242
|
*/
|
|
11202
11243
|
challenge(mfaTempToken: string, code: string, ip: string, userAgent: string, mfa: MfaConfig): Promise<AuthResult | PlatformAuthResult>;
|
|
11244
|
+
/** The checks and the session of one challenge, run on the plane the temp token names. */
|
|
11245
|
+
private admitChallenge;
|
|
11246
|
+
/**
|
|
11247
|
+
* Consumes the temp token, and the consume must WIN: two concurrent submissions both see the marker, and on the recovery-code
|
|
11248
|
+
* path one code and one token would mint two sessions. The loser is reported as an invalid temp token.
|
|
11249
|
+
*/
|
|
11250
|
+
private consumeOrRefuse;
|
|
11203
11251
|
/**
|
|
11204
11252
|
* Refuses a challenge for an account at its failure ceiling.
|
|
11205
11253
|
*
|
|
@@ -11557,21 +11605,6 @@ interface MfaSetupResult {
|
|
|
11557
11605
|
/** Plain-text recovery codes. Display once and never persist in this form. */
|
|
11558
11606
|
recoveryCodes: string[];
|
|
11559
11607
|
}
|
|
11560
|
-
/**
|
|
11561
|
-
* Manages TOTP-based multi-factor authentication lifecycle.
|
|
11562
|
-
*
|
|
11563
|
-
* Handles the complete MFA flow for both dashboard users and platform admins:
|
|
11564
|
-
* - **Setup**: generate TOTP secret + recovery codes, store temporarily in Redis
|
|
11565
|
-
* - **Verify & Enable**: confirm first TOTP code, persist encrypted secret to DB
|
|
11566
|
-
* - **Challenge**: exchange a valid MFA temp token + code for full access tokens
|
|
11567
|
-
* - **Disable**: require a current TOTP code to disable MFA
|
|
11568
|
-
*
|
|
11569
|
-
* @remarks
|
|
11570
|
-
* This service is only registered when `options.mfa` is configured in
|
|
11571
|
-
* `BymaxAuthModule.registerAsync()`. All crypto operations use `node:crypto` only.
|
|
11572
|
-
*
|
|
11573
|
-
* @layer Service
|
|
11574
|
-
*/
|
|
11575
11608
|
declare class MfaService {
|
|
11576
11609
|
private readonly options;
|
|
11577
11610
|
private readonly userRepo;
|
|
@@ -11596,6 +11629,8 @@ declare class MfaService {
|
|
|
11596
11629
|
* here eliminates repetitive `!` assertions throughout the class.
|
|
11597
11630
|
*/
|
|
11598
11631
|
private get mfaOptions();
|
|
11632
|
+
/** The setup a first request stored, read back for the account's address. */
|
|
11633
|
+
private storedSetup;
|
|
11599
11634
|
/**
|
|
11600
11635
|
* Initiates the MFA setup flow for a dashboard user or platform administrator.
|
|
11601
11636
|
*
|
|
@@ -11948,11 +11983,49 @@ declare class InvitationService {
|
|
|
11948
11983
|
* @param revokerUserId - Internal ID of the authenticated user withdrawing the invitation.
|
|
11949
11984
|
* @param email - The invited address. Normalized at this boundary.
|
|
11950
11985
|
* @param tenantId - The tenant the invitation was issued for.
|
|
11951
|
-
* @returns `true` when a pending invitation was removed, `false` when
|
|
11952
|
-
* @throws {@link AuthException} `TOKEN_INVALID` when the revoker no longer exists,
|
|
11953
|
-
* `INSUFFICIENT_ROLE` when they
|
|
11986
|
+
* @returns `true` when a pending invitation was removed, `false` when none was.
|
|
11987
|
+
* @throws {@link AuthException} `TOKEN_INVALID` when the revoker no longer exists,
|
|
11988
|
+
* `INSUFFICIENT_ROLE` when they are outside the tenant or not in good standing, or
|
|
11989
|
+
* `TOO_MANY_REQUESTS` when the invitation was replaced during each attempt to remove it.
|
|
11954
11990
|
*/
|
|
11955
11991
|
revokeInvitation(revokerUserId: string, email: string, tenantId: string): Promise<boolean>;
|
|
11992
|
+
/**
|
|
11993
|
+
* Removes the invitation the index names, when the revoker may withdraw what is there.
|
|
11994
|
+
*
|
|
11995
|
+
* A record that is there is deleted before its index is released, so a store failure between the
|
|
11996
|
+
* two never leaves a redeemable record that nothing names. An index that names no record is
|
|
11997
|
+
* released first, so that an invite about to write it fails its second claim. A release that finds
|
|
11998
|
+
* the index claimed by a later invite starts over, and judges what replaced the invitation.
|
|
11999
|
+
*
|
|
12000
|
+
* @param revoker - The authenticated caller, in the tenant and in good standing.
|
|
12001
|
+
* @param indexKey - The invitee index key.
|
|
12002
|
+
* @param tenantId - The tenant, for the log.
|
|
12003
|
+
* @param revokerUserId - Who revokes, for the log.
|
|
12004
|
+
* @returns `true` when this call removed a pending invitation, `false` when it removed none.
|
|
12005
|
+
* @throws {@link AuthException} `TOO_MANY_REQUESTS` when the invitation was replaced before the
|
|
12006
|
+
* index could be released, on every attempt.
|
|
12007
|
+
*/
|
|
12008
|
+
private withdrawPending;
|
|
12009
|
+
/**
|
|
12010
|
+
* Whether the stored invitation is above the revoker, recording the refusal when it is.
|
|
12011
|
+
*
|
|
12012
|
+
* The caller names an address, not a role, so the role is read from the record. One that no longer
|
|
12013
|
+
* parses is withdrawn without a role check: it cannot be accepted either. The refusal is answered
|
|
12014
|
+
* like an address with no invitation, because a `403` would disclose that one is pending; it is
|
|
12015
|
+
* logged server-side.
|
|
12016
|
+
*
|
|
12017
|
+
* @param revoker - The authenticated caller.
|
|
12018
|
+
* @param raw - The stored record.
|
|
12019
|
+
* @returns `true` when the withdrawal is refused.
|
|
12020
|
+
*/
|
|
12021
|
+
private refusesRevoker;
|
|
12022
|
+
/**
|
|
12023
|
+
* Drops the invitee index of an invitation whose record was consumed, while it still names it.
|
|
12024
|
+
*
|
|
12025
|
+
* @param invitation - The consumed record.
|
|
12026
|
+
* @param token - The raw token it was consumed with.
|
|
12027
|
+
*/
|
|
12028
|
+
private releaseAccepted;
|
|
11956
12029
|
/**
|
|
11957
12030
|
* Parses a stored invitation, answering `null` for anything that is not one.
|
|
11958
12031
|
*
|
|
@@ -12204,6 +12277,10 @@ declare class PasswordResetService {
|
|
|
12204
12277
|
* the configured breach checker.
|
|
12205
12278
|
*/
|
|
12206
12279
|
changePassword(userId: string, tenantId: string, dto: ChangePasswordDto, currentRefreshToken?: string): Promise<void>;
|
|
12280
|
+
/**
|
|
12281
|
+
* Counts a failed proof of the current password and refuses a locked account, a wrong password included.
|
|
12282
|
+
*/
|
|
12283
|
+
private assertCurrentPassword;
|
|
12207
12284
|
/**
|
|
12208
12285
|
* The hash of the live session a presented refresh token stands for, or `undefined` when the
|
|
12209
12286
|
* request carried none. Refuses a token that names no live session of the account; a token that
|
|
@@ -12263,6 +12340,8 @@ declare class PasswordResetService {
|
|
|
12263
12340
|
* Errors are caught and logged — they must not propagate to `initiateReset`.
|
|
12264
12341
|
*/
|
|
12265
12342
|
private sendToken;
|
|
12343
|
+
/** Deletes the token of a reset whose delivery failed, so nothing keeps a working reset nobody was sent. */
|
|
12344
|
+
private dropUnsentToken;
|
|
12266
12345
|
/**
|
|
12267
12346
|
* Generates and stores a password-reset OTP, then sends it to the user's email.
|
|
12268
12347
|
* Errors are caught and logged — they must not propagate to `initiateReset`.
|
|
@@ -12338,6 +12417,8 @@ declare class PlatformAuthService {
|
|
|
12338
12417
|
* account status is configured as blocked.
|
|
12339
12418
|
*/
|
|
12340
12419
|
login(dto: PlatformLoginDto, ip: string, userAgent: string): Promise<PlatformAuthResult | MfaChallengeResult>;
|
|
12420
|
+
/** Records the time of a login without making the login wait for it; a failure is logged, never raised. */
|
|
12421
|
+
private touchLastLogin;
|
|
12341
12422
|
/**
|
|
12342
12423
|
* Logs out a platform administrator by revoking the access token JTI and
|
|
12343
12424
|
* deleting the associated platform refresh session from Redis.
|
|
@@ -12807,6 +12888,15 @@ declare class WorkspaceInvitationStore {
|
|
|
12807
12888
|
key: string;
|
|
12808
12889
|
record: StoredWorkspaceInvitation | null;
|
|
12809
12890
|
} | null>;
|
|
12891
|
+
/**
|
|
12892
|
+
* Whether an address's index names a record key.
|
|
12893
|
+
*
|
|
12894
|
+
* @param ref - The workspace.
|
|
12895
|
+
* @param email - The invitee, normalized.
|
|
12896
|
+
* @param key - The record key.
|
|
12897
|
+
* @returns `true` while the index holds `key`.
|
|
12898
|
+
*/
|
|
12899
|
+
names(ref: WorkspaceRef, email: string, key: string): Promise<boolean>;
|
|
12810
12900
|
/**
|
|
12811
12901
|
* Writes a record, points the address's index at it and lists it as pending, retiring the record
|
|
12812
12902
|
* the index named when it was read, all in one step.
|
|
@@ -13204,6 +13294,8 @@ declare class OAuthService {
|
|
|
13204
13294
|
* @returns The auth result.
|
|
13205
13295
|
*/
|
|
13206
13296
|
private openSession;
|
|
13297
|
+
/** Starts the non-blocking side effects of a login; nothing waits for them. */
|
|
13298
|
+
private runLoginSideEffects;
|
|
13207
13299
|
/**
|
|
13208
13300
|
* Validates and spends the `state` of a callback.
|
|
13209
13301
|
*
|
|
@@ -13464,7 +13556,12 @@ declare function sanitizeHeaders(headers: Record<string, string | string[] | und
|
|
|
13464
13556
|
* ```typescript
|
|
13465
13557
|
* const MIN_RESPONSE_MS = 300
|
|
13466
13558
|
* const start = Date.now()
|
|
13467
|
-
*
|
|
13559
|
+
* let user = null
|
|
13560
|
+
* try {
|
|
13561
|
+
* user = await userRepo.findByEmail(dto.email)
|
|
13562
|
+
* } catch {
|
|
13563
|
+
* // an unknown account and a failed lookup take the same time
|
|
13564
|
+
* }
|
|
13468
13565
|
* const elapsed = Date.now() - start
|
|
13469
13566
|
* await sleep(Math.max(0, MIN_RESPONSE_MS - elapsed)) // always >= 300 ms total
|
|
13470
13567
|
* ```
|
|
@@ -13817,6 +13914,8 @@ declare class ApiKeyGuard implements CanActivate {
|
|
|
13817
13914
|
* @returns The scopes, or `null` when the route declares none.
|
|
13818
13915
|
*/
|
|
13819
13916
|
private declaredScopes;
|
|
13917
|
+
/** Audits a denial and refuses with the code of its reason; never returns. */
|
|
13918
|
+
private refuse;
|
|
13820
13919
|
/**
|
|
13821
13920
|
* Emits the audit event.
|
|
13822
13921
|
*
|
|
@@ -14069,12 +14168,6 @@ declare const AllowPendingWorkspace: () => MethodDecorator & ClassDecorator;
|
|
|
14069
14168
|
*/
|
|
14070
14169
|
declare const CurrentWsWorkspace: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
14071
14170
|
|
|
14072
|
-
/**
|
|
14073
|
-
* @fileoverview Names scoped to a workspace: the keys, rooms and prefixes a host builds for
|
|
14074
|
-
* storage, cache, sockets and queues, encoded so two workspaces can never share one.
|
|
14075
|
-
*
|
|
14076
|
-
* @layer Utility
|
|
14077
|
-
*/
|
|
14078
14171
|
/**
|
|
14079
14172
|
* Builds the name of something that belongs to one workspace.
|
|
14080
14173
|
*
|
|
@@ -14631,12 +14724,15 @@ declare class WorkspaceInvitationService {
|
|
|
14631
14724
|
resend(ref: WorkspaceRef, actor: WorkspaceActor, rawEmail: string, context: HookContext): Promise<void>;
|
|
14632
14725
|
/**
|
|
14633
14726
|
* Withdraws a pending invitation. An address with none, or one the actor may not act on, is
|
|
14634
|
-
* answered like a success and changes nothing.
|
|
14727
|
+
* answered like a success and changes nothing. An invitation that replaces the one being
|
|
14728
|
+
* withdrawn is read again and held to the same ceiling.
|
|
14635
14729
|
*
|
|
14636
14730
|
* @param ref - The workspace.
|
|
14637
14731
|
* @param actor - Who revokes.
|
|
14638
14732
|
* @param rawEmail - The invitee.
|
|
14639
14733
|
* @param context - Request metadata for the hook.
|
|
14734
|
+
* @throws {AuthException} `auth.too_many_requests` when the invitation was replaced during each
|
|
14735
|
+
* attempt to remove it.
|
|
14640
14736
|
*/
|
|
14641
14737
|
revoke(ref: WorkspaceRef, actor: WorkspaceActor, rawEmail: string, context: HookContext): Promise<void>;
|
|
14642
14738
|
/**
|
|
@@ -14686,13 +14782,29 @@ declare class WorkspaceInvitationService {
|
|
|
14686
14782
|
}>;
|
|
14687
14783
|
/**
|
|
14688
14784
|
* Withdraws a platform bootstrap invitation. An address with none, or with an ordinary member
|
|
14689
|
-
* invitation, is answered like a success and changes nothing.
|
|
14785
|
+
* invitation, is answered like a success and changes nothing. A replacement of the invitation
|
|
14786
|
+
* being withdrawn is read again and removed only if it is a bootstrap one too.
|
|
14690
14787
|
*
|
|
14691
14788
|
* @param ref - The workspace id `inviteAsPlatform` returned.
|
|
14692
14789
|
* @param rawEmail - The invitee.
|
|
14693
14790
|
* @param context - Request metadata for the hook.
|
|
14791
|
+
* @throws {AuthException} `auth.too_many_requests` when the invitation was replaced during each
|
|
14792
|
+
* attempt to remove it.
|
|
14694
14793
|
*/
|
|
14695
14794
|
revokeAsPlatform(ref: WorkspaceRef, rawEmail: string, context: HookContext): Promise<void>;
|
|
14795
|
+
/**
|
|
14796
|
+
* Removes the address's invitation and reports it, when `mayWithdraw` accepts what is there.
|
|
14797
|
+
*
|
|
14798
|
+
* The report is for a removal only. When the index stops naming the record, before the record is
|
|
14799
|
+
* read or before it is removed, the address is read again and what replaced it is judged anew.
|
|
14800
|
+
*
|
|
14801
|
+
* @param ref - The workspace.
|
|
14802
|
+
* @param email - The invitee, normalized.
|
|
14803
|
+
* @param mayWithdraw - Whether this caller may remove the record it is shown.
|
|
14804
|
+
* @param actorUserId - Who revokes, or `null` for the platform.
|
|
14805
|
+
* @param context - Request metadata for the hook.
|
|
14806
|
+
*/
|
|
14807
|
+
private withdraw;
|
|
14696
14808
|
/** Counts one invitation against the inviter's hour, refusing the twenty-first. */
|
|
14697
14809
|
private takeInviterSlot;
|
|
14698
14810
|
/** Refuses to replace an invitation the actor may not act on, or one sent too recently or often. */
|