@tai42/api-client 21.0.0 → 22.0.1
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/backend-client.d.ts +1 -1
- package/dist/client/backup-client.d.ts +2 -2
- package/dist/client/config-client.d.ts +3 -3
- package/dist/client/connectors-client.d.ts +15 -15
- package/dist/client/conversations-client.d.ts +222 -0
- package/dist/client/conversations-client.d.ts.map +1 -1
- package/dist/client/index.d.ts +268 -46
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/manifest-client.d.ts +18 -18
- package/dist/client/profiles-client.d.ts +2 -2
- package/dist/client/states-client.d.ts +1 -1
- package/dist/client/tool-extensions-client.d.ts +2 -2
- package/dist/client/tools-client.d.ts +2 -2
- package/dist/generated/openapi-schemas.d.ts +1228 -15
- package/dist/generated/openapi-schemas.d.ts.map +1 -1
- package/dist/generated/openapi-schemas.js +14 -3
- package/dist/generated/openapi-schemas.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/backup.d.ts +4 -4
- package/dist/schemas/connectors.d.ts +13 -13
- package/dist/schemas/conversations.d.ts +296 -0
- package/dist/schemas/conversations.d.ts.map +1 -1
- package/dist/schemas/fleet.d.ts +6 -6
- package/dist/schemas/interactions.d.ts +250 -1
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js +158 -2
- package/dist/schemas/interactions.js.map +1 -1
- package/dist/schemas/manifest-mcp.d.ts +2 -2
- package/dist/schemas/profiles.d.ts +2 -2
- package/dist/schemas/states.d.ts +1 -1
- package/dist/schemas/system-kinds.d.ts +3 -3
- package/package.json +3 -3
- package/src/generated/openapi-schemas.ts +36 -3
- package/src/index.ts +10 -0
- package/src/schemas/interactions.ts +181 -2
|
@@ -79,6 +79,15 @@ export type AgentsEntriesAdd = z.infer<typeof agentsEntriesAdd>;
|
|
|
79
79
|
export const answerFormat = z.enum(["text","confirm","select","form","external","free"]);
|
|
80
80
|
export type AnswerFormat = z.infer<typeof answerFormat>;
|
|
81
81
|
|
|
82
|
+
export const formPageWording = z.object({ "choose_one": z.string().nullable().default(null), "date_unavailable": z.string().nullable().default(null), "failed": z.string().nullable().default(null), "network_error": z.string().nullable().default(null), "update_failed": z.string().nullable().default(null) }).strict();
|
|
83
|
+
export type FormPageWording = z.infer<typeof formPageWording>;
|
|
84
|
+
|
|
85
|
+
export const pageCopy = z.object({ "heading": z.string().nullable().default(null), "text": z.string().nullable().default(null) }).strict();
|
|
86
|
+
export type PageCopy = z.infer<typeof pageCopy>;
|
|
87
|
+
|
|
88
|
+
export const answerPageWording = z.object({ "awaiting": pageCopy.nullable().default(null), "confirm": pageCopy.nullable().default(null), "done": pageCopy.nullable().default(null), "form": formPageWording.nullable().default(null), "submitted": pageCopy.nullable().default(null) }).strict();
|
|
89
|
+
export type AnswerPageWording = z.infer<typeof answerPageWording>;
|
|
90
|
+
|
|
82
91
|
export const formOption = z.object({ "label": z.string().nullable().default(null), "value": z.string() }).strict();
|
|
83
92
|
export type FormOption = z.infer<typeof formOption>;
|
|
84
93
|
|
|
@@ -88,7 +97,7 @@ export type FormData = z.infer<typeof formData>;
|
|
|
88
97
|
export const displayBlock = z.object({ "alt": z.string().nullable().default(null), "kind": z.enum(["heading","body","image"]), "slot": z.string().nullable().default(null), "src": z.string().nullable().default(null), "text": z.string().nullable().default(null) }).strict();
|
|
89
98
|
export type DisplayBlock = z.infer<typeof displayBlock>;
|
|
90
99
|
|
|
91
|
-
export const formPage = z.object({ "display": z.array(displayBlock).default([]), "fields": z.array(z.string()), "kind": z.enum(["input","review"]).default("input"), "title": z.string() }).strict();
|
|
100
|
+
export const formPage = z.object({ "button_label": z.string().nullable().default(null), "display": z.array(displayBlock).default([]), "fields": z.array(z.string()), "kind": z.enum(["input","review"]).default("input"), "title": z.string() }).strict();
|
|
92
101
|
export type FormPage = z.infer<typeof formPage>;
|
|
93
102
|
|
|
94
103
|
export const linkOption = z.object({ "kind": z.literal("link").default("link"), "label": z.string(), "url": z.string() }).strict();
|
|
@@ -109,7 +118,31 @@ export type ReplyOption = z.infer<typeof replyOption>;
|
|
|
109
118
|
export const optionSection = z.object({ "rows": z.array(replyOption), "title": z.string() }).strict();
|
|
110
119
|
export type OptionSection = z.infer<typeof optionSection>;
|
|
111
120
|
|
|
112
|
-
export const
|
|
121
|
+
export const answerWording = z.object({ "confirm": z.string().nullable().default(null), "decline": z.string().nullable().default(null), "open": z.string().nullable().default(null), "rejected": z.string().nullable().default(null), "rejected_final": z.string().nullable().default(null), "reply_hint": z.string().nullable().default(null), "submit": z.string().nullable().default(null) }).strict();
|
|
122
|
+
export type AnswerWording = z.infer<typeof answerWording>;
|
|
123
|
+
|
|
124
|
+
export const choiceWording = z.object({ "group_label": z.string().nullable().default(null), "label": z.string().nullable().default(null), "reply_hint": z.string().nullable().default(null) }).strict();
|
|
125
|
+
export type ChoiceWording = z.infer<typeof choiceWording>;
|
|
126
|
+
|
|
127
|
+
export const fieldWording = z.object({ "choice_label": z.string().nullable().default(null) }).strict();
|
|
128
|
+
export type FieldWording = z.infer<typeof fieldWording>;
|
|
129
|
+
|
|
130
|
+
export const formWording = z.object({ "back": z.string().nullable().default(null), "cancel": z.string().nullable().default(null), "fields": z.record(z.string(), fieldWording).default({}), "open": z.string().nullable().default(null), "review_empty": z.string().nullable().default(null), "submit": z.string().nullable().default(null), "title": z.string().nullable().default(null) }).strict();
|
|
131
|
+
export type FormWording = z.infer<typeof formWording>;
|
|
132
|
+
|
|
133
|
+
export const lineWording = z.object({ "answer_link": z.string().nullable().default(null), "deadline": z.string().nullable().default(null), "options": z.string().nullable().default(null), "reply": z.string().nullable().default(null) }).strict();
|
|
134
|
+
export type LineWording = z.infer<typeof lineWording>;
|
|
135
|
+
|
|
136
|
+
export const countdownWording = z.object({ "one_second_left": z.string().nullable().default(null), "seconds_left": z.string().nullable().default(null), "under_half_minute": z.string().nullable().default(null), "under_minute": z.string().nullable().default(null), "under_ten_seconds": z.string().nullable().default(null) }).strict();
|
|
137
|
+
export type CountdownWording = z.infer<typeof countdownWording>;
|
|
138
|
+
|
|
139
|
+
export const statusWording = z.object({ "answered": z.string().nullable().default(null), "closed": z.string().nullable().default(null), "countdown": countdownWording.nullable().default(null), "expired": z.string().nullable().default(null), "sending": z.string().nullable().default(null), "sent": z.string().nullable().default(null), "unavailable": z.string().nullable().default(null) }).strict();
|
|
140
|
+
export type StatusWording = z.infer<typeof statusWording>;
|
|
141
|
+
|
|
142
|
+
export const wording = z.object({ "answer": answerWording.nullable().default(null), "answer_page": answerPageWording.nullable().default(null), "choice": choiceWording.nullable().default(null), "form": formWording.nullable().default(null), "lines": lineWording.nullable().default(null), "status": statusWording.nullable().default(null) }).strict();
|
|
143
|
+
export type Wording = z.infer<typeof wording>;
|
|
144
|
+
|
|
145
|
+
export const answerPart = z.object({ "data": formData.nullable().default(null), "footer": z.string().nullable().default(null), "form_tag": z.string().nullable().default(null), "header": mediaItem.nullable().default(null), "location": locationElement.nullable().default(null), "media": z.array(mediaItem).nullable().default(null), "message": z.string().default(""), "options": z.array(z.discriminatedUnion("kind", [replyOption, linkOption])).nullable().default(null), "pages": z.array(formPage).nullable().default(null), "schema": z.record(z.string(), z.unknown()).nullable().default(null), "sections": z.array(optionSection).nullable().default(null), "template": channelTemplate.nullable().default(null), "wording": wording.nullable().default(null) }).strict();
|
|
113
146
|
export type AnswerPart = z.infer<typeof answerPart>;
|
|
114
147
|
|
|
115
148
|
export const overlapPolicy = z.object({ "deliver": z.enum(["one","all"]).default("one"), "running": z.enum(["continue","cancel"]).default("continue"), "settle_seconds": z.number().int().gte(0).lte(30).default(0) });
|
|
@@ -583,7 +616,7 @@ export type NotificationListing = z.infer<typeof notificationListing>;
|
|
|
583
616
|
export const notifyResult = z.string();
|
|
584
617
|
export type NotifyResult = z.infer<typeof notifyResult>;
|
|
585
618
|
|
|
586
|
-
export const notifyUser = z.object({ "audience": z.string().nullable().default(null), "channel": z.string().nullable().default(null), "data": formData.nullable().default(null), "footer": z.string().nullable().default(null), "form_tag": z.string().nullable().default(null), "header": mediaItem.nullable().default(null), "location": locationElement.nullable().default(null), "media": z.array(mediaItem).nullable().default(null), "message": z.string(), "options": z.array(z.discriminatedUnion("kind", [replyOption, linkOption])).nullable().default(null), "pages": z.array(formPage).nullable().default(null), "recipient": z.string().nullable().default(null), "schema": z.record(z.string(), z.unknown()).nullable().default(null), "sections": z.array(optionSection).nullable().default(null), "sender_identity": z.string().nullable().default(null), "template": channelTemplate.nullable().default(null) }).strict();
|
|
619
|
+
export const notifyUser = z.object({ "audience": z.string().nullable().default(null), "channel": z.string().nullable().default(null), "data": formData.nullable().default(null), "footer": z.string().nullable().default(null), "form_tag": z.string().nullable().default(null), "header": mediaItem.nullable().default(null), "location": locationElement.nullable().default(null), "media": z.array(mediaItem).nullable().default(null), "message": z.string(), "options": z.array(z.discriminatedUnion("kind", [replyOption, linkOption])).nullable().default(null), "pages": z.array(formPage).nullable().default(null), "recipient": z.string().nullable().default(null), "schema": z.record(z.string(), z.unknown()).nullable().default(null), "sections": z.array(optionSection).nullable().default(null), "sender_identity": z.string().nullable().default(null), "template": channelTemplate.nullable().default(null), "wording": wording.nullable().default(null) }).strict();
|
|
587
620
|
export type NotifyUser = z.infer<typeof notifyUser>;
|
|
588
621
|
|
|
589
622
|
export const oAuthCancelled = z.object({ "kind": z.literal("cancelled"), "message": z.string() });
|
package/src/index.ts
CHANGED
|
@@ -76,6 +76,8 @@ export type { ApiConfig, RequestOptions } from './http';
|
|
|
76
76
|
export { apiDownload, apiRequest, apiText } from './http';
|
|
77
77
|
export type {
|
|
78
78
|
AnswerFormat,
|
|
79
|
+
AnswerPageWording,
|
|
80
|
+
AnswerWording,
|
|
79
81
|
ApiConversationRouteCreate,
|
|
80
82
|
ApplyResult,
|
|
81
83
|
AttachmentMediaItem,
|
|
@@ -90,6 +92,7 @@ export type {
|
|
|
90
92
|
ChannelConversationRouteCreate,
|
|
91
93
|
Channels,
|
|
92
94
|
ChannelTemplate,
|
|
95
|
+
ChoiceWording,
|
|
93
96
|
ClaimLinkCreated,
|
|
94
97
|
CompletedOrigin,
|
|
95
98
|
ConnectionView,
|
|
@@ -123,11 +126,13 @@ export type {
|
|
|
123
126
|
ConversationThreadModeState,
|
|
124
127
|
ConversationThreadsPage,
|
|
125
128
|
ConversationTranscriptPage,
|
|
129
|
+
CountdownWording,
|
|
126
130
|
DashboardMetrics,
|
|
127
131
|
DiscoveredServer,
|
|
128
132
|
DisplayBlock,
|
|
129
133
|
DisplayBlockKind,
|
|
130
134
|
Extension,
|
|
135
|
+
FieldWording,
|
|
131
136
|
FleetOutcome,
|
|
132
137
|
FleetReloadResult,
|
|
133
138
|
FleetReportFanout,
|
|
@@ -143,6 +148,7 @@ export type {
|
|
|
143
148
|
FormPages,
|
|
144
149
|
FormReactions,
|
|
145
150
|
FormUpdate,
|
|
151
|
+
FormWording,
|
|
146
152
|
FreshLife,
|
|
147
153
|
GrantLevel,
|
|
148
154
|
HeldPendingSave,
|
|
@@ -159,6 +165,7 @@ export type {
|
|
|
159
165
|
InviteRow,
|
|
160
166
|
InvokeMemberActionResult,
|
|
161
167
|
KindStatus,
|
|
168
|
+
LineWording,
|
|
162
169
|
LoginFormField,
|
|
163
170
|
LoginMethod,
|
|
164
171
|
LoginMethods,
|
|
@@ -207,6 +214,7 @@ export type {
|
|
|
207
214
|
Notifications,
|
|
208
215
|
OAuthCompleteResult,
|
|
209
216
|
ObservabilityCapabilities,
|
|
217
|
+
PageCopy,
|
|
210
218
|
ParkedCallerAsk,
|
|
211
219
|
ParkedStatus,
|
|
212
220
|
PatternEntry,
|
|
@@ -286,6 +294,7 @@ export type {
|
|
|
286
294
|
StateTemplateParameter,
|
|
287
295
|
StateTemplateTrace,
|
|
288
296
|
StateUpdate,
|
|
297
|
+
StatusWording,
|
|
289
298
|
StorageInfo,
|
|
290
299
|
StorageResourceStat,
|
|
291
300
|
StudioPluginListingEntry,
|
|
@@ -316,6 +325,7 @@ export type {
|
|
|
316
325
|
TriggerLinkRecord,
|
|
317
326
|
ValidateConditionResult,
|
|
318
327
|
VisitOutcome,
|
|
328
|
+
Wording,
|
|
319
329
|
WorkerKind,
|
|
320
330
|
WorkerLastOp,
|
|
321
331
|
WorkerState,
|
|
@@ -88,16 +88,195 @@ export type FormPageKind = z.infer<typeof formPageKind>;
|
|
|
88
88
|
* instead of, for a review page) its input fields; it defaults to empty, so a page that
|
|
89
89
|
* carries none renders exactly as before. `kind` marks a `review` page — a terminal
|
|
90
90
|
* summary step that shows the readback of entered values and the confirm/submit footer
|
|
91
|
-
* and carries no new input fields; it defaults to `input`.
|
|
91
|
+
* and carries no new input fields; it defaults to `input`. `button_label` is the text of
|
|
92
|
+
* the page's primary button — the one that advances from an input page, or submits from
|
|
93
|
+
* the last — in the sender's words and the end-user's language; absent (`null`), the
|
|
94
|
+
* surface shows its own generic word ("Next"/"Submit"/"Confirm"). All additive: an older
|
|
92
95
|
* payload ({title, fields}) parses unchanged.
|
|
93
96
|
*/
|
|
94
|
-
export const formPage = openapi.formPage
|
|
97
|
+
export const formPage = openapi.formPage.extend({
|
|
98
|
+
button_label: z.string().nullable().default(null),
|
|
99
|
+
});
|
|
95
100
|
export type FormPage = z.infer<typeof formPage>;
|
|
96
101
|
|
|
97
102
|
/** The `form` pages list (`format_payload.pages`), safeParsed as a whole by the preview. */
|
|
98
103
|
export const formPages = z.array(formPage);
|
|
99
104
|
export type FormPages = z.infer<typeof formPages>;
|
|
100
105
|
|
|
106
|
+
// The one catalogue of a send's platform-drawn texts (`format_payload.wording`): a
|
|
107
|
+
// question's or a notification's buttons, headings, input hints, message lines,
|
|
108
|
+
// answer-page sentences, refusal sentences, settled-card badges and screen-reader labels,
|
|
109
|
+
// grouped into six chapters. Every leaf is the sender's own words in the end-user's
|
|
110
|
+
// language; absent (or `null`), the surface shows its own generic word. Mirrors the
|
|
111
|
+
// skeleton's `Wording` model member-for-member. A renderer safeParses this off the loose
|
|
112
|
+
// `format_payload`, so a malformed shape falls back to the default words rather than
|
|
113
|
+
// crashing the card (the labels are chrome, never an answer). The Studio inbox draws only
|
|
114
|
+
// the subset of members it has a control for; the rest parse and are ignored.
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* One form field's platform-drawn words (`wording.form.fields[name]`): `choice_label` is
|
|
118
|
+
* the placeholder of the field's picker (its empty-state prompt).
|
|
119
|
+
*/
|
|
120
|
+
export const fieldWording = z.object({
|
|
121
|
+
choice_label: z.string().nullish(),
|
|
122
|
+
});
|
|
123
|
+
export type FieldWording = z.infer<typeof fieldWording>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A form's platform-drawn chrome (`wording.form`): `title` heads the form surface;
|
|
127
|
+
* `open`/`cancel` label the buttons that open and close it; `back` the button that returns
|
|
128
|
+
* to the previous step; `submit` the terminal button of a form with no pages;
|
|
129
|
+
* `review_empty` the review step's line before anything is filled; `fields` carries
|
|
130
|
+
* per-field words keyed by property name. The inbox draws the form inline, so it reads
|
|
131
|
+
* `back`, `submit` and `fields`; `title`/`open`/`cancel`/`review_empty` parse unused.
|
|
132
|
+
*/
|
|
133
|
+
export const formWording = z.object({
|
|
134
|
+
title: z.string().nullish(),
|
|
135
|
+
open: z.string().nullish(),
|
|
136
|
+
cancel: z.string().nullish(),
|
|
137
|
+
back: z.string().nullish(),
|
|
138
|
+
submit: z.string().nullish(),
|
|
139
|
+
review_empty: z.string().nullish(),
|
|
140
|
+
fields: z.record(z.string(), fieldWording).nullish(),
|
|
141
|
+
});
|
|
142
|
+
export type FormWording = z.infer<typeof formWording>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* A choice list's platform-drawn words (`wording.choice`): `label` is the word on the
|
|
146
|
+
* control that presents the list, `reply_hint` the line under a numbered-text list, and
|
|
147
|
+
* `group_label` the accessible name of a flat group of option buttons. The inbox reads
|
|
148
|
+
* `label` (the select field's label and picker placeholder); the rest parse unused.
|
|
149
|
+
*/
|
|
150
|
+
export const choiceWording = z.object({
|
|
151
|
+
label: z.string().nullish(),
|
|
152
|
+
reply_hint: z.string().nullish(),
|
|
153
|
+
group_label: z.string().nullish(),
|
|
154
|
+
});
|
|
155
|
+
export type ChoiceWording = z.infer<typeof choiceWording>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* A non-form question's answer controls and refusal sentences (`wording.answer`): `open`
|
|
159
|
+
* labels the control that opens a `confirm`/`external` question's answer page, `confirm`
|
|
160
|
+
* its affirmative control, `decline` its negative control, `submit` the button that sends a
|
|
161
|
+
* typed or picked answer, `reply_hint` the hint in an empty reply input. `rejected` /
|
|
162
|
+
* `rejected_final` are the sentences the end user reads when an answer is refused; the
|
|
163
|
+
* inbox draws neither (web-only). The inbox reads `open`, `confirm`, `decline`, `submit`
|
|
164
|
+
* and `reply_hint` where it draws the matching control.
|
|
165
|
+
*/
|
|
166
|
+
export const answerWording = z.object({
|
|
167
|
+
open: z.string().nullish(),
|
|
168
|
+
confirm: z.string().nullish(),
|
|
169
|
+
decline: z.string().nullish(),
|
|
170
|
+
submit: z.string().nullish(),
|
|
171
|
+
reply_hint: z.string().nullish(),
|
|
172
|
+
rejected: z.string().nullish(),
|
|
173
|
+
rejected_final: z.string().nullish(),
|
|
174
|
+
});
|
|
175
|
+
export type AnswerWording = z.infer<typeof answerWording>;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The lines of a delivery message (`wording.lines`): `answer_link` carries the tappable
|
|
179
|
+
* answer link, `deadline` names the deadline, `reply` tells the end user how to reply, and
|
|
180
|
+
* `options` lists the choices. Drawn by the chat channels; the inbox draws none of them.
|
|
181
|
+
*/
|
|
182
|
+
export const lineWording = z.object({
|
|
183
|
+
answer_link: z.string().nullish(),
|
|
184
|
+
deadline: z.string().nullish(),
|
|
185
|
+
reply: z.string().nullish(),
|
|
186
|
+
options: z.string().nullish(),
|
|
187
|
+
});
|
|
188
|
+
export type LineWording = z.infer<typeof lineWording>;
|
|
189
|
+
|
|
190
|
+
/** The heading and sentence of one platform-drawn answer page (`wording.answer_page.*`). */
|
|
191
|
+
export const pageCopy = z.object({
|
|
192
|
+
heading: z.string().nullish(),
|
|
193
|
+
text: z.string().nullish(),
|
|
194
|
+
});
|
|
195
|
+
export type PageCopy = z.infer<typeof pageCopy>;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* The form page's own sentences (`wording.answer_page.form`): `failed` when a send did not
|
|
199
|
+
* land, `network_error` when the browser could not reach the server, `update_failed` when a
|
|
200
|
+
* reacting form could not refresh, `choose_one` for an empty required multi-choice, and
|
|
201
|
+
* `date_unavailable` for a blocked date. Drawn by the callback form page; the inbox draws
|
|
202
|
+
* none of them.
|
|
203
|
+
*/
|
|
204
|
+
export const formPageWording = z.object({
|
|
205
|
+
failed: z.string().nullish(),
|
|
206
|
+
network_error: z.string().nullish(),
|
|
207
|
+
update_failed: z.string().nullish(),
|
|
208
|
+
choose_one: z.string().nullish(),
|
|
209
|
+
date_unavailable: z.string().nullish(),
|
|
210
|
+
});
|
|
211
|
+
export type FormPageWording = z.infer<typeof formPageWording>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The pages a question's link opens (`wording.answer_page`): `confirm` the confirm page's
|
|
215
|
+
* copy, `done` the already-answered page's, `awaiting` the reply-on-the-channel page's,
|
|
216
|
+
* `submitted` the form page's post-submit copy, and `form` the form page's own
|
|
217
|
+
* validation/error sentences. Drawn by the callback pages; the inbox draws none of them.
|
|
218
|
+
*/
|
|
219
|
+
export const answerPageWording = z.object({
|
|
220
|
+
confirm: pageCopy.nullish(),
|
|
221
|
+
done: pageCopy.nullish(),
|
|
222
|
+
awaiting: pageCopy.nullish(),
|
|
223
|
+
submitted: pageCopy.nullish(),
|
|
224
|
+
form: formPageWording.nullish(),
|
|
225
|
+
});
|
|
226
|
+
export type AnswerPageWording = z.infer<typeof answerPageWording>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* A live question card's countdown words (`wording.status.countdown`): `seconds_left` the
|
|
230
|
+
* visible plural line, `one_second_left` the visible singular, and `under_minute` /
|
|
231
|
+
* `under_half_minute` / `under_ten_seconds` the spoken lines at the three thresholds. Drawn
|
|
232
|
+
* by the web widget; the inbox draws no countdown.
|
|
233
|
+
*/
|
|
234
|
+
export const countdownWording = z.object({
|
|
235
|
+
seconds_left: z.string().nullish(),
|
|
236
|
+
one_second_left: z.string().nullish(),
|
|
237
|
+
under_minute: z.string().nullish(),
|
|
238
|
+
under_half_minute: z.string().nullish(),
|
|
239
|
+
under_ten_seconds: z.string().nullish(),
|
|
240
|
+
});
|
|
241
|
+
export type CountdownWording = z.infer<typeof countdownWording>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* In-flight and settled status copy (`wording.status`): `sending` the screen-reader label
|
|
245
|
+
* while a send is in flight, `answered` / `expired` / `closed` the badges once a question
|
|
246
|
+
* settles, `sent` the badge after an ask-less form is submitted, `unavailable` the line
|
|
247
|
+
* when a form's door no longer resolves, and `countdown` the live-countdown words. Drawn by
|
|
248
|
+
* the web widget; the inbox draws none of them.
|
|
249
|
+
*/
|
|
250
|
+
export const statusWording = z.object({
|
|
251
|
+
sending: z.string().nullish(),
|
|
252
|
+
answered: z.string().nullish(),
|
|
253
|
+
expired: z.string().nullish(),
|
|
254
|
+
closed: z.string().nullish(),
|
|
255
|
+
sent: z.string().nullish(),
|
|
256
|
+
unavailable: z.string().nullish(),
|
|
257
|
+
countdown: countdownWording.nullish(),
|
|
258
|
+
});
|
|
259
|
+
export type StatusWording = z.infer<typeof statusWording>;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* The one catalogue of a send's platform-drawn texts (`format_payload.wording`), grouped
|
|
263
|
+
* by what each word decorates: the form (`form`), the choice list (`choice`), a question's
|
|
264
|
+
* answer controls and refusal sentences (`answer`), the lines of the delivery message
|
|
265
|
+
* (`lines`), the pages a question's link opens (`answer_page`), and in-flight and settled
|
|
266
|
+
* status (`status`). A page's primary button is the one text not here — it is on the page
|
|
267
|
+
* (`pages[].button_label`). Every leaf is the sender's own words in the end-user's
|
|
268
|
+
* language; absent (or `null`), the surface shows its own word.
|
|
269
|
+
*/
|
|
270
|
+
export const wording = z.object({
|
|
271
|
+
form: formWording.nullish(),
|
|
272
|
+
choice: choiceWording.nullish(),
|
|
273
|
+
answer: answerWording.nullish(),
|
|
274
|
+
lines: lineWording.nullish(),
|
|
275
|
+
answer_page: answerPageWording.nullish(),
|
|
276
|
+
status: statusWording.nullish(),
|
|
277
|
+
});
|
|
278
|
+
export type Wording = z.infer<typeof wording>;
|
|
279
|
+
|
|
101
280
|
// The form reactions and the form update are hand-written: the spec carries them inside an
|
|
102
281
|
// open `format_payload` and an open reaction `update`.
|
|
103
282
|
|