@newskit-render/api 1.6.6-alpha.0 → 1.6.7-alpha.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/cjs/apolloClient/createApolloClient.d.ts +2 -2
- package/dist/cjs/apolloClient/createApolloClient.js +30 -74
- package/dist/cjs/apolloClient/createApolloClient.js.map +1 -1
- package/dist/cjs/helpers/externalLinks/index.js +1 -1
- package/dist/cjs/helpers/externalLinks/index.js.map +1 -1
- package/dist/esm/apolloClient/createApolloClient.d.ts +2 -2
- package/dist/esm/apolloClient/createApolloClient.js +30 -74
- package/dist/esm/apolloClient/createApolloClient.js.map +1 -1
- package/dist/esm/helpers/externalLinks/index.js +1 -1
- package/dist/esm/helpers/externalLinks/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const createApolloClient: (client: Client, cookie?: string, token?: string, accountProviderCookieName?: string, config?: Config) => Promise<ApolloHttpClient>;
|
|
1
|
+
import { Client, Config } from './types';
|
|
2
|
+
export declare const createApolloClient: (client: Client, cookie?: string, token?: string, accountProviderCookieName?: string, config?: Config) => Promise<import("./types").ApolloHttpClient>;
|
|
@@ -1,84 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.createApolloClient = void 0;
|
|
40
4
|
var createClient_1 = require("./createClient");
|
|
41
5
|
var helpers_1 = require("../helpers");
|
|
42
6
|
var types_1 = require("./types");
|
|
43
7
|
var config_1 = require("../config");
|
|
44
|
-
var createApolloClient = function (client, cookie, token, accountProviderCookieName, config) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!(client === types_1.ClientTypes.main)) return [3 /*break*/, 2];
|
|
50
|
-
return [4 /*yield*/, (0, helpers_1.getAcsCookie)(types_1.ClientTypes.main, cookie)];
|
|
51
|
-
case 1:
|
|
52
|
-
headers = _a.sent();
|
|
53
|
-
if (!headers && config_1.acsSessionUrl) {
|
|
54
|
-
headers = { Cookie: "".concat(accountProviderCookieName, "=").concat(token) };
|
|
55
|
-
}
|
|
56
|
-
return [2 /*return*/, (0, createClient_1.createClient)({
|
|
57
|
-
uri: config_1.accountProviderGraphqlUrl || config_1.mainGraphqlUrl,
|
|
58
|
-
links: [helpers_1.retryLink, helpers_1.errorLink],
|
|
59
|
-
headers: headers,
|
|
60
|
-
})];
|
|
61
|
-
case 2:
|
|
62
|
-
if (client === types_1.ClientTypes.nkapi) {
|
|
63
|
-
apiXApiKey = config ? config.newskitApiXApiKey : config_1.newskitApiXApiKey;
|
|
64
|
-
apiEnvUrl = config ? config.newskitApiEnvUrl : config_1.newskitApiEnvUrl;
|
|
65
|
-
return [2 /*return*/, (0, createClient_1.createClient)({
|
|
66
|
-
uri: apiEnvUrl,
|
|
67
|
-
headers: cookie
|
|
68
|
-
? {
|
|
69
|
-
'X-API-KEY': apiXApiKey,
|
|
70
|
-
'newsuk-acs-cookie': (0, helpers_1.getAcsCookie)(types_1.ClientTypes.nkapi, cookie),
|
|
71
|
-
'platform-type': 'desktop',
|
|
72
|
-
}
|
|
73
|
-
: {
|
|
74
|
-
'X-API-KEY': apiXApiKey,
|
|
75
|
-
'platform-type': 'desktop',
|
|
76
|
-
},
|
|
77
|
-
})];
|
|
78
|
-
}
|
|
79
|
-
return [2 /*return*/, (0, createClient_1.createClient)(client)];
|
|
8
|
+
var createApolloClient = function (client, cookie, token, accountProviderCookieName, config) {
|
|
9
|
+
if (client === types_1.ClientTypes.main) {
|
|
10
|
+
var headers = (0, helpers_1.getAcsCookie)(types_1.ClientTypes.main, cookie);
|
|
11
|
+
if (!headers && config_1.acsSessionUrl) {
|
|
12
|
+
headers = { Cookie: "".concat(accountProviderCookieName, "=").concat(token) };
|
|
80
13
|
}
|
|
81
|
-
|
|
82
|
-
|
|
14
|
+
return (0, createClient_1.createClient)({
|
|
15
|
+
uri: config_1.accountProviderGraphqlUrl || config_1.mainGraphqlUrl,
|
|
16
|
+
links: [helpers_1.retryLink, helpers_1.errorLink],
|
|
17
|
+
headers: headers,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (client === types_1.ClientTypes.nkapi) {
|
|
21
|
+
var apiXApiKey = config ? config.newskitApiXApiKey : config_1.newskitApiXApiKey;
|
|
22
|
+
var apiEnvUrl = config ? config.newskitApiEnvUrl : config_1.newskitApiEnvUrl;
|
|
23
|
+
return (0, createClient_1.createClient)({
|
|
24
|
+
uri: apiEnvUrl,
|
|
25
|
+
headers: cookie
|
|
26
|
+
? {
|
|
27
|
+
'X-API-KEY': apiXApiKey,
|
|
28
|
+
'newsuk-acs-cookie': (0, helpers_1.getAcsCookie)(types_1.ClientTypes.nkapi, cookie),
|
|
29
|
+
'platform-type': 'desktop',
|
|
30
|
+
}
|
|
31
|
+
: {
|
|
32
|
+
'X-API-KEY': apiXApiKey,
|
|
33
|
+
'platform-type': 'desktop',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return (0, createClient_1.createClient)(client);
|
|
38
|
+
};
|
|
83
39
|
exports.createApolloClient = createApolloClient;
|
|
84
40
|
//# sourceMappingURL=createApolloClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApolloClient.js","sourceRoot":"","sources":["../../../src/apolloClient/createApolloClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createApolloClient.js","sourceRoot":"","sources":["../../../src/apolloClient/createApolloClient.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAC7C,sCAA+D;AAE/D,iCAAqD;AACrD,oCAMkB;AACX,IAAM,kBAAkB,GAAG,UAChC,MAAc,EACd,MAAe,EACf,KAAc,EACd,yBAAkC,EAClC,MAAe;IAEf,IAAI,MAAM,KAAK,mBAAW,CAAC,IAAI,EAAE;QAC/B,IAAI,OAAO,GAAG,IAAA,sBAAY,EAAC,mBAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAEpD,IAAI,CAAC,OAAO,IAAI,sBAAa,EAAE;YAC7B,OAAO,GAAG,EAAE,MAAM,EAAE,UAAG,yBAAyB,cAAI,KAAK,CAAE,EAAE,CAAA;SAC9D;QAED,OAAO,IAAA,2BAAY,EAAC;YAClB,GAAG,EAAE,kCAAyB,IAAI,uBAAc;YAChD,KAAK,EAAE,CAAC,mBAAS,EAAE,mBAAS,CAAC;YAC7B,OAAO,SAAA;SACR,CAAC,CAAA;KACH;IACD,IAAI,MAAM,KAAK,mBAAW,CAAC,KAAK,EAAE;QAChC,IAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,0BAAiB,CAAA;QACxE,IAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,yBAAgB,CAAA;QAErE,OAAO,IAAA,2BAAY,EAAC;YAClB,GAAG,EAAE,SAAS;YACd,OAAO,EAAE,MAAM;gBACb,CAAC,CAAC;oBACE,WAAW,EAAE,UAAU;oBACvB,mBAAmB,EAAE,IAAA,sBAAY,EAAC,mBAAW,CAAC,KAAK,EAAE,MAAM,CAAC;oBAC5D,eAAe,EAAE,SAAS;iBAC3B;gBACH,CAAC,CAAC;oBACE,WAAW,EAAE,UAAU;oBACvB,eAAe,EAAE,SAAS;iBAC3B;SACN,CAAC,CAAA;KACH;IACD,OAAO,IAAA,2BAAY,EAAC,MAAM,CAAC,CAAA;AAC7B,CAAC,CAAA;AAvCY,QAAA,kBAAkB,sBAuC9B"}
|
|
@@ -18,7 +18,7 @@ exports.retryLink = new retry_1.RetryLink({
|
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
exports.errorLink = (0, error_1.onError)(function (_a) {
|
|
21
|
-
var
|
|
21
|
+
var operation = _a.operation, forward = _a.forward, graphQLErrors = _a.graphQLErrors;
|
|
22
22
|
if (graphQLErrors) {
|
|
23
23
|
console.error(graphQLErrors);
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/helpers/externalLinks/index.ts"],"names":[],"mappings":";;;AAAA,mDAAqD;AACrD,mDAAmD;AACnD,yCAAuD;AACvD,+DAA6D;AAC7D,uCAA4C;AAC5C,2DAA2D;AAC9C,QAAA,SAAS,GAAG,IAAI,iBAAS,CAAC;IACrC,KAAK,EAAE;QACL,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,IAAI;QACT,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,CAAC;KACP;CACF,CAAC,CAAA;AAEW,QAAA,SAAS,GAAe,IAAA,eAAO,EAC1C,UAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/helpers/externalLinks/index.ts"],"names":[],"mappings":";;;AAAA,mDAAqD;AACrD,mDAAmD;AACnD,yCAAuD;AACvD,+DAA6D;AAC7D,uCAA4C;AAC5C,2DAA2D;AAC9C,QAAA,SAAS,GAAG,IAAI,iBAAS,CAAC;IACrC,KAAK,EAAE;QACL,OAAO,EAAE,GAAG;QACZ,GAAG,EAAE,IAAI;QACT,MAAM,EAAE,IAAI;KACb;IAC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R,CAAC,CACF,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const createApolloClient: (client: Client, cookie?: string, token?: string, accountProviderCookieName?: string, config?: Config) => Promise<ApolloHttpClient>;
|
|
1
|
+
import { Client, Config } from './types';
|
|
2
|
+
export declare const createApolloClient: (client: Client, cookie?: string, token?: string, accountProviderCookieName?: string, config?: Config) => Promise<import("./types").ApolloHttpClient>;
|
|
@@ -1,80 +1,36 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
1
|
import { createClient } from './createClient';
|
|
38
2
|
import { getAcsCookie, retryLink, errorLink } from '../helpers';
|
|
39
3
|
import { ClientTypes } from './types';
|
|
40
4
|
import { acsSessionUrl, mainGraphqlUrl, accountProviderGraphqlUrl, newskitApiEnvUrl, newskitApiXApiKey, } from '../config';
|
|
41
|
-
export var createApolloClient = function (client, cookie, token, accountProviderCookieName, config) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (!(client === ClientTypes.main)) return [3 /*break*/, 2];
|
|
47
|
-
return [4 /*yield*/, getAcsCookie(ClientTypes.main, cookie)];
|
|
48
|
-
case 1:
|
|
49
|
-
headers = _a.sent();
|
|
50
|
-
if (!headers && acsSessionUrl) {
|
|
51
|
-
headers = { Cookie: "".concat(accountProviderCookieName, "=").concat(token) };
|
|
52
|
-
}
|
|
53
|
-
return [2 /*return*/, createClient({
|
|
54
|
-
uri: accountProviderGraphqlUrl || mainGraphqlUrl,
|
|
55
|
-
links: [retryLink, errorLink],
|
|
56
|
-
headers: headers,
|
|
57
|
-
})];
|
|
58
|
-
case 2:
|
|
59
|
-
if (client === ClientTypes.nkapi) {
|
|
60
|
-
apiXApiKey = config ? config.newskitApiXApiKey : newskitApiXApiKey;
|
|
61
|
-
apiEnvUrl = config ? config.newskitApiEnvUrl : newskitApiEnvUrl;
|
|
62
|
-
return [2 /*return*/, createClient({
|
|
63
|
-
uri: apiEnvUrl,
|
|
64
|
-
headers: cookie
|
|
65
|
-
? {
|
|
66
|
-
'X-API-KEY': apiXApiKey,
|
|
67
|
-
'newsuk-acs-cookie': getAcsCookie(ClientTypes.nkapi, cookie),
|
|
68
|
-
'platform-type': 'desktop',
|
|
69
|
-
}
|
|
70
|
-
: {
|
|
71
|
-
'X-API-KEY': apiXApiKey,
|
|
72
|
-
'platform-type': 'desktop',
|
|
73
|
-
},
|
|
74
|
-
})];
|
|
75
|
-
}
|
|
76
|
-
return [2 /*return*/, createClient(client)];
|
|
5
|
+
export var createApolloClient = function (client, cookie, token, accountProviderCookieName, config) {
|
|
6
|
+
if (client === ClientTypes.main) {
|
|
7
|
+
var headers = getAcsCookie(ClientTypes.main, cookie);
|
|
8
|
+
if (!headers && acsSessionUrl) {
|
|
9
|
+
headers = { Cookie: "".concat(accountProviderCookieName, "=").concat(token) };
|
|
77
10
|
}
|
|
78
|
-
|
|
79
|
-
|
|
11
|
+
return createClient({
|
|
12
|
+
uri: accountProviderGraphqlUrl || mainGraphqlUrl,
|
|
13
|
+
links: [retryLink, errorLink],
|
|
14
|
+
headers: headers,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (client === ClientTypes.nkapi) {
|
|
18
|
+
var apiXApiKey = config ? config.newskitApiXApiKey : newskitApiXApiKey;
|
|
19
|
+
var apiEnvUrl = config ? config.newskitApiEnvUrl : newskitApiEnvUrl;
|
|
20
|
+
return createClient({
|
|
21
|
+
uri: apiEnvUrl,
|
|
22
|
+
headers: cookie
|
|
23
|
+
? {
|
|
24
|
+
'X-API-KEY': apiXApiKey,
|
|
25
|
+
'newsuk-acs-cookie': getAcsCookie(ClientTypes.nkapi, cookie),
|
|
26
|
+
'platform-type': 'desktop',
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
'X-API-KEY': apiXApiKey,
|
|
30
|
+
'platform-type': 'desktop',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return createClient(client);
|
|
35
|
+
};
|
|
80
36
|
//# sourceMappingURL=createApolloClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApolloClient.js","sourceRoot":"","sources":["../../../src/apolloClient/createApolloClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createApolloClient.js","sourceRoot":"","sources":["../../../src/apolloClient/createApolloClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE/D,OAAO,EAAU,WAAW,EAAU,MAAM,SAAS,CAAA;AACrD,OAAO,EACL,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAA;AAClB,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAChC,MAAc,EACd,MAAe,EACf,KAAc,EACd,yBAAkC,EAClC,MAAe;IAEf,IAAI,MAAM,KAAK,WAAW,CAAC,IAAI,EAAE;QAC/B,IAAI,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAEpD,IAAI,CAAC,OAAO,IAAI,aAAa,EAAE;YAC7B,OAAO,GAAG,EAAE,MAAM,EAAE,UAAG,yBAAyB,cAAI,KAAK,CAAE,EAAE,CAAA;SAC9D;QAED,OAAO,YAAY,CAAC;YAClB,GAAG,EAAE,yBAAyB,IAAI,cAAc;YAChD,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;YAC7B,OAAO,SAAA;SACR,CAAC,CAAA;KACH;IACD,IAAI,MAAM,KAAK,WAAW,CAAC,KAAK,EAAE;QAChC,IAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAA;QACxE,IAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAA;QAErE,OAAO,YAAY,CAAC;YAClB,GAAG,EAAE,SAAS;YACd,OAAO,EAAE,MAAM;gBACb,CAAC,CAAC;oBACE,WAAW,EAAE,UAAU;oBACvB,mBAAmB,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;oBAC5D,eAAe,EAAE,SAAS;iBAC3B;gBACH,CAAC,CAAC;oBACE,WAAW,EAAE,UAAU;oBACvB,eAAe,EAAE,SAAS;iBAC3B;SACN,CAAC,CAAA;KACH;IACD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;AAC7B,CAAC,CAAA"}
|
|
@@ -15,7 +15,7 @@ export var retryLink = new RetryLink({
|
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
export var errorLink = onError(function (_a) {
|
|
18
|
-
var
|
|
18
|
+
var operation = _a.operation, forward = _a.forward, graphQLErrors = _a.graphQLErrors;
|
|
19
19
|
if (graphQLErrors) {
|
|
20
20
|
console.error(graphQLErrors);
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/helpers/externalLinks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,O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