@agility/content-fetch 2.0.0-rc18 → 2.0.0-rc20

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.
Files changed (34) hide show
  1. package/dist/agility-content-fetch.node.js +11377 -0
  2. package/dist/api-client.d.ts +2 -6
  3. package/dist/browser.js +17 -1537
  4. package/dist/node.js +29 -12532
  5. package/dist/types/Client.d.ts +8 -1
  6. package/package.json +3 -5
  7. package/.nyc_output/713b1ec2-05ec-4b67-8061-b6cad0a45ad5.json +0 -1
  8. package/coverage/base.css +0 -223
  9. package/coverage/block-navigation.js +0 -79
  10. package/coverage/index.html +0 -123
  11. package/coverage/prettify.css +0 -1
  12. package/coverage/prettify.js +0 -2
  13. package/coverage/sort-arrow-sprite.png +0 -0
  14. package/coverage/sorter.js +0 -170
  15. package/coverage/src/api-client.js.html +0 -549
  16. package/coverage/src/content-fetch.js.html +0 -336
  17. package/coverage/src/index.html +0 -123
  18. package/coverage/src/methods/getContentItem.js.html +0 -285
  19. package/coverage/src/methods/getContentList.js.html +0 -486
  20. package/coverage/src/methods/getGallery.js.html +0 -243
  21. package/coverage/src/methods/getPage.js.html +0 -273
  22. package/coverage/src/methods/getSitemapFlat.js.html +0 -240
  23. package/coverage/src/methods/getSitemapNested.js.html +0 -231
  24. package/coverage/src/methods/getSyncContent.js.html +0 -258
  25. package/coverage/src/methods/getSyncPages.js.html +0 -258
  26. package/coverage/src/methods/getUrlRedirections.js.html +0 -339
  27. package/coverage/src/methods/index.html +0 -201
  28. package/coverage/src/methods/syncContentItems.js.html +0 -186
  29. package/coverage/src/methods/syncPageItems.js.html +0 -186
  30. package/coverage/src/types/FilterLogicOperator.js.html +0 -129
  31. package/coverage/src/types/FilterOperator.js.html +0 -156
  32. package/coverage/src/types/SortDirection.js.html +0 -129
  33. package/coverage/src/types/index.html +0 -123
  34. package/coverage/src/utils.js.html +0 -330
