@stapel/forms-react 0.1.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.
Files changed (203) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/MODULE.md +172 -0
  3. package/README.md +207 -0
  4. package/dist/api/export.d.ts +66 -0
  5. package/dist/api/export.d.ts.map +1 -0
  6. package/dist/api/export.js +138 -0
  7. package/dist/api/export.js.map +1 -0
  8. package/dist/api/extensions.d.ts +8 -0
  9. package/dist/api/extensions.d.ts.map +1 -0
  10. package/dist/api/extensions.js +8 -0
  11. package/dist/api/extensions.js.map +1 -0
  12. package/dist/api/formsApi.d.ts +113 -0
  13. package/dist/api/formsApi.d.ts.map +1 -0
  14. package/dist/api/formsApi.js +81 -0
  15. package/dist/api/formsApi.js.map +1 -0
  16. package/dist/api/generated/schema.d.ts +987 -0
  17. package/dist/api/generated/schema.d.ts.map +1 -0
  18. package/dist/api/generated/schema.js +2 -0
  19. package/dist/api/generated/schema.js.map +1 -0
  20. package/dist/api/types.d.ts +222 -0
  21. package/dist/api/types.d.ts.map +1 -0
  22. package/dist/api/types.js +14 -0
  23. package/dist/api/types.js.map +1 -0
  24. package/dist/default/ConfigField.d.ts +32 -0
  25. package/dist/default/ConfigField.d.ts.map +1 -0
  26. package/dist/default/ConfigField.js +101 -0
  27. package/dist/default/ConfigField.js.map +1 -0
  28. package/dist/default/ErrorAlert.d.ts +9 -0
  29. package/dist/default/ErrorAlert.d.ts.map +1 -0
  30. package/dist/default/ErrorAlert.js +27 -0
  31. package/dist/default/ErrorAlert.js.map +1 -0
  32. package/dist/default/FormBuilderPane.d.ts +36 -0
  33. package/dist/default/FormBuilderPane.d.ts.map +1 -0
  34. package/dist/default/FormBuilderPane.js +70 -0
  35. package/dist/default/FormBuilderPane.js.map +1 -0
  36. package/dist/default/FormsListPane.d.ts +18 -0
  37. package/dist/default/FormsListPane.d.ts.map +1 -0
  38. package/dist/default/FormsListPane.js +28 -0
  39. package/dist/default/FormsListPane.js.map +1 -0
  40. package/dist/default/ResponsesPane.d.ts +21 -0
  41. package/dist/default/ResponsesPane.d.ts.map +1 -0
  42. package/dist/default/ResponsesPane.js +118 -0
  43. package/dist/default/ResponsesPane.js.map +1 -0
  44. package/dist/default/StapelForm.d.ts +76 -0
  45. package/dist/default/StapelForm.d.ts.map +1 -0
  46. package/dist/default/StapelForm.js +118 -0
  47. package/dist/default/StapelForm.js.map +1 -0
  48. package/dist/default/fields.d.ts +11 -0
  49. package/dist/default/fields.d.ts.map +1 -0
  50. package/dist/default/fields.js +273 -0
  51. package/dist/default/fields.js.map +1 -0
  52. package/dist/default/index.d.ts +42 -0
  53. package/dist/default/index.d.ts.map +1 -0
  54. package/dist/default/index.js +37 -0
  55. package/dist/default/index.js.map +1 -0
  56. package/dist/default/slots.d.ts +59 -0
  57. package/dist/default/slots.d.ts.map +1 -0
  58. package/dist/default/slots.js +25 -0
  59. package/dist/default/slots.js.map +1 -0
  60. package/dist/default/theme.d.ts +23 -0
  61. package/dist/default/theme.d.ts.map +1 -0
  62. package/dist/default/theme.js +38 -0
  63. package/dist/default/theme.js.map +1 -0
  64. package/dist/default/types.d.ts +12 -0
  65. package/dist/default/types.d.ts.map +1 -0
  66. package/dist/default/types.js +2 -0
  67. package/dist/default/types.js.map +1 -0
  68. package/dist/flows/errors.d.ts +12 -0
  69. package/dist/flows/errors.d.ts.map +1 -0
  70. package/dist/flows/errors.js +13 -0
  71. package/dist/flows/errors.js.map +1 -0
  72. package/dist/flows/registry.d.ts +22 -0
  73. package/dist/flows/registry.d.ts.map +1 -0
  74. package/dist/flows/registry.js +20 -0
  75. package/dist/flows/registry.js.map +1 -0
  76. package/dist/headless/FormBuilder.d.ts +100 -0
  77. package/dist/headless/FormBuilder.d.ts.map +1 -0
  78. package/dist/headless/FormBuilder.js +278 -0
  79. package/dist/headless/FormBuilder.js.map +1 -0
  80. package/dist/headless/FormFill.d.ts +88 -0
  81. package/dist/headless/FormFill.d.ts.map +1 -0
  82. package/dist/headless/FormFill.js +279 -0
  83. package/dist/headless/FormFill.js.map +1 -0
  84. package/dist/headless/FormList.d.ts +34 -0
  85. package/dist/headless/FormList.d.ts.map +1 -0
  86. package/dist/headless/FormList.js +37 -0
  87. package/dist/headless/FormList.js.map +1 -0
  88. package/dist/headless/FormsProvider.d.ts +19 -0
  89. package/dist/headless/FormsProvider.d.ts.map +1 -0
  90. package/dist/headless/FormsProvider.js +15 -0
  91. package/dist/headless/FormsProvider.js.map +1 -0
  92. package/dist/headless/ResponsesTable.d.ts +82 -0
  93. package/dist/headless/ResponsesTable.d.ts.map +1 -0
  94. package/dist/headless/ResponsesTable.js +195 -0
  95. package/dist/headless/ResponsesTable.js.map +1 -0
  96. package/dist/i18n/errorsMap.d.ts +10 -0
  97. package/dist/i18n/errorsMap.d.ts.map +1 -0
  98. package/dist/i18n/errorsMap.js +20 -0
  99. package/dist/i18n/errorsMap.js.map +1 -0
  100. package/dist/i18n/es.d.ts +7 -0
  101. package/dist/i18n/es.d.ts.map +1 -0
  102. package/dist/i18n/es.js +118 -0
  103. package/dist/i18n/es.js.map +1 -0
  104. package/dist/i18n/generated/errors.es.gen.d.ts +16 -0
  105. package/dist/i18n/generated/errors.es.gen.d.ts.map +1 -0
  106. package/dist/i18n/generated/errors.es.gen.js +79 -0
  107. package/dist/i18n/generated/errors.es.gen.js.map +1 -0
  108. package/dist/i18n/generated/errors.gen.d.ts +485 -0
  109. package/dist/i18n/generated/errors.gen.d.ts.map +1 -0
  110. package/dist/i18n/generated/errors.gen.js +246 -0
  111. package/dist/i18n/generated/errors.gen.js.map +1 -0
  112. package/dist/i18n/generated/errors.ru.gen.d.ts +16 -0
  113. package/dist/i18n/generated/errors.ru.gen.d.ts.map +1 -0
  114. package/dist/i18n/generated/errors.ru.gen.js +79 -0
  115. package/dist/i18n/generated/errors.ru.gen.js.map +1 -0
  116. package/dist/i18n/keys.d.ts +141 -0
  117. package/dist/i18n/keys.d.ts.map +1 -0
  118. package/dist/i18n/keys.js +233 -0
  119. package/dist/i18n/keys.js.map +1 -0
  120. package/dist/i18n/ru.d.ts +7 -0
  121. package/dist/i18n/ru.d.ts.map +1 -0
  122. package/dist/i18n/ru.js +127 -0
  123. package/dist/i18n/ru.js.map +1 -0
  124. package/dist/index.d.ts +61 -0
  125. package/dist/index.d.ts.map +1 -0
  126. package/dist/index.js +55 -0
  127. package/dist/index.js.map +1 -0
  128. package/dist/model/context.d.ts +11 -0
  129. package/dist/model/context.d.ts.map +1 -0
  130. package/dist/model/context.js +16 -0
  131. package/dist/model/context.js.map +1 -0
  132. package/dist/model/mutations.d.ts +135 -0
  133. package/dist/model/mutations.d.ts.map +1 -0
  134. package/dist/model/mutations.js +223 -0
  135. package/dist/model/mutations.js.map +1 -0
  136. package/dist/model/queries.d.ts +59 -0
  137. package/dist/model/queries.d.ts.map +1 -0
  138. package/dist/model/queries.js +117 -0
  139. package/dist/model/queries.js.map +1 -0
  140. package/dist/model/queryKeys.d.ts +28 -0
  141. package/dist/model/queryKeys.d.ts.map +1 -0
  142. package/dist/model/queryKeys.js +23 -0
  143. package/dist/model/queryKeys.js.map +1 -0
  144. package/dist/model/runtime.d.ts +28 -0
  145. package/dist/model/runtime.d.ts.map +1 -0
  146. package/dist/model/runtime.js +14 -0
  147. package/dist/model/runtime.js.map +1 -0
  148. package/dist/widgets/configForms.d.ts +112 -0
  149. package/dist/widgets/configForms.d.ts.map +1 -0
  150. package/dist/widgets/configForms.js +211 -0
  151. package/dist/widgets/configForms.js.map +1 -0
  152. package/dist/widgets/registry.d.ts +83 -0
  153. package/dist/widgets/registry.d.ts.map +1 -0
  154. package/dist/widgets/registry.js +27 -0
  155. package/dist/widgets/registry.js.map +1 -0
  156. package/dist/widgets/validate.d.ts +57 -0
  157. package/dist/widgets/validate.d.ts.map +1 -0
  158. package/dist/widgets/validate.js +173 -0
  159. package/dist/widgets/validate.js.map +1 -0
  160. package/llms.txt +124 -0
  161. package/manifest.json +1038 -0
  162. package/package.json +108 -0
  163. package/src/analytics/generated/events.json +7 -0
  164. package/src/api/export.ts +195 -0
  165. package/src/api/extensions.ts +7 -0
  166. package/src/api/formsApi.ts +329 -0
  167. package/src/api/generated/schema.ts +989 -0
  168. package/src/api/types.ts +276 -0
  169. package/src/default/ConfigField.tsx +227 -0
  170. package/src/default/ErrorAlert.tsx +46 -0
  171. package/src/default/FormBuilderPane.tsx +414 -0
  172. package/src/default/FormsListPane.tsx +144 -0
  173. package/src/default/ResponsesPane.tsx +332 -0
  174. package/src/default/StapelForm.tsx +377 -0
  175. package/src/default/fields.tsx +454 -0
  176. package/src/default/index.ts +71 -0
  177. package/src/default/slots.ts +78 -0
  178. package/src/default/theme.tsx +65 -0
  179. package/src/default/types.ts +12 -0
  180. package/src/flows/errors.ts +16 -0
  181. package/src/flows/registry.ts +32 -0
  182. package/src/headless/FormBuilder.tsx +453 -0
  183. package/src/headless/FormFill.tsx +396 -0
  184. package/src/headless/FormList.tsx +74 -0
  185. package/src/headless/FormsProvider.tsx +20 -0
  186. package/src/headless/ResponsesTable.tsx +341 -0
  187. package/src/i18n/errorsMap.ts +31 -0
  188. package/src/i18n/es.ts +140 -0
  189. package/src/i18n/generated/errors.es.gen.ts +85 -0
  190. package/src/i18n/generated/errors.gen.ts +277 -0
  191. package/src/i18n/generated/errors.json +583 -0
  192. package/src/i18n/generated/errors.ru.gen.ts +85 -0
  193. package/src/i18n/keys.ts +264 -0
  194. package/src/i18n/ru.ts +150 -0
  195. package/src/index.ts +184 -0
  196. package/src/model/context.tsx +28 -0
  197. package/src/model/mutations.ts +387 -0
  198. package/src/model/queries.ts +154 -0
  199. package/src/model/queryKeys.ts +61 -0
  200. package/src/model/runtime.ts +48 -0
  201. package/src/widgets/registry.ts +101 -0
  202. package/src/widgets/validate.ts +224 -0
  203. package/tsconfig.json +26 -0
