@kubuild/schema 0.8.1 → 0.8.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.
- package/dist/actions.d.cts +473 -0
- package/dist/actions.d.cts.map +1 -0
- package/dist/breakpoints.d.cts +35 -0
- package/dist/breakpoints.d.cts.map +1 -0
- package/dist/builtin-components.d.cts +17 -0
- package/dist/builtin-components.d.cts.map +1 -0
- package/dist/canonical-props.d.cts +39 -0
- package/dist/canonical-props.d.cts.map +1 -0
- package/dist/chunk-IXTL6BV4.js +1041 -0
- package/dist/chunk-IXTL6BV4.js.map +1 -0
- package/dist/document.d.cts +742 -0
- package/dist/document.d.cts.map +1 -0
- package/dist/document.d.ts +2 -2
- package/dist/document.d.ts.map +1 -1
- package/dist/fixtures.d.cts +3 -0
- package/dist/fixtures.d.cts.map +1 -0
- package/dist/fixtures.d.ts +1 -1
- package/dist/fixtures.d.ts.map +1 -1
- package/dist/form.d.cts +129 -0
- package/dist/form.d.cts.map +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/json-schema.d.cts +2066 -0
- package/dist/json-schema.d.cts.map +1 -0
- package/dist/manifest.d.cts +28 -0
- package/dist/manifest.d.cts.map +1 -0
- package/dist/template.d.cts +213 -0
- package/dist/template.d.cts.map +1 -0
- package/dist/template.d.ts +2 -2
- package/dist/template.d.ts.map +1 -1
- package/dist/theme.d.cts +80 -0
- package/dist/theme.d.cts.map +1 -0
- package/dist/tracking.d.cts +348 -0
- package/dist/tracking.d.cts.map +1 -0
- package/dist/types.d.cts +331 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/validate.cjs.map +1 -1
- package/dist/validate.d.cts +16 -0
- package/dist/validate.d.cts.map +1 -0
- package/dist/validate.d.ts +2 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +1 -1
- package/dist/validate.js.map +1 -1
- package/package.json +26 -11
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Supported Tracking Providers
|
|
4
|
+
*/
|
|
5
|
+
export declare const TrackingProviderTypeSchema: z.ZodEnum<{
|
|
6
|
+
custom: "custom";
|
|
7
|
+
meta: "meta";
|
|
8
|
+
google: "google";
|
|
9
|
+
gtm: "gtm";
|
|
10
|
+
tiktok: "tiktok";
|
|
11
|
+
}>;
|
|
12
|
+
export type TrackingProviderType = z.infer<typeof TrackingProviderTypeSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Metadata-only descriptor of a tracking credential saved by the host (account/workspace).
|
|
15
|
+
*
|
|
16
|
+
* This is what the editor receives to render a credential picker. It NEVER carries secret
|
|
17
|
+
* material (access tokens, API secrets, webhook URLs/headers) — those stay on the host and
|
|
18
|
+
* are resolved server-side from `id` (see `TrackingSecretResolver` in `@kubuild/core`).
|
|
19
|
+
*/
|
|
20
|
+
export interface PixelCredentialOption {
|
|
21
|
+
/** Opaque host id, stored in the document as `providers.<provider>.credentialId`. */
|
|
22
|
+
id: string;
|
|
23
|
+
/** Human-readable label shown in the picker. */
|
|
24
|
+
name: string;
|
|
25
|
+
provider: TrackingProviderType | (string & {});
|
|
26
|
+
/** Public Meta / TikTok pixel id, if the credential has one. */
|
|
27
|
+
pixelId?: string;
|
|
28
|
+
/** Public GA4 measurement id, if the credential has one. */
|
|
29
|
+
measurementId?: string;
|
|
30
|
+
/** Public GTM container id, if the credential has one. */
|
|
31
|
+
containerId?: string;
|
|
32
|
+
/** True when the host holds a server-side secret for this credential. */
|
|
33
|
+
hasSecret?: boolean;
|
|
34
|
+
isActive?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Event Delivery Channels:
|
|
38
|
+
* - 'both': Fires client browser pixel and dispatches to the server relay (with deduplication event_id)
|
|
39
|
+
* - 'client_only': Only fires in the browser via client-side pixel scripts
|
|
40
|
+
* - 'server_only': Only sends to the host server relay (no browser pixel call)
|
|
41
|
+
*/
|
|
42
|
+
export declare const TrackingDeliverySchema: z.ZodEnum<{
|
|
43
|
+
both: "both";
|
|
44
|
+
client_only: "client_only";
|
|
45
|
+
server_only: "server_only";
|
|
46
|
+
}>;
|
|
47
|
+
export type TrackingDelivery = z.infer<typeof TrackingDeliverySchema>;
|
|
48
|
+
/**
|
|
49
|
+
* Meta (Facebook) Pixel & Conversions API (CAPI) Configuration
|
|
50
|
+
*/
|
|
51
|
+
export declare const MetaTrackingProviderConfigSchema: z.ZodObject<{
|
|
52
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
55
|
+
capiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
56
|
+
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type MetaTrackingProviderConfig = z.infer<typeof MetaTrackingProviderConfigSchema>;
|
|
59
|
+
/**
|
|
60
|
+
* Google Analytics 4 (GA4) & Measurement Protocol Configuration
|
|
61
|
+
*/
|
|
62
|
+
export declare const GoogleTrackingProviderConfigSchema: z.ZodObject<{
|
|
63
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
measurementId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type GoogleTrackingProviderConfig = z.infer<typeof GoogleTrackingProviderConfigSchema>;
|
|
68
|
+
/**
|
|
69
|
+
* Google Tag Manager (GTM) Configuration.
|
|
70
|
+
* Client-side only: `track_event` with provider 'gtm' (or 'all') pushes to `window.dataLayer`.
|
|
71
|
+
*/
|
|
72
|
+
export declare const GtmTrackingProviderConfigSchema: z.ZodObject<{
|
|
73
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
74
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
75
|
+
containerId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
export type GtmTrackingProviderConfig = z.infer<typeof GtmTrackingProviderConfigSchema>;
|
|
78
|
+
/**
|
|
79
|
+
* TikTok Pixel & Events API Configuration
|
|
80
|
+
*/
|
|
81
|
+
export declare const TikTokTrackingProviderConfigSchema: z.ZodObject<{
|
|
82
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
83
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
84
|
+
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
85
|
+
eventsApiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
86
|
+
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type TikTokTrackingProviderConfig = z.infer<typeof TikTokTrackingProviderConfigSchema>;
|
|
89
|
+
/**
|
|
90
|
+
* Custom Webhook Configuration.
|
|
91
|
+
* The destination URL and any auth headers are host secrets resolved from `credentialId`.
|
|
92
|
+
*/
|
|
93
|
+
export declare const CustomTrackingProviderConfigSchema: z.ZodObject<{
|
|
94
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
95
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type CustomTrackingProviderConfig = z.infer<typeof CustomTrackingProviderConfigSchema>;
|
|
98
|
+
/**
|
|
99
|
+
* Provider keys that `<= 1.0.0` documents stored but that are now host-owned
|
|
100
|
+
* (secrets and server destinations). Used by migration and by import/export
|
|
101
|
+
* sanitization to strip them defensively.
|
|
102
|
+
*/
|
|
103
|
+
export declare const LEGACY_TRACKING_SECRET_KEYS: Readonly<Record<TrackingProviderType, readonly string[]>>;
|
|
104
|
+
/**
|
|
105
|
+
* Global Tracking Configuration Schema
|
|
106
|
+
* Attached to Document / Project. Contains no secrets.
|
|
107
|
+
*/
|
|
108
|
+
export declare const TrackingConfigSchema: z.ZodObject<{
|
|
109
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
110
|
+
debugMode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
111
|
+
autoPageView: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
112
|
+
defaultDelivery: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
113
|
+
both: "both";
|
|
114
|
+
client_only: "client_only";
|
|
115
|
+
server_only: "server_only";
|
|
116
|
+
}>>>;
|
|
117
|
+
providers: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
118
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
120
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
121
|
+
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
122
|
+
capiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
123
|
+
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
google: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
127
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
128
|
+
measurementId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
gtm: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
132
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
133
|
+
containerId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
tiktok: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
137
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
138
|
+
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
139
|
+
eventsApiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
140
|
+
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
custom: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
144
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
}, z.core.$strip>>>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
export type TrackingConfig = z.infer<typeof TrackingConfigSchema>;
|
|
149
|
+
/** Meta Conversions API secret material. */
|
|
150
|
+
export declare const MetaTrackingSecretsSchema: z.ZodObject<{
|
|
151
|
+
capiAccessToken: z.ZodString;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
export type MetaTrackingSecrets = z.infer<typeof MetaTrackingSecretsSchema>;
|
|
154
|
+
/** GA4 Measurement Protocol secret material. */
|
|
155
|
+
export declare const GoogleTrackingSecretsSchema: z.ZodObject<{
|
|
156
|
+
measurementProtocolSecret: z.ZodString;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
export type GoogleTrackingSecrets = z.infer<typeof GoogleTrackingSecretsSchema>;
|
|
159
|
+
/** TikTok Events API secret material. */
|
|
160
|
+
export declare const TikTokTrackingSecretsSchema: z.ZodObject<{
|
|
161
|
+
accessToken: z.ZodString;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export type TikTokTrackingSecrets = z.infer<typeof TikTokTrackingSecretsSchema>;
|
|
164
|
+
/** Custom webhook destination + auth headers (both are host secrets). */
|
|
165
|
+
export declare const CustomTrackingSecretsSchema: z.ZodObject<{
|
|
166
|
+
endpointUrl: z.ZodString;
|
|
167
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
export type CustomTrackingSecrets = z.infer<typeof CustomTrackingSecretsSchema>;
|
|
170
|
+
/** Secret material keyed by provider. GTM is client-only and has no secret. */
|
|
171
|
+
export interface TrackingProviderSecretsMap {
|
|
172
|
+
meta: MetaTrackingSecrets;
|
|
173
|
+
google: GoogleTrackingSecrets;
|
|
174
|
+
tiktok: TikTokTrackingSecrets;
|
|
175
|
+
custom: CustomTrackingSecrets;
|
|
176
|
+
}
|
|
177
|
+
/** Providers that support server-side delivery (and therefore have secrets). */
|
|
178
|
+
export type ServerTrackingProviderType = keyof TrackingProviderSecretsMap;
|
|
179
|
+
/** Secret material for a single provider, as returned by a host secret resolver. */
|
|
180
|
+
export type TrackingProviderSecrets = TrackingProviderSecretsMap[ServerTrackingProviderType];
|
|
181
|
+
/**
|
|
182
|
+
* Standard Event Names commonly used across Meta, Google, and TikTok.
|
|
183
|
+
*/
|
|
184
|
+
export declare const StandardTrackingEventSchema: z.ZodEnum<{
|
|
185
|
+
PageView: "PageView";
|
|
186
|
+
ViewContent: "ViewContent";
|
|
187
|
+
AddToCart: "AddToCart";
|
|
188
|
+
InitiateCheckout: "InitiateCheckout";
|
|
189
|
+
Purchase: "Purchase";
|
|
190
|
+
Lead: "Lead";
|
|
191
|
+
Contact: "Contact";
|
|
192
|
+
CompleteRegistration: "CompleteRegistration";
|
|
193
|
+
Subscribe: "Subscribe";
|
|
194
|
+
Search: "Search";
|
|
195
|
+
SubmitApplication: "SubmitApplication";
|
|
196
|
+
Schedule: "Schedule";
|
|
197
|
+
}>;
|
|
198
|
+
export type StandardTrackingEvent = z.infer<typeof StandardTrackingEventSchema>;
|
|
199
|
+
/**
|
|
200
|
+
* Target provider of a `track_event` step. 'gtm' pushes to `window.dataLayer` (client only).
|
|
201
|
+
*/
|
|
202
|
+
export declare const TrackEventProviderSchema: z.ZodEnum<{
|
|
203
|
+
all: "all";
|
|
204
|
+
custom: "custom";
|
|
205
|
+
meta: "meta";
|
|
206
|
+
google: "google";
|
|
207
|
+
gtm: "gtm";
|
|
208
|
+
tiktok: "tiktok";
|
|
209
|
+
}>;
|
|
210
|
+
export type TrackEventProvider = z.infer<typeof TrackEventProviderSchema>;
|
|
211
|
+
/**
|
|
212
|
+
* Track Event Step Payload Schema (for Action Pipelines)
|
|
213
|
+
*/
|
|
214
|
+
export declare const TrackEventStepPayloadSchema: z.ZodObject<{
|
|
215
|
+
eventName: z.ZodString;
|
|
216
|
+
eventType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
217
|
+
standard: "standard";
|
|
218
|
+
custom: "custom";
|
|
219
|
+
}>>>;
|
|
220
|
+
provider: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
221
|
+
all: "all";
|
|
222
|
+
custom: "custom";
|
|
223
|
+
meta: "meta";
|
|
224
|
+
google: "google";
|
|
225
|
+
gtm: "gtm";
|
|
226
|
+
tiktok: "tiktok";
|
|
227
|
+
}>>>;
|
|
228
|
+
delivery: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
229
|
+
both: "both";
|
|
230
|
+
client_only: "client_only";
|
|
231
|
+
server_only: "server_only";
|
|
232
|
+
}>>>;
|
|
233
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
234
|
+
params: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
235
|
+
userData: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
236
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
237
|
+
}, z.core.$strip>;
|
|
238
|
+
export type TrackEventStepPayload = z.infer<typeof TrackEventStepPayloadSchema>;
|
|
239
|
+
export declare const TRACKING_RELAY_PROTOCOL_VERSION: 1;
|
|
240
|
+
/** Normalized server tracking event, as sent from the browser to the host relay. */
|
|
241
|
+
export declare const ServerTrackingEventSchema: z.ZodObject<{
|
|
242
|
+
eventName: z.ZodString;
|
|
243
|
+
eventType: z.ZodOptional<z.ZodEnum<{
|
|
244
|
+
standard: "standard";
|
|
245
|
+
custom: "custom";
|
|
246
|
+
}>>;
|
|
247
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
248
|
+
eventTime: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
eventSourceUrl: z.ZodOptional<z.ZodString>;
|
|
250
|
+
actionSource: z.ZodOptional<z.ZodEnum<{
|
|
251
|
+
website: "website";
|
|
252
|
+
app: "app";
|
|
253
|
+
system_generated: "system_generated";
|
|
254
|
+
}>>;
|
|
255
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
256
|
+
userData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
257
|
+
customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
export type ServerTrackingEventInput = z.infer<typeof ServerTrackingEventSchema>;
|
|
260
|
+
/**
|
|
261
|
+
* Body the renderer POSTs to the host relay (`RenderContext.tracking.relayUrl`).
|
|
262
|
+
* The relay MUST load the tracking config itself (trusted) — never from this body.
|
|
263
|
+
*/
|
|
264
|
+
export declare const TrackingRelayRequestSchema: z.ZodObject<{
|
|
265
|
+
version: z.ZodLiteral<1>;
|
|
266
|
+
event: z.ZodObject<{
|
|
267
|
+
eventName: z.ZodString;
|
|
268
|
+
eventType: z.ZodOptional<z.ZodEnum<{
|
|
269
|
+
standard: "standard";
|
|
270
|
+
custom: "custom";
|
|
271
|
+
}>>;
|
|
272
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
273
|
+
eventTime: z.ZodOptional<z.ZodNumber>;
|
|
274
|
+
eventSourceUrl: z.ZodOptional<z.ZodString>;
|
|
275
|
+
actionSource: z.ZodOptional<z.ZodEnum<{
|
|
276
|
+
website: "website";
|
|
277
|
+
app: "app";
|
|
278
|
+
system_generated: "system_generated";
|
|
279
|
+
}>>;
|
|
280
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
281
|
+
userData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
282
|
+
customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
provider: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
285
|
+
all: "all";
|
|
286
|
+
custom: "custom";
|
|
287
|
+
meta: "meta";
|
|
288
|
+
google: "google";
|
|
289
|
+
gtm: "gtm";
|
|
290
|
+
tiktok: "tiktok";
|
|
291
|
+
}>>>;
|
|
292
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
293
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
export type TrackingRelayRequest = z.infer<typeof TrackingRelayRequestSchema>;
|
|
296
|
+
/** Per-provider outcome returned by the relay (provider response bodies are not echoed). */
|
|
297
|
+
export declare const TrackingRelayProviderResultSchema: z.ZodObject<{
|
|
298
|
+
provider: z.ZodString;
|
|
299
|
+
success: z.ZodBoolean;
|
|
300
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
301
|
+
skipped: z.ZodOptional<z.ZodBoolean>;
|
|
302
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
303
|
+
error: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
export type TrackingRelayProviderResult = z.infer<typeof TrackingRelayProviderResultSchema>;
|
|
306
|
+
export declare const TrackingRelayErrorCodeSchema: z.ZodEnum<{
|
|
307
|
+
INVALID_REQUEST: "INVALID_REQUEST";
|
|
308
|
+
UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
|
|
309
|
+
FORBIDDEN_ORIGIN: "FORBIDDEN_ORIGIN";
|
|
310
|
+
METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
|
|
311
|
+
CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND";
|
|
312
|
+
INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
313
|
+
}>;
|
|
314
|
+
export type TrackingRelayErrorCode = z.infer<typeof TrackingRelayErrorCodeSchema>;
|
|
315
|
+
export declare const TrackingRelayResponseSchema: z.ZodObject<{
|
|
316
|
+
version: z.ZodLiteral<1>;
|
|
317
|
+
success: z.ZodBoolean;
|
|
318
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
319
|
+
skipped: z.ZodOptional<z.ZodBoolean>;
|
|
320
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
321
|
+
results: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
322
|
+
provider: z.ZodString;
|
|
323
|
+
success: z.ZodBoolean;
|
|
324
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
skipped: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
327
|
+
error: z.ZodOptional<z.ZodString>;
|
|
328
|
+
}, z.core.$strip>>>;
|
|
329
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
330
|
+
code: z.ZodEnum<{
|
|
331
|
+
INVALID_REQUEST: "INVALID_REQUEST";
|
|
332
|
+
UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
|
|
333
|
+
FORBIDDEN_ORIGIN: "FORBIDDEN_ORIGIN";
|
|
334
|
+
METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
|
|
335
|
+
CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND";
|
|
336
|
+
INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
337
|
+
}>;
|
|
338
|
+
message: z.ZodString;
|
|
339
|
+
}, z.core.$strip>>;
|
|
340
|
+
}, z.core.$strip>;
|
|
341
|
+
export type TrackingRelayResponse = z.infer<typeof TrackingRelayResponseSchema>;
|
|
342
|
+
/**
|
|
343
|
+
* Type guards
|
|
344
|
+
*/
|
|
345
|
+
export declare function isTrackingConfig(value: unknown): value is TrackingConfig;
|
|
346
|
+
export declare function isTrackEventStepPayload(value: unknown): value is TrackEventStepPayload;
|
|
347
|
+
export declare function isTrackingRelayRequest(value: unknown): value is TrackingRelayRequest;
|
|
348
|
+
//# sourceMappingURL=tracking.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.d.cts","sourceRoot":"","sources":["../src/tracking.ts"],"names":[],"mappings":"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"}
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@kubuild/schema/types` — pure TypeScript interfaces for the portable document format
|
|
3
|
+
* (STORA-552).
|
|
4
|
+
*
|
|
5
|
+
* This module MUST NOT import zod (or any module that does). Its emitted `.d.ts` is what
|
|
6
|
+
* hosts on a different zod major (e.g. a zod v3 backend) import to type `PageDocument`,
|
|
7
|
+
* `Node`, etc. without pulling zod v4's core namespace into their compilation.
|
|
8
|
+
*
|
|
9
|
+
* Every type here mirrors the *parsed output* (`z.infer<...>`) of the matching schema in
|
|
10
|
+
* the main entry, i.e. fields with a schema default are required. The equality is
|
|
11
|
+
* enforced by `tests/types.test.ts` (`expectTypeOf(...).toEqualTypeOf(...)`), so a schema
|
|
12
|
+
* change that is not reflected here fails `pnpm run typecheck`.
|
|
13
|
+
*/
|
|
14
|
+
export interface AssetReference {
|
|
15
|
+
type: 'asset';
|
|
16
|
+
assetId: string;
|
|
17
|
+
filename?: string;
|
|
18
|
+
mimeType?: string;
|
|
19
|
+
fallbackUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface VariableBinding {
|
|
22
|
+
type: 'variable';
|
|
23
|
+
key: string;
|
|
24
|
+
fallback?: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface ActionBinding {
|
|
27
|
+
type: string;
|
|
28
|
+
payload?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export type StyleValue = string | number | boolean | null | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Standard CSS style definition supporting Flexbox, sizing constraints, effects,
|
|
33
|
+
* CSS Grid, and arbitrary CSS properties / design-token references.
|
|
34
|
+
*/
|
|
35
|
+
export interface StyleDefinition extends Record<string, StyleValue> {
|
|
36
|
+
display?: string;
|
|
37
|
+
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse' | (string & {});
|
|
38
|
+
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse' | (string & {});
|
|
39
|
+
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'start' | 'end' | 'left' | 'right' | (string & {});
|
|
40
|
+
alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'start' | 'end' | 'self-start' | 'self-end' | (string & {});
|
|
41
|
+
alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'start' | 'end' | (string & {});
|
|
42
|
+
gap?: string | number;
|
|
43
|
+
rowGap?: string | number;
|
|
44
|
+
columnGap?: string | number;
|
|
45
|
+
flexGrow?: number | string;
|
|
46
|
+
flexShrink?: number | string;
|
|
47
|
+
flexBasis?: string | number;
|
|
48
|
+
alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch' | (string & {});
|
|
49
|
+
width?: string | number;
|
|
50
|
+
height?: string | number;
|
|
51
|
+
minWidth?: string | number;
|
|
52
|
+
maxWidth?: string | number;
|
|
53
|
+
minHeight?: string | number;
|
|
54
|
+
maxHeight?: string | number;
|
|
55
|
+
objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down' | (string & {});
|
|
56
|
+
objectPosition?: string;
|
|
57
|
+
borderRadius?: string | number;
|
|
58
|
+
borderTopLeftRadius?: string | number;
|
|
59
|
+
borderTopRightRadius?: string | number;
|
|
60
|
+
borderBottomRightRadius?: string | number;
|
|
61
|
+
borderBottomLeftRadius?: string | number;
|
|
62
|
+
backdropFilter?: string;
|
|
63
|
+
filter?: string;
|
|
64
|
+
boxShadow?: string;
|
|
65
|
+
backgroundColor?: string;
|
|
66
|
+
backgroundImage?: string;
|
|
67
|
+
backgroundSize?: 'cover' | 'contain' | 'auto' | (string & {});
|
|
68
|
+
backgroundPosition?: string;
|
|
69
|
+
backgroundRepeat?: 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y' | (string & {});
|
|
70
|
+
backgroundAttachment?: 'scroll' | 'fixed' | 'local' | (string & {});
|
|
71
|
+
gridTemplateColumns?: string;
|
|
72
|
+
gridTemplateRows?: string;
|
|
73
|
+
gridAutoFlow?: string;
|
|
74
|
+
gridAutoColumns?: string;
|
|
75
|
+
gridAutoRows?: string;
|
|
76
|
+
gridColumn?: string | number;
|
|
77
|
+
gridRow?: string | number;
|
|
78
|
+
gridColumnStart?: string | number;
|
|
79
|
+
gridColumnEnd?: string | number;
|
|
80
|
+
gridRowStart?: string | number;
|
|
81
|
+
gridRowEnd?: string | number;
|
|
82
|
+
colSpan?: number | string;
|
|
83
|
+
rowSpan?: number | string;
|
|
84
|
+
justifySelf?: string;
|
|
85
|
+
}
|
|
86
|
+
export type PseudoStateStyles = Record<string, StyleDefinition>;
|
|
87
|
+
/** Breakpoint style layers (`base` applies to every viewport) plus pseudo-state layers. */
|
|
88
|
+
export interface ResponsiveStyles {
|
|
89
|
+
[key: string]: unknown;
|
|
90
|
+
base?: StyleDefinition;
|
|
91
|
+
desktop?: StyleDefinition;
|
|
92
|
+
tablet?: StyleDefinition;
|
|
93
|
+
mobile?: StyleDefinition;
|
|
94
|
+
states?: Record<string, StyleDefinition>;
|
|
95
|
+
}
|
|
96
|
+
export interface AnimationConfig {
|
|
97
|
+
type: string;
|
|
98
|
+
duration: number;
|
|
99
|
+
delay: number;
|
|
100
|
+
easing: string;
|
|
101
|
+
once: boolean;
|
|
102
|
+
hoverEffect: string;
|
|
103
|
+
loopEffect: string;
|
|
104
|
+
}
|
|
105
|
+
export type ThemeTokenValue = string | number;
|
|
106
|
+
/** Design tokens; referenced from styles as `var(--kb-color-<key>)` etc. */
|
|
107
|
+
export interface Theme {
|
|
108
|
+
colors?: Record<string, ThemeTokenValue>;
|
|
109
|
+
fonts?: Record<string, ThemeTokenValue>;
|
|
110
|
+
radii?: Record<string, ThemeTokenValue>;
|
|
111
|
+
spacing?: Record<string, ThemeTokenValue>;
|
|
112
|
+
}
|
|
113
|
+
export type ValidationRuleType = 'required' | 'email' | 'url' | 'min_length' | 'max_length' | 'numeric_min' | 'numeric_max' | 'pattern' | 'match_field' | 'custom_regex';
|
|
114
|
+
export type ValidateOnEvent = 'blur' | 'change' | 'submit';
|
|
115
|
+
export interface ValidationRule {
|
|
116
|
+
type: ValidationRuleType;
|
|
117
|
+
value?: unknown;
|
|
118
|
+
message: string;
|
|
119
|
+
}
|
|
120
|
+
export interface FormFieldBinding {
|
|
121
|
+
name: string;
|
|
122
|
+
label?: string;
|
|
123
|
+
defaultValue?: unknown;
|
|
124
|
+
rules: ValidationRule[];
|
|
125
|
+
validateOn: ValidateOnEvent;
|
|
126
|
+
transform?: 'trim' | 'lowercase' | 'uppercase' | 'number';
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
required?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface FormConfig {
|
|
131
|
+
formId: string;
|
|
132
|
+
resetOnSubmit: boolean;
|
|
133
|
+
scrollToFirstError: boolean;
|
|
134
|
+
validateOn: ValidateOnEvent;
|
|
135
|
+
initialValues?: Record<string, unknown>;
|
|
136
|
+
rules?: ValidationRule[];
|
|
137
|
+
}
|
|
138
|
+
export type ActionTriggerType = 'click' | 'submit' | 'change' | 'blur' | 'focus' | 'load' | 'expire';
|
|
139
|
+
export type ActionStepType = 'api_request' | 'navigate' | 'set_state' | 'reset_form' | 'show_toast' | 'open_modal' | 'close_modal' | 'toggle_modal' | 'copy_clipboard' | 'custom_event' | 'track_event';
|
|
140
|
+
export type ConditionOperator = 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'is_truthy' | 'is_falsy' | 'gt' | 'gte' | 'lt' | 'lte' | 'regex';
|
|
141
|
+
export interface ActionStepCondition {
|
|
142
|
+
field: string;
|
|
143
|
+
operator: ConditionOperator;
|
|
144
|
+
value?: unknown;
|
|
145
|
+
}
|
|
146
|
+
export interface ActionStep {
|
|
147
|
+
id: string;
|
|
148
|
+
type: ActionStepType;
|
|
149
|
+
label?: string;
|
|
150
|
+
payload?: Record<string, unknown>;
|
|
151
|
+
condition?: ActionStepCondition;
|
|
152
|
+
timeout?: number;
|
|
153
|
+
continueOnError?: boolean;
|
|
154
|
+
onSuccess?: ActionStep[];
|
|
155
|
+
onError?: ActionStep[];
|
|
156
|
+
}
|
|
157
|
+
export interface ActionPipeline {
|
|
158
|
+
id: string;
|
|
159
|
+
trigger: ActionTriggerType;
|
|
160
|
+
label?: string;
|
|
161
|
+
debounceMs?: number;
|
|
162
|
+
preventDuplicate?: boolean;
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
steps: ActionStep[];
|
|
165
|
+
}
|
|
166
|
+
export type TrackingProviderType = 'meta' | 'google' | 'gtm' | 'tiktok' | 'custom';
|
|
167
|
+
export type TrackingDelivery = 'both' | 'client_only' | 'server_only';
|
|
168
|
+
export interface MetaTrackingProviderConfig {
|
|
169
|
+
enabled: boolean;
|
|
170
|
+
credentialId?: string;
|
|
171
|
+
pixelId: string;
|
|
172
|
+
capiEnabled: boolean;
|
|
173
|
+
testEventCode: string;
|
|
174
|
+
}
|
|
175
|
+
export interface GoogleTrackingProviderConfig {
|
|
176
|
+
enabled: boolean;
|
|
177
|
+
credentialId?: string;
|
|
178
|
+
measurementId: string;
|
|
179
|
+
}
|
|
180
|
+
export interface GtmTrackingProviderConfig {
|
|
181
|
+
enabled: boolean;
|
|
182
|
+
credentialId?: string;
|
|
183
|
+
containerId: string;
|
|
184
|
+
}
|
|
185
|
+
export interface TikTokTrackingProviderConfig {
|
|
186
|
+
enabled: boolean;
|
|
187
|
+
credentialId?: string;
|
|
188
|
+
pixelId: string;
|
|
189
|
+
eventsApiEnabled: boolean;
|
|
190
|
+
testEventCode: string;
|
|
191
|
+
}
|
|
192
|
+
export interface CustomTrackingProviderConfig {
|
|
193
|
+
enabled: boolean;
|
|
194
|
+
credentialId?: string;
|
|
195
|
+
}
|
|
196
|
+
export interface TrackingConfig {
|
|
197
|
+
enabled: boolean;
|
|
198
|
+
debugMode: boolean;
|
|
199
|
+
autoPageView: boolean;
|
|
200
|
+
defaultDelivery: TrackingDelivery;
|
|
201
|
+
providers: {
|
|
202
|
+
meta?: MetaTrackingProviderConfig;
|
|
203
|
+
google?: GoogleTrackingProviderConfig;
|
|
204
|
+
gtm?: GtmTrackingProviderConfig;
|
|
205
|
+
tiktok?: TikTokTrackingProviderConfig;
|
|
206
|
+
custom?: CustomTrackingProviderConfig;
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export interface Node {
|
|
210
|
+
id: string;
|
|
211
|
+
type: string;
|
|
212
|
+
props?: Record<string, unknown>;
|
|
213
|
+
styles?: ResponsiveStyles;
|
|
214
|
+
animation?: AnimationConfig;
|
|
215
|
+
actions?: ActionPipeline[];
|
|
216
|
+
formConfig?: FormConfig;
|
|
217
|
+
children?: Node[];
|
|
218
|
+
}
|
|
219
|
+
export type RootPageNode = Node & {
|
|
220
|
+
type: 'page';
|
|
221
|
+
};
|
|
222
|
+
export interface DocumentMetadata {
|
|
223
|
+
title: string;
|
|
224
|
+
description: string;
|
|
225
|
+
author: string;
|
|
226
|
+
createdAt?: string;
|
|
227
|
+
updatedAt?: string;
|
|
228
|
+
tags: string[];
|
|
229
|
+
category: string;
|
|
230
|
+
version: string;
|
|
231
|
+
custom?: Record<string, unknown>;
|
|
232
|
+
tracking?: TrackingConfig;
|
|
233
|
+
}
|
|
234
|
+
export interface PageDocument {
|
|
235
|
+
schema: 'stora.page';
|
|
236
|
+
version: string;
|
|
237
|
+
metadata?: DocumentMetadata;
|
|
238
|
+
tracking?: TrackingConfig;
|
|
239
|
+
theme?: Theme;
|
|
240
|
+
document: RootPageNode;
|
|
241
|
+
}
|
|
242
|
+
export type ArtboardType = 'page' | 'component';
|
|
243
|
+
export interface Artboard {
|
|
244
|
+
id: string;
|
|
245
|
+
name: string;
|
|
246
|
+
artboardType: ArtboardType;
|
|
247
|
+
slug?: string;
|
|
248
|
+
triggerId?: string;
|
|
249
|
+
viewport?: 'desktop' | 'tablet' | 'mobile';
|
|
250
|
+
width?: number;
|
|
251
|
+
position?: {
|
|
252
|
+
x: number;
|
|
253
|
+
y: number;
|
|
254
|
+
};
|
|
255
|
+
document: PageDocument;
|
|
256
|
+
}
|
|
257
|
+
export interface ProjectDocument {
|
|
258
|
+
schema: 'stora.project';
|
|
259
|
+
version: string;
|
|
260
|
+
metadata?: DocumentMetadata;
|
|
261
|
+
tracking?: TrackingConfig;
|
|
262
|
+
artboards: Artboard[];
|
|
263
|
+
activeArtboardId?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface ManifestAssetItem {
|
|
266
|
+
id: string;
|
|
267
|
+
path: string;
|
|
268
|
+
mimeType: string;
|
|
269
|
+
size: number;
|
|
270
|
+
checksum?: string;
|
|
271
|
+
}
|
|
272
|
+
export interface Manifest {
|
|
273
|
+
schema: 'stora.page';
|
|
274
|
+
schemaVersion: string;
|
|
275
|
+
packageVersion: string;
|
|
276
|
+
builderCompatibility: string;
|
|
277
|
+
requiredComponents: string[];
|
|
278
|
+
requiredCapabilities: string[];
|
|
279
|
+
assets: ManifestAssetItem[];
|
|
280
|
+
createdAt?: string;
|
|
281
|
+
}
|
|
282
|
+
export interface SafeThumbnailObject {
|
|
283
|
+
url: string;
|
|
284
|
+
alt?: string;
|
|
285
|
+
width?: number;
|
|
286
|
+
height?: number;
|
|
287
|
+
}
|
|
288
|
+
export type SafeThumbnail = AssetReference | SafeThumbnailObject | string;
|
|
289
|
+
export interface TemplatePackageRef {
|
|
290
|
+
path?: string;
|
|
291
|
+
url?: string;
|
|
292
|
+
checksum?: string;
|
|
293
|
+
format: 'stora' | 'json';
|
|
294
|
+
}
|
|
295
|
+
export interface TemplateRequirements {
|
|
296
|
+
requiredComponents: string[];
|
|
297
|
+
requiredCapabilities: string[];
|
|
298
|
+
}
|
|
299
|
+
export interface TemplateRecord {
|
|
300
|
+
id: string;
|
|
301
|
+
name: string;
|
|
302
|
+
description: string;
|
|
303
|
+
category: string;
|
|
304
|
+
tags: string[];
|
|
305
|
+
thumbnail?: SafeThumbnail;
|
|
306
|
+
author: string;
|
|
307
|
+
version: string;
|
|
308
|
+
document?: PageDocument;
|
|
309
|
+
packageReference?: TemplatePackageRef;
|
|
310
|
+
requirements: TemplateRequirements;
|
|
311
|
+
createdAt?: string;
|
|
312
|
+
updatedAt?: string;
|
|
313
|
+
custom?: Record<string, unknown>;
|
|
314
|
+
}
|
|
315
|
+
export interface SchemaValidationIssue {
|
|
316
|
+
/** Dotted path to the offending value, e.g. `document.children.0.id` (empty for root). */
|
|
317
|
+
path: string;
|
|
318
|
+
message: string;
|
|
319
|
+
/** Validator issue code (e.g. `invalid_type`, `custom`). */
|
|
320
|
+
code: string;
|
|
321
|
+
}
|
|
322
|
+
export type SchemaValidationResult<T> = {
|
|
323
|
+
success: true;
|
|
324
|
+
data: T;
|
|
325
|
+
issues: [];
|
|
326
|
+
} | {
|
|
327
|
+
success: false;
|
|
328
|
+
data?: undefined;
|
|
329
|
+
issues: SchemaValidationIssue[];
|
|
330
|
+
};
|
|
331
|
+
//# sourceMappingURL=types.d.cts.map
|