package/dist/browser.js CHANGED
@@ -1,1538 +1,9 @@
1
1
  (() => {
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
3
  var __export = (target, all) => {
12
4
  for (var name in all)
13
5
  __defProp(target, name, { get: all[name], enumerable: true });
14
6
  };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
-
32
- // node_modules/axios/lib/helpers/bind.js
33
- var require_bind = __commonJS({
34
- "node_modules/axios/lib/helpers/bind.js"(exports, module2) {
35
- "use strict";
36
- module2.exports = function bind(fn, thisArg) {
37
- return function wrap() {
38
- var args = new Array(arguments.length);
39
- for (var i = 0; i < args.length; i++) {
40
- args[i] = arguments[i];
41
- }
42
- return fn.apply(thisArg, args);
43
- };
44
- };
45
- }
46
- });
47
-
48
- // node_modules/axios/lib/utils.js
49
- var require_utils = __commonJS({
50
- "node_modules/axios/lib/utils.js"(exports, module2) {
51
- "use strict";
52
- var bind = require_bind();
53
- var toString = Object.prototype.toString;
54
- var kindOf = function(cache) {
55
- return function(thing) {
56
- var str = toString.call(thing);
57
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
58
- };
59
- }(/* @__PURE__ */ Object.create(null));
60
- function kindOfTest(type) {
61
- type = type.toLowerCase();
62
- return function isKindOf(thing) {
63
- return kindOf(thing) === type;
64
- };
65
- }
66
- function isArray(val) {
67
- return Array.isArray(val);
68
- }
69
- function isUndefined(val) {
70
- return typeof val === "undefined";
71
- }
72
- function isBuffer(val) {
73
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
74
- }
75
- var isArrayBuffer = kindOfTest("ArrayBuffer");
76
- function isArrayBufferView(val) {
77
- var result;
78
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
79
- result = ArrayBuffer.isView(val);
80
- } else {
81
- result = val && val.buffer && isArrayBuffer(val.buffer);
82
- }
83
- return result;
84
- }
85
- function isString(val) {
86
- return typeof val === "string";
87
- }
88
- function isNumber(val) {
89
- return typeof val === "number";
90
- }
91
- function isObject(val) {
92
- return val !== null && typeof val === "object";
93
- }
94
- function isPlainObject(val) {
95
- if (kindOf(val) !== "object") {
96
- return false;
97
- }
98
- var prototype = Object.getPrototypeOf(val);
99
- return prototype === null || prototype === Object.prototype;
100
- }
101
- var isDate = kindOfTest("Date");
102
- var isFile = kindOfTest("File");
103
- var isBlob = kindOfTest("Blob");
104
- var isFileList = kindOfTest("FileList");
105
- function isFunction(val) {
106
- return toString.call(val) === "[object Function]";
107
- }
108
- function isStream(val) {
109
- return isObject(val) && isFunction(val.pipe);
110
- }
111
- function isFormData(thing) {
112
- var pattern = "[object FormData]";
113
- return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
114
- }
115
- var isURLSearchParams = kindOfTest("URLSearchParams");
116
- function trim(str) {
117
- return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
118
- }
119
- function isStandardBrowserEnv() {
120
- if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
121
- return false;
122
- }
123
- return typeof window !== "undefined" && typeof document !== "undefined";
124
- }
125
- function forEach(obj, fn) {
126
- if (obj === null || typeof obj === "undefined") {
127
- return;
128
- }
129
- if (typeof obj !== "object") {
130
- obj = [obj];
131
- }
132
- if (isArray(obj)) {
133
- for (var i = 0, l = obj.length; i < l; i++) {
134
- fn.call(null, obj[i], i, obj);
135
- }
136
- } else {
137
- for (var key in obj) {
138
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
139
- fn.call(null, obj[key], key, obj);
140
- }
141
- }
142
- }
143
- }
144
- function merge() {
145
- var result = {};
146
- function assignValue(val, key) {
147
- if (isPlainObject(result[key]) && isPlainObject(val)) {
148
- result[key] = merge(result[key], val);
149
- } else if (isPlainObject(val)) {
150
- result[key] = merge({}, val);
151
- } else if (isArray(val)) {
152
- result[key] = val.slice();
153
- } else {
154
- result[key] = val;
155
- }
156
- }
157
- for (var i = 0, l = arguments.length; i < l; i++) {
158
- forEach(arguments[i], assignValue);
159
- }
160
- return result;
161
- }
162
- function extend(a, b, thisArg) {
163
- forEach(b, function assignValue(val, key) {
164
- if (thisArg && typeof val === "function") {
165
- a[key] = bind(val, thisArg);
166
- } else {
167
- a[key] = val;
168
- }
169
- });
170
- return a;
171
- }
172
- function stripBOM(content) {
173
- if (content.charCodeAt(0) === 65279) {
174
- content = content.slice(1);
175
- }
176
- return content;
177
- }
178
- function inherits(constructor, superConstructor, props, descriptors) {
179
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
180
- constructor.prototype.constructor = constructor;
181
- props && Object.assign(constructor.prototype, props);
182
- }
183
- function toFlatObject(sourceObj, destObj, filter) {
184
- var props;
185
- var i;
186
- var prop;
187
- var merged = {};
188
- destObj = destObj || {};
189
- do {
190
- props = Object.getOwnPropertyNames(sourceObj);
191
- i = props.length;
192
- while (i-- > 0) {
193
- prop = props[i];
194
- if (!merged[prop]) {
195
- destObj[prop] = sourceObj[prop];
196
- merged[prop] = true;
197
- }
198
- }
199
- sourceObj = Object.getPrototypeOf(sourceObj);
200
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
201
- return destObj;
202
- }
203
- function endsWith(str, searchString, position) {
204
- str = String(str);
205
- if (position === void 0 || position > str.length) {
206
- position = str.length;
207
- }
208
- position -= searchString.length;
209
- var lastIndex = str.indexOf(searchString, position);
210
- return lastIndex !== -1 && lastIndex === position;
211
- }
212
- function toArray(thing) {
213
- if (!thing)
214
- return null;
215
- var i = thing.length;
216
- if (isUndefined(i))
217
- return null;
218
- var arr = new Array(i);
219
- while (i-- > 0) {
220
- arr[i] = thing[i];
221
- }
222
- return arr;
223
- }
224
- var isTypedArray = function(TypedArray) {
225
- return function(thing) {
226
- return TypedArray && thing instanceof TypedArray;
227
- };
228
- }(typeof Uint8Array !== "undefined" && Object.getPrototypeOf(Uint8Array));
229
- module2.exports = {
230
- isArray,
231
- isArrayBuffer,
232
- isBuffer,
233
- isFormData,
234
- isArrayBufferView,
235
- isString,
236
- isNumber,
237
- isObject,
238
- isPlainObject,
239
- isUndefined,
240
- isDate,
241
- isFile,
242
- isBlob,
243
- isFunction,
244
- isStream,
245
- isURLSearchParams,
246
- isStandardBrowserEnv,
247
- forEach,
248
- merge,
249
- extend,
250
- trim,
251
- stripBOM,
252
- inherits,
253
- toFlatObject,
254
- kindOf,
255
- kindOfTest,
256
- endsWith,
257
- toArray,
258
- isTypedArray,
259
- isFileList
260
- };
261
- }
262
- });
263
-
264
- // node_modules/axios/lib/helpers/buildURL.js
265
- var require_buildURL = __commonJS({
266
- "node_modules/axios/lib/helpers/buildURL.js"(exports, module2) {
267
- "use strict";
268
- var utils = require_utils();
269
- function encode(val) {
270
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
271
- }
272
- module2.exports = function buildURL(url, params, paramsSerializer) {
273
- if (!params) {
274
- return url;
275
- }
276
- var serializedParams;
277
- if (paramsSerializer) {
278
- serializedParams = paramsSerializer(params);
279
- } else if (utils.isURLSearchParams(params)) {
280
- serializedParams = params.toString();
281
- } else {
282
- var parts = [];
283
- utils.forEach(params, function serialize(val, key) {
284
- if (val === null || typeof val === "undefined") {
285
- return;
286
- }
287
- if (utils.isArray(val)) {
288
- key = key + "[]";
289
- } else {
290
- val = [val];
291
- }
292
- utils.forEach(val, function parseValue(v) {
293
- if (utils.isDate(v)) {
294
- v = v.toISOString();
295
- } else if (utils.isObject(v)) {
296
- v = JSON.stringify(v);
297
- }
298
- parts.push(encode(key) + "=" + encode(v));
299
- });
300
- });
301
- serializedParams = parts.join("&");
302
- }
303
- if (serializedParams) {
304
- var hashmarkIndex = url.indexOf("#");
305
- if (hashmarkIndex !== -1) {
306
- url = url.slice(0, hashmarkIndex);
307
- }
308
- url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
309
- }
310
- return url;
311
- };
312
- }
313
- });
314
-
315
- // node_modules/axios/lib/core/InterceptorManager.js
316
- var require_InterceptorManager = __commonJS({
317
- "node_modules/axios/lib/core/InterceptorManager.js"(exports, module2) {
318
- "use strict";
319
- var utils = require_utils();
320
- function InterceptorManager() {
321
- this.handlers = [];
322
- }
323
- InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
324
- this.handlers.push({
325
- fulfilled,
326
- rejected,
327
- synchronous: options ? options.synchronous : false,
328
- runWhen: options ? options.runWhen : null
329
- });
330
- return this.handlers.length - 1;
331
- };
332
- InterceptorManager.prototype.eject = function eject(id) {
333
- if (this.handlers[id]) {
334
- this.handlers[id] = null;
335
- }
336
- };
337
- InterceptorManager.prototype.forEach = function forEach(fn) {
338
- utils.forEach(this.handlers, function forEachHandler(h) {
339
- if (h !== null) {
340
- fn(h);
341
- }
342
- });
343
- };
344
- module2.exports = InterceptorManager;
345
- }
346
- });
347
-
348
- // node_modules/axios/lib/helpers/normalizeHeaderName.js
349
- var require_normalizeHeaderName = __commonJS({
350
- "node_modules/axios/lib/helpers/normalizeHeaderName.js"(exports, module2) {
351
- "use strict";
352
- var utils = require_utils();
353
- module2.exports = function normalizeHeaderName(headers, normalizedName) {
354
- utils.forEach(headers, function processHeader(value, name) {
355
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
356
- headers[normalizedName] = value;
357
- delete headers[name];
358
- }
359
- });
360
- };
361
- }
362
- });
363
-
364
- // node_modules/axios/lib/core/AxiosError.js
365
- var require_AxiosError = __commonJS({
366
- "node_modules/axios/lib/core/AxiosError.js"(exports, module2) {
367
- "use strict";
368
- var utils = require_utils();
369
- function AxiosError(message, code, config, request, response) {
370
- Error.call(this);
371
- this.message = message;
372
- this.name = "AxiosError";
373
- code && (this.code = code);
374
- config && (this.config = config);
375
- request && (this.request = request);
376
- response && (this.response = response);
377
- }
378
- utils.inherits(AxiosError, Error, {
379
- toJSON: function toJSON() {
380
- return {
381
- // Standard
382
- message: this.message,
383
- name: this.name,
384
- // Microsoft
385
- description: this.description,
386
- number: this.number,
387
- // Mozilla
388
- fileName: this.fileName,
389
- lineNumber: this.lineNumber,
390
- columnNumber: this.columnNumber,
391
- stack: this.stack,
392
- // Axios
393
- config: this.config,
394
- code: this.code,
395
- status: this.response && this.response.status ? this.response.status : null
396
- };
397
- }
398
- });
399
- var prototype = AxiosError.prototype;
400
- var descriptors = {};
401
- [
402
- "ERR_BAD_OPTION_VALUE",
403
- "ERR_BAD_OPTION",
404
- "ECONNABORTED",
405
- "ETIMEDOUT",
406
- "ERR_NETWORK",
407
- "ERR_FR_TOO_MANY_REDIRECTS",
408
- "ERR_DEPRECATED",
409
- "ERR_BAD_RESPONSE",
410
- "ERR_BAD_REQUEST",
411
- "ERR_CANCELED"
412
- // eslint-disable-next-line func-names
413
- ].forEach(function(code) {
414
- descriptors[code] = { value: code };
415
- });
416
- Object.defineProperties(AxiosError, descriptors);
417
- Object.defineProperty(prototype, "isAxiosError", { value: true });
418
- AxiosError.from = function(error, code, config, request, response, customProps) {
419
- var axiosError = Object.create(prototype);
420
- utils.toFlatObject(error, axiosError, function filter(obj) {
421
- return obj !== Error.prototype;
422
- });
423
- AxiosError.call(axiosError, error.message, code, config, request, response);
424
- axiosError.name = error.name;
425
- customProps && Object.assign(axiosError, customProps);
426
- return axiosError;
427
- };
428
- module2.exports = AxiosError;
429
- }
430
- });
431
-
432
- // node_modules/axios/lib/defaults/transitional.js
433
- var require_transitional = __commonJS({
434
- "node_modules/axios/lib/defaults/transitional.js"(exports, module2) {
435
- "use strict";
436
- module2.exports = {
437
- silentJSONParsing: true,
438
- forcedJSONParsing: true,
439
- clarifyTimeoutError: false
440
- };
441
- }
442
- });
443
-
444
- // node_modules/axios/lib/helpers/toFormData.js
445
- var require_toFormData = __commonJS({
446
- "node_modules/axios/lib/helpers/toFormData.js"(exports, module2) {
447
- "use strict";
448
- var utils = require_utils();
449
- function toFormData(obj, formData) {
450
- formData = formData || new FormData();
451
- var stack = [];
452
- function convertValue(value) {
453
- if (value === null)
454
- return "";
455
- if (utils.isDate(value)) {
456
- return value.toISOString();
457
- }
458
- if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
459
- return typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
460
- }
461
- return value;
462
- }
463
- function build(data, parentKey) {
464
- if (utils.isPlainObject(data) || utils.isArray(data)) {
465
- if (stack.indexOf(data) !== -1) {
466
- throw Error("Circular reference detected in " + parentKey);
467
- }
468
- stack.push(data);
469
- utils.forEach(data, function each(value, key) {
470
- if (utils.isUndefined(value))
471
- return;
472
- var fullKey = parentKey ? parentKey + "." + key : key;
473
- var arr;
474
- if (value && !parentKey && typeof value === "object") {
475
- if (utils.endsWith(key, "{}")) {
476
- value = JSON.stringify(value);
477
- } else if (utils.endsWith(key, "[]") && (arr = utils.toArray(value))) {
478
- arr.forEach(function(el) {
479
- !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
480
- });
481
- return;
482
- }
483
- }
484
- build(value, fullKey);
485
- });
486
- stack.pop();
487
- } else {
488
- formData.append(parentKey, convertValue(data));
489
- }
490
- }
491
- build(obj);
492
- return formData;
493
- }
494
- module2.exports = toFormData;
495
- }
496
- });
497
-
498
- // node_modules/axios/lib/core/settle.js
499
- var require_settle = __commonJS({
500
- "node_modules/axios/lib/core/settle.js"(exports, module2) {
501
- "use strict";
502
- var AxiosError = require_AxiosError();
503
- module2.exports = function settle(resolve, reject, response) {
504
- var validateStatus = response.config.validateStatus;
505
- if (!response.status || !validateStatus || validateStatus(response.status)) {
506
- resolve(response);
507
- } else {
508
- reject(new AxiosError(
509
- "Request failed with status code " + response.status,
510
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
511
- response.config,
512
- response.request,
513
- response
514
- ));
515
- }
516
- };
517
- }
518
- });
519
-
520
- // node_modules/axios/lib/helpers/cookies.js
521
- var require_cookies = __commonJS({
522
- "node_modules/axios/lib/helpers/cookies.js"(exports, module2) {
523
- "use strict";
524
- var utils = require_utils();
525
- module2.exports = utils.isStandardBrowserEnv() ? (
526
- // Standard browser envs support document.cookie
527
- function standardBrowserEnv() {
528
- return {
529
- write: function write(name, value, expires, path, domain, secure) {
530
- var cookie = [];
531
- cookie.push(name + "=" + encodeURIComponent(value));
532
- if (utils.isNumber(expires)) {
533
- cookie.push("expires=" + new Date(expires).toGMTString());
534
- }
535
- if (utils.isString(path)) {
536
- cookie.push("path=" + path);
537
- }
538
- if (utils.isString(domain)) {
539
- cookie.push("domain=" + domain);
540
- }
541
- if (secure === true) {
542
- cookie.push("secure");
543
- }
544
- document.cookie = cookie.join("; ");
545
- },
546
- read: function read(name) {
547
- var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
548
- return match ? decodeURIComponent(match[3]) : null;
549
- },
550
- remove: function remove(name) {
551
- this.write(name, "", Date.now() - 864e5);
552
- }
553
- };
554
- }()
555
- ) : (
556
- // Non standard browser env (web workers, react-native) lack needed support.
557
- function nonStandardBrowserEnv() {
558
- return {
559
- write: function write() {
560
- },
561
- read: function read() {
562
- return null;
563
- },
564
- remove: function remove() {
565
- }
566
- };
567
- }()
568
- );
569
- }
570
- });
571
-
572
- // node_modules/axios/lib/helpers/isAbsoluteURL.js
573
- var require_isAbsoluteURL = __commonJS({
574
- "node_modules/axios/lib/helpers/isAbsoluteURL.js"(exports, module2) {
575
- "use strict";
576
- module2.exports = function isAbsoluteURL(url) {
577
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
578
- };
579
- }
580
- });
581
-
582
- // node_modules/axios/lib/helpers/combineURLs.js
583
- var require_combineURLs = __commonJS({
584
- "node_modules/axios/lib/helpers/combineURLs.js"(exports, module2) {
585
- "use strict";
586
- module2.exports = function combineURLs(baseURL, relativeURL) {
587
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
588
- };
589
- }
590
- });
591
-
592
- // node_modules/axios/lib/core/buildFullPath.js
593
- var require_buildFullPath = __commonJS({
594
- "node_modules/axios/lib/core/buildFullPath.js"(exports, module2) {
595
- "use strict";
596
- var isAbsoluteURL = require_isAbsoluteURL();
597
- var combineURLs = require_combineURLs();
598
- module2.exports = function buildFullPath(baseURL, requestedURL) {
599
- if (baseURL && !isAbsoluteURL(requestedURL)) {
600
- return combineURLs(baseURL, requestedURL);
601
- }
602
- return requestedURL;
603
- };
604
- }
605
- });
606
-
607
- // node_modules/axios/lib/helpers/parseHeaders.js
608
- var require_parseHeaders = __commonJS({
609
- "node_modules/axios/lib/helpers/parseHeaders.js"(exports, module2) {
610
- "use strict";
611
- var utils = require_utils();
612
- var ignoreDuplicateOf = [
613
- "age",
614
- "authorization",
615
- "content-length",
616
- "content-type",
617
- "etag",
618
- "expires",
619
- "from",
620
- "host",
621
- "if-modified-since",
622
- "if-unmodified-since",
623
- "last-modified",
624
- "location",
625
- "max-forwards",
626
- "proxy-authorization",
627
- "referer",
628
- "retry-after",
629
- "user-agent"
630
- ];
631
- module2.exports = function parseHeaders(headers) {
632
- var parsed = {};
633
- var key;
634
- var val;
635
- var i;
636
- if (!headers) {
637
- return parsed;
638
- }
639
- utils.forEach(headers.split("\n"), function parser(line) {
640
- i = line.indexOf(":");
641
- key = utils.trim(line.substr(0, i)).toLowerCase();
642
- val = utils.trim(line.substr(i + 1));
643
- if (key) {
644
- if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
645
- return;
646
- }
647
- if (key === "set-cookie") {
648
- parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
649
- } else {
650
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
651
- }
652
- }
653
- });
654
- return parsed;
655
- };
656
- }
657
- });
658
-
659
- // node_modules/axios/lib/helpers/isURLSameOrigin.js
660
- var require_isURLSameOrigin = __commonJS({
661
- "node_modules/axios/lib/helpers/isURLSameOrigin.js"(exports, module2) {
662
- "use strict";
663
- var utils = require_utils();
664
- module2.exports = utils.isStandardBrowserEnv() ? (
665
- // Standard browser envs have full support of the APIs needed to test
666
- // whether the request URL is of the same origin as current location.
667
- function standardBrowserEnv() {
668
- var msie = /(msie|trident)/i.test(navigator.userAgent);
669
- var urlParsingNode = document.createElement("a");
670
- var originURL;
671
- function resolveURL(url) {
672
- var href = url;
673
- if (msie) {
674
- urlParsingNode.setAttribute("href", href);
675
- href = urlParsingNode.href;
676
- }
677
- urlParsingNode.setAttribute("href", href);
678
- return {
679
- href: urlParsingNode.href,
680
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
681
- host: urlParsingNode.host,
682
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
683
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
684
- hostname: urlParsingNode.hostname,
685
- port: urlParsingNode.port,
686
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
687
- };
688
- }
689
- originURL = resolveURL(window.location.href);
690
- return function isURLSameOrigin(requestURL) {
691
- var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
692
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
693
- };
694
- }()
695
- ) : (
696
- // Non standard browser envs (web workers, react-native) lack needed support.
697
- function nonStandardBrowserEnv() {
698
- return function isURLSameOrigin() {
699
- return true;
700
- };
701
- }()
702
- );
703
- }
704
- });
705
-
706
- // node_modules/axios/lib/cancel/CanceledError.js
707
- var require_CanceledError = __commonJS({
708
- "node_modules/axios/lib/cancel/CanceledError.js"(exports, module2) {
709
- "use strict";
710
- var AxiosError = require_AxiosError();
711
- var utils = require_utils();
712
- function CanceledError(message) {
713
- AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED);
714
- this.name = "CanceledError";
715
- }
716
- utils.inherits(CanceledError, AxiosError, {
717
- __CANCEL__: true
718
- });
719
- module2.exports = CanceledError;
720
- }
721
- });
722
-
723
- // node_modules/axios/lib/helpers/parseProtocol.js
724
- var require_parseProtocol = __commonJS({
725
- "node_modules/axios/lib/helpers/parseProtocol.js"(exports, module2) {
726
- "use strict";
727
- module2.exports = function parseProtocol(url) {
728
- var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
729
- return match && match[1] || "";
730
- };
731
- }
732
- });
733
-
734
- // node_modules/axios/lib/adapters/xhr.js
735
- var require_xhr = __commonJS({
736
- "node_modules/axios/lib/adapters/xhr.js"(exports, module2) {
737
- "use strict";
738
- var utils = require_utils();
739
- var settle = require_settle();
740
- var cookies = require_cookies();
741
- var buildURL = require_buildURL();
742
- var buildFullPath = require_buildFullPath();
743
- var parseHeaders = require_parseHeaders();
744
- var isURLSameOrigin = require_isURLSameOrigin();
745
- var transitionalDefaults = require_transitional();
746
- var AxiosError = require_AxiosError();
747
- var CanceledError = require_CanceledError();
748
- var parseProtocol = require_parseProtocol();
749
- module2.exports = function xhrAdapter(config) {
750
- return new Promise(function dispatchXhrRequest(resolve, reject) {
751
- var requestData = config.data;
752
- var requestHeaders = config.headers;
753
- var responseType = config.responseType;
754
- var onCanceled;
755
- function done() {
756
- if (config.cancelToken) {
757
- config.cancelToken.unsubscribe(onCanceled);
758
- }
759
- if (config.signal) {
760
- config.signal.removeEventListener("abort", onCanceled);
761
- }
762
- }
763
- if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
764
- delete requestHeaders["Content-Type"];
765
- }
766
- var request = new XMLHttpRequest();
767
- if (config.auth) {
768
- var username = config.auth.username || "";
769
- var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
770
- requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
771
- }
772
- var fullPath = buildFullPath(config.baseURL, config.url);
773
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
774
- request.timeout = config.timeout;
775
- function onloadend() {
776
- if (!request) {
777
- return;
778
- }
779
- var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null;
780
- var responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
781
- var response = {
782
- data: responseData,
783
- status: request.status,
784
- statusText: request.statusText,
785
- headers: responseHeaders,
786
- config,
787
- request
788
- };
789
- settle(function _resolve(value) {
790
- resolve(value);
791
- done();
792
- }, function _reject(err) {
793
- reject(err);
794
- done();
795
- }, response);
796
- request = null;
797
- }
798
- if ("onloadend" in request) {
799
- request.onloadend = onloadend;
800
- } else {
801
- request.onreadystatechange = function handleLoad() {
802
- if (!request || request.readyState !== 4) {
803
- return;
804
- }
805
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
806
- return;
807
- }
808
- setTimeout(onloadend);
809
- };
810
- }
811
- request.onabort = function handleAbort() {
812
- if (!request) {
813
- return;
814
- }
815
- reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
816
- request = null;
817
- };
818
- request.onerror = function handleError() {
819
- reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, request));
820
- request = null;
821
- };
822
- request.ontimeout = function handleTimeout() {
823
- var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
824
- var transitional = config.transitional || transitionalDefaults;
825
- if (config.timeoutErrorMessage) {
826
- timeoutErrorMessage = config.timeoutErrorMessage;
827
- }
828
- reject(new AxiosError(
829
- timeoutErrorMessage,
830
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
831
- config,
832
- request
833
- ));
834
- request = null;
835
- };
836
- if (utils.isStandardBrowserEnv()) {
837
- var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
838
- if (xsrfValue) {
839
- requestHeaders[config.xsrfHeaderName] = xsrfValue;
840
- }
841
- }
842
- if ("setRequestHeader" in request) {
843
- utils.forEach(requestHeaders, function setRequestHeader(val, key) {
844
- if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
845
- delete requestHeaders[key];
846
- } else {
847
- request.setRequestHeader(key, val);
848
- }
849
- });
850
- }
851
- if (!utils.isUndefined(config.withCredentials)) {
852
- request.withCredentials = !!config.withCredentials;
853
- }
854
- if (responseType && responseType !== "json") {
855
- request.responseType = config.responseType;
856
- }
857
- if (typeof config.onDownloadProgress === "function") {
858
- request.addEventListener("progress", config.onDownloadProgress);
859
- }
860
- if (typeof config.onUploadProgress === "function" && request.upload) {
861
- request.upload.addEventListener("progress", config.onUploadProgress);
862
- }
863
- if (config.cancelToken || config.signal) {
864
- onCanceled = function(cancel) {
865
- if (!request) {
866
- return;
867
- }
868
- reject(!cancel || cancel && cancel.type ? new CanceledError() : cancel);
869
- request.abort();
870
- request = null;
871
- };
872
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
873
- if (config.signal) {
874
- config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
875
- }
876
- }
877
- if (!requestData) {
878
- requestData = null;
879
- }
880
- var protocol = parseProtocol(fullPath);
881
- if (protocol && ["http", "https", "file"].indexOf(protocol) === -1) {
882
- reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
883
- return;
884
- }
885
- request.send(requestData);
886
- });
887
- };
888
- }
889
- });
890
-
891
- // node_modules/axios/lib/helpers/null.js
892
- var require_null = __commonJS({
893
- "node_modules/axios/lib/helpers/null.js"(exports, module2) {
894
- module2.exports = null;
895
- }
896
- });
897
-
898
- // node_modules/axios/lib/defaults/index.js
899
- var require_defaults = __commonJS({
900
- "node_modules/axios/lib/defaults/index.js"(exports, module2) {
901
- "use strict";
902
- var utils = require_utils();
903
- var normalizeHeaderName = require_normalizeHeaderName();
904
- var AxiosError = require_AxiosError();
905
- var transitionalDefaults = require_transitional();
906
- var toFormData = require_toFormData();
907
- var DEFAULT_CONTENT_TYPE = {
908
- "Content-Type": "application/x-www-form-urlencoded"
909
- };
910
- function setContentTypeIfUnset(headers, value) {
911
- if (!utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"])) {
912
- headers["Content-Type"] = value;
913
- }
914
- }
915
- function getDefaultAdapter() {
916
- var adapter;
917
- if (typeof XMLHttpRequest !== "undefined") {
918
- adapter = require_xhr();
919
- } else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
920
- adapter = require_xhr();
921
- }
922
- return adapter;
923
- }
924
- function stringifySafely(rawValue, parser, encoder) {
925
- if (utils.isString(rawValue)) {
926
- try {
927
- (parser || JSON.parse)(rawValue);
928
- return utils.trim(rawValue);
929
- } catch (e) {
930
- if (e.name !== "SyntaxError") {
931
- throw e;
932
- }
933
- }
934
- }
935
- return (encoder || JSON.stringify)(rawValue);
936
- }
937
- var defaults = {
938
- transitional: transitionalDefaults,
939
- adapter: getDefaultAdapter(),
940
- transformRequest: [function transformRequest(data, headers) {
941
- normalizeHeaderName(headers, "Accept");
942
- normalizeHeaderName(headers, "Content-Type");
943
- if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
944
- return data;
945
- }
946
- if (utils.isArrayBufferView(data)) {
947
- return data.buffer;
948
- }
949
- if (utils.isURLSearchParams(data)) {
950
- setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
951
- return data.toString();
952
- }
953
- var isObjectPayload = utils.isObject(data);
954
- var contentType = headers && headers["Content-Type"];
955
- var isFileList;
956
- if ((isFileList = utils.isFileList(data)) || isObjectPayload && contentType === "multipart/form-data") {
957
- var _FormData = this.env && this.env.FormData;
958
- return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData());
959
- } else if (isObjectPayload || contentType === "application/json") {
960
- setContentTypeIfUnset(headers, "application/json");
961
- return stringifySafely(data);
962
- }
963
- return data;
964
- }],
965
- transformResponse: [function transformResponse(data) {
966
- var transitional = this.transitional || defaults.transitional;
967
- var silentJSONParsing = transitional && transitional.silentJSONParsing;
968
- var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
969
- var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
970
- if (strictJSONParsing || forcedJSONParsing && utils.isString(data) && data.length) {
971
- try {
972
- return JSON.parse(data);
973
- } catch (e) {
974
- if (strictJSONParsing) {
975
- if (e.name === "SyntaxError") {
976
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
977
- }
978
- throw e;
979
- }
980
- }
981
- }
982
- return data;
983
- }],
984
- /**
985
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
986
- * timeout is not created.
987
- */
988
- timeout: 0,
989
- xsrfCookieName: "XSRF-TOKEN",
990
- xsrfHeaderName: "X-XSRF-TOKEN",
991
- maxContentLength: -1,
992
- maxBodyLength: -1,
993
- env: {
994
- FormData: require_null()
995
- },
996
- validateStatus: function validateStatus(status) {
997
- return status >= 200 && status < 300;
998
- },
999
- headers: {
1000
- common: {
1001
- "Accept": "application/json, text/plain, */*"
1002
- }
1003
- }
1004
- };
1005
- utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
1006
- defaults.headers[method] = {};
1007
- });
1008
- utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
1009
- defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
1010
- });
1011
- module2.exports = defaults;
1012
- }
1013
- });
1014
-
1015
- // node_modules/axios/lib/core/transformData.js
1016
- var require_transformData = __commonJS({
1017
- "node_modules/axios/lib/core/transformData.js"(exports, module2) {
1018
- "use strict";
1019
- var utils = require_utils();
1020
- var defaults = require_defaults();
1021
- module2.exports = function transformData(data, headers, fns) {
1022
- var context = this || defaults;
1023
- utils.forEach(fns, function transform(fn) {
1024
- data = fn.call(context, data, headers);
1025
- });
1026
- return data;
1027
- };
1028
- }
1029
- });
1030
-
1031
- // node_modules/axios/lib/cancel/isCancel.js
1032
- var require_isCancel = __commonJS({
1033
- "node_modules/axios/lib/cancel/isCancel.js"(exports, module2) {
1034
- "use strict";
1035
- module2.exports = function isCancel(value) {
1036
- return !!(value && value.__CANCEL__);
1037
- };
1038
- }
1039
- });
1040
-
1041
- // node_modules/axios/lib/core/dispatchRequest.js
1042
- var require_dispatchRequest = __commonJS({
1043
- "node_modules/axios/lib/core/dispatchRequest.js"(exports, module2) {
1044
- "use strict";
1045
- var utils = require_utils();
1046
- var transformData = require_transformData();
1047
- var isCancel = require_isCancel();
1048
- var defaults = require_defaults();
1049
- var CanceledError = require_CanceledError();
1050
- function throwIfCancellationRequested(config) {
1051
- if (config.cancelToken) {
1052
- config.cancelToken.throwIfRequested();
1053
- }
1054
- if (config.signal && config.signal.aborted) {
1055
- throw new CanceledError();
1056
- }
1057
- }
1058
- module2.exports = function dispatchRequest(config) {
1059
- throwIfCancellationRequested(config);
1060
- config.headers = config.headers || {};
1061
- config.data = transformData.call(
1062
- config,
1063
- config.data,
1064
- config.headers,
1065
- config.transformRequest
1066
- );
1067
- config.headers = utils.merge(
1068
- config.headers.common || {},
1069
- config.headers[config.method] || {},
1070
- config.headers
1071
- );
1072
- utils.forEach(
1073
- ["delete", "get", "head", "post", "put", "patch", "common"],
1074
- function cleanHeaderConfig(method) {
1075
- delete config.headers[method];
1076
- }
1077
- );
1078
- var adapter = config.adapter || defaults.adapter;
1079
- return adapter(config).then(function onAdapterResolution(response) {
1080
- throwIfCancellationRequested(config);
1081
- response.data = transformData.call(
1082
- config,
1083
- response.data,
1084
- response.headers,
1085
- config.transformResponse
1086
- );
1087
- return response;
1088
- }, function onAdapterRejection(reason) {
1089
- if (!isCancel(reason)) {
1090
- throwIfCancellationRequested(config);
1091
- if (reason && reason.response) {
1092
- reason.response.data = transformData.call(
1093
- config,
1094
- reason.response.data,
1095
- reason.response.headers,
1096
- config.transformResponse
1097
- );
1098
- }
1099
- }
1100
- return Promise.reject(reason);
1101
- });
1102
- };
1103
- }
1104
- });
1105
-
1106
- // node_modules/axios/lib/core/mergeConfig.js
1107
- var require_mergeConfig = __commonJS({
1108
- "node_modules/axios/lib/core/mergeConfig.js"(exports, module2) {
1109
- "use strict";
1110
- var utils = require_utils();
1111
- module2.exports = function mergeConfig(config1, config2) {
1112
- config2 = config2 || {};
1113
- var config = {};
1114
- function getMergedValue(target, source) {
1115
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
1116
- return utils.merge(target, source);
1117
- } else if (utils.isPlainObject(source)) {
1118
- return utils.merge({}, source);
1119
- } else if (utils.isArray(source)) {
1120
- return source.slice();
1121
- }
1122
- return source;
1123
- }
1124
- function mergeDeepProperties(prop) {
1125
- if (!utils.isUndefined(config2[prop])) {
1126
- return getMergedValue(config1[prop], config2[prop]);
1127
- } else if (!utils.isUndefined(config1[prop])) {
1128
- return getMergedValue(void 0, config1[prop]);
1129
- }
1130
- }
1131
- function valueFromConfig2(prop) {
1132
- if (!utils.isUndefined(config2[prop])) {
1133
- return getMergedValue(void 0, config2[prop]);
1134
- }
1135
- }
1136
- function defaultToConfig2(prop) {
1137
- if (!utils.isUndefined(config2[prop])) {
1138
- return getMergedValue(void 0, config2[prop]);
1139
- } else if (!utils.isUndefined(config1[prop])) {
1140
- return getMergedValue(void 0, config1[prop]);
1141
- }
1142
- }
1143
- function mergeDirectKeys(prop) {
1144
- if (prop in config2) {
1145
- return getMergedValue(config1[prop], config2[prop]);
1146
- } else if (prop in config1) {
1147
- return getMergedValue(void 0, config1[prop]);
1148
- }
1149
- }
1150
- var mergeMap = {
1151
- "url": valueFromConfig2,
1152
- "method": valueFromConfig2,
1153
- "data": valueFromConfig2,
1154
- "baseURL": defaultToConfig2,
1155
- "transformRequest": defaultToConfig2,
1156
- "transformResponse": defaultToConfig2,
1157
- "paramsSerializer": defaultToConfig2,
1158
- "timeout": defaultToConfig2,
1159
- "timeoutMessage": defaultToConfig2,
1160
- "withCredentials": defaultToConfig2,
1161
- "adapter": defaultToConfig2,
1162
- "responseType": defaultToConfig2,
1163
- "xsrfCookieName": defaultToConfig2,
1164
- "xsrfHeaderName": defaultToConfig2,
1165
- "onUploadProgress": defaultToConfig2,
1166
- "onDownloadProgress": defaultToConfig2,
1167
- "decompress": defaultToConfig2,
1168
- "maxContentLength": defaultToConfig2,
1169
- "maxBodyLength": defaultToConfig2,
1170
- "beforeRedirect": defaultToConfig2,
1171
- "transport": defaultToConfig2,
1172
- "httpAgent": defaultToConfig2,
1173
- "httpsAgent": defaultToConfig2,
1174
- "cancelToken": defaultToConfig2,
1175
- "socketPath": defaultToConfig2,
1176
- "responseEncoding": defaultToConfig2,
1177
- "validateStatus": mergeDirectKeys
1178
- };
1179
- utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
1180
- var merge = mergeMap[prop] || mergeDeepProperties;
1181
- var configValue = merge(prop);
1182
- utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
1183
- });
1184
- return config;
1185
- };
1186
- }
1187
- });
1188
-
1189
- // node_modules/axios/lib/env/data.js
1190
- var require_data = __commonJS({
1191
- "node_modules/axios/lib/env/data.js"(exports, module2) {
1192
- module2.exports = {
1193
- "version": "0.27.2"
1194
- };
1195
- }
1196
- });
1197
-
1198
- // node_modules/axios/lib/helpers/validator.js
1199
- var require_validator = __commonJS({
1200
- "node_modules/axios/lib/helpers/validator.js"(exports, module2) {
1201
- "use strict";
1202
- var VERSION = require_data().version;
1203
- var AxiosError = require_AxiosError();
1204
- var validators = {};
1205
- ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
1206
- validators[type] = function validator(thing) {
1207
- return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
1208
- };
1209
- });
1210
- var deprecatedWarnings = {};
1211
- validators.transitional = function transitional(validator, version, message) {
1212
- function formatMessage(opt, desc) {
1213
- return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
1214
- }
1215
- return function(value, opt, opts) {
1216
- if (validator === false) {
1217
- throw new AxiosError(
1218
- formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
1219
- AxiosError.ERR_DEPRECATED
1220
- );
1221
- }
1222
- if (version && !deprecatedWarnings[opt]) {
1223
- deprecatedWarnings[opt] = true;
1224
- console.warn(
1225
- formatMessage(
1226
- opt,
1227
- " has been deprecated since v" + version + " and will be removed in the near future"
1228
- )
1229
- );
1230
- }
1231
- return validator ? validator(value, opt, opts) : true;
1232
- };
1233
- };
1234
- function assertOptions(options, schema, allowUnknown) {
1235
- if (typeof options !== "object") {
1236
- throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
1237
- }
1238
- var keys = Object.keys(options);
1239
- var i = keys.length;
1240
- while (i-- > 0) {
1241
- var opt = keys[i];
1242
- var validator = schema[opt];
1243
- if (validator) {
1244
- var value = options[opt];
1245
- var result = value === void 0 || validator(value, opt, options);
1246
- if (result !== true) {
1247
- throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
1248
- }
1249
- continue;
1250
- }
1251
- if (allowUnknown !== true) {
1252
- throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
1253
- }
1254
- }
1255
- }
1256
- module2.exports = {
1257
- assertOptions,
1258
- validators
1259
- };
1260
- }
1261
- });
1262
-
1263
- // node_modules/axios/lib/core/Axios.js
1264
- var require_Axios = __commonJS({
1265
- "node_modules/axios/lib/core/Axios.js"(exports, module2) {
1266
- "use strict";
1267
- var utils = require_utils();
1268
- var buildURL = require_buildURL();
1269
- var InterceptorManager = require_InterceptorManager();
1270
- var dispatchRequest = require_dispatchRequest();
1271
- var mergeConfig = require_mergeConfig();
1272
- var buildFullPath = require_buildFullPath();
1273
- var validator = require_validator();
1274
- var validators = validator.validators;
1275
- function Axios(instanceConfig) {
1276
- this.defaults = instanceConfig;
1277
- this.interceptors = {
1278
- request: new InterceptorManager(),
1279
- response: new InterceptorManager()
1280
- };
1281
- }
1282
- Axios.prototype.request = function request(configOrUrl, config) {
1283
- if (typeof configOrUrl === "string") {
1284
- config = config || {};
1285
- config.url = configOrUrl;
1286
- } else {
1287
- config = configOrUrl || {};
1288
- }
1289
- config = mergeConfig(this.defaults, config);
1290
- if (config.method) {
1291
- config.method = config.method.toLowerCase();
1292
- } else if (this.defaults.method) {
1293
- config.method = this.defaults.method.toLowerCase();
1294
- } else {
1295
- config.method = "get";
1296
- }
1297
- var transitional = config.transitional;
1298
- if (transitional !== void 0) {
1299
- validator.assertOptions(transitional, {
1300
- silentJSONParsing: validators.transitional(validators.boolean),
1301
- forcedJSONParsing: validators.transitional(validators.boolean),
1302
- clarifyTimeoutError: validators.transitional(validators.boolean)
1303
- }, false);
1304
- }
1305
- var requestInterceptorChain = [];
1306
- var synchronousRequestInterceptors = true;
1307
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
1308
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
1309
- return;
1310
- }
1311
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
1312
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
1313
- });
1314
- var responseInterceptorChain = [];
1315
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
1316
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
1317
- });
1318
- var promise;
1319
- if (!synchronousRequestInterceptors) {
1320
- var chain = [dispatchRequest, void 0];
1321
- Array.prototype.unshift.apply(chain, requestInterceptorChain);
1322
- chain = chain.concat(responseInterceptorChain);
1323
- promise = Promise.resolve(config);
1324
- while (chain.length) {
1325
- promise = promise.then(chain.shift(), chain.shift());
1326
- }
1327
- return promise;
1328
- }
1329
- var newConfig = config;
1330
- while (requestInterceptorChain.length) {
1331
- var onFulfilled = requestInterceptorChain.shift();
1332
- var onRejected = requestInterceptorChain.shift();
1333
- try {
1334
- newConfig = onFulfilled(newConfig);
1335
- } catch (error) {
1336
- onRejected(error);
1337
- break;
1338
- }
1339
- }
1340
- try {
1341
- promise = dispatchRequest(newConfig);
1342
- } catch (error) {
1343
- return Promise.reject(error);
1344
- }
1345
- while (responseInterceptorChain.length) {
1346
- promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
1347
- }
1348
- return promise;
1349
- };
1350
- Axios.prototype.getUri = function getUri(config) {
1351
- config = mergeConfig(this.defaults, config);
1352
- var fullPath = buildFullPath(config.baseURL, config.url);
1353
- return buildURL(fullPath, config.params, config.paramsSerializer);
1354
- };
1355
- utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
1356
- Axios.prototype[method] = function(url, config) {
1357
- return this.request(mergeConfig(config || {}, {
1358
- method,
1359
- url,
1360
- data: (config || {}).data
1361
- }));
1362
- };
1363
- });
1364
- utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
1365
- function generateHTTPMethod(isForm) {
1366
- return function httpMethod(url, data, config) {
1367
- return this.request(mergeConfig(config || {}, {
1368
- method,
1369
- headers: isForm ? {
1370
- "Content-Type": "multipart/form-data"
1371
- } : {},
1372
- url,
1373
- data
1374
- }));
1375
- };
1376
- }
1377
- Axios.prototype[method] = generateHTTPMethod();
1378
- Axios.prototype[method + "Form"] = generateHTTPMethod(true);
1379
- });
1380
- module2.exports = Axios;
1381
- }
1382
- });
1383
-
1384
- // node_modules/axios/lib/cancel/CancelToken.js
1385
- var require_CancelToken = __commonJS({
1386
- "node_modules/axios/lib/cancel/CancelToken.js"(exports, module2) {
1387
- "use strict";
1388
- var CanceledError = require_CanceledError();
1389
- function CancelToken(executor) {
1390
- if (typeof executor !== "function") {
1391
- throw new TypeError("executor must be a function.");
1392
- }
1393
- var resolvePromise;
1394
- this.promise = new Promise(function promiseExecutor(resolve) {
1395
- resolvePromise = resolve;
1396
- });
1397
- var token = this;
1398
- this.promise.then(function(cancel) {
1399
- if (!token._listeners)
1400
- return;
1401
- var i;
1402
- var l = token._listeners.length;
1403
- for (i = 0; i < l; i++) {
1404
- token._listeners[i](cancel);
1405
- }
1406
- token._listeners = null;
1407
- });
1408
- this.promise.then = function(onfulfilled) {
1409
- var _resolve;
1410
- var promise = new Promise(function(resolve) {
1411
- token.subscribe(resolve);
1412
- _resolve = resolve;
1413
- }).then(onfulfilled);
1414
- promise.cancel = function reject() {
1415
- token.unsubscribe(_resolve);
1416
- };
1417
- return promise;
1418
- };
1419
- executor(function cancel(message) {
1420
- if (token.reason) {
1421
- return;
1422
- }
1423
- token.reason = new CanceledError(message);
1424
- resolvePromise(token.reason);
1425
- });
1426
- }
1427
- CancelToken.prototype.throwIfRequested = function throwIfRequested() {
1428
- if (this.reason) {
1429
- throw this.reason;
1430
- }
1431
- };
1432
- CancelToken.prototype.subscribe = function subscribe(listener) {
1433
- if (this.reason) {
1434
- listener(this.reason);
1435
- return;
1436
- }
1437
- if (this._listeners) {
1438
- this._listeners.push(listener);
1439
- } else {
1440
- this._listeners = [listener];
1441
- }
1442
- };
1443
- CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
1444
- if (!this._listeners) {
1445
- return;
1446
- }
1447
- var index = this._listeners.indexOf(listener);
1448
- if (index !== -1) {
1449
- this._listeners.splice(index, 1);
1450
- }
1451
- };
1452
- CancelToken.source = function source() {
1453
- var cancel;
1454
- var token = new CancelToken(function executor(c) {
1455
- cancel = c;
1456
- });
1457
- return {
1458
- token,
1459
- cancel
1460
- };
1461
- };
1462
- module2.exports = CancelToken;
1463
- }
1464
- });
1465
-
1466
- // node_modules/axios/lib/helpers/spread.js
1467
- var require_spread = __commonJS({
1468
- "node_modules/axios/lib/helpers/spread.js"(exports, module2) {
1469
- "use strict";
1470
- module2.exports = function spread(callback) {
1471
- return function wrap(arr) {
1472
- return callback.apply(null, arr);
1473
- };
1474
- };
1475
- }
1476
- });
1477
-
1478
- // node_modules/axios/lib/helpers/isAxiosError.js
1479
- var require_isAxiosError = __commonJS({
1480
- "node_modules/axios/lib/helpers/isAxiosError.js"(exports, module2) {
1481
- "use strict";
1482
- var utils = require_utils();
1483
- module2.exports = function isAxiosError(payload) {
1484
- return utils.isObject(payload) && payload.isAxiosError === true;
1485
- };
1486
- }
1487
- });
1488
-
1489
- // node_modules/axios/lib/axios.js
1490
- var require_axios = __commonJS({
1491
- "node_modules/axios/lib/axios.js"(exports, module2) {
1492
- "use strict";
1493
- var utils = require_utils();
1494
- var bind = require_bind();
1495
- var Axios = require_Axios();
1496
- var mergeConfig = require_mergeConfig();
1497
- var defaults = require_defaults();
1498
- function createInstance(defaultConfig2) {
1499
- var context = new Axios(defaultConfig2);
1500
- var instance = bind(Axios.prototype.request, context);
1501
- utils.extend(instance, Axios.prototype, context);
1502
- utils.extend(instance, context);
1503
- instance.create = function create(instanceConfig) {
1504
- return createInstance(mergeConfig(defaultConfig2, instanceConfig));
1505
- };
1506
- return instance;
1507
- }
1508
- var axios2 = createInstance(defaults);
1509
- axios2.Axios = Axios;
1510
- axios2.CanceledError = require_CanceledError();
1511
- axios2.CancelToken = require_CancelToken();
1512
- axios2.isCancel = require_isCancel();
1513
- axios2.VERSION = require_data().version;
1514
- axios2.toFormData = require_toFormData();
1515
- axios2.AxiosError = require_AxiosError();
1516
- axios2.Cancel = axios2.CanceledError;
1517
- axios2.all = function all(promises) {
1518
- return Promise.all(promises);
1519
- };
1520
- axios2.spread = require_spread();
1521
- axios2.isAxiosError = require_isAxiosError();
1522
- module2.exports = axios2;
1523
- module2.exports.default = axios2;
1524
- }
1525
- });
1526
-
1527
- // node_modules/axios/index.js
1528
- var require_axios2 = __commonJS({
1529
- "node_modules/axios/index.js"(exports, module2) {
1530
- module2.exports = require_axios();
1531
- }
1532
- });
1533
-
1534
- // src/api-client.ts
1535
- var import_axios = __toESM(require_axios2());
1536
7
 
