prismic-ts-codegen 0.1.13 → 0.1.14

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 (147) hide show
  1. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs +59 -0
  2. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs.map +1 -0
  3. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js +59 -0
  4. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js.map +1 -0
  5. package/dist/_node_modules/@prismicio/client/dist/cookie.cjs +5 -0
  6. package/dist/_node_modules/@prismicio/client/dist/cookie.cjs.map +1 -0
  7. package/dist/_node_modules/@prismicio/client/dist/cookie.js +5 -0
  8. package/dist/_node_modules/@prismicio/client/dist/cookie.js.map +1 -0
  9. package/dist/_node_modules/@prismicio/client/dist/createClient.cjs +1138 -0
  10. package/dist/_node_modules/@prismicio/client/dist/createClient.cjs.map +1 -0
  11. package/dist/_node_modules/@prismicio/client/dist/createClient.js +1138 -0
  12. package/dist/_node_modules/@prismicio/client/dist/createClient.js.map +1 -0
  13. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs +7 -0
  14. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs.map +1 -0
  15. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js +7 -0
  16. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js.map +1 -0
  17. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs +7 -0
  18. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs.map +1 -0
  19. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js +7 -0
  20. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js.map +1 -0
  21. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs +7 -0
  22. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs.map +1 -0
  23. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js +7 -0
  24. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js.map +1 -0
  25. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs +19 -0
  26. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs.map +1 -0
  27. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js +19 -0
  28. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js.map +1 -0
  29. package/dist/_node_modules/@prismicio/client/dist/filter.cjs +247 -0
  30. package/dist/_node_modules/@prismicio/client/dist/filter.cjs.map +1 -0
  31. package/dist/_node_modules/@prismicio/client/dist/filter.js +247 -0
  32. package/dist/_node_modules/@prismicio/client/dist/filter.js.map +1 -0
  33. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs +13 -0
  34. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs.map +1 -0
  35. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js +13 -0
  36. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js.map +1 -0
  37. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs +12 -0
  38. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs.map +1 -0
  39. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js +12 -0
  40. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js.map +1 -0
  41. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs +47 -0
  42. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs.map +1 -0
  43. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js +47 -0
  44. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js.map +1 -0
  45. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs +26 -0
  46. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs.map +1 -0
  47. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js +26 -0
  48. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js.map +1 -0
  49. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs +12 -0
  50. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs.map +1 -0
  51. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js +12 -0
  52. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js.map +1 -0
  53. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs +7 -0
  54. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs.map +1 -0
  55. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js +7 -0
  56. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js.map +1 -0
  57. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs +11 -0
  58. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs.map +1 -0
  59. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js +11 -0
  60. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js.map +1 -0
  61. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs +7 -0
  62. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs.map +1 -0
  63. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js +7 -0
  64. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js.map +1 -0
  65. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs +7 -0
  66. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs.map +1 -0
  67. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js +7 -0
  68. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js.map +1 -0
  69. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs +8 -0
  70. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs.map +1 -0
  71. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js +8 -0
  72. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js.map +1 -0
  73. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs +9 -0
  74. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs.map +1 -0
  75. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js +9 -0
  76. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js.map +1 -0
  77. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs +8 -0
  78. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs.map +1 -0
  79. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js +8 -0
  80. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js.map +1 -0
  81. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs +12 -0
  82. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs.map +1 -0
  83. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js +12 -0
  84. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js.map +1 -0
  85. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs +8 -0
  86. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs.map +1 -0
  87. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js +8 -0
  88. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js.map +1 -0
  89. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs +8 -0
  90. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs.map +1 -0
  91. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js +8 -0
  92. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js.map +1 -0
  93. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs +21 -0
  94. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs.map +1 -0
  95. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js +21 -0
  96. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js.map +1 -0
  97. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs +7 -0
  98. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
  99. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js +7 -0
  100. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js.map +1 -0
  101. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs +9 -0
  102. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs.map +1 -0
  103. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js +9 -0
  104. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js.map +1 -0
  105. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs +8 -0
  106. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs.map +1 -0
  107. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js +8 -0
  108. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js.map +1 -0
  109. package/dist/_node_modules/@prismicio/client/dist/package.json.cjs +5 -0
  110. package/dist/_node_modules/@prismicio/client/dist/package.json.cjs.map +1 -0
  111. package/dist/_node_modules/@prismicio/client/dist/package.json.js +5 -0
  112. package/dist/_node_modules/@prismicio/client/dist/package.json.js.map +1 -0
  113. package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs +10 -0
  114. package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs.map +1 -0
  115. package/dist/_node_modules/@prismicio/client/dist/types/value/link.js +10 -0
  116. package/dist/_node_modules/@prismicio/client/dist/types/value/link.js.map +1 -0
  117. package/dist/cli/loadLocaleIDs.cjs +2 -19
  118. package/dist/cli/loadLocaleIDs.cjs.map +1 -1
  119. package/dist/cli/loadLocaleIDs.js +2 -2
  120. package/dist/cli/loadLocaleIDs.js.map +1 -1
  121. package/dist/lib/buildCustomTypeDataType.cjs.map +1 -1
  122. package/dist/lib/buildCustomTypeDataType.d.ts +1 -1
  123. package/dist/lib/buildCustomTypeDataType.js.map +1 -1
  124. package/dist/lib/buildCustomTypeType.cjs.map +1 -1
  125. package/dist/lib/buildCustomTypeType.d.ts +1 -1
  126. package/dist/lib/buildCustomTypeType.js.map +1 -1
  127. package/dist/lib/buildFieldDocs.cjs.map +1 -1
  128. package/dist/lib/buildFieldDocs.d.ts +1 -1
  129. package/dist/lib/buildFieldDocs.js.map +1 -1
  130. package/dist/lib/buildFieldProperties.cjs +18 -19
  131. package/dist/lib/buildFieldProperties.cjs.map +1 -1
  132. package/dist/lib/buildFieldProperties.d.ts +1 -1
  133. package/dist/lib/buildFieldProperties.js +18 -19
  134. package/dist/lib/buildFieldProperties.js.map +1 -1
  135. package/dist/lib/buildSharedSliceType.cjs.map +1 -1
  136. package/dist/lib/buildSharedSliceType.d.ts +1 -1
  137. package/dist/lib/buildSharedSliceType.js.map +1 -1
  138. package/dist/lib/checkHasUIDFIeld.cjs.map +1 -1
  139. package/dist/lib/checkHasUIDFIeld.d.ts +1 -1
  140. package/dist/lib/checkHasUIDFIeld.js.map +1 -1
  141. package/package.json +1 -1
  142. package/src/lib/buildCustomTypeDataType.ts +1 -1
  143. package/src/lib/buildCustomTypeType.ts +1 -1
  144. package/src/lib/buildFieldDocs.ts +1 -1
  145. package/src/lib/buildFieldProperties.ts +19 -23
  146. package/src/lib/buildSharedSliceType.ts +1 -1
  147. package/src/lib/checkHasUIDFIeld.ts +1 -1
