@makeswift/runtime 0.28.7-canary.4 → 0.28.7-canary.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/api-resources-client.js.map +1 -1
- package/dist/cjs/api/graphql/documents/queries.js +6 -6
- package/dist/cjs/api/graphql/documents/queries.js.map +1 -1
- package/dist/cjs/api/graphql/generated/types.js.map +1 -1
- package/dist/cjs/api/graphql-api-client.js +23 -1
- package/dist/cjs/api/graphql-api-client.js.map +1 -1
- package/dist/cjs/api/{client.js → host-api-resources-client.js} +7 -7
- package/dist/cjs/api/host-api-resources-client.js.map +1 -0
- package/dist/cjs/api/rest-api-client.js +186 -0
- package/dist/cjs/api/rest-api-client.js.map +1 -0
- package/dist/cjs/api/schema/index.js +23 -0
- package/dist/cjs/api/schema/index.js.map +1 -0
- package/dist/cjs/api/schema/page-pathname-slice.js +38 -0
- package/dist/cjs/api/schema/page-pathname-slice.js.map +1 -0
- package/dist/cjs/api/types.js.map +1 -1
- package/dist/cjs/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/client/component-snapshot.js +63 -0
- package/dist/cjs/client/component-snapshot.js.map +1 -0
- package/dist/cjs/client/index.js +103 -360
- package/dist/cjs/client/index.js.map +1 -1
- package/dist/cjs/client/page-snapshot.js +33 -0
- package/dist/cjs/client/page-snapshot.js.map +1 -0
- package/dist/cjs/client/schema/component-document.js +45 -0
- package/dist/cjs/client/schema/component-document.js.map +1 -0
- package/dist/cjs/client/schema/fonts.js +38 -0
- package/dist/cjs/client/schema/fonts.js.map +1 -0
- package/dist/cjs/client/schema/get-page.js +39 -0
- package/dist/cjs/client/schema/get-page.js.map +1 -0
- package/dist/cjs/client/schema/get-pages.js +68 -0
- package/dist/cjs/client/schema/get-pages.js.map +1 -0
- package/dist/cjs/client/schema/index.js +31 -0
- package/dist/cjs/client/schema/index.js.map +1 -0
- package/dist/cjs/client/schema/preview-token-payload.js +34 -0
- package/dist/cjs/client/schema/preview-token-payload.js.map +1 -0
- package/dist/cjs/next/client.js +0 -8
- package/dist/cjs/next/client.js.map +1 -1
- package/dist/cjs/next/components/tests/controls/color-control/fixtures.js.map +1 -1
- package/dist/cjs/next/components/tests/controls/page-control-prop-rendering.js.map +1 -1
- package/dist/cjs/next/components/tests/controls/rich-text-v2-control/fixtures.js.map +1 -1
- package/dist/cjs/next/fetch.js.map +1 -1
- package/dist/cjs/next/testing/element-data.js +3 -3
- package/dist/cjs/next/testing/element-data.js.map +1 -1
- package/dist/cjs/runtimes/react/hooks/use-cache-data.js.map +1 -1
- package/dist/cjs/runtimes/react/runtime-core.js +2 -2
- package/dist/cjs/runtimes/react/runtime-core.js.map +1 -1
- package/dist/cjs/runtimes/react/testing/react-runtime.js +7 -1
- package/dist/cjs/runtimes/react/testing/react-runtime.js.map +1 -1
- package/dist/cjs/state/api-client/fetch-api-resource.js +8 -8
- package/dist/cjs/state/api-client/fetch-api-resource.js.map +1 -1
- package/dist/esm/api/api-resources-client.js.map +1 -1
- package/dist/esm/api/graphql/documents/queries.js +4 -4
- package/dist/esm/api/graphql/documents/queries.js.map +1 -1
- package/dist/esm/api/graphql/generated/types.js.map +1 -1
- package/dist/esm/api/graphql-api-client.js +29 -2
- package/dist/esm/api/graphql-api-client.js.map +1 -1
- package/dist/esm/api/{client.js → host-api-resources-client.js} +3 -3
- package/dist/esm/api/host-api-resources-client.js.map +1 -0
- package/dist/esm/api/rest-api-client.js +151 -0
- package/dist/esm/api/rest-api-client.js.map +1 -0
- package/dist/esm/api/schema/index.js +2 -0
- package/dist/esm/api/schema/index.js.map +1 -0
- package/dist/esm/api/schema/page-pathname-slice.js +14 -0
- package/dist/esm/api/schema/page-pathname-slice.js.map +1 -0
- package/dist/esm/api/types.js.map +1 -1
- package/dist/esm/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/client/component-snapshot.js +39 -0
- package/dist/esm/client/component-snapshot.js.map +1 -0
- package/dist/esm/client/index.js +68 -329
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/client/page-snapshot.js +9 -0
- package/dist/esm/client/page-snapshot.js.map +1 -0
- package/dist/esm/client/schema/component-document.js +20 -0
- package/dist/esm/client/schema/component-document.js.map +1 -0
- package/dist/esm/client/schema/fonts.js +14 -0
- package/dist/esm/client/schema/fonts.js.map +1 -0
- package/dist/esm/client/schema/get-page.js +15 -0
- package/dist/esm/client/schema/get-page.js.map +1 -0
- package/dist/esm/client/schema/get-pages.js +42 -0
- package/dist/esm/client/schema/get-pages.js.map +1 -0
- package/dist/esm/client/schema/index.js +6 -0
- package/dist/esm/client/schema/index.js.map +1 -0
- package/dist/esm/client/schema/preview-token-payload.js +10 -0
- package/dist/esm/client/schema/preview-token-payload.js.map +1 -0
- package/dist/esm/next/client.js +0 -8
- package/dist/esm/next/client.js.map +1 -1
- package/dist/esm/next/components/tests/controls/color-control/fixtures.js.map +1 -1
- package/dist/esm/next/components/tests/controls/page-control-prop-rendering.js.map +1 -1
- package/dist/esm/next/components/tests/controls/rich-text-v2-control/fixtures.js.map +1 -1
- package/dist/esm/next/fetch.js.map +1 -1
- package/dist/esm/next/testing/element-data.js +1 -1
- package/dist/esm/next/testing/element-data.js.map +1 -1
- package/dist/esm/runtimes/react/hooks/use-cache-data.js.map +1 -1
- package/dist/esm/runtimes/react/runtime-core.js +2 -2
- package/dist/esm/runtimes/react/runtime-core.js.map +1 -1
- package/dist/esm/runtimes/react/testing/react-runtime.js +7 -1
- package/dist/esm/runtimes/react/testing/react-runtime.js.map +1 -1
- package/dist/esm/state/api-client/fetch-api-resource.js +1 -1
- package/dist/esm/state/api-client/fetch-api-resource.js.map +1 -1
- package/dist/types/api/__tests__/rest-api-client.error-handling.test.d.ts +2 -0
- package/dist/types/api/__tests__/rest-api-client.error-handling.test.d.ts.map +1 -0
- package/dist/types/api/__tests__/rest-api-client.get-resources.test.d.ts +2 -0
- package/dist/types/api/__tests__/rest-api-client.get-resources.test.d.ts.map +1 -0
- package/dist/types/api/api-resources-client.d.ts.map +1 -1
- package/dist/types/api/graphql/documents/queries.d.ts +1 -1
- package/dist/types/api/graphql/documents/queries.d.ts.map +1 -1
- package/dist/types/api/graphql/generated/types.d.ts +2 -2
- package/dist/types/api/graphql/generated/types.d.ts.map +1 -1
- package/dist/types/api/graphql-api-client.d.ts +5 -0
- package/dist/types/api/graphql-api-client.d.ts.map +1 -1
- package/dist/types/api/{client.d.ts → host-api-resources-client.d.ts} +3 -4
- package/dist/types/api/host-api-resources-client.d.ts.map +1 -0
- package/dist/types/api/rest-api-client.d.ts +25 -0
- package/dist/types/api/rest-api-client.d.ts.map +1 -0
- package/dist/types/api/schema/index.d.ts +2 -0
- package/dist/types/api/schema/index.d.ts.map +1 -0
- package/dist/types/api/schema/page-pathname-slice.d.ts +21 -0
- package/dist/types/api/schema/page-pathname-slice.d.ts.map +1 -0
- package/dist/types/api/types.d.ts +1 -0
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/client/component-snapshot.d.ts +25 -0
- package/dist/types/client/component-snapshot.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +19 -640
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/client/page-snapshot.d.ts +62 -0
- package/dist/types/client/page-snapshot.d.ts.map +1 -0
- package/dist/types/client/schema/component-document.d.ts +285 -0
- package/dist/types/client/schema/component-document.d.ts.map +1 -0
- package/dist/types/client/schema/fonts.d.ts +27 -0
- package/dist/types/client/schema/fonts.d.ts.map +1 -0
- package/dist/types/client/schema/get-page.d.ts +30 -0
- package/dist/types/client/schema/get-page.d.ts.map +1 -0
- package/dist/types/client/schema/get-pages.d.ts +202 -0
- package/dist/types/client/schema/get-pages.d.ts.map +1 -0
- package/dist/types/client/schema/index.d.ts +6 -0
- package/dist/types/client/schema/index.d.ts.map +1 -0
- package/dist/types/client/schema/preview-token-payload.d.ts +19 -0
- package/dist/types/client/schema/preview-token-payload.d.ts.map +1 -0
- package/dist/types/next/client.d.ts +0 -1
- package/dist/types/next/client.d.ts.map +1 -1
- package/dist/types/next/components/tests/controls/color-control/fixtures.d.ts +1 -1
- package/dist/types/next/components/tests/controls/color-control/fixtures.d.ts.map +1 -1
- package/dist/types/next/components/tests/controls/page-control-prop-rendering.d.ts +1 -1
- package/dist/types/next/components/tests/controls/page-control-prop-rendering.d.ts.map +1 -1
- package/dist/types/next/components/tests/controls/rich-text-v2-control/fixtures.d.ts +1 -1
- package/dist/types/next/components/tests/controls/rich-text-v2-control/fixtures.d.ts.map +1 -1
- package/dist/types/next/fetch.d.ts +1 -1
- package/dist/types/next/fetch.d.ts.map +1 -1
- package/dist/types/runtimes/react/hooks/use-cache-data.d.ts +1 -1
- package/dist/types/runtimes/react/hooks/use-cache-data.d.ts.map +1 -1
- package/dist/types/runtimes/react/runtime-core.d.ts +1 -1
- package/dist/types/runtimes/react/runtime-core.d.ts.map +1 -1
- package/dist/types/runtimes/react/testing/react-runtime.d.ts.map +1 -1
- package/dist/types/state/api-client/fetch-api-resource.d.ts +1 -2
- package/dist/types/state/api-client/fetch-api-resource.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/api/client.js.map +0 -1
- package/dist/esm/api/client.js.map +0 -1
- package/dist/types/api/client.d.ts.map +0 -1
- package/dist/types/client/tests/client.error-handling.test.d.ts +0 -2
- package/dist/types/client/tests/client.error-handling.test.d.ts.map +0 -1
- package/dist/types/client/tests/client.get-resources.test.d.ts +0 -2
- package/dist/types/client/tests/client.get-resources.test.d.ts.map +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const pageData: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
title: z.ZodNullable<z.ZodString>;
|
|
6
|
+
description: z.ZodNullable<z.ZodString>;
|
|
7
|
+
canonicalUrl: z.ZodNullable<z.ZodString>;
|
|
8
|
+
socialImageUrl: z.ZodNullable<z.ZodString>;
|
|
9
|
+
sitemapPriority: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
sitemapFrequency: z.ZodNullable<z.ZodEnum<["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"]>>;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
updatedAt: z.ZodString;
|
|
13
|
+
publishedAt: z.ZodNullable<z.ZodString>;
|
|
14
|
+
isOnline: z.ZodNullable<z.ZodBoolean>;
|
|
15
|
+
excludedFromSearch: z.ZodNullable<z.ZodBoolean>;
|
|
16
|
+
locale: z.ZodString;
|
|
17
|
+
localizedVariants: z.ZodArray<z.ZodObject<{
|
|
18
|
+
locale: z.ZodString;
|
|
19
|
+
path: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
path: string;
|
|
22
|
+
locale: string;
|
|
23
|
+
}, {
|
|
24
|
+
path: string;
|
|
25
|
+
locale: string;
|
|
26
|
+
}>, "many">;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
path: string;
|
|
29
|
+
id: string;
|
|
30
|
+
locale: string;
|
|
31
|
+
title: string | null;
|
|
32
|
+
description: string | null;
|
|
33
|
+
canonicalUrl: string | null;
|
|
34
|
+
socialImageUrl: string | null;
|
|
35
|
+
sitemapPriority: number | null;
|
|
36
|
+
sitemapFrequency: "never" | "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
publishedAt: string | null;
|
|
40
|
+
isOnline: boolean | null;
|
|
41
|
+
excludedFromSearch: boolean | null;
|
|
42
|
+
localizedVariants: {
|
|
43
|
+
path: string;
|
|
44
|
+
locale: string;
|
|
45
|
+
}[];
|
|
46
|
+
}, {
|
|
47
|
+
path: string;
|
|
48
|
+
id: string;
|
|
49
|
+
locale: string;
|
|
50
|
+
title: string | null;
|
|
51
|
+
description: string | null;
|
|
52
|
+
canonicalUrl: string | null;
|
|
53
|
+
socialImageUrl: string | null;
|
|
54
|
+
sitemapPriority: number | null;
|
|
55
|
+
sitemapFrequency: "never" | "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
updatedAt: string;
|
|
58
|
+
publishedAt: string | null;
|
|
59
|
+
isOnline: boolean | null;
|
|
60
|
+
excludedFromSearch: boolean | null;
|
|
61
|
+
localizedVariants: {
|
|
62
|
+
path: string;
|
|
63
|
+
locale: string;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
66
|
+
export declare const getPagesResult: z.ZodObject<{
|
|
67
|
+
data: z.ZodArray<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
path: z.ZodString;
|
|
70
|
+
title: z.ZodNullable<z.ZodString>;
|
|
71
|
+
description: z.ZodNullable<z.ZodString>;
|
|
72
|
+
canonicalUrl: z.ZodNullable<z.ZodString>;
|
|
73
|
+
socialImageUrl: z.ZodNullable<z.ZodString>;
|
|
74
|
+
sitemapPriority: z.ZodNullable<z.ZodNumber>;
|
|
75
|
+
sitemapFrequency: z.ZodNullable<z.ZodEnum<["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"]>>;
|
|
76
|
+
createdAt: z.ZodString;
|
|
77
|
+
updatedAt: z.ZodString;
|
|
78
|
+
publishedAt: z.ZodNullable<z.ZodString>;
|
|
79
|
+
isOnline: z.ZodNullable<z.ZodBoolean>;
|
|
80
|
+
excludedFromSearch: z.ZodNullable<z.ZodBoolean>;
|
|
81
|
+
locale: z.ZodString;
|
|
82
|
+
localizedVariants: z.ZodArray<z.ZodObject<{
|
|
83
|
+
locale: z.ZodString;
|
|
84
|
+
path: z.ZodString;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
path: string;
|
|
87
|
+
locale: string;
|
|
88
|
+
}, {
|
|
89
|
+
path: string;
|
|
90
|
+
locale: string;
|
|
91
|
+
}>, "many">;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
path: string;
|
|
94
|
+
id: string;
|
|
95
|
+
locale: string;
|
|
96
|
+
title: string | null;
|
|
97
|
+
description: string | null;
|
|
98
|
+
canonicalUrl: string | null;
|
|
99
|
+
socialImageUrl: string | null;
|
|
100
|
+
sitemapPriority: number | null;
|
|
101
|
+
sitemapFrequency: "never" | "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
|
|
102
|
+
createdAt: string;
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
publishedAt: string | null;
|
|
105
|
+
isOnline: boolean | null;
|
|
106
|
+
excludedFromSearch: boolean | null;
|
|
107
|
+
localizedVariants: {
|
|
108
|
+
path: string;
|
|
109
|
+
locale: string;
|
|
110
|
+
}[];
|
|
111
|
+
}, {
|
|
112
|
+
path: string;
|
|
113
|
+
id: string;
|
|
114
|
+
locale: string;
|
|
115
|
+
title: string | null;
|
|
116
|
+
description: string | null;
|
|
117
|
+
canonicalUrl: string | null;
|
|
118
|
+
socialImageUrl: string | null;
|
|
119
|
+
sitemapPriority: number | null;
|
|
120
|
+
sitemapFrequency: "never" | "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
|
|
121
|
+
createdAt: string;
|
|
122
|
+
updatedAt: string;
|
|
123
|
+
publishedAt: string | null;
|
|
124
|
+
isOnline: boolean | null;
|
|
125
|
+
excludedFromSearch: boolean | null;
|
|
126
|
+
localizedVariants: {
|
|
127
|
+
path: string;
|
|
128
|
+
locale: string;
|
|
129
|
+
}[];
|
|
130
|
+
}>, "many">;
|
|
131
|
+
hasMore: z.ZodBoolean;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
data: {
|
|
134
|
+
path: string;
|
|
135
|
+
id: string;
|
|
136
|
+
locale: string;
|
|
137
|
+
title: string | null;
|
|
138
|
+
description: string | null;
|
|
139
|
+
canonicalUrl: string | null;
|
|
140
|
+
socialImageUrl: string | null;
|
|
141
|
+
sitemapPriority: number | null;
|
|
142
|
+
sitemapFrequency: "never" | "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
|
|
143
|
+
createdAt: string;
|
|
144
|
+
updatedAt: string;
|
|
145
|
+
publishedAt: string | null;
|
|
146
|
+
isOnline: boolean | null;
|
|
147
|
+
excludedFromSearch: boolean | null;
|
|
148
|
+
localizedVariants: {
|
|
149
|
+
path: string;
|
|
150
|
+
locale: string;
|
|
151
|
+
}[];
|
|
152
|
+
}[];
|
|
153
|
+
hasMore: boolean;
|
|
154
|
+
}, {
|
|
155
|
+
data: {
|
|
156
|
+
path: string;
|
|
157
|
+
id: string;
|
|
158
|
+
locale: string;
|
|
159
|
+
title: string | null;
|
|
160
|
+
description: string | null;
|
|
161
|
+
canonicalUrl: string | null;
|
|
162
|
+
socialImageUrl: string | null;
|
|
163
|
+
sitemapPriority: number | null;
|
|
164
|
+
sitemapFrequency: "never" | "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | null;
|
|
165
|
+
createdAt: string;
|
|
166
|
+
updatedAt: string;
|
|
167
|
+
publishedAt: string | null;
|
|
168
|
+
isOnline: boolean | null;
|
|
169
|
+
excludedFromSearch: boolean | null;
|
|
170
|
+
localizedVariants: {
|
|
171
|
+
path: string;
|
|
172
|
+
locale: string;
|
|
173
|
+
}[];
|
|
174
|
+
}[];
|
|
175
|
+
hasMore: boolean;
|
|
176
|
+
}>;
|
|
177
|
+
export declare const getPagesParams: z.ZodObject<{
|
|
178
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
after: z.ZodOptional<z.ZodString>;
|
|
180
|
+
sortBy: z.ZodOptional<z.ZodEnum<["title", "path", "description", "createdAt", "updatedAt"]>>;
|
|
181
|
+
sortDirection: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
182
|
+
includeOffline: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
pathPrefix: z.ZodOptional<z.ZodString>;
|
|
184
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
limit?: number | undefined;
|
|
187
|
+
after?: string | undefined;
|
|
188
|
+
sortBy?: "path" | "title" | "description" | "createdAt" | "updatedAt" | undefined;
|
|
189
|
+
sortDirection?: "desc" | "asc" | undefined;
|
|
190
|
+
includeOffline?: boolean | undefined;
|
|
191
|
+
pathPrefix?: string | undefined;
|
|
192
|
+
locale?: string | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
limit?: number | undefined;
|
|
195
|
+
after?: string | undefined;
|
|
196
|
+
sortBy?: "path" | "title" | "description" | "createdAt" | "updatedAt" | undefined;
|
|
197
|
+
sortDirection?: "desc" | "asc" | undefined;
|
|
198
|
+
includeOffline?: boolean | undefined;
|
|
199
|
+
pathPrefix?: string | undefined;
|
|
200
|
+
locale?: string | undefined;
|
|
201
|
+
}>;
|
|
202
|
+
//# sourceMappingURL=get-pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pages.d.ts","sourceRoot":"","sources":["../../../../src/client/schema/get-pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBnB,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGzB,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;EAQzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const previewTokenPayload: z.ZodObject<{
|
|
3
|
+
payload: z.ZodObject<{
|
|
4
|
+
version: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
version: string;
|
|
7
|
+
}, {
|
|
8
|
+
version: string;
|
|
9
|
+
}>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
payload: {
|
|
12
|
+
version: string;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
payload: {
|
|
16
|
+
version: string;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=preview-token-payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-token-payload.d.ts","sourceRoot":"","sources":["../../../../src/client/schema/preview-token-payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;EAI9B,CAAA"}
|
|
@@ -4,6 +4,5 @@ import { MakeswiftClient } from '../client';
|
|
|
4
4
|
export declare class Makeswift extends MakeswiftClient {
|
|
5
5
|
static getSiteVersion(previewData: PreviewData): SiteVersion | null;
|
|
6
6
|
static getPreviewMode(previewData: PreviewData): boolean;
|
|
7
|
-
fetchOptions(_siteVersion: SiteVersion): Record<string, unknown>;
|
|
8
7
|
}
|
|
9
8
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/next/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAGlC,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/next/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAGlC,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAM3C,qBAAa,SAAU,SAAQ,eAAe;IAC5C,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI;IAOnE,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO;CAGzD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ValueType } from '@makeswift/controls';
|
|
2
2
|
import { ColorDefinition } from '@makeswift/controls';
|
|
3
3
|
import { type Swatch } from '../../../../../api';
|
|
4
|
-
import { type CacheData } from '../../../../../api/client';
|
|
4
|
+
import { type CacheData } from '../../../../../api/api-resources-client';
|
|
5
5
|
type SwatchData = Omit<Swatch, 'id'>;
|
|
6
6
|
export declare const swatchId = "[swatch-test-id]";
|
|
7
7
|
export declare const swatch: SwatchData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../../../../src/next/components/tests/controls/color-control/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../../../../src/next/components/tests/controls/color-control/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,KAAK,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAEpC,eAAO,MAAM,QAAQ,qBAAqB,CAAA;AAC1C,eAAO,MAAM,MAAM,EAAE,UAKpB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,eAAe,CAG5C,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,QAAQ,UAAU,GAAG,IAAI,KAAG,OAAO,CAAC,SAAS,CAIrE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@testing-library/jest-dom';
|
|
2
2
|
import { type ValueType, type DataType, ControlDefinition } from '@makeswift/controls';
|
|
3
|
-
import { type CacheData } from '../../../../api/client';
|
|
3
|
+
import { type CacheData } from '../../../../api/api-resources-client';
|
|
4
4
|
import { ElementData } from '../../../../state/read-only-state';
|
|
5
5
|
import { ReactRuntime } from '../../../../runtimes/react/react-runtime';
|
|
6
6
|
export declare function testPageControlPropRendering<D extends ControlDefinition>(controlDefinition: D, { toData, value, locale, cacheData, expectedRenders, registerComponents, action, rootElements, isInBuilder, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-control-prop-rendering.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/tests/controls/page-control-prop-rendering.tsx"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,CAAA;AAGlC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"page-control-prop-rendering.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/tests/controls/page-control-prop-rendering.tsx"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,CAAA;AAGlC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AAiEvE,wBAAsB,4BAA4B,CAAC,CAAC,SAAS,iBAAiB,EAC5E,iBAAiB,EAAE,CAAC,EACpB,EACE,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,MAAM,EACN,YAAiB,EACjB,WAAmB,GACpB,EAAE;IACD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC7C,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;IACpD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAChD,YAAY,CAAC,EAAE,WAAW,EAAE,CAAA;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,iBA6FF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../../../../src/next/components/tests/controls/rich-text-v2-control/fixtures.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../../../../src/next/components/tests/controls/rich-text-v2-control/fixtures.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAoCxE,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAe,CAAA;AACjC,eAAO,MAAM,SAAS,QAAO,OAAO,CAAC,SAAS,CAe5C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/next/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/next/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAI7C,eAAO,MAAM,KAAK,EAAE,SACuD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cache-data.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-cache-data.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/hooks/use-cache-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAKlE,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,QAQhD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SerializableReplacementContext } from '@makeswift/controls';
|
|
2
|
-
import { type HttpFetch } from '../../
|
|
2
|
+
import { type HttpFetch } from '../../api/types';
|
|
3
3
|
import { type SiteVersion } from '../../api/site-version';
|
|
4
4
|
import { Breakpoints, BreakpointsInput } from '../../state/modules/breakpoints';
|
|
5
5
|
import { type Element, type ElementData } from '../../state/read-only-state';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-core.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/react/runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,qBAAqB,CAAA;AAGzE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime-core.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/react/runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,qBAAqB,CAAA;AAGzE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EACL,WAAW,EACX,gBAAgB,EAEjB,MAAM,iCAAiC,CAAA;AAIxC,OAAO,EAAkB,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC5F,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,KAAK,EACX,MAAM,mBAAmB,CAAA;AAK1B,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;IAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B,CAAA;AAID,qBAAa,WAAW;IAKtB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAM3B;IAEF,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;gBAEb,EACV,SAAuC,EACvC,SAAuC,EACvC,WAAW,EACX,UAAU,EACV,KAAK,GACN,EAAE;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,WAAW,CAAC,EAAE,gBAAgB,CAAA;QAC9B,UAAU,CAAC,EAAE,QAAQ,CAAA;QACrB,KAAK,EAAE,SAAS,CAAA;KACjB;IAYD,gBAAgB,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAG,KAAK;IA+B1D,WAAW,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAalE,YAAY,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAanE,eAAe,CACb,WAAW,EAAE,WAAW,EACxB,kBAAkB,EAAE,8BAA8B,GACjD,OAAO;IAIV,cAAc,IAAI,WAAW;IAI7B,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED,OAAO,CAAC,wBAAwB;IAUhC,OAAO,CAAC,wBAAwB;CAKjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/testing/react-runtime.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,GAAE;IAAE,WAAW,CAAC,EAAE,gBAAgB,CAAA;CAAO,
|
|
1
|
+
{"version":3,"file":"react-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/testing/react-runtime.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,GAAE;IAAE,WAAW,CAAC,EAAE,gBAAgB,CAAA;CAAO,gBAQ1F"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ThunkAction } from '@reduxjs/toolkit';
|
|
2
2
|
import { type Action } from '../actions';
|
|
3
|
-
import { APIResourceType, type APIResource, type APIResourceLocale } from '../../api';
|
|
3
|
+
import { APIResourceType, type APIResource, type APIResourceLocale, type HttpFetch } from '../../api/types';
|
|
4
4
|
import { type State } from './state';
|
|
5
|
-
export type HttpFetch = (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
6
5
|
type Thunk<ReturnType> = ThunkAction<ReturnType, State, unknown, Action>;
|
|
7
6
|
export declare function fetchAPIResource<T extends APIResourceType>(resourceType: T, resourceId: string, fetch: HttpFetch, locale?: APIResourceLocale<T>): Thunk<Promise<Extract<APIResource, {
|
|
8
7
|
__typename: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-api-resource.d.ts","sourceRoot":"","sources":["../../../../src/state/api-client/fetch-api-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAMnD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAQhB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fetch-api-resource.d.ts","sourceRoot":"","sources":["../../../../src/state/api-client/fetch-api-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAMnD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAQhB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,KAAK,KAAK,EAA6D,MAAM,SAAS,CAAA;AAE/F,KAAK,KAAK,CAAC,UAAU,IAAI,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAExE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,eAAe,EACxD,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,SAAS,EAChB,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAsGhE"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/client.ts"],"sourcesContent":["import { type State as ApiClientState } from '../state/api-client/state'\nimport { type HttpFetch, fetchAPIResource } from '../state/api-client/fetch-api-resource'\nimport { configureClientStore } from '../state/api-client/client-store'\n\nimport {\n type File,\n type GlobalElement,\n type LocalizedGlobalElement,\n type PagePathnameSlice,\n type Swatch,\n type Table,\n type Typography,\n APIResourceType,\n} from './types'\n\nimport { ApiResourcesClient } from './api-resources-client'\n\nexport { CacheData } from './api-resources-client'\n\n/**\n * NOTE(miguel): This \"client\" is used to fetch Makeswift API resources needed for the host. For\n * example, swatches, files, typographies, etc. Ideally it's internal to the runtime and is only\n * used by controls to transform API references to API resources.\n *\n * Moreover, its use should be reserved for the builder only, since for live pages all Makeswift\n * API resources should be embedded in the \"page snapshot\". In the builder, this client serves the\n * purpose of sending requests for API resources and keeping a cache so that changes that happen in\n * the builder, like modifying a swatch, can be sent via `postMessage` to the host and the cache can\n * immediately update the value and re-render.\n *\n * Furthermore, the API resources requested shouldn't be requested directly from the Makeswift API\n * as that would require those resources to not be authenticated since the requests come from the\n * browser when running the host. Instead, the requests should go to the host directly, at the\n * Makeswift API endpoint (i.g., `/api/makeswift/[...makeswift]` dynamic route) where the host's\n * API key can be used, securely, in the server. For this reason, this client should really be a\n * client of the host's API, not Makeswift's, intended to build and continuously maintain a realtime\n * snapshot for use in the builder, not the lives pages.\n */\nexport class MakeswiftHostApiClient extends ApiResourcesClient {\n readonly fetch: HttpFetch\n\n constructor({\n fetch,\n preloadedState,\n }: {\n fetch: HttpFetch\n preloadedState: Partial<ApiClientState>\n }) {\n super({\n store: configureClientStore({ preloadedState }),\n })\n\n this.fetch = fetch\n }\n\n async fetchSwatch(swatchId: string): Promise<Swatch | null> {\n return await this.store.dispatch(fetchAPIResource(APIResourceType.Swatch, swatchId, this.fetch))\n }\n\n async fetchFile(fileId: string): Promise<File | null> {\n return await this.store.dispatch(fetchAPIResource(APIResourceType.File, fileId, this.fetch))\n }\n\n async fetchTypography(typographyId: string): Promise<Typography | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.Typography, typographyId, this.fetch),\n )\n }\n\n async fetchGlobalElement(globalElementId: string): Promise<GlobalElement | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.GlobalElement, globalElementId, this.fetch),\n )\n }\n\n async fetchLocalizedGlobalElement({\n globalElementId,\n locale,\n }: {\n globalElementId: string\n locale: string\n }): Promise<LocalizedGlobalElement | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.LocalizedGlobalElement, globalElementId, this.fetch, locale),\n )\n }\n\n async fetchPagePathnameSlice({\n pageId,\n locale,\n }: {\n pageId: string\n locale: string | null\n }): Promise<PagePathnameSlice | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.PagePathnameSlice, pageId, this.fetch, locale),\n )\n }\n\n async fetchTable(tableId: string): Promise<Table | null> {\n return await this.store.dispatch(fetchAPIResource(APIResourceType.Table, tableId, this.fetch))\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gCAAiD;AACjD,0BAAqC;AAErC,mBASO;AAEP,kCAAmC;AAEnC,IAAAA,+BAA0B;AAqBnB,MAAM,+BAA+B,+CAAmB;AAAA,EACpD;AAAA,EAET,YAAY;AAAA,IACV;AAAA,IACA;AAAA,EACF,GAGG;AACD,UAAM;AAAA,MACJ,WAAO,0CAAqB,EAAE,eAAe,CAAC;AAAA,IAChD,CAAC;AAED,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,MAAM,YAAY,UAA0C;AAC1D,WAAO,MAAM,KAAK,MAAM,aAAS,4CAAiB,6BAAgB,QAAQ,UAAU,KAAK,KAAK,CAAC;AAAA,EACjG;AAAA,EAEA,MAAM,UAAU,QAAsC;AACpD,WAAO,MAAM,KAAK,MAAM,aAAS,4CAAiB,6BAAgB,MAAM,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC7F;AAAA,EAEA,MAAM,gBAAgB,cAAkD;AACtE,WAAO,MAAM,KAAK,MAAM;AAAA,UACtB,4CAAiB,6BAAgB,YAAY,cAAc,KAAK,KAAK;AAAA,IACvE;AAAA,EACF;AAAA,EAEA,MAAM,mBAAmB,iBAAwD;AAC/E,WAAO,MAAM,KAAK,MAAM;AAAA,UACtB,4CAAiB,6BAAgB,eAAe,iBAAiB,KAAK,KAAK;AAAA,IAC7E;AAAA,EACF;AAAA,EAEA,MAAM,4BAA4B;AAAA,IAChC;AAAA,IACA;AAAA,EACF,GAG2C;AACzC,WAAO,MAAM,KAAK,MAAM;AAAA,UACtB,4CAAiB,6BAAgB,wBAAwB,iBAAiB,KAAK,OAAO,MAAM;AAAA,IAC9F;AAAA,EACF;AAAA,EAEA,MAAM,uBAAuB;AAAA,IAC3B;AAAA,IACA;AAAA,EACF,GAGsC;AACpC,WAAO,MAAM,KAAK,MAAM;AAAA,UACtB,4CAAiB,6BAAgB,mBAAmB,QAAQ,KAAK,OAAO,MAAM;AAAA,IAChF;AAAA,EACF;AAAA,EAEA,MAAM,WAAW,SAAwC;AACvD,WAAO,MAAM,KAAK,MAAM,aAAS,4CAAiB,6BAAgB,OAAO,SAAS,KAAK,KAAK,CAAC;AAAA,EAC/F;AACF;","names":["import_api_resources_client"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/client.ts"],"sourcesContent":["import { type State as ApiClientState } from '../state/api-client/state'\nimport { type HttpFetch, fetchAPIResource } from '../state/api-client/fetch-api-resource'\nimport { configureClientStore } from '../state/api-client/client-store'\n\nimport {\n type File,\n type GlobalElement,\n type LocalizedGlobalElement,\n type PagePathnameSlice,\n type Swatch,\n type Table,\n type Typography,\n APIResourceType,\n} from './types'\n\nimport { ApiResourcesClient } from './api-resources-client'\n\nexport { CacheData } from './api-resources-client'\n\n/**\n * NOTE(miguel): This \"client\" is used to fetch Makeswift API resources needed for the host. For\n * example, swatches, files, typographies, etc. Ideally it's internal to the runtime and is only\n * used by controls to transform API references to API resources.\n *\n * Moreover, its use should be reserved for the builder only, since for live pages all Makeswift\n * API resources should be embedded in the \"page snapshot\". In the builder, this client serves the\n * purpose of sending requests for API resources and keeping a cache so that changes that happen in\n * the builder, like modifying a swatch, can be sent via `postMessage` to the host and the cache can\n * immediately update the value and re-render.\n *\n * Furthermore, the API resources requested shouldn't be requested directly from the Makeswift API\n * as that would require those resources to not be authenticated since the requests come from the\n * browser when running the host. Instead, the requests should go to the host directly, at the\n * Makeswift API endpoint (i.g., `/api/makeswift/[...makeswift]` dynamic route) where the host's\n * API key can be used, securely, in the server. For this reason, this client should really be a\n * client of the host's API, not Makeswift's, intended to build and continuously maintain a realtime\n * snapshot for use in the builder, not the lives pages.\n */\nexport class MakeswiftHostApiClient extends ApiResourcesClient {\n readonly fetch: HttpFetch\n\n constructor({\n fetch,\n preloadedState,\n }: {\n fetch: HttpFetch\n preloadedState: Partial<ApiClientState>\n }) {\n super({\n store: configureClientStore({ preloadedState }),\n })\n\n this.fetch = fetch\n }\n\n async fetchSwatch(swatchId: string): Promise<Swatch | null> {\n return await this.store.dispatch(fetchAPIResource(APIResourceType.Swatch, swatchId, this.fetch))\n }\n\n async fetchFile(fileId: string): Promise<File | null> {\n return await this.store.dispatch(fetchAPIResource(APIResourceType.File, fileId, this.fetch))\n }\n\n async fetchTypography(typographyId: string): Promise<Typography | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.Typography, typographyId, this.fetch),\n )\n }\n\n async fetchGlobalElement(globalElementId: string): Promise<GlobalElement | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.GlobalElement, globalElementId, this.fetch),\n )\n }\n\n async fetchLocalizedGlobalElement({\n globalElementId,\n locale,\n }: {\n globalElementId: string\n locale: string\n }): Promise<LocalizedGlobalElement | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.LocalizedGlobalElement, globalElementId, this.fetch, locale),\n )\n }\n\n async fetchPagePathnameSlice({\n pageId,\n locale,\n }: {\n pageId: string\n locale: string | null\n }): Promise<PagePathnameSlice | null> {\n return await this.store.dispatch(\n fetchAPIResource(APIResourceType.PagePathnameSlice, pageId, this.fetch, locale),\n )\n }\n\n async fetchTable(tableId: string): Promise<Table | null> {\n return await this.store.dispatch(fetchAPIResource(APIResourceType.Table, tableId, this.fetch))\n }\n}\n"],"mappings":"AACA,SAAyB,wBAAwB;AACjD,SAAS,4BAA4B;AAErC;AAAA,EAQE;AAAA,OACK;AAEP,SAAS,0BAA0B;AAEnC,SAAS,iBAAiB;AAqBnB,MAAM,+BAA+B,mBAAmB;AAAA,EACpD;AAAA,EAET,YAAY;AAAA,IACV;AAAA,IACA;AAAA,EACF,GAGG;AACD,UAAM;AAAA,MACJ,OAAO,qBAAqB,EAAE,eAAe,CAAC;AAAA,IAChD,CAAC;AAED,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,MAAM,YAAY,UAA0C;AAC1D,WAAO,MAAM,KAAK,MAAM,SAAS,iBAAiB,gBAAgB,QAAQ,UAAU,KAAK,KAAK,CAAC;AAAA,EACjG;AAAA,EAEA,MAAM,UAAU,QAAsC;AACpD,WAAO,MAAM,KAAK,MAAM,SAAS,iBAAiB,gBAAgB,MAAM,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC7F;AAAA,EAEA,MAAM,gBAAgB,cAAkD;AACtE,WAAO,MAAM,KAAK,MAAM;AAAA,MACtB,iBAAiB,gBAAgB,YAAY,cAAc,KAAK,KAAK;AAAA,IACvE;AAAA,EACF;AAAA,EAEA,MAAM,mBAAmB,iBAAwD;AAC/E,WAAO,MAAM,KAAK,MAAM;AAAA,MACtB,iBAAiB,gBAAgB,eAAe,iBAAiB,KAAK,KAAK;AAAA,IAC7E;AAAA,EACF;AAAA,EAEA,MAAM,4BAA4B;AAAA,IAChC;AAAA,IACA;AAAA,EACF,GAG2C;AACzC,WAAO,MAAM,KAAK,MAAM;AAAA,MACtB,iBAAiB,gBAAgB,wBAAwB,iBAAiB,KAAK,OAAO,MAAM;AAAA,IAC9F;AAAA,EACF;AAAA,EAEA,MAAM,uBAAuB;AAAA,IAC3B;AAAA,IACA;AAAA,EACF,GAGsC;AACpC,WAAO,MAAM,KAAK,MAAM;AAAA,MACtB,iBAAiB,gBAAgB,mBAAmB,QAAQ,KAAK,OAAO,MAAM;AAAA,IAChF;AAAA,EACF;AAAA,EAEA,MAAM,WAAW,SAAwC;AACvD,WAAO,MAAM,KAAK,MAAM,SAAS,iBAAiB,gBAAgB,OAAO,SAAS,KAAK,KAAK,CAAC;AAAA,EAC/F;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,wCAAwC,CAAA;AAGzF,OAAO,EACL,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,UAAU,EAEhB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;gBAEb,EACV,KAAK,EACL,cAAc,GACf,EAAE;QACD,KAAK,EAAE,SAAS,CAAA;QAChB,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;KACxC;IAQK,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIrD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAMjE,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAM1E,2BAA2B,CAAC,EAChC,eAAe,EACf,MAAM,GACP,EAAE;QACD,eAAe,EAAE,MAAM,CAAA;QACvB,MAAM,EAAE,MAAM,CAAA;KACf,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAMpC,sBAAsB,CAAC,EAC3B,MAAM,EACN,MAAM,GACP,EAAE;QACD,MAAM,EAAE,MAAM,CAAA;QACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KACtB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAM/B,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAGzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.error-handling.test.d.ts","sourceRoot":"","sources":["../../../../src/client/tests/client.error-handling.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.get-resources.test.d.ts","sourceRoot":"","sources":["../../../../src/client/tests/client.get-resources.test.ts"],"names":[],"mappings":""}
|