@makeswift/runtime 0.24.7-canary.1 → 0.24.7-canary.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 (73) hide show
  1. package/client/package.json +5 -0
  2. package/dist/cjs/client/index.js +686 -0
  3. package/dist/cjs/client/index.js.map +1 -0
  4. package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
  5. package/dist/cjs/next/client.js +8 -654
  6. package/dist/cjs/next/client.js.map +1 -1
  7. package/dist/cjs/next/components/MakeswiftComponent.js +1 -1
  8. package/dist/cjs/next/components/MakeswiftComponent.js.map +1 -1
  9. package/dist/cjs/next/components/Slot.js.map +1 -1
  10. package/dist/cjs/next/components/page.js +1 -1
  11. package/dist/cjs/next/components/page.js.map +1 -1
  12. package/dist/cjs/next/index.js.map +1 -1
  13. package/dist/cjs/runtimes/react/testing/element-data.js.map +1 -1
  14. package/dist/cjs/utils/async-iterable.js.map +1 -0
  15. package/dist/cjs/utils/pagination.js.map +1 -0
  16. package/dist/esm/client/index.js +671 -0
  17. package/dist/esm/client/index.js.map +1 -0
  18. package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
  19. package/dist/esm/next/client.js +7 -662
  20. package/dist/esm/next/client.js.map +1 -1
  21. package/dist/esm/next/components/MakeswiftComponent.js +1 -1
  22. package/dist/esm/next/components/MakeswiftComponent.js.map +1 -1
  23. package/dist/esm/next/components/Slot.js.map +1 -1
  24. package/dist/esm/next/components/page.js +1 -1
  25. package/dist/esm/next/components/page.js.map +1 -1
  26. package/dist/esm/next/index.js.map +1 -1
  27. package/dist/esm/runtimes/react/testing/element-data.js.map +1 -1
  28. package/dist/esm/utils/async-iterable.js.map +1 -0
  29. package/dist/esm/utils/pagination.js.map +1 -0
  30. package/dist/types/client/index.d.ts +697 -0
  31. package/dist/types/client/index.d.ts.map +1 -0
  32. package/dist/types/client/tests/client.error-handling.test.d.ts.map +1 -0
  33. package/dist/types/client/tests/client.get-component-snapshot.test.d.ts.map +1 -0
  34. package/dist/types/client/tests/client.get-page-snapshot.test.d.ts.map +1 -0
  35. package/dist/types/client/tests/client.get-pages.test.d.ts.map +1 -0
  36. package/dist/types/client/tests/client.get-resources.test.d.ts.map +1 -0
  37. package/dist/types/next/client.d.ts +3 -690
  38. package/dist/types/next/client.d.ts.map +1 -1
  39. package/dist/types/next/components/MakeswiftComponent.d.ts +1 -1
  40. package/dist/types/next/components/MakeswiftComponent.d.ts.map +1 -1
  41. package/dist/types/next/components/Slot.d.ts +1 -1
  42. package/dist/types/next/components/Slot.d.ts.map +1 -1
  43. package/dist/types/next/components/page.d.ts +1 -1
  44. package/dist/types/next/components/page.d.ts.map +1 -1
  45. package/dist/types/next/index.d.ts +1 -1
  46. package/dist/types/next/index.d.ts.map +1 -1
  47. package/dist/types/runtimes/react/testing/element-data.d.ts +1 -1
  48. package/dist/types/runtimes/react/testing/element-data.d.ts.map +1 -1
  49. package/dist/types/utils/async-iterable.d.ts.map +1 -0
  50. package/dist/types/utils/pagination.d.ts.map +1 -0
  51. package/package.json +7 -1
  52. package/dist/cjs/next/utils/async-iterable.js.map +0 -1
  53. package/dist/cjs/next/utils/pagination.js.map +0 -1
  54. package/dist/esm/next/utils/async-iterable.js.map +0 -1
  55. package/dist/esm/next/utils/pagination.js.map +0 -1
  56. package/dist/types/next/tests/client.error-handling.test.d.ts.map +0 -1
  57. package/dist/types/next/tests/client.get-component-snapshot.test.d.ts.map +0 -1
  58. package/dist/types/next/tests/client.get-page-snapshot.test.d.ts.map +0 -1
  59. package/dist/types/next/tests/client.get-pages.test.d.ts.map +0 -1
  60. package/dist/types/next/tests/client.get-resources.test.d.ts.map +0 -1
  61. package/dist/types/next/utils/async-iterable.d.ts.map +0 -1
  62. package/dist/types/next/utils/pagination.d.ts.map +0 -1
  63. /package/dist/cjs/{next/utils → utils}/async-iterable.js +0 -0
  64. /package/dist/cjs/{next/utils → utils}/pagination.js +0 -0
  65. /package/dist/esm/{next/utils → utils}/async-iterable.js +0 -0
  66. /package/dist/esm/{next/utils → utils}/pagination.js +0 -0
  67. /package/dist/types/{next → client}/tests/client.error-handling.test.d.ts +0 -0
  68. /package/dist/types/{next → client}/tests/client.get-component-snapshot.test.d.ts +0 -0
  69. /package/dist/types/{next → client}/tests/client.get-page-snapshot.test.d.ts +0 -0
  70. /package/dist/types/{next → client}/tests/client.get-pages.test.d.ts +0 -0
  71. /package/dist/types/{next → client}/tests/client.get-resources.test.d.ts +0 -0
  72. /package/dist/types/{next/utils → utils}/async-iterable.d.ts +0 -0
  73. /package/dist/types/{next/utils → utils}/pagination.d.ts +0 -0
