@8ms/helpers 1.1.108 → 1.1.110
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/api/ApiResponse.js
CHANGED
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const post_1 = __importDefault(require("../../axios/post"));
|
|
7
7
|
global.deepcrawlApi = {
|
|
8
|
-
lastUpdated: null,
|
|
9
8
|
token: null,
|
|
9
|
+
updatedAt: null,
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* http://api-docs.deepcrawl.com/
|
|
@@ -26,7 +26,10 @@ const initClient = async ({ auth }) => {
|
|
|
26
26
|
url: `https://api.deepcrawl.com/sessions`,
|
|
27
27
|
});
|
|
28
28
|
// Ensure the value exists
|
|
29
|
-
const token = apiResponse.getBodyDefaultTo({
|
|
29
|
+
const token = apiResponse.getBodyDefaultTo({
|
|
30
|
+
defaultValue: null,
|
|
31
|
+
keys: ['token'],
|
|
32
|
+
});
|
|
30
33
|
if (token) {
|
|
31
34
|
global.deepcrawlApi.token = token;
|
|
32
35
|
}
|
|
@@ -4,10 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const post_1 = __importDefault(require("../../axios/post"));
|
|
7
|
-
const defaultTo_1 = __importDefault(require("../../util/defaultTo"));
|
|
8
7
|
global.deepcrawlGraphql = {
|
|
9
|
-
lastUpdated: null,
|
|
10
8
|
token: null,
|
|
9
|
+
updatedAt: null,
|
|
11
10
|
};
|
|
12
11
|
/**
|
|
13
12
|
* https://graph-docs.deepcrawl.com/graphql/explorer/
|
|
@@ -26,10 +25,9 @@ const initClient = async ({ auth }) => {
|
|
|
26
25
|
},
|
|
27
26
|
url: `https://graph.deepcrawl.com/`,
|
|
28
27
|
});
|
|
29
|
-
const token =
|
|
28
|
+
const token = apiResponse.getBodyDefaultTo({
|
|
30
29
|
defaultValue: null,
|
|
31
|
-
|
|
32
|
-
keys: ['data', 'data', 'createSessionUsingUserKey', 'token'],
|
|
30
|
+
keys: ['data', 'createSessionUsingUserKey', 'token'],
|
|
33
31
|
});
|
|
34
32
|
// Ensure the value exists
|
|
35
33
|
if (token) {
|