@gradial/aci 0.1.23 → 0.1.25

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 (50) hide show
  1. package/README.md +4 -4
  2. package/bin/aci-darwin-arm64 +0 -0
  3. package/dist/audience-data-models.d.ts +406 -0
  4. package/dist/audience-data-models.js +105 -0
  5. package/dist/block-ref.d.ts +2 -2
  6. package/dist/content/assets.js +1 -1
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +6 -0
  9. package/dist/next/asset-route.d.ts +0 -1
  10. package/dist/next/asset-route.js +5 -6
  11. package/dist/next/config.js +53 -3
  12. package/dist/next/content-watch.js +1 -1
  13. package/dist/next/middleware.d.ts +2 -2
  14. package/dist/next/middleware.js +47 -26
  15. package/dist/next/page.d.ts +6 -0
  16. package/dist/next/page.js +34 -4
  17. package/dist/next/preview-mode.js +6 -7
  18. package/dist/next/server.js +4 -20
  19. package/dist/preview/core.d.ts +0 -2
  20. package/dist/preview/core.js +1 -3
  21. package/dist/react/Media.d.ts +1 -1
  22. package/dist/react/Media.js +1 -1
  23. package/dist/react/VideoPlayer.d.ts +307 -6
  24. package/dist/react/VideoPlayer.js +19 -5
  25. package/dist/react/index.d.ts +3 -3
  26. package/dist/types/image.d.ts +2 -2
  27. package/dist/types/media.d.ts +3 -0
  28. package/dist/types/video.d.ts +14 -8
  29. package/dist/types/video.js +3 -0
  30. package/package.json +2 -8
  31. package/src/cli/compile-registry.mjs +68 -43
  32. package/src/cli/verify-next-cdn-routes.mjs +101 -0
  33. package/src/types/component.ts +55 -0
  34. package/src/types/config.ts +37 -0
  35. package/src/types/data.ts +47 -0
  36. package/src/types/image.ts +4 -3
  37. package/src/types/index.ts +11 -0
  38. package/src/types/layout.ts +29 -0
  39. package/src/types/link.ts +100 -0
  40. package/src/types/media.ts +34 -0
  41. package/src/types/page.ts +47 -0
  42. package/src/types/render-mode.ts +10 -0
  43. package/src/types/renderer.ts +83 -0
  44. package/src/types/rich-text.ts +64 -0
  45. package/src/types/video.ts +76 -0
  46. package/templates/astro/template/package.json.tmpl +3 -6
  47. package/templates/nextjs/template/{next.config.ts → next.config.mjs} +2 -2
  48. package/templates/nextjs/template/package.json.tmpl +3 -5
  49. package/templates/nextjs/template/src/app/gradial/assets/[...path]/route.ts +4 -0
  50. package/templates/nextjs/template/src/app/gradial/assets/[releaseId]/[...path]/route.ts +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agentic Content Infrastructure SDK
2
2
 
3
- `@gradial/aci` `0.1.23` is a pre-1.0 public-surface reset for the ACI
3
+ `@gradial/aci` `0.1.21` is a pre-1.0 public-surface reset for the ACI
4
4
  client SDK. Breaking changes from the old `0.1.x` accidental surface are
5
5
  intentional: the root import is framework-neutral, framework runtime behavior is
6
6
  behind explicit subpaths, and the first required customer path is React/Next.
@@ -8,7 +8,7 @@ behind explicit subpaths, and the first required customer path is React/Next.
8
8
  ## Install
9
9
 
10
10
  ```bash
11
- npm install @gradial/aci@0.1.23 zod@^4
11
+ npm install @gradial/aci@0.1.21 zod@^4
12
12
  ```
13
13
 
14
14
  ## Root Import
@@ -68,13 +68,13 @@ go through an app-owned HTTP endpoint backed server-side by a `ContentProvider`.
68
68
  The first RC scaffold path is Next:
69
69
 
70
70
  ```bash
71
- npx @gradial/aci@0.1.23 init my-site --template next-starter
71
+ npx @gradial/aci@0.1.21 init my-site --template next-starter
72
72
  ```
73
73
 
74
74
  List available templates:
