@intuned/runtime-dev 1.1.2-auth-helper.2 → 1.1.2-auth-helper.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/backendFunctions/getAuthSessionParameters.js +2 -2
- package/dist/common/cli/constants.js +1 -1
- package/dist/common/cli/types.d.ts +1 -1
- package/dist/common/runApi/errors.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -0
- package/dist/runtime/getAuthSessionParameters.js +2 -2
- package/package.json +1 -1
- package/template.tsconfig.json +4 -7
|
@@ -15,11 +15,11 @@ const authSessionParametersResponseSchema = _zod.z.object({
|
|
|
15
15
|
async function getAuthSessionParameters() {
|
|
16
16
|
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
17
17
|
if (!context) {
|
|
18
|
-
throw new Error("getAuthSessionParameters failed due to an internal error.");
|
|
18
|
+
throw new Error("getAuthSessionParameters failed due to an internal error (context was not found).");
|
|
19
19
|
}
|
|
20
20
|
const authSessionId = context.authSessionId;
|
|
21
21
|
if ((0, _isNil.default)(authSessionId)) {
|
|
22
|
-
throw new Error("
|
|
22
|
+
throw new Error("Auth sessions are not enabled");
|
|
23
23
|
}
|
|
24
24
|
const response = await (0, _jwtTokenManager.callBackendFunctionWithToken)(`auth-session/${authSessionId}/parameters`, {
|
|
25
25
|
method: "GET"
|
|
@@ -10,7 +10,7 @@ export declare const maxLevelsExceededErrorCode = "MaxLevelsExceededError";
|
|
|
10
10
|
export declare const automationError = "AutomationError";
|
|
11
11
|
export declare const internalInvalidInputErrorCode = "InternalInvalidInputError";
|
|
12
12
|
export declare const runAutomationErrorCodes: readonly ["APINotFoundError", "InvalidAPIError", "InvalidCheckError", "AbortedError", "AuthRequiredError", "AuthCheckNotFoundError", "AuthCheckFailedError", "MaxLevelsExceededError", "AutomationError", "InternalInvalidInputError"];
|
|
13
|
-
export type RunAutomationErrorCode =
|
|
13
|
+
export type RunAutomationErrorCode = typeof runAutomationErrorCodes[number];
|
|
14
14
|
export declare abstract class RunAutomationError<T = any> {
|
|
15
15
|
code: RunAutomationErrorCode;
|
|
16
16
|
statusCode: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, } from "./runtime";
|
|
1
|
+
export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, getAuthSessionParameters, } from "./runtime";
|
|
2
2
|
export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
|
|
3
3
|
export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
|
|
4
4
|
export { getProductionPlaywrightConstructs } from "./common/getPlaywrightConstructs";
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "extendTimeout", {
|
|
|
21
21
|
return _runtime.extendTimeout;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "getAuthSessionParameters", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _runtime.getAuthSessionParameters;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "getDownloadDirectoryPath", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
@@ -8,13 +8,13 @@ var _asyncLocalStorage = require("../common/asyncLocalStorage");
|
|
|
8
8
|
async function getAuthSessionParameters() {
|
|
9
9
|
const context = (0, _asyncLocalStorage.getExecutionContext)();
|
|
10
10
|
if (!context) {
|
|
11
|
-
throw new Error("getAuthSessionParameters failed due to an internal error.");
|
|
11
|
+
throw new Error("getAuthSessionParameters failed due to an internal error (context was not found).");
|
|
12
12
|
}
|
|
13
13
|
const {
|
|
14
14
|
getAuthSessionParameters
|
|
15
15
|
} = context;
|
|
16
16
|
if (!getAuthSessionParameters) {
|
|
17
|
-
throw new Error("getAuthSessionParameters
|
|
17
|
+
throw new Error("getAuthSessionParameters failed due to an internal error (helper was not found on context).");
|
|
18
18
|
}
|
|
19
19
|
return await getAuthSessionParameters();
|
|
20
20
|
}
|
package/package.json
CHANGED
package/template.tsconfig.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "ESNext",
|
|
4
3
|
"target": "ES2021",
|
|
5
|
-
"lib": [
|
|
6
|
-
"dom",
|
|
7
|
-
"es2021"
|
|
8
|
-
],
|
|
4
|
+
"lib": ["dom", "es2021"],
|
|
9
5
|
"resolveJsonModule": true,
|
|
10
6
|
"esModuleInterop": true,
|
|
11
|
-
"moduleResolution": "
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"module": "esnext",
|
|
12
9
|
"skipLibCheck": true
|
|
13
10
|
}
|
|
14
|
-
}
|
|
11
|
+
}
|