@@ -0,0 +1,697 @@
1
+ import { z } from 'zod';
2
+ import { File, GlobalElement, LocalizedGlobalElement, PagePathnameSlice, Swatch, Table, Typography } from '../api';
3
+ import { CacheData } from '../api/react';
4
+ import { ReactRuntime } from '../runtimes/react';
5
+ import { type Element, type ElementData, type Data, type Document } from '../state/react-page';
6
+ import { MakeswiftSiteVersion } from '../api/site-version';
7
+ import { EmbeddedDocument } from '../state/modules/read-only-documents';
8
+ declare const makeswiftPageResultSchema: z.ZodObject<{
9
+ id: z.ZodString;
10
+ path: z.ZodString;
11
+ title: z.ZodNullable<z.ZodString>;
12
+ description: z.ZodNullable<z.ZodString>;
13
+ canonicalUrl: z.ZodNullable<z.ZodString>;
14
+ socialImageUrl: z.ZodNullable<z.ZodString>;
15
+ sitemapPriority: z.ZodNullable<z.ZodNumber>;
16
+ sitemapFrequency: z.ZodNullable<z.ZodEnum<["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"]>>;
17
+ createdAt: z.ZodString;
18
+ updatedAt: z.ZodString;
19
+ publishedAt: z.ZodNullable<z.ZodString>;
20
+ isOnline: z.ZodNullable<z.ZodBoolean>;
21
+ excludedFromSearch: z.ZodNullable<z.ZodBoolean>;
22
+ locale: z.ZodString;
23
+ localizedVariants: z.ZodArray<z.ZodObject<{
24
+ locale: z.ZodString;
25
+ path: z.ZodString;
26
+ }, "strip", z.ZodTypeAny, {
27
+ locale: string;
28
+ path: string;
29
+ }, {
30
+ locale: string;
31
+ path: string;
32
+ }>, "many">;
33
+ }, "strip", z.ZodTypeAny, {
34
+ description: string | null;
35
+ id: string;
36
+ locale: string;
37
+ path: string;
38
+ title: string | null;
39
+ canonicalUrl: string | null;
40
+ socialImageUrl: string | null;
41
+ sitemapPriority: number | null;
42
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
43
+ createdAt: string;
44
+ updatedAt: string;
45
+ publishedAt: string | null;
46
+ isOnline: boolean | null;
47
+ excludedFromSearch: boolean | null;
48
+ localizedVariants: {
49
+ locale: string;
50
+ path: string;
51
+ }[];
52
+ }, {
53
+ description: string | null;
54
+ id: string;
55
+ locale: string;
56
+ path: string;
57
+ title: string | null;
58
+ canonicalUrl: string | null;
59
+ socialImageUrl: string | null;
60
+ sitemapPriority: number | null;
61
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
62
+ createdAt: string;
63
+ updatedAt: string;
64
+ publishedAt: string | null;
65
+ isOnline: boolean | null;
66
+ excludedFromSearch: boolean | null;
67
+ localizedVariants: {
68
+ locale: string;
69
+ path: string;
70
+ }[];
71
+ }>;
72
+ declare const makeswiftGetPagesResultAPISchema: z.ZodObject<{
73
+ data: z.ZodArray<z.ZodObject<{
74
+ id: z.ZodString;
75
+ path: z.ZodString;
76
+ title: z.ZodNullable<z.ZodString>;
77
+ description: z.ZodNullable<z.ZodString>;
78
+ canonicalUrl: z.ZodNullable<z.ZodString>;
79
+ socialImageUrl: z.ZodNullable<z.ZodString>;
80
+ sitemapPriority: z.ZodNullable<z.ZodNumber>;
81
+ sitemapFrequency: z.ZodNullable<z.ZodEnum<["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"]>>;
82
+ createdAt: z.ZodString;
83
+ updatedAt: z.ZodString;
84
+ publishedAt: z.ZodNullable<z.ZodString>;
85
+ isOnline: z.ZodNullable<z.ZodBoolean>;
86
+ excludedFromSearch: z.ZodNullable<z.ZodBoolean>;
87
+ locale: z.ZodString;
88
+ localizedVariants: z.ZodArray<z.ZodObject<{
89
+ locale: z.ZodString;
90
+ path: z.ZodString;
91
+ }, "strip", z.ZodTypeAny, {
92
+ locale: string;
93
+ path: string;
94
+ }, {
95
+ locale: string;
96
+ path: string;
97
+ }>, "many">;
98
+ }, "strip", z.ZodTypeAny, {
99
+ description: string | null;
100
+ id: string;
101
+ locale: string;
102
+ path: string;
103
+ title: string | null;
104
+ canonicalUrl: string | null;
105
+ socialImageUrl: string | null;
106
+ sitemapPriority: number | null;
107
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
108
+ createdAt: string;
109
+ updatedAt: string;
110
+ publishedAt: string | null;
111
+ isOnline: boolean | null;
112
+ excludedFromSearch: boolean | null;
113
+ localizedVariants: {
114
+ locale: string;
115
+ path: string;
116
+ }[];
117
+ }, {
118
+ description: string | null;
119
+ id: string;
120
+ locale: string;
121
+ path: string;
122
+ title: string | null;
123
+ canonicalUrl: string | null;
124
+ socialImageUrl: string | null;
125
+ sitemapPriority: number | null;
126
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
127
+ createdAt: string;
128
+ updatedAt: string;
129
+ publishedAt: string | null;
130
+ isOnline: boolean | null;
131
+ excludedFromSearch: boolean | null;
132
+ localizedVariants: {
133
+ locale: string;
134
+ path: string;
135
+ }[];
136
+ }>, "many">;
137
+ hasMore: z.ZodBoolean;
138
+ }, "strip", z.ZodTypeAny, {
139
+ data: {
140
+ description: string | null;
141
+ id: string;
142
+ locale: string;
143
+ path: string;
144
+ title: string | null;
145
+ canonicalUrl: string | null;
146
+ socialImageUrl: string | null;
147
+ sitemapPriority: number | null;
148
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
149
+ createdAt: string;
150
+ updatedAt: string;
151
+ publishedAt: string | null;
152
+ isOnline: boolean | null;
153
+ excludedFromSearch: boolean | null;
154
+ localizedVariants: {
155
+ locale: string;
156
+ path: string;
157
+ }[];
158
+ }[];
159
+ hasMore: boolean;
160
+ }, {
161
+ data: {
162
+ description: string | null;
163
+ id: string;
164
+ locale: string;
165
+ path: string;
166
+ title: string | null;
167
+ canonicalUrl: string | null;
168
+ socialImageUrl: string | null;
169
+ sitemapPriority: number | null;
170
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
171
+ createdAt: string;
172
+ updatedAt: string;
173
+ publishedAt: string | null;
174
+ isOnline: boolean | null;
175
+ excludedFromSearch: boolean | null;
176
+ localizedVariants: {
177
+ locale: string;
178
+ path: string;
179
+ }[];
180
+ }[];
181
+ hasMore: boolean;
182
+ }>;
183
+ export type MakeswiftPage = z.infer<typeof makeswiftPageResultSchema>;
184
+ export type MakeswiftGetPagesResult = z.infer<typeof makeswiftGetPagesResultAPISchema>;
185
+ export type MakeswiftPageDocument = {
186
+ id: string;
187
+ site: {
188
+ id: string;
189
+ };
190
+ data: Element;
191
+ snippets: Snippet[];
192
+ fonts: Font[];
193
+ meta: Meta;
194
+ seo: Seo;
195
+ localizedPages: LocalizedPage[];
196
+ locale: string | null;
197
+ };
198
+ export declare function pageToRootDocument(pageDocument: MakeswiftPageDocument): Document;
199
+ export type MakeswiftPageSnapshot = {
200
+ document: MakeswiftPageDocument;
201
+ cacheData: CacheData;
202
+ };
203
+ declare const makeswiftComponentDocumentSchema: z.ZodObject<{
204
+ id: z.ZodString;
205
+ name: z.ZodNullable<z.ZodString>;
206
+ locale: z.ZodNullable<z.ZodString>;
207
+ data: z.ZodUnion<[z.ZodObject<{
208
+ type: z.ZodString;
209
+ key: z.ZodString;
210
+ props: z.ZodRecord<z.ZodString, z.ZodType<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
211
+ [key: string]: string | number | boolean | any | any | null | undefined;
212
+ } | null | undefined)[] | {
213
+ [key: string]: string | number | boolean | any | any | null | undefined;
214
+ } | null | undefined)[] | {
215
+ [key: string]: string | number | boolean | any | any | null | undefined;
216
+ } | null | undefined)[] | {
217
+ [key: string]: string | number | boolean | any | any | null | undefined;
218
+ } | null | undefined)[] | {
219
+ [key: string]: string | number | boolean | any | any | null | undefined;
220
+ } | null | undefined)[] | {
221
+ [key: string]: string | number | boolean | any | any | null | undefined;
222
+ } | null | undefined)[] | {
223
+ [key: string]: string | number | boolean | any | any | null | undefined;
224
+ } | null | undefined)[] | {
225
+ [key: string]: string | number | boolean | any | any | null | undefined;
226
+ } | null | undefined)[] | {
227
+ [key: string]: string | number | boolean | any | any | null | undefined;
228
+ } | null | undefined)[] | {
229
+ [key: string]: string | number | boolean | any | any | null | undefined;
230
+ } | null | undefined)[] | {
231
+ [key: string]: string | number | boolean | any | any | null | undefined;
232
+ } | null | undefined)[] | {
233
+ [key: string]: string | number | boolean | any | any | null | undefined;
234
+ } | null | undefined, z.ZodTypeDef, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
235
+ [key: string]: string | number | boolean | any | any | null | undefined;
236
+ } | null | undefined)[] | {
237
+ [key: string]: string | number | boolean | any | any | null | undefined;
238
+ } | null | undefined)[] | {
239
+ [key: string]: string | number | boolean | any | any | null | undefined;
240
+ } | null | undefined)[] | {
241
+ [key: string]: string | number | boolean | any | any | null | undefined;
242
+ } | null | undefined)[] | {
243
+ [key: string]: string | number | boolean | any | any | null | undefined;
244
+ } | null | undefined)[] | {
245
+ [key: string]: string | number | boolean | any | any | null | undefined;
246
+ } | null | undefined)[] | {
247
+ [key: string]: string | number | boolean | any | any | null | undefined;
248
+ } | null | undefined)[] | {
249
+ [key: string]: string | number | boolean | any | any | null | undefined;
250
+ } | null | undefined)[] | {
251
+ [key: string]: string | number | boolean | any | any | null | undefined;
252
+ } | null | undefined)[] | {
253
+ [key: string]: string | number | boolean | any | any | null | undefined;
254
+ } | null | undefined)[] | {
255
+ [key: string]: string | number | boolean | any | any | null | undefined;
256
+ } | null | undefined)[] | {
257
+ [key: string]: string | number | boolean | any | any | null | undefined;
258
+ } | null | undefined>>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ type: string;
261
+ key: string;
262
+ props: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
263
+ [key: string]: string | number | boolean | any | any | null | undefined;
264
+ } | null | undefined)[] | {
265
+ [key: string]: string | number | boolean | any | any | null | undefined;
266
+ } | null | undefined)[] | {
267
+ [key: string]: string | number | boolean | any | any | null | undefined;
268
+ } | null | undefined)[] | {
269
+ [key: string]: string | number | boolean | any | any | null | undefined;
270
+ } | null | undefined)[] | {
271
+ [key: string]: string | number | boolean | any | any | null | undefined;
272
+ } | null | undefined)[] | {
273
+ [key: string]: string | number | boolean | any | any | null | undefined;
274
+ } | null | undefined)[] | {
275
+ [key: string]: string | number | boolean | any | any | null | undefined;
276
+ } | null | undefined)[] | {
277
+ [key: string]: string | number | boolean | any | any | null | undefined;
278
+ } | null | undefined)[] | {
279
+ [key: string]: string | number | boolean | any | any | null | undefined;
280
+ } | null | undefined)[] | {
281
+ [key: string]: string | number | boolean | any | any | null | undefined;
282
+ } | null | undefined)[] | {
283
+ [key: string]: string | number | boolean | any | any | null | undefined;
284
+ } | null | undefined)[] | {
285
+ [key: string]: string | number | boolean | any | any | null | undefined;
286
+ } | null | undefined>;
287
+ }, {
288
+ type: string;
289
+ key: string;
290
+ props: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
291
+ [key: string]: string | number | boolean | any | any | null | undefined;
292
+ } | null | undefined)[] | {
293
+ [key: string]: string | number | boolean | any | any | null | undefined;
294
+ } | null | undefined)[] | {
295
+ [key: string]: string | number | boolean | any | any | null | undefined;
296
+ } | null | undefined)[] | {
297
+ [key: string]: string | number | boolean | any | any | null | undefined;
298
+ } | null | undefined)[] | {
299
+ [key: string]: string | number | boolean | any | any | null | undefined;
300
+ } | null | undefined)[] | {
301
+ [key: string]: string | number | boolean | any | any | null | undefined;
302
+ } | null | undefined)[] | {
303
+ [key: string]: string | number | boolean | any | any | null | undefined;
304
+ } | null | undefined)[] | {
305
+ [key: string]: string | number | boolean | any | any | null | undefined;
306
+ } | null | undefined)[] | {
307
+ [key: string]: string | number | boolean | any | any | null | undefined;
308
+ } | null | undefined)[] | {
309
+ [key: string]: string | number | boolean | any | any | null | undefined;
310
+ } | null | undefined)[] | {
311
+ [key: string]: string | number | boolean | any | any | null | undefined;
312
+ } | null | undefined)[] | {
313
+ [key: string]: string | number | boolean | any | any | null | undefined;
314
+ } | null | undefined>;
315
+ }>, z.ZodObject<{
316
+ type: z.ZodLiteral<"reference">;
317
+ key: z.ZodString;
318
+ value: z.ZodString;
319
+ }, "strip", z.ZodTypeAny, {
320
+ type: "reference";
321
+ value: string;
322
+ key: string;
323
+ }, {
324
+ type: "reference";
325
+ value: string;
326
+ key: string;
327
+ }>]>;
328
+ siteId: z.ZodString;
329
+ inheritsFromParent: z.ZodBoolean;
330
+ }, "strip", z.ZodTypeAny, {
331
+ id: string;
332
+ locale: string | null;
333
+ name: string | null;
334
+ data: ({
335
+ type: string;
336
+ key: string;
337
+ props: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
338
+ [key: string]: string | number | boolean | any | any | null | undefined;
339
+ } | null | undefined)[] | {
340
+ [key: string]: string | number | boolean | any | any | null | undefined;
341
+ } | null | undefined)[] | {
342
+ [key: string]: string | number | boolean | any | any | null | undefined;
343
+ } | null | undefined)[] | {
344
+ [key: string]: string | number | boolean | any | any | null | undefined;
345
+ } | null | undefined)[] | {
346
+ [key: string]: string | number | boolean | any | any | null | undefined;
347
+ } | null | undefined)[] | {
348
+ [key: string]: string | number | boolean | any | any | null | undefined;
349
+ } | null | undefined)[] | {
350
+ [key: string]: string | number | boolean | any | any | null | undefined;
351
+ } | null | undefined)[] | {
352
+ [key: string]: string | number | boolean | any | any | null | undefined;
353
+ } | null | undefined)[] | {
354
+ [key: string]: string | number | boolean | any | any | null | undefined;
355
+ } | null | undefined)[] | {
356
+ [key: string]: string | number | boolean | any | any | null | undefined;
357
+ } | null | undefined)[] | {
358
+ [key: string]: string | number | boolean | any | any | null | undefined;
359
+ } | null | undefined)[] | {
360
+ [key: string]: string | number | boolean | any | any | null | undefined;
361
+ } | null | undefined>;
362
+ } | {
363
+ type: "reference";
364
+ value: string;
365
+ key: string;
366
+ }) & ({
367
+ type: string;
368
+ key: string;
369
+ props: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
370
+ [key: string]: string | number | boolean | any | any | null | undefined;
371
+ } | null | undefined)[] | {
372
+ [key: string]: string | number | boolean | any | any | null | undefined;
373
+ } | null | undefined)[] | {
374
+ [key: string]: string | number | boolean | any | any | null | undefined;
375
+ } | null | undefined)[] | {
376
+ [key: string]: string | number | boolean | any | any | null | undefined;
377
+ } | null | undefined)[] | {
378
+ [key: string]: string | number | boolean | any | any | null | undefined;
379
+ } | null | undefined)[] | {
380
+ [key: string]: string | number | boolean | any | any | null | undefined;
381
+ } | null | undefined)[] | {
382
+ [key: string]: string | number | boolean | any | any | null | undefined;
383
+ } | null | undefined)[] | {
384
+ [key: string]: string | number | boolean | any | any | null | undefined;
385
+ } | null | undefined)[] | {
386
+ [key: string]: string | number | boolean | any | any | null | undefined;
387
+ } | null | undefined)[] | {
388
+ [key: string]: string | number | boolean | any | any | null | undefined;
389
+ } | null | undefined)[] | {
390
+ [key: string]: string | number | boolean | any | any | null | undefined;
391
+ } | null | undefined)[] | {
392
+ [key: string]: string | number | boolean | any | any | null | undefined;
393
+ } | null | undefined>;
394
+ } | {
395
+ type: "reference";
396
+ value: string;
397
+ key: string;
398
+ } | undefined);
399
+ siteId: string;
400
+ inheritsFromParent: boolean;
401
+ }, {
402
+ id: string;
403
+ locale: string | null;
404
+ name: string | null;
405
+ data: ({
406
+ type: string;
407
+ key: string;
408
+ props: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
409
+ [key: string]: string | number | boolean | any | any | null | undefined;
410
+ } | null | undefined)[] | {
411
+ [key: string]: string | number | boolean | any | any | null | undefined;
412
+ } | null | undefined)[] | {
413
+ [key: string]: string | number | boolean | any | any | null | undefined;
414
+ } | null | undefined)[] | {
415
+ [key: string]: string | number | boolean | any | any | null | undefined;
416
+ } | null | undefined)[] | {
417
+ [key: string]: string | number | boolean | any | any | null | undefined;
418
+ } | null | undefined)[] | {
419
+ [key: string]: string | number | boolean | any | any | null | undefined;
420
+ } | null | undefined)[] | {
421
+ [key: string]: string | number | boolean | any | any | null | undefined;
422
+ } | null | undefined)[] | {
423
+ [key: string]: string | number | boolean | any | any | null | undefined;
424
+ } | null | undefined)[] | {
425
+ [key: string]: string | number | boolean | any | any | null | undefined;
426
+ } | null | undefined)[] | {
427
+ [key: string]: string | number | boolean | any | any | null | undefined;
428
+ } | null | undefined)[] | {
429
+ [key: string]: string | number | boolean | any | any | null | undefined;
430
+ } | null | undefined)[] | {
431
+ [key: string]: string | number | boolean | any | any | null | undefined;
432
+ } | null | undefined>;
433
+ } | {
434
+ type: "reference";
435
+ value: string;
436
+ key: string;
437
+ }) & ({
438
+ type: string;
439
+ key: string;
440
+ props: Record<string, string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
441
+ [key: string]: string | number | boolean | any | any | null | undefined;
442
+ } | null | undefined)[] | {
443
+ [key: string]: string | number | boolean | any | any | null | undefined;
444
+ } | null | undefined)[] | {
445
+ [key: string]: string | number | boolean | any | any | null | undefined;
446
+ } | null | undefined)[] | {
447
+ [key: string]: string | number | boolean | any | any | null | undefined;
448
+ } | null | undefined)[] | {
449
+ [key: string]: string | number | boolean | any | any | null | undefined;
450
+ } | null | undefined)[] | {
451
+ [key: string]: string | number | boolean | any | any | null | undefined;
452
+ } | null | undefined)[] | {
453
+ [key: string]: string | number | boolean | any | any | null | undefined;
454
+ } | null | undefined)[] | {
455
+ [key: string]: string | number | boolean | any | any | null | undefined;
456
+ } | null | undefined)[] | {
457
+ [key: string]: string | number | boolean | any | any | null | undefined;
458
+ } | null | undefined)[] | {
459
+ [key: string]: string | number | boolean | any | any | null | undefined;
460
+ } | null | undefined)[] | {
461
+ [key: string]: string | number | boolean | any | any | null | undefined;
462
+ } | null | undefined)[] | {
463
+ [key: string]: string | number | boolean | any | any | null | undefined;
464
+ } | null | undefined>;
465
+ } | {
466
+ type: "reference";
467
+ value: string;
468
+ key: string;
469
+ } | undefined);
470
+ siteId: string;
471
+ inheritsFromParent: boolean;
472
+ }>;
473
+ export type MakeswiftComponentDocument = z.infer<typeof makeswiftComponentDocumentSchema>;
474
+ declare const makeswiftComponentDocumentFallbackSchema: z.ZodObject<{
475
+ id: z.ZodString;
476
+ locale: z.ZodNullable<z.ZodString>;
477
+ data: z.ZodNull;
478
+ }, "strip", z.ZodTypeAny, {
479
+ id: string;
480
+ locale: string | null;
481
+ data: null;
482
+ }, {
483
+ id: string;
484
+ locale: string | null;
485
+ data: null;
486
+ }>;
487
+ export type MakeswiftComponentDocumentFallback = z.infer<typeof makeswiftComponentDocumentFallbackSchema>;
488
+ export type MakeswiftComponentSnapshotMetadata = {
489
+ allowLocaleFallback: boolean;
490
+ requestedLocale: string | null;
491
+ };
492
+ export type MakeswiftComponentSnapshot = {
493
+ document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback;
494
+ key: string;
495
+ cacheData: CacheData;
496
+ meta: MakeswiftComponentSnapshotMetadata;
497
+ };
498
+ export declare function componentDocumentToRootEmbeddedDocument({ document, documentKey, name, type, meta, }: {
499
+ document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback;
500
+ documentKey: string;
501
+ name: string;
502
+ type: string;
503
+ meta: MakeswiftComponentSnapshotMetadata;
504
+ }): EmbeddedDocument;
505
+ export declare function failedResponseBody(response: Response): Promise<unknown>;
506
+ type Snippet = {
507
+ id: string;
508
+ code: string;
509
+ location: 'HEAD' | 'BODY';
510
+ liveEnabled: boolean;
511
+ builderEnabled: boolean;
512
+ cleanup: string | null;
513
+ };
514
+ type Font = {
515
+ family: string;
516
+ variants: string[];
517
+ };
518
+ type Meta = {
519
+ title?: string | null;
520
+ description?: string | null;
521
+ keywords?: string | null;
522
+ socialImage?: {
523
+ id: string;
524
+ publicUrl: string;
525
+ mimetype: string;
526
+ } | null;
527
+ favicon?: {
528
+ id: string;
529
+ publicUrl: string;
530
+ mimetype: string;
531
+ } | null;
532
+ };
533
+ type Seo = {
534
+ canonicalUrl?: string | null;
535
+ isIndexingBlocked?: boolean | null;
536
+ };
537
+ type LocalizedPage = {
538
+ id: string;
539
+ data: Element;
540
+ elementTreeId: string;
541
+ parentId: string | null;
542
+ meta: Omit<Meta, 'favicon'>;
543
+ seo: Seo;
544
+ };
545
+ type MakeswiftConfig = {
546
+ apiOrigin?: string;
547
+ runtime: ReactRuntime;
548
+ };
549
+ export type Sitemap = {
550
+ id: string;
551
+ loc: string;
552
+ lastmod?: string;
553
+ changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
554
+ priority?: number;
555
+ alternateRefs?: {
556
+ hreflang: string;
557
+ href: string;
558
+ }[];
559
+ }[];
560
+ declare const getPageAPISchema: z.ZodObject<{
561
+ pathname: z.ZodString;
562
+ locale: z.ZodString;
563
+ alternate: z.ZodArray<z.ZodObject<{
564
+ pathname: z.ZodString;
565
+ locale: z.ZodString;
566
+ }, "strip", z.ZodTypeAny, {
567
+ locale: string;
568
+ pathname: string;
569
+ }, {
570
+ locale: string;
571
+ pathname: string;
572
+ }>, "many">;
573
+ }, "strip", z.ZodTypeAny, {
574
+ locale: string;
575
+ pathname: string;
576
+ alternate: {
577
+ locale: string;
578
+ pathname: string;
579
+ }[];
580
+ }, {
581
+ locale: string;
582
+ pathname: string;
583
+ alternate: {
584
+ locale: string;
585
+ pathname: string;
586
+ }[];
587
+ }>;
588
+ type GetPageAPI = z.infer<typeof getPageAPISchema>;
589
+ export declare class MakeswiftClient {
590
+ private graphqlClient;
591
+ private runtime;
592
+ readonly apiKey: string;
593
+ readonly apiOrigin: URL;
594
+ constructor(apiKey: string, { apiOrigin, runtime }: MakeswiftConfig);
595
+ private fetch;
596
+ /**
597
+ * Override this method to provide additional fetch options, e.g. revalidation, cache tags, etc.
598
+ */
599
+ fetchOptions(_siteVersion: MakeswiftSiteVersion): Record<string, unknown>;
600
+ private getPagesInternal;
601
+ getPages: (options?: ({
602
+ siteVersion?: "Live" | "Working" | undefined;
603
+ } & {
604
+ limit?: number | undefined;
605
+ after?: string | undefined;
606
+ sortBy?: "description" | "path" | "title" | "createdAt" | "updatedAt" | undefined;
607
+ sortDirection?: "desc" | "asc" | undefined;
608
+ includeOffline?: boolean | undefined;
609
+ pathPrefix?: string | undefined;
610
+ locale?: string | undefined;
611
+ }) | undefined) => Promise<{
612
+ data: {
613
+ description: string | null;
614
+ id: string;
615
+ locale: string;
616
+ path: string;
617
+ title: string | null;
618
+ canonicalUrl: string | null;
619
+ socialImageUrl: string | null;
620
+ sitemapPriority: number | null;
621
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
622
+ createdAt: string;
623
+ updatedAt: string;
624
+ publishedAt: string | null;
625
+ isOnline: boolean | null;
626
+ excludedFromSearch: boolean | null;
627
+ localizedVariants: {
628
+ locale: string;
629
+ path: string;
630
+ }[];
631
+ }[];
632
+ hasMore: boolean;
633
+ }> & import("../utils/async-iterable").AsyncIterableExt<{
634
+ description: string | null;
635
+ id: string;
636
+ locale: string;
637
+ path: string;
638
+ title: string | null;
639
+ canonicalUrl: string | null;
640
+ socialImageUrl: string | null;
641
+ sitemapPriority: number | null;
642
+ sitemapFrequency: "always" | "never" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
643
+ createdAt: string;
644
+ updatedAt: string;
645
+ publishedAt: string | null;
646
+ isOnline: boolean | null;
647
+ excludedFromSearch: boolean | null;
648
+ localizedVariants: {
649
+ locale: string;
650
+ path: string;
651
+ }[];
652
+ }>;
653
+ getPage(pathname: string, { siteVersion, locale, }?: {
654
+ siteVersion?: MakeswiftSiteVersion;
655
+ locale?: string;
656
+ }): Promise<GetPageAPI | null>;
657
+ private getTypographies;
658
+ private getSwatches;
659
+ private getIntrospectedResources;
660
+ private introspect;
661
+ getPageSnapshot(pathname: string, { siteVersion: siteVersionPromise, locale, allowLocaleFallback, }: {
662
+ siteVersion: MakeswiftSiteVersion | Promise<MakeswiftSiteVersion>;
663
+ locale?: string;
664
+ allowLocaleFallback?: boolean;
665
+ }): Promise<MakeswiftPageSnapshot | null>;
666
+ getComponentSnapshot(id: string, { siteVersion: siteVersionPromise, locale, allowLocaleFallback, }: {
667
+ siteVersion: MakeswiftSiteVersion | Promise<MakeswiftSiteVersion>;
668
+ locale?: string;
669
+ allowLocaleFallback?: boolean;
670
+ }): Promise<MakeswiftComponentSnapshot>;
671
+ getSwatch(swatchId: string, siteVersion: MakeswiftSiteVersion): Promise<Swatch | null>;
672
+ getFile(fileId: string): Promise<File | null>;
673
+ getTypography(typographyId: string, siteVersion: MakeswiftSiteVersion): Promise<Typography | null>;
674
+ getGlobalElement(globalElementId: string, siteVersion: MakeswiftSiteVersion): Promise<GlobalElement | null>;
675
+ getLocalizedGlobalElement(globalElementId: string, locale: string, siteVersion: MakeswiftSiteVersion): Promise<LocalizedGlobalElement | null>;
676
+ getPagePathnameSlices(pageIds: string[], siteVersion: MakeswiftSiteVersion, { locale }: {
677
+ locale?: string | null;
678
+ }): Promise<(PagePathnameSlice | null)[]>;
679
+ getPagePathnameSlice(pageId: string, siteVersion: MakeswiftSiteVersion, { locale }?: {
680
+ locale?: string;
681
+ }): Promise<PagePathnameSlice | null>;
682
+ getTable(tableId: string): Promise<Table | null>;
683
+ /**
684
+ * @deprecated `getSitemap` is deprecated. We recommend constructing a sitemap
685
+ * using data from `getPages` instead.
686
+ */
687
+ getSitemap({ limit, after, pathnamePrefix, locale, }?: {
688
+ limit?: number;
689
+ after?: string;
690
+ pathnamePrefix?: string;
691
+ locale?: string;
692
+ }): Promise<Sitemap>;
693
+ getTranslatableData(elementTree: ElementData): Record<string, Data>;
694
+ mergeTranslatedData(elementTree: ElementData, translatedData: Record<string, Data>): Element;
695
+ }
696
+ export {};
697
+ //# sourceMappingURL=index.d.ts.map