@intuned/runtime-dev 0.1.0-test.23 → 0.1.0-test.24
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function tsNodeImport(
|
|
1
|
+
export declare function tsNodeImport(apiName: string): Promise<any>;
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.tsNodeImport = tsNodeImport;
|
|
7
7
|
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); }
|
|
8
8
|
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 && Object.prototype.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; }
|
|
9
|
-
async function tsNodeImport(
|
|
9
|
+
async function tsNodeImport(apiName) {
|
|
10
10
|
require("ts-node").register({
|
|
11
11
|
transpileOnly: true,
|
|
12
12
|
compilerOptions: {
|
|
13
13
|
lib: ["dom", "es2020"]
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
const imported = await (specifier => new Promise(r => r(
|
|
16
|
+
const imported = await (specifier => new Promise(r => r(specifier)).then(s => _interopRequireWildcard(require(s))))(`./${apiName}.ts`);
|
|
17
17
|
return imported;
|
|
18
18
|
}
|
|
@@ -250,7 +250,7 @@ async function checkAuthSessionWithRetries(page, context, importFunction, retrie
|
|
|
250
250
|
}
|
|
251
251
|
async function importUsingImportFunction(path, importFunction) {
|
|
252
252
|
try {
|
|
253
|
-
const imported = importFunction ? await importFunction(path) : await (specifier => new Promise(r => r(
|
|
253
|
+
const imported = importFunction ? await importFunction(path) : await (specifier => new Promise(r => r(specifier)).then(s => _interopRequireWildcard(require(s))))(`./${path}.ts`);
|
|
254
254
|
if (!imported || !imported.default || !imported.default.constructor) {
|
|
255
255
|
return (0, _neverthrow.err)(new _errors.InvalidApiError("API file path does not have a default export"));
|
|
256
256
|
}
|