quidproquo-core 0.1.9 → 0.1.10
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/lib/commonjs/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.d.ts +1 -0
- package/lib/commonjs/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.js +1 -0
- package/lib/commonjs/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.js.map +1 -1
- package/lib/commonjs/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.d.ts +1 -0
- package/lib/commonjs/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.js.map +1 -1
- package/lib/commonjs/actions/userDirectory/UserDirectoryActionType.d.ts +2 -0
- package/lib/commonjs/actions/userDirectory/UserDirectoryActionType.js +2 -0
- package/lib/commonjs/actions/userDirectory/UserDirectoryActionType.js.map +1 -1
- package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.d.ts +6 -0
- package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.js +23 -0
- package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.js.map +1 -0
- package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.d.ts +12 -0
- package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.js +3 -0
- package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.js.map +1 -0
- package/lib/commonjs/actions/userDirectory/UserDirectorySignOutUserActionRequester.d.ts +6 -0
- package/lib/commonjs/actions/userDirectory/UserDirectorySignOutUserActionRequester.js +23 -0
- package/lib/commonjs/actions/userDirectory/UserDirectorySignOutUserActionRequester.js.map +1 -0
- package/lib/commonjs/actions/userDirectory/UserDirectorySignOutUserActionTypes.d.ts +11 -0
- package/lib/commonjs/actions/userDirectory/UserDirectorySignOutUserActionTypes.js +3 -0
- package/lib/commonjs/actions/userDirectory/UserDirectorySignOutUserActionTypes.js.map +1 -0
- package/lib/commonjs/actions/userDirectory/index.d.ts +4 -0
- package/lib/commonjs/actions/userDirectory/index.js +4 -0
- package/lib/commonjs/actions/userDirectory/index.js.map +1 -1
- package/lib/commonjs/config/settings/userDirectory.d.ts +2 -0
- package/lib/commonjs/config/settings/userDirectory.js +1 -0
- package/lib/commonjs/config/settings/userDirectory.js.map +1 -1
- package/lib/commonjs/createImplementationRuntime.js +8 -0
- package/lib/commonjs/createImplementationRuntime.js.map +1 -1
- package/lib/commonjs/runtime/resolveStory.js +9 -5
- package/lib/commonjs/runtime/resolveStory.js.map +1 -1
- package/lib/commonjs/types/UnionToIntersection.d.ts +1 -0
- package/lib/commonjs/types/UnionToIntersection.js +3 -0
- package/lib/commonjs/types/UnionToIntersection.js.map +1 -0
- package/lib/commonjs/types/index.d.ts +1 -0
- package/lib/commonjs/types/index.js +1 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/esm/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.d.ts +1 -0
- package/lib/esm/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.js +1 -0
- package/lib/esm/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.js.map +1 -1
- package/lib/esm/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.d.ts +1 -0
- package/lib/esm/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.js.map +1 -1
- package/lib/esm/actions/userDirectory/UserDirectoryActionType.d.ts +2 -0
- package/lib/esm/actions/userDirectory/UserDirectoryActionType.js +2 -0
- package/lib/esm/actions/userDirectory/UserDirectoryActionType.js.map +1 -1
- package/lib/esm/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.d.ts +6 -0
- package/lib/esm/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.js +19 -0
- package/lib/esm/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.js.map +1 -0
- package/lib/esm/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.d.ts +12 -0
- package/lib/esm/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.js +2 -0
- package/lib/esm/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.js.map +1 -0
- package/lib/esm/actions/userDirectory/UserDirectorySignOutUserActionRequester.d.ts +6 -0
- package/lib/esm/actions/userDirectory/UserDirectorySignOutUserActionRequester.js +19 -0
- package/lib/esm/actions/userDirectory/UserDirectorySignOutUserActionRequester.js.map +1 -0
- package/lib/esm/actions/userDirectory/UserDirectorySignOutUserActionTypes.d.ts +11 -0
- package/lib/esm/actions/userDirectory/UserDirectorySignOutUserActionTypes.js +2 -0
- package/lib/esm/actions/userDirectory/UserDirectorySignOutUserActionTypes.js.map +1 -0
- package/lib/esm/actions/userDirectory/index.d.ts +4 -0
- package/lib/esm/actions/userDirectory/index.js +4 -0
- package/lib/esm/actions/userDirectory/index.js.map +1 -1
- package/lib/esm/config/settings/userDirectory.d.ts +2 -0
- package/lib/esm/config/settings/userDirectory.js +1 -0
- package/lib/esm/config/settings/userDirectory.js.map +1 -1
- package/lib/esm/createImplementationRuntime.js +8 -0
- package/lib/esm/createImplementationRuntime.js.map +1 -1
- package/lib/esm/runtime/resolveStory.js +9 -5
- package/lib/esm/runtime/resolveStory.js.map +1 -1
- package/lib/esm/types/UnionToIntersection.d.ts +1 -0
- package/lib/esm/types/UnionToIntersection.js +2 -0
- package/lib/esm/types/UnionToIntersection.js.map +1 -0
- package/lib/esm/types/index.d.ts +1 -0
- package/lib/esm/types/index.js +1 -0
- package/lib/esm/types/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,4 +5,5 @@ export declare const FileGenerateTemporaryUploadSecureUrlErrorTypeEnum: {
|
|
|
5
5
|
};
|
|
6
6
|
export declare function askFileGenerateTemporaryUploadSecureUrl(drive: string, filepath: string, expirationMs: number, advancedOptions?: {
|
|
7
7
|
contentType?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentType'];
|
|
8
|
+
contentDisposition?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentDisposition'];
|
|
8
9
|
}, scope?: string): FileGenerateTemporaryUploadSecureUrlActionRequester;
|
|
@@ -16,6 +16,7 @@ function* askFileGenerateTemporaryUploadSecureUrl(drive, filepath, expirationMs,
|
|
|
16
16
|
filepath,
|
|
17
17
|
expirationMs,
|
|
18
18
|
contentType: advancedOptions === null || advancedOptions === void 0 ? void 0 : advancedOptions.contentType,
|
|
19
|
+
contentDisposition: advancedOptions === null || advancedOptions === void 0 ? void 0 : advancedOptions.contentDisposition,
|
|
19
20
|
// maxSizeBytes: advancedOptions?.maxSizeBytes,
|
|
20
21
|
scope,
|
|
21
22
|
},
|
package/lib/commonjs/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.ts"],"names":[],"mappings":";;;AAYA,
|
|
1
|
+
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.ts"],"names":[],"mappings":";;;AAYA,0FAuBC;AAnCD,uCAAuD;AACvD,qDAAkD;AAMrC,QAAA,iDAAiD,GAAG,IAAA,gCAAwB,EAAC,+BAAc,CAAC,gCAAgC,EAAE;IACzI,mBAAmB,EAAE,uDAAuD;IAC5E,cAAc,EAAE,2CAA2C;CAC5D,CAAC,CAAC;AAEH,QAAe,CAAC,CAAC,uCAAuC,CACtD,KAAa,EACb,QAAgB,EAChB,YAAoB,EACpB,eAIC,EACD,KAAc;IAEd,OAAO,MAAM;QACX,IAAI,EAAE,+BAAc,CAAC,gCAAgC;QACrD,OAAO,EAAE;YACP,KAAK;YACL,QAAQ;YACR,YAAY;YACZ,WAAW,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW;YACzC,kBAAkB,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,kBAAkB;YACvD,+CAA+C;YAC/C,KAAK;SACN;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { createErrorEnumForAction } from '../../types';\nimport { FileActionType } from './FileActionType';\nimport {\n FileGenerateTemporaryUploadSecureUrlActionPayload,\n FileGenerateTemporaryUploadSecureUrlActionRequester,\n} from './FileGenerateTemporaryUploadSecureUrlActionTypes';\n\nexport const FileGenerateTemporaryUploadSecureUrlErrorTypeEnum = createErrorEnumForAction(FileActionType.GenerateTemporaryUploadSecureUrl, [\n 'ExpirationTooLong', // requested expiry exceeds max length of time possible\n 'InvalidScope', // scope is not a valid single path segment\n]);\n\nexport function* askFileGenerateTemporaryUploadSecureUrl(\n drive: string,\n filepath: string,\n expirationMs: number,\n advancedOptions?: {\n contentType?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentType'];\n contentDisposition?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentDisposition'];\n // maxSizeBytes?: FileGenerateTemporaryUploadSecureUrlActionPayload['maxSizeBytes']\n },\n scope?: string,\n): FileGenerateTemporaryUploadSecureUrlActionRequester {\n return yield {\n type: FileActionType.GenerateTemporaryUploadSecureUrl,\n payload: {\n drive,\n filepath,\n expirationMs,\n contentType: advancedOptions?.contentType,\n contentDisposition: advancedOptions?.contentDisposition,\n // maxSizeBytes: advancedOptions?.maxSizeBytes,\n scope,\n },\n };\n}\n"]}
|
|
@@ -5,6 +5,7 @@ export interface FileGenerateTemporaryUploadSecureUrlActionPayload {
|
|
|
5
5
|
filepath: string;
|
|
6
6
|
expirationMs: number;
|
|
7
7
|
contentType?: string;
|
|
8
|
+
contentDisposition?: string;
|
|
8
9
|
scope?: string;
|
|
9
10
|
}
|
|
10
11
|
export interface FileGenerateTemporaryUploadSecureUrlAction extends Action<FileGenerateTemporaryUploadSecureUrlActionPayload> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { FileActionType } from './FileActionType';\n\n// Payload\nexport interface FileGenerateTemporaryUploadSecureUrlActionPayload {\n drive: string;\n filepath: string;\n expirationMs: number;\n // maxSizeBytes?: number;\n contentType?: string;\n scope?: string;\n}\n\n// Action\nexport interface FileGenerateTemporaryUploadSecureUrlAction extends Action<FileGenerateTemporaryUploadSecureUrlActionPayload> {\n type: FileActionType.GenerateTemporaryUploadSecureUrl;\n payload: FileGenerateTemporaryUploadSecureUrlActionPayload;\n}\n\n// Function Types\nexport type FileGenerateTemporaryUploadSecureUrlActionProcessor = ActionProcessor<FileGenerateTemporaryUploadSecureUrlAction, string>;\nexport type FileGenerateTemporaryUploadSecureUrlActionRequester = ActionRequester<FileGenerateTemporaryUploadSecureUrlAction, string>;\n"]}
|
|
1
|
+
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { FileActionType } from './FileActionType';\n\n// Payload\nexport interface FileGenerateTemporaryUploadSecureUrlActionPayload {\n drive: string;\n filepath: string;\n expirationMs: number;\n // maxSizeBytes?: number;\n contentType?: string;\n // Content-Disposition to bake into the upload so the stored object serves with it (e.g. 'inline'\n // so a PDF previews in an <iframe> instead of force-downloading). On S3 it is signed into the PUT\n // (the client must send the matching header); the dev store persists it as sidecar metadata.\n contentDisposition?: string;\n scope?: string;\n}\n\n// Action\nexport interface FileGenerateTemporaryUploadSecureUrlAction extends Action<FileGenerateTemporaryUploadSecureUrlActionPayload> {\n type: FileActionType.GenerateTemporaryUploadSecureUrl;\n payload: FileGenerateTemporaryUploadSecureUrlActionPayload;\n}\n\n// Function Types\nexport type FileGenerateTemporaryUploadSecureUrlActionProcessor = ActionProcessor<FileGenerateTemporaryUploadSecureUrlAction, string>;\nexport type FileGenerateTemporaryUploadSecureUrlActionRequester = ActionRequester<FileGenerateTemporaryUploadSecureUrlAction, string>;\n"]}
|
|
@@ -6,6 +6,8 @@ export declare enum UserDirectoryActionType {
|
|
|
6
6
|
ForgotPassword = "@quidproquo-core/UserDirectory/ForgotPassword",
|
|
7
7
|
ConfirmForgotPassword = "@quidproquo-core/UserDirectory/ConfirmForgotPassword",
|
|
8
8
|
RefreshToken = "@quidproquo-core/UserDirectory/RefreshToken",
|
|
9
|
+
SignOutUser = "@quidproquo-core/UserDirectory/SignOutUser",
|
|
10
|
+
RevokeRefreshToken = "@quidproquo-core/UserDirectory/RevokeRefreshToken",
|
|
9
11
|
RequestEmailVerification = "@quidproquo-core/UserDirectory/RequestEmailVerification",
|
|
10
12
|
ConfirmEmailVerification = "@quidproquo-core/UserDirectory/ConfirmEmailVerification",
|
|
11
13
|
ReadAccessToken = "@quidproquo-core/UserDirectory/ReadAccessToken",
|
|
@@ -8,6 +8,8 @@ var UserDirectoryActionType;
|
|
|
8
8
|
UserDirectoryActionType["ForgotPassword"] = "@quidproquo-core/UserDirectory/ForgotPassword";
|
|
9
9
|
UserDirectoryActionType["ConfirmForgotPassword"] = "@quidproquo-core/UserDirectory/ConfirmForgotPassword";
|
|
10
10
|
UserDirectoryActionType["RefreshToken"] = "@quidproquo-core/UserDirectory/RefreshToken";
|
|
11
|
+
UserDirectoryActionType["SignOutUser"] = "@quidproquo-core/UserDirectory/SignOutUser";
|
|
12
|
+
UserDirectoryActionType["RevokeRefreshToken"] = "@quidproquo-core/UserDirectory/RevokeRefreshToken";
|
|
11
13
|
UserDirectoryActionType["RequestEmailVerification"] = "@quidproquo-core/UserDirectory/RequestEmailVerification";
|
|
12
14
|
UserDirectoryActionType["ConfirmEmailVerification"] = "@quidproquo-core/UserDirectory/ConfirmEmailVerification";
|
|
13
15
|
UserDirectoryActionType["ReadAccessToken"] = "@quidproquo-core/UserDirectory/ReadAccessToken";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserDirectoryActionType.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryActionType.ts"],"names":[],"mappings":";;;AAGA,IAAY,
|
|
1
|
+
{"version":3,"file":"UserDirectoryActionType.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryActionType.ts"],"names":[],"mappings":";;;AAGA,IAAY,uBAsBX;AAtBD,WAAY,uBAAuB;IACjC,mFAAwD,CAAA;IACxD,+FAAoE,CAAA;IACpE,2FAAgE,CAAA;IAChE,yGAA8E,CAAA;IAC9E,uFAA4D,CAAA;IAC5D,qFAA0D,CAAA;IAC1D,mGAAwE,CAAA;IACxE,+GAAoF,CAAA;IACpF,+GAAoF,CAAA;IACpF,6FAAkE,CAAA;IAClE,2FAAgE,CAAA;IAChE,iGAAsE,CAAA;IACtE,2GAAgF,CAAA;IAChF,2GAAgF,CAAA;IAChF,iGAAsE,CAAA;IACtE,iHAAsF,CAAA;IACtF,iGAAsE,CAAA;IACtE,2FAAgE,CAAA;IAChE,qFAA0D,CAAA;IAC1D,+EAAoD,CAAA;IACpD,qGAA0E,CAAA;AAC5E,CAAC,EAtBW,uBAAuB,uCAAvB,uBAAuB,QAsBlC","sourcesContent":["import { QpqIsoDateTime } from '../../types/QpqIsoDateTime';\nimport { AuthenticateUserChallenge } from './types';\n\nexport enum UserDirectoryActionType {\n CreateUser = '@quidproquo-core/UserDirectory/CreateUser',\n AuthenticateUser = '@quidproquo-core/UserDirectory/AuthenticateUser',\n ForgotPassword = '@quidproquo-core/UserDirectory/ForgotPassword',\n ConfirmForgotPassword = '@quidproquo-core/UserDirectory/ConfirmForgotPassword',\n RefreshToken = '@quidproquo-core/UserDirectory/RefreshToken',\n SignOutUser = '@quidproquo-core/UserDirectory/SignOutUser',\n RevokeRefreshToken = '@quidproquo-core/UserDirectory/RevokeRefreshToken',\n RequestEmailVerification = '@quidproquo-core/UserDirectory/RequestEmailVerification',\n ConfirmEmailVerification = '@quidproquo-core/UserDirectory/ConfirmEmailVerification',\n ReadAccessToken = '@quidproquo-core/UserDirectory/ReadAccessToken',\n SetAccessToken = '@quidproquo-core/UserDirectory/SetAccessToken',\n DecodeAccessToken = '@quidproquo-core/UserDirectory/DecodeAccessToken',\n RespondToAuthChallenge = '@quidproquo-core/UserDirectory/RespondToAuthChallenge',\n AssociateSoftwareToken = '@quidproquo-core/UserDirectory/AssociateSoftwareToken',\n GetUserAttributes = '@quidproquo-core/UserDirectory/GetUserAttributes',\n GetUserAttributesByUserId = '@quidproquo-core/UserDirectory/GetUserAttributesByUserId',\n SetUserAttributes = '@quidproquo-core/UserDirectory/SetUserAttributes',\n ChangePassword = '@quidproquo-core/UserDirectory/ChangePassword',\n SetPassword = '@quidproquo-core/UserDirectory/SetPassword',\n GetUsers = '@quidproquo-core/UserDirectory/GetUsers',\n GetUsersByAttribute = '@quidproquo-core/UserDirectory/GetUsersByAttribute',\n}\n\nexport interface AuthenticationInfo {\n accessToken?: string;\n expirationDurationInSeconds?: number;\n expiresAt?: QpqIsoDateTime;\n idToken?: string;\n refreshToken?: string;\n tokenType?: string;\n}\n\nexport interface AuthenticationDeliveryDetails {\n attributeName: string;\n deliveryMedium: 'EMAIL' | 'SMS';\n destination: string;\n}\n\nexport interface AuthenticateUserResponse {\n challenge: AuthenticateUserChallenge;\n challengeParameters?: Record<string, string>;\n session?: string;\n\n authenticationInfo?: AuthenticationInfo;\n}\n\nexport interface UserAttributes {\n /** The user's email address */\n email?: string;\n /** Indicates whether the user's email address has been verified */\n emailVerified?: boolean;\n /** The user's unique identifier */\n userId?: string;\n /** The user's postal address */\n address?: string;\n /** The user's date of birth (YYYY-MM-DD format) */\n birthDate?: string;\n /** The user's last name or surname */\n familyName?: string;\n /** The user's gender (e.g., \"male\", \"female\", \"other\") */\n gender?: string;\n /** The user's first name or given name */\n givenName?: string;\n /** The user's preferred locale (e.g., \"en-US\", \"fr-FR\") */\n locale?: string;\n /** The user's middle name */\n middleName?: string;\n /** The user's full name */\n name?: string;\n /** The user's nickname or alias */\n nickname?: string;\n /** The user's phone number (in E.164 format, e.g., \"+1-555-123-4567\") */\n phoneNumber?: string;\n /** The URL of the user's profile picture */\n picture?: string;\n /** The user's preferred username, if different from the given name */\n preferredUsername?: string;\n /** The URL of the user's profile page */\n profile?: string;\n /** The URL of the user's personal website or blog */\n website?: string;\n /** The user's timezone (e.g., \"America/Los_Angeles\", \"Europe/London\") */\n zoneInfo?: string;\n}\n"]}
|
package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UserDirectoryRevokeRefreshTokenActionRequester } from './UserDirectoryRevokeRefreshTokenActionTypes';
|
|
2
|
+
export declare const UserDirectoryRevokeRefreshTokenErrorTypeEnum: {
|
|
3
|
+
Unauthorized: string;
|
|
4
|
+
LimitExceeded: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function askUserDirectoryRevokeRefreshToken(userDirectoryName: string, refreshToken: string): UserDirectoryRevokeRefreshTokenActionRequester;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserDirectoryRevokeRefreshTokenErrorTypeEnum = void 0;
|
|
4
|
+
exports.askUserDirectoryRevokeRefreshToken = askUserDirectoryRevokeRefreshToken;
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
const UserDirectoryActionType_1 = require("./UserDirectoryActionType");
|
|
7
|
+
exports.UserDirectoryRevokeRefreshTokenErrorTypeEnum = (0, types_1.createErrorEnumForAction)(UserDirectoryActionType_1.UserDirectoryActionType.RevokeRefreshToken, [
|
|
8
|
+
'Unauthorized', // the refresh token is invalid/already revoked, or revocation is disabled on the app client
|
|
9
|
+
'LimitExceeded', // too many attempts; the caller should back off and retry later
|
|
10
|
+
]);
|
|
11
|
+
// Revokes a SINGLE refresh token (and every access token minted from it) — the "log out
|
|
12
|
+
// this device" primitive. Unlike SignOutUser (which revokes all of a user's sessions), this
|
|
13
|
+
// targets exactly the session that holds this refresh token, so other devices stay signed in.
|
|
14
|
+
function* askUserDirectoryRevokeRefreshToken(userDirectoryName, refreshToken) {
|
|
15
|
+
return yield {
|
|
16
|
+
type: UserDirectoryActionType_1.UserDirectoryActionType.RevokeRefreshToken,
|
|
17
|
+
payload: {
|
|
18
|
+
userDirectoryName,
|
|
19
|
+
refreshToken,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=UserDirectoryRevokeRefreshTokenActionRequester.js.map
|
package/lib/commonjs/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectoryRevokeRefreshTokenActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.ts"],"names":[],"mappings":";;;AAYA,gFASC;AArBD,uCAAuD;AACvD,uEAAoE;AAGvD,QAAA,4CAA4C,GAAG,IAAA,gCAAwB,EAAC,iDAAuB,CAAC,kBAAkB,EAAE;IAC/H,cAAc,EAAE,4FAA4F;IAC5G,eAAe,EAAE,gEAAgE;CAClF,CAAC,CAAC;AAEH,wFAAwF;AACxF,4FAA4F;AAC5F,8FAA8F;AAC9F,QAAe,CAAC,CAAC,kCAAkC,CAAC,iBAAyB,EAAE,YAAoB;IACjG,OAAO,MAAM;QACX,IAAI,EAAE,iDAAuB,CAAC,kBAAkB;QAChD,OAAO,EAAE;YACP,iBAAiB;YAEjB,YAAY;SACb;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { createErrorEnumForAction } from '../../types';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\nimport { UserDirectoryRevokeRefreshTokenActionRequester } from './UserDirectoryRevokeRefreshTokenActionTypes';\n\nexport const UserDirectoryRevokeRefreshTokenErrorTypeEnum = createErrorEnumForAction(UserDirectoryActionType.RevokeRefreshToken, [\n 'Unauthorized', // the refresh token is invalid/already revoked, or revocation is disabled on the app client\n 'LimitExceeded', // too many attempts; the caller should back off and retry later\n]);\n\n// Revokes a SINGLE refresh token (and every access token minted from it) — the \"log out\n// this device\" primitive. Unlike SignOutUser (which revokes all of a user's sessions), this\n// targets exactly the session that holds this refresh token, so other devices stay signed in.\nexport function* askUserDirectoryRevokeRefreshToken(userDirectoryName: string, refreshToken: string): UserDirectoryRevokeRefreshTokenActionRequester {\n return yield {\n type: UserDirectoryActionType.RevokeRefreshToken,\n payload: {\n userDirectoryName,\n\n refreshToken,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
|
+
export interface UserDirectoryRevokeRefreshTokenActionPayload {
|
|
4
|
+
userDirectoryName: string;
|
|
5
|
+
refreshToken: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UserDirectoryRevokeRefreshTokenAction extends Action<UserDirectoryRevokeRefreshTokenActionPayload> {
|
|
8
|
+
type: UserDirectoryActionType.RevokeRefreshToken;
|
|
9
|
+
payload: UserDirectoryRevokeRefreshTokenActionPayload;
|
|
10
|
+
}
|
|
11
|
+
export type UserDirectoryRevokeRefreshTokenActionProcessor = ActionProcessor<UserDirectoryRevokeRefreshTokenAction, void>;
|
|
12
|
+
export type UserDirectoryRevokeRefreshTokenActionRequester = ActionRequester<UserDirectoryRevokeRefreshTokenAction, void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectoryRevokeRefreshTokenActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\n\n// Payload\nexport interface UserDirectoryRevokeRefreshTokenActionPayload {\n userDirectoryName: string;\n\n refreshToken: string;\n}\n\n// Action\nexport interface UserDirectoryRevokeRefreshTokenAction extends Action<UserDirectoryRevokeRefreshTokenActionPayload> {\n type: UserDirectoryActionType.RevokeRefreshToken;\n payload: UserDirectoryRevokeRefreshTokenActionPayload;\n}\n\n// Function Types\nexport type UserDirectoryRevokeRefreshTokenActionProcessor = ActionProcessor<UserDirectoryRevokeRefreshTokenAction, void>;\nexport type UserDirectoryRevokeRefreshTokenActionRequester = ActionRequester<UserDirectoryRevokeRefreshTokenAction, void>;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UserDirectorySignOutUserActionRequester } from './UserDirectorySignOutUserActionTypes';
|
|
2
|
+
export declare const UserDirectorySignOutUserErrorTypeEnum: {
|
|
3
|
+
Unauthorized: string;
|
|
4
|
+
LimitExceeded: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function askUserDirectorySignOutUser(accessToken: string): UserDirectorySignOutUserActionRequester;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserDirectorySignOutUserErrorTypeEnum = void 0;
|
|
4
|
+
exports.askUserDirectorySignOutUser = askUserDirectorySignOutUser;
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
const UserDirectoryActionType_1 = require("./UserDirectoryActionType");
|
|
7
|
+
exports.UserDirectorySignOutUserErrorTypeEnum = (0, types_1.createErrorEnumForAction)(UserDirectoryActionType_1.UserDirectoryActionType.SignOutUser, [
|
|
8
|
+
'Unauthorized', // the access token is missing/invalid/expired — there is nothing to revoke
|
|
9
|
+
'LimitExceeded', // too many attempts; the caller should back off and retry later
|
|
10
|
+
]);
|
|
11
|
+
// Globally signs the user out: revokes EVERY refresh token issued to the owner of this
|
|
12
|
+
// access token, so a stolen/persisted refresh token stops working (logout / compromise
|
|
13
|
+
// response). Access tokens already minted remain valid until they expire (stateless JWTs),
|
|
14
|
+
// so keep the access-token validity short.
|
|
15
|
+
function* askUserDirectorySignOutUser(accessToken) {
|
|
16
|
+
return yield {
|
|
17
|
+
type: UserDirectoryActionType_1.UserDirectoryActionType.SignOutUser,
|
|
18
|
+
payload: {
|
|
19
|
+
accessToken,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=UserDirectorySignOutUserActionRequester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectorySignOutUserActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectorySignOutUserActionRequester.ts"],"names":[],"mappings":";;;AAaA,kEAOC;AApBD,uCAAuD;AACvD,uEAAoE;AAGvD,QAAA,qCAAqC,GAAG,IAAA,gCAAwB,EAAC,iDAAuB,CAAC,WAAW,EAAE;IACjH,cAAc,EAAE,2EAA2E;IAC3F,eAAe,EAAE,gEAAgE;CAClF,CAAC,CAAC;AAEH,uFAAuF;AACvF,uFAAuF;AACvF,2FAA2F;AAC3F,2CAA2C;AAC3C,QAAe,CAAC,CAAC,2BAA2B,CAAC,WAAmB;IAC9D,OAAO,MAAM;QACX,IAAI,EAAE,iDAAuB,CAAC,WAAW;QACzC,OAAO,EAAE;YACP,WAAW;SACZ;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { createErrorEnumForAction } from '../../types';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\nimport { UserDirectorySignOutUserActionRequester } from './UserDirectorySignOutUserActionTypes';\n\nexport const UserDirectorySignOutUserErrorTypeEnum = createErrorEnumForAction(UserDirectoryActionType.SignOutUser, [\n 'Unauthorized', // the access token is missing/invalid/expired — there is nothing to revoke\n 'LimitExceeded', // too many attempts; the caller should back off and retry later\n]);\n\n// Globally signs the user out: revokes EVERY refresh token issued to the owner of this\n// access token, so a stolen/persisted refresh token stops working (logout / compromise\n// response). Access tokens already minted remain valid until they expire (stateless JWTs),\n// so keep the access-token validity short.\nexport function* askUserDirectorySignOutUser(accessToken: string): UserDirectorySignOutUserActionRequester {\n return yield {\n type: UserDirectoryActionType.SignOutUser,\n payload: {\n accessToken,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
|
+
export interface UserDirectorySignOutUserActionPayload {
|
|
4
|
+
accessToken: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UserDirectorySignOutUserAction extends Action<UserDirectorySignOutUserActionPayload> {
|
|
7
|
+
type: UserDirectoryActionType.SignOutUser;
|
|
8
|
+
payload: UserDirectorySignOutUserActionPayload;
|
|
9
|
+
}
|
|
10
|
+
export type UserDirectorySignOutUserActionProcessor = ActionProcessor<UserDirectorySignOutUserAction, void>;
|
|
11
|
+
export type UserDirectorySignOutUserActionRequester = ActionRequester<UserDirectorySignOutUserAction, void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectorySignOutUserActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectorySignOutUserActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\n\n// Payload\nexport interface UserDirectorySignOutUserActionPayload {\n accessToken: string;\n}\n\n// Action\nexport interface UserDirectorySignOutUserAction extends Action<UserDirectorySignOutUserActionPayload> {\n type: UserDirectoryActionType.SignOutUser;\n payload: UserDirectorySignOutUserActionPayload;\n}\n\n// Function Types\nexport type UserDirectorySignOutUserActionProcessor = ActionProcessor<UserDirectorySignOutUserAction, void>;\nexport type UserDirectorySignOutUserActionRequester = ActionRequester<UserDirectorySignOutUserAction, void>;\n"]}
|
|
@@ -32,9 +32,13 @@ export * from './UserDirectoryRequestEmailVerificationActionRequester';
|
|
|
32
32
|
export * from './UserDirectoryRequestEmailVerificationActionTypes';
|
|
33
33
|
export * from './UserDirectoryRespondToAuthChallengeActionRequester';
|
|
34
34
|
export * from './UserDirectoryRespondToAuthChallengeActionTypes';
|
|
35
|
+
export * from './UserDirectoryRevokeRefreshTokenActionRequester';
|
|
36
|
+
export * from './UserDirectoryRevokeRefreshTokenActionTypes';
|
|
35
37
|
export * from './UserDirectorySetAccessTokenActionRequester';
|
|
36
38
|
export * from './UserDirectorySetAccessTokenActionTypes';
|
|
37
39
|
export * from './UserDirectorySetPasswordActionRequester';
|
|
38
40
|
export * from './UserDirectorySetPasswordActionTypes';
|
|
39
41
|
export * from './UserDirectorySetUserAttributesActionRequester';
|
|
40
42
|
export * from './UserDirectorySetUserAttributesActionTypes';
|
|
43
|
+
export * from './UserDirectorySignOutUserActionRequester';
|
|
44
|
+
export * from './UserDirectorySignOutUserActionTypes';
|
|
@@ -48,10 +48,14 @@ __exportStar(require("./UserDirectoryRequestEmailVerificationActionRequester"),
|
|
|
48
48
|
__exportStar(require("./UserDirectoryRequestEmailVerificationActionTypes"), exports);
|
|
49
49
|
__exportStar(require("./UserDirectoryRespondToAuthChallengeActionRequester"), exports);
|
|
50
50
|
__exportStar(require("./UserDirectoryRespondToAuthChallengeActionTypes"), exports);
|
|
51
|
+
__exportStar(require("./UserDirectoryRevokeRefreshTokenActionRequester"), exports);
|
|
52
|
+
__exportStar(require("./UserDirectoryRevokeRefreshTokenActionTypes"), exports);
|
|
51
53
|
__exportStar(require("./UserDirectorySetAccessTokenActionRequester"), exports);
|
|
52
54
|
__exportStar(require("./UserDirectorySetAccessTokenActionTypes"), exports);
|
|
53
55
|
__exportStar(require("./UserDirectorySetPasswordActionRequester"), exports);
|
|
54
56
|
__exportStar(require("./UserDirectorySetPasswordActionTypes"), exports);
|
|
55
57
|
__exportStar(require("./UserDirectorySetUserAttributesActionRequester"), exports);
|
|
56
58
|
__exportStar(require("./UserDirectorySetUserAttributesActionTypes"), exports);
|
|
59
|
+
__exportStar(require("./UserDirectorySignOutUserActionRequester"), exports);
|
|
60
|
+
__exportStar(require("./UserDirectorySignOutUserActionTypes"), exports);
|
|
57
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,4DAA0C;AAC1C,uFAAqE;AACrE,mFAAiE;AACjE,iFAA+D;AAC/D,6EAA2D;AAC3D,+EAA6D;AAC7D,2EAAyD;AACzD,yFAAuE;AACvE,qFAAmE;AACnE,sFAAoE;AACpE,kFAAgE;AAChE,2EAAyD;AACzD,uEAAqD;AACrD,kFAAgE;AAChE,8EAA4D;AAC5D,+EAA6D;AAC7D,2EAAyD;AACzD,kFAAgE;AAChE,8EAA4D;AAC5D,0FAAwE;AACxE,sFAAoE;AACpE,yEAAuD;AACvD,qEAAmD;AACnD,oFAAkE;AAClE,gFAA8D;AAC9D,gFAA8D;AAC9D,4EAA0D;AAC1D,6EAA2D;AAC3D,yEAAuD;AACvD,yFAAuE;AACvE,qFAAmE;AACnE,uFAAqE;AACrE,mFAAiE;AACjE,+EAA6D;AAC7D,2EAAyD;AACzD,4EAA0D;AAC1D,wEAAsD;AACtD,kFAAgE;AAChE,8EAA4D","sourcesContent":["export * from './types';\nexport * from './UserDirectoryActionType';\nexport * from './UserDirectoryAssociateSoftwareTokenActionRequester';\nexport * from './UserDirectoryAssociateSoftwareTokenActionTypes';\nexport * from './UserDirectoryAuthenticateUserActionRequester';\nexport * from './UserDirectoryAuthenticateUserActionTypes';\nexport * from './UserDirectoryChangePasswordActionRequester';\nexport * from './UserDirectoryChangePasswordActionTypes';\nexport * from './UserDirectoryConfirmEmailVerificationActionRequester';\nexport * from './UserDirectoryConfirmEmailVerificationActionTypes';\nexport * from './UserDirectoryConfirmForgotPasswordActionRequester';\nexport * from './UserDirectoryConfirmForgotPasswordActionTypes';\nexport * from './UserDirectoryCreateUserActionRequester';\nexport * from './UserDirectoryCreateUserActionTypes';\nexport * from './UserDirectoryDecodeAccessTokenActionRequester';\nexport * from './UserDirectoryDecodeAccessTokenActionTypes';\nexport * from './UserDirectoryForgotPasswordActionRequester';\nexport * from './UserDirectoryForgotPasswordActionTypes';\nexport * from './UserDirectoryGetUserAttributesActionRequester';\nexport * from './UserDirectoryGetUserAttributesActionTypes';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionRequester';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionTypes';\nexport * from './UserDirectoryGetUsersActionRequester';\nexport * from './UserDirectoryGetUsersActionTypes';\nexport * from './UserDirectoryGetUsersByAttributeActionRequester';\nexport * from './UserDirectoryGetUsersByAttributeActionTypes';\nexport * from './UserDirectoryReadAccessTokenActionRequester';\nexport * from './UserDirectoryReadAccessTokenActionTypes';\nexport * from './UserDirectoryRefreshTokenActionRequester';\nexport * from './UserDirectoryRefreshTokenActionTypes';\nexport * from './UserDirectoryRequestEmailVerificationActionRequester';\nexport * from './UserDirectoryRequestEmailVerificationActionTypes';\nexport * from './UserDirectoryRespondToAuthChallengeActionRequester';\nexport * from './UserDirectoryRespondToAuthChallengeActionTypes';\nexport * from './UserDirectorySetAccessTokenActionRequester';\nexport * from './UserDirectorySetAccessTokenActionTypes';\nexport * from './UserDirectorySetPasswordActionRequester';\nexport * from './UserDirectorySetPasswordActionTypes';\nexport * from './UserDirectorySetUserAttributesActionRequester';\nexport * from './UserDirectorySetUserAttributesActionTypes';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,4DAA0C;AAC1C,uFAAqE;AACrE,mFAAiE;AACjE,iFAA+D;AAC/D,6EAA2D;AAC3D,+EAA6D;AAC7D,2EAAyD;AACzD,yFAAuE;AACvE,qFAAmE;AACnE,sFAAoE;AACpE,kFAAgE;AAChE,2EAAyD;AACzD,uEAAqD;AACrD,kFAAgE;AAChE,8EAA4D;AAC5D,+EAA6D;AAC7D,2EAAyD;AACzD,kFAAgE;AAChE,8EAA4D;AAC5D,0FAAwE;AACxE,sFAAoE;AACpE,yEAAuD;AACvD,qEAAmD;AACnD,oFAAkE;AAClE,gFAA8D;AAC9D,gFAA8D;AAC9D,4EAA0D;AAC1D,6EAA2D;AAC3D,yEAAuD;AACvD,yFAAuE;AACvE,qFAAmE;AACnE,uFAAqE;AACrE,mFAAiE;AACjE,mFAAiE;AACjE,+EAA6D;AAC7D,+EAA6D;AAC7D,2EAAyD;AACzD,4EAA0D;AAC1D,wEAAsD;AACtD,kFAAgE;AAChE,8EAA4D;AAC5D,4EAA0D;AAC1D,wEAAsD","sourcesContent":["export * from './types';\nexport * from './UserDirectoryActionType';\nexport * from './UserDirectoryAssociateSoftwareTokenActionRequester';\nexport * from './UserDirectoryAssociateSoftwareTokenActionTypes';\nexport * from './UserDirectoryAuthenticateUserActionRequester';\nexport * from './UserDirectoryAuthenticateUserActionTypes';\nexport * from './UserDirectoryChangePasswordActionRequester';\nexport * from './UserDirectoryChangePasswordActionTypes';\nexport * from './UserDirectoryConfirmEmailVerificationActionRequester';\nexport * from './UserDirectoryConfirmEmailVerificationActionTypes';\nexport * from './UserDirectoryConfirmForgotPasswordActionRequester';\nexport * from './UserDirectoryConfirmForgotPasswordActionTypes';\nexport * from './UserDirectoryCreateUserActionRequester';\nexport * from './UserDirectoryCreateUserActionTypes';\nexport * from './UserDirectoryDecodeAccessTokenActionRequester';\nexport * from './UserDirectoryDecodeAccessTokenActionTypes';\nexport * from './UserDirectoryForgotPasswordActionRequester';\nexport * from './UserDirectoryForgotPasswordActionTypes';\nexport * from './UserDirectoryGetUserAttributesActionRequester';\nexport * from './UserDirectoryGetUserAttributesActionTypes';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionRequester';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionTypes';\nexport * from './UserDirectoryGetUsersActionRequester';\nexport * from './UserDirectoryGetUsersActionTypes';\nexport * from './UserDirectoryGetUsersByAttributeActionRequester';\nexport * from './UserDirectoryGetUsersByAttributeActionTypes';\nexport * from './UserDirectoryReadAccessTokenActionRequester';\nexport * from './UserDirectoryReadAccessTokenActionTypes';\nexport * from './UserDirectoryRefreshTokenActionRequester';\nexport * from './UserDirectoryRefreshTokenActionTypes';\nexport * from './UserDirectoryRequestEmailVerificationActionRequester';\nexport * from './UserDirectoryRequestEmailVerificationActionTypes';\nexport * from './UserDirectoryRespondToAuthChallengeActionRequester';\nexport * from './UserDirectoryRespondToAuthChallengeActionTypes';\nexport * from './UserDirectoryRevokeRefreshTokenActionRequester';\nexport * from './UserDirectoryRevokeRefreshTokenActionTypes';\nexport * from './UserDirectorySetAccessTokenActionRequester';\nexport * from './UserDirectorySetAccessTokenActionTypes';\nexport * from './UserDirectorySetPasswordActionRequester';\nexport * from './UserDirectorySetPasswordActionTypes';\nexport * from './UserDirectorySetUserAttributesActionRequester';\nexport * from './UserDirectorySetUserAttributesActionTypes';\nexport * from './UserDirectorySignOutUserActionRequester';\nexport * from './UserDirectorySignOutUserActionTypes';\n"]}
|
|
@@ -25,6 +25,7 @@ export interface QPQConfigAdvancedUserDirectorySettings extends QPQConfigAdvance
|
|
|
25
25
|
dnsRecord?: AuthDirectoryDnsRecord;
|
|
26
26
|
customAuthRuntime?: CustomAuthRuntime;
|
|
27
27
|
mfa?: UserDirectoryMfaSettings;
|
|
28
|
+
accessTokenValidityMinutes?: number;
|
|
28
29
|
}
|
|
29
30
|
export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
30
31
|
name: string;
|
|
@@ -35,5 +36,6 @@ export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
|
35
36
|
dnsRecord?: AuthDirectoryDnsRecord;
|
|
36
37
|
customAuthRuntime?: CustomAuthRuntime;
|
|
37
38
|
mfa: UserDirectoryMfaSettings;
|
|
39
|
+
accessTokenValidityMinutes?: number;
|
|
38
40
|
}
|
|
39
41
|
export declare const defineUserDirectory: (name: string, options?: QPQConfigAdvancedUserDirectorySettings) => UserDirectoryQPQConfigSetting;
|
|
@@ -29,6 +29,7 @@ const defineUserDirectory = (name, options) => {
|
|
|
29
29
|
},
|
|
30
30
|
dnsRecord: options === null || options === void 0 ? void 0 : options.dnsRecord,
|
|
31
31
|
customAuthRuntime: options === null || options === void 0 ? void 0 : options.customAuthRuntime,
|
|
32
|
+
accessTokenValidityMinutes: options === null || options === void 0 ? void 0 : options.accessTokenValidityMinutes,
|
|
32
33
|
mfa: {
|
|
33
34
|
mode: (_f = (_e = options === null || options === void 0 ? void 0 : options.mfa) === null || _e === void 0 ? void 0 : _e.mode) !== null && _f !== void 0 ? _f : UserDirectoryMfaMode.off,
|
|
34
35
|
secondFactors: ((_h = (_g = options === null || options === void 0 ? void 0 : options.mfa) === null || _g === void 0 ? void 0 : _g.secondFactors) === null || _h === void 0 ? void 0 : _h.length) ? options.mfa.secondFactors : [UserDirectoryMfaSecondFactor.totp],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userDirectory.js","sourceRoot":"","sources":["../../../../src/config/settings/userDirectory.ts"],"names":[],"mappings":";;;AACA,4CAAqG;AACrG,gEAAiG;AAQjG,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACvB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,6CAAa,CAAA;IACb,sEAAsE;AACxE,CAAC,EAHW,4BAA4B,4CAA5B,4BAA4B,QAGvC;
|
|
1
|
+
{"version":3,"file":"userDirectory.js","sourceRoot":"","sources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AAE,IAAI,mCAAI,oBAAoB,CAAC,GAAG;YACpD,aAAa,EAAE,CAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAE,aAAa,0CAAE,MAAM,EAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC;SACrH;QAED,KAAK,EAAE,IAAA,uEAAoD,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC;KAC5E,CAAC,CAAA;CAAA,CAAC;AA3BU,QAAA,mBAAmB,uBA2B7B","sourcesContent":["import { CrossModuleOwner } from '../../types';\nimport { QPQConfigAdvancedSettings, QPQConfigSetting, QPQCoreConfigSettingType } from '../QPQConfig';\nimport { convertCrossModuleOwnerToGenericResourceNameOverride } from '../utils/crossModuleUtils';\nimport { CustomAuthRuntime, EmailTemplates } from './emailTemplates';\n\nexport type AuthDirectoryDnsRecord = {\n subdomain: string;\n rootDomain: string;\n};\n\nexport enum UserDirectoryMfaMode {\n off = 'off',\n optional = 'optional',\n required = 'required',\n}\n\nexport enum UserDirectoryMfaSecondFactor {\n totp = 'totp',\n // sms = 'sms', // future — additionally needs phone + SNS role infra.\n}\n\nexport interface UserDirectoryMfaSettings {\n mode: UserDirectoryMfaMode;\n\n // Enabled second factors. Defaults to [totp] when omitted.\n secondFactors?: UserDirectoryMfaSecondFactor[];\n}\n\nexport interface QPQConfigAdvancedUserDirectorySettings extends QPQConfigAdvancedSettings {\n phoneRequired?: boolean;\n\n selfSignUpEnabled?: boolean;\n\n emailTemplates?: EmailTemplates;\n\n owner?: CrossModuleOwner<'userDirectoryName'>;\n\n dnsRecord?: AuthDirectoryDnsRecord;\n\n customAuthRuntime?: CustomAuthRuntime;\n\n mfa?: UserDirectoryMfaSettings;\n\n // Access/ID token (JWT) lifetime in minutes. Shorter = a smaller window in which a\n // revoked session's still-valid access token keeps working (access tokens are stateless\n // and can't be revoked before expiry). Cognito allows 5–1440; omitted → Cognito default\n // (60).\n //\n // Generally web apps should refresh in the few mins so this should be > 5.\n accessTokenValidityMinutes?: number;\n}\n\nexport interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {\n name: string;\n\n phoneRequired: boolean;\n\n selfSignUpEnabled: boolean;\n\n emailTemplates: EmailTemplates;\n\n owner?: CrossModuleOwner;\n\n dnsRecord?: AuthDirectoryDnsRecord;\n\n customAuthRuntime?: CustomAuthRuntime;\n\n mfa: UserDirectoryMfaSettings;\n\n accessTokenValidityMinutes?: number;\n}\n\nexport const defineUserDirectory = (name: string, options?: QPQConfigAdvancedUserDirectorySettings): UserDirectoryQPQConfigSetting => ({\n configSettingType: QPQCoreConfigSettingType.userDirectory,\n uniqueKey: name,\n\n name,\n\n phoneRequired: options?.phoneRequired || false,\n\n selfSignUpEnabled: options?.selfSignUpEnabled ?? false,\n\n emailTemplates: {\n verifyEmail: options?.emailTemplates?.verifyEmail,\n resetPassword: options?.emailTemplates?.resetPassword,\n resetPasswordAdmin: options?.emailTemplates?.resetPasswordAdmin,\n },\n\n dnsRecord: options?.dnsRecord,\n customAuthRuntime: options?.customAuthRuntime,\n\n accessTokenValidityMinutes: options?.accessTokenValidityMinutes,\n\n mfa: {\n mode: options?.mfa?.mode ?? UserDirectoryMfaMode.off,\n secondFactors: options?.mfa?.secondFactors?.length ? options.mfa.secondFactors : [UserDirectoryMfaSecondFactor.totp],\n },\n\n owner: convertCrossModuleOwnerToGenericResourceNameOverride(options?.owner),\n});\n"]}
|
|
@@ -30,6 +30,14 @@ const createImplementationRuntime = (qpqConfig, tags, getDateNow, randomGuid, se
|
|
|
30
30
|
const moduleName = (0, qpqCoreUtils_1.getApplicationModuleName)(qpqConfig);
|
|
31
31
|
const resolveStory = (0, runtime_1.createRuntime)(qpqConfig, {
|
|
32
32
|
context: session.context,
|
|
33
|
+
// Service-local context and the caller's function globals travel into the
|
|
34
|
+
// nested implementation runtime (a within-service child: tool executor,
|
|
35
|
+
// drive file resolver, custom implementation), so stories run under it can
|
|
36
|
+
// read route/function config (e.g. the eventDoc user-directory global an
|
|
37
|
+
// AI tool needs to resolve the actor, or the tenant scope resolver). Mirrors
|
|
38
|
+
// the inline-function execute processor, which carries the same fields.
|
|
39
|
+
localContext: session.localContext,
|
|
40
|
+
functionGlobals: session.functionGlobals,
|
|
33
41
|
depth: (session.depth || 0) + 1,
|
|
34
42
|
decodedAccessToken: session.decodedAccessToken,
|
|
35
43
|
correlation: session.correlation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createImplementationRuntime.js","sourceRoot":"","sources":["../../src/createImplementationRuntime.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsE;AAEtE,iDAA0D;AAC1D,uCAA0C;AAC1C,mCAUiB;AAEjB,4DAA4D;AAC5D,4DAA4D;AAE5D,gFAAgF;AAChF,wFAAwF;AAExF,oGAAoG;AAEpG,8EAA8E;AAC9E,6CAA6C;AAC7C,+CAA+C;AAE/C,4IAA4I;AAC5I,+BAA+B;AAC/B,0BAA0B;AAC1B,KAAK;AAEE,MAAM,2BAA2B,GAAG,CACzC,SAAoB,EACpB,IAAc,EAEd,UAA+C,EAC/C,UAAwB,EAExB,OAAqB,EACrB,gBAAqC,EACrC,MAAiB,EACjB,mBAAwC,EACxC,cAA+B,EACG,EAAE;IACpC,MAAM,UAAU,GAAG,IAAA,uCAAwB,EAAC,SAAS,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,IAAA,uBAAa,EAChC,SAAS,EACT;QACE,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC;QAC/B,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,EACD,GAAS,EAAE,kDAAC,OAAA,gBAAgB,CAAA,GAAA,EAC5B,UAAU,EACV,MAAM;IACN,0BAA0B;IAC1B,GAAG,UAAU,KAAK,UAAU,EAAE,EAAE,EAChC,sBAAc,CAAC,4BAA4B,EAC3C,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,cAAc,CACf,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"createImplementationRuntime.js","sourceRoot":"","sources":["../../src/createImplementationRuntime.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsE;AAEtE,iDAA0D;AAC1D,uCAA0C;AAC1C,mCAUiB;AAEjB,4DAA4D;AAC5D,4DAA4D;AAE5D,gFAAgF;AAChF,wFAAwF;AAExF,oGAAoG;AAEpG,8EAA8E;AAC9E,6CAA6C;AAC7C,+CAA+C;AAE/C,4IAA4I;AAC5I,+BAA+B;AAC/B,0BAA0B;AAC1B,KAAK;AAEE,MAAM,2BAA2B,GAAG,CACzC,SAAoB,EACpB,IAAc,EAEd,UAA+C,EAC/C,UAAwB,EAExB,OAAqB,EACrB,gBAAqC,EACrC,MAAiB,EACjB,mBAAwC,EACxC,cAA+B,EACG,EAAE;IACpC,MAAM,UAAU,GAAG,IAAA,uCAAwB,EAAC,SAAS,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,IAAA,uBAAa,EAChC,SAAS,EACT;QACE,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,0EAA0E;QAC1E,wEAAwE;QACxE,2EAA2E;QAC3E,yEAAyE;QACzE,6EAA6E;QAC7E,wEAAwE;QACxE,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC;QAC/B,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,EACD,GAAS,EAAE,kDAAC,OAAA,gBAAgB,CAAA,GAAA,EAC5B,UAAU,EACV,MAAM;IACN,0BAA0B;IAC1B,GAAG,UAAU,KAAK,UAAU,EAAE,EAAE,EAChC,sBAAc,CAAC,4BAA4B,EAC3C,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,cAAc,CACf,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AA5CW,QAAA,2BAA2B,+BA4CtC;AAEK,MAAM,8BAA8B,GAAG,CAC5C,SAAoB,EACpB,KAAe,EACf,GAAW,EACX,2BAA+D,EAC/D,UAAwB,EACxB,UAAwB,EACrB,EAAE;IACL,MAAM,cAAc,GAA8B,CAChD,OAAO,EACP,OAAO,EACP,mBAAmB,EACnB,MAAM,EACN,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,EAAE;QACF,MAAM,YAAY,GAAG,IAAA,mCAA2B,EAC9C,SAAS,EACT,CAAC,GAAG,CAAC,EACL,UAAU,EACV,UAAU,EACV,OAAO,kCAEF,mBAAmB,GACnB,CAAC,2BAA2B,CAAC,CAAC,CAAC,MAAM,2BAA2B,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAE3G,MAAM,EACN,mBAAmB,EACnB,cAAc,CACf,CAAC;QAEF,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAEzD,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YACtB,OAAO,IAAA,+BAAiB,EAAC,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACrF,CAAC;QAED,OAAO,IAAA,0BAAY,EAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC,CAAA,CAAC;IAEF,OAAO,cAAmB,CAAC;AAC7B,CAAC,CAAC;AA1CW,QAAA,8BAA8B,kCA0CzC","sourcesContent":["import { actionResult, actionResultError } from './logic/actionLogic';\nimport { QPQConfig } from './config';\nimport { getApplicationModuleName } from './qpqCoreUtils';\nimport { createRuntime } from './runtime';\nimport {\n ActionProcessor,\n ActionProcessorList,\n ActionProcessorListResolver,\n AnyStory,\n DynamicModuleLoader,\n QpqLogger,\n QpqRuntimeType,\n StorySession,\n StreamRegistry,\n} from './types';\n\n// export const getDateNow = () => new Date().toISOString();\n// export const randomGuid = () => new Date().toISOString();\n\n// export type ActionProcessorReturnType<AP extends ActionProcessor<any, any>> =\n// ReturnType<AP> extends AsyncActionProcessorResult<infer TReturn> ? TReturn : never;\n\n// export type ActionProcessorPayloadType<AP extends ActionProcessor<any, any>> = Parameters<AP>[0];\n\n// export type ActionProcessorNative<AP extends ActionProcessor<any, any>> = (\n// payload: ActionProcessorPayloadType<AP>,\n// ) => Promise<ActionProcessorReturnType<AP>>;\n\n// export const resolveActionProcessorToNative = <AP extends ActionProcessor<any, any>>(actionProcessor: AP): ActionProcessorNative<AP> => {\n// // return null as TReturn;\n// return null as never;\n// };\n\nexport const createImplementationRuntime = (\n qpqConfig: QPQConfig,\n tags: string[],\n\n getDateNow: Parameters<typeof createRuntime>[3],\n randomGuid: () => string,\n\n session: StorySession,\n actionProcessors: ActionProcessorList,\n logger: QpqLogger,\n dynamicModuleLoader: DynamicModuleLoader,\n streamRegistry?: StreamRegistry,\n): ReturnType<typeof createRuntime> => {\n const moduleName = getApplicationModuleName(qpqConfig);\n\n const resolveStory = createRuntime(\n qpqConfig,\n {\n context: session.context,\n // Service-local context and the caller's function globals travel into the\n // nested implementation runtime (a within-service child: tool executor,\n // drive file resolver, custom implementation), so stories run under it can\n // read route/function config (e.g. the eventDoc user-directory global an\n // AI tool needs to resolve the actor, or the tenant scope resolver). Mirrors\n // the inline-function execute processor, which carries the same fields.\n localContext: session.localContext,\n functionGlobals: session.functionGlobals,\n depth: (session.depth || 0) + 1,\n decodedAccessToken: session.decodedAccessToken,\n correlation: session.correlation,\n },\n async () => actionProcessors,\n getDateNow,\n logger,\n // TODO: Share this logic.\n `${moduleName}::${randomGuid()}`,\n QpqRuntimeType.EXECUTE_IMPLEMENTATION_STORY,\n dynamicModuleLoader,\n undefined,\n tags,\n streamRegistry,\n );\n\n return resolveStory;\n};\n\nexport const getProcessCustomImplementation = <T extends ActionProcessor<any, any>>(\n qpqConfig: QPQConfig,\n story: AnyStory,\n tag: string,\n actionProcessorListResolver: ActionProcessorListResolver | null,\n getDateNow: () => string,\n getNewGuid: () => string,\n): T => {\n const actionProcesor: ActionProcessor<any, any> = async (\n payload,\n session,\n actionProcessorList,\n logger,\n updateSession,\n dynamicModuleLoader,\n streamRegistry,\n ) => {\n const resolveStory = createImplementationRuntime(\n qpqConfig,\n [tag],\n getDateNow,\n getNewGuid,\n session,\n {\n ...actionProcessorList,\n ...(actionProcessorListResolver ? await actionProcessorListResolver(qpqConfig, dynamicModuleLoader) : {}),\n },\n logger,\n dynamicModuleLoader,\n streamRegistry,\n );\n\n const storyResult = await resolveStory(story, [payload]);\n\n if (storyResult.error) {\n return actionResultError(storyResult.error.errorType, storyResult.error.errorText);\n }\n\n return actionResult(storyResult.result);\n };\n\n return actionProcesor as T;\n};\n"]}
|
|
@@ -31,11 +31,15 @@ function resolveStory(story, args, qpqConfig, callerSession, getActionProcessors
|
|
|
31
31
|
decodedAccessToken: callerSession.decodedAccessToken,
|
|
32
32
|
context: callerSession.context,
|
|
33
33
|
localContext: callerSession.localContext,
|
|
34
|
-
// In-process story executions
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
|
|
34
|
+
// In-process story executions run WITHIN the caller's function, so they
|
|
35
|
+
// inherit its globals - their own registration wins on collision. This
|
|
36
|
+
// covers inline functions (EXECUTE_STORY) AND implementation stories
|
|
37
|
+
// (EXECUTE_IMPLEMENTATION_STORY: tool executors, drive file resolvers,
|
|
38
|
+
// custom implementations) - both are nested, not transport boundaries, so
|
|
39
|
+
// an AI tool executor can read the queue/route globals (e.g. the eventDoc
|
|
40
|
+
// user-directory global needed to resolve the actor). Transport entries
|
|
41
|
+
// (http/queue/ws) start fresh from their own runtime registration only.
|
|
42
|
+
functionGlobals: runtimeType === StorySession_1.QpqRuntimeType.EXECUTE_STORY || runtimeType === StorySession_1.QpqRuntimeType.EXECUTE_IMPLEMENTATION_STORY
|
|
39
43
|
? Object.assign(Object.assign({}, callerSession.functionGlobals), runtimeGlobals) : runtimeGlobals,
|
|
40
44
|
};
|
|
41
45
|
const updateSession = (newSession) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveStory.js","sourceRoot":"","sources":["../../../src/runtime/resolveStory.ts"],"names":[],"mappings":";;;;;;;;;;;AAWA,oCA+IC;AAzJD,sDAA4G;AAC5G,4CAAuD;AACvD,kDAA2D;AAG3D,0DAAuD;AACvD,wDAA8G;AAC9G,oCAAwD;AACxD,mDAAgD;AAEhD,SAAsB,YAAY,CAChC,KAAwB,EACxB,IAAW,EACX,SAAoB,EACpB,aAA2B,EAC3B,mBAAkG,EAClG,UAAwB,EACxB,MAAiB,EACjB,kBAA0B,EAC1B,WAA2B,EAC3B,mBAAwB,EACxB,sBAA2C,EAC3C,WAAsB,EACtB,cAA+B;;;QAE/B,MAAM,gBAAgB,GAAwB,MAAM,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;QACxG,MAAM,QAAQ,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,IAAA,6BAAoB,GAAE,CAAC;QAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QAE9B,MAAM,cAAc,GAAG,sBAAsB,IAAI,IAAA,oCAA4B,EAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAEnJ,IAAI,aAAa,GAA4C,IAAI,CAAC;QAClE,IAAI,YAAY,GAAiB;YAC/B,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,CAAC;YAC9B,kBAAkB,EAAE,aAAa,CAA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mB,EAAC,YAAY,CAAC,CAAC,CAAC;gBACjE,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;gBACzB,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,0CAAE,IAAI,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC9F,uCACK,QAAQ,KACX,UAAU,EAAE,UAAU,EAAE,EACxB,KAAK,EAAE;wBACL,SAAS,EAAE,GAAG,CAAC,OAAO;wBACtB,SAAS,EAAE,6BAAa,CAAC,YAAY;wBACrC,UAAU,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,0CAAE,IAAI;qBACvC,IACD;YACJ,CAAC;YACD,uCACK,QAAQ,KACX,UAAU,EAAE,UAAU,EAAE,EACxB,KAAK,EAAE;oBACL,SAAS,EAAE,6BAA6B;oBACxC,SAAS,EAAE,6BAAa,CAAC,YAAY;oBACrC,UAAU,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,0CAAE,IAAI;iBACvC,IACD;QACJ,CAAC;QAED,MAAM,WAAW,mCACZ,QAAQ,KACX,UAAU,EAAE,UAAU,EAAE,EACxB,MAAM,EAAE,aAAa,CAAC,KAAK,GAC5B,CAAC;QAEF,yHAAyH;QACzH,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA","sourcesContent":["import { QPQConfig } from '../config';\nimport { isErroredActionResult, resolveActionResult, resolveActionResultError } from '../logic/actionLogic';\nimport { createStreamRegistry } from '../logic/stream';\nimport { getApplicationModuleName } from '../qpqCoreUtils';\nimport { QpqFunctionRuntime, QpqLogger, StreamRegistry } from '../types';\nimport { Action, ActionProcessorList } from '../types/Action';\nimport { ErrorTypeEnum } from '../types/ErrorTypeEnum';\nimport { QpqRuntimeType, Story, StoryResult, StorySession, StorySessionUpdater } from '../types/StorySession';\nimport { isQpqFunctionRuntimeAdvanced } from '../utils';\nimport { processAction } from './processAction';\n\nexport async function resolveStory<TArgs extends Array<any>>(\n story: Story<TArgs, any>,\n args: TArgs,\n qpqConfig: QPQConfig,\n callerSession: StorySession,\n getActionProcessors: (config: QPQConfig, dynamicModuleLoader: any) => Promise<ActionProcessorList>,\n getTimeNow: () => string,\n logger: QpqLogger,\n runtimeCorrelation: string,\n runtimeType: QpqRuntimeType,\n dynamicModuleLoader: any,\n qpqFunctionRuntimeInfo?: QpqFunctionRuntime,\n initialTags?: string[],\n streamRegistry?: StreamRegistry,\n): Promise<StoryResult<any>> {\n const actionProcessors: ActionProcessorList = await getActionProcessors(qpqConfig, dynamicModuleLoader);\n const registry = streamRegistry ?? createStreamRegistry();\n const reader = story(...args);\n\n const runtimeGlobals = qpqFunctionRuntimeInfo && isQpqFunctionRuntimeAdvanced(qpqFunctionRuntimeInfo) ? qpqFunctionRuntimeInfo.globals : undefined;\n\n let storyProgress: IteratorResult<Action<any>, any> | null = null;\n let storySession: StorySession = {\n correlation: runtimeCorrelation,\n depth: callerSession.depth + 1,\n decodedAccessToken: callerSession.decodedAccessToken,\n context: callerSession.context,\n localContext: callerSession.localContext,\n // In-process story executions (inline functions) run WITHIN the caller's\n // function, so they inherit its globals - their own registration wins on\n // collision. Transport entries (http/queue/ws) start fresh from their own\n // runtime registration only.\n functionGlobals:\n runtimeType === QpqRuntimeType.EXECUTE_STORY\n ? {\n ...callerSession.functionGlobals,\n ...runtimeGlobals,\n }\n : runtimeGlobals,\n };\n\n const updateSession: StorySessionUpdater = (newSession: Partial<StorySession>): void => {\n storySession = { ...storySession, ...newSession };\n };\n\n const response: StoryResult<any> = {\n input: args,\n session: { ...storySession },\n history: [],\n startedAt: getTimeNow(),\n finishedAt: getTimeNow(),\n tags: initialTags || [],\n moduleName: getApplicationModuleName(qpqConfig),\n correlation: storySession.correlation!,\n fromCorrelation: callerSession.correlation,\n runtimeType: runtimeType,\n logs: [],\n qpqFunctionRuntimeInfo,\n };\n\n // Enforce maximum depth\n if (storySession.depth > 100) {\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: `Story depth exceeded [${storySession.depth}]!`,\n errorType: ErrorTypeEnum.GenericError,\n },\n };\n }\n\n try {\n storyProgress = reader.next();\n\n while (!storyProgress.done) {\n const action = storyProgress.value;\n const executionTime = getTimeNow();\n\n const actionResult = await processAction(action, actionProcessors, storySession, logger, updateSession, dynamicModuleLoader, registry);\n\n const historyEntry = {\n act: action,\n res: actionResult,\n startedAt: executionTime,\n finishedAt: getTimeNow(),\n };\n\n // console.log(`${action.type}: took ${new Date(historyEntry.finishedAt).getTime() - new Date(historyEntry.startedAt).getTime()}ms`);\n response.history.push(historyEntry);\n\n if (isErroredActionResult(actionResult) && !action.returnErrors) {\n console.log('Caught Error:', JSON.stringify(resolveActionResultError(actionResult)));\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: resolveActionResultError(actionResult),\n };\n }\n\n // Feed the result back to the story generator\n if (action.returnErrors) {\n const isSuccess = !isErroredActionResult(actionResult);\n const result = isSuccess\n ? { success: true, result: resolveActionResult(actionResult) }\n : { success: false, error: resolveActionResultError(actionResult) };\n storyProgress = reader.next(result);\n } else {\n storyProgress = reader.next(resolveActionResult(actionResult));\n }\n }\n } catch (err) {\n if (err instanceof Error) {\n console.log(`Uncaught Error: [${JSON.stringify(storyProgress?.value?.type)}] ${err.message}`);\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: err.message,\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: 'Unknown error has occurred!',\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n\n const storyResult = {\n ...response,\n finishedAt: getTimeNow(),\n result: storyProgress.value,\n };\n\n // console.log(`story took ${new Date(storyResult.finishedAt).getTime() - new Date(storyResult.startedAt).getTime()}ms`);\n return storyResult;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"resolveStory.js","sourceRoot":"","sources":["../../../src/runtime/resolveStory.ts"],"names":[],"mappings":";;;;;;;;;;;AAWA,oCAmJC;AA7JD,sDAA4G;AAC5G,4CAAuD;AACvD,kDAA2D;AAG3D,0DAAuD;AACvD,wDAA8G;AAC9G,oCAAwD;AACxD,mDAAgD;AAEhD,SAAsB,YAAY,CAChC,KAAwB,EACxB,IAAW,EACX,SAAoB,EACpB,aAA2B,EAC3B,mBAAkG,EAClG,UAAwB,EACxB,MAAiB,EACjB,kBAA0B,EAC1B,WAA2B,EAC3B,mBAAwB,EACxB,sBAA2C,EAC3C,WAAsB,EACtB,cAA+B;;;QAE/B,MAAM,gBAAgB,GAAwB,MAAM,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;QACxG,MAAM,QAAQ,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,IAAA,6BAAoB,GAAE,CAAC;QAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QAE9B,MAAM,cAAc,GAAG,sBAAsB,IAAI,IAAA,oCAA4B,EAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAEnJ,IAAI,aAAa,GAA4C,IAAI,CAAC;QAClE,IAAI,YAAY,GAAiB;YAC/B,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,CAAC;YAC9B,kBAAkB,EAAE,aAAa,CAAC,kBAAkB;YACpD,OAAO,EAAE,aAAa,CAAC,OAAO;YAC9B,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,wEAAwE;YACxE,uEAAuE;YACvE,qEAAqE;YACrE,uEAAuE;YACvE,0EAA0E;YAC1E,0EAA0E;YAC1E,wEAAwE;YACxE,wEAA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,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;gBACzB,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,0CAAE,IAAI,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC9F,uCACK,QAAQ,KACX,UAAU,EAAE,UAAU,EAAE,EACxB,KAAK,EAAE;wBACL,SAAS,EAAE,GAAG,CAAC,OAAO;wBACtB,SAAS,EAAE,6BAAa,CAAC,YAAY;wBACrC,UAAU,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,0CAAE,IAAI;qBACvC,IACD;YACJ,CAAC;YACD,uCACK,QAAQ,KACX,UAAU,EAAE,UAAU,EAAE,EACxB,KAAK,EAAE;oBACL,SAAS,EAAE,6BAA6B;oBACxC,SAAS,EAAE,6BAAa,CAAC,YAAY;oBACrC,UAAU,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,0CAAE,IAAI;iBACvC,IACD;QACJ,CAAC;QAED,MAAM,WAAW,mCACZ,QAAQ,KACX,UAAU,EAAE,UAAU,EAAE,EACxB,MAAM,EAAE,aAAa,CAAC,KAAK,GAC5B,CAAC;QAEF,yHAAyH;QACzH,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA","sourcesContent":["import { QPQConfig } from '../config';\nimport { isErroredActionResult, resolveActionResult, resolveActionResultError } from '../logic/actionLogic';\nimport { createStreamRegistry } from '../logic/stream';\nimport { getApplicationModuleName } from '../qpqCoreUtils';\nimport { QpqFunctionRuntime, QpqLogger, StreamRegistry } from '../types';\nimport { Action, ActionProcessorList } from '../types/Action';\nimport { ErrorTypeEnum } from '../types/ErrorTypeEnum';\nimport { QpqRuntimeType, Story, StoryResult, StorySession, StorySessionUpdater } from '../types/StorySession';\nimport { isQpqFunctionRuntimeAdvanced } from '../utils';\nimport { processAction } from './processAction';\n\nexport async function resolveStory<TArgs extends Array<any>>(\n story: Story<TArgs, any>,\n args: TArgs,\n qpqConfig: QPQConfig,\n callerSession: StorySession,\n getActionProcessors: (config: QPQConfig, dynamicModuleLoader: any) => Promise<ActionProcessorList>,\n getTimeNow: () => string,\n logger: QpqLogger,\n runtimeCorrelation: string,\n runtimeType: QpqRuntimeType,\n dynamicModuleLoader: any,\n qpqFunctionRuntimeInfo?: QpqFunctionRuntime,\n initialTags?: string[],\n streamRegistry?: StreamRegistry,\n): Promise<StoryResult<any>> {\n const actionProcessors: ActionProcessorList = await getActionProcessors(qpqConfig, dynamicModuleLoader);\n const registry = streamRegistry ?? createStreamRegistry();\n const reader = story(...args);\n\n const runtimeGlobals = qpqFunctionRuntimeInfo && isQpqFunctionRuntimeAdvanced(qpqFunctionRuntimeInfo) ? qpqFunctionRuntimeInfo.globals : undefined;\n\n let storyProgress: IteratorResult<Action<any>, any> | null = null;\n let storySession: StorySession = {\n correlation: runtimeCorrelation,\n depth: callerSession.depth + 1,\n decodedAccessToken: callerSession.decodedAccessToken,\n context: callerSession.context,\n localContext: callerSession.localContext,\n // In-process story executions run WITHIN the caller's function, so they\n // inherit its globals - their own registration wins on collision. This\n // covers inline functions (EXECUTE_STORY) AND implementation stories\n // (EXECUTE_IMPLEMENTATION_STORY: tool executors, drive file resolvers,\n // custom implementations) - both are nested, not transport boundaries, so\n // an AI tool executor can read the queue/route globals (e.g. the eventDoc\n // user-directory global needed to resolve the actor). Transport entries\n // (http/queue/ws) start fresh from their own runtime registration only.\n functionGlobals:\n runtimeType === QpqRuntimeType.EXECUTE_STORY || runtimeType === QpqRuntimeType.EXECUTE_IMPLEMENTATION_STORY\n ? {\n ...callerSession.functionGlobals,\n ...runtimeGlobals,\n }\n : runtimeGlobals,\n };\n\n const updateSession: StorySessionUpdater = (newSession: Partial<StorySession>): void => {\n storySession = { ...storySession, ...newSession };\n };\n\n const response: StoryResult<any> = {\n input: args,\n session: { ...storySession },\n history: [],\n startedAt: getTimeNow(),\n finishedAt: getTimeNow(),\n tags: initialTags || [],\n moduleName: getApplicationModuleName(qpqConfig),\n correlation: storySession.correlation!,\n fromCorrelation: callerSession.correlation,\n runtimeType: runtimeType,\n logs: [],\n qpqFunctionRuntimeInfo,\n };\n\n // Enforce maximum depth\n if (storySession.depth > 100) {\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: `Story depth exceeded [${storySession.depth}]!`,\n errorType: ErrorTypeEnum.GenericError,\n },\n };\n }\n\n try {\n storyProgress = reader.next();\n\n while (!storyProgress.done) {\n const action = storyProgress.value;\n const executionTime = getTimeNow();\n\n const actionResult = await processAction(action, actionProcessors, storySession, logger, updateSession, dynamicModuleLoader, registry);\n\n const historyEntry = {\n act: action,\n res: actionResult,\n startedAt: executionTime,\n finishedAt: getTimeNow(),\n };\n\n // console.log(`${action.type}: took ${new Date(historyEntry.finishedAt).getTime() - new Date(historyEntry.startedAt).getTime()}ms`);\n response.history.push(historyEntry);\n\n if (isErroredActionResult(actionResult) && !action.returnErrors) {\n console.log('Caught Error:', JSON.stringify(resolveActionResultError(actionResult)));\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: resolveActionResultError(actionResult),\n };\n }\n\n // Feed the result back to the story generator\n if (action.returnErrors) {\n const isSuccess = !isErroredActionResult(actionResult);\n const result = isSuccess\n ? { success: true, result: resolveActionResult(actionResult) }\n : { success: false, error: resolveActionResultError(actionResult) };\n storyProgress = reader.next(result);\n } else {\n storyProgress = reader.next(resolveActionResult(actionResult));\n }\n }\n } catch (err) {\n if (err instanceof Error) {\n console.log(`Uncaught Error: [${JSON.stringify(storyProgress?.value?.type)}] ${err.message}`);\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: err.message,\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: 'Unknown error has occurred!',\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n\n const storyResult = {\n ...response,\n finishedAt: getTimeNow(),\n result: storyProgress.value,\n };\n\n // console.log(`story took ${new Date(storyResult.finishedAt).getTime() - new Date(storyResult.startedAt).getTime()}ms`);\n return storyResult;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UnionToIntersection<T> = (T extends unknown ? (member: T) => void : never) extends (member: infer TIntersection) => void ? TIntersection : never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionToIntersection.js","sourceRoot":"","sources":["../../../src/types/UnionToIntersection.ts"],"names":[],"mappings":"","sourcesContent":["// Standard union-to-intersection: distributing T into a contravariant (parameter)\n// position makes inference produce the intersection of the union's members.\nexport type UnionToIntersection<T> = (T extends unknown ? (member: T) => void : never) extends (member: infer TIntersection) => void\n ? TIntersection\n : never;\n"]}
|
|
@@ -46,5 +46,6 @@ __exportStar(require("./ScheduledEvent"), exports);
|
|
|
46
46
|
__exportStar(require("./StorySession"), exports);
|
|
47
47
|
__exportStar(require("./StreamRegistry"), exports);
|
|
48
48
|
__exportStar(require("./UnboundLogicStory"), exports);
|
|
49
|
+
__exportStar(require("./UnionToIntersection"), exports);
|
|
49
50
|
__exportStar(require("./utils"), exports);
|
|
50
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,kDAAgC;AAChC,oDAAkC;AAClC,wDAAsC;AACtC,uDAAqC;AACrC,qDAAmC;AACnC,6DAA2C;AAC3C,qDAAmC;AACnC,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B;AAC9B,2DAAyC;AACzC,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,0DAAwC;AACxC,6CAA2B;AAC3B,kDAAgC;AAChC,yDAAuC;AACvC,sDAAoC;AACpC,uDAAqC;AACrC,mDAAiC;AACjC,8CAA4B;AAC5B,iDAA+B;AAC/B,+CAA6B;AAC7B,gDAA8B;AAC9B,mDAAiC;AACjC,iDAA+B;AAC/B,mDAAiC;AACjC,sDAAoC;AACpC,0CAAwB","sourcesContent":["export * from './Action';\nexport * from './authChallenge';\nexport * from './BoundLogicStory';\nexport * from './ConfigUrlDefinition';\nexport * from './CrossModuleMessage';\nexport * from './CrossModuleOwner';\nexport * from './CrossServiceResourceName';\nexport * from './DecomposedString';\nexport * from './DeployEvent';\nexport * from './DynamicModuleLoader';\nexport * from './ErrorTypeEnum';\nexport * from './EventMessage';\nexport * from './ExcludeKeys';\nexport * from './FullyQualifiedResource';\nexport * from './KeyOf';\nexport * from './LogLevelEnum';\nexport * from './Lookup';\nexport * from './NotifyErrorQueueEvent';\nexport * from './Nullable';\nexport * from './QPQBinaryData';\nexport * from './QpqContextIdentifier';\nexport * from './QpqExecutionTrace';\nexport * from './QpqFunctionRuntime';\nexport * from './QpqIsoDateTime';\nexport * from './QpqLogger';\nexport * from './QpqPagedData';\nexport * from './QueueEvent';\nexport * from './Readonlyify';\nexport * from './ScheduledEvent';\nexport * from './StorySession';\nexport * from './StreamRegistry';\nexport * from './UnboundLogicStory';\nexport * from './utils';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,kDAAgC;AAChC,oDAAkC;AAClC,wDAAsC;AACtC,uDAAqC;AACrC,qDAAmC;AACnC,6DAA2C;AAC3C,qDAAmC;AACnC,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B;AAC9B,2DAAyC;AACzC,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,0DAAwC;AACxC,6CAA2B;AAC3B,kDAAgC;AAChC,yDAAuC;AACvC,sDAAoC;AACpC,uDAAqC;AACrC,mDAAiC;AACjC,8CAA4B;AAC5B,iDAA+B;AAC/B,+CAA6B;AAC7B,gDAA8B;AAC9B,mDAAiC;AACjC,iDAA+B;AAC/B,mDAAiC;AACjC,sDAAoC;AACpC,wDAAsC;AACtC,0CAAwB","sourcesContent":["export * from './Action';\nexport * from './authChallenge';\nexport * from './BoundLogicStory';\nexport * from './ConfigUrlDefinition';\nexport * from './CrossModuleMessage';\nexport * from './CrossModuleOwner';\nexport * from './CrossServiceResourceName';\nexport * from './DecomposedString';\nexport * from './DeployEvent';\nexport * from './DynamicModuleLoader';\nexport * from './ErrorTypeEnum';\nexport * from './EventMessage';\nexport * from './ExcludeKeys';\nexport * from './FullyQualifiedResource';\nexport * from './KeyOf';\nexport * from './LogLevelEnum';\nexport * from './Lookup';\nexport * from './NotifyErrorQueueEvent';\nexport * from './Nullable';\nexport * from './QPQBinaryData';\nexport * from './QpqContextIdentifier';\nexport * from './QpqExecutionTrace';\nexport * from './QpqFunctionRuntime';\nexport * from './QpqIsoDateTime';\nexport * from './QpqLogger';\nexport * from './QpqPagedData';\nexport * from './QueueEvent';\nexport * from './Readonlyify';\nexport * from './ScheduledEvent';\nexport * from './StorySession';\nexport * from './StreamRegistry';\nexport * from './UnboundLogicStory';\nexport * from './UnionToIntersection';\nexport * from './utils';\n"]}
|
|
@@ -5,4 +5,5 @@ export declare const FileGenerateTemporaryUploadSecureUrlErrorTypeEnum: {
|
|
|
5
5
|
};
|
|
6
6
|
export declare function askFileGenerateTemporaryUploadSecureUrl(drive: string, filepath: string, expirationMs: number, advancedOptions?: {
|
|
7
7
|
contentType?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentType'];
|
|
8
|
+
contentDisposition?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentDisposition'];
|
|
8
9
|
}, scope?: string): FileGenerateTemporaryUploadSecureUrlActionRequester;
|
|
@@ -12,6 +12,7 @@ export function* askFileGenerateTemporaryUploadSecureUrl(drive, filepath, expira
|
|
|
12
12
|
filepath,
|
|
13
13
|
expirationMs,
|
|
14
14
|
contentType: advancedOptions?.contentType,
|
|
15
|
+
contentDisposition: advancedOptions?.contentDisposition,
|
|
15
16
|
// maxSizeBytes: advancedOptions?.maxSizeBytes,
|
|
16
17
|
scope,
|
|
17
18
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,MAAM,CAAC,MAAM,iDAAiD,GAAG,wBAAwB,CAAC,cAAc,CAAC,gCAAgC,EAAE;IACzI,mBAAmB,EAAE,uDAAuD;IAC5E,cAAc,EAAE,2CAA2C;CAC5D,CAAC,CAAC;AAEH,MAAM,SAAS,CAAC,CAAC,uCAAuC,CACtD,KAAa,EACb,QAAgB,EAChB,YAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionRequester.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,MAAM,CAAC,MAAM,iDAAiD,GAAG,wBAAwB,CAAC,cAAc,CAAC,gCAAgC,EAAE;IACzI,mBAAmB,EAAE,uDAAuD;IAC5E,cAAc,EAAE,2CAA2C;CAC5D,CAAC,CAAC;AAEH,MAAM,SAAS,CAAC,CAAC,uCAAuC,CACtD,KAAa,EACb,QAAgB,EAChB,YAAoB,EACpB,eAIC,EACD,KAAc;IAEd,OAAO,MAAM;QACX,IAAI,EAAE,cAAc,CAAC,gCAAgC;QACrD,OAAO,EAAE;YACP,KAAK;YACL,QAAQ;YACR,YAAY;YACZ,WAAW,EAAE,eAAe,EAAE,WAAW;YACzC,kBAAkB,EAAE,eAAe,EAAE,kBAAkB;YACvD,+CAA+C;YAC/C,KAAK;SACN;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { createErrorEnumForAction } from '../../types';\nimport { FileActionType } from './FileActionType';\nimport {\n FileGenerateTemporaryUploadSecureUrlActionPayload,\n FileGenerateTemporaryUploadSecureUrlActionRequester,\n} from './FileGenerateTemporaryUploadSecureUrlActionTypes';\n\nexport const FileGenerateTemporaryUploadSecureUrlErrorTypeEnum = createErrorEnumForAction(FileActionType.GenerateTemporaryUploadSecureUrl, [\n 'ExpirationTooLong', // requested expiry exceeds max length of time possible\n 'InvalidScope', // scope is not a valid single path segment\n]);\n\nexport function* askFileGenerateTemporaryUploadSecureUrl(\n drive: string,\n filepath: string,\n expirationMs: number,\n advancedOptions?: {\n contentType?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentType'];\n contentDisposition?: FileGenerateTemporaryUploadSecureUrlActionPayload['contentDisposition'];\n // maxSizeBytes?: FileGenerateTemporaryUploadSecureUrlActionPayload['maxSizeBytes']\n },\n scope?: string,\n): FileGenerateTemporaryUploadSecureUrlActionRequester {\n return yield {\n type: FileActionType.GenerateTemporaryUploadSecureUrl,\n payload: {\n drive,\n filepath,\n expirationMs,\n contentType: advancedOptions?.contentType,\n contentDisposition: advancedOptions?.contentDisposition,\n // maxSizeBytes: advancedOptions?.maxSizeBytes,\n scope,\n },\n };\n}\n"]}
|
|
@@ -5,6 +5,7 @@ export interface FileGenerateTemporaryUploadSecureUrlActionPayload {
|
|
|
5
5
|
filepath: string;
|
|
6
6
|
expirationMs: number;
|
|
7
7
|
contentType?: string;
|
|
8
|
+
contentDisposition?: string;
|
|
8
9
|
scope?: string;
|
|
9
10
|
}
|
|
10
11
|
export interface FileGenerateTemporaryUploadSecureUrlAction extends Action<FileGenerateTemporaryUploadSecureUrlActionPayload> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { FileActionType } from './FileActionType';\n\n// Payload\nexport interface FileGenerateTemporaryUploadSecureUrlActionPayload {\n drive: string;\n filepath: string;\n expirationMs: number;\n // maxSizeBytes?: number;\n contentType?: string;\n scope?: string;\n}\n\n// Action\nexport interface FileGenerateTemporaryUploadSecureUrlAction extends Action<FileGenerateTemporaryUploadSecureUrlActionPayload> {\n type: FileActionType.GenerateTemporaryUploadSecureUrl;\n payload: FileGenerateTemporaryUploadSecureUrlActionPayload;\n}\n\n// Function Types\nexport type FileGenerateTemporaryUploadSecureUrlActionProcessor = ActionProcessor<FileGenerateTemporaryUploadSecureUrlAction, string>;\nexport type FileGenerateTemporaryUploadSecureUrlActionRequester = ActionRequester<FileGenerateTemporaryUploadSecureUrlAction, string>;\n"]}
|
|
1
|
+
{"version":3,"file":"FileGenerateTemporaryUploadSecureUrlActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/file/FileGenerateTemporaryUploadSecureUrlActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { FileActionType } from './FileActionType';\n\n// Payload\nexport interface FileGenerateTemporaryUploadSecureUrlActionPayload {\n drive: string;\n filepath: string;\n expirationMs: number;\n // maxSizeBytes?: number;\n contentType?: string;\n // Content-Disposition to bake into the upload so the stored object serves with it (e.g. 'inline'\n // so a PDF previews in an <iframe> instead of force-downloading). On S3 it is signed into the PUT\n // (the client must send the matching header); the dev store persists it as sidecar metadata.\n contentDisposition?: string;\n scope?: string;\n}\n\n// Action\nexport interface FileGenerateTemporaryUploadSecureUrlAction extends Action<FileGenerateTemporaryUploadSecureUrlActionPayload> {\n type: FileActionType.GenerateTemporaryUploadSecureUrl;\n payload: FileGenerateTemporaryUploadSecureUrlActionPayload;\n}\n\n// Function Types\nexport type FileGenerateTemporaryUploadSecureUrlActionProcessor = ActionProcessor<FileGenerateTemporaryUploadSecureUrlAction, string>;\nexport type FileGenerateTemporaryUploadSecureUrlActionRequester = ActionRequester<FileGenerateTemporaryUploadSecureUrlAction, string>;\n"]}
|
|
@@ -6,6 +6,8 @@ export declare enum UserDirectoryActionType {
|
|
|
6
6
|
ForgotPassword = "@quidproquo-core/UserDirectory/ForgotPassword",
|
|
7
7
|
ConfirmForgotPassword = "@quidproquo-core/UserDirectory/ConfirmForgotPassword",
|
|
8
8
|
RefreshToken = "@quidproquo-core/UserDirectory/RefreshToken",
|
|
9
|
+
SignOutUser = "@quidproquo-core/UserDirectory/SignOutUser",
|
|
10
|
+
RevokeRefreshToken = "@quidproquo-core/UserDirectory/RevokeRefreshToken",
|
|
9
11
|
RequestEmailVerification = "@quidproquo-core/UserDirectory/RequestEmailVerification",
|
|
10
12
|
ConfirmEmailVerification = "@quidproquo-core/UserDirectory/ConfirmEmailVerification",
|
|
11
13
|
ReadAccessToken = "@quidproquo-core/UserDirectory/ReadAccessToken",
|
|
@@ -5,6 +5,8 @@ export var UserDirectoryActionType;
|
|
|
5
5
|
UserDirectoryActionType["ForgotPassword"] = "@quidproquo-core/UserDirectory/ForgotPassword";
|
|
6
6
|
UserDirectoryActionType["ConfirmForgotPassword"] = "@quidproquo-core/UserDirectory/ConfirmForgotPassword";
|
|
7
7
|
UserDirectoryActionType["RefreshToken"] = "@quidproquo-core/UserDirectory/RefreshToken";
|
|
8
|
+
UserDirectoryActionType["SignOutUser"] = "@quidproquo-core/UserDirectory/SignOutUser";
|
|
9
|
+
UserDirectoryActionType["RevokeRefreshToken"] = "@quidproquo-core/UserDirectory/RevokeRefreshToken";
|
|
8
10
|
UserDirectoryActionType["RequestEmailVerification"] = "@quidproquo-core/UserDirectory/RequestEmailVerification";
|
|
9
11
|
UserDirectoryActionType["ConfirmEmailVerification"] = "@quidproquo-core/UserDirectory/ConfirmEmailVerification";
|
|
10
12
|
UserDirectoryActionType["ReadAccessToken"] = "@quidproquo-core/UserDirectory/ReadAccessToken";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserDirectoryActionType.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryActionType.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"UserDirectoryActionType.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryActionType.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,uBAsBX;AAtBD,WAAY,uBAAuB;IACjC,mFAAwD,CAAA;IACxD,+FAAoE,CAAA;IACpE,2FAAgE,CAAA;IAChE,yGAA8E,CAAA;IAC9E,uFAA4D,CAAA;IAC5D,qFAA0D,CAAA;IAC1D,mGAAwE,CAAA;IACxE,+GAAoF,CAAA;IACpF,+GAAoF,CAAA;IACpF,6FAAkE,CAAA;IAClE,2FAAgE,CAAA;IAChE,iGAAsE,CAAA;IACtE,2GAAgF,CAAA;IAChF,2GAAgF,CAAA;IAChF,iGAAsE,CAAA;IACtE,iHAAsF,CAAA;IACtF,iGAAsE,CAAA;IACtE,2FAAgE,CAAA;IAChE,qFAA0D,CAAA;IAC1D,+EAAoD,CAAA;IACpD,qGAA0E,CAAA;AAC5E,CAAC,EAtBW,uBAAuB,KAAvB,uBAAuB,QAsBlC","sourcesContent":["import { QpqIsoDateTime } from '../../types/QpqIsoDateTime';\nimport { AuthenticateUserChallenge } from './types';\n\nexport enum UserDirectoryActionType {\n CreateUser = '@quidproquo-core/UserDirectory/CreateUser',\n AuthenticateUser = '@quidproquo-core/UserDirectory/AuthenticateUser',\n ForgotPassword = '@quidproquo-core/UserDirectory/ForgotPassword',\n ConfirmForgotPassword = '@quidproquo-core/UserDirectory/ConfirmForgotPassword',\n RefreshToken = '@quidproquo-core/UserDirectory/RefreshToken',\n SignOutUser = '@quidproquo-core/UserDirectory/SignOutUser',\n RevokeRefreshToken = '@quidproquo-core/UserDirectory/RevokeRefreshToken',\n RequestEmailVerification = '@quidproquo-core/UserDirectory/RequestEmailVerification',\n ConfirmEmailVerification = '@quidproquo-core/UserDirectory/ConfirmEmailVerification',\n ReadAccessToken = '@quidproquo-core/UserDirectory/ReadAccessToken',\n SetAccessToken = '@quidproquo-core/UserDirectory/SetAccessToken',\n DecodeAccessToken = '@quidproquo-core/UserDirectory/DecodeAccessToken',\n RespondToAuthChallenge = '@quidproquo-core/UserDirectory/RespondToAuthChallenge',\n AssociateSoftwareToken = '@quidproquo-core/UserDirectory/AssociateSoftwareToken',\n GetUserAttributes = '@quidproquo-core/UserDirectory/GetUserAttributes',\n GetUserAttributesByUserId = '@quidproquo-core/UserDirectory/GetUserAttributesByUserId',\n SetUserAttributes = '@quidproquo-core/UserDirectory/SetUserAttributes',\n ChangePassword = '@quidproquo-core/UserDirectory/ChangePassword',\n SetPassword = '@quidproquo-core/UserDirectory/SetPassword',\n GetUsers = '@quidproquo-core/UserDirectory/GetUsers',\n GetUsersByAttribute = '@quidproquo-core/UserDirectory/GetUsersByAttribute',\n}\n\nexport interface AuthenticationInfo {\n accessToken?: string;\n expirationDurationInSeconds?: number;\n expiresAt?: QpqIsoDateTime;\n idToken?: string;\n refreshToken?: string;\n tokenType?: string;\n}\n\nexport interface AuthenticationDeliveryDetails {\n attributeName: string;\n deliveryMedium: 'EMAIL' | 'SMS';\n destination: string;\n}\n\nexport interface AuthenticateUserResponse {\n challenge: AuthenticateUserChallenge;\n challengeParameters?: Record<string, string>;\n session?: string;\n\n authenticationInfo?: AuthenticationInfo;\n}\n\nexport interface UserAttributes {\n /** The user's email address */\n email?: string;\n /** Indicates whether the user's email address has been verified */\n emailVerified?: boolean;\n /** The user's unique identifier */\n userId?: string;\n /** The user's postal address */\n address?: string;\n /** The user's date of birth (YYYY-MM-DD format) */\n birthDate?: string;\n /** The user's last name or surname */\n familyName?: string;\n /** The user's gender (e.g., \"male\", \"female\", \"other\") */\n gender?: string;\n /** The user's first name or given name */\n givenName?: string;\n /** The user's preferred locale (e.g., \"en-US\", \"fr-FR\") */\n locale?: string;\n /** The user's middle name */\n middleName?: string;\n /** The user's full name */\n name?: string;\n /** The user's nickname or alias */\n nickname?: string;\n /** The user's phone number (in E.164 format, e.g., \"+1-555-123-4567\") */\n phoneNumber?: string;\n /** The URL of the user's profile picture */\n picture?: string;\n /** The user's preferred username, if different from the given name */\n preferredUsername?: string;\n /** The URL of the user's profile page */\n profile?: string;\n /** The URL of the user's personal website or blog */\n website?: string;\n /** The user's timezone (e.g., \"America/Los_Angeles\", \"Europe/London\") */\n zoneInfo?: string;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UserDirectoryRevokeRefreshTokenActionRequester } from './UserDirectoryRevokeRefreshTokenActionTypes';
|
|
2
|
+
export declare const UserDirectoryRevokeRefreshTokenErrorTypeEnum: {
|
|
3
|
+
Unauthorized: string;
|
|
4
|
+
LimitExceeded: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function askUserDirectoryRevokeRefreshToken(userDirectoryName: string, refreshToken: string): UserDirectoryRevokeRefreshTokenActionRequester;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createErrorEnumForAction } from '../../types';
|
|
2
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
|
+
export const UserDirectoryRevokeRefreshTokenErrorTypeEnum = createErrorEnumForAction(UserDirectoryActionType.RevokeRefreshToken, [
|
|
4
|
+
'Unauthorized', // the refresh token is invalid/already revoked, or revocation is disabled on the app client
|
|
5
|
+
'LimitExceeded', // too many attempts; the caller should back off and retry later
|
|
6
|
+
]);
|
|
7
|
+
// Revokes a SINGLE refresh token (and every access token minted from it) — the "log out
|
|
8
|
+
// this device" primitive. Unlike SignOutUser (which revokes all of a user's sessions), this
|
|
9
|
+
// targets exactly the session that holds this refresh token, so other devices stay signed in.
|
|
10
|
+
export function* askUserDirectoryRevokeRefreshToken(userDirectoryName, refreshToken) {
|
|
11
|
+
return yield {
|
|
12
|
+
type: UserDirectoryActionType.RevokeRefreshToken,
|
|
13
|
+
payload: {
|
|
14
|
+
userDirectoryName,
|
|
15
|
+
refreshToken,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=UserDirectoryRevokeRefreshTokenActionRequester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectoryRevokeRefreshTokenActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionRequester.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,MAAM,CAAC,MAAM,4CAA4C,GAAG,wBAAwB,CAAC,uBAAuB,CAAC,kBAAkB,EAAE;IAC/H,cAAc,EAAE,4FAA4F;IAC5G,eAAe,EAAE,gEAAgE;CAClF,CAAC,CAAC;AAEH,wFAAwF;AACxF,4FAA4F;AAC5F,8FAA8F;AAC9F,MAAM,SAAS,CAAC,CAAC,kCAAkC,CAAC,iBAAyB,EAAE,YAAoB;IACjG,OAAO,MAAM;QACX,IAAI,EAAE,uBAAuB,CAAC,kBAAkB;QAChD,OAAO,EAAE;YACP,iBAAiB;YAEjB,YAAY;SACb;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { createErrorEnumForAction } from '../../types';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\nimport { UserDirectoryRevokeRefreshTokenActionRequester } from './UserDirectoryRevokeRefreshTokenActionTypes';\n\nexport const UserDirectoryRevokeRefreshTokenErrorTypeEnum = createErrorEnumForAction(UserDirectoryActionType.RevokeRefreshToken, [\n 'Unauthorized', // the refresh token is invalid/already revoked, or revocation is disabled on the app client\n 'LimitExceeded', // too many attempts; the caller should back off and retry later\n]);\n\n// Revokes a SINGLE refresh token (and every access token minted from it) — the \"log out\n// this device\" primitive. Unlike SignOutUser (which revokes all of a user's sessions), this\n// targets exactly the session that holds this refresh token, so other devices stay signed in.\nexport function* askUserDirectoryRevokeRefreshToken(userDirectoryName: string, refreshToken: string): UserDirectoryRevokeRefreshTokenActionRequester {\n return yield {\n type: UserDirectoryActionType.RevokeRefreshToken,\n payload: {\n userDirectoryName,\n\n refreshToken,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
|
+
export interface UserDirectoryRevokeRefreshTokenActionPayload {
|
|
4
|
+
userDirectoryName: string;
|
|
5
|
+
refreshToken: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UserDirectoryRevokeRefreshTokenAction extends Action<UserDirectoryRevokeRefreshTokenActionPayload> {
|
|
8
|
+
type: UserDirectoryActionType.RevokeRefreshToken;
|
|
9
|
+
payload: UserDirectoryRevokeRefreshTokenActionPayload;
|
|
10
|
+
}
|
|
11
|
+
export type UserDirectoryRevokeRefreshTokenActionProcessor = ActionProcessor<UserDirectoryRevokeRefreshTokenAction, void>;
|
|
12
|
+
export type UserDirectoryRevokeRefreshTokenActionRequester = ActionRequester<UserDirectoryRevokeRefreshTokenAction, void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectoryRevokeRefreshTokenActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectoryRevokeRefreshTokenActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\n\n// Payload\nexport interface UserDirectoryRevokeRefreshTokenActionPayload {\n userDirectoryName: string;\n\n refreshToken: string;\n}\n\n// Action\nexport interface UserDirectoryRevokeRefreshTokenAction extends Action<UserDirectoryRevokeRefreshTokenActionPayload> {\n type: UserDirectoryActionType.RevokeRefreshToken;\n payload: UserDirectoryRevokeRefreshTokenActionPayload;\n}\n\n// Function Types\nexport type UserDirectoryRevokeRefreshTokenActionProcessor = ActionProcessor<UserDirectoryRevokeRefreshTokenAction, void>;\nexport type UserDirectoryRevokeRefreshTokenActionRequester = ActionRequester<UserDirectoryRevokeRefreshTokenAction, void>;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UserDirectorySignOutUserActionRequester } from './UserDirectorySignOutUserActionTypes';
|
|
2
|
+
export declare const UserDirectorySignOutUserErrorTypeEnum: {
|
|
3
|
+
Unauthorized: string;
|
|
4
|
+
LimitExceeded: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function askUserDirectorySignOutUser(accessToken: string): UserDirectorySignOutUserActionRequester;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createErrorEnumForAction } from '../../types';
|
|
2
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
|
+
export const UserDirectorySignOutUserErrorTypeEnum = createErrorEnumForAction(UserDirectoryActionType.SignOutUser, [
|
|
4
|
+
'Unauthorized', // the access token is missing/invalid/expired — there is nothing to revoke
|
|
5
|
+
'LimitExceeded', // too many attempts; the caller should back off and retry later
|
|
6
|
+
]);
|
|
7
|
+
// Globally signs the user out: revokes EVERY refresh token issued to the owner of this
|
|
8
|
+
// access token, so a stolen/persisted refresh token stops working (logout / compromise
|
|
9
|
+
// response). Access tokens already minted remain valid until they expire (stateless JWTs),
|
|
10
|
+
// so keep the access-token validity short.
|
|
11
|
+
export function* askUserDirectorySignOutUser(accessToken) {
|
|
12
|
+
return yield {
|
|
13
|
+
type: UserDirectoryActionType.SignOutUser,
|
|
14
|
+
payload: {
|
|
15
|
+
accessToken,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=UserDirectorySignOutUserActionRequester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectorySignOutUserActionRequester.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectorySignOutUserActionRequester.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,MAAM,CAAC,MAAM,qCAAqC,GAAG,wBAAwB,CAAC,uBAAuB,CAAC,WAAW,EAAE;IACjH,cAAc,EAAE,2EAA2E;IAC3F,eAAe,EAAE,gEAAgE;CAClF,CAAC,CAAC;AAEH,uFAAuF;AACvF,uFAAuF;AACvF,2FAA2F;AAC3F,2CAA2C;AAC3C,MAAM,SAAS,CAAC,CAAC,2BAA2B,CAAC,WAAmB;IAC9D,OAAO,MAAM;QACX,IAAI,EAAE,uBAAuB,CAAC,WAAW;QACzC,OAAO,EAAE;YACP,WAAW;SACZ;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { createErrorEnumForAction } from '../../types';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\nimport { UserDirectorySignOutUserActionRequester } from './UserDirectorySignOutUserActionTypes';\n\nexport const UserDirectorySignOutUserErrorTypeEnum = createErrorEnumForAction(UserDirectoryActionType.SignOutUser, [\n 'Unauthorized', // the access token is missing/invalid/expired — there is nothing to revoke\n 'LimitExceeded', // too many attempts; the caller should back off and retry later\n]);\n\n// Globally signs the user out: revokes EVERY refresh token issued to the owner of this\n// access token, so a stolen/persisted refresh token stops working (logout / compromise\n// response). Access tokens already minted remain valid until they expire (stateless JWTs),\n// so keep the access-token validity short.\nexport function* askUserDirectorySignOutUser(accessToken: string): UserDirectorySignOutUserActionRequester {\n return yield {\n type: UserDirectoryActionType.SignOutUser,\n payload: {\n accessToken,\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
|
+
export interface UserDirectorySignOutUserActionPayload {
|
|
4
|
+
accessToken: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UserDirectorySignOutUserAction extends Action<UserDirectorySignOutUserActionPayload> {
|
|
7
|
+
type: UserDirectoryActionType.SignOutUser;
|
|
8
|
+
payload: UserDirectorySignOutUserActionPayload;
|
|
9
|
+
}
|
|
10
|
+
export type UserDirectorySignOutUserActionProcessor = ActionProcessor<UserDirectorySignOutUserAction, void>;
|
|
11
|
+
export type UserDirectorySignOutUserActionRequester = ActionRequester<UserDirectorySignOutUserAction, void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDirectorySignOutUserActionTypes.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/UserDirectorySignOutUserActionTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { Action, ActionProcessor, ActionRequester } from '../../types/Action';\nimport { UserDirectoryActionType } from './UserDirectoryActionType';\n\n// Payload\nexport interface UserDirectorySignOutUserActionPayload {\n accessToken: string;\n}\n\n// Action\nexport interface UserDirectorySignOutUserAction extends Action<UserDirectorySignOutUserActionPayload> {\n type: UserDirectoryActionType.SignOutUser;\n payload: UserDirectorySignOutUserActionPayload;\n}\n\n// Function Types\nexport type UserDirectorySignOutUserActionProcessor = ActionProcessor<UserDirectorySignOutUserAction, void>;\nexport type UserDirectorySignOutUserActionRequester = ActionRequester<UserDirectorySignOutUserAction, void>;\n"]}
|
|
@@ -32,9 +32,13 @@ export * from './UserDirectoryRequestEmailVerificationActionRequester';
|
|
|
32
32
|
export * from './UserDirectoryRequestEmailVerificationActionTypes';
|
|
33
33
|
export * from './UserDirectoryRespondToAuthChallengeActionRequester';
|
|
34
34
|
export * from './UserDirectoryRespondToAuthChallengeActionTypes';
|
|
35
|
+
export * from './UserDirectoryRevokeRefreshTokenActionRequester';
|
|
36
|
+
export * from './UserDirectoryRevokeRefreshTokenActionTypes';
|
|
35
37
|
export * from './UserDirectorySetAccessTokenActionRequester';
|
|
36
38
|
export * from './UserDirectorySetAccessTokenActionTypes';
|
|
37
39
|
export * from './UserDirectorySetPasswordActionRequester';
|
|
38
40
|
export * from './UserDirectorySetPasswordActionTypes';
|
|
39
41
|
export * from './UserDirectorySetUserAttributesActionRequester';
|
|
40
42
|
export * from './UserDirectorySetUserAttributesActionTypes';
|
|
43
|
+
export * from './UserDirectorySignOutUserActionRequester';
|
|
44
|
+
export * from './UserDirectorySignOutUserActionTypes';
|
|
@@ -32,10 +32,14 @@ export * from './UserDirectoryRequestEmailVerificationActionRequester';
|
|
|
32
32
|
export * from './UserDirectoryRequestEmailVerificationActionTypes';
|
|
33
33
|
export * from './UserDirectoryRespondToAuthChallengeActionRequester';
|
|
34
34
|
export * from './UserDirectoryRespondToAuthChallengeActionTypes';
|
|
35
|
+
export * from './UserDirectoryRevokeRefreshTokenActionRequester';
|
|
36
|
+
export * from './UserDirectoryRevokeRefreshTokenActionTypes';
|
|
35
37
|
export * from './UserDirectorySetAccessTokenActionRequester';
|
|
36
38
|
export * from './UserDirectorySetAccessTokenActionTypes';
|
|
37
39
|
export * from './UserDirectorySetPasswordActionRequester';
|
|
38
40
|
export * from './UserDirectorySetPasswordActionTypes';
|
|
39
41
|
export * from './UserDirectorySetUserAttributesActionRequester';
|
|
40
42
|
export * from './UserDirectorySetUserAttributesActionTypes';
|
|
43
|
+
export * from './UserDirectorySignOutUserActionRequester';
|
|
44
|
+
export * from './UserDirectorySignOutUserActionTypes';
|
|
41
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yDAAyD,CAAC;AACxE,cAAc,qDAAqD,CAAC;AACpE,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC","sourcesContent":["export * from './types';\nexport * from './UserDirectoryActionType';\nexport * from './UserDirectoryAssociateSoftwareTokenActionRequester';\nexport * from './UserDirectoryAssociateSoftwareTokenActionTypes';\nexport * from './UserDirectoryAuthenticateUserActionRequester';\nexport * from './UserDirectoryAuthenticateUserActionTypes';\nexport * from './UserDirectoryChangePasswordActionRequester';\nexport * from './UserDirectoryChangePasswordActionTypes';\nexport * from './UserDirectoryConfirmEmailVerificationActionRequester';\nexport * from './UserDirectoryConfirmEmailVerificationActionTypes';\nexport * from './UserDirectoryConfirmForgotPasswordActionRequester';\nexport * from './UserDirectoryConfirmForgotPasswordActionTypes';\nexport * from './UserDirectoryCreateUserActionRequester';\nexport * from './UserDirectoryCreateUserActionTypes';\nexport * from './UserDirectoryDecodeAccessTokenActionRequester';\nexport * from './UserDirectoryDecodeAccessTokenActionTypes';\nexport * from './UserDirectoryForgotPasswordActionRequester';\nexport * from './UserDirectoryForgotPasswordActionTypes';\nexport * from './UserDirectoryGetUserAttributesActionRequester';\nexport * from './UserDirectoryGetUserAttributesActionTypes';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionRequester';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionTypes';\nexport * from './UserDirectoryGetUsersActionRequester';\nexport * from './UserDirectoryGetUsersActionTypes';\nexport * from './UserDirectoryGetUsersByAttributeActionRequester';\nexport * from './UserDirectoryGetUsersByAttributeActionTypes';\nexport * from './UserDirectoryReadAccessTokenActionRequester';\nexport * from './UserDirectoryReadAccessTokenActionTypes';\nexport * from './UserDirectoryRefreshTokenActionRequester';\nexport * from './UserDirectoryRefreshTokenActionTypes';\nexport * from './UserDirectoryRequestEmailVerificationActionRequester';\nexport * from './UserDirectoryRequestEmailVerificationActionTypes';\nexport * from './UserDirectoryRespondToAuthChallengeActionRequester';\nexport * from './UserDirectoryRespondToAuthChallengeActionTypes';\nexport * from './UserDirectorySetAccessTokenActionRequester';\nexport * from './UserDirectorySetAccessTokenActionTypes';\nexport * from './UserDirectorySetPasswordActionRequester';\nexport * from './UserDirectorySetPasswordActionTypes';\nexport * from './UserDirectorySetUserAttributesActionRequester';\nexport * from './UserDirectorySetUserAttributesActionTypes';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/actions/userDirectory/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yDAAyD,CAAC;AACxE,cAAc,qDAAqD,CAAC;AACpE,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC","sourcesContent":["export * from './types';\nexport * from './UserDirectoryActionType';\nexport * from './UserDirectoryAssociateSoftwareTokenActionRequester';\nexport * from './UserDirectoryAssociateSoftwareTokenActionTypes';\nexport * from './UserDirectoryAuthenticateUserActionRequester';\nexport * from './UserDirectoryAuthenticateUserActionTypes';\nexport * from './UserDirectoryChangePasswordActionRequester';\nexport * from './UserDirectoryChangePasswordActionTypes';\nexport * from './UserDirectoryConfirmEmailVerificationActionRequester';\nexport * from './UserDirectoryConfirmEmailVerificationActionTypes';\nexport * from './UserDirectoryConfirmForgotPasswordActionRequester';\nexport * from './UserDirectoryConfirmForgotPasswordActionTypes';\nexport * from './UserDirectoryCreateUserActionRequester';\nexport * from './UserDirectoryCreateUserActionTypes';\nexport * from './UserDirectoryDecodeAccessTokenActionRequester';\nexport * from './UserDirectoryDecodeAccessTokenActionTypes';\nexport * from './UserDirectoryForgotPasswordActionRequester';\nexport * from './UserDirectoryForgotPasswordActionTypes';\nexport * from './UserDirectoryGetUserAttributesActionRequester';\nexport * from './UserDirectoryGetUserAttributesActionTypes';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionRequester';\nexport * from './UserDirectoryGetUserAttributesByUserIdActionTypes';\nexport * from './UserDirectoryGetUsersActionRequester';\nexport * from './UserDirectoryGetUsersActionTypes';\nexport * from './UserDirectoryGetUsersByAttributeActionRequester';\nexport * from './UserDirectoryGetUsersByAttributeActionTypes';\nexport * from './UserDirectoryReadAccessTokenActionRequester';\nexport * from './UserDirectoryReadAccessTokenActionTypes';\nexport * from './UserDirectoryRefreshTokenActionRequester';\nexport * from './UserDirectoryRefreshTokenActionTypes';\nexport * from './UserDirectoryRequestEmailVerificationActionRequester';\nexport * from './UserDirectoryRequestEmailVerificationActionTypes';\nexport * from './UserDirectoryRespondToAuthChallengeActionRequester';\nexport * from './UserDirectoryRespondToAuthChallengeActionTypes';\nexport * from './UserDirectoryRevokeRefreshTokenActionRequester';\nexport * from './UserDirectoryRevokeRefreshTokenActionTypes';\nexport * from './UserDirectorySetAccessTokenActionRequester';\nexport * from './UserDirectorySetAccessTokenActionTypes';\nexport * from './UserDirectorySetPasswordActionRequester';\nexport * from './UserDirectorySetPasswordActionTypes';\nexport * from './UserDirectorySetUserAttributesActionRequester';\nexport * from './UserDirectorySetUserAttributesActionTypes';\nexport * from './UserDirectorySignOutUserActionRequester';\nexport * from './UserDirectorySignOutUserActionTypes';\n"]}
|
|
@@ -25,6 +25,7 @@ export interface QPQConfigAdvancedUserDirectorySettings extends QPQConfigAdvance
|
|
|
25
25
|
dnsRecord?: AuthDirectoryDnsRecord;
|
|
26
26
|
customAuthRuntime?: CustomAuthRuntime;
|
|
27
27
|
mfa?: UserDirectoryMfaSettings;
|
|
28
|
+
accessTokenValidityMinutes?: number;
|
|
28
29
|
}
|
|
29
30
|
export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
30
31
|
name: string;
|
|
@@ -35,5 +36,6 @@ export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
|
35
36
|
dnsRecord?: AuthDirectoryDnsRecord;
|
|
36
37
|
customAuthRuntime?: CustomAuthRuntime;
|
|
37
38
|
mfa: UserDirectoryMfaSettings;
|
|
39
|
+
accessTokenValidityMinutes?: number;
|
|
38
40
|
}
|
|
39
41
|
export declare const defineUserDirectory: (name: string, options?: QPQConfigAdvancedUserDirectorySettings) => UserDirectoryQPQConfigSetting;
|
|
@@ -24,6 +24,7 @@ export const defineUserDirectory = (name, options) => ({
|
|
|
24
24
|
},
|
|
25
25
|
dnsRecord: options?.dnsRecord,
|
|
26
26
|
customAuthRuntime: options?.customAuthRuntime,
|
|
27
|
+
accessTokenValidityMinutes: options?.accessTokenValidityMinutes,
|
|
27
28
|
mfa: {
|
|
28
29
|
mode: options?.mfa?.mode ?? UserDirectoryMfaMode.off,
|
|
29
30
|
secondFactors: options?.mfa?.secondFactors?.length ? options.mfa.secondFactors : [UserDirectoryMfaSecondFactor.totp],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userDirectory.js","sourceRoot":"","sources":["../../../../src/config/settings/userDirectory.ts"],"names":[],"mappings":"AACA,OAAO,EAA+C,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACrG,OAAO,EAAE,oDAAoD,EAAE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BAAkB;KAChE;IAED,SAAS,EAAE,OAAO,EAAE,SAAS;IAC7B,iBAAiB,EAAE,OAAO,EAAE,iBAAiB;IAE7C,0BAA0B,EAAE,OAAO,EAAE,0BAA0B;IAE/D,GAAG,EAAE;QACH,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,IAAI,oBAAoB,CAAC,GAAG;QACpD,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC;KACrH;IAED,KAAK,EAAE,oDAAoD,CAAC,OAAO,EAAE,KAAK,CAAC;CAC5E,CAAC,CAAC","sourcesContent":["import { CrossModuleOwner } from '../../types';\nimport { QPQConfigAdvancedSettings, QPQConfigSetting, QPQCoreConfigSettingType } from '../QPQConfig';\nimport { convertCrossModuleOwnerToGenericResourceNameOverride } from '../utils/crossModuleUtils';\nimport { CustomAuthRuntime, EmailTemplates } from './emailTemplates';\n\nexport type AuthDirectoryDnsRecord = {\n subdomain: string;\n rootDomain: string;\n};\n\nexport enum UserDirectoryMfaMode {\n off = 'off',\n optional = 'optional',\n required = 'required',\n}\n\nexport enum UserDirectoryMfaSecondFactor {\n totp = 'totp',\n // sms = 'sms', // future — additionally needs phone + SNS role infra.\n}\n\nexport interface UserDirectoryMfaSettings {\n mode: UserDirectoryMfaMode;\n\n // Enabled second factors. Defaults to [totp] when omitted.\n secondFactors?: UserDirectoryMfaSecondFactor[];\n}\n\nexport interface QPQConfigAdvancedUserDirectorySettings extends QPQConfigAdvancedSettings {\n phoneRequired?: boolean;\n\n selfSignUpEnabled?: boolean;\n\n emailTemplates?: EmailTemplates;\n\n owner?: CrossModuleOwner<'userDirectoryName'>;\n\n dnsRecord?: AuthDirectoryDnsRecord;\n\n customAuthRuntime?: CustomAuthRuntime;\n\n mfa?: UserDirectoryMfaSettings;\n\n // Access/ID token (JWT) lifetime in minutes. Shorter = a smaller window in which a\n // revoked session's still-valid access token keeps working (access tokens are stateless\n // and can't be revoked before expiry). Cognito allows 5–1440; omitted → Cognito default\n // (60).\n //\n // Generally web apps should refresh in the few mins so this should be > 5.\n accessTokenValidityMinutes?: number;\n}\n\nexport interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {\n name: string;\n\n phoneRequired: boolean;\n\n selfSignUpEnabled: boolean;\n\n emailTemplates: EmailTemplates;\n\n owner?: CrossModuleOwner;\n\n dnsRecord?: AuthDirectoryDnsRecord;\n\n customAuthRuntime?: CustomAuthRuntime;\n\n mfa: UserDirectoryMfaSettings;\n\n accessTokenValidityMinutes?: number;\n}\n\nexport const defineUserDirectory = (name: string, options?: QPQConfigAdvancedUserDirectorySettings): UserDirectoryQPQConfigSetting => ({\n configSettingType: QPQCoreConfigSettingType.userDirectory,\n uniqueKey: name,\n\n name,\n\n phoneRequired: options?.phoneRequired || false,\n\n selfSignUpEnabled: options?.selfSignUpEnabled ?? false,\n\n emailTemplates: {\n verifyEmail: options?.emailTemplates?.verifyEmail,\n resetPassword: options?.emailTemplates?.resetPassword,\n resetPasswordAdmin: options?.emailTemplates?.resetPasswordAdmin,\n },\n\n dnsRecord: options?.dnsRecord,\n customAuthRuntime: options?.customAuthRuntime,\n\n accessTokenValidityMinutes: options?.accessTokenValidityMinutes,\n\n mfa: {\n mode: options?.mfa?.mode ?? UserDirectoryMfaMode.off,\n secondFactors: options?.mfa?.secondFactors?.length ? options.mfa.secondFactors : [UserDirectoryMfaSecondFactor.totp],\n },\n\n owner: convertCrossModuleOwnerToGenericResourceNameOverride(options?.owner),\n});\n"]}
|
|
@@ -18,6 +18,14 @@ export const createImplementationRuntime = (qpqConfig, tags, getDateNow, randomG
|
|
|
18
18
|
const moduleName = getApplicationModuleName(qpqConfig);
|
|
19
19
|
const resolveStory = createRuntime(qpqConfig, {
|
|
20
20
|
context: session.context,
|
|
21
|
+
// Service-local context and the caller's function globals travel into the
|
|
22
|
+
// nested implementation runtime (a within-service child: tool executor,
|
|
23
|
+
// drive file resolver, custom implementation), so stories run under it can
|
|
24
|
+
// read route/function config (e.g. the eventDoc user-directory global an
|
|
25
|
+
// AI tool needs to resolve the actor, or the tenant scope resolver). Mirrors
|
|
26
|
+
// the inline-function execute processor, which carries the same fields.
|
|
27
|
+
localContext: session.localContext,
|
|
28
|
+
functionGlobals: session.functionGlobals,
|
|
21
29
|
depth: (session.depth || 0) + 1,
|
|
22
30
|
decodedAccessToken: session.decodedAccessToken,
|
|
23
31
|
correlation: session.correlation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createImplementationRuntime.js","sourceRoot":"","sources":["../../src/createImplementationRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAOL,cAAc,GAGf,MAAM,SAAS,CAAC;AAEjB,4DAA4D;AAC5D,4DAA4D;AAE5D,gFAAgF;AAChF,wFAAwF;AAExF,oGAAoG;AAEpG,8EAA8E;AAC9E,6CAA6C;AAC7C,+CAA+C;AAE/C,4IAA4I;AAC5I,+BAA+B;AAC/B,0BAA0B;AAC1B,KAAK;AAEL,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,SAAoB,EACpB,IAAc,EAEd,UAA+C,EAC/C,UAAwB,EAExB,OAAqB,EACrB,gBAAqC,EACrC,MAAiB,EACjB,mBAAwC,EACxC,cAA+B,EACG,EAAE;IACpC,MAAM,UAAU,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,aAAa,CAChC,SAAS,EACT;QACE,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CA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AAC7B,CAAC,CAAC","sourcesContent":["import { actionResult, actionResultError } from './logic/actionLogic';\nimport { QPQConfig } from './config';\nimport { getApplicationModuleName } from './qpqCoreUtils';\nimport { createRuntime } from './runtime';\nimport {\n ActionProcessor,\n ActionProcessorList,\n ActionProcessorListResolver,\n AnyStory,\n DynamicModuleLoader,\n QpqLogger,\n QpqRuntimeType,\n StorySession,\n StreamRegistry,\n} from './types';\n\n// export const getDateNow = () => new Date().toISOString();\n// export const randomGuid = () => new Date().toISOString();\n\n// export type ActionProcessorReturnType<AP extends ActionProcessor<any, any>> =\n// ReturnType<AP> extends AsyncActionProcessorResult<infer TReturn> ? TReturn : never;\n\n// export type ActionProcessorPayloadType<AP extends ActionProcessor<any, any>> = Parameters<AP>[0];\n\n// export type ActionProcessorNative<AP extends ActionProcessor<any, any>> = (\n// payload: ActionProcessorPayloadType<AP>,\n// ) => Promise<ActionProcessorReturnType<AP>>;\n\n// export const resolveActionProcessorToNative = <AP extends ActionProcessor<any, any>>(actionProcessor: AP): ActionProcessorNative<AP> => {\n// // return null as TReturn;\n// return null as never;\n// };\n\nexport const createImplementationRuntime = (\n qpqConfig: QPQConfig,\n tags: string[],\n\n getDateNow: Parameters<typeof createRuntime>[3],\n randomGuid: () => string,\n\n session: StorySession,\n actionProcessors: ActionProcessorList,\n logger: QpqLogger,\n dynamicModuleLoader: DynamicModuleLoader,\n streamRegistry?: StreamRegistry,\n): ReturnType<typeof createRuntime> => {\n const moduleName = getApplicationModuleName(qpqConfig);\n\n const resolveStory = createRuntime(\n qpqConfig,\n {\n context: session.context,\n depth: (session.depth || 0) + 1,\n decodedAccessToken: session.decodedAccessToken,\n correlation: session.correlation,\n },\n async () => actionProcessors,\n getDateNow,\n logger,\n // TODO: Share this logic.\n `${moduleName}::${randomGuid()}`,\n QpqRuntimeType.EXECUTE_IMPLEMENTATION_STORY,\n dynamicModuleLoader,\n undefined,\n tags,\n streamRegistry,\n );\n\n return resolveStory;\n};\n\nexport const getProcessCustomImplementation = <T extends ActionProcessor<any, any>>(\n qpqConfig: QPQConfig,\n story: AnyStory,\n tag: string,\n actionProcessorListResolver: ActionProcessorListResolver | null,\n getDateNow: () => string,\n getNewGuid: () => string,\n): T => {\n const actionProcesor: ActionProcessor<any, any> = async (\n payload,\n session,\n actionProcessorList,\n logger,\n updateSession,\n dynamicModuleLoader,\n streamRegistry,\n ) => {\n const resolveStory = createImplementationRuntime(\n qpqConfig,\n [tag],\n getDateNow,\n getNewGuid,\n session,\n {\n ...actionProcessorList,\n ...(actionProcessorListResolver ? await actionProcessorListResolver(qpqConfig, dynamicModuleLoader) : {}),\n },\n logger,\n dynamicModuleLoader,\n streamRegistry,\n );\n\n const storyResult = await resolveStory(story, [payload]);\n\n if (storyResult.error) {\n return actionResultError(storyResult.error.errorType, storyResult.error.errorText);\n }\n\n return actionResult(storyResult.result);\n };\n\n return actionProcesor as T;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"createImplementationRuntime.js","sourceRoot":"","sources":["../../src/createImplementationRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAOL,cAAc,GAGf,MAAM,SAAS,CAAC;AAEjB,4DAA4D;AAC5D,4DAA4D;AAE5D,gFAAgF;AAChF,wFAAwF;AAExF,oGAAoG;AAEpG,8EAA8E;AAC9E,6CAA6C;AAC7C,+CAA+C;AAE/C,4IAA4I;AAC5I,+BAA+B;AAC/B,0BAA0B;AAC1B,KAAK;AAEL,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,SAAoB,EACpB,IAAc,EAEd,UAA+C,EAC/C,UAAwB,EAExB,OAAqB,EACrB,gBAAqC,EACrC,MAAiB,EACjB,mBAAwC,EACxC,cAA+B,EACG,EAAE;IACpC,MAAM,UA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Ac,CACf,CAAC;QAEF,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAEzD,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YACtB,OAAO,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACrF,CAAC;QAED,OAAO,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,OAAO,cAAmB,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["import { actionResult, actionResultError } from './logic/actionLogic';\nimport { QPQConfig } from './config';\nimport { getApplicationModuleName } from './qpqCoreUtils';\nimport { createRuntime } from './runtime';\nimport {\n ActionProcessor,\n ActionProcessorList,\n ActionProcessorListResolver,\n AnyStory,\n DynamicModuleLoader,\n QpqLogger,\n QpqRuntimeType,\n StorySession,\n StreamRegistry,\n} from './types';\n\n// export const getDateNow = () => new Date().toISOString();\n// export const randomGuid = () => new Date().toISOString();\n\n// export type ActionProcessorReturnType<AP extends ActionProcessor<any, any>> =\n// ReturnType<AP> extends AsyncActionProcessorResult<infer TReturn> ? TReturn : never;\n\n// export type ActionProcessorPayloadType<AP extends ActionProcessor<any, any>> = Parameters<AP>[0];\n\n// export type ActionProcessorNative<AP extends ActionProcessor<any, any>> = (\n// payload: ActionProcessorPayloadType<AP>,\n// ) => Promise<ActionProcessorReturnType<AP>>;\n\n// export const resolveActionProcessorToNative = <AP extends ActionProcessor<any, any>>(actionProcessor: AP): ActionProcessorNative<AP> => {\n// // return null as TReturn;\n// return null as never;\n// };\n\nexport const createImplementationRuntime = (\n qpqConfig: QPQConfig,\n tags: string[],\n\n getDateNow: Parameters<typeof createRuntime>[3],\n randomGuid: () => string,\n\n session: StorySession,\n actionProcessors: ActionProcessorList,\n logger: QpqLogger,\n dynamicModuleLoader: DynamicModuleLoader,\n streamRegistry?: StreamRegistry,\n): ReturnType<typeof createRuntime> => {\n const moduleName = getApplicationModuleName(qpqConfig);\n\n const resolveStory = createRuntime(\n qpqConfig,\n {\n context: session.context,\n // Service-local context and the caller's function globals travel into the\n // nested implementation runtime (a within-service child: tool executor,\n // drive file resolver, custom implementation), so stories run under it can\n // read route/function config (e.g. the eventDoc user-directory global an\n // AI tool needs to resolve the actor, or the tenant scope resolver). Mirrors\n // the inline-function execute processor, which carries the same fields.\n localContext: session.localContext,\n functionGlobals: session.functionGlobals,\n depth: (session.depth || 0) + 1,\n decodedAccessToken: session.decodedAccessToken,\n correlation: session.correlation,\n },\n async () => actionProcessors,\n getDateNow,\n logger,\n // TODO: Share this logic.\n `${moduleName}::${randomGuid()}`,\n QpqRuntimeType.EXECUTE_IMPLEMENTATION_STORY,\n dynamicModuleLoader,\n undefined,\n tags,\n streamRegistry,\n );\n\n return resolveStory;\n};\n\nexport const getProcessCustomImplementation = <T extends ActionProcessor<any, any>>(\n qpqConfig: QPQConfig,\n story: AnyStory,\n tag: string,\n actionProcessorListResolver: ActionProcessorListResolver | null,\n getDateNow: () => string,\n getNewGuid: () => string,\n): T => {\n const actionProcesor: ActionProcessor<any, any> = async (\n payload,\n session,\n actionProcessorList,\n logger,\n updateSession,\n dynamicModuleLoader,\n streamRegistry,\n ) => {\n const resolveStory = createImplementationRuntime(\n qpqConfig,\n [tag],\n getDateNow,\n getNewGuid,\n session,\n {\n ...actionProcessorList,\n ...(actionProcessorListResolver ? await actionProcessorListResolver(qpqConfig, dynamicModuleLoader) : {}),\n },\n logger,\n dynamicModuleLoader,\n streamRegistry,\n );\n\n const storyResult = await resolveStory(story, [payload]);\n\n if (storyResult.error) {\n return actionResultError(storyResult.error.errorType, storyResult.error.errorText);\n }\n\n return actionResult(storyResult.result);\n };\n\n return actionProcesor as T;\n};\n"]}
|
|
@@ -17,11 +17,15 @@ export async function resolveStory(story, args, qpqConfig, callerSession, getAct
|
|
|
17
17
|
decodedAccessToken: callerSession.decodedAccessToken,
|
|
18
18
|
context: callerSession.context,
|
|
19
19
|
localContext: callerSession.localContext,
|
|
20
|
-
// In-process story executions
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
|
|
20
|
+
// In-process story executions run WITHIN the caller's function, so they
|
|
21
|
+
// inherit its globals - their own registration wins on collision. This
|
|
22
|
+
// covers inline functions (EXECUTE_STORY) AND implementation stories
|
|
23
|
+
// (EXECUTE_IMPLEMENTATION_STORY: tool executors, drive file resolvers,
|
|
24
|
+
// custom implementations) - both are nested, not transport boundaries, so
|
|
25
|
+
// an AI tool executor can read the queue/route globals (e.g. the eventDoc
|
|
26
|
+
// user-directory global needed to resolve the actor). Transport entries
|
|
27
|
+
// (http/queue/ws) start fresh from their own runtime registration only.
|
|
28
|
+
functionGlobals: runtimeType === QpqRuntimeType.EXECUTE_STORY || runtimeType === QpqRuntimeType.EXECUTE_IMPLEMENTATION_STORY
|
|
25
29
|
? {
|
|
26
30
|
...callerSession.functionGlobals,
|
|
27
31
|
...runtimeGlobals,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveStory.js","sourceRoot":"","sources":["../../../src/runtime/resolveStory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAyD,MAAM,uBAAuB,CAAC;AAC9G,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAAwB,EACxB,IAAW,EACX,SAAoB,EACpB,aAA2B,EAC3B,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AE;gBACL,SAAS,EAAE,6BAA6B;gBACxC,SAAS,EAAE,aAAa,CAAC,YAAY;gBACrC,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI;aACvC;SACF,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG;QAClB,GAAG,QAAQ;QACX,UAAU,EAAE,UAAU,EAAE;QACxB,MAAM,EAAE,aAAa,CAAC,KAAK;KAC5B,CAAC;IAEF,yHAAyH;IACzH,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { QPQConfig } from '../config';\nimport { isErroredActionResult, resolveActionResult, resolveActionResultError } from '../logic/actionLogic';\nimport { createStreamRegistry } from '../logic/stream';\nimport { getApplicationModuleName } from '../qpqCoreUtils';\nimport { QpqFunctionRuntime, QpqLogger, StreamRegistry } from '../types';\nimport { Action, ActionProcessorList } from '../types/Action';\nimport { ErrorTypeEnum } from '../types/ErrorTypeEnum';\nimport { QpqRuntimeType, Story, StoryResult, StorySession, StorySessionUpdater } from '../types/StorySession';\nimport { isQpqFunctionRuntimeAdvanced } from '../utils';\nimport { processAction } from './processAction';\n\nexport async function resolveStory<TArgs extends Array<any>>(\n story: Story<TArgs, any>,\n args: TArgs,\n qpqConfig: QPQConfig,\n callerSession: StorySession,\n getActionProcessors: (config: QPQConfig, dynamicModuleLoader: any) => Promise<ActionProcessorList>,\n getTimeNow: () => string,\n logger: QpqLogger,\n runtimeCorrelation: string,\n runtimeType: QpqRuntimeType,\n dynamicModuleLoader: any,\n qpqFunctionRuntimeInfo?: QpqFunctionRuntime,\n initialTags?: string[],\n streamRegistry?: StreamRegistry,\n): Promise<StoryResult<any>> {\n const actionProcessors: ActionProcessorList = await getActionProcessors(qpqConfig, dynamicModuleLoader);\n const registry = streamRegistry ?? createStreamRegistry();\n const reader = story(...args);\n\n const runtimeGlobals = qpqFunctionRuntimeInfo && isQpqFunctionRuntimeAdvanced(qpqFunctionRuntimeInfo) ? qpqFunctionRuntimeInfo.globals : undefined;\n\n let storyProgress: IteratorResult<Action<any>, any> | null = null;\n let storySession: StorySession = {\n correlation: runtimeCorrelation,\n depth: callerSession.depth + 1,\n decodedAccessToken: callerSession.decodedAccessToken,\n context: callerSession.context,\n localContext: callerSession.localContext,\n // In-process story executions (inline functions) run WITHIN the caller's\n // function, so they inherit its globals - their own registration wins on\n // collision. Transport entries (http/queue/ws) start fresh from their own\n // runtime registration only.\n functionGlobals:\n runtimeType === QpqRuntimeType.EXECUTE_STORY\n ? {\n ...callerSession.functionGlobals,\n ...runtimeGlobals,\n }\n : runtimeGlobals,\n };\n\n const updateSession: StorySessionUpdater = (newSession: Partial<StorySession>): void => {\n storySession = { ...storySession, ...newSession };\n };\n\n const response: StoryResult<any> = {\n input: args,\n session: { ...storySession },\n history: [],\n startedAt: getTimeNow(),\n finishedAt: getTimeNow(),\n tags: initialTags || [],\n moduleName: getApplicationModuleName(qpqConfig),\n correlation: storySession.correlation!,\n fromCorrelation: callerSession.correlation,\n runtimeType: runtimeType,\n logs: [],\n qpqFunctionRuntimeInfo,\n };\n\n // Enforce maximum depth\n if (storySession.depth > 100) {\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: `Story depth exceeded [${storySession.depth}]!`,\n errorType: ErrorTypeEnum.GenericError,\n },\n };\n }\n\n try {\n storyProgress = reader.next();\n\n while (!storyProgress.done) {\n const action = storyProgress.value;\n const executionTime = getTimeNow();\n\n const actionResult = await processAction(action, actionProcessors, storySession, logger, updateSession, dynamicModuleLoader, registry);\n\n const historyEntry = {\n act: action,\n res: actionResult,\n startedAt: executionTime,\n finishedAt: getTimeNow(),\n };\n\n // console.log(`${action.type}: took ${new Date(historyEntry.finishedAt).getTime() - new Date(historyEntry.startedAt).getTime()}ms`);\n response.history.push(historyEntry);\n\n if (isErroredActionResult(actionResult) && !action.returnErrors) {\n console.log('Caught Error:', JSON.stringify(resolveActionResultError(actionResult)));\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: resolveActionResultError(actionResult),\n };\n }\n\n // Feed the result back to the story generator\n if (action.returnErrors) {\n const isSuccess = !isErroredActionResult(actionResult);\n const result = isSuccess\n ? { success: true, result: resolveActionResult(actionResult) }\n : { success: false, error: resolveActionResultError(actionResult) };\n storyProgress = reader.next(result);\n } else {\n storyProgress = reader.next(resolveActionResult(actionResult));\n }\n }\n } catch (err) {\n if (err instanceof Error) {\n console.log(`Uncaught Error: [${JSON.stringify(storyProgress?.value?.type)}] ${err.message}`);\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: err.message,\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: 'Unknown error has occurred!',\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n\n const storyResult = {\n ...response,\n finishedAt: getTimeNow(),\n result: storyProgress.value,\n };\n\n // console.log(`story took ${new Date(storyResult.finishedAt).getTime() - new Date(storyResult.startedAt).getTime()}ms`);\n return storyResult;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"resolveStory.js","sourceRoot":"","sources":["../../../src/runtime/resolveStory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAyD,MAAM,uBAAuB,CAAC;AAC9G,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAAwB,EACxB,IAAW,EACX,SAAoB,EACpB,aAA2B,EAC3B,mBAAkG,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C;QACJ,CAAC;QACD,OAAO;YACL,GAAG,QAAQ;YACX,UAAU,EAAE,UAAU,EAAE;YACxB,KAAK,EAAE;gBACL,SAAS,EAAE,6BAA6B;gBACxC,SAAS,EAAE,aAAa,CAAC,YAAY;gBACrC,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI;aACvC;SACF,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG;QAClB,GAAG,QAAQ;QACX,UAAU,EAAE,UAAU,EAAE;QACxB,MAAM,EAAE,aAAa,CAAC,KAAK;KAC5B,CAAC;IAEF,yHAAyH;IACzH,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { QPQConfig } from '../config';\nimport { isErroredActionResult, resolveActionResult, resolveActionResultError } from '../logic/actionLogic';\nimport { createStreamRegistry } from '../logic/stream';\nimport { getApplicationModuleName } from '../qpqCoreUtils';\nimport { QpqFunctionRuntime, QpqLogger, StreamRegistry } from '../types';\nimport { Action, ActionProcessorList } from '../types/Action';\nimport { ErrorTypeEnum } from '../types/ErrorTypeEnum';\nimport { QpqRuntimeType, Story, StoryResult, StorySession, StorySessionUpdater } from '../types/StorySession';\nimport { isQpqFunctionRuntimeAdvanced } from '../utils';\nimport { processAction } from './processAction';\n\nexport async function resolveStory<TArgs extends Array<any>>(\n story: Story<TArgs, any>,\n args: TArgs,\n qpqConfig: QPQConfig,\n callerSession: StorySession,\n getActionProcessors: (config: QPQConfig, dynamicModuleLoader: any) => Promise<ActionProcessorList>,\n getTimeNow: () => string,\n logger: QpqLogger,\n runtimeCorrelation: string,\n runtimeType: QpqRuntimeType,\n dynamicModuleLoader: any,\n qpqFunctionRuntimeInfo?: QpqFunctionRuntime,\n initialTags?: string[],\n streamRegistry?: StreamRegistry,\n): Promise<StoryResult<any>> {\n const actionProcessors: ActionProcessorList = await getActionProcessors(qpqConfig, dynamicModuleLoader);\n const registry = streamRegistry ?? createStreamRegistry();\n const reader = story(...args);\n\n const runtimeGlobals = qpqFunctionRuntimeInfo && isQpqFunctionRuntimeAdvanced(qpqFunctionRuntimeInfo) ? qpqFunctionRuntimeInfo.globals : undefined;\n\n let storyProgress: IteratorResult<Action<any>, any> | null = null;\n let storySession: StorySession = {\n correlation: runtimeCorrelation,\n depth: callerSession.depth + 1,\n decodedAccessToken: callerSession.decodedAccessToken,\n context: callerSession.context,\n localContext: callerSession.localContext,\n // In-process story executions run WITHIN the caller's function, so they\n // inherit its globals - their own registration wins on collision. This\n // covers inline functions (EXECUTE_STORY) AND implementation stories\n // (EXECUTE_IMPLEMENTATION_STORY: tool executors, drive file resolvers,\n // custom implementations) - both are nested, not transport boundaries, so\n // an AI tool executor can read the queue/route globals (e.g. the eventDoc\n // user-directory global needed to resolve the actor). Transport entries\n // (http/queue/ws) start fresh from their own runtime registration only.\n functionGlobals:\n runtimeType === QpqRuntimeType.EXECUTE_STORY || runtimeType === QpqRuntimeType.EXECUTE_IMPLEMENTATION_STORY\n ? {\n ...callerSession.functionGlobals,\n ...runtimeGlobals,\n }\n : runtimeGlobals,\n };\n\n const updateSession: StorySessionUpdater = (newSession: Partial<StorySession>): void => {\n storySession = { ...storySession, ...newSession };\n };\n\n const response: StoryResult<any> = {\n input: args,\n session: { ...storySession },\n history: [],\n startedAt: getTimeNow(),\n finishedAt: getTimeNow(),\n tags: initialTags || [],\n moduleName: getApplicationModuleName(qpqConfig),\n correlation: storySession.correlation!,\n fromCorrelation: callerSession.correlation,\n runtimeType: runtimeType,\n logs: [],\n qpqFunctionRuntimeInfo,\n };\n\n // Enforce maximum depth\n if (storySession.depth > 100) {\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: `Story depth exceeded [${storySession.depth}]!`,\n errorType: ErrorTypeEnum.GenericError,\n },\n };\n }\n\n try {\n storyProgress = reader.next();\n\n while (!storyProgress.done) {\n const action = storyProgress.value;\n const executionTime = getTimeNow();\n\n const actionResult = await processAction(action, actionProcessors, storySession, logger, updateSession, dynamicModuleLoader, registry);\n\n const historyEntry = {\n act: action,\n res: actionResult,\n startedAt: executionTime,\n finishedAt: getTimeNow(),\n };\n\n // console.log(`${action.type}: took ${new Date(historyEntry.finishedAt).getTime() - new Date(historyEntry.startedAt).getTime()}ms`);\n response.history.push(historyEntry);\n\n if (isErroredActionResult(actionResult) && !action.returnErrors) {\n console.log('Caught Error:', JSON.stringify(resolveActionResultError(actionResult)));\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: resolveActionResultError(actionResult),\n };\n }\n\n // Feed the result back to the story generator\n if (action.returnErrors) {\n const isSuccess = !isErroredActionResult(actionResult);\n const result = isSuccess\n ? { success: true, result: resolveActionResult(actionResult) }\n : { success: false, error: resolveActionResultError(actionResult) };\n storyProgress = reader.next(result);\n } else {\n storyProgress = reader.next(resolveActionResult(actionResult));\n }\n }\n } catch (err) {\n if (err instanceof Error) {\n console.log(`Uncaught Error: [${JSON.stringify(storyProgress?.value?.type)}] ${err.message}`);\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: err.message,\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n return {\n ...response,\n finishedAt: getTimeNow(),\n error: {\n errorText: 'Unknown error has occurred!',\n errorType: ErrorTypeEnum.GenericError,\n errorStack: storyProgress?.value?.type,\n },\n };\n }\n\n const storyResult = {\n ...response,\n finishedAt: getTimeNow(),\n result: storyProgress.value,\n };\n\n // console.log(`story took ${new Date(storyResult.finishedAt).getTime() - new Date(storyResult.startedAt).getTime()}ms`);\n return storyResult;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UnionToIntersection<T> = (T extends unknown ? (member: T) => void : never) extends (member: infer TIntersection) => void ? TIntersection : never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnionToIntersection.js","sourceRoot":"","sources":["../../../src/types/UnionToIntersection.ts"],"names":[],"mappings":"","sourcesContent":["// Standard union-to-intersection: distributing T into a contravariant (parameter)\n// position makes inference produce the intersection of the union's members.\nexport type UnionToIntersection<T> = (T extends unknown ? (member: T) => void : never) extends (member: infer TIntersection) => void\n ? TIntersection\n : never;\n"]}
|
package/lib/esm/types/index.d.ts
CHANGED
package/lib/esm/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC","sourcesContent":["export * from './Action';\nexport * from './authChallenge';\nexport * from './BoundLogicStory';\nexport * from './ConfigUrlDefinition';\nexport * from './CrossModuleMessage';\nexport * from './CrossModuleOwner';\nexport * from './CrossServiceResourceName';\nexport * from './DecomposedString';\nexport * from './DeployEvent';\nexport * from './DynamicModuleLoader';\nexport * from './ErrorTypeEnum';\nexport * from './EventMessage';\nexport * from './ExcludeKeys';\nexport * from './FullyQualifiedResource';\nexport * from './KeyOf';\nexport * from './LogLevelEnum';\nexport * from './Lookup';\nexport * from './NotifyErrorQueueEvent';\nexport * from './Nullable';\nexport * from './QPQBinaryData';\nexport * from './QpqContextIdentifier';\nexport * from './QpqExecutionTrace';\nexport * from './QpqFunctionRuntime';\nexport * from './QpqIsoDateTime';\nexport * from './QpqLogger';\nexport * from './QpqPagedData';\nexport * from './QueueEvent';\nexport * from './Readonlyify';\nexport * from './ScheduledEvent';\nexport * from './StorySession';\nexport * from './StreamRegistry';\nexport * from './UnboundLogicStory';\nexport * from './utils';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC","sourcesContent":["export * from './Action';\nexport * from './authChallenge';\nexport * from './BoundLogicStory';\nexport * from './ConfigUrlDefinition';\nexport * from './CrossModuleMessage';\nexport * from './CrossModuleOwner';\nexport * from './CrossServiceResourceName';\nexport * from './DecomposedString';\nexport * from './DeployEvent';\nexport * from './DynamicModuleLoader';\nexport * from './ErrorTypeEnum';\nexport * from './EventMessage';\nexport * from './ExcludeKeys';\nexport * from './FullyQualifiedResource';\nexport * from './KeyOf';\nexport * from './LogLevelEnum';\nexport * from './Lookup';\nexport * from './NotifyErrorQueueEvent';\nexport * from './Nullable';\nexport * from './QPQBinaryData';\nexport * from './QpqContextIdentifier';\nexport * from './QpqExecutionTrace';\nexport * from './QpqFunctionRuntime';\nexport * from './QpqIsoDateTime';\nexport * from './QpqLogger';\nexport * from './QpqPagedData';\nexport * from './QueueEvent';\nexport * from './Readonlyify';\nexport * from './ScheduledEvent';\nexport * from './StorySession';\nexport * from './StreamRegistry';\nexport * from './UnboundLogicStory';\nexport * from './UnionToIntersection';\nexport * from './utils';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"homepage": "https://github.com/joe-coady/quidproquo#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^24.2.1",
|
|
36
|
-
"quidproquo-tsconfig": "0.1.
|
|
36
|
+
"quidproquo-tsconfig": "0.1.10",
|
|
37
37
|
"typescript": "^5.8.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|