prismic-ts-codegen 0.1.28-alpha.6 → 0.1.28-alpha.7
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/_node_modules/@prismicio/client/dist/Client.cjs +106 -95
- package/dist/_node_modules/@prismicio/client/dist/Client.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/Client.js +106 -95
- package/dist/_node_modules/@prismicio/client/dist/Client.js.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/lib/request.cjs +43 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/request.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/request.js +43 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/request.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs +1 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs.map +1 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.js +1 -1
- package/dist/_node_modules/@prismicio/client/dist/package.json.js.map +1 -1
- package/dist/_node_modules/map-obj/index.cjs +1 -1
- package/dist/_node_modules/map-obj/index.js +1 -1
- package/dist/_node_modules/minimist-options/index.cjs +1 -1
- package/dist/_node_modules/minimist-options/index.js +1 -1
- package/dist/_virtual/index2.cjs +2 -2
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.cjs +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/package.json +2 -2
- package/dist/_node_modules/@prismicio/client/dist/BaseClient.cjs +0 -97
- package/dist/_node_modules/@prismicio/client/dist/BaseClient.cjs.map +0 -1
- package/dist/_node_modules/@prismicio/client/dist/BaseClient.js +0 -97
- package/dist/_node_modules/@prismicio/client/dist/BaseClient.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const pLimit = require("./pLimit.cjs");
|
|
4
|
+
const DEFAULT_RETRY_AFTER = 1500;
|
|
5
|
+
const THROTTLED_RUNNERS = {};
|
|
6
|
+
const DEDUPLICATED_JOBS = {};
|
|
7
|
+
async function request(url, init, fetchFn) {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
const stringURL = url.toString();
|
|
10
|
+
let job;
|
|
11
|
+
if (init == null ? void 0 : init.body) {
|
|
12
|
+
const runner = THROTTLED_RUNNERS[_a = url.hostname] || (THROTTLED_RUNNERS[_a] = pLimit.pLimit({
|
|
13
|
+
interval: DEFAULT_RETRY_AFTER
|
|
14
|
+
}));
|
|
15
|
+
job = runner(() => fetchFn(stringURL, init));
|
|
16
|
+
} else {
|
|
17
|
+
const existingJob = (_b = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b.get(init == null ? void 0 : init.signal);
|
|
18
|
+
if (existingJob) {
|
|
19
|
+
job = existingJob;
|
|
20
|
+
} else {
|
|
21
|
+
job = fetchFn(stringURL, init).finally(() => {
|
|
22
|
+
var _a2, _b2;
|
|
23
|
+
(_a2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _a2.delete(init == null ? void 0 : init.signal);
|
|
24
|
+
if (((_b2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b2.size) === 0) {
|
|
25
|
+
delete DEDUPLICATED_JOBS[stringURL];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const map = DEDUPLICATED_JOBS[stringURL] || (DEDUPLICATED_JOBS[stringURL] = /* @__PURE__ */ new Map());
|
|
29
|
+
map.set(init == null ? void 0 : init.signal, job);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const response = await job;
|
|
33
|
+
if (response.status === 429) {
|
|
34
|
+
const retryAfter = Number(response.headers.get("retry-after"));
|
|
35
|
+
const resolvedRetryAfter = Number.isNaN(retryAfter) ? DEFAULT_RETRY_AFTER : retryAfter * 1e3;
|
|
36
|
+
await new Promise((resolve) => setTimeout(resolve, resolvedRetryAfter));
|
|
37
|
+
return request(url, init, fetchFn);
|
|
38
|
+
}
|
|
39
|
+
return response.clone();
|
|
40
|
+
}
|
|
41
|
+
exports.DEFAULT_RETRY_AFTER = DEFAULT_RETRY_AFTER;
|
|
42
|
+
exports.request = request;
|
|
43
|
+
//# sourceMappingURL=request.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/request.js"],"sourcesContent":["import { pLimit } from \"./pLimit.js\";\nconst DEFAULT_RETRY_AFTER = 1500;\nconst THROTTLED_RUNNERS = {};\nconst DEDUPLICATED_JOBS = {};\nasync function request(url, init, fetchFn) {\n var _a, _b;\n const stringURL = url.toString();\n let job;\n if (init == null ? void 0 : init.body) {\n const runner = THROTTLED_RUNNERS[_a = url.hostname] || (THROTTLED_RUNNERS[_a] = pLimit({\n interval: DEFAULT_RETRY_AFTER\n }));\n job = runner(() => fetchFn(stringURL, init));\n } else {\n const existingJob = (_b = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b.get(init == null ? void 0 : init.signal);\n if (existingJob) {\n job = existingJob;\n } else {\n job = fetchFn(stringURL, init).finally(() => {\n var _a2, _b2;\n (_a2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _a2.delete(init == null ? void 0 : init.signal);\n if (((_b2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b2.size) === 0) {\n delete DEDUPLICATED_JOBS[stringURL];\n }\n });\n const map = DEDUPLICATED_JOBS[stringURL] || (DEDUPLICATED_JOBS[stringURL] = /* @__PURE__ */ new Map());\n map.set(init == null ? void 0 : init.signal, job);\n }\n }\n const response = await job;\n if (response.status === 429) {\n const retryAfter = Number(response.headers.get(\"retry-after\"));\n const resolvedRetryAfter = Number.isNaN(retryAfter) ? DEFAULT_RETRY_AFTER : retryAfter * 1e3;\n await new Promise((resolve) => setTimeout(resolve, resolvedRetryAfter));\n return request(url, init, fetchFn);\n }\n return response.clone();\n}\nexport {\n DEFAULT_R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AQ,CAAC,YAAY,WAAW,SAAS,kBAAkB,CAAC;AACtE,WAAO,QAAQ,KAAK,MAAM,OAAO;AAAA,EAClC;AACD,SAAO,SAAS;AAClB;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { pLimit } from "./pLimit.js";
|
|
2
|
+
const DEFAULT_RETRY_AFTER = 1500;
|
|
3
|
+
const THROTTLED_RUNNERS = {};
|
|
4
|
+
const DEDUPLICATED_JOBS = {};
|
|
5
|
+
async function request(url, init, fetchFn) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const stringURL = url.toString();
|
|
8
|
+
let job;
|
|
9
|
+
if (init == null ? void 0 : init.body) {
|
|
10
|
+
const runner = THROTTLED_RUNNERS[_a = url.hostname] || (THROTTLED_RUNNERS[_a] = pLimit({
|
|
11
|
+
interval: DEFAULT_RETRY_AFTER
|
|
12
|
+
}));
|
|
13
|
+
job = runner(() => fetchFn(stringURL, init));
|
|
14
|
+
} else {
|
|
15
|
+
const existingJob = (_b = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b.get(init == null ? void 0 : init.signal);
|
|
16
|
+
if (existingJob) {
|
|
17
|
+
job = existingJob;
|
|
18
|
+
} else {
|
|
19
|
+
job = fetchFn(stringURL, init).finally(() => {
|
|
20
|
+
var _a2, _b2;
|
|
21
|
+
(_a2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _a2.delete(init == null ? void 0 : init.signal);
|
|
22
|
+
if (((_b2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b2.size) === 0) {
|
|
23
|
+
delete DEDUPLICATED_JOBS[stringURL];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const map = DEDUPLICATED_JOBS[stringURL] || (DEDUPLICATED_JOBS[stringURL] = /* @__PURE__ */ new Map());
|
|
27
|
+
map.set(init == null ? void 0 : init.signal, job);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const response = await job;
|
|
31
|
+
if (response.status === 429) {
|
|
32
|
+
const retryAfter = Number(response.headers.get("retry-after"));
|
|
33
|
+
const resolvedRetryAfter = Number.isNaN(retryAfter) ? DEFAULT_RETRY_AFTER : retryAfter * 1e3;
|
|
34
|
+
await new Promise((resolve) => setTimeout(resolve, resolvedRetryAfter));
|
|
35
|
+
return request(url, init, fetchFn);
|
|
36
|
+
}
|
|
37
|
+
return response.clone();
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
DEFAULT_RETRY_AFTER,
|
|
41
|
+
request
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/request.js"],"sourcesContent":["import { pLimit } from \"./pLimit.js\";\nconst DEFAULT_RETRY_AFTER = 1500;\nconst THROTTLED_RUNNERS = {};\nconst DEDUPLICATED_JOBS = {};\nasync function request(url, init, fetchFn) {\n var _a, _b;\n const stringURL = url.toString();\n let job;\n if (init == null ? void 0 : init.body) {\n const runner = THROTTLED_RUNNERS[_a = url.hostname] || (THROTTLED_RUNNERS[_a] = pLimit({\n interval: DEFAULT_RETRY_AFTER\n }));\n job = runner(() => fetchFn(stringURL, init));\n } else {\n const existingJob = (_b = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b.get(init == null ? void 0 : init.signal);\n if (existingJob) {\n job = existingJob;\n } else {\n job = fetchFn(stringURL, init).finally(() => {\n var _a2, _b2;\n (_a2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _a2.delete(init == null ? void 0 : init.signal);\n if (((_b2 = DEDUPLICATED_JOBS[stringURL]) == null ? void 0 : _b2.size) === 0) {\n delete DEDUPLICATED_JOBS[stringURL];\n }\n });\n const map = DEDUPLICATED_JOBS[stringURL] || (DEDUPLICATED_JOBS[stringURL] = /* @__PURE__ */ new Map());\n map.set(init == null ? void 0 : init.signal, job);\n }\n }\n const response = await job;\n if (response.status === 429) {\n const retryAfter = Number(response.headers.get(\"retry-after\"));\n const resolvedRetryAfter = Number.isNaN(retryAfter) ? DEFAULT_RETRY_AFTER : retryAfter * 1e3;\n await new Promise((resolve) => setTimeout(resolve, resolvedRetryAfter));\n return request(url, init, fetchFn);\n }\n return response.clone();\n}\nexport {\n DEFAULT_RETRY_AFTER,\n request\n};\n//# sourceMappingURL=request.js.map\n"],"names":[],"mappings":";AACK,MAAC,sBAAsB;AAC5B,MAAM,oBAAoB,CAAA;AAC1B,MAAM,oBAAoB,CAAA;AAC1B,eAAe,QAAQ,KAAK,MAAM,SAAS;AACzC,MAAI,IAAI;AACR,QAAM,YAAY,IAAI;AACtB,MAAI;AACJ,MAAI,QAAQ,OAAO,SAAS,KAAK,MAAM;AACrC,UAAM,SAAS,kBAAkB,KAAK,IAAI,QAAQ,MAAM,kBAAkB,EAAE,IAAI,OAAO;AAAA,MACrF,UAAU;AAAA,IACX,CAAA;AACD,UAAM,OAAO,MAAM,QAAQ,WAAW,IAAI,CAAC;AAAA,EAC/C,OAAS;AACL,UAAM,eAAe,KAAK,kBAAkB,SAAS,MAAM,OAAO,SAAS,GAAG,IAAI,QAAQ,OAAO,SAAS,KAAK,MAAM;AACrH,QAAI,aAAa;AACf,YAAM;AAAA,IACZ,OAAW;AACL,YAAM,QAAQ,WAAW,IAAI,EAAE,QAAQ,MAAM;AAC3C,YAAI,KAAK;AACT,SAAC,MAAM,kBAAkB,SAAS,MAAM,OAAO,SAAS,IAAI,OAAO,QAAQ,OAAO,SAAS,KAAK,MAAM;AACtG,cAAM,MAAM,kBAAkB,SAAS,MAAM,OAAO,SAAS,IAAI,UAAU,GAAG;AAC5E,iBAAO,kBAAkB,SAAS;AAAA,QACnC;AAAA,MACT,CAAO;AACD,YAAM,MAAM,kBAAkB,SAAS,MAAM,kBAAkB,SAAS,IAAoB,oBAAI,IAAG;AACnG,UAAI,IAAI,QAAQ,OAAO,SAAS,KAAK,QAAQ,GAAG;AAAA,IACjD;AAAA,EACF;AACD,QAAM,WAAW,MAAM;AACvB,MAAI,SAAS,WAAW,KAAK;AAC3B,UAAM,aAAa,OAAO,SAAS,QAAQ,IAAI,aAAa,CAAC;AAC7D,UAAM,qBAAqB,OAAO,MAAM,UAAU,IAAI,sBAAsB,aAAa;AACzF,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,kBAAkB,CAAC;AACtE,WAAO,QAAQ,KAAK,MAAM,OAAO;AAAA,EAClC;AACD,SAAO,SAAS;AAClB;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/package.json.js"],"sourcesContent":["const version = \"7.
|
|
1
|
+
{"version":3,"file":"package.json.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/package.json.js"],"sourcesContent":["const name = \"@prismicio/client\";\nconst version = \"7.21.0-alpha.0\";\nexport {\n name,\n version\n};\n//# sourceMappingURL=package.json.js.map\n"],"names":[],"mappings":";;AACK,MAAC,UAAU;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.js","sources":["../../../../../node_modules/@prismicio/client/dist/package.json.js"],"sourcesContent":["const version = \"7.
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":["../../../../../node_modules/@prismicio/client/dist/package.json.js"],"sourcesContent":["const name = \"@prismicio/client\";\nconst version = \"7.21.0-alpha.0\";\nexport {\n name,\n version\n};\n//# sourceMappingURL=package.json.js.map\n"],"names":[],"mappings":"AACK,MAAC,UAAU;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const _commonjsHelpers = require("../../_virtual/_commonjsHelpers.cjs");
|
|
3
|
-
const index = require("../../_virtual/
|
|
3
|
+
const index = require("../../_virtual/index2.cjs");
|
|
4
4
|
const isObject = (value) => typeof value === "object" && value !== null;
|
|
5
5
|
const mapObjectSkip = Symbol("skip");
|
|
6
6
|
const isObjectCustom = (value) => isObject(value) && !(value instanceof RegExp) && !(value instanceof Error) && !(value instanceof Date);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs } from "../../_virtual/_commonjsHelpers.js";
|
|
2
|
-
import { __module as mapObj } from "../../_virtual/
|
|
2
|
+
import { __module as mapObj } from "../../_virtual/index2.js";
|
|
3
3
|
const isObject = (value) => typeof value === "object" && value !== null;
|
|
4
4
|
const mapObjectSkip = Symbol("skip");
|
|
5
5
|
const isObjectCustom = (value) => isObject(value) && !(value instanceof RegExp) && !(value instanceof Error) && !(value instanceof Date);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const _commonjsHelpers = require("../../_virtual/_commonjsHelpers.cjs");
|
|
3
|
-
const index = require("../../_virtual/
|
|
3
|
+
const index = require("../../_virtual/index3.cjs");
|
|
4
4
|
const index$1 = require("../is-plain-obj/index.cjs");
|
|
5
5
|
const index$2 = require("../arrify/index.cjs");
|
|
6
6
|
const index$3 = require("../kind-of/index.cjs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs } from "../../_virtual/_commonjsHelpers.js";
|
|
2
|
-
import { __module as minimistOptions } from "../../_virtual/
|
|
2
|
+
import { __module as minimistOptions } from "../../_virtual/index3.js";
|
|
3
3
|
import { i as isPlainObj } from "../is-plain-obj/index.js";
|
|
4
4
|
import { a as arrify$1 } from "../arrify/index.js";
|
|
5
5
|
import { k as kindOf$1 } from "../kind-of/index.js";
|
package/dist/_virtual/index2.cjs
CHANGED
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.cjs
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prismic-ts-codegen",
|
|
3
|
-
"version": "0.1.28-alpha.
|
|
3
|
+
"version": "0.1.28-alpha.7",
|
|
4
4
|
"description": "An experimental Prismic model-to-TypeScript-type generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"quick-lru": "^6.1.2"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@prismicio/client": "7.
|
|
76
|
+
"@prismicio/client": "7.21.0-alpha.0",
|
|
77
77
|
"@prismicio/mock": "0.7.1",
|
|
78
78
|
"@size-limit/preset-small-lib": "^8.2.6",
|
|
79
79
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const pLimit = require("./lib/pLimit.cjs");
|
|
4
|
-
const PrismicError = require("./errors/PrismicError.cjs");
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
-
const UNKNOWN_RATE_LIMIT_DELAY = 1500;
|
|
9
|
-
class BaseClient {
|
|
10
|
-
constructor(options) {
|
|
11
|
-
__publicField(this, "fetchFn");
|
|
12
|
-
__publicField(this, "fetchOptions");
|
|
13
|
-
__publicField(this, "queuedFetchJobs", {});
|
|
14
|
-
__publicField(this, "dedupedFetchJobs", {});
|
|
15
|
-
this.fetchOptions = options.fetchOptions;
|
|
16
|
-
if (typeof options.fetch === "function") {
|
|
17
|
-
this.fetchFn = options.fetch;
|
|
18
|
-
} else if (typeof globalThis.fetch === "function") {
|
|
19
|
-
this.fetchFn = globalThis.fetch;
|
|
20
|
-
} else {
|
|
21
|
-
throw new PrismicError.PrismicError("A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.", void 0, void 0);
|
|
22
|
-
}
|
|
23
|
-
if (this.fetchFn === globalThis.fetch) {
|
|
24
|
-
this.fetchFn = this.fetchFn.bind(globalThis);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async fetch(url, params = {}) {
|
|
28
|
-
var _a, _b, _c, _d, _e;
|
|
29
|
-
const requestInit = {
|
|
30
|
-
...this.fetchOptions,
|
|
31
|
-
...params.fetchOptions,
|
|
32
|
-
headers: {
|
|
33
|
-
...(_a = this.fetchOptions) == null ? void 0 : _a.headers,
|
|
34
|
-
...(_b = params.fetchOptions) == null ? void 0 : _b.headers
|
|
35
|
-
},
|
|
36
|
-
signal: ((_c = params.fetchOptions) == null ? void 0 : _c.signal) || params.signal || ((_d = this.fetchOptions) == null ? void 0 : _d.signal)
|
|
37
|
-
};
|
|
38
|
-
if ((_e = params.fetchOptions) == null ? void 0 : _e.body) {
|
|
39
|
-
return this.queueFetch(url, requestInit);
|
|
40
|
-
} else {
|
|
41
|
-
return this.dedupeFetch(url, requestInit);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
queueFetch(url, requestInit = {}) {
|
|
45
|
-
const hostname = new URL(url).hostname;
|
|
46
|
-
if (!this.queuedFetchJobs[hostname]) {
|
|
47
|
-
this.queuedFetchJobs[hostname] = pLimit.pLimit({
|
|
48
|
-
interval: UNKNOWN_RATE_LIMIT_DELAY
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return this.queuedFetchJobs[hostname](() => this.createFetchJob(url, requestInit));
|
|
52
|
-
}
|
|
53
|
-
dedupeFetch(url, requestInit = {}) {
|
|
54
|
-
let job;
|
|
55
|
-
if (this.dedupedFetchJobs[url] && this.dedupedFetchJobs[url].has(requestInit.signal)) {
|
|
56
|
-
job = this.dedupedFetchJobs[url].get(requestInit.signal);
|
|
57
|
-
} else {
|
|
58
|
-
this.dedupedFetchJobs[url] = this.dedupedFetchJobs[url] || /* @__PURE__ */ new Map();
|
|
59
|
-
job = this.createFetchJob(url, requestInit).finally(() => {
|
|
60
|
-
var _a, _b;
|
|
61
|
-
(_a = this.dedupedFetchJobs[url]) == null ? void 0 : _a.delete(requestInit.signal);
|
|
62
|
-
if (((_b = this.dedupedFetchJobs[url]) == null ? void 0 : _b.size) === 0) {
|
|
63
|
-
delete this.dedupedFetchJobs[url];
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
this.dedupedFetchJobs[url].set(requestInit.signal, job);
|
|
67
|
-
}
|
|
68
|
-
return job;
|
|
69
|
-
}
|
|
70
|
-
createFetchJob(url, requestInit = {}) {
|
|
71
|
-
return this.fetchFn(url, requestInit).then(async (res) => {
|
|
72
|
-
let json = void 0;
|
|
73
|
-
let text = void 0;
|
|
74
|
-
if (res.ok) {
|
|
75
|
-
try {
|
|
76
|
-
json = await res.json();
|
|
77
|
-
} catch {
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
try {
|
|
81
|
-
text = await res.text();
|
|
82
|
-
json = JSON.parse(text);
|
|
83
|
-
} catch {
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
status: res.status,
|
|
88
|
-
headers: res.headers,
|
|
89
|
-
json,
|
|
90
|
-
text
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.BaseClient = BaseClient;
|
|
96
|
-
exports.UNKNOWN_RATE_LIMIT_DELAY = UNKNOWN_RATE_LIMIT_DELAY;
|
|
97
|
-
//# sourceMappingURL=BaseClient.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/BaseClient.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nimport { pLimit } from \"./lib/pLimit.js\";\nimport { PrismicError } from \"./errors/PrismicError.js\";\nconst UNKNOWN_RATE_LIMIT_DELAY = 1500;\nclass BaseClient {\n constructor(options) {\n /**\n * The function used to make network requests to the Prismic REST API. In\n * environments where a global `fetch` function does not exist, such as\n * Node.js, this function must be provided.\n */\n __publicField(this, \"fetchFn\");\n __publicField(this, \"fetchOptions\");\n /**\n * Active queued `fetch()` jobs keyed by URL and AbortSignal (if it exists).\n */\n __publicField(this, \"queuedFetchJobs\", {});\n /**\n * Active deduped `fetch()` jobs keyed by URL and AbortSignal (if it exists).\n */\n __publicField(this, \"dedupedFetchJobs\", {});\n this.fetchOptions = options.fetchOptions;\n if (typeof options.fetch === \"function\") {\n this.fetchFn = options.fetch;\n } else if (typeof globalThis.fetch === \"function\") {\n this.fetchFn = globalThis.fetch;\n } else {\n throw new PrismicError(\"A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.\", void 0, void 0);\n }\n if (this.fetchFn === globalThis.fetch) {\n this.fetchFn = this.fetchFn.bind(globalThis);\n }\n }\n async fetch(url, params = {}) {\n var _a, _b, _c, _d, _e;\n const requestInit = {\n ...this.fetchOptions,\n ...params.fetchOptions,\n headers: {\n ...(_a = this.fetchOptions) == null ? void 0 : _a.headers,\n ...(_b = params.fetchOptions) == null ? void 0 : _b.headers\n },\n signal: ((_c = params.fetchOptions) == null ? void 0 : _c.signal) || params.signal || ((_d = this.fetchOptions) == null ? void 0 : _d.signal)\n };\n if ((_e = params.fetchOptions) == null ? void 0 : _e.body) {\n return this.queueFetch(url, requestInit);\n } else {\n return this.dedupeFetch(url, requestInit);\n }\n }\n queueFetch(url, requestInit = {}) {\n const hostname = new URL(url).hostname;\n if (!this.queuedFetchJobs[hostname]) {\n this.queuedFetchJobs[hostname] = pLimit({\n interval: UNKNOWN_RATE_LIMIT_DELAY\n });\n }\n return this.queuedFetchJobs[hostname](() => this.createFetchJob(url, requestInit));\n }\n dedupeFetch(url, requestInit = {}) {\n let job;\n if (this.dedupedFetchJobs[url] && this.dedupedFetchJobs[url].has(requestInit.signal)) {\n job = this.dedupedFetchJobs[url].get(requestInit.signal);\n } else {\n this.dedupedFetchJobs[url] = this.dedupedFetchJobs[url] || /* @__PURE__ */ new Map();\n job = this.createFetchJob(url, requestInit).finally(() => {\n var _a, _b;\n (_a = this.dedupedFetchJobs[url]) == null ? void 0 : _a.delete(requestInit.signal);\n if (((_b = this.dedupedFetchJobs[url]) == null ? void 0 : _b.size) === 0) {\n delete this.dedupedFetchJobs[url];\n }\n });\n this.dedupedFetchJobs[url].set(requestInit.signal, job);\n }\n return job;\n }\n createFetchJob(url, requestInit = {}) {\n return this.fetchFn(url, requestInit).then(async (res) => {\n let json = void 0;\n let text = void 0;\n if (res.ok) {\n try {\n json = await res.json();\n } catch {\n }\n } else {\n try {\n text = await res.text();\n json = JSON.parse(text);\n } catch {\n }\n }\n return {\n status: res.status,\n headers: res.headers,\n json,\n text\n };\n });\n }\n}\nexport {\n BaseClient,\n UNKNOWN_RATE_LIMIT_DELAY\n};\n//# sourceMappingURL=BaseClient.js.map\n"],"names":["PrismicError","pLimit"],"mappings":";;;;AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAO,CAAA,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU,gBAAgB,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAK,KAAK,KAAK;AAGxG,MAAC,2BAA2B;AACjC,MAAM,WAAW;AAAA,EACf,YAAY,SAAS;AAMnB,kBAAc,MAAM,SAAS;AAC7B,kBAAc,MAAM,cAAc;AAIlC,kBAAc,MAAM,mBAAmB,CAAA,CAAE;AAIzC,kBAAc,MAAM,oBAAoB,CAAA,CAAE;A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
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
const UNKNOWN_RATE_LIMIT_DELAY = 1500;
|
|
7
|
-
class BaseClient {
|
|
8
|
-
constructor(options) {
|
|
9
|
-
__publicField(this, "fetchFn");
|
|
10
|
-
__publicField(this, "fetchOptions");
|
|
11
|
-
__publicField(this, "queuedFetchJobs", {});
|
|
12
|
-
__publicField(this, "dedupedFetchJobs", {});
|
|
13
|
-
this.fetchOptions = options.fetchOptions;
|
|
14
|
-
if (typeof options.fetch === "function") {
|
|
15
|
-
this.fetchFn = options.fetch;
|
|
16
|
-
} else if (typeof globalThis.fetch === "function") {
|
|
17
|
-
this.fetchFn = globalThis.fetch;
|
|
18
|
-
} else {
|
|
19
|
-
throw new PrismicError("A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.", void 0, void 0);
|
|
20
|
-
}
|
|
21
|
-
if (this.fetchFn === globalThis.fetch) {
|
|
22
|
-
this.fetchFn = this.fetchFn.bind(globalThis);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async fetch(url, params = {}) {
|
|
26
|
-
var _a, _b, _c, _d, _e;
|
|
27
|
-
const requestInit = {
|
|
28
|
-
...this.fetchOptions,
|
|
29
|
-
...params.fetchOptions,
|
|
30
|
-
headers: {
|
|
31
|
-
...(_a = this.fetchOptions) == null ? void 0 : _a.headers,
|
|
32
|
-
...(_b = params.fetchOptions) == null ? void 0 : _b.headers
|
|
33
|
-
},
|
|
34
|
-
signal: ((_c = params.fetchOptions) == null ? void 0 : _c.signal) || params.signal || ((_d = this.fetchOptions) == null ? void 0 : _d.signal)
|
|
35
|
-
};
|
|
36
|
-
if ((_e = params.fetchOptions) == null ? void 0 : _e.body) {
|
|
37
|
-
return this.queueFetch(url, requestInit);
|
|
38
|
-
} else {
|
|
39
|
-
return this.dedupeFetch(url, requestInit);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
queueFetch(url, requestInit = {}) {
|
|
43
|
-
const hostname = new URL(url).hostname;
|
|
44
|
-
if (!this.queuedFetchJobs[hostname]) {
|
|
45
|
-
this.queuedFetchJobs[hostname] = pLimit({
|
|
46
|
-
interval: UNKNOWN_RATE_LIMIT_DELAY
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return this.queuedFetchJobs[hostname](() => this.createFetchJob(url, requestInit));
|
|
50
|
-
}
|
|
51
|
-
dedupeFetch(url, requestInit = {}) {
|
|
52
|
-
let job;
|
|
53
|
-
if (this.dedupedFetchJobs[url] && this.dedupedFetchJobs[url].has(requestInit.signal)) {
|
|
54
|
-
job = this.dedupedFetchJobs[url].get(requestInit.signal);
|
|
55
|
-
} else {
|
|
56
|
-
this.dedupedFetchJobs[url] = this.dedupedFetchJobs[url] || /* @__PURE__ */ new Map();
|
|
57
|
-
job = this.createFetchJob(url, requestInit).finally(() => {
|
|
58
|
-
var _a, _b;
|
|
59
|
-
(_a = this.dedupedFetchJobs[url]) == null ? void 0 : _a.delete(requestInit.signal);
|
|
60
|
-
if (((_b = this.dedupedFetchJobs[url]) == null ? void 0 : _b.size) === 0) {
|
|
61
|
-
delete this.dedupedFetchJobs[url];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
this.dedupedFetchJobs[url].set(requestInit.signal, job);
|
|
65
|
-
}
|
|
66
|
-
return job;
|
|
67
|
-
}
|
|
68
|
-
createFetchJob(url, requestInit = {}) {
|
|
69
|
-
return this.fetchFn(url, requestInit).then(async (res) => {
|
|
70
|
-
let json = void 0;
|
|
71
|
-
let text = void 0;
|
|
72
|
-
if (res.ok) {
|
|
73
|
-
try {
|
|
74
|
-
json = await res.json();
|
|
75
|
-
} catch {
|
|
76
|
-
}
|
|
77
|
-
} else {
|
|
78
|
-
try {
|
|
79
|
-
text = await res.text();
|
|
80
|
-
json = JSON.parse(text);
|
|
81
|
-
} catch {
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
status: res.status,
|
|
86
|
-
headers: res.headers,
|
|
87
|
-
json,
|
|
88
|
-
text
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
export {
|
|
94
|
-
BaseClient,
|
|
95
|
-
UNKNOWN_RATE_LIMIT_DELAY
|
|
96
|
-
};
|
|
97
|
-
//# sourceMappingURL=BaseClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.js","sources":["../../../../../node_modules/@prismicio/client/dist/BaseClient.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nimport { pLimit } from \"./lib/pLimit.js\";\nimport { PrismicError } from \"./errors/PrismicError.js\";\nconst UNKNOWN_RATE_LIMIT_DELAY = 1500;\nclass BaseClient {\n constructor(options) {\n /**\n * The function used to make network requests to the Prismic REST API. In\n * environments where a global `fetch` function does not exist, such as\n * Node.js, this function must be provided.\n */\n __publicField(this, \"fetchFn\");\n __publicField(this, \"fetchOptions\");\n /**\n * Active queued `fetch()` jobs keyed by URL and AbortSignal (if it exists).\n */\n __publicField(this, \"queuedFetchJobs\", {});\n /**\n * Active deduped `fetch()` jobs keyed by URL and AbortSignal (if it exists).\n */\n __publicField(this, \"dedupedFetchJobs\", {});\n this.fetchOptions = options.fetchOptions;\n if (typeof options.fetch === \"function\") {\n this.fetchFn = options.fetch;\n } else if (typeof globalThis.fetch === \"function\") {\n this.fetchFn = globalThis.fetch;\n } else {\n throw new PrismicError(\"A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.\", void 0, void 0);\n }\n if (this.fetchFn === globalThis.fetch) {\n this.fetchFn = this.fetchFn.bind(globalThis);\n }\n }\n async fetch(url, params = {}) {\n var _a, _b, _c, _d, _e;\n const requestInit = {\n ...this.fetchOptions,\n ...params.fetchOptions,\n headers: {\n ...(_a = this.fetchOptions) == null ? void 0 : _a.headers,\n ...(_b = params.fetchOptions) == null ? void 0 : _b.headers\n },\n signal: ((_c = params.fetchOptions) == null ? void 0 : _c.signal) || params.signal || ((_d = this.fetchOptions) == null ? void 0 : _d.signal)\n };\n if ((_e = params.fetchOptions) == null ? void 0 : _e.body) {\n return this.queueFetch(url, requestInit);\n } else {\n return this.dedupeFetch(url, requestInit);\n }\n }\n queueFetch(url, requestInit = {}) {\n const hostname = new URL(url).hostname;\n if (!this.queuedFetchJobs[hostname]) {\n this.queuedFetchJobs[hostname] = pLimit({\n interval: UNKNOWN_RATE_LIMIT_DELAY\n });\n }\n return this.queuedFetchJobs[hostname](() => this.createFetchJob(url, requestInit));\n }\n dedupeFetch(url, requestInit = {}) {\n let job;\n if (this.dedupedFetchJobs[url] && this.dedupedFetchJobs[url].has(requestInit.signal)) {\n job = this.dedupedFetchJobs[url].get(requestInit.signal);\n } else {\n this.dedupedFetchJobs[url] = this.dedupedFetchJobs[url] || /* @__PURE__ */ new Map();\n job = this.createFetchJob(url, requestInit).finally(() => {\n var _a, _b;\n (_a = this.dedupedFetchJobs[url]) == null ? void 0 : _a.delete(requestInit.signal);\n if (((_b = this.dedupedFetchJobs[url]) == null ? void 0 : _b.size) === 0) {\n delete this.dedupedFetchJobs[url];\n }\n });\n this.dedupedFetchJobs[url].set(requestInit.signal, job);\n }\n return job;\n }\n createFetchJob(url, requestInit = {}) {\n return this.fetchFn(url, requestInit).then(async (res) => {\n let json = void 0;\n let text = void 0;\n if (res.ok) {\n try {\n json = await res.json();\n } catch {\n }\n } else {\n try {\n text = await res.text();\n json = JSON.parse(text);\n } catch {\n }\n }\n return {\n status: res.status,\n headers: res.headers,\n json,\n text\n };\n });\n }\n}\nexport {\n BaseClient,\n UNKNOWN_RATE_LIMIT_DELAY\n};\n//# sourceMappingURL=BaseClient.js.map\n"],"names":[],"mappings":";;AAAA,IAAI,YAAY,OAAO;AACvB,IAAI,kBAAkB,CAAC,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK,EAAE,YAAY,MAAM,cAAc,MAAM,UAAU,MAAM,MAAO,CAAA,IAAI,IAAI,GAAG,IAAI;AAC1J,IAAI,gBAAgB,CAAC,KAAK,KAAK,UAAU,gBAAgB,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAK,KAAK,KAAK;AAGxG,MAAC,2BAA2B;AACjC,MAAM,WAAW;AAAA,EACf,YAAY,SAAS;AAMnB,kBAAc,MAAM,SAAS;AAC7B,kBAAc,MAAM,cAAc;AAIlC,kBAAc,MAAM,mBAAmB,CAAA,CAAE;AAIzC,kBAAc,MAAM,oBAAoB,CAAA,CAAE;AAC1C,SAAK,eAAe,QAAQ;AAC5B,QAAI,OAAO,QAAQ,UAAU,YAAY;AACvC,WAAK,UAAU,QAAQ;AAAA,IACxB,WAAU,OAAO,WAAW,UAAU,YAAY;AACjD,WAAK,UAAU,WAAW;AAAA,IAChC,OAAW;AACL,YAAM,IAAI,aAAa,kMAAkM,QAAQ,MAAM;AAAA,IACxO;AACD,QAAI,KAAK,YAAY,WAAW,OAAO;AACrC,WAAK,UAAU,KAAK,QAAQ,KAAK,UAAU;AAAA,IAC5C;AAAA,EACF;AAAA,EACD,MAAM,MAAM,KAAK,SAAS,IAAI;AAC5B,QAAI,IAAI,IAAI,IAAI,IAAI;AACpB,UAAM,cAAc;AAAA,MAClB,GAAG,KAAK;AAAA,MACR,GAAG,OAAO;AAAA,MACV,SAAS;AAAA,QACP,IAAI,KAAK,KAAK,iBAAiB,OAAO,SAAS,GAAG;AAAA,QAClD,IAAI,KAAK,OAAO,iBAAiB,OA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