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