@aooth/auth-moost 0.1.1 → 0.1.3
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/index.d.mts +12 -1
- package/dist/index.mjs +56 -15
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1262,6 +1262,17 @@ declare class InviteWorkflow {
|
|
|
1262
1262
|
private emitAudit;
|
|
1263
1263
|
}
|
|
1264
1264
|
//#endregion
|
|
1265
|
+
//#region src/workflows/default-workflows.d.ts
|
|
1266
|
+
declare class DefaultLoginWorkflow extends LoginWorkflow {
|
|
1267
|
+
constructor(users: UserService, auth: AuthCredential);
|
|
1268
|
+
}
|
|
1269
|
+
declare class DefaultInviteWorkflow extends InviteWorkflow {
|
|
1270
|
+
constructor(users: UserService, auth: AuthCredential);
|
|
1271
|
+
}
|
|
1272
|
+
declare class DefaultRecoveryWorkflow extends RecoveryWorkflow {
|
|
1273
|
+
constructor(users: UserService, auth: AuthCredential);
|
|
1274
|
+
}
|
|
1275
|
+
//#endregion
|
|
1265
1276
|
//#region src/workflows/auth-email-outlet.d.ts
|
|
1266
1277
|
interface AuthEmailOutletDeps {
|
|
1267
1278
|
emailSender: EmailSender$1;
|
|
@@ -1276,4 +1287,4 @@ interface AuthEmailOutletDeps {
|
|
|
1276
1287
|
*/
|
|
1277
1288
|
declare function createAuthEmailOutlet(deps: AuthEmailOutletDeps): WfOutlet;
|
|
1278
1289
|
//#endregion
|
|
1279
|
-
export { type AuditEmitter, type AuditEvent, type AuthBindings, type AuthContext, AuthController, type AuthEmailEvent, type AuthEmailKind, type AuthEmailOutletDeps, AuthGuarded, type AuthLoginResponse, type AuthLogoutBody, type AuthOkResponse, type AuthOptions, type AuthRefreshBody, type AuthSmsEvent, type AuthSmsKind, type BuildMagicLinkUrl, type ConcurrencyLimitOptions, DEFAULT_AUTH_WORKFLOWS, type DeliverEmail, type DeliverPayload, type DeliverSms, type DuplicateAction, type EmailSender, type InvitePrepareUserInput, type InviteSendMode, type InviteWfCtx, InviteWorkflow, type InviteWorkflowOpts, type IssueResult, type LoginRedirect, type LoginWfCtx, LoginWorkflow, type LoginWorkflowOpts, type MfaSummary, type MfaTransport, type PreparedUserInput, Public, type RecoveryDeliveryMode, type RecoveryOtpTransport, type RecoveryWfCtx, RecoveryWorkflow, type RecoveryWorkflowOpts, type ResolvedAuthCookieConfig, type ResolvedAuthOptions, type ResolvedInviteWorkflowOpts, type ResolvedLoginWorkflowOpts, type ResolvedRecoveryWorkflowOpts, type SmsSender, type SsoProvider, type TAuthMeta, UserId, WfTrigger, type WfTriggerOpts, WfTriggerProvider, authGuardInterceptor, createAuthEmailOutlet, generateMagicLinkToken, getAuthMate, mergeInviteOpts, mergeLoginOpts, mergeRecoveryOpts, parseInviteRoles, useAuth };
|
|
1290
|
+
export { type AuditEmitter, type AuditEvent, type AuthBindings, type AuthContext, AuthController, type AuthEmailEvent, type AuthEmailKind, type AuthEmailOutletDeps, AuthGuarded, type AuthLoginResponse, type AuthLogoutBody, type AuthOkResponse, type AuthOptions, type AuthRefreshBody, type AuthSmsEvent, type AuthSmsKind, type BuildMagicLinkUrl, type ConcurrencyLimitOptions, DEFAULT_AUTH_WORKFLOWS, DefaultInviteWorkflow, DefaultLoginWorkflow, DefaultRecoveryWorkflow, type DeliverEmail, type DeliverPayload, type DeliverSms, type DuplicateAction, type EmailSender, type InvitePrepareUserInput, type InviteSendMode, type InviteWfCtx, InviteWorkflow, type InviteWorkflowOpts, type IssueResult, type LoginRedirect, type LoginWfCtx, LoginWorkflow, type LoginWorkflowOpts, type MfaSummary, type MfaTransport, type PreparedUserInput, Public, type RecoveryDeliveryMode, type RecoveryOtpTransport, type RecoveryWfCtx, RecoveryWorkflow, type RecoveryWorkflowOpts, type ResolvedAuthCookieConfig, type ResolvedAuthOptions, type ResolvedInviteWorkflowOpts, type ResolvedLoginWorkflowOpts, type ResolvedRecoveryWorkflowOpts, type SmsSender, type SsoProvider, type TAuthMeta, UserId, WfTrigger, type WfTriggerOpts, WfTriggerProvider, authGuardInterceptor, createAuthEmailOutlet, generateMagicLinkToken, getAuthMate, mergeInviteOpts, mergeLoginOpts, mergeRecoveryOpts, parseInviteRoles, useAuth };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AuthCredential, AuthError, generateMagicLinkToken } from "@aooth/auth";
|
|
2
2
|
import { current, defineWook, eventTypeKey, key } from "@wooksjs/event-core";
|
|
3
3
|
import { HttpError, useAuthorization, useCookies, useRequest, useResponse, useUrlParams } from "@wooksjs/event-http";
|
|
4
|
-
import { Controller, Injectable, Intercept, Resolve, TInterceptorPriority, defineAfterInterceptor, defineBeforeInterceptor, getMoostMate, useControllerContext } from "moost";
|
|
4
|
+
import { Controller, Inherit, Injectable, Intercept, Resolve, TInterceptorPriority, defineAfterInterceptor, defineBeforeInterceptor, getMoostMate, useControllerContext } from "moost";
|
|
5
5
|
import { ArbacAction, ArbacResource, getArbacMate } from "@aooth/arbac-moost";
|
|
6
6
|
import { Body, Get, HttpError as HttpError$1, Post } from "@moostjs/event-http";
|
|
7
7
|
import { createAsHttpOutlet, extractPassContext, finishWfAborted, finishWfWithChoice, finishWfWithData, finishWfWithRedirect, handleAsOutletRequest, serializeFormSchema } from "@atscript/moost-wf";
|
|
@@ -283,7 +283,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
283
283
|
}
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/wf-trigger/provider.ts
|
|
286
|
-
var _ref$
|
|
286
|
+
var _ref$5;
|
|
287
287
|
let WfTriggerProvider = class WfTriggerProvider {
|
|
288
288
|
state = new HandleStateStrategy({ store: new WfStateStoreMemory() });
|
|
289
289
|
outlets = [createAsHttpOutlet()];
|
|
@@ -319,7 +319,7 @@ let WfTriggerProvider = class WfTriggerProvider {
|
|
|
319
319
|
}, deps);
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
WfTriggerProvider = __decorate([Injectable(), __decorateMetadata("design:paramtypes", [typeof (_ref$
|
|
322
|
+
WfTriggerProvider = __decorate([Injectable(), __decorateMetadata("design:paramtypes", [typeof (_ref$5 = typeof MoostWf !== "undefined" && MoostWf) === "function" ? _ref$5 : Object])], WfTriggerProvider);
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region src/wf-trigger/decorator.ts
|
|
325
325
|
/**
|
|
@@ -347,7 +347,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
347
347
|
}
|
|
348
348
|
//#endregion
|
|
349
349
|
//#region src/auth.controller.ts
|
|
350
|
-
var _ref$
|
|
350
|
+
var _ref$4;
|
|
351
351
|
/** Workflows allowed by the bundled `/auth/trigger` endpoint. Subclasses override `triggerWf()` to extend. */
|
|
352
352
|
const DEFAULT_AUTH_WORKFLOWS = [
|
|
353
353
|
"auth.login",
|
|
@@ -434,7 +434,7 @@ __decorate([
|
|
|
434
434
|
AuthController = __decorate([
|
|
435
435
|
Controller("auth"),
|
|
436
436
|
ArbacResource("auth"),
|
|
437
|
-
__decorateMetadata("design:paramtypes", [typeof (_ref$
|
|
437
|
+
__decorateMetadata("design:paramtypes", [typeof (_ref$4 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref$4 : Object])
|
|
438
438
|
], AuthController);
|
|
439
439
|
//#endregion
|
|
440
440
|
//#region src/atscript/models/forms.as.js
|
|
@@ -904,7 +904,7 @@ function resolveClientIp() {
|
|
|
904
904
|
* without an override throws. Boot-time "X required when Y enabled" checks
|
|
905
905
|
* are gone for sender/store/emitter; only data-validity checks remain.
|
|
906
906
|
*/
|
|
907
|
-
var _ref$
|
|
907
|
+
var _ref$3, _ref2$3;
|
|
908
908
|
function mfaKindOf(methodName) {
|
|
909
909
|
if (methodName === "sms" || methodName === "email" || methodName === "totp") return methodName;
|
|
910
910
|
return null;
|
|
@@ -1911,8 +1911,8 @@ LoginWorkflow = __decorate([
|
|
|
1911
1911
|
Controller(),
|
|
1912
1912
|
__decorateMetadata("design:paramtypes", [
|
|
1913
1913
|
Object,
|
|
1914
|
-
typeof (_ref$
|
|
1915
|
-
typeof (_ref2$
|
|
1914
|
+
typeof (_ref$3 = typeof UserService !== "undefined" && UserService) === "function" ? _ref$3 : Object,
|
|
1915
|
+
typeof (_ref2$3 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref2$3 : Object
|
|
1916
1916
|
])
|
|
1917
1917
|
], LoginWorkflow);
|
|
1918
1918
|
//#endregion
|
|
@@ -2003,7 +2003,7 @@ function mergeRecoveryOpts(opts = {}) {
|
|
|
2003
2003
|
* Rate-limiting is intentionally NOT part of this workflow — consumers who
|
|
2004
2004
|
* want a cap wire it themselves at the HTTP / trigger layer.
|
|
2005
2005
|
*/
|
|
2006
|
-
var _ref$
|
|
2006
|
+
var _ref$2, _ref2$2;
|
|
2007
2007
|
/**
|
|
2008
2008
|
* Sentinel returned by alt-action handlers that have already short-circuited
|
|
2009
2009
|
* via `useWfFinished().set(...)`. The step body returns `undefined` after
|
|
@@ -2467,8 +2467,8 @@ RecoveryWorkflow = __decorate([
|
|
|
2467
2467
|
Controller(),
|
|
2468
2468
|
__decorateMetadata("design:paramtypes", [
|
|
2469
2469
|
Object,
|
|
2470
|
-
typeof (_ref$
|
|
2471
|
-
typeof (_ref2$
|
|
2470
|
+
typeof (_ref$2 = typeof UserService !== "undefined" && UserService) === "function" ? _ref$2 : Object,
|
|
2471
|
+
typeof (_ref2$2 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref2$2 : Object
|
|
2472
2472
|
])
|
|
2473
2473
|
], RecoveryWorkflow);
|
|
2474
2474
|
/**
|
|
@@ -2584,7 +2584,7 @@ function mergeInviteOpts(opts = {}) {
|
|
|
2584
2584
|
* Rate-limiting is intentionally NOT part of this workflow — consumers who
|
|
2585
2585
|
* want a cap wire it themselves at the HTTP / trigger layer.
|
|
2586
2586
|
*/
|
|
2587
|
-
var _ref, _ref2;
|
|
2587
|
+
var _ref$1, _ref2$1;
|
|
2588
2588
|
/**
|
|
2589
2589
|
* Sentinel returned by alt-action handlers that have already short-circuited
|
|
2590
2590
|
* via `useWfFinished().set(...)`. The step body returns `undefined` after
|
|
@@ -3311,11 +3311,52 @@ InviteWorkflow = __decorate([
|
|
|
3311
3311
|
Controller(),
|
|
3312
3312
|
__decorateMetadata("design:paramtypes", [
|
|
3313
3313
|
Object,
|
|
3314
|
-
typeof (_ref = typeof UserService !== "undefined" && UserService) === "function" ? _ref : Object,
|
|
3315
|
-
typeof (_ref2 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref2 : Object
|
|
3314
|
+
typeof (_ref$1 = typeof UserService !== "undefined" && UserService) === "function" ? _ref$1 : Object,
|
|
3315
|
+
typeof (_ref2$1 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref2$1 : Object
|
|
3316
3316
|
])
|
|
3317
3317
|
], InviteWorkflow);
|
|
3318
3318
|
//#endregion
|
|
3319
|
+
//#region src/workflows/default-workflows.ts
|
|
3320
|
+
/**
|
|
3321
|
+
* Empty-opts subclasses moost can DI-register directly. The base workflows'
|
|
3322
|
+
* first ctor arg is an opts POJO (no provider), which moost won't inject.
|
|
3323
|
+
* To override opts or hooks, extend the base class instead.
|
|
3324
|
+
*/
|
|
3325
|
+
var _ref, _ref2, _ref3, _ref4, _ref5, _ref6;
|
|
3326
|
+
let DefaultLoginWorkflow = class DefaultLoginWorkflow extends LoginWorkflow {
|
|
3327
|
+
constructor(users, auth) {
|
|
3328
|
+
super({}, users, auth);
|
|
3329
|
+
}
|
|
3330
|
+
};
|
|
3331
|
+
DefaultLoginWorkflow = __decorate([
|
|
3332
|
+
Inherit(),
|
|
3333
|
+
Injectable("FOR_EVENT"),
|
|
3334
|
+
Controller(),
|
|
3335
|
+
__decorateMetadata("design:paramtypes", [typeof (_ref = typeof UserService !== "undefined" && UserService) === "function" ? _ref : Object, typeof (_ref2 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref2 : Object])
|
|
3336
|
+
], DefaultLoginWorkflow);
|
|
3337
|
+
let DefaultInviteWorkflow = class DefaultInviteWorkflow extends InviteWorkflow {
|
|
3338
|
+
constructor(users, auth) {
|
|
3339
|
+
super({}, users, auth);
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
DefaultInviteWorkflow = __decorate([
|
|
3343
|
+
Inherit(),
|
|
3344
|
+
Injectable("FOR_EVENT"),
|
|
3345
|
+
Controller(),
|
|
3346
|
+
__decorateMetadata("design:paramtypes", [typeof (_ref3 = typeof UserService !== "undefined" && UserService) === "function" ? _ref3 : Object, typeof (_ref4 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref4 : Object])
|
|
3347
|
+
], DefaultInviteWorkflow);
|
|
3348
|
+
let DefaultRecoveryWorkflow = class DefaultRecoveryWorkflow extends RecoveryWorkflow {
|
|
3349
|
+
constructor(users, auth) {
|
|
3350
|
+
super({}, users, auth);
|
|
3351
|
+
}
|
|
3352
|
+
};
|
|
3353
|
+
DefaultRecoveryWorkflow = __decorate([
|
|
3354
|
+
Inherit(),
|
|
3355
|
+
Injectable("FOR_EVENT"),
|
|
3356
|
+
Controller(),
|
|
3357
|
+
__decorateMetadata("design:paramtypes", [typeof (_ref5 = typeof UserService !== "undefined" && UserService) === "function" ? _ref5 : Object, typeof (_ref6 = typeof AuthCredential !== "undefined" && AuthCredential) === "function" ? _ref6 : Object])
|
|
3358
|
+
], DefaultRecoveryWorkflow);
|
|
3359
|
+
//#endregion
|
|
3319
3360
|
//#region src/workflows/auth-email-outlet.ts
|
|
3320
3361
|
/**
|
|
3321
3362
|
* Build the email outlet that delivers magic links via the consumer's
|
|
@@ -3344,4 +3385,4 @@ function createAuthEmailOutlet(deps) {
|
|
|
3344
3385
|
});
|
|
3345
3386
|
}
|
|
3346
3387
|
//#endregion
|
|
3347
|
-
export { AuthController, AuthGuarded, DEFAULT_AUTH_WORKFLOWS, InviteWorkflow, LoginWorkflow, Public, RecoveryWorkflow, UserId, WfTrigger, WfTriggerProvider, authGuardInterceptor, createAuthEmailOutlet, generateMagicLinkToken, getAuthMate, mergeInviteOpts, mergeLoginOpts, mergeRecoveryOpts, parseInviteRoles, useAuth };
|
|
3388
|
+
export { AuthController, AuthGuarded, DEFAULT_AUTH_WORKFLOWS, DefaultInviteWorkflow, DefaultLoginWorkflow, DefaultRecoveryWorkflow, InviteWorkflow, LoginWorkflow, Public, RecoveryWorkflow, UserId, WfTrigger, WfTriggerProvider, authGuardInterceptor, createAuthEmailOutlet, generateMagicLinkToken, getAuthMate, mergeInviteOpts, mergeLoginOpts, mergeRecoveryOpts, parseInviteRoles, useAuth };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aooth/auth-moost",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Moost auth integration for aoothjs — AuthGuard interceptor, useAuth composable, REST endpoints, workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aoothjs",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@atscript/moost-wf": "^0.1.65",
|
|
55
|
-
"@aooth/arbac-moost": "^0.1.
|
|
56
|
-
"@aooth/auth": "0.1.
|
|
57
|
-
"@aooth/user": "0.1.
|
|
55
|
+
"@aooth/arbac-moost": "^0.1.3",
|
|
56
|
+
"@aooth/auth": "0.1.3",
|
|
57
|
+
"@aooth/user": "0.1.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@atscript/core": "^0.1.56",
|