@tai42/api-client 35.0.0 → 36.0.0
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/client/index.d.ts +1 -1
- package/dist/client/interactions-client.d.ts +1 -1
- package/dist/schemas/interactions.d.ts +10 -9
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js +11 -8
- package/dist/schemas/interactions.js.map +1 -1
- package/package.json +1 -1
- package/src/schemas/interactions.ts +11 -8
package/dist/client/index.d.ts
CHANGED
|
@@ -2458,7 +2458,7 @@ export declare function createApiClient(config: ApiConfig): {
|
|
|
2458
2458
|
value: string;
|
|
2459
2459
|
}[]>;
|
|
2460
2460
|
errors: Record<string, string>;
|
|
2461
|
-
display: Record<string,
|
|
2461
|
+
display: Record<string, string | number | boolean | null>;
|
|
2462
2462
|
}>;
|
|
2463
2463
|
readonly cancelInteraction: (interactionId: string) => Promise<{
|
|
2464
2464
|
interaction_id: string;
|
|
@@ -41,7 +41,7 @@ export declare function interactionsClient(t: Transport): {
|
|
|
41
41
|
value: string;
|
|
42
42
|
}[]>;
|
|
43
43
|
errors: Record<string, string>;
|
|
44
|
-
display: Record<string,
|
|
44
|
+
display: Record<string, string | number | boolean | null>;
|
|
45
45
|
}>;
|
|
46
46
|
cancelInteraction: (interactionId: string) => Promise<{
|
|
47
47
|
interaction_id: string;
|
|
@@ -106,10 +106,9 @@ export type DisplayBlockKind = z.infer<typeof displayBlockKind>;
|
|
|
106
106
|
* One ordered, display-only block on a form page (never an input): a `heading` or
|
|
107
107
|
* `body` text block, or an `image`. `text` carries a heading/body's words; `src`/`alt`
|
|
108
108
|
* carry an image's source and alt text. An optional `slot` names a data key whose value
|
|
109
|
-
* a heading/body block shows in place of static `text` — filled
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* the image source in place of `src`, and `null` or `""` leaves the block its alt text.
|
|
109
|
+
* a heading/body block shows in place of static `text` — filled by a reaction's `display`
|
|
110
|
+
* update while the form is open (so a computed total is a display slot, not a special
|
|
111
|
+
* case). An image block's slot value is the image source in place of `src`, and `null` or `""` leaves the block its alt text.
|
|
113
112
|
* Every text field is `.nullish()` (absent OR explicit `null` both parse
|
|
114
113
|
* to absent) so a block that omits a key — or sends an explicit `null` — is not a
|
|
115
114
|
* whole-page parse failure. Applied per block by the preview (safeParsed via its page),
|
|
@@ -501,9 +500,11 @@ export type FormReactions = z.infer<typeof formReactions>;
|
|
|
501
500
|
* `update`): the same kind of data a form is sent with, applied to the open form. `values`
|
|
502
501
|
* sets field values; `options` replaces the per-send choice list of option-bearing fields;
|
|
503
502
|
* `errors` shows per-field messages (keyed by field name); `display` fills display slots
|
|
504
|
-
* (keyed by slot name) — a computed total among them.
|
|
505
|
-
*
|
|
506
|
-
*
|
|
503
|
+
* (keyed by slot name) — a computed total among them. A slot value is a text, a number,
|
|
504
|
+
* true/false or `null` (the slot unfilled); an object or a list makes the whole update
|
|
505
|
+
* malformed. Every member defaults to empty, so a reaction that touches only one of them
|
|
506
|
+
* returns only that one. The door response is safeParsed, so a malformed update surfaces
|
|
507
|
+
* loudly rather than applying a half-understood change.
|
|
507
508
|
*/
|
|
508
509
|
export declare const formUpdate: z.ZodObject<{
|
|
509
510
|
values: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -513,7 +514,7 @@ export declare const formUpdate: z.ZodObject<{
|
|
|
513
514
|
value: z.ZodString;
|
|
514
515
|
}, z.core.$strict>>>>;
|
|
515
516
|
errors: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
516
|
-
display: z.ZodDefault<z.ZodRecord<z.ZodString, z.
|
|
517
|
+
display: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
517
518
|
}, z.core.$strip>;
|
|
518
519
|
export type FormUpdate = z.infer<typeof formUpdate>;
|
|
519
520
|
/**
|
|
@@ -545,7 +546,7 @@ export declare const interactionReaction: z.ZodObject<{
|
|
|
545
546
|
value: z.ZodString;
|
|
546
547
|
}, z.core.$strict>>>>;
|
|
547
548
|
errors: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
548
|
-
display: z.ZodDefault<z.ZodRecord<z.ZodString, z.
|
|
549
|
+
display: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
549
550
|
}, z.core.$strip>;
|
|
550
551
|
}, z.core.$strip>;
|
|
551
552
|
export type InteractionReaction = z.infer<typeof interactionReaction>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../src/schemas/interactions.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,YAAY;;;;;;;EAAuB,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,mGAAmG;AACnG,eAAO,MAAM,SAAS;;;;;;EAAoB,CAAC;AAC3C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;kBAAoB,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,wEAAwE;AACxE,eAAO,MAAM,mBAAmB;;;;;;EAAoB,CAAC;AACrD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;kBAAoB,CAAC;AACrD,MAAM,MAAM,mBAAmB,G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AAmB;;;iBAAkC,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;iBAAkC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAoE,CAAC;AAClG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -48,10 +48,9 @@ export const displayBlockKind = openapi.displayBlock.shape.kind;
|
|
|
48
48
|
* One ordered, display-only block on a form page (never an input): a `heading` or
|
|
49
49
|
* `body` text block, or an `image`. `text` carries a heading/body's words; `src`/`alt`
|
|
50
50
|
* carry an image's source and alt text. An optional `slot` names a data key whose value
|
|
51
|
-
* a heading/body block shows in place of static `text` — filled
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* the image source in place of `src`, and `null` or `""` leaves the block its alt text.
|
|
51
|
+
* a heading/body block shows in place of static `text` — filled by a reaction's `display`
|
|
52
|
+
* update while the form is open (so a computed total is a display slot, not a special
|
|
53
|
+
* case). An image block's slot value is the image source in place of `src`, and `null` or `""` leaves the block its alt text.
|
|
55
54
|
* Every text field is `.nullish()` (absent OR explicit `null` both parse
|
|
56
55
|
* to absent) so a block that omits a key — or sends an explicit `null` — is not a
|
|
57
56
|
* whole-page parse failure. Applied per block by the preview (safeParsed via its page),
|
|
@@ -279,15 +278,19 @@ export const formReactions = z.object({
|
|
|
279
278
|
* `update`): the same kind of data a form is sent with, applied to the open form. `values`
|
|
280
279
|
* sets field values; `options` replaces the per-send choice list of option-bearing fields;
|
|
281
280
|
* `errors` shows per-field messages (keyed by field name); `display` fills display slots
|
|
282
|
-
* (keyed by slot name) — a computed total among them.
|
|
283
|
-
*
|
|
284
|
-
*
|
|
281
|
+
* (keyed by slot name) — a computed total among them. A slot value is a text, a number,
|
|
282
|
+
* true/false or `null` (the slot unfilled); an object or a list makes the whole update
|
|
283
|
+
* malformed. Every member defaults to empty, so a reaction that touches only one of them
|
|
284
|
+
* returns only that one. The door response is safeParsed, so a malformed update surfaces
|
|
285
|
+
* loudly rather than applying a half-understood change.
|
|
285
286
|
*/
|
|
286
287
|
export const formUpdate = z.object({
|
|
287
288
|
values: z.record(z.string(), z.unknown()).default({}),
|
|
288
289
|
options: z.record(z.string(), z.array(formOption)).default({}),
|
|
289
290
|
errors: z.record(z.string(), z.string()).default({}),
|
|
290
|
-
display: z
|
|
291
|
+
display: z
|
|
292
|
+
.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.null()]))
|
|
293
|
+
.default({}),
|
|
291
294
|
});
|
|
292
295
|
/**
|
|
293
296
|
* The event a reaction round-trip reports to the door (the contract's `FormReactionEvent`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/schemas/interactions.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,iEAAiE;AACjE,iFAAiF;AACjF,+EAA+E;AAC/E,kFAAkF;AAElF,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAGjD,mGAAmG;AACnG,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;AAG3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;AAGtD,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC;AA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AAG,OAAO,CAAC,uBAAuB,CAAC;AAGpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -67,10 +67,9 @@ export type DisplayBlockKind = z.infer<typeof displayBlockKind>;
|
|
|
67
67
|
* One ordered, display-only block on a form page (never an input): a `heading` or
|
|
68
68
|
* `body` text block, or an `image`. `text` carries a heading/body's words; `src`/`alt`
|
|
69
69
|
* carry an image's source and alt text. An optional `slot` names a data key whose value
|
|
70
|
-
* a heading/body block shows in place of static `text` — filled
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* the image source in place of `src`, and `null` or `""` leaves the block its alt text.
|
|
70
|
+
* a heading/body block shows in place of static `text` — filled by a reaction's `display`
|
|
71
|
+
* update while the form is open (so a computed total is a display slot, not a special
|
|
72
|
+
* case). An image block's slot value is the image source in place of `src`, and `null` or `""` leaves the block its alt text.
|
|
74
73
|
* Every text field is `.nullish()` (absent OR explicit `null` both parse
|
|
75
74
|
* to absent) so a block that omits a key — or sends an explicit `null` — is not a
|
|
76
75
|
* whole-page parse failure. Applied per block by the preview (safeParsed via its page),
|
|
@@ -332,15 +331,19 @@ export type FormReactions = z.infer<typeof formReactions>;
|
|
|
332
331
|
* `update`): the same kind of data a form is sent with, applied to the open form. `values`
|
|
333
332
|
* sets field values; `options` replaces the per-send choice list of option-bearing fields;
|
|
334
333
|
* `errors` shows per-field messages (keyed by field name); `display` fills display slots
|
|
335
|
-
* (keyed by slot name) — a computed total among them.
|
|
336
|
-
*
|
|
337
|
-
*
|
|
334
|
+
* (keyed by slot name) — a computed total among them. A slot value is a text, a number,
|
|
335
|
+
* true/false or `null` (the slot unfilled); an object or a list makes the whole update
|
|
336
|
+
* malformed. Every member defaults to empty, so a reaction that touches only one of them
|
|
337
|
+
* returns only that one. The door response is safeParsed, so a malformed update surfaces
|
|
338
|
+
* loudly rather than applying a half-understood change.
|
|
338
339
|
*/
|
|
339
340
|
export const formUpdate = z.object({
|
|
340
341
|
values: z.record(z.string(), z.unknown()).default({}),
|
|
341
342
|
options: z.record(z.string(), z.array(formOption)).default({}),
|
|
342
343
|
errors: z.record(z.string(), z.string()).default({}),
|
|
343
|
-
display: z
|
|
344
|
+
display: z
|
|
345
|
+
.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.null()]))
|
|
346
|
+
.default({}),
|
|
344
347
|
});
|
|
345
348
|
export type FormUpdate = z.infer<typeof formUpdate>;
|
|
346
349
|
|