@intuned/runtime-dev 1.1.2-auth-helper.2 → 1.1.2-auth-helper.4

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.
@@ -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("authSessionId is not set");
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"
@@ -27,7 +27,7 @@ const userCLIScripts = exports.userCLIScripts = {
27
27
  };
28
28
  const tsConfigCli = exports.tsConfigCli = {
29
29
  compilerOptions: {
30
- moduleResolution: "node",
30
+ moduleResolution: "bundler",
31
31
  target: "ES2021",
32
32
  outDir: "./dist",
33
33
  sourceMap: false,
@@ -1,5 +1,5 @@
1
1
  export declare const templateIds: string[];
2
- export type TemplateId = (typeof templateIds)[number];
2
+ export type TemplateId = typeof templateIds[number];
3
3
  /**
4
4
  * A simple, tree-like structure to describe the contents of a folder to be mounted.
5
5
  *
@@ -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 = (typeof runAutomationErrorCodes)[number];
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 () {
@@ -201,3 +201,18 @@ export declare function requestMultipleChoice(
201
201
  * ```
202
202
  */
203
203
  export declare function requestOTP(message: string): unknown;
204
+
205
+ /**
206
+ * Retrieves the parameters for the authentication session currently being used.
207
+ *
208
+ * @returns {AuthSessionParameters} An object containing the parameters for the current authentication session.
209
+ *
210
+ * @example
211
+ * ```typescript getAuthSessionParameters
212
+ * import { getAuthSessionParameters } from "@intuned/sdk/runtime"
213
+ *
214
+ * const authSessionParams = getAuthSessionParameters();
215
+ * console.log(authSessionParams);
216
+ * ```
217
+ */
218
+ export declare function getAuthSessionParameters();
@@ -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 is not defined.");
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.1.2-auth-helper.2",
3
+ "version": "1.1.2-auth-helper.4",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -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": "node",
7
+ "moduleResolution": "bundler",
8
+ "module": "esnext",
12
9
  "skipLibCheck": true
13
10
  }
14
- }
11
+ }