75
75
 
76
76
  ```bash
77
- npx @gradial/aci@0.1.23 init --list
77
+ npx @gradial/aci@0.1.21 init --list
78
78
  ```
79
79
 
80
80
  ## Verify Locally
Binary file
@@ -0,0 +1,406 @@
1
+ import { z } from 'zod';
2
+ export declare const segmentDataModel: import("./index.js").DataModelContract<z.ZodObject<{
3
+ id: z.ZodString;
4
+ displayName: z.ZodString;
5
+ status: z.ZodEnum<{
6
+ draft: "draft";
7
+ enabled: "enabled";
8
+ disabled: "disabled";
9
+ }>;
10
+ priority: z.ZodOptional<z.ZodNumber>;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>, "segment">;
13
+ export declare const audienceDataModel: import("./index.js").DataModelContract<z.ZodObject<{
14
+ id: z.ZodString;
15
+ displayName: z.ZodString;
16
+ status: z.ZodEnum<{
17
+ draft: "draft";
18
+ enabled: "enabled";
19
+ disabled: "disabled";
20
+ }>;
21
+ priority: z.ZodNumber;
22
+ membershipSource: z.ZodEnum<{
23
+ segment: "segment";
24
+ rule: "rule";
25
+ manual: "manual";
26
+ external: "external";
27
+ none: "none";
28
+ }>;
29
+ ruleRef: z.ZodOptional<z.ZodString>;
30
+ segmentRef: z.ZodOptional<z.ZodString>;
31
+ providerRef: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>, "audience">;
33
+ export declare const audienceRuleDataModel: import("./index.js").DataModelContract<z.ZodObject<{
34
+ id: z.ZodString;
35
+ status: z.ZodEnum<{
36
+ draft: "draft";
37
+ enabled: "enabled";
38
+ disabled: "disabled";
39
+ }>;
40
+ description: z.ZodOptional<z.ZodString>;
41
+ expression: z.ZodObject<{
42
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
43
+ field: z.ZodString;
44
+ operator: z.ZodEnum<{
45
+ equals: "equals";
46
+ contains: "contains";
47
+ startsWith: "startsWith";
48
+ exists: "exists";
49
+ }>;
50
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
51
+ }, z.core.$strip>>>;
52
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
53
+ field: z.ZodString;
54
+ operator: z.ZodEnum<{
55
+ equals: "equals";
56
+ contains: "contains";
57
+ startsWith: "startsWith";
58
+ exists: "exists";
59
+ }>;
60
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
61
+ }, z.core.$strip>>>;
62
+ }, z.core.$strip>;
63
+ }, z.core.$strip>, "audience_rule">;
64
+ export declare const visitorProfileDataModel: import("./index.js").DataModelContract<z.ZodObject<{
65
+ visitorId: z.ZodString;
66
+ audienceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
+ segmentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
69
+ updatedAt: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>, "visitor_profile">;
71
+ export declare const goalDataModel: import("./index.js").DataModelContract<z.ZodObject<{
72
+ id: z.ZodString;
73
+ displayName: z.ZodString;
74
+ status: z.ZodEnum<{
75
+ draft: "draft";
76
+ enabled: "enabled";
77
+ disabled: "disabled";
78
+ }>;
79
+ eventName: z.ZodString;
80
+ eventRule: z.ZodOptional<z.ZodObject<{
81
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
82
+ field: z.ZodString;
83
+ operator: z.ZodEnum<{
84
+ equals: "equals";
85
+ contains: "contains";
86
+ startsWith: "startsWith";
87
+ exists: "exists";
88
+ }>;
89
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
90
+ }, z.core.$strip>>>;
91
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
92
+ field: z.ZodString;
93
+ operator: z.ZodEnum<{
94
+ equals: "equals";
95
+ contains: "contains";
96
+ startsWith: "startsWith";
97
+ exists: "exists";
98
+ }>;
99
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
100
+ }, z.core.$strip>>>;
101
+ }, z.core.$strip>>;
102
+ }, z.core.$strip>, "goal">;
103
+ export declare const experimentDataModel: import("./index.js").DataModelContract<z.ZodObject<{
104
+ id: z.ZodString;
105
+ displayName: z.ZodString;
106
+ status: z.ZodEnum<{
107
+ draft: "draft";
108
+ running: "running";
109
+ paused: "paused";
110
+ stopped: "stopped";
111
+ promoted: "promoted";
112
+ archived: "archived";
113
+ }>;
114
+ kind: z.ZodEnum<{
115
+ ab: "ab";
116
+ abn: "abn";
117
+ xt: "xt";
118
+ }>;
119
+ priority: z.ZodNumber;
120
+ allocationVersion: z.ZodOptional<z.ZodString>;
121
+ salt: z.ZodOptional<z.ZodString>;
122
+ scope: z.ZodObject<{
123
+ routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
124
+ fragments: z.ZodOptional<z.ZodArray<z.ZodString>>;
125
+ }, z.core.$strip>;
126
+ primaryGoalRef: z.ZodOptional<z.ZodString>;
127
+ primaryGoalId: z.ZodOptional<z.ZodString>;
128
+ goalRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
129
+ goalIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
130
+ arms: z.ZodArray<z.ZodObject<{
131
+ id: z.ZodString;
132
+ displayName: z.ZodString;
133
+ role: z.ZodEnum<{
134
+ control: "control";
135
+ variant: "variant";
136
+ }>;
137
+ allocationBasisPoints: z.ZodOptional<z.ZodNumber>;
138
+ rule: z.ZodOptional<z.ZodObject<{
139
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
140
+ field: z.ZodString;
141
+ operator: z.ZodEnum<{
142
+ equals: "equals";
143
+ contains: "contains";
144
+ startsWith: "startsWith";
145
+ exists: "exists";
146
+ }>;
147
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
148
+ }, z.core.$strip>>>;
149
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
150
+ field: z.ZodString;
151
+ operator: z.ZodEnum<{
152
+ equals: "equals";
153
+ contains: "contains";
154
+ startsWith: "startsWith";
155
+ exists: "exists";
156
+ }>;
157
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
158
+ }, z.core.$strip>>>;
159
+ }, z.core.$strip>>;
160
+ }, z.core.$strip>>;
161
+ }, z.core.$strip>, "experiment">;
162
+ export declare const experimentationDataModels: (import("./index.js").DataModelContract<z.ZodObject<{
163
+ id: z.ZodString;
164
+ displayName: z.ZodString;
165
+ status: z.ZodEnum<{
166
+ draft: "draft";
167
+ enabled: "enabled";
168
+ disabled: "disabled";
169
+ }>;
170
+ eventName: z.ZodString;
171
+ eventRule: z.ZodOptional<z.ZodObject<{
172
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
173
+ field: z.ZodString;
174
+ operator: z.ZodEnum<{
175
+ equals: "equals";
176
+ contains: "contains";
177
+ startsWith: "startsWith";
178
+ exists: "exists";
179
+ }>;
180
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
181
+ }, z.core.$strip>>>;
182
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
183
+ field: z.ZodString;
184
+ operator: z.ZodEnum<{
185
+ equals: "equals";
186
+ contains: "contains";
187
+ startsWith: "startsWith";
188
+ exists: "exists";
189
+ }>;
190
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
191
+ }, z.core.$strip>>>;
192
+ }, z.core.$strip>>;
193
+ }, z.core.$strip>, "goal"> | import("./index.js").DataModelContract<z.ZodObject<{
194
+ id: z.ZodString;
195
+ displayName: z.ZodString;
196
+ status: z.ZodEnum<{
197
+ draft: "draft";
198
+ running: "running";
199
+ paused: "paused";
200
+ stopped: "stopped";
201
+ promoted: "promoted";
202
+ archived: "archived";
203
+ }>;
204
+ kind: z.ZodEnum<{
205
+ ab: "ab";
206
+ abn: "abn";
207
+ xt: "xt";
208
+ }>;
209
+ priority: z.ZodNumber;
210
+ allocationVersion: z.ZodOptional<z.ZodString>;
211
+ salt: z.ZodOptional<z.ZodString>;
212
+ scope: z.ZodObject<{
213
+ routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
+ fragments: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
+ }, z.core.$strip>;
216
+ primaryGoalRef: z.ZodOptional<z.ZodString>;
217
+ primaryGoalId: z.ZodOptional<z.ZodString>;
218
+ goalRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
219
+ goalIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
220
+ arms: z.ZodArray<z.ZodObject<{
221
+ id: z.ZodString;
222
+ displayName: z.ZodString;
223
+ role: z.ZodEnum<{
224
+ control: "control";
225
+ variant: "variant";
226
+ }>;
227
+ allocationBasisPoints: z.ZodOptional<z.ZodNumber>;
228
+ rule: z.ZodOptional<z.ZodObject<{
229
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
+ field: z.ZodString;
231
+ operator: z.ZodEnum<{
232
+ equals: "equals";
233
+ contains: "contains";
234
+ startsWith: "startsWith";
235
+ exists: "exists";
236
+ }>;
237
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
238
+ }, z.core.$strip>>>;
239
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
240
+ field: z.ZodString;
241
+ operator: z.ZodEnum<{
242
+ equals: "equals";
243
+ contains: "contains";
244
+ startsWith: "startsWith";
245
+ exists: "exists";
246
+ }>;
247
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
248
+ }, z.core.$strip>>>;
249
+ }, z.core.$strip>>;
250
+ }, z.core.$strip>>;
251
+ }, z.core.$strip>, "experiment">)[];
252
+ export declare const audienceDataModels: (import("./index.js").DataModelContract<z.ZodObject<{
253
+ id: z.ZodString;
254
+ displayName: z.ZodString;
255
+ status: z.ZodEnum<{
256
+ draft: "draft";
257
+ enabled: "enabled";
258
+ disabled: "disabled";
259
+ }>;
260
+ priority: z.ZodOptional<z.ZodNumber>;
261
+ description: z.ZodOptional<z.ZodString>;
262
+ }, z.core.$strip>, "segment"> | import("./index.js").DataModelContract<z.ZodObject<{
263
+ id: z.ZodString;
264
+ displayName: z.ZodString;
265
+ status: z.ZodEnum<{
266
+ draft: "draft";
267
+ enabled: "enabled";
268
+ disabled: "disabled";
269
+ }>;
270
+ priority: z.ZodNumber;
271
+ membershipSource: z.ZodEnum<{
272
+ segment: "segment";
273
+ rule: "rule";
274
+ manual: "manual";
275
+ external: "external";
276
+ none: "none";
277
+ }>;
278
+ ruleRef: z.ZodOptional<z.ZodString>;
279
+ segmentRef: z.ZodOptional<z.ZodString>;
280
+ providerRef: z.ZodOptional<z.ZodString>;
281
+ }, z.core.$strip>, "audience"> | import("./index.js").DataModelContract<z.ZodObject<{
282
+ id: z.ZodString;
283
+ status: z.ZodEnum<{
284
+ draft: "draft";
285
+ enabled: "enabled";
286
+ disabled: "disabled";
287
+ }>;
288
+ description: z.ZodOptional<z.ZodString>;
289
+ expression: z.ZodObject<{
290
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
291
+ field: z.ZodString;
292
+ operator: z.ZodEnum<{
293
+ equals: "equals";
294
+ contains: "contains";
295
+ startsWith: "startsWith";
296
+ exists: "exists";
297
+ }>;
298
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
299
+ }, z.core.$strip>>>;
300
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
301
+ field: z.ZodString;
302
+ operator: z.ZodEnum<{
303
+ equals: "equals";
304
+ contains: "contains";
305
+ startsWith: "startsWith";
306
+ exists: "exists";
307
+ }>;
308
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
309
+ }, z.core.$strip>>>;
310
+ }, z.core.$strip>;
311
+ }, z.core.$strip>, "audience_rule"> | import("./index.js").DataModelContract<z.ZodObject<{
312
+ visitorId: z.ZodString;
313
+ audienceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
314
+ segmentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
315
+ traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
316
+ updatedAt: z.ZodOptional<z.ZodString>;
317
+ }, z.core.$strip>, "visitor_profile"> | import("./index.js").DataModelContract<z.ZodObject<{
318
+ id: z.ZodString;
319
+ displayName: z.ZodString;
320
+ status: z.ZodEnum<{
321
+ draft: "draft";
322
+ enabled: "enabled";
323
+ disabled: "disabled";
324
+ }>;
325
+ eventName: z.ZodString;
326
+ eventRule: z.ZodOptional<z.ZodObject<{
327
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
328
+ field: z.ZodString;
329
+ operator: z.ZodEnum<{
330
+ equals: "equals";
331
+ contains: "contains";
332
+ startsWith: "startsWith";
333
+ exists: "exists";
334
+ }>;
335
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
336
+ }, z.core.$strip>>>;
337
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
338
+ field: z.ZodString;
339
+ operator: z.ZodEnum<{
340
+ equals: "equals";
341
+ contains: "contains";
342
+ startsWith: "startsWith";
343
+ exists: "exists";
344
+ }>;
345
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
346
+ }, z.core.$strip>>>;
347
+ }, z.core.$strip>>;
348
+ }, z.core.$strip>, "goal"> | import("./index.js").DataModelContract<z.ZodObject<{
349
+ id: z.ZodString;
350
+ displayName: z.ZodString;
351
+ status: z.ZodEnum<{
352
+ draft: "draft";
353
+ running: "running";
354
+ paused: "paused";
355
+ stopped: "stopped";
356
+ promoted: "promoted";
357
+ archived: "archived";
358
+ }>;
359
+ kind: z.ZodEnum<{
360
+ ab: "ab";
361
+ abn: "abn";
362
+ xt: "xt";
363
+ }>;
364
+ priority: z.ZodNumber;
365
+ allocationVersion: z.ZodOptional<z.ZodString>;
366
+ salt: z.ZodOptional<z.ZodString>;
367
+ scope: z.ZodObject<{
368
+ routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
369
+ fragments: z.ZodOptional<z.ZodArray<z.ZodString>>;
370
+ }, z.core.$strip>;
371
+ primaryGoalRef: z.ZodOptional<z.ZodString>;
372
+ primaryGoalId: z.ZodOptional<z.ZodString>;
373
+ goalRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
374
+ goalIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
375
+ arms: z.ZodArray<z.ZodObject<{
376
+ id: z.ZodString;
377
+ displayName: z.ZodString;
378
+ role: z.ZodEnum<{
379
+ control: "control";
380
+ variant: "variant";
381
+ }>;
382
+ allocationBasisPoints: z.ZodOptional<z.ZodNumber>;
383
+ rule: z.ZodOptional<z.ZodObject<{
384
+ all: z.ZodOptional<z.ZodArray<z.ZodObject<{
385
+ field: z.ZodString;
386
+ operator: z.ZodEnum<{
387
+ equals: "equals";
388
+ contains: "contains";
389
+ startsWith: "startsWith";
390
+ exists: "exists";
391
+ }>;
392
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
393
+ }, z.core.$strip>>>;
394
+ any: z.ZodOptional<z.ZodArray<z.ZodObject<{
395
+ field: z.ZodString;
396
+ operator: z.ZodEnum<{
397
+ equals: "equals";
398
+ contains: "contains";
399
+ startsWith: "startsWith";
400
+ exists: "exists";
401
+ }>;
402
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
403
+ }, z.core.$strip>>>;
404
+ }, z.core.$strip>>;
405
+ }, z.core.$strip>>;
406
+ }, z.core.$strip>, "experiment">)[];
@@ -0,0 +1,105 @@
1
+ import { z } from 'zod';
2
+ import { defineDataModel } from './define-data-model.js';
3
+ const resourceStatus = z.enum(['draft', 'enabled', 'disabled']);
4
+ const experimentStatus = z.enum(['draft', 'running', 'paused', 'stopped', 'promoted', 'archived']);
5
+ const experimentKind = z.enum(['ab', 'abn', 'xt']);
6
+ const scalarValue = z.union([z.string(), z.number(), z.boolean()]);
7
+ const requestRuleConditionSchema = z.object({
8
+ field: z.string().min(1),
9
+ operator: z.enum(['equals', 'contains', 'startsWith', 'exists']),
10
+ value: scalarValue.optional(),
11
+ });
12
+ const requestRuleExpressionSchema = z.object({
13
+ all: z.array(requestRuleConditionSchema).optional(),
14
+ any: z.array(requestRuleConditionSchema).optional(),
15
+ });
16
+ export const segmentDataModel = defineDataModel({
17
+ type: 'segment',
18
+ schema: z.object({
19
+ id: z.string().min(1),
20
+ displayName: z.string().min(1),
21
+ status: resourceStatus,
22
+ priority: z.number().int().nonnegative().optional(),
23
+ description: z.string().optional(),
24
+ }),
25
+ });
26
+ export const audienceDataModel = defineDataModel({
27
+ type: 'audience',
28
+ schema: z.object({
29
+ id: z.string().min(1),
30
+ displayName: z.string().min(1),
31
+ status: resourceStatus,
32
+ priority: z.number().int().nonnegative(),
33
+ membershipSource: z.enum(['rule', 'segment', 'manual', 'external', 'none']),
34
+ ruleRef: z.string().optional(),
35
+ segmentRef: z.string().optional(),
36
+ providerRef: z.string().optional(),
37
+ }),
38
+ });
39
+ export const audienceRuleDataModel = defineDataModel({
40
+ type: 'audience_rule',
41
+ schema: z.object({
42
+ id: z.string().min(1),
43
+ status: resourceStatus,
44
+ description: z.string().optional(),
45
+ expression: requestRuleExpressionSchema,
46
+ }),
47
+ });
48
+ export const visitorProfileDataModel = defineDataModel({
49
+ type: 'visitor_profile',
50
+ schema: z.object({
51
+ visitorId: z.string().min(1),
52
+ audienceIds: z.array(z.string().min(1)).optional(),
53
+ segmentIds: z.array(z.string().min(1)).optional(),
54
+ traits: z.record(z.string(), scalarValue).optional(),
55
+ updatedAt: z.string().optional(),
56
+ }),
57
+ });
58
+ export const goalDataModel = defineDataModel({
59
+ type: 'goal',
60
+ schema: z.object({
61
+ id: z.string().min(1),
62
+ displayName: z.string().min(1),
63
+ status: resourceStatus,
64
+ eventName: z.string().min(1),
65
+ eventRule: requestRuleExpressionSchema.optional(),
66
+ }),
67
+ });
68
+ export const experimentDataModel = defineDataModel({
69
+ type: 'experiment',
70
+ schema: z.object({
71
+ id: z.string().min(1),
72
+ displayName: z.string().min(1),
73
+ status: experimentStatus,
74
+ kind: experimentKind,
75
+ priority: z.number().int().nonnegative(),
76
+ allocationVersion: z.string().optional(),
77
+ salt: z.string().optional(),
78
+ scope: z.object({
79
+ routes: z.array(z.string().min(1)).optional(),
80
+ fragments: z.array(z.string().min(1)).optional(),
81
+ }),
82
+ primaryGoalRef: z.string().optional(),
83
+ primaryGoalId: z.string().optional(),
84
+ goalRefs: z.array(z.string().min(1)).optional(),
85
+ goalIds: z.array(z.string().min(1)).optional(),
86
+ arms: z.array(z.object({
87
+ id: z.string().min(1),
88
+ displayName: z.string().min(1),
89
+ role: z.enum(['control', 'variant']),
90
+ allocationBasisPoints: z.number().int().min(0).max(10000).optional(),
91
+ rule: requestRuleExpressionSchema.optional(),
92
+ })).min(1),
93
+ }),
94
+ });
95
+ export const experimentationDataModels = [
96
+ goalDataModel,
97
+ experimentDataModel,
98
+ ];
99
+ export const audienceDataModels = [
100
+ segmentDataModel,
101
+ audienceDataModel,
102
+ audienceRuleDataModel,
103
+ visitorProfileDataModel,
104
+ ...experimentationDataModels,
105
+ ];
@@ -27,8 +27,8 @@ export interface BlockRefOptions {
27
27
  */
28
28
  export declare function blockRef(options?: BlockRefOptions): z.ZodObject<{
29
29
  id: z.ZodString;
30
- component: z.ZodEnum<{
30
+ component: z.ZodString | z.ZodEnum<{
31
31
  [x: string]: string;
32
- }> | z.ZodString;
32
+ }>;
33
33
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
34
34
  }, z.core.$strip>;
@@ -31,7 +31,7 @@ export async function getReleaseAssetResponse(input) {
31
31
  copyHeader(res.headers, headers, 'content-length');
32
32
  copyHeader(res.headers, headers, 'etag');
33
33
  copyHeader(res.headers, headers, 'last-modified');
34
- headers.set('cache-control', 'public, max-age=31536000, immutable');
34
+ headers.set('cache-control', 'public, max-age=300, must-revalidate');
35
35
  return new Response(res.body, { status: 200, headers });
36
36
  }
37
37
  function cleanAssetPath(value) {
package/dist/index.d.ts CHANGED
@@ -12,3 +12,6 @@ export type { Config, RouteConfig, ExternalDependency, DAMConfig, } from './type
12
12
  export type { Renderer, RenderCapabilities, RenderPageRequest, RenderPageResult, RequestContext, ReleaseContext, RenderFragmentRequest, RenderIslandRequest, RenderResult, IslandDescriptor, CachePolicy, GeoContext, } from './types/renderer.js';
13
13
  export type { Asset, } from './types/media.js';
14
14
  export { AssetSchema, isImage, isAsset, } from './types/media.js';
15
+ export * from './audience-data-models.js';
16
+ export * from './define-data-model.js';
17
+ export * from './types/index.js';
package/dist/index.js CHANGED
@@ -6,3 +6,9 @@ export { ImageSchema, imageAttrs, primaryImageSource, } from './types/image.js';
6
6
  export { LinkSchema, resolveLink, resolveHref, assertSafeHref, normalizeLinkRel, } from './types/link.js';
7
7
  export { HeadingSchema, InlineContentSchema, RichTextValueSchema, } from './types/rich-text.js';
8
8
  export { AssetSchema, isImage, isAsset, } from './types/media.js';
9
+ export * from './audience-data-models.js';
10
+ export * from './define-data-model.js';
11
+ export * from './types/index.js';
12
+ // Note: content/ is NOT re-exported here because it imports node:path,
13
+ // making it incompatible with client-side bundlers. Import server-only
14
+ // content utilities from '@gradial/aci/content' explicitly.
@@ -2,7 +2,6 @@ type AssetRouteContext = {
2
2
  params: Promise<AssetRouteParams>;
3
3
  };
4
4
  type AssetRouteParams = {
5
- releaseId?: string;
6
5
  path?: string[];
7
6
  };
8
7
  export declare const runtime = "nodejs";
@@ -1,21 +1,20 @@
1
1
  import { FileContentProvider } from '../providers/file.js';
2
- import { getReleaseAssetResponse } from '../content/assets.js';
3
- const LOCAL_RELEASE_ID = 'local';
2
+ import { getReleaseAssetResponse, resolveReleaseId } from './server.js';
4
3
  export const runtime = 'nodejs';
5
4
  export const dynamic = 'force-dynamic';
6
5
  export async function GET(_request, { params }) {
7
6
  const resolvedParams = await params;
8
- const releaseId = resolvedParams.releaseId || '';
9
7
  const assetPath = '/' + (resolvedParams.path || []).join('/');
10
- if (!releaseId || assetPath === '/') {
8
+ if (assetPath === '/') {
11
9
  return new Response('asset not found', { status: 404 });
12
10
  }
13
- if (releaseId === LOCAL_RELEASE_ID) {
11
+ if (process.env.ACI_CONTENT_PROVIDER === 'file') {
14
12
  const provider = new FileContentProvider();
15
13
  return provider.fetchRaw(assetPath);
16
14
  }
17
15
  try {
18
- return await getReleaseAssetResponse({ releaseId, assetPath });
16
+ const releaseId = await resolveReleaseId();
17
+ return await getReleaseAssetResponse(releaseId, assetPath);
19
18
  }
20
19
  catch {
21
20
  return new Response('asset not found', { status: 404 });