1537
8
  // src/utils.ts
1538
9
  function logError(consoleMessage) {
@@ -1587,10 +58,11 @@
1587
58
  if (config.requiresGuidInHeaders) {
1588
59
  defaultAuthHeaders.Guid = config.guid;
1589
60
  }
1590
- return {
61
+ const headers = {
1591
62
  ...defaultAuthHeaders,
1592
63
  ...config.headers
1593
64
  };
65
+ return headers;
1594
66
  }
1595
67
  function isHttps(url) {
1596
68
  if (!url.toLowerCase().startsWith("https://")) {
@@ -1968,8 +440,6 @@
1968
440
  config.requiresGuidInHeaders = true;
1969
441
  }
1970
442
  this.config = config;
1971
- let adapter = void 0;
1972
- this._api = import_axios.default.create();
1973
443
  }
1974
444
  async getContentItem(params) {
1975
445
  return getContentItem_default.call(this, params);
@@ -2004,15 +474,25 @@
2004
474
  logDebug(`AgilityCMS Fetch API LOG: ${reqConfig.baseURL}${reqConfig.url}`);
2005
475
  }
2006
476
  try {
2007
- const response = await this._api(reqConfig);
2008
- let data = response.data;
2009
- if (response.request.fromCache) {
2010
- data["fromCache"] = true;
477
+ const fullUrl = `${reqConfig.baseURL}${reqConfig.url}`;
478
+ let init = {
479
+ method: "GET",
480
+ headers: {
481
+ ...reqConfig.headers,
482
+ "Content-Type": "application/json",
483
+ "Accept": "application/json"
484
+ }
485
+ };
486
+ const response = await fetch(fullUrl, init);
487
+ if (!response.ok) {
488
+ logError(`AgilityCMS Fetch API ERROR: Request returned a ${response.status} response for ${reqConfig.baseURL}${reqConfig.url}. ${response.statusText}`);
489
+ return;
2011
490
  }
491
+ let data = await response.json();
2012
492
  if (this.config.debug) {
2013
493
  data["agilityResponseHeaders"] = response.headers;
2014
494
  }
2015
- return await data;
495
+ return data;
2016
496
  } catch (error) {
2017
497
  logError(`AgilityCMS Fetch API ERROR: Request failed for ${reqConfig.baseURL}${reqConfig.url} ... ${error} ... Does the item exist?`);
2018
498
  }