@alwaysmeticulous/client 2.69.0 → 2.70.0
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/api/apply-default-execution-options-from-project.d.ts +5 -0
- package/dist/api/apply-default-execution-options-from-project.js +42 -0
- package/dist/api/apply-default-execution-options-from-project.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReplayExecutionOptions } from "@alwaysmeticulous/sdk-bundles-api";
|
|
2
|
+
export declare const applyDefaultExecutionOptionsFromProject: ({ apiToken, executionOptions, }: {
|
|
3
|
+
apiToken: string | undefined | null;
|
|
4
|
+
executionOptions: ReplayExecutionOptions;
|
|
5
|
+
}) => Promise<ReplayExecutionOptions>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.applyDefaultExecutionOptionsFromProject = void 0;
|
|
7
|
+
const common_1 = require("@alwaysmeticulous/common");
|
|
8
|
+
const loglevel_1 = __importDefault(require("loglevel"));
|
|
9
|
+
const client_1 = require("../client");
|
|
10
|
+
const project_api_1 = require("./project.api");
|
|
11
|
+
const applyDefaultExecutionOptionsFromProject = async ({ apiToken, executionOptions, }) => {
|
|
12
|
+
const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
|
|
13
|
+
const client = (0, client_1.createClient)({ apiToken });
|
|
14
|
+
const project = await (0, project_api_1.getProject)(client);
|
|
15
|
+
if (!project) {
|
|
16
|
+
throw new Error(`Could not retrieve project data. Is the API token correct?`);
|
|
17
|
+
}
|
|
18
|
+
if (executionOptions.networkStubbingMode != null ||
|
|
19
|
+
project.settings.networkStubbingMode == null) {
|
|
20
|
+
return executionOptions;
|
|
21
|
+
}
|
|
22
|
+
if (project.settings.networkStubbingMode.type === "stub-non-ssr-requests") {
|
|
23
|
+
logger.info("");
|
|
24
|
+
logger.info("Stubbing all requests, except requests to render server components and requests for static assets");
|
|
25
|
+
logger.info("Visit your project settings page if you wish to change this");
|
|
26
|
+
logger.info("");
|
|
27
|
+
}
|
|
28
|
+
if (project.settings.networkStubbingMode.type === "custom-stubbing") {
|
|
29
|
+
logger.info("");
|
|
30
|
+
logger.info(`Stubbing all requests, except requests which match one of the following regexes: [${project.settings.networkStubbingMode.requestsToNotStub
|
|
31
|
+
.map((request) => `'${request.urlRegex}'`)
|
|
32
|
+
.join(", ")}]`);
|
|
33
|
+
logger.info("Visit your project settings page if you wish to change this");
|
|
34
|
+
logger.info("");
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
...executionOptions,
|
|
38
|
+
networkStubbingMode: project.settings.networkStubbingMode,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.applyDefaultExecutionOptionsFromProject = applyDefaultExecutionOptionsFromProject;
|
|
42
|
+
//# sourceMappingURL=apply-default-execution-options-from-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-default-execution-options-from-project.js","sourceRoot":"","sources":["../../src/api/apply-default-execution-options-from-project.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAkE;AAElE,wDAA2B;AAC3B,sCAAyC;AACzC,+CAA2C;AAEpC,MAAM,uCAAuC,GAAG,KAAK,EAAE,EAC5D,QAAQ,EACR,gBAAgB,GAIjB,EAAmC,EAAE;IACpC,MAAM,MAAM,GAAG,kBAAG,CAAC,SAAS,CAAC,+BAAsB,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,IAAA,wBAAU,EAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;KACH;IAED,IACE,gBAAgB,CAAC,mBAAmB,IAAI,IAAI;QAC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,IAAI,IAAI,EAC5C;QACA,OAAO,gBAAgB,CAAC;KACzB;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,KAAK,uBAAuB,EAAE;QACzE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CACT,mGAAmG,CACpG,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;QAC3E,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACjB;IACD,IAAI,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,KAAK,iBAAiB,EAAE;QACnE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CACT,qFAAqF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,iBAAiB;aACxI,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,QAAQ,GAAG,CAAC;aACzC,IAAI,CAAC,IAAI,CAAC,GAAG,CACjB,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;QAC3E,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACjB;IAED,OAAO;QACL,GAAG,gBAAgB;QACnB,mBAAmB,EAAE,OAAO,CAAC,QAAQ,CAAC,mBAAmB;KAC1D,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,uCAAuC,2CA8ClD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
export { applyDefaultExecutionOptionsFromProject } from "./api/apply-default-execution-options-from-project";
|
|
1
2
|
export { getProject } from "./api/project.api";
|
|
2
|
-
export { getRecordedSession, getRecordedSessionData, getRecordingCommandId, postSessionIdNotification, } from "./api/session.api";
|
|
3
|
-
export { getLatestTestRunResults, GetLatestTestRunOptions, } from "./api/test-run.api";
|
|
4
3
|
export { getReplay, getReplayDownloadUrl } from "./api/replay.api";
|
|
5
|
-
export {
|
|
4
|
+
export { getRecordedSession, getRecordedSessionData, getRecordingCommandId, postSessionIdNotification, } from "./api/session.api";
|
|
5
|
+
export { GetLatestTestRunOptions, getLatestTestRunResults, } from "./api/test-run.api";
|
|
6
|
+
export { ClientOptions, createClient } from "./client";
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createClient = exports.
|
|
3
|
+
exports.createClient = exports.getLatestTestRunResults = exports.postSessionIdNotification = exports.getRecordingCommandId = exports.getRecordedSessionData = exports.getRecordedSession = exports.getReplayDownloadUrl = exports.getReplay = exports.getProject = exports.applyDefaultExecutionOptionsFromProject = void 0;
|
|
4
|
+
var apply_default_execution_options_from_project_1 = require("./api/apply-default-execution-options-from-project");
|
|
5
|
+
Object.defineProperty(exports, "applyDefaultExecutionOptionsFromProject", { enumerable: true, get: function () { return apply_default_execution_options_from_project_1.applyDefaultExecutionOptionsFromProject; } });
|
|
4
6
|
var project_api_1 = require("./api/project.api");
|
|
5
7
|
Object.defineProperty(exports, "getProject", { enumerable: true, get: function () { return project_api_1.getProject; } });
|
|
8
|
+
var replay_api_1 = require("./api/replay.api");
|
|
9
|
+
Object.defineProperty(exports, "getReplay", { enumerable: true, get: function () { return replay_api_1.getReplay; } });
|
|
10
|
+
Object.defineProperty(exports, "getReplayDownloadUrl", { enumerable: true, get: function () { return replay_api_1.getReplayDownloadUrl; } });
|
|
6
11
|
var session_api_1 = require("./api/session.api");
|
|
7
12
|
Object.defineProperty(exports, "getRecordedSession", { enumerable: true, get: function () { return session_api_1.getRecordedSession; } });
|
|
8
13
|
Object.defineProperty(exports, "getRecordedSessionData", { enumerable: true, get: function () { return session_api_1.getRecordedSessionData; } });
|
|
@@ -10,9 +15,6 @@ Object.defineProperty(exports, "getRecordingCommandId", { enumerable: true, get:
|
|
|
10
15
|
Object.defineProperty(exports, "postSessionIdNotification", { enumerable: true, get: function () { return session_api_1.postSessionIdNotification; } });
|
|
11
16
|
var test_run_api_1 = require("./api/test-run.api");
|
|
12
17
|
Object.defineProperty(exports, "getLatestTestRunResults", { enumerable: true, get: function () { return test_run_api_1.getLatestTestRunResults; } });
|
|
13
|
-
var replay_api_1 = require("./api/replay.api");
|
|
14
|
-
Object.defineProperty(exports, "getReplay", { enumerable: true, get: function () { return replay_api_1.getReplay; } });
|
|
15
|
-
Object.defineProperty(exports, "getReplayDownloadUrl", { enumerable: true, get: function () { return replay_api_1.getReplayDownloadUrl; } });
|
|
16
18
|
var client_1 = require("./client");
|
|
17
19
|
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return client_1.createClient; } });
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,yGAAA,UAAU,OAAA;AACnB,iDAK2B;AAJzB,iHAAA,kBAAkB,OAAA;AAClB,qHAAA,sBAAsB,OAAA;AACtB,oHAAA,qBAAqB,OAAA;AACrB,wHAAA,yBAAyB,OAAA;AAE3B,mDAG4B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mHAA6G;AAApG,uKAAA,uCAAuC,OAAA;AAChD,iDAA+C;AAAtC,yGAAA,UAAU,OAAA;AACnB,+CAAmE;AAA1D,uGAAA,SAAS,OAAA;AAAE,kHAAA,oBAAoB,OAAA;AACxC,iDAK2B;AAJzB,iHAAA,kBAAkB,OAAA;AAClB,qHAAA,sBAAsB,OAAA;AACtB,oHAAA,qBAAqB,OAAA;AACrB,wHAAA,yBAAyB,OAAA;AAE3B,mDAG4B;AAD1B,uHAAA,uBAAuB,OAAA;AAEzB,mCAAuD;AAA/B,sGAAA,YAAY,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwaysmeticulous/client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.70.0",
|
|
4
4
|
"description": "Helper methods for using the Meticulous backend API",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"depcheck": "depcheck --ignore-patterns=dist"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@alwaysmeticulous/api": "^2.
|
|
23
|
-
"@alwaysmeticulous/common": "^2.
|
|
22
|
+
"@alwaysmeticulous/api": "^2.70.0",
|
|
23
|
+
"@alwaysmeticulous/common": "^2.70.0",
|
|
24
|
+
"@alwaysmeticulous/sdk-bundles-api": "^2.70.0",
|
|
24
25
|
"axios": "^1.2.6",
|
|
25
26
|
"axios-retry": "^3.5.0",
|
|
26
27
|
"loglevel": "^1.8.0"
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"bugs": {
|
|
43
44
|
"url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "f6b1b6f2e2f513d53c3cb427644bbb2afa928741"
|
|
46
47
|
}
|