@intuned/runtime-dev 1.0.6-cli-auth.0.0.1 → 1.0.6-cli-auth.0.0.3-test
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.
|
@@ -20,7 +20,7 @@ _commander.program.description("Create an auth session").option("-i, --input <in
|
|
|
20
20
|
const authSessionInputPath = _path.default.join(process.cwd(), authSessionInputFile);
|
|
21
21
|
authSessionInput = await fs.readJSON(authSessionInputPath);
|
|
22
22
|
}
|
|
23
|
-
const session = (0, _utils.runCreateApi)(authSessionInput);
|
|
23
|
+
const session = await (0, _utils.runCreateApi)(authSessionInput);
|
|
24
24
|
console.log(_chalk.default.green("Auth session created successfully!"));
|
|
25
25
|
console.log(_chalk.default.blue("Session details:"));
|
|
26
26
|
console.log(_chalk.default.blue(JSON.stringify(session, null, 2)));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { StorageState } from "../../common/contextStorageStateHelpers";
|
|
2
1
|
export declare function isAuthEnabled(): Promise<boolean>;
|
|
3
2
|
export declare function ensureCreateApi(): Promise<boolean>;
|
|
4
|
-
export declare function runCreateApi(authSessionInput: Record<string, any>): Promise<
|
|
3
|
+
export declare function runCreateApi(authSessionInput: Record<string, any>): Promise<any>;
|
|
@@ -13,7 +13,6 @@ var _utils = require("../run-api-cli/utils");
|
|
|
13
13
|
var _asyncLocalStorage = require("../../common/asyncLocalStorage");
|
|
14
14
|
var _enums = require("../../runtime/enums");
|
|
15
15
|
var _nanoid = require("nanoid");
|
|
16
|
-
var _runApi = require("../../common/runApi");
|
|
17
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -42,13 +41,7 @@ async function runCreateApi(authSessionInput) {
|
|
|
42
41
|
}, () => (0, _utils.runApiViaCLI)(createApiName, authSessionInput, {
|
|
43
42
|
retrieveSession: true
|
|
44
43
|
}));
|
|
45
|
-
|
|
46
|
-
throw new _runApi.AutomationError(runCreateResult.result.error);
|
|
47
|
-
}
|
|
48
|
-
if (!runCreateResult.session) {
|
|
49
|
-
throw new Error(`Auth session not retrieved in the result. Please check the create API.`);
|
|
50
|
-
}
|
|
51
|
-
return runCreateResult.session;
|
|
44
|
+
return runCreateResult;
|
|
52
45
|
} catch (error) {
|
|
53
46
|
throw new Error(`Error running the create API: ${error.message}`);
|
|
54
47
|
}
|