@@ -0,0 +1,485 @@
1
+ /**
2
+ * Remediation vocabulary (frontend-core-architecture §2.5). Declared by the
3
+ * backend on the error registry and consumed verbatim from its `errors.json`
4
+ * artifact. A host maps it to UX — retryable → "try again"; `wait_and_retry` →
5
+ * timer from `params.retry_after_minutes`; `verify` → the step-up seam;
6
+ * `fix_input` → highlight the offending field.
7
+ */
8
+ export type Remediation = "retry" | "wait_and_retry" | "reauthenticate" | "verify" | "fix_input" | "contact_support" | "bug";
9
+ export interface FormsErrorSpec {
10
+ /** HTTP status the backend raises this key with. */
11
+ readonly status: number;
12
+ /** `{param}` interpolation slots present in the message. */
13
+ readonly params: readonly string[];
14
+ /** Remediation hint declared by the backend (see {@link Remediation}). */
15
+ readonly remediation: Remediation;
16
+ /** English fallback (source: stapel-auth errors.json). */
17
+ readonly en: string;
18
+ }
19
+ /**
20
+ * The FORMS_ERRORS map — every `error.*` key stapel-auth can raise, keyed by its
21
+ * canonical code. The single source of truth behind the en fallback bundle, the
22
+ * remediation lookup, and the manifest `errors` block.
23
+ */
24
+ export declare const FORMS_ERRORS: {
25
+ readonly "error.400.bad_request": {
26
+ readonly status: 400;
27
+ readonly params: readonly [];
28
+ readonly remediation: "fix_input";
29
+ readonly en: "Bad request";
30
+ };
31
+ readonly "error.400.captcha_invalid": {
32
+ readonly status: 400;
33
+ readonly params: readonly [];
34
+ readonly remediation: "retry";
35
+ readonly en: "Captcha verification failed. Please try again.";
36
+ };
37
+ readonly "error.400.captcha_required": {
38
+ readonly status: 400;
39
+ readonly params: readonly [];
40
+ readonly remediation: "retry";
41
+ readonly en: "Captcha token is required.";
42
+ };
43
+ readonly "error.400.description_too_long": {
44
+ readonly status: 400;
45
+ readonly params: readonly ["max_length"];
46
+ readonly remediation: "fix_input";
47
+ readonly en: "Description must be at most {max_length} characters";
48
+ };
49
+ readonly "error.400.description_too_short": {
50
+ readonly status: 400;
51
+ readonly params: readonly ["min_length"];
52
+ readonly remediation: "fix_input";
53
+ readonly en: "Description must be at least {min_length} characters";
54
+ };
55
+ readonly "error.400.expected_list": {
56
+ readonly status: 400;
57
+ readonly params: readonly [];
58
+ readonly remediation: "fix_input";
59
+ readonly en: "Expected a list of items";
60
+ };
61
+ readonly "error.400.feature_above_maximum": {
62
+ readonly status: 400;
63
+ readonly params: readonly ["feature"];
64
+ readonly remediation: "fix_input";
65
+ readonly en: "Value is above maximum for {feature}";
66
+ };
67
+ readonly "error.400.feature_below_minimum": {
68
+ readonly status: 400;
69
+ readonly params: readonly ["feature"];
70
+ readonly remediation: "fix_input";
71
+ readonly en: "Value is below minimum for {feature}";
72
+ };
73
+ readonly "error.400.feature_invalid_config": {
74
+ readonly status: 400;
75
+ readonly params: readonly ["feature"];
76
+ readonly remediation: "fix_input";
77
+ readonly en: "Invalid config for {feature}";
78
+ };
79
+ readonly "error.400.feature_invalid_format": {
80
+ readonly status: 400;
81
+ readonly params: readonly ["feature"];
82
+ readonly remediation: "fix_input";
83
+ readonly en: "Invalid format for {feature}";
84
+ };
85
+ readonly "error.400.feature_invalid_type": {
86
+ readonly status: 400;
87
+ readonly params: readonly ["feature"];
88
+ readonly remediation: "fix_input";
89
+ readonly en: "Invalid type for {feature}";
90
+ };
91
+ readonly "error.400.feature_mandatory_missing": {
92
+ readonly status: 400;
93
+ readonly params: readonly ["feature"];
94
+ readonly remediation: "fix_input";
95
+ readonly en: "Mandatory feature {feature} is required";
96
+ };
97
+ readonly "error.400.feature_not_allowed": {
98
+ readonly status: 400;
99
+ readonly params: readonly ["feature"];
100
+ readonly remediation: "fix_input";
101
+ readonly en: "Feature {feature} is not allowed here";
102
+ };
103
+ readonly "error.400.feature_not_in_options": {
104
+ readonly status: 400;
105
+ readonly params: readonly ["feature"];
106
+ readonly remediation: "fix_input";
107
+ readonly en: "Value is not in allowed options for {feature}";
108
+ };
109
+ readonly "error.400.feature_unknown": {
110
+ readonly status: 400;
111
+ readonly params: readonly ["feature"];
112
+ readonly remediation: "fix_input";
113
+ readonly en: "Unknown feature {feature}";
114
+ };
115
+ readonly "error.400.feature_unknown_type": {
116
+ readonly status: 400;
117
+ readonly params: readonly ["feature"];
118
+ readonly remediation: "fix_input";
119
+ readonly en: "Unknown feature type for {feature}";
120
+ };
121
+ readonly "error.400.field.blank": {
122
+ readonly status: 400;
123
+ readonly params: readonly ["field"];
124
+ readonly remediation: "fix_input";
125
+ readonly en: "{field} may not be blank";
126
+ };
127
+ readonly "error.400.field.does_not_exist": {
128
+ readonly status: 400;
129
+ readonly params: readonly ["field"];
130
+ readonly remediation: "fix_input";
131
+ readonly en: "{field} does not exist";
132
+ };
133
+ readonly "error.400.field.invalid": {
134
+ readonly status: 400;
135
+ readonly params: readonly ["field"];
136
+ readonly remediation: "fix_input";
137
+ readonly en: "{field} is invalid";
138
+ };
139
+ readonly "error.400.field.invalid_choice": {
140
+ readonly status: 400;
141
+ readonly params: readonly ["field"];
142
+ readonly remediation: "fix_input";
143
+ readonly en: "{field} is not a valid choice";
144
+ };
145
+ readonly "error.400.field.max_length": {
146
+ readonly status: 400;
147
+ readonly params: readonly ["field", "max_length"];
148
+ readonly remediation: "fix_input";
149
+ readonly en: "{field} must be at most {max_length} characters";
150
+ };
151
+ readonly "error.400.field.max_value": {
152
+ readonly status: 400;
153
+ readonly params: readonly ["field", "max_value"];
154
+ readonly remediation: "fix_input";
155
+ readonly en: "{field} must be at most {max_value}";
156
+ };
157
+ readonly "error.400.field.min_length": {
158
+ readonly status: 400;
159
+ readonly params: readonly ["field", "min_length"];
160
+ readonly remediation: "fix_input";
161
+ readonly en: "{field} must be at least {min_length} characters";
162
+ };
163
+ readonly "error.400.field.min_value": {
164
+ readonly status: 400;
165
+ readonly params: readonly ["field", "min_value"];
166
+ readonly remediation: "fix_input";
167
+ readonly en: "{field} must be at least {min_value}";
168
+ };
169
+ readonly "error.400.field.null": {
170
+ readonly status: 400;
171
+ readonly params: readonly ["field"];
172
+ readonly remediation: "fix_input";
173
+ readonly en: "{field} may not be null";
174
+ };
175
+ readonly "error.400.field.required": {
176
+ readonly status: 400;
177
+ readonly params: readonly ["field"];
178
+ readonly remediation: "fix_input";
179
+ readonly en: "{field} is required";
180
+ };
181
+ readonly "error.400.field.unique": {
182
+ readonly status: 400;
183
+ readonly params: readonly ["field"];
184
+ readonly remediation: "fix_input";
185
+ readonly en: "{field} must be unique";
186
+ };
187
+ readonly "error.400.forms_answers_not_object": {
188
+ readonly status: 400;
189
+ readonly params: readonly [];
190
+ readonly remediation: "fix_input";
191
+ readonly en: "Answers must be an object keyed by field slug";
192
+ };
193
+ readonly "error.400.forms_duplicate_slug": {
194
+ readonly status: 400;
195
+ readonly params: readonly ["slug"];
196
+ readonly remediation: "fix_input";
197
+ readonly en: "Field slug {slug} appears more than once";
198
+ };
199
+ readonly "error.400.forms_empty_schema": {
200
+ readonly status: 400;
201
+ readonly params: readonly [];
202
+ readonly remediation: "fix_input";
203
+ readonly en: "A form must have at least one field to publish";
204
+ };
205
+ readonly "error.400.forms_invalid_retention": {
206
+ readonly status: 400;
207
+ readonly params: readonly [];
208
+ readonly remediation: "fix_input";
209
+ readonly en: "The retention override may only shorten the module retention period";
210
+ };
211
+ readonly "error.400.forms_invalid_schema": {
212
+ readonly status: 400;
213
+ readonly params: readonly [];
214
+ readonly remediation: "fix_input";
215
+ readonly en: "The form schema is not valid";
216
+ };
217
+ readonly "error.400.forms_invalid_state": {
218
+ readonly status: 400;
219
+ readonly params: readonly [];
220
+ readonly remediation: "fix_input";
221
+ readonly en: "Unknown form state";
222
+ };
223
+ readonly "error.400.forms_kind_not_allowed": {
224
+ readonly status: 400;
225
+ readonly params: readonly ["kind"];
226
+ readonly remediation: "fix_input";
227
+ readonly en: "Field kind {kind} may not be used in a form";
228
+ };
229
+ readonly "error.400.forms_no_draft": {
230
+ readonly status: 400;
231
+ readonly params: readonly [];
232
+ readonly remediation: "fix_input";
233
+ readonly en: "There is no draft to publish";
234
+ };
235
+ readonly "error.400.forms_no_recipients": {
236
+ readonly status: 400;
237
+ readonly params: readonly [];
238
+ readonly remediation: "fix_input";
239
+ readonly en: "No notification recipient is configured for this form";
240
+ };
241
+ readonly "error.400.forms_not_published": {
242
+ readonly status: 400;
243
+ readonly params: readonly [];
244
+ readonly remediation: "fix_input";
245
+ readonly en: "The form has no published version yet";
246
+ };
247
+ readonly "error.400.forms_too_many_fields": {
248
+ readonly status: 400;
249
+ readonly params: readonly [];
250
+ readonly remediation: "fix_input";
251
+ readonly en: "The form has more fields than the limit allows";
252
+ };
253
+ readonly "error.400.forms_too_many_open": {
254
+ readonly status: 400;
255
+ readonly params: readonly [];
256
+ readonly remediation: "contact_support";
257
+ readonly en: "This workspace already has the maximum number of open forms";
258
+ };
259
+ readonly "error.400.forms_unknown_field": {
260
+ readonly status: 400;
261
+ readonly params: readonly [];
262
+ readonly remediation: "fix_input";
263
+ readonly en: "The submission answers a field the form does not have";
264
+ };
265
+ readonly "error.400.invalid_ad_id": {
266
+ readonly status: 400;
267
+ readonly params: readonly [];
268
+ readonly remediation: "fix_input";
269
+ readonly en: "Invalid advertisement ID";
270
+ };
271
+ readonly "error.400.validation_error": {
272
+ readonly status: 400;
273
+ readonly params: readonly [];
274
+ readonly remediation: "fix_input";
275
+ readonly en: "Validation error";
276
+ };
277
+ readonly "error.400.verification_failed": {
278
+ readonly status: 400;
279
+ readonly params: readonly [];
280
+ readonly remediation: "verify";
281
+ readonly en: "Verification failed";
282
+ };
283
+ readonly "error.400.verification_invalid_factor": {
284
+ readonly status: 400;
285
+ readonly params: readonly [];
286
+ readonly remediation: "verify";
287
+ readonly en: "This verification factor is not available";
288
+ };
289
+ readonly "error.401.unauthorized": {
290
+ readonly status: 401;
291
+ readonly params: readonly [];
292
+ readonly remediation: "reauthenticate";
293
+ readonly en: "Authentication required";
294
+ };
295
+ readonly "error.402.payment_required": {
296
+ readonly status: 402;
297
+ readonly params: readonly [];
298
+ readonly remediation: "retry";
299
+ readonly en: "Payment required";
300
+ };
301
+ readonly "error.403.forbidden": {
302
+ readonly status: 403;
303
+ readonly params: readonly [];
304
+ readonly remediation: "retry";
305
+ readonly en: "You do not have permission to perform this action";
306
+ };
307
+ readonly "error.403.forms_forbidden": {
308
+ readonly status: 403;
309
+ readonly params: readonly [];
310
+ readonly remediation: "contact_support";
311
+ readonly en: "You do not have access to this form";
312
+ };
313
+ readonly "error.403.network_blocked": {
314
+ readonly status: 403;
315
+ readonly params: readonly [];
316
+ readonly remediation: "contact_support";
317
+ readonly en: "Requests from this network are not allowed";
318
+ };
319
+ readonly "error.403.verification_enrollment_required": {
320
+ readonly status: 403;
321
+ readonly params: readonly [];
322
+ readonly remediation: "verify";
323
+ readonly en: "Verification factor enrollment required";
324
+ };
325
+ readonly "error.403.verification_required": {
326
+ readonly status: 403;
327
+ readonly params: readonly [];
328
+ readonly remediation: "verify";
329
+ readonly en: "Additional verification required";
330
+ };
331
+ readonly "error.404.ad_not_found": {
332
+ readonly status: 404;
333
+ readonly params: readonly [];
334
+ readonly remediation: "retry";
335
+ readonly en: "Listing not found";
336
+ };
337
+ readonly "error.404.forms_not_found": {
338
+ readonly status: 404;
339
+ readonly params: readonly [];
340
+ readonly remediation: "verify";
341
+ readonly en: "Form not found";
342
+ };
343
+ readonly "error.404.forms_submission_not_found": {
344
+ readonly status: 404;
345
+ readonly params: readonly [];
346
+ readonly remediation: "verify";
347
+ readonly en: "Submission not found";
348
+ };
349
+ readonly "error.404.not_found": {
350
+ readonly status: 404;
351
+ readonly params: readonly [];
352
+ readonly remediation: "retry";
353
+ readonly en: "Requested resource not found";
354
+ };
355
+ readonly "error.404.verification_challenge_not_found": {
356
+ readonly status: 404;
357
+ readonly params: readonly [];
358
+ readonly remediation: "verify";
359
+ readonly en: "Verification challenge not found or expired";
360
+ };
361
+ readonly "error.405.method_not_allowed": {
362
+ readonly status: 405;
363
+ readonly params: readonly [];
364
+ readonly remediation: "retry";
365
+ readonly en: "Method not allowed";
366
+ };
367
+ readonly "error.406.not_acceptable": {
368
+ readonly status: 406;
369
+ readonly params: readonly [];
370
+ readonly remediation: "retry";
371
+ readonly en: "Not acceptable";
372
+ };
373
+ readonly "error.408.request_timeout": {
374
+ readonly status: 408;
375
+ readonly params: readonly [];
376
+ readonly remediation: "retry";
377
+ readonly en: "Request timeout";
378
+ };
379
+ readonly "error.409.conflict": {
380
+ readonly status: 409;
381
+ readonly params: readonly [];
382
+ readonly remediation: "fix_input";
383
+ readonly en: "Resource already exists";
384
+ };
385
+ readonly "error.409.forms_submission_cap": {
386
+ readonly status: 409;
387
+ readonly params: readonly [];
388
+ readonly remediation: "contact_support";
389
+ readonly en: "This form has reached its submission limit";
390
+ };
391
+ readonly "error.409.forms_version_superseded": {
392
+ readonly status: 409;
393
+ readonly params: readonly [];
394
+ readonly remediation: "retry";
395
+ readonly en: "The form changed while you were filling it in";
396
+ };
397
+ readonly "error.410.forms_closed": {
398
+ readonly status: 410;
399
+ readonly params: readonly [];
400
+ readonly remediation: "contact_support";
401
+ readonly en: "This form is closed";
402
+ };
403
+ readonly "error.410.gone": {
404
+ readonly status: 410;
405
+ readonly params: readonly [];
406
+ readonly remediation: "retry";
407
+ readonly en: "Resource has been permanently removed";
408
+ };
409
+ readonly "error.413.forms_body_too_large": {
410
+ readonly status: 413;
411
+ readonly params: readonly [];
412
+ readonly remediation: "fix_input";
413
+ readonly en: "The submission exceeds the size limit";
414
+ };
415
+ readonly "error.413.payload_too_large": {
416
+ readonly status: 413;
417
+ readonly params: readonly [];
418
+ readonly remediation: "retry";
419
+ readonly en: "Request body is too large";
420
+ };
421
+ readonly "error.415.unsupported_media_type": {
422
+ readonly status: 415;
423
+ readonly params: readonly [];
424
+ readonly remediation: "retry";
425
+ readonly en: "Unsupported media type";
426
+ };
427
+ readonly "error.422.unprocessable_entity": {
428
+ readonly status: 422;
429
+ readonly params: readonly [];
430
+ readonly remediation: "wait_and_retry";
431
+ readonly en: "Unprocessable entity";
432
+ };
433
+ readonly "error.423.locked": {
434
+ readonly status: 423;
435
+ readonly params: readonly [];
436
+ readonly remediation: "wait_and_retry";
437
+ readonly en: "Resource is locked";
438
+ };
439
+ readonly "error.423.verification_locked": {
440
+ readonly status: 423;
441
+ readonly params: readonly [];
442
+ readonly remediation: "wait_and_retry";
443
+ readonly en: "Too many failed attempts — verification locked";
444
+ };
445
+ readonly "error.429.rate_limit": {
446
+ readonly status: 429;
447
+ readonly params: readonly ["retry_after_minutes"];
448
+ readonly remediation: "wait_and_retry";
449
+ readonly en: "Too many attempts. Try again in {retry_after_minutes} minutes.";
450
+ };
451
+ readonly "error.429.too_many_requests": {
452
+ readonly status: 429;
453
+ readonly params: readonly [];
454
+ readonly remediation: "wait_and_retry";
455
+ readonly en: "Too many requests. Please try again later.";
456
+ };
457
+ readonly "error.500.internal": {
458
+ readonly status: 500;
459
+ readonly params: readonly [];
460
+ readonly remediation: "contact_support";
461
+ readonly en: "Something went wrong";
462
+ };
463
+ readonly "error.503.forms_workspaces_unavailable": {
464
+ readonly status: 503;
465
+ readonly params: readonly [];
466
+ readonly remediation: "wait_and_retry";
467
+ readonly en: "Workspace membership service is unavailable";
468
+ };
469
+ readonly "error.503.mandate_unavailable": {
470
+ readonly status: 503;
471
+ readonly params: readonly [];
472
+ readonly remediation: "retry";
473
+ readonly en: "Cannot verify workspace mandate right now";
474
+ };
475
+ };
476
+ export type FormsErrorCode = keyof typeof FORMS_ERRORS;
477
+ /** Every backend error code this module can surface, sorted. */
478
+ export declare const FORMS_ERROR_CODES: readonly FormsErrorCode[];
479
+ /**
480
+ * English fallback bundle — one string per backend key, so a `StapelApiError.code`
481
+ * never renders as a raw key. Merged UNDER the hand-polished UI copy in
482
+ * {@link authI18nBundleEn} (polish wins; this guarantees coverage).
483
+ */
484
+ export declare const formsErrorBundleEn: Record<FormsErrorCode, string>;
485
+ //# sourceMappingURL=errors.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.gen.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated/errors.gen.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,gBAAgB,GAChB,gBAAgB,GAChB,QAAQ,GACR,WAAW,GACX,iBAAiB,GACjB,KAAK,CAAC;AAEV,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Ef,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,YAAY,CAAC;AAEvD,gEAAgE;AAChE,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EA4EtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CA4E7D,CAAC"}