@prismicio/client 6.7.0 → 6.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/ForbiddenError.cjs +7 -0
  2. package/dist/ForbiddenError.cjs.map +1 -0
  3. package/dist/ForbiddenError.d.ts +11 -0
  4. package/dist/ForbiddenError.js +7 -0
  5. package/dist/ForbiddenError.js.map +1 -0
  6. package/dist/NotFoundError.cjs +7 -0
  7. package/dist/NotFoundError.cjs.map +1 -0
  8. package/dist/NotFoundError.d.ts +3 -0
  9. package/dist/NotFoundError.js +7 -0
  10. package/dist/NotFoundError.js.map +1 -0
  11. package/dist/ParsingError.cjs +7 -0
  12. package/dist/ParsingError.cjs.map +1 -0
  13. package/dist/ParsingError.d.ts +12 -0
  14. package/dist/ParsingError.js +7 -0
  15. package/dist/ParsingError.js.map +1 -0
  16. package/dist/PrismicError.cjs +19 -0
  17. package/dist/PrismicError.cjs.map +1 -0
  18. package/dist/PrismicError.d.ts +5 -0
  19. package/dist/PrismicError.js +19 -0
  20. package/dist/PrismicError.js.map +1 -0
  21. package/dist/buildQueryURL.cjs +40 -0
  22. package/dist/buildQueryURL.cjs.map +1 -0
  23. package/dist/buildQueryURL.d.ts +130 -0
  24. package/dist/buildQueryURL.js +40 -0
  25. package/dist/buildQueryURL.js.map +1 -0
  26. package/dist/client.cjs +436 -0
  27. package/dist/client.cjs.map +1 -0
  28. package/dist/client.d.ts +929 -0
  29. package/dist/client.js +419 -0
  30. package/dist/client.js.map +1 -0
  31. package/dist/cookie.cjs +5 -0
  32. package/dist/cookie.cjs.map +1 -0
  33. package/dist/cookie.d.ts +5 -0
  34. package/dist/cookie.js +5 -0
  35. package/dist/cookie.js.map +1 -0
  36. package/dist/getGraphQLEndpoint.cjs +13 -0
  37. package/dist/getGraphQLEndpoint.cjs.map +1 -0
  38. package/dist/getGraphQLEndpoint.d.ts +9 -0
  39. package/dist/getGraphQLEndpoint.js +13 -0
  40. package/dist/getGraphQLEndpoint.js.map +1 -0
  41. package/dist/getRepositoryEndpoint.cjs +13 -0
  42. package/dist/getRepositoryEndpoint.cjs.map +1 -0
  43. package/dist/getRepositoryEndpoint.d.ts +10 -0
  44. package/dist/getRepositoryEndpoint.js +13 -0
  45. package/dist/getRepositoryEndpoint.js.map +1 -0
  46. package/dist/getRepositoryName.cjs +12 -0
  47. package/dist/getRepositoryName.cjs.map +1 -0
  48. package/dist/getRepositoryName.d.ts +13 -0
  49. package/dist/getRepositoryName.js +12 -0
  50. package/dist/getRepositoryName.js.map +1 -0
  51. package/dist/index.cjs +32 -719
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.d.ts +88 -1526
  54. package/dist/index.js +34 -679
  55. package/dist/index.js.map +1 -1
  56. package/dist/isRepositoryEndpoint.cjs +12 -0
  57. package/dist/isRepositoryEndpoint.cjs.map +1 -0
  58. package/dist/isRepositoryEndpoint.d.ts +10 -0
  59. package/dist/isRepositoryEndpoint.js +12 -0
  60. package/dist/isRepositoryEndpoint.js.map +1 -0
  61. package/dist/isRepositoryName.cjs +7 -0
  62. package/dist/isRepositoryName.cjs.map +1 -0
  63. package/dist/isRepositoryName.d.ts +9 -0
  64. package/dist/isRepositoryName.js +7 -0
  65. package/dist/isRepositoryName.js.map +1 -0
  66. package/dist/lib/appendPredicates.cjs +14 -0
  67. package/dist/lib/appendPredicates.cjs.map +1 -0
  68. package/dist/lib/appendPredicates.d.ts +18 -0
  69. package/dist/lib/appendPredicates.js +14 -0
  70. package/dist/lib/appendPredicates.js.map +1 -0
  71. package/dist/lib/castArray.cjs +5 -0
  72. package/dist/lib/castArray.cjs.map +1 -0
  73. package/dist/lib/castArray.d.ts +11 -0
  74. package/dist/lib/castArray.js +5 -0
  75. package/dist/lib/castArray.js.map +1 -0
  76. package/dist/lib/castThunk.cjs +5 -0
  77. package/dist/lib/castThunk.cjs.map +1 -0
  78. package/dist/lib/castThunk.d.ts +10 -0
  79. package/dist/lib/castThunk.js +5 -0
  80. package/dist/lib/castThunk.js.map +1 -0
  81. package/dist/lib/findMasterRef.cjs +8 -0
  82. package/dist/lib/findMasterRef.cjs.map +1 -0
  83. package/dist/lib/findMasterRef.d.ts +10 -0
  84. package/dist/lib/findMasterRef.js +8 -0
  85. package/dist/lib/findMasterRef.js.map +1 -0
  86. package/dist/lib/findRef.cjs +12 -0
  87. package/dist/lib/findRef.cjs.map +1 -0
  88. package/dist/lib/findRef.d.ts +13 -0
  89. package/dist/lib/findRef.js +12 -0
  90. package/dist/lib/findRef.js.map +1 -0
  91. package/dist/lib/findRefByID.cjs +8 -0
  92. package/dist/lib/findRefByID.cjs.map +1 -0
  93. package/dist/lib/findRefByID.d.ts +11 -0
  94. package/dist/lib/findRefByID.js +8 -0
  95. package/dist/lib/findRefByID.js.map +1 -0
  96. package/dist/lib/findRefByLabel.cjs +8 -0
  97. package/dist/lib/findRefByLabel.cjs.map +1 -0
  98. package/dist/lib/findRefByLabel.d.ts +11 -0
  99. package/dist/lib/findRefByLabel.js +8 -0
  100. package/dist/lib/findRefByLabel.js.map +1 -0
  101. package/dist/lib/getPreviewCookie.cjs +21 -0
  102. package/dist/lib/getPreviewCookie.cjs.map +1 -0
  103. package/dist/lib/getPreviewCookie.d.ts +9 -0
  104. package/dist/lib/getPreviewCookie.js +21 -0
  105. package/dist/lib/getPreviewCookie.js.map +1 -0
  106. package/dist/lib/minifyGraphQLQuery.cjs +7 -0
  107. package/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
  108. package/dist/lib/minifyGraphQLQuery.d.ts +8 -0
  109. package/dist/lib/minifyGraphQLQuery.js +7 -0
  110. package/dist/lib/minifyGraphQLQuery.js.map +1 -0
  111. package/dist/lib/orElseThrow.d.ts +11 -0
  112. package/dist/predicate.cjs +68 -0
  113. package/dist/predicate.cjs.map +1 -0
  114. package/dist/predicate.d.ts +209 -0
  115. package/dist/predicate.js +68 -0
  116. package/dist/predicate.js.map +1 -0
  117. package/dist/types.d.ts +156 -0
  118. package/package.json +21 -21
  119. package/src/buildQueryURL.ts +6 -3
  120. package/src/client.ts +71 -36
  121. package/src/cookie.ts +2 -1
  122. package/src/getRepositoryName.ts +4 -2
  123. package/src/isRepositoryEndpoint.ts +2 -1
  124. package/src/isRepositoryName.ts +2 -1
  125. package/src/lib/appendPredicates.ts +2 -1
  126. package/src/lib/getPreviewCookie.ts +2 -1
  127. package/src/predicate.ts +4 -2
  128. package/src/types.ts +16 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findRefByID.cjs","sources":["../../../src/lib/findRefByID.ts"],"sourcesContent":["import * as prismicT from \"@prismicio/types\";\n\nimport { findRef } from \"./findRef\";\n\n/**\n * Returns the ref from a list of given refs with a matching ID.\n *\n * @param refs - A list of refs to search.\n * @param id - The ID of the ref to find.\n *\n * @returns The ref with a matching ID from the list.\n * @throws If a matching ref cannot be found.\n */\nexport const findRefByID = (refs: prismicT.Ref[], id: string): prismicT.Ref => {\n\treturn findRef(refs, (ref) => ref.id === id);\n};\n"],"names":["findRef"],"mappings":";;;AAaa,MAAA,cAAc,CAAC,MAAsB,OAA4B;AAC7E,SAAOA,QAAAA,QAAQ,MAAM,CAAC,QAAQ,IAAI,OAAO,EAAE;AAC5C;;"}