@@ -0,0 +1,247 @@
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 pathWithArgsFilter = (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 pathFilter = (name) => {
22
+ const filterFn = pathWithArgsFilter(name);
23
+ const fn = (path) => {
24
+ return filterFn(path);
25
+ };
26
+ return fn;
27
+ };
28
+ const argsFilter = (name) => {
29
+ const filterFn = pathWithArgsFilter(name);
30
+ const fn = (...args) => {
31
+ return filterFn("", ...args);
32
+ };
33
+ return fn;
34
+ };
35
+ const filter = {
36
+ /**
37
+ * The `at` filter checks that the path matches the described value exactly.
38
+ * It takes a single value for a field or an array (only for tags).
39
+ *
40
+ * {@link https://prismic.io/docs/rest-api-technical-reference#at}
41
+ */
42
+ at: pathWithArgsFilter("at"),
43
+ /**
44
+ * The `not` filter checks that the path doesn't match the provided value
45
+ * exactly. It takes a single value for a field or an array (only for tags).
46
+ *
47
+ * {@link https://prismic.io/docs/rest-api-technical-reference#not}
48
+ */
49
+ not: pathWithArgsFilter("not"),
50
+ /**
51
+ * The `any` filter takes an array of values. It works exactly the same way as
52
+ * the `at` operator, but checks whether the fragment matches any of the
53
+ * values in the array.
54
+ *
55
+ * {@link https://prismic.io/docs/rest-api-technical-reference#any}
56
+ */
57
+ any: pathWithArgsFilter("any"),
58
+ /**
59
+ * The `in` filter is used specifically to retrieve an array of documents by
60
+ * their IDs or UIDs. This filter is much more efficient at this than the any
61
+ * filter.
62
+ *
63
+ * {@link https://prismic.io/docs/rest-api-technical-reference#in}
64
+ */
65
+ in: pathWithArgsFilter("in"),
66
+ /**
67
+ * The `fulltext` filter provides two capabilities:
68
+ *
69
+ * 1. Checking if a certain string is anywhere inside a document (this is what
70
+ * you should use to make your project's search engine feature)
71
+ * 2. Checking if the string is contained inside a specific custom type’s Rich
72
+ * Text or Key Text fragment.
73
+ *
74
+ * {@link https://prismic.io/docs/rest-api-technical-reference#fulltext}
75
+ */
76
+ fulltext: pathWithArgsFilter("fulltext"),
77
+ /**
78
+ * The `has` filter checks whether a fragment has a value. It will return all
79
+ * the documents of the specified type that contain a value for the specified
80
+ * field.
81
+ *
82
+ * {@link https://prismic.io/docs/rest-api-technical-reference#has}
83
+ */
84
+ has: pathFilter("has"),
85
+ /**
86
+ * The `missing` filter checks if a fragment doesn't have a value. It will
87
+ * return all the documents of the specified type that do not contain a value
88
+ * for the specified field.
89
+ *
90
+ * {@link https://prismic.io/docs/rest-api-technical-reference#missing}
91
+ */
92
+ missing: pathFilter("missing"),
93
+ /**
94
+ * The `similar` filter takes the ID of a document, and returns a list of
95
+ * documents with similar content. This allows you to build an automated
96
+ * content discovery feature (for example, a "Related posts" section).
97
+ *
98
+ * {@link https://prismic.io/docs/rest-api-technical-reference#similar}
99
+ */
100
+ similar: argsFilter("similar"),
101
+ /**
102
+ * The `geopoint.near` filter checks that the value in the path is within the
103
+ * radius of the given coordinates.
104
+ *
105
+ * This filter will only work for a geopoint field.
106
+ *
107
+ * {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}
108
+ */
109
+ geopointNear: pathWithArgsFilter("geopoint.near"),
110
+ /**
111
+ * The `number.lt` filter checks that the value in the number field is less
112
+ * than the value passed into the filter.
113
+ *
114
+ * {@link https://prismic.io/docs/rest-api-technical-reference#numberlessthan}
115
+ */
116
+ numberLessThan: pathWithArgsFilter("number.lt"),
117
+ /**
118
+ * The `number.gt` filter checks that the value in the number field is greater
119
+ * than the value passed into the filter.
120
+ *
121
+ * {@link https://prismic.io/docs/rest-api-technical-reference#numbergreaterthan}
122
+ */
123
+ numberGreaterThan: pathWithArgsFilter("number.gt"),
124
+ /**
125
+ * The `number.inRange` filter checks that the value in the path is within the
126
+ * two values passed into the filter.
127
+ *
128
+ * {@link https://prismic.io/docs/rest-api-technical-reference#numberinrange}
129
+ */
130
+ numberInRange: pathWithArgsFilter("number.inRange"),
131
+ /**
132
+ * The `date.after` filter checks that the value in the path is after the date
133
+ * value passed into the filter.
134
+ *
135
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
136
+ */
137
+ dateAfter: pathWithArgsFilter("date.after"),
138
+ /**
139
+ * The `date.before` filter checks that the value in the path is before the
140
+ * date value passed into the filter.
141
+ *
142
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
143
+ */
144
+ dateBefore: pathWithArgsFilter("date.before"),
145
+ /**
146
+ * The `date.between` filter checks that the value in the path is within the
147
+ * date values passed into the filter.
148
+ *
149
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
150
+ */
151
+ dateBetween: pathWithArgsFilter("date.between"),
152
+ /**
153
+ * The `date.day-of-month` filter checks that the value in the path is equal
154
+ * to the day of the month passed into the filter.
155
+ *
156
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
157
+ */
158
+ dateDayOfMonth: pathWithArgsFilter("date.day-of-month"),
159
+ /**
160
+ * The `date.day-of-month-after` filter checks that the value in the path is
161
+ * after the day of the month passed into the filter.
162
+ *
163
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
164
+ */
165
+ dateDayOfMonthAfter: pathWithArgsFilter("date.day-of-month-after"),
166
+ /**
167
+ * The `date.day-of-month-before` filter checks that the value in the path is
168
+ * before the day of the month passed into the filter.
169
+ *
170
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
171
+ */
172
+ dateDayOfMonthBefore: pathWithArgsFilter("date.day-of-month-before"),
173
+ /**
174
+ * The `date.day-of-week` filter checks that the value in the path is equal to
175
+ * the day of the week passed into the filter.
176
+ *
177
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
178
+ */
179
+ dateDayOfWeek: pathWithArgsFilter("date.day-of-week"),
180
+ /**
181
+ * The `date.day-of-week-after` filter checks that the value in the path is
182
+ * after the day of the week passed into the filter.
183
+ *
184
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
185
+ */
186
+ dateDayOfWeekAfter: pathWithArgsFilter("date.day-of-week-after"),
187
+ /**
188
+ * The date.day-of-week-before filter checks that the value in the path is
189
+ * before the day of the week passed into the filter.
190
+ *
191
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
192
+ */
193
+ dateDayOfWeekBefore: pathWithArgsFilter("date.day-of-week-before"),
194
+ /**
195
+ * The `date.month` filter checks that the value in the path occurs in the
196
+ * month value passed into the filter.
197
+ *
198
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
199
+ */
200
+ dateMonth: pathWithArgsFilter("date.month"),
201
+ /**
202
+ * The `date.month-after` filter checks that the value in the path occurs in
203
+ * any month after the value passed into the filter.
204
+ *
205
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
206
+ */
207
+ dateMonthAfter: pathWithArgsFilter("date.month-after"),
208
+ /**
209
+ * The `date.month-before` filter checks that the value in the path occurs in
210
+ * any month before the value passed into the filter.
211
+ *
212
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
213
+ */
214
+ dateMonthBefore: pathWithArgsFilter("date.month-before"),
215
+ /**
216
+ * The `date.year` filter checks that the value in the path occurs in the year
217
+ * value passed into the filter.
218
+ *
219
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
220
+ */
221
+ dateYear: pathWithArgsFilter("date.year"),
222
+ /**
223
+ * The `date.hour` filter checks that the value in the path occurs within the
224
+ * hour value passed into the filter.
225
+ *
226
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
227
+ */
228
+ dateHour: pathWithArgsFilter("date.hour"),
229
+ /**
230
+ * The `date.hour-after` filter checks that the value in the path occurs after
231
+ * the hour value passed into the filter.
232
+ *
233
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
234
+ */
235
+ dateHourAfter: pathWithArgsFilter("date.hour-after"),
236
+ /**
237
+ * The `date.hour-before` filter checks that the value in the path occurs
238
+ * before the hour value passed into the filter.
239
+ *
240
+ * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
241
+ */
242
+ dateHourBefore: pathWithArgsFilter("date.hour-before")
243
+ };
244
+ export {
245
+ filter
246
+ };
247
+ //# sourceMappingURL=filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.js","sources":["../../../../../node_modules/@prismicio/client/dist/filter.js"],"sourcesContent":["const formatValue = (value) => {\n if (Array.isArray(value)) {\n return `[${value.map(formatValue).join(\", \")}]`;\n }\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n if (value instanceof Date) {\n return `${value.getTime()}`;\n }\n return `${value}`;\n};\nconst pathWithArgsFilter = (name) => {\n const fn = (path, ...args) => {\n const formattedArgs = args.map(formatValue).join(\", \");\n const joiner = path && args.length ? \", \" : \"\";\n return `[${name}(${path}${joiner}${formattedArgs})]`;\n };\n return fn;\n};\nconst pathFilter = (name) => {\n const filterFn = pathWithArgsFilter(name);\n const fn = (path) => {\n return filterFn(path);\n };\n return fn;\n};\nconst argsFilter = (name) => {\n const filterFn = pathWithArgsFilter(name);\n const fn = (...args) => {\n return filterFn(\"\", ...args);\n };\n return fn;\n};\nconst filter = {\n /**\n * The `at` filter checks that the path matches the described value exactly.\n * It takes a single value for a field or an array (only for tags).\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#at}\n */\n at: pathWithArgsFilter(\"at\"),\n /**\n * The `not` filter checks that the path doesn't match the provided value\n * exactly. It takes a single value for a field or an array (only for tags).\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#not}\n */\n not: pathWithArgsFilter(\"not\"),\n /**\n * The `any` filter takes an array of values. It works exactly the same way as\n * the `at` operator, but checks whether the fragment matches any of the\n * values in the array.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#any}\n */\n any: pathWithArgsFilter(\"any\"),\n /**\n * The `in` filter is used specifically to retrieve an array of documents by\n * their IDs or UIDs. This filter is much more efficient at this than the any\n * filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#in}\n */\n in: pathWithArgsFilter(\"in\"),\n /**\n * The `fulltext` filter provides two capabilities:\n *\n * 1. Checking if a certain string is anywhere inside a document (this is what\n * you should use to make your project's search engine feature)\n * 2. Checking if the string is contained inside a specific custom type’s Rich\n * Text or Key Text fragment.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#fulltext}\n */\n fulltext: pathWithArgsFilter(\"fulltext\"),\n /**\n * The `has` filter checks whether a fragment has a value. It will return all\n * the documents of the specified type that contain a value for the specified\n * field.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#has}\n */\n has: pathFilter(\"has\"),\n /**\n * The `missing` filter checks if a fragment doesn't have a value. It will\n * return all the documents of the specified type that do not contain a value\n * for the specified field.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#missing}\n */\n missing: pathFilter(\"missing\"),\n /**\n * The `similar` filter takes the ID of a document, and returns a list of\n * documents with similar content. This allows you to build an automated\n * content discovery feature (for example, a \"Related posts\" section).\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#similar}\n */\n similar: argsFilter(\"similar\"),\n /**\n * The `geopoint.near` filter checks that the value in the path is within the\n * radius of the given coordinates.\n *\n * This filter will only work for a geopoint field.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}\n */\n geopointNear: pathWithArgsFilter(\"geopoint.near\"),\n /**\n * The `number.lt` filter checks that the value in the number field is less\n * than the value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#numberlessthan}\n */\n numberLessThan: pathWithArgsFilter(\"number.lt\"),\n /**\n * The `number.gt` filter checks that the value in the number field is greater\n * than the value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#numbergreaterthan}\n */\n numberGreaterThan: pathWithArgsFilter(\"number.gt\"),\n /**\n * The `number.inRange` filter checks that the value in the path is within the\n * two values passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#numberinrange}\n */\n numberInRange: pathWithArgsFilter(\"number.inRange\"),\n /**\n * The `date.after` filter checks that the value in the path is after the date\n * value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateAfter: pathWithArgsFilter(\"date.after\"),\n /**\n * The `date.before` filter checks that the value in the path is before the\n * date value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateBefore: pathWithArgsFilter(\"date.before\"),\n /**\n * The `date.between` filter checks that the value in the path is within the\n * date values passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateBetween: pathWithArgsFilter(\"date.between\"),\n /**\n * The `date.day-of-month` filter checks that the value in the path is equal\n * to the day of the month passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateDayOfMonth: pathWithArgsFilter(\"date.day-of-month\"),\n /**\n * The `date.day-of-month-after` filter checks that the value in the path is\n * after the day of the month passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateDayOfMonthAfter: pathWithArgsFilter(\"date.day-of-month-after\"),\n /**\n * The `date.day-of-month-before` filter checks that the value in the path is\n * before the day of the month passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateDayOfMonthBefore: pathWithArgsFilter(\"date.day-of-month-before\"),\n /**\n * The `date.day-of-week` filter checks that the value in the path is equal to\n * the day of the week passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateDayOfWeek: pathWithArgsFilter(\"date.day-of-week\"),\n /**\n * The `date.day-of-week-after` filter checks that the value in the path is\n * after the day of the week passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateDayOfWeekAfter: pathWithArgsFilter(\"date.day-of-week-after\"),\n /**\n * The date.day-of-week-before filter checks that the value in the path is\n * before the day of the week passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateDayOfWeekBefore: pathWithArgsFilter(\"date.day-of-week-before\"),\n /**\n * The `date.month` filter checks that the value in the path occurs in the\n * month value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateMonth: pathWithArgsFilter(\"date.month\"),\n /**\n * The `date.month-after` filter checks that the value in the path occurs in\n * any month after the value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateMonthAfter: pathWithArgsFilter(\"date.month-after\"),\n /**\n * The `date.month-before` filter checks that the value in the path occurs in\n * any month before the value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateMonthBefore: pathWithArgsFilter(\"date.month-before\"),\n /**\n * The `date.year` filter checks that the value in the path occurs in the year\n * value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateYear: pathWithArgsFilter(\"date.year\"),\n /**\n * The `date.hour` filter checks that the value in the path occurs within the\n * hour value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateHour: pathWithArgsFilter(\"date.hour\"),\n /**\n * The `date.hour-after` filter checks that the value in the path occurs after\n * the hour value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateHourAfter: pathWithArgsFilter(\"date.hour-after\"),\n /**\n * The `date.hour-before` filter checks that the value in the path occurs\n * before the hour value passed into the filter.\n *\n * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n */\n dateHourBefore: pathWithArgsFilter(\"date.hour-before\")\n};\nexport {\n filter\n};\n//# sourceMappingURL=filter.js.map\n"],"names":[],"mappings":"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","x_google_ignoreList":[0]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const PrismicError = require("./errors/PrismicError.cjs");
4
+ const isRepositoryName = require("./isRepositoryName.cjs");
5
+ const getRepositoryEndpoint = (repositoryName) => {
6
+ if (isRepositoryName.isRepositoryName(repositoryName)) {
7
+ return `https://${repositoryName}.cdn.prismic.io/api/v2`;
8
+ } else {
9
+ throw new PrismicError.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
10
+ }
11
+ };
12
+ exports.getRepositoryEndpoint = getRepositoryEndpoint;
13
+ //# sourceMappingURL=getRepositoryEndpoint.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRepositoryEndpoint.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/getRepositoryEndpoint.js"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError.js\";\nimport { isRepositoryName } from \"./isRepositoryName.js\";\nconst getRepositoryEndpoint = (repositoryName) => {\n if (isRepositoryName(repositoryName)) {\n return `https://${repositoryName}.cdn.prismic.io/api/v2`;\n } else {\n throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);\n }\n};\nexport {\n getRepositoryEndpoint\n};\n//# sourceMappingURL=getRepositoryEndpoint.js.map\n"],"names":["isRepositoryName","PrismicError"],"mappings":";;;;AAEK,MAAC,wBAAwB,CAAC,mBAAmB;AAChD,MAAIA,iBAAAA,iBAAiB,cAAc,GAAG;AACpC,WAAO,WAAW;AAAA,EACtB,OAAS;AACL,UAAM,IAAIC,aAAAA,aAAa,iDAAiD,kBAAkB,QAAQ,MAAM;AAAA,EACzG;AACH;;","x_google_ignoreList":[0]}
@@ -0,0 +1,13 @@
1
+ import { PrismicError } from "./errors/PrismicError.js";
2
+ import { isRepositoryName } from "./isRepositoryName.js";
3
+ const getRepositoryEndpoint = (repositoryName) => {
4
+ if (isRepositoryName(repositoryName)) {
5
+ return `https://${repositoryName}.cdn.prismic.io/api/v2`;
6
+ } else {
7
+ throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
8
+ }
9
+ };
10
+ export {
11
+ getRepositoryEndpoint
12
+ };
13
+ //# sourceMappingURL=getRepositoryEndpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRepositoryEndpoint.js","sources":["../../../../../node_modules/@prismicio/client/dist/getRepositoryEndpoint.js"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError.js\";\nimport { isRepositoryName } from \"./isRepositoryName.js\";\nconst getRepositoryEndpoint = (repositoryName) => {\n if (isRepositoryName(repositoryName)) {\n return `https://${repositoryName}.cdn.prismic.io/api/v2`;\n } else {\n throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);\n }\n};\nexport {\n getRepositoryEndpoint\n};\n//# sourceMappingURL=getRepositoryEndpoint.js.map\n"],"names":[],"mappings":";;AAEK,MAAC,wBAAwB,CAAC,mBAAmB;AAChD,MAAI,iBAAiB,cAAc,GAAG;AACpC,WAAO,WAAW;AAAA,EACtB,OAAS;AACL,UAAM,IAAI,aAAa,iDAAiD,kBAAkB,QAAQ,MAAM;AAAA,EACzG;AACH;","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 getRepositoryName = (repositoryEndpoint) => {
5
+ try {
6
+ return new URL(repositoryEndpoint).hostname.split(".")[0];
7
+ } catch {
8
+ throw new PrismicError.PrismicError(`An invalid Prismic Rest API V2 endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);
9
+ }
10
+ };
11
+ exports.getRepositoryName = getRepositoryName;
12
+ //# sourceMappingURL=getRepositoryName.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRepositoryName.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/getRepositoryName.js"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError.js\";\nconst getRepositoryName = (repositoryEndpoint) => {\n try {\n return new URL(repositoryEndpoint).hostname.split(\".\")[0];\n } catch {\n throw new PrismicError(`An invalid Prismic Rest API V2 endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);\n }\n};\nexport {\n getRepositoryName\n};\n//# sourceMappingURL=getRepositoryName.js.map\n"],"names":["PrismicError"],"mappings":";;;AACK,MAAC,oBAAoB,CAAC,uBAAuB;AAChD,MAAI;AACF,WAAO,IAAI,IAAI,kBAAkB,EAAE,SAAS,MAAM,GAAG,EAAE,CAAC;AAAA,EAC5D,QAAI;AACA,UAAM,IAAIA,aAAAA,aAAa,yDAAyD,sBAAsB,QAAQ,MAAM;AAAA,EACrH;AACH;;","x_google_ignoreList":[0]}
@@ -0,0 +1,12 @@
1
+ import { PrismicError } from "./errors/PrismicError.js";
2
+ const getRepositoryName = (repositoryEndpoint) => {
3
+ try {
4
+ return new URL(repositoryEndpoint).hostname.split(".")[0];
5
+ } catch {
6
+ throw new PrismicError(`An invalid Prismic Rest API V2 endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);
7
+ }
8
+ };
9
+ export {
10
+ getRepositoryName
11
+ };
12
+ //# sourceMappingURL=getRepositoryName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRepositoryName.js","sources":["../../../../../node_modules/@prismicio/client/dist/getRepositoryName.js"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError.js\";\nconst getRepositoryName = (repositoryEndpoint) => {\n try {\n return new URL(repositoryEndpoint).hostname.split(\".\")[0];\n } catch {\n throw new PrismicError(`An invalid Prismic Rest API V2 endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);\n }\n};\nexport {\n getRepositoryName\n};\n//# sourceMappingURL=getRepositoryName.js.map\n"],"names":[],"mappings":";AACK,MAAC,oBAAoB,CAAC,uBAAuB;AAChD,MAAI;AACF,WAAO,IAAI,IAAI,kBAAkB,EAAE,SAAS,MAAM,GAAG,EAAE,CAAC;AAAA,EAC5D,QAAI;AACA,UAAM,IAAI,aAAa,yDAAyD,sBAAsB,QAAQ,MAAM;AAAA,EACrH;AACH;","x_google_ignoreList":[0]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const link = require("../types/value/link.cjs");
4
+ const documentToLinkField = require("./documentToLinkField.cjs");
5
+ const asLink = (linkFieldOrDocument, ...configObjectOrTuple) => {
6
+ if (!linkFieldOrDocument) {
7
+ return null;
8
+ }
9
+ const linkField = (
10
+ // prettier-ignore
11
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
13
+ // TODO: Remove the `prettier-ignore` comment when this bug is fixed.
14
+ "link_type" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField.documentToLinkField(linkFieldOrDocument)
15
+ );
16
+ const [configObjectOrLinkResolver] = configObjectOrTuple;
17
+ let config;
18
+ if (typeof configObjectOrLinkResolver === "function" || configObjectOrLinkResolver == null) {
19
+ config = {
20
+ linkResolver: configObjectOrLinkResolver
21
+ };
22
+ } else {
23
+ config = { ...configObjectOrLinkResolver };
24
+ }
25
+ switch (linkField.link_type) {
26
+ case link.LinkType.Media:
27
+ case link.LinkType.Web:
28
+ return "url" in linkField ? linkField.url : null;
29
+ case link.LinkType.Document: {
30
+ if ("id" in linkField && config.linkResolver) {
31
+ const resolvedURL = config.linkResolver(linkField);
32
+ if (resolvedURL != null) {
33
+ return resolvedURL;
34
+ }
35
+ }
36
+ if ("url" in linkField && linkField.url) {
37
+ return linkField.url;
38
+ }
39
+ return null;
40
+ }
41
+ case link.LinkType.Any:
42
+ default:
43
+ return null;
44
+ }
45
+ };
46
+ exports.asLink = asLink;
47
+ //# sourceMappingURL=asLink.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLink.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asLink.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nimport { documentToLinkField } from \"./documentToLinkField.js\";\nconst asLink = (linkFieldOrDocument, ...configObjectOrTuple) => {\n if (!linkFieldOrDocument) {\n return null;\n }\n const linkField = (\n // prettier-ignore\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n // TODO: Remove the `prettier-ignore` comment when this bug is fixed.\n \"link_type\" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField(linkFieldOrDocument)\n );\n const [configObjectOrLinkResolver] = configObjectOrTuple;\n let config;\n if (typeof configObjectOrLinkResolver === \"function\" || configObjectOrLinkResolver == null) {\n config = {\n linkResolver: configObjectOrLinkResolver\n };\n } else {\n config = { ...configObjectOrLinkResolver };\n }\n switch (linkField.link_type) {\n case LinkType.Media:\n case LinkType.Web:\n return \"url\" in linkField ? linkField.url : null;\n case LinkType.Document: {\n if (\"id\" in linkField && config.linkResolver) {\n const resolvedURL = config.linkResolver(linkField);\n if (resolvedURL != null) {\n return resolvedURL;\n }\n }\n if (\"url\" in linkField && linkField.url) {\n return linkField.url;\n }\n return null;\n }\n case LinkType.Any:\n default:\n return null;\n }\n};\nexport {\n asLink\n};\n//# sourceMappingURL=asLink.js.map\n"],"names":["documentToLinkField","LinkType"],"mappings":";;;;AAEK,MAAC,SAAS,CAAC,wBAAwB,wBAAwB;AAC9D,MAAI,CAAC,qBAAqB;AACxB,WAAO;AAAA,EACR;AACD,QAAM;AAAA;AAAA;AAAA;AAAA;AAAA,IAKJ,eAAe,sBAAsB,sBAAsBA,oBAAAA,oBAAoB,mBAAmB;AAAA;AAEpG,QAAM,CAAC,0BAA0B,IAAI;AACrC,MAAI;AACJ,MAAI,OAAO,+BAA+B,cAAc,8BAA8B,MAAM;AAC1F,aAAS;AAAA,MACP,cAAc;AAAA,IACpB;AAAA,EACA,OAAS;AACL,aAAS,EAAE,GAAG;EACf;AACD,UAAQ,UAAU,WAAS;AAAA,IACzB,KAAKC,KAAAA,SAAS;AAAA,IACd,KAAKA,KAAQ,SAAC;AACZ,aAAO,SAAS,YAAY,UAAU,MAAM;AAAA,IAC9C,KAAKA,KAAAA,SAAS,UAAU;AACtB,UAAI,QAAQ,aAAa,OAAO,cAAc;AAC5C,cAAM,cAAc,OAAO,aAAa,SAAS;AACjD,YAAI,eAAe,MAAM;AACvB,iBAAO;AAAA,QACR;AAAA,MACF;AACD,UAAI,SAAS,aAAa,UAAU,KAAK;AACvC,eAAO,UAAU;AAAA,MAClB;AACD,aAAO;AAAA,IACR;AAAA,IACD,KAAKA,KAAAA,SAAS;AAAA,IACd;AACE,aAAO;AAAA,EACV;AACH;;","x_google_ignoreList":[0]}
@@ -0,0 +1,47 @@
1
+ import { LinkType } from "../types/value/link.js";
2
+ import { documentToLinkField } from "./documentToLinkField.js";
3
+ const asLink = (linkFieldOrDocument, ...configObjectOrTuple) => {
4
+ if (!linkFieldOrDocument) {
5
+ return null;
6
+ }
7
+ const linkField = (
8
+ // prettier-ignore
9
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
11
+ // TODO: Remove the `prettier-ignore` comment when this bug is fixed.
12
+ "link_type" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField(linkFieldOrDocument)
13
+ );
14
+ const [configObjectOrLinkResolver] = configObjectOrTuple;
15
+ let config;
16
+ if (typeof configObjectOrLinkResolver === "function" || configObjectOrLinkResolver == null) {
17
+ config = {
18
+ linkResolver: configObjectOrLinkResolver
19
+ };
20
+ } else {
21
+ config = { ...configObjectOrLinkResolver };
22
+ }
23
+ switch (linkField.link_type) {
24
+ case LinkType.Media:
25
+ case LinkType.Web:
26
+ return "url" in linkField ? linkField.url : null;
27
+ case LinkType.Document: {
28
+ if ("id" in linkField && config.linkResolver) {
29
+ const resolvedURL = config.linkResolver(linkField);
30
+ if (resolvedURL != null) {
31
+ return resolvedURL;
32
+ }
33
+ }
34
+ if ("url" in linkField && linkField.url) {
35
+ return linkField.url;
36
+ }
37
+ return null;
38
+ }
39
+ case LinkType.Any:
40
+ default:
41
+ return null;
42
+ }
43
+ };
44
+ export {
45
+ asLink
46
+ };
47
+ //# sourceMappingURL=asLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLink.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asLink.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nimport { documentToLinkField } from \"./documentToLinkField.js\";\nconst asLink = (linkFieldOrDocument, ...configObjectOrTuple) => {\n if (!linkFieldOrDocument) {\n return null;\n }\n const linkField = (\n // prettier-ignore\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n // TODO: Remove the `prettier-ignore` comment when this bug is fixed.\n \"link_type\" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField(linkFieldOrDocument)\n );\n const [configObjectOrLinkResolver] = configObjectOrTuple;\n let config;\n if (typeof configObjectOrLinkResolver === \"function\" || configObjectOrLinkResolver == null) {\n config = {\n linkResolver: configObjectOrLinkResolver\n };\n } else {\n config = { ...configObjectOrLinkResolver };\n }\n switch (linkField.link_type) {\n case LinkType.Media:\n case LinkType.Web:\n return \"url\" in linkField ? linkField.url : null;\n case LinkType.Document: {\n if (\"id\" in linkField && config.linkResolver) {\n const resolvedURL = config.linkResolver(linkField);\n if (resolvedURL != null) {\n return resolvedURL;\n }\n }\n if (\"url\" in linkField && linkField.url) {\n return linkField.url;\n }\n return null;\n }\n case LinkType.Any:\n default:\n return null;\n }\n};\nexport {\n asLink\n};\n//# sourceMappingURL=asLink.js.map\n"],"names":[],"mappings":";;AAEK,MAAC,SAAS,CAAC,wBAAwB,wBAAwB;AAC9D,MAAI,CAAC,qBAAqB;AACxB,WAAO;AAAA,EACR;AACD,QAAM;AAAA;AAAA;AAAA;AAAA;AAAA,IAKJ,eAAe,sBAAsB,sBAAsB,oBAAoB,mBAAmB;AAAA;AAEpG,QAAM,CAAC,0BAA0B,IAAI;AACrC,MAAI;AACJ,MAAI,OAAO,+BAA+B,cAAc,8BAA8B,MAAM;AAC1F,aAAS;AAAA,MACP,cAAc;AAAA,IACpB;AAAA,EACA,OAAS;AACL,aAAS,EAAE,GAAG;EACf;AACD,UAAQ,UAAU,WAAS;AAAA,IACzB,KAAK,SAAS;AAAA,IACd,KAAK,SAAS;AACZ,aAAO,SAAS,YAAY,UAAU,MAAM;AAAA,IAC9C,KAAK,SAAS,UAAU;AACtB,UAAI,QAAQ,aAAa,OAAO,cAAc;AAC5C,cAAM,cAAc,OAAO,aAAa,SAAS;AACjD,YAAI,eAAe,MAAM;AACvB,iBAAO;AAAA,QACR;AAAA,MACF;AACD,UAAI,SAAS,aAAa,UAAU,KAAK;AACvC,eAAO,UAAU;AAAA,MAClB;AACD,aAAO;AAAA,IACR;AAAA,IACD,KAAK,SAAS;AAAA,IACd;AACE,aAAO;AAAA,EACV;AACH;","x_google_ignoreList":[0]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const link = require("../types/value/link.cjs");
4
+ const documentToLinkField = (prismicDocument) => {
5
+ var _a;
6
+ return {
7
+ link_type: link.LinkType.Document,
8
+ id: prismicDocument.id,
9
+ uid: prismicDocument.uid || void 0,
10
+ type: prismicDocument.type,
11
+ tags: prismicDocument.tags,
12
+ lang: prismicDocument.lang,
13
+ url: prismicDocument.url == null ? void 0 : prismicDocument.url,
14
+ slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],
15
+ // The REST API does not include a `data` property if the data
16
+ // object is empty.
17
+ //
18
+ // A presence check for `prismicDocument.data` is done to
19
+ // support partial documents. While `documentToLinkField` is
20
+ // not typed to accept partial documents, passing a partial
21
+ // document can happen in untyped projects.
22
+ ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}
23
+ };
24
+ };
25
+ exports.documentToLinkField = documentToLinkField;
26
+ //# sourceMappingURL=documentToLinkField.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentToLinkField.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":["LinkType"],"mappings":";;;AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAWA,KAAQ,SAAC;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;;","x_google_ignoreList":[0]}
@@ -0,0 +1,26 @@
1
+ import { LinkType } from "../types/value/link.js";
2
+ const documentToLinkField = (prismicDocument) => {
3
+ var _a;
4
+ return {
5
+ link_type: LinkType.Document,
6
+ id: prismicDocument.id,
7
+ uid: prismicDocument.uid || void 0,
8
+ type: prismicDocument.type,
9
+ tags: prismicDocument.tags,
10
+ lang: prismicDocument.lang,
11
+ url: prismicDocument.url == null ? void 0 : prismicDocument.url,
12
+ slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],
13
+ // The REST API does not include a `data` property if the data
14
+ // object is empty.
15
+ //
16
+ // A presence check for `prismicDocument.data` is done to
17
+ // support partial documents. While `documentToLinkField` is
18
+ // not typed to accept partial documents, passing a partial
19
+ // document can happen in untyped projects.
20
+ ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}
21
+ };
22
+ };
23
+ export {
24
+ documentToLinkField
25
+ };
26
+ //# sourceMappingURL=documentToLinkField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentToLinkField.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":[],"mappings":";AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAW,SAAS;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;","x_google_ignoreList":[0]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const isRepositoryEndpoint = (input) => {
4
+ try {
5
+ new URL(input);
6
+ return true;
7
+ } catch {
8
+ return false;
9
+ }
10
+ };
11
+ exports.isRepositoryEndpoint = isRepositoryEndpoint;
12
+ //# sourceMappingURL=isRepositoryEndpoint.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isRepositoryEndpoint.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/isRepositoryEndpoint.js"],"sourcesContent":["const isRepositoryEndpoint = (input) => {\n try {\n new URL(input);\n return true;\n } catch {\n return false;\n }\n};\nexport {\n isRepositoryEndpoint\n};\n//# sourceMappingURL=isRepositoryEndpoint.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,uBAAuB,CAAC,UAAU;AACtC,MAAI;AACF,QAAI,IAAI,KAAK;AACb,WAAO;AAAA,EACX,QAAI;AACA,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
@@ -0,0 +1,12 @@
1
+ const isRepositoryEndpoint = (input) => {
2
+ try {
3
+ new URL(input);
4
+ return true;
5
+ } catch {
6
+ return false;
7
+ }
8
+ };
9
+ export {
10
+ isRepositoryEndpoint
11
+ };
12
+ //# sourceMappingURL=isRepositoryEndpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isRepositoryEndpoint.js","sources":["../../../../../node_modules/@prismicio/client/dist/isRepositoryEndpoint.js"],"sourcesContent":["const isRepositoryEndpoint = (input) => {\n try {\n new URL(input);\n return true;\n } catch {\n return false;\n }\n};\nexport {\n isRepositoryEndpoint\n};\n//# sourceMappingURL=isRepositoryEndpoint.js.map\n"],"names":[],"mappings":"AAAK,MAAC,uBAAuB,CAAC,UAAU;AACtC,MAAI;AACF,QAAI,IAAI,KAAK;AACb,WAAO;AAAA,EACX,QAAI;AACA,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const isRepositoryName = (input) => {
4
+ return /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input);
5
+ };
6
+ exports.isRepositoryName = isRepositoryName;
7
+ //# sourceMappingURL=isRepositoryName.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isRepositoryName.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/isRepositoryName.js"],"sourcesContent":["const isRepositoryName = (input) => {\n return /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input);\n};\nexport {\n isRepositoryName\n};\n//# sourceMappingURL=isRepositoryName.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,mBAAmB,CAAC,UAAU;AAClC,SAAO,2CAA2C,KAAK,KAAK;AAC9D;;","x_google_ignoreList":[0]}
@@ -0,0 +1,7 @@
1
+ const isRepositoryName = (input) => {
2
+ return /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input);
3
+ };
4
+ export {
5
+ isRepositoryName
6
+ };
7
+ //# sourceMappingURL=isRepositoryName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isRepositoryName.js","sources":["../../../../../node_modules/@prismicio/client/dist/isRepositoryName.js"],"sourcesContent":["const isRepositoryName = (input) => {\n return /^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(input);\n};\nexport {\n isRepositoryName\n};\n//# sourceMappingURL=isRepositoryName.js.map\n"],"names":[],"mappings":"AAAK,MAAC,mBAAmB,CAAC,UAAU;AAClC,SAAO,2CAA2C,KAAK,KAAK;AAC9D;","x_google_ignoreList":[0]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const castArray = require("./castArray.cjs");
4
+ const appendFilters = (objWithFilters = {}, filters) => {
5
+ return {
6
+ ...objWithFilters,
7
+ filters: [...objWithFilters.filters || [], ...castArray.castArray(filters)]
8
+ };
9
+ };
10
+ exports.appendFilters = appendFilters;
11
+ //# sourceMappingURL=appendFilters.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appendFilters.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/appendFilters.js"],"sourcesContent":["import { castArray } from \"./castArray.js\";\nconst appendFilters = (objWithFilters = {}, filters) => {\n return {\n ...objWithFilters,\n filters: [...objWithFilters.filters || [], ...castArray(filters)]\n };\n};\nexport {\n appendFilters\n};\n//# sourceMappingURL=appendFilters.js.map\n"],"names":["castArray"],"mappings":";;;AACK,MAAC,gBAAgB,CAAC,iBAAiB,CAAE,GAAE,YAAY;AACtD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,GAAG,eAAe,WAAW,CAAA,GAAI,GAAGA,UAAAA,UAAU,OAAO,CAAC;AAAA,EACpE;AACA;;","x_google_ignoreList":[0]}
@@ -0,0 +1,11 @@
1
+ import { castArray } from "./castArray.js";
2
+ const appendFilters = (objWithFilters = {}, filters) => {
3
+ return {
4
+ ...objWithFilters,
5
+ filters: [...objWithFilters.filters || [], ...castArray(filters)]
6
+ };
7
+ };
8
+ export {
9
+ appendFilters
10
+ };
11
+ //# sourceMappingURL=appendFilters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appendFilters.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/appendFilters.js"],"sourcesContent":["import { castArray } from \"./castArray.js\";\nconst appendFilters = (objWithFilters = {}, filters) => {\n return {\n ...objWithFilters,\n filters: [...objWithFilters.filters || [], ...castArray(filters)]\n };\n};\nexport {\n appendFilters\n};\n//# sourceMappingURL=appendFilters.js.map\n"],"names":[],"mappings":";AACK,MAAC,gBAAgB,CAAC,iBAAiB,CAAE,GAAE,YAAY;AACtD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS,CAAC,GAAG,eAAe,WAAW,CAAA,GAAI,GAAG,UAAU,OAAO,CAAC;AAAA,EACpE;AACA;","x_google_ignoreList":[0]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const castArray = (a) => {
4
+ return Array.isArray(a) ? a : [a];
5
+ };
6
+ exports.castArray = castArray;
7
+ //# sourceMappingURL=castArray.cjs.map