prismic-ts-codegen 0.1.13 → 0.1.15
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/buildQueryURL.cjs +59 -0
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js +59 -0
- package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/cookie.cjs +5 -0
- package/dist/_node_modules/@prismicio/client/dist/cookie.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/cookie.js +5 -0
- package/dist/_node_modules/@prismicio/client/dist/cookie.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/createClient.cjs +1138 -0
- package/dist/_node_modules/@prismicio/client/dist/createClient.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/createClient.js +1138 -0
- package/dist/_node_modules/@prismicio/client/dist/createClient.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs +19 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js +19 -0
- package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/filter.cjs +247 -0
- package/dist/_node_modules/@prismicio/client/dist/filter.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/filter.js +247 -0
- package/dist/_node_modules/@prismicio/client/dist/filter.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs +13 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js +13 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs +12 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js +12 -0
- package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs +47 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js +47 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs +26 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js +26 -0
- package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs +12 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js +12 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs +11 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js +11 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs +9 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js +9 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs +12 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js +12 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs +21 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js +21 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs +7 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js +7 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs +9 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js +9 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js +8 -0
- package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs +5 -0
- package/dist/_node_modules/@prismicio/client/dist/package.json.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/package.json.js +5 -0
- package/dist/_node_modules/@prismicio/client/dist/package.json.js.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs +10 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs.map +1 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.js +10 -0
- package/dist/_node_modules/@prismicio/client/dist/types/value/link.js.map +1 -0
- package/dist/cli/loadLocaleIDs.cjs +2 -19
- package/dist/cli/loadLocaleIDs.cjs.map +1 -1
- package/dist/cli/loadLocaleIDs.js +2 -2
- package/dist/cli/loadLocaleIDs.js.map +1 -1
- package/dist/lib/buildCustomTypeDataType.cjs.map +1 -1
- package/dist/lib/buildCustomTypeDataType.d.ts +1 -1
- package/dist/lib/buildCustomTypeDataType.js.map +1 -1
- package/dist/lib/buildCustomTypeType.cjs.map +1 -1
- package/dist/lib/buildCustomTypeType.d.ts +1 -1
- package/dist/lib/buildCustomTypeType.js.map +1 -1
- package/dist/lib/buildFieldDocs.cjs.map +1 -1
- package/dist/lib/buildFieldDocs.d.ts +1 -1
- package/dist/lib/buildFieldDocs.js.map +1 -1
- package/dist/lib/buildFieldProperties.cjs +18 -19
- package/dist/lib/buildFieldProperties.cjs.map +1 -1
- package/dist/lib/buildFieldProperties.d.ts +1 -1
- package/dist/lib/buildFieldProperties.js +18 -19
- package/dist/lib/buildFieldProperties.js.map +1 -1
- package/dist/lib/buildSharedSliceType.cjs.map +1 -1
- package/dist/lib/buildSharedSliceType.d.ts +1 -1
- package/dist/lib/buildSharedSliceType.js.map +1 -1
- package/dist/lib/buildUnion.cjs +1 -1
- package/dist/lib/buildUnion.cjs.map +1 -1
- package/dist/lib/buildUnion.js +1 -1
- package/dist/lib/buildUnion.js.map +1 -1
- package/dist/lib/checkHasUIDFIeld.cjs.map +1 -1
- package/dist/lib/checkHasUIDFIeld.d.ts +1 -1
- package/dist/lib/checkHasUIDFIeld.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/buildCustomTypeDataType.ts +1 -1
- package/src/lib/buildCustomTypeType.ts +1 -1
- package/src/lib/buildFieldDocs.ts +1 -1
- package/src/lib/buildFieldProperties.ts +19 -23
- package/src/lib/buildSharedSliceType.ts +1 -1
- package/src/lib/buildUnion.ts +1 -1
- package/src/lib/checkHasUIDFIeld.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castArray.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/castArray.js"],"sourcesContent":["const castArray = (a) => {\n return Array.isArray(a) ? a : [a];\n};\nexport {\n castArray\n};\n//# sourceMappingURL=castArray.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,YAAY,CAAC,MAAM;AACvB,SAAO,MAAM,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC;AAClC;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castArray.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/castArray.js"],"sourcesContent":["const castArray = (a) => {\n return Array.isArray(a) ? a : [a];\n};\nexport {\n castArray\n};\n//# sourceMappingURL=castArray.js.map\n"],"names":[],"mappings":"AAAK,MAAC,YAAY,CAAC,MAAM;AACvB,SAAO,MAAM,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC;AAClC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castThunk.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/castThunk.js"],"sourcesContent":["const castThunk = (a) => {\n return typeof a === \"function\" ? a : () => a;\n};\nexport {\n castThunk\n};\n//# sourceMappingURL=castThunk.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,YAAY,CAAC,MAAM;AACvB,SAAO,OAAO,MAAM,aAAa,IAAI,MAAM;AAC7C;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"castThunk.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/castThunk.js"],"sourcesContent":["const castThunk = (a) => {\n return typeof a === \"function\" ? a : () => a;\n};\nexport {\n castThunk\n};\n//# sourceMappingURL=castThunk.js.map\n"],"names":[],"mappings":"AAAK,MAAC,YAAY,CAAC,MAAM;AACvB,SAAO,OAAO,MAAM,aAAa,IAAI,MAAM;AAC7C;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const package_json = require("../package.json.cjs");
|
|
4
|
+
const devMsg = (slug) => {
|
|
5
|
+
return `https://prismic.dev/msg/client/v${package_json.version}/${slug}`;
|
|
6
|
+
};
|
|
7
|
+
exports.devMsg = devMsg;
|
|
8
|
+
//# sourceMappingURL=devMsg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devMsg.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/devMsg.js"],"sourcesContent":["import { version } from \"../package.json.js\";\nconst devMsg = (slug) => {\n return `https://prismic.dev/msg/client/v${version}/${slug}`;\n};\nexport {\n devMsg\n};\n//# sourceMappingURL=devMsg.js.map\n"],"names":["version"],"mappings":";;;AACK,MAAC,SAAS,CAAC,SAAS;AACvB,SAAO,mCAAmCA,aAAAA,WAAW;AACvD;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devMsg.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/devMsg.js"],"sourcesContent":["import { version } from \"../package.json.js\";\nconst devMsg = (slug) => {\n return `https://prismic.dev/msg/client/v${version}/${slug}`;\n};\nexport {\n devMsg\n};\n//# sourceMappingURL=devMsg.js.map\n"],"names":[],"mappings":";AACK,MAAC,SAAS,CAAC,SAAS;AACvB,SAAO,mCAAmC,WAAW;AACvD;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const filter = require("../filter.cjs");
|
|
4
|
+
const castArray = require("./castArray.cjs");
|
|
5
|
+
const everyTagFilter = (tags) => {
|
|
6
|
+
return filter.filter.at("document.tags", castArray.castArray(tags));
|
|
7
|
+
};
|
|
8
|
+
exports.everyTagFilter = everyTagFilter;
|
|
9
|
+
//# sourceMappingURL=everyTagFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"everyTagFilter.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/everyTagFilter.js"],"sourcesContent":["import { filter } from \"../filter.js\";\nimport { castArray } from \"./castArray.js\";\nconst everyTagFilter = (tags) => {\n return filter.at(\"document.tags\", castArray(tags));\n};\nexport {\n everyTagFilter\n};\n//# sourceMappingURL=everyTagFilter.js.map\n"],"names":["filter","castArray"],"mappings":";;;;AAEK,MAAC,iBAAiB,CAAC,SAAS;AAC/B,SAAOA,OAAAA,OAAO,GAAG,iBAAiBC,UAAAA,UAAU,IAAI,CAAC;AACnD;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"everyTagFilter.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/everyTagFilter.js"],"sourcesContent":["import { filter } from \"../filter.js\";\nimport { castArray } from \"./castArray.js\";\nconst everyTagFilter = (tags) => {\n return filter.at(\"document.tags\", castArray(tags));\n};\nexport {\n everyTagFilter\n};\n//# sourceMappingURL=everyTagFilter.js.map\n"],"names":[],"mappings":";;AAEK,MAAC,iBAAiB,CAAC,SAAS;AAC/B,SAAO,OAAO,GAAG,iBAAiB,UAAU,IAAI,CAAC;AACnD;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const findRef = require("./findRef.cjs");
|
|
4
|
+
const findMasterRef = (refs) => {
|
|
5
|
+
return findRef.findRef(refs, (ref) => ref.isMasterRef);
|
|
6
|
+
};
|
|
7
|
+
exports.findMasterRef = findMasterRef;
|
|
8
|
+
//# sourceMappingURL=findMasterRef.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findMasterRef.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findMasterRef.js"],"sourcesContent":["import { findRef } from \"./findRef.js\";\nconst findMasterRef = (refs) => {\n return findRef(refs, (ref) => ref.isMasterRef);\n};\nexport {\n findMasterRef\n};\n//# sourceMappingURL=findMasterRef.js.map\n"],"names":["findRef"],"mappings":";;;AACK,MAAC,gBAAgB,CAAC,SAAS;AAC9B,SAAOA,QAAAA,QAAQ,MAAM,CAAC,QAAQ,IAAI,WAAW;AAC/C;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findMasterRef.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findMasterRef.js"],"sourcesContent":["import { findRef } from \"./findRef.js\";\nconst findMasterRef = (refs) => {\n return findRef(refs, (ref) => ref.isMasterRef);\n};\nexport {\n findMasterRef\n};\n//# sourceMappingURL=findMasterRef.js.map\n"],"names":[],"mappings":";AACK,MAAC,gBAAgB,CAAC,SAAS;AAC9B,SAAO,QAAQ,MAAM,CAAC,QAAQ,IAAI,WAAW;AAC/C;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const PrismicError = require("../errors/PrismicError.cjs");
|
|
4
|
+
const findRef = (refs, filter) => {
|
|
5
|
+
const ref = refs.find((ref2) => filter(ref2));
|
|
6
|
+
if (!ref) {
|
|
7
|
+
throw new PrismicError.PrismicError("Ref could not be found.", void 0, void 0);
|
|
8
|
+
}
|
|
9
|
+
return ref;
|
|
10
|
+
};
|
|
11
|
+
exports.findRef = findRef;
|
|
12
|
+
//# sourceMappingURL=findRef.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRef.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findRef.js"],"sourcesContent":["import { PrismicError } from \"../errors/PrismicError.js\";\nconst findRef = (refs, filter) => {\n const ref = refs.find((ref2) => filter(ref2));\n if (!ref) {\n throw new PrismicError(\"Ref could not be found.\", void 0, void 0);\n }\n return ref;\n};\nexport {\n findRef\n};\n//# sourceMappingURL=findRef.js.map\n"],"names":["PrismicError"],"mappings":";;;AACK,MAAC,UAAU,CAAC,MAAM,WAAW;AAChC,QAAM,MAAM,KAAK,KAAK,CAAC,SAAS,OAAO,IAAI,CAAC;AAC5C,MAAI,CAAC,KAAK;AACR,UAAM,IAAIA,aAAY,aAAC,2BAA2B,QAAQ,MAAM;AAAA,EACjE;AACD,SAAO;AACT;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PrismicError } from "../errors/PrismicError.js";
|
|
2
|
+
const findRef = (refs, filter) => {
|
|
3
|
+
const ref = refs.find((ref2) => filter(ref2));
|
|
4
|
+
if (!ref) {
|
|
5
|
+
throw new PrismicError("Ref could not be found.", void 0, void 0);
|
|
6
|
+
}
|
|
7
|
+
return ref;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
findRef
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=findRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRef.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findRef.js"],"sourcesContent":["import { PrismicError } from \"../errors/PrismicError.js\";\nconst findRef = (refs, filter) => {\n const ref = refs.find((ref2) => filter(ref2));\n if (!ref) {\n throw new PrismicError(\"Ref could not be found.\", void 0, void 0);\n }\n return ref;\n};\nexport {\n findRef\n};\n//# sourceMappingURL=findRef.js.map\n"],"names":[],"mappings":";AACK,MAAC,UAAU,CAAC,MAAM,WAAW;AAChC,QAAM,MAAM,KAAK,KAAK,CAAC,SAAS,OAAO,IAAI,CAAC;AAC5C,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,aAAa,2BAA2B,QAAQ,MAAM;AAAA,EACjE;AACD,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const findRef = require("./findRef.cjs");
|
|
4
|
+
const findRefByID = (refs, id) => {
|
|
5
|
+
return findRef.findRef(refs, (ref) => ref.id === id);
|
|
6
|
+
};
|
|
7
|
+
exports.findRefByID = findRefByID;
|
|
8
|
+
//# sourceMappingURL=findRefByID.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRefByID.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findRefByID.js"],"sourcesContent":["import { findRef } from \"./findRef.js\";\nconst findRefByID = (refs, id) => {\n return findRef(refs, (ref) => ref.id === id);\n};\nexport {\n findRefByID\n};\n//# sourceMappingURL=findRefByID.js.map\n"],"names":["findRef"],"mappings":";;;AACK,MAAC,cAAc,CAAC,MAAM,OAAO;AAChC,SAAOA,QAAAA,QAAQ,MAAM,CAAC,QAAQ,IAAI,OAAO,EAAE;AAC7C;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRefByID.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findRefByID.js"],"sourcesContent":["import { findRef } from \"./findRef.js\";\nconst findRefByID = (refs, id) => {\n return findRef(refs, (ref) => ref.id === id);\n};\nexport {\n findRefByID\n};\n//# sourceMappingURL=findRefByID.js.map\n"],"names":[],"mappings":";AACK,MAAC,cAAc,CAAC,MAAM,OAAO;AAChC,SAAO,QAAQ,MAAM,CAAC,QAAQ,IAAI,OAAO,EAAE;AAC7C;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const findRef = require("./findRef.cjs");
|
|
4
|
+
const findRefByLabel = (refs, label) => {
|
|
5
|
+
return findRef.findRef(refs, (ref) => ref.label === label);
|
|
6
|
+
};
|
|
7
|
+
exports.findRefByLabel = findRefByLabel;
|
|
8
|
+
//# sourceMappingURL=findRefByLabel.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRefByLabel.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findRefByLabel.js"],"sourcesContent":["import { findRef } from \"./findRef.js\";\nconst findRefByLabel = (refs, label) => {\n return findRef(refs, (ref) => ref.label === label);\n};\nexport {\n findRefByLabel\n};\n//# sourceMappingURL=findRefByLabel.js.map\n"],"names":["findRef"],"mappings":";;;AACK,MAAC,iBAAiB,CAAC,MAAM,UAAU;AACtC,SAAOA,QAAAA,QAAQ,MAAM,CAAC,QAAQ,IAAI,UAAU,KAAK;AACnD;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRefByLabel.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/findRefByLabel.js"],"sourcesContent":["import { findRef } from \"./findRef.js\";\nconst findRefByLabel = (refs, label) => {\n return findRef(refs, (ref) => ref.label === label);\n};\nexport {\n findRefByLabel\n};\n//# sourceMappingURL=findRefByLabel.js.map\n"],"names":[],"mappings":";AACK,MAAC,iBAAiB,CAAC,MAAM,UAAU;AACtC,SAAO,QAAQ,MAAM,CAAC,QAAQ,IAAI,UAAU,KAAK;AACnD;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cookie = require("../cookie.cjs");
|
|
4
|
+
const readValue = (value) => {
|
|
5
|
+
return value.replace(/%3B/g, ";");
|
|
6
|
+
};
|
|
7
|
+
const getPreviewCookie = (cookieJar) => {
|
|
8
|
+
const cookies = cookieJar.split("; ");
|
|
9
|
+
let value;
|
|
10
|
+
for (const cookie$1 of cookies) {
|
|
11
|
+
const parts = cookie$1.split("=");
|
|
12
|
+
const name = readValue(parts[0]).replace(/%3D/g, "=");
|
|
13
|
+
if (name === cookie.preview) {
|
|
14
|
+
value = readValue(parts.slice(1).join("="));
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
exports.getPreviewCookie = getPreviewCookie;
|
|
21
|
+
//# sourceMappingURL=getPreviewCookie.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPreviewCookie.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/getPreviewCookie.js"],"sourcesContent":["import { preview } from \"../cookie.js\";\nconst readValue = (value) => {\n return value.replace(/%3B/g, \";\");\n};\nconst getPreviewCookie = (cookieJar) => {\n const cookies = cookieJar.split(\"; \");\n let value;\n for (const cookie of cookies) {\n const parts = cookie.split(\"=\");\n const name = readValue(parts[0]).replace(/%3D/g, \"=\");\n if (name === preview) {\n value = readValue(parts.slice(1).join(\"=\"));\n break;\n }\n }\n return value;\n};\nexport {\n getPreviewCookie\n};\n//# sourceMappingURL=getPreviewCookie.js.map\n"],"names":["cookie","preview"],"mappings":";;;AACA,MAAM,YAAY,CAAC,UAAU;AAC3B,SAAO,MAAM,QAAQ,QAAQ,GAAG;AAClC;AACK,MAAC,mBAAmB,CAAC,cAAc;AACtC,QAAM,UAAU,UAAU,MAAM,IAAI;AACpC,MAAI;AACJ,aAAWA,YAAU,SAAS;AAC5B,UAAM,QAAQA,SAAO,MAAM,GAAG;AAC9B,UAAM,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,QAAQ,QAAQ,GAAG;AACpD,QAAI,SAASC,OAAAA,SAAS;AACpB,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACD;AAAA,EACF;AACD,SAAO;AACT;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { preview } from "../cookie.js";
|
|
2
|
+
const readValue = (value) => {
|
|
3
|
+
return value.replace(/%3B/g, ";");
|
|
4
|
+
};
|
|
5
|
+
const getPreviewCookie = (cookieJar) => {
|
|
6
|
+
const cookies = cookieJar.split("; ");
|
|
7
|
+
let value;
|
|
8
|
+
for (const cookie of cookies) {
|
|
9
|
+
const parts = cookie.split("=");
|
|
10
|
+
const name = readValue(parts[0]).replace(/%3D/g, "=");
|
|
11
|
+
if (name === preview) {
|
|
12
|
+
value = readValue(parts.slice(1).join("="));
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
getPreviewCookie
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=getPreviewCookie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPreviewCookie.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/getPreviewCookie.js"],"sourcesContent":["import { preview } from \"../cookie.js\";\nconst readValue = (value) => {\n return value.replace(/%3B/g, \";\");\n};\nconst getPreviewCookie = (cookieJar) => {\n const cookies = cookieJar.split(\"; \");\n let value;\n for (const cookie of cookies) {\n const parts = cookie.split(\"=\");\n const name = readValue(parts[0]).replace(/%3D/g, \"=\");\n if (name === preview) {\n value = readValue(parts.slice(1).join(\"=\"));\n break;\n }\n }\n return value;\n};\nexport {\n getPreviewCookie\n};\n//# sourceMappingURL=getPreviewCookie.js.map\n"],"names":[],"mappings":";AACA,MAAM,YAAY,CAAC,UAAU;AAC3B,SAAO,MAAM,QAAQ,QAAQ,GAAG;AAClC;AACK,MAAC,mBAAmB,CAAC,cAAc;AACtC,QAAM,UAAU,UAAU,MAAM,IAAI;AACpC,MAAI;AACJ,aAAW,UAAU,SAAS;AAC5B,UAAM,QAAQ,OAAO,MAAM,GAAG;AAC9B,UAAM,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,QAAQ,QAAQ,GAAG;AACpD,QAAI,SAAS,SAAS;AACpB,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACD;AAAA,EACF;AACD,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const minifyGraphQLQuery = (query) => {
|
|
4
|
+
return query.replace(/(\n| )*( |{|})(\n| )*/gm, (_chars, _spaces, brackets) => brackets);
|
|
5
|
+
};
|
|
6
|
+
exports.minifyGraphQLQuery = minifyGraphQLQuery;
|
|
7
|
+
//# sourceMappingURL=minifyGraphQLQuery.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minifyGraphQLQuery.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js"],"sourcesContent":["const minifyGraphQLQuery = (query) => {\n return query.replace(/(\\n| )*( |{|})(\\n| )*/gm, (_chars, _spaces, brackets) => brackets);\n};\nexport {\n minifyGraphQLQuery\n};\n//# sourceMappingURL=minifyGraphQLQuery.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,qBAAqB,CAAC,UAAU;AACpC,SAAO,MAAM,QAAQ,2BAA2B,CAAC,QAAQ,SAAS,aAAa,QAAQ;AACzF;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minifyGraphQLQuery.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js"],"sourcesContent":["const minifyGraphQLQuery = (query) => {\n return query.replace(/(\\n| )*( |{|})(\\n| )*/gm, (_chars, _spaces, brackets) => brackets);\n};\nexport {\n minifyGraphQLQuery\n};\n//# sourceMappingURL=minifyGraphQLQuery.js.map\n"],"names":[],"mappings":"AAAK,MAAC,qBAAqB,CAAC,UAAU;AACpC,SAAO,MAAM,QAAQ,2BAA2B,CAAC,QAAQ,SAAS,aAAa,QAAQ;AACzF;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const filter = require("../filter.cjs");
|
|
4
|
+
const castArray = require("./castArray.cjs");
|
|
5
|
+
const someTagsFilter = (tags) => {
|
|
6
|
+
return filter.filter.any("document.tags", castArray.castArray(tags));
|
|
7
|
+
};
|
|
8
|
+
exports.someTagsFilter = someTagsFilter;
|
|
9
|
+
//# sourceMappingURL=someTagsFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"someTagsFilter.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/someTagsFilter.js"],"sourcesContent":["import { filter } from \"../filter.js\";\nimport { castArray } from \"./castArray.js\";\nconst someTagsFilter = (tags) => {\n return filter.any(\"document.tags\", castArray(tags));\n};\nexport {\n someTagsFilter\n};\n//# sourceMappingURL=someTagsFilter.js.map\n"],"names":["filter","castArray"],"mappings":";;;;AAEK,MAAC,iBAAiB,CAAC,SAAS;AAC/B,SAAOA,OAAAA,OAAO,IAAI,iBAAiBC,UAAAA,UAAU,IAAI,CAAC;AACpD;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"someTagsFilter.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/someTagsFilter.js"],"sourcesContent":["import { filter } from \"../filter.js\";\nimport { castArray } from \"./castArray.js\";\nconst someTagsFilter = (tags) => {\n return filter.any(\"document.tags\", castArray(tags));\n};\nexport {\n someTagsFilter\n};\n//# sourceMappingURL=someTagsFilter.js.map\n"],"names":[],"mappings":";;AAEK,MAAC,iBAAiB,CAAC,SAAS;AAC/B,SAAO,OAAO,IAAI,iBAAiB,UAAU,IAAI,CAAC;AACpD;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const filter = require("../filter.cjs");
|
|
4
|
+
const typeFilter = (documentType) => {
|
|
5
|
+
return filter.filter.at("document.type", documentType);
|
|
6
|
+
};
|
|
7
|
+
exports.typeFilter = typeFilter;
|
|
8
|
+
//# sourceMappingURL=typeFilter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeFilter.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/typeFilter.js"],"sourcesContent":["import { filter } from \"../filter.js\";\nconst typeFilter = (documentType) => {\n return filter.at(\"document.type\", documentType);\n};\nexport {\n typeFilter\n};\n//# sourceMappingURL=typeFilter.js.map\n"],"names":["filter"],"mappings":";;;AACK,MAAC,aAAa,CAAC,iBAAiB;AACnC,SAAOA,cAAO,GAAG,iBAAiB,YAAY;AAChD;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeFilter.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/typeFilter.js"],"sourcesContent":["import { filter } from \"../filter.js\";\nconst typeFilter = (documentType) => {\n return filter.at(\"document.type\", documentType);\n};\nexport {\n typeFilter\n};\n//# sourceMappingURL=typeFilter.js.map\n"],"names":[],"mappings":";AACK,MAAC,aAAa,CAAC,iBAAiB;AACnC,SAAO,OAAO,GAAG,iBAAiB,YAAY;AAChD;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/package.json.js"],"sourcesContent":["const version = \"7.1.0\";\nexport {\n version\n};\n//# sourceMappingURL=package.json.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,UAAU;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":["../../../../../node_modules/@prismicio/client/dist/package.json.js"],"sourcesContent":["const version = \"7.1.0\";\nexport {\n version\n};\n//# sourceMappingURL=package.json.js.map\n"],"names":[],"mappings":"AAAK,MAAC,UAAU;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.cjs","sources":["../../../../../../../node_modules/@prismicio/client/dist/types/value/link.js"],"sourcesContent":["const LinkType = {\n Any: \"Any\",\n Document: \"Document\",\n Media: \"Media\",\n Web: \"Web\"\n};\nexport {\n LinkType\n};\n//# sourceMappingURL=link.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,WAAW;AAAA,EACf,KAAK;AAAA,EACL,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AACP;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sources":["../../../../../../../node_modules/@prismicio/client/dist/types/value/link.js"],"sourcesContent":["const LinkType = {\n Any: \"Any\",\n Document: \"Document\",\n Media: \"Media\",\n Web: \"Web\"\n};\nexport {\n LinkType\n};\n//# sourceMappingURL=link.js.map\n"],"names":[],"mappings":"AAAK,MAAC,WAAW;AAAA,EACf,KAAK;AAAA,EACL,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AACP;","x_google_ignoreList":[0]}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const prismic = require("@prismicio/client");
|
|
4
3
|
const fetch = require("node-fetch");
|
|
5
|
-
|
|
6
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
-
if (e) {
|
|
8
|
-
for (const k in e) {
|
|
9
|
-
if (k !== "default") {
|
|
10
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: () => e[k]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
n.default = e;
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
const prismic__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismic);
|
|
4
|
+
const createClient = require('./../_node_modules/@prismicio/client/dist/createClient.cjs');
|
|
22
5
|
const loadLocaleIDs = async (config) => {
|
|
23
6
|
const localeIDs = new Set(config.localeIDs || []);
|
|
24
7
|
if ("repositoryName" in config && config.fetchFromRepository) {
|
|
25
|
-
const client =
|
|
8
|
+
const client = createClient.createClient(config.repositoryName, {
|
|
26
9
|
accessToken: config.accessToken,
|
|
27
10
|
fetch
|
|
28
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadLocaleIDs.cjs","sources":["../../../src/cli/loadLocaleIDs.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\nimport fetch from \"node-fetch\";\n\ntype LoadLocalesConfig =\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t }\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t\t\trepositoryName: string;\n\t\t\taccessToken: string;\n\t\t\tfetchFromRepository?: boolean;\n\t };\n\nexport const loadLocaleIDs = async (\n\tconfig: LoadLocalesConfig,\n): Promise<string[]> => {\n\tconst localeIDs = new Set<string>(config.localeIDs || []);\n\n\tif (\"repositoryName\" in config && config.fetchFromRepository) {\n\t\tconst client = prismic.createClient(config.repositoryName, {\n\t\t\taccessToken: config.accessToken,\n\t\t\tfetch,\n\t\t});\n\n\t\tconst repository = await client.getRepository();\n\n\t\tfor (const language of repository.languages) {\n\t\t\tlocaleIDs.add(language.id);\n\t\t}\n\t}\n\n\treturn [...localeIDs];\n};\n"],"names":["prismic"],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadLocaleIDs.cjs","sources":["../../../src/cli/loadLocaleIDs.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\nimport fetch from \"node-fetch\";\n\ntype LoadLocalesConfig =\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t }\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t\t\trepositoryName: string;\n\t\t\taccessToken: string;\n\t\t\tfetchFromRepository?: boolean;\n\t };\n\nexport const loadLocaleIDs = async (\n\tconfig: LoadLocalesConfig,\n): Promise<string[]> => {\n\tconst localeIDs = new Set<string>(config.localeIDs || []);\n\n\tif (\"repositoryName\" in config && config.fetchFromRepository) {\n\t\tconst client = prismic.createClient(config.repositoryName, {\n\t\t\taccessToken: config.accessToken,\n\t\t\tfetch,\n\t\t});\n\n\t\tconst repository = await client.getRepository();\n\n\t\tfor (const language of repository.languages) {\n\t\t\tlocaleIDs.add(language.id);\n\t\t}\n\t}\n\n\treturn [...localeIDs];\n};\n"],"names":["prismic.createClient"],"mappings":";;;;AAca,MAAA,gBAAgB,OAC5B,WACsB;AACtB,QAAM,YAAY,IAAI,IAAY,OAAO,aAAa,CAAE,CAAA;AAEpD,MAAA,oBAAoB,UAAU,OAAO,qBAAqB;AAC7D,UAAM,SAASA,aAAAA,aAAqB,OAAO,gBAAgB;AAAA,MAC1D,aAAa,OAAO;AAAA,MACpB;AAAA,IAAA,CACA;AAEK,UAAA,aAAa,MAAM,OAAO;AAErB,eAAA,YAAY,WAAW,WAAW;AAClC,gBAAA,IAAI,SAAS,EAAE;AAAA,IACzB;AAAA,EACD;AAEM,SAAA,CAAC,GAAG,SAAS;AACrB;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as prismic from "@prismicio/client";
|
|
2
1
|
import fetch from "node-fetch";
|
|
2
|
+
import { createClient } from './../_node_modules/@prismicio/client/dist/createClient.js';
|
|
3
3
|
const loadLocaleIDs = async (config) => {
|
|
4
4
|
const localeIDs = new Set(config.localeIDs || []);
|
|
5
5
|
if ("repositoryName" in config && config.fetchFromRepository) {
|
|
6
|
-
const client =
|
|
6
|
+
const client = createClient(config.repositoryName, {
|
|
7
7
|
accessToken: config.accessToken,
|
|
8
8
|
fetch
|
|
9
9
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadLocaleIDs.js","sources":["../../../src/cli/loadLocaleIDs.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\nimport fetch from \"node-fetch\";\n\ntype LoadLocalesConfig =\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t }\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t\t\trepositoryName: string;\n\t\t\taccessToken: string;\n\t\t\tfetchFromRepository?: boolean;\n\t };\n\nexport const loadLocaleIDs = async (\n\tconfig: LoadLocalesConfig,\n): Promise<string[]> => {\n\tconst localeIDs = new Set<string>(config.localeIDs || []);\n\n\tif (\"repositoryName\" in config && config.fetchFromRepository) {\n\t\tconst client = prismic.createClient(config.repositoryName, {\n\t\t\taccessToken: config.accessToken,\n\t\t\tfetch,\n\t\t});\n\n\t\tconst repository = await client.getRepository();\n\n\t\tfor (const language of repository.languages) {\n\t\t\tlocaleIDs.add(language.id);\n\t\t}\n\t}\n\n\treturn [...localeIDs];\n};\n"],"names":[],"mappings":";;AAca,MAAA,gBAAgB,OAC5B,WACsB;AACtB,QAAM,YAAY,IAAI,IAAY,OAAO,aAAa,CAAE,CAAA;AAEpD,MAAA,oBAAoB,UAAU,OAAO,qBAAqB;AAC7D,UAAM,
|
|
1
|
+
{"version":3,"file":"loadLocaleIDs.js","sources":["../../../src/cli/loadLocaleIDs.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\nimport fetch from \"node-fetch\";\n\ntype LoadLocalesConfig =\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t }\n\t| {\n\t\t\tlocaleIDs?: string[];\n\t\t\trepositoryName: string;\n\t\t\taccessToken: string;\n\t\t\tfetchFromRepository?: boolean;\n\t };\n\nexport const loadLocaleIDs = async (\n\tconfig: LoadLocalesConfig,\n): Promise<string[]> => {\n\tconst localeIDs = new Set<string>(config.localeIDs || []);\n\n\tif (\"repositoryName\" in config && config.fetchFromRepository) {\n\t\tconst client = prismic.createClient(config.repositoryName, {\n\t\t\taccessToken: config.accessToken,\n\t\t\tfetch,\n\t\t});\n\n\t\tconst repository = await client.getRepository();\n\n\t\tfor (const language of repository.languages) {\n\t\t\tlocaleIDs.add(language.id);\n\t\t}\n\t}\n\n\treturn [...localeIDs];\n};\n"],"names":["prismic.createClient"],"mappings":";;AAca,MAAA,gBAAgB,OAC5B,WACsB;AACtB,QAAM,YAAY,IAAI,IAAY,OAAO,aAAa,CAAE,CAAA;AAEpD,MAAA,oBAAoB,UAAU,OAAO,qBAAqB;AAC7D,UAAM,SAASA,aAAqB,OAAO,gBAAgB;AAAA,MAC1D,aAAa,OAAO;AAAA,MACpB;AAAA,IAAA,CACA;AAEK,UAAA,aAAa,MAAM,OAAO;AAErB,eAAA,YAAY,WAAW,WAAW;AAClC,gBAAA,IAAI,SAAS,EAAE;AAAA,IACzB;AAAA,EACD;AAEM,SAAA,CAAC,GAAG,SAAS;AACrB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeDataType.cjs","sources":["../../../src/lib/buildCustomTypeDataType.ts"],"sourcesContent":["import { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\n\nimport { buildTypeName } from \"../lib/buildTypeName\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { buildFieldProperties } from \"./buildFieldProperties\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeDataTypeArgs = {\n\tmodel: CustomTypeModel;\n\tfieldConfigs: FieldConfigs;\n};\n\ntype BuildCustomTypeDataTypeReturnValue = {\n\tname: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeDataType(\n\targs: BuildCustomTypeDataTypeArgs,\n): BuildCustomTypeDataTypeReturnValue {\n\tlet code = \"\";\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\", \"Data\");\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tlet fieldProperties = \"\";\n\n\tfor (const tabName in args.model.json) {\n\t\tconst { uid: _uid, ...fields } = args.model.json[tabName];\n\n\t\tconst tabFieldProperties = buildFieldProperties({\n\t\t\tfields,\n\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\tpath: [\n\t\t\t\t{\n\t\t\t\t\tname: args.model.id,\n\t\t\t\t\tmodel: args.model,\n\t\t\t\t},\n\t\t\t],\n\t\t\ttabName,\n\t\t});\n\n\t\tfieldProperties += tabFieldProperties.code;\n\n\t\tauxiliaryTypes.push(...tabFieldProperties.auxiliaryTypes);\n\t}\n\n\tif (fieldProperties) {\n\t\tcode = source`\n\t\t\t/**\n\t\t\t * Content for ${humanReadableName} documents\n\t\t\t */\n\t\t\tinterface ${name} {\n\t\t\t\t${fieldProperties}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcode = `interface ${name} {}`;\n\t}\n\n\treturn {\n\t\tname,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n}\n"],"names":["buildTypeName","getHumanReadableModelName","buildFieldProperties","source"],"mappings":";;;;;;AAqBM,SAAU,wBACf,MAAiC;AAEjC,MAAI,OAAO;AACX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAOA,cAAAA,cAAc,KAAK,MAAM,IAAI,YAAY,MAAM;AAC5D,QAAM,oBAAoBC,0BAAAA,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,MAAI,kBAAkB;AAEX,aAAA,WAAW,KAAK,MAAM,MAAM;AAChC,UAAA,EAAE,KAAK,MAAM,GAAG,WAAW,KAAK,MAAM,KAAK,OAAO;AAExD,UAAM,qBAAqBC,qBAAAA,qBAAqB;AAAA,MAC/C;AAAA,MACA,cAAc,KAAK;AAAA,MACnB,MAAM;AAAA,QACL;AAAA,UACC,MAAM,KAAK,MAAM;AAAA,UACjB,OAAO,KAAK;AAAA,QACZ;AAAA,MACD;AAAA,MACD;AAAA,IAAA,CACA;AAED,uBAAmB,mBAAmB;AAEvB,mBAAA,KAAK,GAAG,mBAAmB,cAAc;AAAA,EACxD;AAED,MAAI,iBAAiB;AACb,WAAAC,WAAAA;AAAAA;AAAAA,oBAEW;AAAA;AAAA,eAEL;AAAA,MACT;AAAA;AAAA;AAAA,EAAA,OAGE;AACN,WAAO,aAAa;AAAA,EACpB;AAEM,SAAA;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF;;"}
|
|
1
|
+
{"version":3,"file":"buildCustomTypeDataType.cjs","sources":["../../../src/lib/buildCustomTypeDataType.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\n\nimport { buildTypeName } from \"../lib/buildTypeName\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { buildFieldProperties } from \"./buildFieldProperties\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeDataTypeArgs = {\n\tmodel: CustomTypeModel;\n\tfieldConfigs: FieldConfigs;\n};\n\ntype BuildCustomTypeDataTypeReturnValue = {\n\tname: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeDataType(\n\targs: BuildCustomTypeDataTypeArgs,\n): BuildCustomTypeDataTypeReturnValue {\n\tlet code = \"\";\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\", \"Data\");\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tlet fieldProperties = \"\";\n\n\tfor (const tabName in args.model.json) {\n\t\tconst { uid: _uid, ...fields } = args.model.json[tabName];\n\n\t\tconst tabFieldProperties = buildFieldProperties({\n\t\t\tfields,\n\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\tpath: [\n\t\t\t\t{\n\t\t\t\t\tname: args.model.id,\n\t\t\t\t\tmodel: args.model,\n\t\t\t\t},\n\t\t\t],\n\t\t\ttabName,\n\t\t});\n\n\t\tfieldProperties += tabFieldProperties.code;\n\n\t\tauxiliaryTypes.push(...tabFieldProperties.auxiliaryTypes);\n\t}\n\n\tif (fieldProperties) {\n\t\tcode = source`\n\t\t\t/**\n\t\t\t * Content for ${humanReadableName} documents\n\t\t\t */\n\t\t\tinterface ${name} {\n\t\t\t\t${fieldProperties}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcode = `interface ${name} {}`;\n\t}\n\n\treturn {\n\t\tname,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n}\n"],"names":["buildTypeName","getHumanReadableModelName","buildFieldProperties","source"],"mappings":";;;;;;AAqBM,SAAU,wBACf,MAAiC;AAEjC,MAAI,OAAO;AACX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAOA,cAAAA,cAAc,KAAK,MAAM,IAAI,YAAY,MAAM;AAC5D,QAAM,oBAAoBC,0BAAAA,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,MAAI,kBAAkB;AAEX,aAAA,WAAW,KAAK,MAAM,MAAM;AAChC,UAAA,EAAE,KAAK,MAAM,GAAG,WAAW,KAAK,MAAM,KAAK,OAAO;AAExD,UAAM,qBAAqBC,qBAAAA,qBAAqB;AAAA,MAC/C;AAAA,MACA,cAAc,KAAK;AAAA,MACnB,MAAM;AAAA,QACL;AAAA,UACC,MAAM,KAAK,MAAM;AAAA,UACjB,OAAO,KAAK;AAAA,QACZ;AAAA,MACD;AAAA,MACD;AAAA,IAAA,CACA;AAED,uBAAmB,mBAAmB;AAEvB,mBAAA,KAAK,GAAG,mBAAmB,cAAc;AAAA,EACxD;AAED,MAAI,iBAAiB;AACb,WAAAC,WAAAA;AAAAA;AAAAA,oBAEW;AAAA;AAAA,eAEL;AAAA,MACT;AAAA;AAAA;AAAA,EAAA,OAGE;AACN,WAAO,aAAa;AAAA,EACpB;AAEM,SAAA;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeDataType.js","sources":["../../../src/lib/buildCustomTypeDataType.ts"],"sourcesContent":["import { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\n\nimport { buildTypeName } from \"../lib/buildTypeName\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { buildFieldProperties } from \"./buildFieldProperties\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeDataTypeArgs = {\n\tmodel: CustomTypeModel;\n\tfieldConfigs: FieldConfigs;\n};\n\ntype BuildCustomTypeDataTypeReturnValue = {\n\tname: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeDataType(\n\targs: BuildCustomTypeDataTypeArgs,\n): BuildCustomTypeDataTypeReturnValue {\n\tlet code = \"\";\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\", \"Data\");\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tlet fieldProperties = \"\";\n\n\tfor (const tabName in args.model.json) {\n\t\tconst { uid: _uid, ...fields } = args.model.json[tabName];\n\n\t\tconst tabFieldProperties = buildFieldProperties({\n\t\t\tfields,\n\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\tpath: [\n\t\t\t\t{\n\t\t\t\t\tname: args.model.id,\n\t\t\t\t\tmodel: args.model,\n\t\t\t\t},\n\t\t\t],\n\t\t\ttabName,\n\t\t});\n\n\t\tfieldProperties += tabFieldProperties.code;\n\n\t\tauxiliaryTypes.push(...tabFieldProperties.auxiliaryTypes);\n\t}\n\n\tif (fieldProperties) {\n\t\tcode = source`\n\t\t\t/**\n\t\t\t * Content for ${humanReadableName} documents\n\t\t\t */\n\t\t\tinterface ${name} {\n\t\t\t\t${fieldProperties}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcode = `interface ${name} {}`;\n\t}\n\n\treturn {\n\t\tname,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n}\n"],"names":[],"mappings":";;;;AAqBM,SAAU,wBACf,MAAiC;AAEjC,MAAI,OAAO;AACX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAO,cAAc,KAAK,MAAM,IAAI,YAAY,MAAM;AAC5D,QAAM,oBAAoB,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,MAAI,kBAAkB;AAEX,aAAA,WAAW,KAAK,MAAM,MAAM;AAChC,UAAA,EAAE,KAAK,MAAM,GAAG,WAAW,KAAK,MAAM,KAAK,OAAO;AAExD,UAAM,qBAAqB,qBAAqB;AAAA,MAC/C;AAAA,MACA,cAAc,KAAK;AAAA,MACnB,MAAM;AAAA,QACL;AAAA,UACC,MAAM,KAAK,MAAM;AAAA,UACjB,OAAO,KAAK;AAAA,QACZ;AAAA,MACD;AAAA,MACD;AAAA,IAAA,CACA;AAED,uBAAmB,mBAAmB;AAEvB,mBAAA,KAAK,GAAG,mBAAmB,cAAc;AAAA,EACxD;AAED,MAAI,iBAAiB;AACb,WAAA;AAAA;AAAA,oBAEW;AAAA;AAAA,eAEL;AAAA,MACT;AAAA;AAAA;AAAA,EAAA,OAGE;AACN,WAAO,aAAa;AAAA,EACpB;AAEM,SAAA;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF;"}
|
|
1
|
+
{"version":3,"file":"buildCustomTypeDataType.js","sources":["../../../src/lib/buildCustomTypeDataType.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\n\nimport { buildTypeName } from \"../lib/buildTypeName\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { buildFieldProperties } from \"./buildFieldProperties\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeDataTypeArgs = {\n\tmodel: CustomTypeModel;\n\tfieldConfigs: FieldConfigs;\n};\n\ntype BuildCustomTypeDataTypeReturnValue = {\n\tname: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeDataType(\n\targs: BuildCustomTypeDataTypeArgs,\n): BuildCustomTypeDataTypeReturnValue {\n\tlet code = \"\";\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\", \"Data\");\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tlet fieldProperties = \"\";\n\n\tfor (const tabName in args.model.json) {\n\t\tconst { uid: _uid, ...fields } = args.model.json[tabName];\n\n\t\tconst tabFieldProperties = buildFieldProperties({\n\t\t\tfields,\n\t\t\tfieldConfigs: args.fieldConfigs,\n\t\t\tpath: [\n\t\t\t\t{\n\t\t\t\t\tname: args.model.id,\n\t\t\t\t\tmodel: args.model,\n\t\t\t\t},\n\t\t\t],\n\t\t\ttabName,\n\t\t});\n\n\t\tfieldProperties += tabFieldProperties.code;\n\n\t\tauxiliaryTypes.push(...tabFieldProperties.auxiliaryTypes);\n\t}\n\n\tif (fieldProperties) {\n\t\tcode = source`\n\t\t\t/**\n\t\t\t * Content for ${humanReadableName} documents\n\t\t\t */\n\t\t\tinterface ${name} {\n\t\t\t\t${fieldProperties}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcode = `interface ${name} {}`;\n\t}\n\n\treturn {\n\t\tname,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n}\n"],"names":[],"mappings":";;;;AAqBM,SAAU,wBACf,MAAiC;AAEjC,MAAI,OAAO;AACX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAO,cAAc,KAAK,MAAM,IAAI,YAAY,MAAM;AAC5D,QAAM,oBAAoB,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,MAAI,kBAAkB;AAEX,aAAA,WAAW,KAAK,MAAM,MAAM;AAChC,UAAA,EAAE,KAAK,MAAM,GAAG,WAAW,KAAK,MAAM,KAAK,OAAO;AAExD,UAAM,qBAAqB,qBAAqB;AAAA,MAC/C;AAAA,MACA,cAAc,KAAK;AAAA,MACnB,MAAM;AAAA,QACL;AAAA,UACC,MAAM,KAAK,MAAM;AAAA,UACjB,OAAO,KAAK;AAAA,QACZ;AAAA,MACD;AAAA,MACD;AAAA,IAAA,CACA;AAED,uBAAmB,mBAAmB;AAEvB,mBAAA,KAAK,GAAG,mBAAmB,cAAc;AAAA,EACxD;AAED,MAAI,iBAAiB;AACb,WAAA;AAAA;AAAA,oBAEW;AAAA;AAAA,eAEL;AAAA,MACT;AAAA;AAAA;AAAA,EAAA,OAGE;AACN,WAAO,aAAa;AAAA,EACpB;AAEM,SAAA;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeType.cjs","sources":["../../../src/lib/buildCustomTypeType.ts"],"sourcesContent":["import { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { CUSTOM_TYPES_DOCUMENTATION_URL } from \"../constants\";\n\nimport { addSection } from \"./addSection\";\nimport { buildCustomTypeDataType } from \"./buildCustomTypeDataType\";\nimport { buildTypeName } from \"./buildTypeName\";\nimport { buildUnion } from \"./buildUnion\";\nimport { checkHasUIDField } from \"./checkHasUIDFIeld\";\nimport { getCacheKey } from \"./getCacheKey\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeTypesArgs = {\n\tmodel: CustomTypeModel;\n\tlocaleIDs?: string[];\n\tfieldConfigs: FieldConfigs;\n\tcache?: QuickLRU<string, unknown>;\n};\n\ntype BuildCustomTypeTypeReturnValue = {\n\tname: string;\n\tdataName: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeType(\n\targs: BuildCustomTypeTypesArgs,\n): BuildCustomTypeTypeReturnValue {\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\t\tconst cached = args.cache.get(key);\n\n\t\tif (cached) {\n\t\t\treturn cached as BuildCustomTypeTypeReturnValue;\n\t\t}\n\t}\n\n\tlet code = \"\";\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\");\n\tconst langDefault =\n\t\targs.localeIDs && args.localeIDs.length > 0\n\t\t\t? buildUnion(args.localeIDs.map((localeID) => `\"${localeID}\"`))\n\t\t\t: \"string\";\n\tconst baseDocumentType = checkHasUIDField(args.model)\n\t\t? \"PrismicDocumentWithUID\"\n\t\t: \"PrismicDocumentWithoutUID\";\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tconst dataType = buildCustomTypeDataType({\n\t\tmodel: args.model,\n\t\tfieldConfigs: args.fieldConfigs,\n\t});\n\n\tauxiliaryTypes.push(...dataType.auxiliaryTypes);\n\n\tcode = addSection(dataType.code, code);\n\n\tcode = addSection(\n\t\tsource`\n\t\t\t/**\n\t\t\t * ${humanReadableName} document from Prismic\n\t\t\t *\n\t\t\t * - **API ID**: \\`${args.model.id}\\`\n\t\t\t * - **Repeatable**: \\`${args.model.repeatable.toString()}\\`\n\t\t\t * - **Documentation**: ${CUSTOM_TYPES_DOCUMENTATION_URL}\n\t\t\t *\n\t\t\t * @typeParam Lang - Language API ID of the document.\n\t\t\t */\n\t\t\texport type ${name}<Lang extends string = ${langDefault}> = prismic.${baseDocumentType}<Simplify<${\n\t\t\tdataType.name\n\t\t}>, \"${args.model.id}\", Lang>;\n\t\t`,\n\t\tcode,\n\t);\n\n\tconst result = {\n\t\tname,\n\t\tdataName: dataType.name,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\n\t\targs.cache.set(key, result);\n\t}\n\n\treturn result;\n}\n"],"names":["getCacheKey","buildTypeName","buildUnion","checkHasUIDField","getHumanReadableModelName","buildCustomTypeDataType","addSection","source","CUSTOM_TYPES_DOCUMENTATION_URL"],"mappings":";;;;;;;;;;;AA8BM,SAAU,oBACf,MAA8B;AAE9B,MAAI,KAAK,OAAO;AACT,UAAA,MAAMA,YAAAA,YAAY,KAAK,KAAK;AAClC,UAAM,SAAS,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,QAAQ;AACJ,aAAA;AAAA,IACP;AAAA,EACD;AAED,MAAI,OAAO;AAEX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAOC,cAAAA,cAAc,KAAK,MAAM,IAAI,UAAU;AACpD,QAAM,cACL,KAAK,aAAa,KAAK,UAAU,SAAS,IACvCC,sBAAW,KAAK,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,CAAC,IAC5D;AACJ,QAAM,mBAAmBC,iBAAAA,iBAAiB,KAAK,KAAK,IACjD,2BACA;AACH,QAAM,oBAAoBC,0BAAAA,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,QAAM,WAAWC,wBAAAA,wBAAwB;AAAA,IACxC,OAAO,KAAK;AAAA,IACZ,cAAc,KAAK;AAAA,EAAA,CACnB;AAEc,iBAAA,KAAK,GAAG,SAAS,cAAc;AAEvC,SAAAC,WAAAA,WAAW,SAAS,MAAM,IAAI;AAErC,SAAOA,WACN,WAAAC;;QAEM;AAAA;AAAA,wBAEgB,KAAK,MAAM;AAAA,4BACP,KAAK,MAAM,WAAW,SAAU;AAAA,6BAC/BC;;;;iBAIZ,8BAA8B,0BAA0B,6BACtE,SAAS,WACH,KAAK,MAAM;AAAA,KAElB,IAAI;AAGL,QAAM,SAAS;AAAA,IACd;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAGD,MAAI,KAAK,OAAO;AACT,UAAA,MAAMR,YAAAA,YAAY,KAAK,KAAK;AAE7B,SAAA,MAAM,IAAI,KAAK,MAAM;AAAA,EAC1B;AAEM,SAAA;AACR;;"}
|
|
1
|
+
{"version":3,"file":"buildCustomTypeType.cjs","sources":["../../../src/lib/buildCustomTypeType.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { CUSTOM_TYPES_DOCUMENTATION_URL } from \"../constants\";\n\nimport { addSection } from \"./addSection\";\nimport { buildCustomTypeDataType } from \"./buildCustomTypeDataType\";\nimport { buildTypeName } from \"./buildTypeName\";\nimport { buildUnion } from \"./buildUnion\";\nimport { checkHasUIDField } from \"./checkHasUIDFIeld\";\nimport { getCacheKey } from \"./getCacheKey\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeTypesArgs = {\n\tmodel: CustomTypeModel;\n\tlocaleIDs?: string[];\n\tfieldConfigs: FieldConfigs;\n\tcache?: QuickLRU<string, unknown>;\n};\n\ntype BuildCustomTypeTypeReturnValue = {\n\tname: string;\n\tdataName: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeType(\n\targs: BuildCustomTypeTypesArgs,\n): BuildCustomTypeTypeReturnValue {\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\t\tconst cached = args.cache.get(key);\n\n\t\tif (cached) {\n\t\t\treturn cached as BuildCustomTypeTypeReturnValue;\n\t\t}\n\t}\n\n\tlet code = \"\";\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\");\n\tconst langDefault =\n\t\targs.localeIDs && args.localeIDs.length > 0\n\t\t\t? buildUnion(args.localeIDs.map((localeID) => `\"${localeID}\"`))\n\t\t\t: \"string\";\n\tconst baseDocumentType = checkHasUIDField(args.model)\n\t\t? \"PrismicDocumentWithUID\"\n\t\t: \"PrismicDocumentWithoutUID\";\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tconst dataType = buildCustomTypeDataType({\n\t\tmodel: args.model,\n\t\tfieldConfigs: args.fieldConfigs,\n\t});\n\n\tauxiliaryTypes.push(...dataType.auxiliaryTypes);\n\n\tcode = addSection(dataType.code, code);\n\n\tcode = addSection(\n\t\tsource`\n\t\t\t/**\n\t\t\t * ${humanReadableName} document from Prismic\n\t\t\t *\n\t\t\t * - **API ID**: \\`${args.model.id}\\`\n\t\t\t * - **Repeatable**: \\`${args.model.repeatable.toString()}\\`\n\t\t\t * - **Documentation**: ${CUSTOM_TYPES_DOCUMENTATION_URL}\n\t\t\t *\n\t\t\t * @typeParam Lang - Language API ID of the document.\n\t\t\t */\n\t\t\texport type ${name}<Lang extends string = ${langDefault}> = prismic.${baseDocumentType}<Simplify<${\n\t\t\tdataType.name\n\t\t}>, \"${args.model.id}\", Lang>;\n\t\t`,\n\t\tcode,\n\t);\n\n\tconst result = {\n\t\tname,\n\t\tdataName: dataType.name,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\n\t\targs.cache.set(key, result);\n\t}\n\n\treturn result;\n}\n"],"names":["getCacheKey","buildTypeName","buildUnion","checkHasUIDField","getHumanReadableModelName","buildCustomTypeDataType","addSection","source","CUSTOM_TYPES_DOCUMENTATION_URL"],"mappings":";;;;;;;;;;;AA8BM,SAAU,oBACf,MAA8B;AAE9B,MAAI,KAAK,OAAO;AACT,UAAA,MAAMA,YAAAA,YAAY,KAAK,KAAK;AAClC,UAAM,SAAS,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,QAAQ;AACJ,aAAA;AAAA,IACP;AAAA,EACD;AAED,MAAI,OAAO;AAEX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAOC,cAAAA,cAAc,KAAK,MAAM,IAAI,UAAU;AACpD,QAAM,cACL,KAAK,aAAa,KAAK,UAAU,SAAS,IACvCC,sBAAW,KAAK,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,CAAC,IAC5D;AACJ,QAAM,mBAAmBC,iBAAAA,iBAAiB,KAAK,KAAK,IACjD,2BACA;AACH,QAAM,oBAAoBC,0BAAAA,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,QAAM,WAAWC,wBAAAA,wBAAwB;AAAA,IACxC,OAAO,KAAK;AAAA,IACZ,cAAc,KAAK;AAAA,EAAA,CACnB;AAEc,iBAAA,KAAK,GAAG,SAAS,cAAc;AAEvC,SAAAC,WAAAA,WAAW,SAAS,MAAM,IAAI;AAErC,SAAOA,WACN,WAAAC;;QAEM;AAAA;AAAA,wBAEgB,KAAK,MAAM;AAAA,4BACP,KAAK,MAAM,WAAW,SAAU;AAAA,6BAC/BC;;;;iBAIZ,8BAA8B,0BAA0B,6BACtE,SAAS,WACH,KAAK,MAAM;AAAA,KAElB,IAAI;AAGL,QAAM,SAAS;AAAA,IACd;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAGD,MAAI,KAAK,OAAO;AACT,UAAA,MAAMR,YAAAA,YAAY,KAAK,KAAK;AAE7B,SAAA,MAAM,IAAI,KAAK,MAAM;AAAA,EAC1B;AAEM,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeType.js","sources":["../../../src/lib/buildCustomTypeType.ts"],"sourcesContent":["import { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { CUSTOM_TYPES_DOCUMENTATION_URL } from \"../constants\";\n\nimport { addSection } from \"./addSection\";\nimport { buildCustomTypeDataType } from \"./buildCustomTypeDataType\";\nimport { buildTypeName } from \"./buildTypeName\";\nimport { buildUnion } from \"./buildUnion\";\nimport { checkHasUIDField } from \"./checkHasUIDFIeld\";\nimport { getCacheKey } from \"./getCacheKey\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeTypesArgs = {\n\tmodel: CustomTypeModel;\n\tlocaleIDs?: string[];\n\tfieldConfigs: FieldConfigs;\n\tcache?: QuickLRU<string, unknown>;\n};\n\ntype BuildCustomTypeTypeReturnValue = {\n\tname: string;\n\tdataName: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeType(\n\targs: BuildCustomTypeTypesArgs,\n): BuildCustomTypeTypeReturnValue {\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\t\tconst cached = args.cache.get(key);\n\n\t\tif (cached) {\n\t\t\treturn cached as BuildCustomTypeTypeReturnValue;\n\t\t}\n\t}\n\n\tlet code = \"\";\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\");\n\tconst langDefault =\n\t\targs.localeIDs && args.localeIDs.length > 0\n\t\t\t? buildUnion(args.localeIDs.map((localeID) => `\"${localeID}\"`))\n\t\t\t: \"string\";\n\tconst baseDocumentType = checkHasUIDField(args.model)\n\t\t? \"PrismicDocumentWithUID\"\n\t\t: \"PrismicDocumentWithoutUID\";\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tconst dataType = buildCustomTypeDataType({\n\t\tmodel: args.model,\n\t\tfieldConfigs: args.fieldConfigs,\n\t});\n\n\tauxiliaryTypes.push(...dataType.auxiliaryTypes);\n\n\tcode = addSection(dataType.code, code);\n\n\tcode = addSection(\n\t\tsource`\n\t\t\t/**\n\t\t\t * ${humanReadableName} document from Prismic\n\t\t\t *\n\t\t\t * - **API ID**: \\`${args.model.id}\\`\n\t\t\t * - **Repeatable**: \\`${args.model.repeatable.toString()}\\`\n\t\t\t * - **Documentation**: ${CUSTOM_TYPES_DOCUMENTATION_URL}\n\t\t\t *\n\t\t\t * @typeParam Lang - Language API ID of the document.\n\t\t\t */\n\t\t\texport type ${name}<Lang extends string = ${langDefault}> = prismic.${baseDocumentType}<Simplify<${\n\t\t\tdataType.name\n\t\t}>, \"${args.model.id}\", Lang>;\n\t\t`,\n\t\tcode,\n\t);\n\n\tconst result = {\n\t\tname,\n\t\tdataName: dataType.name,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\n\t\targs.cache.set(key, result);\n\t}\n\n\treturn result;\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BM,SAAU,oBACf,MAA8B;AAE9B,MAAI,KAAK,OAAO;AACT,UAAA,MAAM,YAAY,KAAK,KAAK;AAClC,UAAM,SAAS,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,QAAQ;AACJ,aAAA;AAAA,IACP;AAAA,EACD;AAED,MAAI,OAAO;AAEX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAO,cAAc,KAAK,MAAM,IAAI,UAAU;AACpD,QAAM,cACL,KAAK,aAAa,KAAK,UAAU,SAAS,IACvC,WAAW,KAAK,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,CAAC,IAC5D;AACJ,QAAM,mBAAmB,iBAAiB,KAAK,KAAK,IACjD,2BACA;AACH,QAAM,oBAAoB,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,QAAM,WAAW,wBAAwB;AAAA,IACxC,OAAO,KAAK;AAAA,IACZ,cAAc,KAAK;AAAA,EAAA,CACnB;AAEc,iBAAA,KAAK,GAAG,SAAS,cAAc;AAEvC,SAAA,WAAW,SAAS,MAAM,IAAI;AAErC,SAAO,WACN;AAAA;AAAA,QAEM;AAAA;AAAA,wBAEgB,KAAK,MAAM;AAAA,4BACP,KAAK,MAAM,WAAW,SAAU;AAAA,6BAC/B;AAAA;AAAA;AAAA;AAAA,iBAIZ,8BAA8B,0BAA0B,6BACtE,SAAS,WACH,KAAK,MAAM;AAAA,KAElB,IAAI;AAGL,QAAM,SAAS;AAAA,IACd;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAGD,MAAI,KAAK,OAAO;AACT,UAAA,MAAM,YAAY,KAAK,KAAK;AAE7B,SAAA,MAAM,IAAI,KAAK,MAAM;AAAA,EAC1B;AAEM,SAAA;AACR;"}
|
|
1
|
+
{"version":3,"file":"buildCustomTypeType.js","sources":["../../../src/lib/buildCustomTypeType.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\nimport { source } from \"common-tags\";\nimport QuickLRU from \"quick-lru\";\n\nimport { AuxiliaryType, FieldConfigs } from \"../types\";\n\nimport { CUSTOM_TYPES_DOCUMENTATION_URL } from \"../constants\";\n\nimport { addSection } from \"./addSection\";\nimport { buildCustomTypeDataType } from \"./buildCustomTypeDataType\";\nimport { buildTypeName } from \"./buildTypeName\";\nimport { buildUnion } from \"./buildUnion\";\nimport { checkHasUIDField } from \"./checkHasUIDFIeld\";\nimport { getCacheKey } from \"./getCacheKey\";\nimport { getHumanReadableModelName } from \"./getHumanReadableModelName\";\n\ntype BuildCustomTypeTypesArgs = {\n\tmodel: CustomTypeModel;\n\tlocaleIDs?: string[];\n\tfieldConfigs: FieldConfigs;\n\tcache?: QuickLRU<string, unknown>;\n};\n\ntype BuildCustomTypeTypeReturnValue = {\n\tname: string;\n\tdataName: string;\n\tcode: string;\n\tauxiliaryTypes: AuxiliaryType[];\n};\n\nexport function buildCustomTypeType(\n\targs: BuildCustomTypeTypesArgs,\n): BuildCustomTypeTypeReturnValue {\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\t\tconst cached = args.cache.get(key);\n\n\t\tif (cached) {\n\t\t\treturn cached as BuildCustomTypeTypeReturnValue;\n\t\t}\n\t}\n\n\tlet code = \"\";\n\n\tconst auxiliaryTypes: AuxiliaryType[] = [];\n\n\tconst name = buildTypeName(args.model.id, \"Document\");\n\tconst langDefault =\n\t\targs.localeIDs && args.localeIDs.length > 0\n\t\t\t? buildUnion(args.localeIDs.map((localeID) => `\"${localeID}\"`))\n\t\t\t: \"string\";\n\tconst baseDocumentType = checkHasUIDField(args.model)\n\t\t? \"PrismicDocumentWithUID\"\n\t\t: \"PrismicDocumentWithoutUID\";\n\tconst humanReadableName = getHumanReadableModelName({\n\t\tname: args.model.id,\n\t\tmodel: args.model,\n\t});\n\n\tconst dataType = buildCustomTypeDataType({\n\t\tmodel: args.model,\n\t\tfieldConfigs: args.fieldConfigs,\n\t});\n\n\tauxiliaryTypes.push(...dataType.auxiliaryTypes);\n\n\tcode = addSection(dataType.code, code);\n\n\tcode = addSection(\n\t\tsource`\n\t\t\t/**\n\t\t\t * ${humanReadableName} document from Prismic\n\t\t\t *\n\t\t\t * - **API ID**: \\`${args.model.id}\\`\n\t\t\t * - **Repeatable**: \\`${args.model.repeatable.toString()}\\`\n\t\t\t * - **Documentation**: ${CUSTOM_TYPES_DOCUMENTATION_URL}\n\t\t\t *\n\t\t\t * @typeParam Lang - Language API ID of the document.\n\t\t\t */\n\t\t\texport type ${name}<Lang extends string = ${langDefault}> = prismic.${baseDocumentType}<Simplify<${\n\t\t\tdataType.name\n\t\t}>, \"${args.model.id}\", Lang>;\n\t\t`,\n\t\tcode,\n\t);\n\n\tconst result = {\n\t\tname,\n\t\tdataName: dataType.name,\n\t\tcode,\n\t\tauxiliaryTypes,\n\t};\n\n\tif (args.cache) {\n\t\tconst key = getCacheKey(args.model);\n\n\t\targs.cache.set(key, result);\n\t}\n\n\treturn result;\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BM,SAAU,oBACf,MAA8B;AAE9B,MAAI,KAAK,OAAO;AACT,UAAA,MAAM,YAAY,KAAK,KAAK;AAClC,UAAM,SAAS,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,QAAQ;AACJ,aAAA;AAAA,IACP;AAAA,EACD;AAED,MAAI,OAAO;AAEX,QAAM,iBAAkC,CAAA;AAExC,QAAM,OAAO,cAAc,KAAK,MAAM,IAAI,UAAU;AACpD,QAAM,cACL,KAAK,aAAa,KAAK,UAAU,SAAS,IACvC,WAAW,KAAK,UAAU,IAAI,CAAC,aAAa,IAAI,WAAW,CAAC,IAC5D;AACJ,QAAM,mBAAmB,iBAAiB,KAAK,KAAK,IACjD,2BACA;AACH,QAAM,oBAAoB,0BAA0B;AAAA,IACnD,MAAM,KAAK,MAAM;AAAA,IACjB,OAAO,KAAK;AAAA,EAAA,CACZ;AAED,QAAM,WAAW,wBAAwB;AAAA,IACxC,OAAO,KAAK;AAAA,IACZ,cAAc,KAAK;AAAA,EAAA,CACnB;AAEc,iBAAA,KAAK,GAAG,SAAS,cAAc;AAEvC,SAAA,WAAW,SAAS,MAAM,IAAI;AAErC,SAAO,WACN;AAAA;AAAA,QAEM;AAAA;AAAA,wBAEgB,KAAK,MAAM;AAAA,4BACP,KAAK,MAAM,WAAW,SAAU;AAAA,6BAC/B;AAAA;AAAA;AAAA;AAAA,iBAIZ,8BAA8B,0BAA0B,6BACtE,SAAS,WACH,KAAK,MAAM;AAAA,KAElB,IAAI;AAGL,QAAM,SAAS;AAAA,IACd;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAGD,MAAI,KAAK,OAAO;AACT,UAAA,MAAM,YAAY,KAAK,KAAK;AAE7B,SAAA,MAAM,IAAI,KAAK,MAAM;AAAA,EAC1B;AAEM,SAAA;AACR;"}
|