@@ -0,0 +1,11 @@
1
+ import * as prismicT from "@prismicio/types";
2
+ /**
3
+ * Returns the ref from a list of given refs with a matching ID.
4
+ *
5
+ * @param refs - A list of refs to search.
6
+ * @param id - The ID of the ref to find.
7
+ *
8
+ * @returns The ref with a matching ID from the list.
9
+ * @throws If a matching ref cannot be found.
10
+ */
11
+ export declare const findRefByID: (refs: prismicT.Ref[], id: string) => prismicT.Ref;
@@ -0,0 +1,8 @@
1
+ import { findRef } from "./findRef.js";
2
+ const findRefByID = (refs, id) => {
3
+ return findRef(refs, (ref) => ref.id === id);
4
+ };
5
+ export {
6
+ findRefByID
7
+ };
8
+ //# sourceMappingURL=findRefByID.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findRefByID.js","sources":["../../../src/lib/findRefByID.ts"],"sourcesContent":["import * as prismicT from \"@prismicio/types\";\n\nimport { findRef } from \"./findRef\";\n\n/**\n * Returns the ref from a list of given refs with a matching ID.\n *\n * @param refs - A list of refs to search.\n * @param id - The ID of the ref to find.\n *\n * @returns The ref with a matching ID from the list.\n * @throws If a matching ref cannot be found.\n */\nexport const findRefByID = (refs: prismicT.Ref[], id: string): prismicT.Ref => {\n\treturn findRef(refs, (ref) => ref.id === id);\n};\n"],"names":[],"mappings":";AAaa,MAAA,cAAc,CAAC,MAAsB,OAA4B;AAC7E,SAAO,QAAQ,MAAM,CAAC,QAAQ,IAAI,OAAO,EAAE;AAC5C;"}
@@ -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":["../../../src/lib/findRefByLabel.ts"],"sourcesContent":["import * as prismicT from \"@prismicio/types\";\n\nimport { findRef } from \"./findRef\";\n\n/**\n * Returns the ref from a list of given refs with a matching label.\n *\n * @param refs - A list of refs to search.\n * @param id - The label of the ref to find.\n *\n * @returns The ref with a matching label from the list.\n * @throws If a matching ref cannot be found.\n */\nexport const findRefByLabel = (\n\trefs: prismicT.Ref[],\n\tlabel: string,\n): prismicT.Ref => {\n\treturn findRef(refs, (ref) => ref.label === label);\n};\n"],"names":["findRef"],"mappings":";;;AAaa,MAAA,iBAAiB,CAC7B,MACA,UACiB;AACjB,SAAOA,QAAAA,QAAQ,MAAM,CAAC,QAAQ,IAAI,UAAU,KAAK;AAClD;;"}
@@ -0,0 +1,11 @@
1
+ import * as prismicT from "@prismicio/types";
2
+ /**
3
+ * Returns the ref from a list of given refs with a matching label.
4
+ *
5
+ * @param refs - A list of refs to search.
6
+ * @param id - The label of the ref to find.
7
+ *
8
+ * @returns The ref with a matching label from the list.
9
+ * @throws If a matching ref cannot be found.
10
+ */
11
+ export declare const findRefByLabel: (refs: prismicT.Ref[], label: string) => prismicT.Ref;
@@ -0,0 +1,8 @@
1
+ import { findRef } from "./findRef.js";
2
+ const findRefByLabel = (refs, label) => {
3
+ return findRef(refs, (ref) => ref.label === label);
4
+ };
5
+ export {
6
+ findRefByLabel
7
+ };
8
+ //# sourceMappingURL=findRefByLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findRefByLabel.js","sources":["../../../src/lib/findRefByLabel.ts"],"sourcesContent":["import * as prismicT from \"@prismicio/types\";\n\nimport { findRef } from \"./findRef\";\n\n/**\n * Returns the ref from a list of given refs with a matching label.\n *\n * @param refs - A list of refs to search.\n * @param id - The label of the ref to find.\n *\n * @returns The ref with a matching label from the list.\n * @throws If a matching ref cannot be found.\n */\nexport const findRefByLabel = (\n\trefs: prismicT.Ref[],\n\tlabel: string,\n): prismicT.Ref => {\n\treturn findRef(refs, (ref) => ref.label === label);\n};\n"],"names":[],"mappings":";AAaa,MAAA,iBAAiB,CAC7B,MACA,UACiB;AACjB,SAAO,QAAQ,MAAM,CAAC,QAAQ,IAAI,UAAU,KAAK;AAClD;"}
@@ -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
+ continue;
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":["../../../src/lib/getPreviewCookie.ts"],"sourcesContent":["import { preview as previewCookieName } from \"../cookie\";\n\nconst readValue = (value: string): string => {\n\treturn value.replace(/%3B/g, \";\");\n};\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the\n * cookie.\n *\n * @returns The value of the cookie, if it exists.\n */\nexport const getPreviewCookie = (cookieJar: string): string | undefined => {\n\tconst cookies = cookieJar.split(\"; \");\n\n\tlet value: string | undefined;\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\");\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\");\n\n\t\tif (name === previewCookieName) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"));\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn value;\n};\n"],"names":["cookie","previewCookieName"],"mappings":";;;AAEA,MAAM,YAAY,CAAC,UAAyB;AACpC,SAAA,MAAM,QAAQ,QAAQ,GAAG;AACjC;AAUa,MAAA,mBAAmB,CAAC,cAAyC;AACnE,QAAA,UAAU,UAAU,MAAM,IAAI;AAEhC,MAAA;AAEJ,aAAWA,YAAU,SAAS;AACvB,UAAA,QAAQA,SAAO,MAAM,GAAG;AAC9B,UAAM,OAAO,UAAU,MAAM,EAAE,EAAE,QAAQ,QAAQ,GAAG;AAEpD,QAAI,SAASC,OAAAA,SAAmB;AAC/B,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACA;AAAA,EACD;AAEM,SAAA;AACR;;"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns the value of a cookie from a given cookie store.
3
+ *
4
+ * @param cookieJar - The stringified cookie store from which to read the
5
+ * cookie.
6
+ *
7
+ * @returns The value of the cookie, if it exists.
8
+ */
9
+ export declare const getPreviewCookie: (cookieJar: string) => string | undefined;
@@ -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
+ continue;
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":["../../../src/lib/getPreviewCookie.ts"],"sourcesContent":["import { preview as previewCookieName } from \"../cookie\";\n\nconst readValue = (value: string): string => {\n\treturn value.replace(/%3B/g, \";\");\n};\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the\n * cookie.\n *\n * @returns The value of the cookie, if it exists.\n */\nexport const getPreviewCookie = (cookieJar: string): string | undefined => {\n\tconst cookies = cookieJar.split(\"; \");\n\n\tlet value: string | undefined;\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\");\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\");\n\n\t\tif (name === previewCookieName) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"));\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn value;\n};\n"],"names":["previewCookieName"],"mappings":";AAEA,MAAM,YAAY,CAAC,UAAyB;AACpC,SAAA,MAAM,QAAQ,QAAQ,GAAG;AACjC;AAUa,MAAA,mBAAmB,CAAC,cAAyC;AACnE,QAAA,UAAU,UAAU,MAAM,IAAI;AAEhC,MAAA;AAEJ,aAAW,UAAU,SAAS;AACvB,UAAA,QAAQ,OAAO,MAAM,GAAG;AAC9B,UAAM,OAAO,UAAU,MAAM,EAAE,EAAE,QAAQ,QAAQ,GAAG;AAEpD,QAAI,SAASA,SAAmB;AAC/B,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACA;AAAA,EACD;AAEM,SAAA;AACR;"}
@@ -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":["../../../src/lib/minifyGraphQLQuery.ts"],"sourcesContent":["/**\n * Minifies a GraphQL query by removing whitespace where possible.\n *\n * @param query - GraphQL query to minify.\n *\n * @returns A minified version of `query`.\n */\nexport const minifyGraphQLQuery = (query: string): string => {\n\treturn query.replace(\n\t\t/(\\n| )*( |{|})(\\n| )*/gm,\n\t\t(_chars, _spaces, brackets) => brackets,\n\t);\n};\n"],"names":[],"mappings":";;AAOa,MAAA,qBAAqB,CAAC,UAAyB;AAC3D,SAAO,MAAM,QACZ,2BACA,CAAC,QAAQ,SAAS,aAAa,QAAQ;AAEzC;;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Minifies a GraphQL query by removing whitespace where possible.
3
+ *
4
+ * @param query - GraphQL query to minify.
5
+ *
6
+ * @returns A minified version of `query`.
7
+ */
8
+ export declare const minifyGraphQLQuery: (query: string) => string;
@@ -0,0 +1,7 @@
1
+ const minifyGraphQLQuery = (query) => {
2
+ return query.replace(/(\n| )*( |{|})(\n| )*/gm, (_chars, _spaces, brackets) => brackets);
3
+ };
4
+ export {
5
+ minifyGraphQLQuery
6
+ };
7
+ //# sourceMappingURL=minifyGraphQLQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minifyGraphQLQuery.js","sources":["../../../src/lib/minifyGraphQLQuery.ts"],"sourcesContent":["/**\n * Minifies a GraphQL query by removing whitespace where possible.\n *\n * @param query - GraphQL query to minify.\n *\n * @returns A minified version of `query`.\n */\nexport const minifyGraphQLQuery = (query: string): string => {\n\treturn query.replace(\n\t\t/(\\n| )*( |{|})(\\n| )*/gm,\n\t\t(_chars, _spaces, brackets) => brackets,\n\t);\n};\n"],"names":[],"mappings":"AAOa,MAAA,qBAAqB,CAAC,UAAyB;AAC3D,SAAO,MAAM,QACZ,2BACA,CAAC,QAAQ,SAAS,aAAa,QAAQ;AAEzC;"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Throws an error if a given value is nullish.
3
+ *
4
+ * @typeParam Nullable - Value to check.
5
+ * @param a -Nullable value to check.
6
+ * @param error - Error to throw if `a` is nullish.
7
+ *
8
+ * @returns `a`, whose type is narrowed to be non-nullable.
9
+ * @throws Throws the given error if `a` is nullish.
10
+ */
11
+ export declare const orElseThrow: <T>(a: T | null | undefined, error: Error) => T;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const formatValue = (value) => {
4
+ if (Array.isArray(value)) {
5
+ return `[${value.map(formatValue).join(", ")}]`;
6
+ }
7
+ if (typeof value === "string") {
8
+ return `"${value}"`;
9
+ }
10
+ if (value instanceof Date) {
11
+ return `${value.getTime()}`;
12
+ }
13
+ return `${value}`;
14
+ };
15
+ const pathWithArgsPredicate = (name) => {
16
+ const fn = (path, ...args) => {
17
+ const formattedArgs = args.map(formatValue).join(", ");
18
+ const joiner = path && args.length ? ", " : "";
19
+ return `[${name}(${path}${joiner}${formattedArgs})]`;
20
+ };
21
+ return fn;
22
+ };
23
+ const pathPredicate = (name) => {
24
+ const predicateFn = pathWithArgsPredicate(name);
25
+ const fn = (path) => {
26
+ return predicateFn(path);
27
+ };
28
+ return fn;
29
+ };
30
+ const argsPredicate = (name) => {
31
+ const predicateFn = pathWithArgsPredicate(name);
32
+ const fn = (...args) => {
33
+ return predicateFn("", ...args);
34
+ };
35
+ return fn;
36
+ };
37
+ const predicate = {
38
+ at: pathWithArgsPredicate("at"),
39
+ not: pathWithArgsPredicate("not"),
40
+ any: pathWithArgsPredicate("any"),
41
+ in: pathWithArgsPredicate("in"),
42
+ fulltext: pathWithArgsPredicate("fulltext"),
43
+ has: pathPredicate("has"),
44
+ missing: pathPredicate("missing"),
45
+ similar: argsPredicate("similar"),
46
+ geopointNear: pathWithArgsPredicate("geopoint.near"),
47
+ numberLessThan: pathWithArgsPredicate("number.lt"),
48
+ numberGreaterThan: pathWithArgsPredicate("number.gt"),
49
+ numberInRange: pathWithArgsPredicate("number.inRange"),
50
+ dateAfter: pathWithArgsPredicate("date.after"),
51
+ dateBefore: pathWithArgsPredicate("date.before"),
52
+ dateBetween: pathWithArgsPredicate("date.between"),
53
+ dateDayOfMonth: pathWithArgsPredicate("date.day-of-month"),
54
+ dateDayOfMonthAfter: pathWithArgsPredicate("date.day-of-month-after"),
55
+ dateDayOfMonthBefore: pathWithArgsPredicate("date.day-of-month-before"),
56
+ dateDayOfWeek: pathWithArgsPredicate("date.day-of-week"),
57
+ dateDayOfWeekAfter: pathWithArgsPredicate("date.day-of-week-after"),
58
+ dateDayOfWeekBefore: pathWithArgsPredicate("date.day-of-week-before"),
59
+ dateMonth: pathWithArgsPredicate("date.month"),
60
+ dateMonthAfter: pathWithArgsPredicate("date.month-after"),
61
+ dateMonthBefore: pathWithArgsPredicate("date.month-before"),
62
+ dateYear: pathWithArgsPredicate("date.year"),
63
+ dateHour: pathWithArgsPredicate("date.hour"),
64
+ dateHourAfter: pathWithArgsPredicate("date.hour-after"),
65
+ dateHourBefore: pathWithArgsPredicate("date.hour-before")
66
+ };
67
+ exports.predicate = predicate;
68
+ //# sourceMappingURL=predicate.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate.cjs","sources":["../../src/predicate.ts"],"sourcesContent":["/**\n * Formats the value of a predicate element to a stringified version accepted by\n * the Prismic REST API.\n *\n * @param value - Value to format.\n *\n * @returns `value` formatted for the Prismic REST API.\n */\nconst formatValue = (\n\tvalue:\n\t\t| string\n\t\t| number\n\t\t| Date\n\t\t| unknown\n\t\t| (string | number | Date | unknown)[],\n): string => {\n\tif (Array.isArray(value)) {\n\t\treturn `[${value.map(formatValue).join(\", \")}]`;\n\t}\n\n\tif (typeof value === \"string\") {\n\t\treturn `\"${value}\"`;\n\t}\n\n\tif (value instanceof Date) {\n\t\treturn `${value.getTime()}`;\n\t}\n\n\treturn `${value}`;\n};\n\n/**\n * Creates a predicate builder function for predicates with a path and\n * arguments.\n *\n * @typeParam Args - Arguments for the predicate.\n * @param name - Name of the predicate used in the resulting string.\n *\n * @returns Predicate builder function for the given name.\n */\nconst pathWithArgsPredicate = <Args extends unknown[]>(name: string) => {\n\t/**\n\t * @param path - Path to the value to be compared.\n\t */\n\tconst fn = (path: string, ...args: Args): string => {\n\t\tconst formattedArgs = args.map(formatValue).join(\", \");\n\t\tconst joiner = path && args.length ? \", \" : \"\";\n\n\t\treturn `[${name}(${path}${joiner}${formattedArgs})]`;\n\t};\n\n\treturn fn;\n};\n\n/**\n * Creates a predicate builder function for predicates with only a path.\n *\n * @param name - Name of the predicate used in the resulting string.\n *\n * @returns Predicate builder function for the given name.\n */\nconst pathPredicate = (name: string) => {\n\tconst predicateFn = pathWithArgsPredicate(name);\n\n\t/**\n\t * @param path - Path for the predicate.\n\t */\n\tconst fn = (path: string): string => {\n\t\treturn predicateFn(path);\n\t};\n\n\treturn fn;\n};\n\n/**\n * Creates a predicate builder function for predicates with only arguments and\n * no path.\n *\n * @param name - Name of the predicate used in the resulting string.\n *\n * @returns Predicate builder function for the given name.\n */\nconst argsPredicate = <Args extends unknown[]>(name: string) => {\n\tconst predicateFn = pathWithArgsPredicate<Args>(name);\n\n\t/**\n\t * @param args - Arguments for the predicate.\n\t */\n\tconst fn = (...args: Args): string => {\n\t\treturn predicateFn(\"\", ...args);\n\t};\n\n\treturn fn;\n};\n\nexport const predicate = {\n\t/**\n\t * The `at` predicate checks that the path matches the described value\n\t * exactly. It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#at}\n\t */\n\tat: pathWithArgsPredicate<\n\t\t[value: string | number | boolean | Date | string[]]\n\t>(\"at\"),\n\n\t/**\n\t * The `not` predicate checks that the path doesn't match the provided value\n\t * exactly. It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#not}\n\t */\n\tnot: pathWithArgsPredicate<\n\t\t[value: string | number | boolean | Date | string[]]\n\t>(\"not\"),\n\n\t/**\n\t * The `any` predicate takes an array of values. It works exactly the same way\n\t * as the `at` operator, but checks whether the fragment matches any of the\n\t * values in the array.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#any}\n\t */\n\tany: pathWithArgsPredicate<[values: (string | number | boolean | Date)[]]>(\n\t\t\"any\",\n\t),\n\n\t/**\n\t * The `in` predicate is used specifically to retrieve an array of documents\n\t * by their IDs or UIDs. This predicate is much more efficient at this than\n\t * the any predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#in}\n\t */\n\tin: pathWithArgsPredicate<[values: string[]]>(\"in\"),\n\n\t/**\n\t * The `fulltext` predicate provides two capabilities:\n\t *\n\t * 1. Checking if a certain string is anywhere inside a document (this is what\n\t * you should use to make your project's search engine feature)\n\t * 2. Checking if the string is contained inside a specific custom type’s Rich\n\t * Text or Key Text fragment.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#fulltext}\n\t */\n\tfulltext: pathWithArgsPredicate<[searchTerms: string]>(\"fulltext\"),\n\n\t/**\n\t * The `has` predicate checks whether a fragment has a value. It will return\n\t * all the documents of the specified type that contain a value for the\n\t * specified field.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#has}\n\t */\n\thas: pathPredicate(\"has\"),\n\n\t/**\n\t * The `missing` predicate checks if a fragment doesn't have a value. It will\n\t * return all the documents of the specified type that do not contain a value\n\t * for the specified field.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#missing}\n\t */\n\tmissing: pathPredicate(\"missing\"),\n\n\t/**\n\t * The `similar` predicate takes the ID of a document, and returns a list of\n\t * documents with similar content. This allows you to build an automated\n\t * content discovery feature (for example, a \"Related posts\" section).\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#similar}\n\t */\n\tsimilar: argsPredicate<[id: string, value: number]>(\"similar\"),\n\n\t/**\n\t * The `geopoint.near` predicate checks that the value in the path is within\n\t * the radius of the given coordinates.\n\t *\n\t * This predicate will only work for a GeoPoint field.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#near}\n\t */\n\tgeopointNear:\n\t\tpathWithArgsPredicate<\n\t\t\t[latitude: number, longitude: number, radius: number]\n\t\t>(\"geopoint.near\"),\n\n\t/**\n\t * The `number.lt` predicate checks that the value in the number field is less\n\t * than the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#lt-less-than}\n\t */\n\tnumberLessThan: pathWithArgsPredicate<[value: number]>(\"number.lt\"),\n\n\t/**\n\t * The `number.gt` predicate checks that the value in the number field is\n\t * greater than the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#gt-greater-than}\n\t */\n\tnumberGreaterThan: pathWithArgsPredicate<[value: number]>(\"number.gt\"),\n\n\t/**\n\t * The `number.inRange` predicate checks that the value in the path is within\n\t * the two values passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#inrange}\n\t */\n\tnumberInRange:\n\t\tpathWithArgsPredicate<[lowerLimit: number, upperLimit: number]>(\n\t\t\t\"number.inRange\",\n\t\t),\n\n\t/**\n\t * The `date.after` predicate checks that the value in the path is after the\n\t * date value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#after}\n\t */\n\tdateAfter:\n\t\tpathWithArgsPredicate<[date: string | number | Date]>(\"date.after\"),\n\n\t/**\n\t * The `date.before` predicate checks that the value in the path is before the\n\t * date value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#before}\n\t */\n\tdateBefore:\n\t\tpathWithArgsPredicate<[date: string | number | Date]>(\"date.before\"),\n\n\t/**\n\t * The `date.between` predicate checks that the value in the path is within\n\t * the date values passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#between}\n\t */\n\tdateBetween:\n\t\tpathWithArgsPredicate<\n\t\t\t[startDate: string | number | Date, endDate: string | number | Date]\n\t\t>(\"date.between\"),\n\n\t/**\n\t * The `date.day-of-month` predicate checks that the value in the path is\n\t * equal to the day of the month passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonth}\n\t */\n\tdateDayOfMonth: pathWithArgsPredicate<[day: number]>(\"date.day-of-month\"),\n\n\t/**\n\t * The `date.day-of-month-after` predicate checks that the value in the path\n\t * is after the day of the month passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthafter}\n\t */\n\tdateDayOfMonthAfter: pathWithArgsPredicate<[day: number]>(\n\t\t\"date.day-of-month-after\",\n\t),\n\n\t/**\n\t * The `date.day-of-month-before` predicate checks that the value in the path\n\t * is before the day of the month passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthbefore}\n\t */\n\tdateDayOfMonthBefore: pathWithArgsPredicate<[day: number]>(\n\t\t\"date.day-of-month-before\",\n\t),\n\n\t/**\n\t * The `date.day-of-week` predicate checks that the value in the path is equal\n\t * to the day of the week passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweek}\n\t */\n\tdateDayOfWeek:\n\t\tpathWithArgsPredicate<[day: string | number]>(\"date.day-of-week\"),\n\n\t/**\n\t * The `date.day-of-week-after` predicate checks that the value in the path is\n\t * after the day of the week passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekafter}\n\t */\n\tdateDayOfWeekAfter: pathWithArgsPredicate<[day: string | number]>(\n\t\t\"date.day-of-week-after\",\n\t),\n\n\t/**\n\t * The date.day-of-week-before predicate checks that the value in the path is\n\t * before the day of the week passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekbefore}\n\t */\n\tdateDayOfWeekBefore: pathWithArgsPredicate<[day: string | number]>(\n\t\t\"date.day-of-week-before\",\n\t),\n\n\t/**\n\t * The `date.month` predicate checks that the value in the path occurs in the\n\t * month value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#month}\n\t */\n\tdateMonth: pathWithArgsPredicate<[month: string | number]>(\"date.month\"),\n\n\t/**\n\t * The `date.month-after` predicate checks that the value in the path occurs\n\t * in any month after the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthafter}\n\t */\n\tdateMonthAfter:\n\t\tpathWithArgsPredicate<[month: string | number]>(\"date.month-after\"),\n\n\t/**\n\t * The `date.month-before` predicate checks that the value in the path occurs\n\t * in any month before the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthbefore}\n\t */\n\tdateMonthBefore:\n\t\tpathWithArgsPredicate<[month: string | number]>(\"date.month-before\"),\n\n\t/**\n\t * The `date.year` predicate checks that the value in the path occurs in the\n\t * year value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#year}\n\t */\n\tdateYear: pathWithArgsPredicate<[year: number]>(\"date.year\"),\n\n\t/**\n\t * The `date.hour` predicate checks that the value in the path occurs within\n\t * the hour value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hour}\n\t */\n\tdateHour: pathWithArgsPredicate<[hour: number]>(\"date.hour\"),\n\n\t/**\n\t * The `date.hour-after` predicate checks that the value in the path occurs\n\t * after the hour value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourafter}\n\t */\n\tdateHourAfter: pathWithArgsPredicate<[hour: number]>(\"date.hour-after\"),\n\n\t/**\n\t * The `date.hour-before` predicate checks that the value in the path occurs\n\t * before the hour value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourbefore}\n\t */\n\tdateHourBefore: pathWithArgsPredicate<[hour: number]>(\"date.hour-before\"),\n};\n"],"names":[],"mappings":";;AAQA,MAAM,cAAc,CACnB,UAMW;AACP,MAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAO,IAAI,MAAM,IAAI,WAAW,EAAE,KAAK,IAAI;AAAA,EAC3C;AAEG,MAAA,OAAO,UAAU,UAAU;AAC9B,WAAO,IAAI;AAAA,EACX;AAED,MAAI,iBAAiB,MAAM;AACnB,WAAA,GAAG,MAAM,QAAO;AAAA,EACvB;AAED,SAAO,GAAG;AACX;AAWA,MAAM,wBAAwB,CAAyB,SAAgB;AAIhE,QAAA,KAAK,CAAC,SAAiB,SAAsB;AAClD,UAAM,gBAAgB,KAAK,IAAI,WAAW,EAAE,KAAK,IAAI;AACrD,UAAM,SAAS,QAAQ,KAAK,SAAS,OAAO;AAErC,WAAA,IAAI,QAAQ,OAAO,SAAS;AAAA,EAAA;AAG7B,SAAA;AACR;AASA,MAAM,gBAAgB,CAAC,SAAgB;AAChC,QAAA,cAAc,sBAAsB,IAAI;AAKxC,QAAA,KAAK,CAAC,SAAwB;AACnC,WAAO,YAAY,IAAI;AAAA,EAAA;AAGjB,SAAA;AACR;AAUA,MAAM,gBAAgB,CAAyB,SAAgB;AACxD,QAAA,cAAc,sBAA4B,IAAI;AAK9C,QAAA,KAAK,IAAI,SAAsB;AAC7B,WAAA,YAAY,IAAI,GAAG,IAAI;AAAA,EAAA;AAGxB,SAAA;AACR;AAEO,MAAM,YAAY;AAAA,EAOxB,IAAI,sBAEF,IAAI;AAAA,EAQN,KAAK,sBAEH,KAAK;AAAA,EASP,KAAK,sBACJ,KAAK;AAAA,EAUN,IAAI,sBAA0C,IAAI;AAAA,EAYlD,UAAU,sBAA6C,UAAU;AAAA,EASjE,KAAK,cAAc,KAAK;AAAA,EASxB,SAAS,cAAc,SAAS;AAAA,EAShC,SAAS,cAA2C,SAAS;AAAA,EAU7D,cACC,sBAEE,eAAe;AAAA,EAQlB,gBAAgB,sBAAuC,WAAW;AAAA,EAQlE,mBAAmB,sBAAuC,WAAW;AAAA,EAQrE,eACC,sBACC,gBAAgB;AAAA,EASlB,WACC,sBAAsD,YAAY;AAAA,EAQnE,YACC,sBAAsD,aAAa;AAAA,EAQpE,aACC,sBAEE,cAAc;AAAA,EAQjB,gBAAgB,sBAAqC,mBAAmB;AAAA,EAQxE,qBAAqB,sBACpB,yBAAyB;AAAA,EAS1B,sBAAsB,sBACrB,0BAA0B;AAAA,EAS3B,eACC,sBAA8C,kBAAkB;AAAA,EAQjE,oBAAoB,sBACnB,wBAAwB;AAAA,EASzB,qBAAqB,sBACpB,yBAAyB;AAAA,EAS1B,WAAW,sBAAgD,YAAY;AAAA,EAQvE,gBACC,sBAAgD,kBAAkB;AAAA,EAQnE,iBACC,sBAAgD,mBAAmB;AAAA,EAQpE,UAAU,sBAAsC,WAAW;AAAA,EAQ3D,UAAU,sBAAsC,WAAW;AAAA,EAQ3D,eAAe,sBAAsC,iBAAiB;AAAA,EAQtE,gBAAgB,sBAAsC,kBAAkB;;;"}
@@ -0,0 +1,209 @@
1
+ export declare const predicate: {
2
+ /**
3
+ * The `at` predicate checks that the path matches the described value
4
+ * exactly. It takes a single value for a field or an array (only for tags).
5
+ *
6
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#at}
7
+ */
8
+ at: (path: string, value: string | number | boolean | string[] | Date) => string;
9
+ /**
10
+ * The `not` predicate checks that the path doesn't match the provided value
11
+ * exactly. It takes a single value for a field or an array (only for tags).
12
+ *
13
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#not}
14
+ */
15
+ not: (path: string, value: string | number | boolean | string[] | Date) => string;
16
+ /**
17
+ * The `any` predicate takes an array of values. It works exactly the same way
18
+ * as the `at` operator, but checks whether the fragment matches any of the
19
+ * values in the array.
20
+ *
21
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#any}
22
+ */
23
+ any: (path: string, values: (string | number | boolean | Date)[]) => string;
24
+ /**
25
+ * The `in` predicate is used specifically to retrieve an array of documents
26
+ * by their IDs or UIDs. This predicate is much more efficient at this than
27
+ * the any predicate.
28
+ *
29
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#in}
30
+ */
31
+ in: (path: string, values: string[]) => string;
32
+ /**
33
+ * The `fulltext` predicate provides two capabilities:
34
+ *
35
+ * 1. Checking if a certain string is anywhere inside a document (this is what
36
+ * you should use to make your project's search engine feature)
37
+ * 2. Checking if the string is contained inside a specific custom type’s Rich
38
+ * Text or Key Text fragment.
39
+ *
40
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#fulltext}
41
+ */
42
+ fulltext: (path: string, searchTerms: string) => string;
43
+ /**
44
+ * The `has` predicate checks whether a fragment has a value. It will return
45
+ * all the documents of the specified type that contain a value for the
46
+ * specified field.
47
+ *
48
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#has}
49
+ */
50
+ has: (path: string) => string;
51
+ /**
52
+ * The `missing` predicate checks if a fragment doesn't have a value. It will
53
+ * return all the documents of the specified type that do not contain a value
54
+ * for the specified field.
55
+ *
56
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#missing}
57
+ */
58
+ missing: (path: string) => string;
59
+ /**
60
+ * The `similar` predicate takes the ID of a document, and returns a list of
61
+ * documents with similar content. This allows you to build an automated
62
+ * content discovery feature (for example, a "Related posts" section).
63
+ *
64
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#similar}
65
+ */
66
+ similar: (id: string, value: number) => string;
67
+ /**
68
+ * The `geopoint.near` predicate checks that the value in the path is within
69
+ * the radius of the given coordinates.
70
+ *
71
+ * This predicate will only work for a GeoPoint field.
72
+ *
73
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#near}
74
+ */
75
+ geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
76
+ /**
77
+ * The `number.lt` predicate checks that the value in the number field is less
78
+ * than the value passed into the predicate.
79
+ *
80
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#lt-less-than}
81
+ */
82
+ numberLessThan: (path: string, value: number) => string;
83
+ /**
84
+ * The `number.gt` predicate checks that the value in the number field is
85
+ * greater than the value passed into the predicate.
86
+ *
87
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#gt-greater-than}
88
+ */
89
+ numberGreaterThan: (path: string, value: number) => string;
90
+ /**
91
+ * The `number.inRange` predicate checks that the value in the path is within
92
+ * the two values passed into the predicate.
93
+ *
94
+ * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#inrange}
95
+ */
96
+ numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
97
+ /**
98
+ * The `date.after` predicate checks that the value in the path is after the
99
+ * date value passed into the predicate.
100
+ *
101
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#after}
102
+ */
103
+ dateAfter: (path: string, date: string | number | Date) => string;
104
+ /**
105
+ * The `date.before` predicate checks that the value in the path is before the
106
+ * date value passed into the predicate.
107
+ *
108
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#before}
109
+ */
110
+ dateBefore: (path: string, date: string | number | Date) => string;
111
+ /**
112
+ * The `date.between` predicate checks that the value in the path is within
113
+ * the date values passed into the predicate.
114
+ *
115
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#between}
116
+ */
117
+ dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
118
+ /**
119
+ * The `date.day-of-month` predicate checks that the value in the path is
120
+ * equal to the day of the month passed into the predicate.
121
+ *
122
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonth}
123
+ */
124
+ dateDayOfMonth: (path: string, day: number) => string;
125
+ /**
126
+ * The `date.day-of-month-after` predicate checks that the value in the path
127
+ * is after the day of the month passed into the predicate.
128
+ *
129
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthafter}
130
+ */
131
+ dateDayOfMonthAfter: (path: string, day: number) => string;
132
+ /**
133
+ * The `date.day-of-month-before` predicate checks that the value in the path
134
+ * is before the day of the month passed into the predicate.
135
+ *
136
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthbefore}
137
+ */
138
+ dateDayOfMonthBefore: (path: string, day: number) => string;
139
+ /**
140
+ * The `date.day-of-week` predicate checks that the value in the path is equal
141
+ * to the day of the week passed into the predicate.
142
+ *
143
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweek}
144
+ */
145
+ dateDayOfWeek: (path: string, day: string | number) => string;
146
+ /**
147
+ * The `date.day-of-week-after` predicate checks that the value in the path is
148
+ * after the day of the week passed into the predicate.
149
+ *
150
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekafter}
151
+ */
152
+ dateDayOfWeekAfter: (path: string, day: string | number) => string;
153
+ /**
154
+ * The date.day-of-week-before predicate checks that the value in the path is
155
+ * before the day of the week passed into the predicate.
156
+ *
157
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekbefore}
158
+ */
159
+ dateDayOfWeekBefore: (path: string, day: string | number) => string;
160
+ /**
161
+ * The `date.month` predicate checks that the value in the path occurs in the
162
+ * month value passed into the predicate.
163
+ *
164
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#month}
165
+ */
166
+ dateMonth: (path: string, month: string | number) => string;
167
+ /**
168
+ * The `date.month-after` predicate checks that the value in the path occurs
169
+ * in any month after the value passed into the predicate.
170
+ *
171
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthafter}
172
+ */
173
+ dateMonthAfter: (path: string, month: string | number) => string;
174
+ /**
175
+ * The `date.month-before` predicate checks that the value in the path occurs
176
+ * in any month before the value passed into the predicate.
177
+ *
178
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthbefore}
179
+ */
180
+ dateMonthBefore: (path: string, month: string | number) => string;
181
+ /**
182
+ * The `date.year` predicate checks that the value in the path occurs in the
183
+ * year value passed into the predicate.
184
+ *
185
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#year}
186
+ */
187
+ dateYear: (path: string, year: number) => string;
188
+ /**
189
+ * The `date.hour` predicate checks that the value in the path occurs within
190
+ * the hour value passed into the predicate.
191
+ *
192
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hour}
193
+ */
194
+ dateHour: (path: string, hour: number) => string;
195
+ /**
196
+ * The `date.hour-after` predicate checks that the value in the path occurs
197
+ * after the hour value passed into the predicate.
198
+ *
199
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourafter}
200
+ */
201
+ dateHourAfter: (path: string, hour: number) => string;
202
+ /**
203
+ * The `date.hour-before` predicate checks that the value in the path occurs
204
+ * before the hour value passed into the predicate.
205
+ *
206
+ * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourbefore}
207
+ */
208
+ dateHourBefore: (path: string, hour: number) => string;
209
+ };
@@ -0,0 +1,68 @@
1
+ const formatValue = (value) => {
2
+ if (Array.isArray(value)) {
3
+ return `[${value.map(formatValue).join(", ")}]`;
4
+ }
5
+ if (typeof value === "string") {
6
+ return `"${value}"`;
7
+ }
8
+ if (value instanceof Date) {
9
+ return `${value.getTime()}`;
10
+ }
11
+ return `${value}`;
12
+ };
13
+ const pathWithArgsPredicate = (name) => {
14
+ const fn = (path, ...args) => {
15
+ const formattedArgs = args.map(formatValue).join(", ");
16
+ const joiner = path && args.length ? ", " : "";
17
+ return `[${name}(${path}${joiner}${formattedArgs})]`;
18
+ };
19
+ return fn;
20
+ };
21
+ const pathPredicate = (name) => {
22
+ const predicateFn = pathWithArgsPredicate(name);
23
+ const fn = (path) => {
24
+ return predicateFn(path);
25
+ };
26
+ return fn;
27
+ };
28
+ const argsPredicate = (name) => {
29
+ const predicateFn = pathWithArgsPredicate(name);
30
+ const fn = (...args) => {
31
+ return predicateFn("", ...args);
32
+ };
33
+ return fn;
34
+ };
35
+ const predicate = {
36
+ at: pathWithArgsPredicate("at"),
37
+ not: pathWithArgsPredicate("not"),
38
+ any: pathWithArgsPredicate("any"),
39
+ in: pathWithArgsPredicate("in"),
40
+ fulltext: pathWithArgsPredicate("fulltext"),
41
+ has: pathPredicate("has"),
42
+ missing: pathPredicate("missing"),
43
+ similar: argsPredicate("similar"),
44
+ geopointNear: pathWithArgsPredicate("geopoint.near"),
45
+ numberLessThan: pathWithArgsPredicate("number.lt"),
46
+ numberGreaterThan: pathWithArgsPredicate("number.gt"),
47
+ numberInRange: pathWithArgsPredicate("number.inRange"),
48
+ dateAfter: pathWithArgsPredicate("date.after"),
49
+ dateBefore: pathWithArgsPredicate("date.before"),
50
+ dateBetween: pathWithArgsPredicate("date.between"),
51
+ dateDayOfMonth: pathWithArgsPredicate("date.day-of-month"),
52
+ dateDayOfMonthAfter: pathWithArgsPredicate("date.day-of-month-after"),
53
+ dateDayOfMonthBefore: pathWithArgsPredicate("date.day-of-month-before"),
54
+ dateDayOfWeek: pathWithArgsPredicate("date.day-of-week"),
55
+ dateDayOfWeekAfter: pathWithArgsPredicate("date.day-of-week-after"),
56
+ dateDayOfWeekBefore: pathWithArgsPredicate("date.day-of-week-before"),
57
+ dateMonth: pathWithArgsPredicate("date.month"),
58
+ dateMonthAfter: pathWithArgsPredicate("date.month-after"),
59
+ dateMonthBefore: pathWithArgsPredicate("date.month-before"),
60
+ dateYear: pathWithArgsPredicate("date.year"),
61
+ dateHour: pathWithArgsPredicate("date.hour"),
62
+ dateHourAfter: pathWithArgsPredicate("date.hour-after"),
63
+ dateHourBefore: pathWithArgsPredicate("date.hour-before")
64
+ };
65
+ export {
66
+ predicate
67
+ };
68
+ //# sourceMappingURL=predicate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate.js","sources":["../../src/predicate.ts"],"sourcesContent":["/**\n * Formats the value of a predicate element to a stringified version accepted by\n * the Prismic REST API.\n *\n * @param value - Value to format.\n *\n * @returns `value` formatted for the Prismic REST API.\n */\nconst formatValue = (\n\tvalue:\n\t\t| string\n\t\t| number\n\t\t| Date\n\t\t| unknown\n\t\t| (string | number | Date | unknown)[],\n): string => {\n\tif (Array.isArray(value)) {\n\t\treturn `[${value.map(formatValue).join(\", \")}]`;\n\t}\n\n\tif (typeof value === \"string\") {\n\t\treturn `\"${value}\"`;\n\t}\n\n\tif (value instanceof Date) {\n\t\treturn `${value.getTime()}`;\n\t}\n\n\treturn `${value}`;\n};\n\n/**\n * Creates a predicate builder function for predicates with a path and\n * arguments.\n *\n * @typeParam Args - Arguments for the predicate.\n * @param name - Name of the predicate used in the resulting string.\n *\n * @returns Predicate builder function for the given name.\n */\nconst pathWithArgsPredicate = <Args extends unknown[]>(name: string) => {\n\t/**\n\t * @param path - Path to the value to be compared.\n\t */\n\tconst fn = (path: string, ...args: Args): string => {\n\t\tconst formattedArgs = args.map(formatValue).join(\", \");\n\t\tconst joiner = path && args.length ? \", \" : \"\";\n\n\t\treturn `[${name}(${path}${joiner}${formattedArgs})]`;\n\t};\n\n\treturn fn;\n};\n\n/**\n * Creates a predicate builder function for predicates with only a path.\n *\n * @param name - Name of the predicate used in the resulting string.\n *\n * @returns Predicate builder function for the given name.\n */\nconst pathPredicate = (name: string) => {\n\tconst predicateFn = pathWithArgsPredicate(name);\n\n\t/**\n\t * @param path - Path for the predicate.\n\t */\n\tconst fn = (path: string): string => {\n\t\treturn predicateFn(path);\n\t};\n\n\treturn fn;\n};\n\n/**\n * Creates a predicate builder function for predicates with only arguments and\n * no path.\n *\n * @param name - Name of the predicate used in the resulting string.\n *\n * @returns Predicate builder function for the given name.\n */\nconst argsPredicate = <Args extends unknown[]>(name: string) => {\n\tconst predicateFn = pathWithArgsPredicate<Args>(name);\n\n\t/**\n\t * @param args - Arguments for the predicate.\n\t */\n\tconst fn = (...args: Args): string => {\n\t\treturn predicateFn(\"\", ...args);\n\t};\n\n\treturn fn;\n};\n\nexport const predicate = {\n\t/**\n\t * The `at` predicate checks that the path matches the described value\n\t * exactly. It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#at}\n\t */\n\tat: pathWithArgsPredicate<\n\t\t[value: string | number | boolean | Date | string[]]\n\t>(\"at\"),\n\n\t/**\n\t * The `not` predicate checks that the path doesn't match the provided value\n\t * exactly. It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#not}\n\t */\n\tnot: pathWithArgsPredicate<\n\t\t[value: string | number | boolean | Date | string[]]\n\t>(\"not\"),\n\n\t/**\n\t * The `any` predicate takes an array of values. It works exactly the same way\n\t * as the `at` operator, but checks whether the fragment matches any of the\n\t * values in the array.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#any}\n\t */\n\tany: pathWithArgsPredicate<[values: (string | number | boolean | Date)[]]>(\n\t\t\"any\",\n\t),\n\n\t/**\n\t * The `in` predicate is used specifically to retrieve an array of documents\n\t * by their IDs or UIDs. This predicate is much more efficient at this than\n\t * the any predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#in}\n\t */\n\tin: pathWithArgsPredicate<[values: string[]]>(\"in\"),\n\n\t/**\n\t * The `fulltext` predicate provides two capabilities:\n\t *\n\t * 1. Checking if a certain string is anywhere inside a document (this is what\n\t * you should use to make your project's search engine feature)\n\t * 2. Checking if the string is contained inside a specific custom type’s Rich\n\t * Text or Key Text fragment.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#fulltext}\n\t */\n\tfulltext: pathWithArgsPredicate<[searchTerms: string]>(\"fulltext\"),\n\n\t/**\n\t * The `has` predicate checks whether a fragment has a value. It will return\n\t * all the documents of the specified type that contain a value for the\n\t * specified field.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#has}\n\t */\n\thas: pathPredicate(\"has\"),\n\n\t/**\n\t * The `missing` predicate checks if a fragment doesn't have a value. It will\n\t * return all the documents of the specified type that do not contain a value\n\t * for the specified field.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#missing}\n\t */\n\tmissing: pathPredicate(\"missing\"),\n\n\t/**\n\t * The `similar` predicate takes the ID of a document, and returns a list of\n\t * documents with similar content. This allows you to build an automated\n\t * content discovery feature (for example, a \"Related posts\" section).\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#similar}\n\t */\n\tsimilar: argsPredicate<[id: string, value: number]>(\"similar\"),\n\n\t/**\n\t * The `geopoint.near` predicate checks that the value in the path is within\n\t * the radius of the given coordinates.\n\t *\n\t * This predicate will only work for a GeoPoint field.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#near}\n\t */\n\tgeopointNear:\n\t\tpathWithArgsPredicate<\n\t\t\t[latitude: number, longitude: number, radius: number]\n\t\t>(\"geopoint.near\"),\n\n\t/**\n\t * The `number.lt` predicate checks that the value in the number field is less\n\t * than the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#lt-less-than}\n\t */\n\tnumberLessThan: pathWithArgsPredicate<[value: number]>(\"number.lt\"),\n\n\t/**\n\t * The `number.gt` predicate checks that the value in the number field is\n\t * greater than the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#gt-greater-than}\n\t */\n\tnumberGreaterThan: pathWithArgsPredicate<[value: number]>(\"number.gt\"),\n\n\t/**\n\t * The `number.inRange` predicate checks that the value in the path is within\n\t * the two values passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#inrange}\n\t */\n\tnumberInRange:\n\t\tpathWithArgsPredicate<[lowerLimit: number, upperLimit: number]>(\n\t\t\t\"number.inRange\",\n\t\t),\n\n\t/**\n\t * The `date.after` predicate checks that the value in the path is after the\n\t * date value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#after}\n\t */\n\tdateAfter:\n\t\tpathWithArgsPredicate<[date: string | number | Date]>(\"date.after\"),\n\n\t/**\n\t * The `date.before` predicate checks that the value in the path is before the\n\t * date value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#before}\n\t */\n\tdateBefore:\n\t\tpathWithArgsPredicate<[date: string | number | Date]>(\"date.before\"),\n\n\t/**\n\t * The `date.between` predicate checks that the value in the path is within\n\t * the date values passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#between}\n\t */\n\tdateBetween:\n\t\tpathWithArgsPredicate<\n\t\t\t[startDate: string | number | Date, endDate: string | number | Date]\n\t\t>(\"date.between\"),\n\n\t/**\n\t * The `date.day-of-month` predicate checks that the value in the path is\n\t * equal to the day of the month passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonth}\n\t */\n\tdateDayOfMonth: pathWithArgsPredicate<[day: number]>(\"date.day-of-month\"),\n\n\t/**\n\t * The `date.day-of-month-after` predicate checks that the value in the path\n\t * is after the day of the month passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthafter}\n\t */\n\tdateDayOfMonthAfter: pathWithArgsPredicate<[day: number]>(\n\t\t\"date.day-of-month-after\",\n\t),\n\n\t/**\n\t * The `date.day-of-month-before` predicate checks that the value in the path\n\t * is before the day of the month passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthbefore}\n\t */\n\tdateDayOfMonthBefore: pathWithArgsPredicate<[day: number]>(\n\t\t\"date.day-of-month-before\",\n\t),\n\n\t/**\n\t * The `date.day-of-week` predicate checks that the value in the path is equal\n\t * to the day of the week passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweek}\n\t */\n\tdateDayOfWeek:\n\t\tpathWithArgsPredicate<[day: string | number]>(\"date.day-of-week\"),\n\n\t/**\n\t * The `date.day-of-week-after` predicate checks that the value in the path is\n\t * after the day of the week passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekafter}\n\t */\n\tdateDayOfWeekAfter: pathWithArgsPredicate<[day: string | number]>(\n\t\t\"date.day-of-week-after\",\n\t),\n\n\t/**\n\t * The date.day-of-week-before predicate checks that the value in the path is\n\t * before the day of the week passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekbefore}\n\t */\n\tdateDayOfWeekBefore: pathWithArgsPredicate<[day: string | number]>(\n\t\t\"date.day-of-week-before\",\n\t),\n\n\t/**\n\t * The `date.month` predicate checks that the value in the path occurs in the\n\t * month value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#month}\n\t */\n\tdateMonth: pathWithArgsPredicate<[month: string | number]>(\"date.month\"),\n\n\t/**\n\t * The `date.month-after` predicate checks that the value in the path occurs\n\t * in any month after the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthafter}\n\t */\n\tdateMonthAfter:\n\t\tpathWithArgsPredicate<[month: string | number]>(\"date.month-after\"),\n\n\t/**\n\t * The `date.month-before` predicate checks that the value in the path occurs\n\t * in any month before the value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthbefore}\n\t */\n\tdateMonthBefore:\n\t\tpathWithArgsPredicate<[month: string | number]>(\"date.month-before\"),\n\n\t/**\n\t * The `date.year` predicate checks that the value in the path occurs in the\n\t * year value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#year}\n\t */\n\tdateYear: pathWithArgsPredicate<[year: number]>(\"date.year\"),\n\n\t/**\n\t * The `date.hour` predicate checks that the value in the path occurs within\n\t * the hour value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hour}\n\t */\n\tdateHour: pathWithArgsPredicate<[hour: number]>(\"date.hour\"),\n\n\t/**\n\t * The `date.hour-after` predicate checks that the value in the path occurs\n\t * after the hour value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourafter}\n\t */\n\tdateHourAfter: pathWithArgsPredicate<[hour: number]>(\"date.hour-after\"),\n\n\t/**\n\t * The `date.hour-before` predicate checks that the value in the path occurs\n\t * before the hour value passed into the predicate.\n\t *\n\t * {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourbefore}\n\t */\n\tdateHourBefore: pathWithArgsPredicate<[hour: number]>(\"date.hour-before\"),\n};\n"],"names":[],"mappings":"AAQA,MAAM,cAAc,CACnB,UAMW;AACP,MAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAO,IAAI,MAAM,IAAI,WAAW,EAAE,KAAK,IAAI;AAAA,EAC3C;AAEG,MAAA,OAAO,UAAU,UAAU;AAC9B,WAAO,IAAI;AAAA,EACX;AAED,MAAI,iBAAiB,MAAM;AACnB,WAAA,GAAG,MAAM,QAAO;AAAA,EACvB;AAED,SAAO,GAAG;AACX;AAWA,MAAM,wBAAwB,CAAyB,SAAgB;AAIhE,QAAA,KAAK,CAAC,SAAiB,SAAsB;AAClD,UAAM,gBAAgB,KAAK,IAAI,WAAW,EAAE,KAAK,IAAI;AACrD,UAAM,SAAS,QAAQ,KAAK,SAAS,OAAO;AAErC,WAAA,IAAI,QAAQ,OAAO,SAAS;AAAA,EAAA;AAG7B,SAAA;AACR;AASA,MAAM,gBAAgB,CAAC,SAAgB;AAChC,QAAA,cAAc,sBAAsB,IAAI;AAKxC,QAAA,KAAK,CAAC,SAAwB;AACnC,WAAO,YAAY,IAAI;AAAA,EAAA;AAGjB,SAAA;AACR;AAUA,MAAM,gBAAgB,CAAyB,SAAgB;AACxD,QAAA,cAAc,sBAA4B,IAAI;AAK9C,QAAA,KAAK,IAAI,SAAsB;AAC7B,WAAA,YAAY,IAAI,GAAG,IAAI;AAAA,EAAA;AAGxB,SAAA;AACR;AAEO,MAAM,YAAY;AAAA,EAOxB,IAAI,sBAEF,IAAI;AAAA,EAQN,KAAK,sBAEH,KAAK;AAAA,EASP,KAAK,sBACJ,KAAK;AAAA,EAUN,IAAI,sBAA0C,IAAI;AAAA,EAYlD,UAAU,sBAA6C,UAAU;AAAA,EASjE,KAAK,cAAc,KAAK;AAAA,EASxB,SAAS,cAAc,SAAS;AAAA,EAShC,SAAS,cAA2C,SAAS;AAAA,EAU7D,cACC,sBAEE,eAAe;AAAA,EAQlB,gBAAgB,sBAAuC,WAAW;AAAA,EAQlE,mBAAmB,sBAAuC,WAAW;AAAA,EAQrE,eACC,sBACC,gBAAgB;AAAA,EASlB,WACC,sBAAsD,YAAY;AAAA,EAQnE,YACC,sBAAsD,aAAa;AAAA,EAQpE,aACC,sBAEE,cAAc;AAAA,EAQjB,gBAAgB,sBAAqC,mBAAmB;AAAA,EAQxE,qBAAqB,sBACpB,yBAAyB;AAAA,EAS1B,sBAAsB,sBACrB,0BAA0B;AAAA,EAS3B,eACC,sBAA8C,kBAAkB;AAAA,EAQjE,oBAAoB,sBACnB,wBAAwB;AAAA,EASzB,qBAAqB,sBACpB,yBAAyB;AAAA,EAS1B,WAAW,sBAAgD,YAAY;AAAA,EAQvE,gBACC,sBAAgD,kBAAkB;AAAA,EAQnE,iBACC,sBAAgD,mBAAmB;AAAA,EAQpE,UAAU,sBAAsC,WAAW;AAAA,EAQ3D,UAAU,sBAAsC,WAAW;AAAA,EAQ3D,eAAe,sBAAsC,iBAAiB;AAAA,EAQtE,gBAAgB,sBAAsC,kBAAkB;;"}