@btst/plugin-form-builder 1.0.0-beta.0 → 1.2.0-beta.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.
Files changed (84) hide show
  1. package/dist/api/index.cjs +1 -0
  2. package/dist/api/index.d.cts +1 -1
  3. package/dist/api/index.d.mts +1 -1
  4. package/dist/api/index.d.ts +1 -1
  5. package/dist/api/index.mjs +1 -1
  6. package/dist/api/operations.cjs +64 -4
  7. package/dist/api/operations.mjs +64 -5
  8. package/dist/api/plugin.cjs +8 -0
  9. package/dist/api/plugin.mjs +8 -0
  10. package/dist/api/submissions-csv.cjs +69 -0
  11. package/dist/api/submissions-csv.mjs +64 -0
  12. package/dist/client/components/forms/form-renderer.cjs +31 -2
  13. package/dist/client/components/forms/form-renderer.mjs +31 -2
  14. package/dist/client/components/forms/media-file-field.cjs +48 -0
  15. package/dist/client/components/forms/media-file-field.mjs +46 -0
  16. package/dist/client/components/index.d.cts +4 -2
  17. package/dist/client/components/index.d.mts +4 -2
  18. package/dist/client/components/index.d.ts +4 -2
  19. package/dist/client/components/pages/ai-schema.cjs +120 -0
  20. package/dist/client/components/pages/ai-schema.mjs +118 -0
  21. package/dist/client/components/pages/form-builder-page.internal.cjs +40 -1
  22. package/dist/client/components/pages/form-builder-page.internal.mjs +41 -2
  23. package/dist/client/components/pages/form-list-page.internal.cjs +1 -0
  24. package/dist/client/components/pages/form-list-page.internal.mjs +1 -0
  25. package/dist/client/components/pages/submissions-page.internal.cjs +40 -0
  26. package/dist/client/components/pages/submissions-page.internal.mjs +41 -1
  27. package/dist/client/components/shared/pagination.cjs +19 -0
  28. package/dist/client/components/shared/pagination.mjs +20 -1
  29. package/dist/client/hooks/form-builder-hooks.cjs +4 -0
  30. package/dist/client/hooks/form-builder-hooks.mjs +4 -1
  31. package/dist/client/hooks/index.cjs +1 -0
  32. package/dist/client/hooks/index.d.cts +7 -2
  33. package/dist/client/hooks/index.d.mts +7 -2
  34. package/dist/client/hooks/index.d.ts +7 -2
  35. package/dist/client/hooks/index.mjs +1 -1
  36. package/dist/client/index.d.cts +42 -3
  37. package/dist/client/index.d.mts +42 -3
  38. package/dist/client/index.d.ts +42 -3
  39. package/dist/permissions.cjs +8 -0
  40. package/dist/permissions.d.cts +6 -0
  41. package/dist/permissions.d.mts +6 -0
  42. package/dist/permissions.d.ts +6 -0
  43. package/dist/permissions.mjs +8 -0
  44. package/dist/query-keys.cjs +7 -0
  45. package/dist/query-keys.d.cts +29 -1
  46. package/dist/query-keys.d.mts +29 -1
  47. package/dist/query-keys.d.ts +29 -1
  48. package/dist/query-keys.mjs +7 -0
  49. package/dist/shared/{plugin-form-builder.CSP5HR2O.d.ts → plugin-form-builder.65tLgfcd.d.ts} +46 -29
  50. package/dist/shared/{plugin-form-builder.Bbl9NufB.d.cts → plugin-form-builder.DXdOj9vM.d.cts} +46 -29
  51. package/dist/shared/{plugin-form-builder.lp98rFNl.d.mts → plugin-form-builder.PWs25HN1.d.mts} +46 -29
  52. package/dist/shared/{plugin-form-builder.DWrQ3lRX.d.ts → plugin-form-builder.sdjcoJcH.d.cts} +15 -1
  53. package/dist/shared/{plugin-form-builder.DWrQ3lRX.d.cts → plugin-form-builder.sdjcoJcH.d.mts} +15 -1
  54. package/dist/shared/{plugin-form-builder.DWrQ3lRX.d.mts → plugin-form-builder.sdjcoJcH.d.ts} +15 -1
  55. package/dist/ui/src/components/auto-form/config.cjs +2 -0
  56. package/dist/ui/src/components/auto-form/config.mjs +2 -0
  57. package/dist/ui/src/components/auto-form/fields/file.cjs +68 -0
  58. package/dist/ui/src/components/auto-form/fields/file.mjs +63 -0
  59. package/dist/ui/src/components/auto-form/fields/object.cjs +9 -2
  60. package/dist/ui/src/components/auto-form/fields/object.mjs +9 -2
  61. package/dist/ui/src/components/auto-form/helpers.cjs +9 -0
  62. package/dist/ui/src/components/auto-form/helpers.mjs +9 -0
  63. package/dist/ui/src/components/auto-form/index.cjs +29 -4
  64. package/dist/ui/src/components/auto-form/index.mjs +31 -6
  65. package/dist/ui/src/components/auto-form/stepped-auto-form.cjs +34 -29
  66. package/dist/ui/src/components/auto-form/stepped-auto-form.mjs +35 -30
  67. package/dist/ui/src/components/form-builder/canvas.cjs +9 -0
  68. package/dist/ui/src/components/form-builder/canvas.mjs +9 -0
  69. package/dist/ui/src/components/form-builder/components/index.cjs +12 -0
  70. package/dist/ui/src/components/form-builder/components/index.mjs +12 -1
  71. package/dist/ui/src/components/form-builder/condition-editor.cjs +73 -0
  72. package/dist/ui/src/components/form-builder/condition-editor.mjs +71 -0
  73. package/dist/ui/src/components/form-builder/edit-field-dialog.cjs +6 -2
  74. package/dist/ui/src/components/form-builder/edit-field-dialog.mjs +6 -2
  75. package/dist/ui/src/components/form-builder/index.cjs +6 -1
  76. package/dist/ui/src/components/form-builder/index.mjs +6 -1
  77. package/dist/ui/src/components/form-builder/schema-utils.cjs +2 -0
  78. package/dist/ui/src/components/form-builder/schema-utils.mjs +2 -0
  79. package/dist/ui/src/components/form.mjs +1 -1
  80. package/dist/ui/src/lib/form-visibility.cjs +20 -0
  81. package/dist/ui/src/lib/form-visibility.mjs +18 -0
  82. package/dist/ui/src/lib/schema-converter.cjs +101 -0
  83. package/dist/ui/src/lib/schema-converter.mjs +100 -1
  84. package/package.json +4 -4
@@ -118,6 +118,13 @@ const formBuilderResources = {
118
118
  }
119
119
  },
120
120
  mutations: {
121
+ export: {
122
+ path: "@post/forms/:formId/submissions/export",
123
+ method: "POST",
124
+ input: (formId) => ({ params: { formId } }),
125
+ select: (data) => data,
126
+ refresh: false
127
+ },
121
128
  delete: {
122
129
  path: "@delete/forms/:formId/submissions/:subId",
123
130
  method: "DELETE",
@@ -48,6 +48,10 @@ declare const ListSubmissionsOperationInputSchema: z$1.ZodObject<{
48
48
  offset: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>>;
49
49
  }, z$1.core.$strip>;
50
50
  }, z$1.core.$strip>;
51
+ /** Input for exporting one form’s submissions. */
52
+ declare const ExportSubmissionsOperationInputSchema: z$1.ZodObject<{
53
+ formId: z$1.ZodString;
54
+ }, z$1.core.$strip>;
51
55
  declare const GetSubmissionOperationInputSchema: z$1.ZodObject<{
52
56
  formId: z$1.ZodString;
53
57
  submissionId: z$1.ZodString;
@@ -73,6 +77,10 @@ interface SubmitOperationResult extends SerializedFormSubmission {
73
77
  readonly form: Pick<SerializedForm, "successMessage" | "redirectUrl">;
74
78
  }
75
79
  type FormBuilderOperations = {
80
+ readonly exportSubmissions: Operation<typeof ExportSubmissionsOperationInputSchema, typeof formBuilderPermissions.submission.export, {
81
+ readonly csv: string;
82
+ readonly filename: string;
83
+ }>;
76
84
  readonly listForms: Operation<typeof listFormsQuerySchema, typeof formBuilderPermissions.form.read, FormListOperationResult>;
77
85
  readonly getFormBySlug: Operation<typeof GetFormBySlugOperationInputSchema, typeof formBuilderPermissions.form.render, SerializedForm>;
78
86
  readonly getFormById: Operation<typeof GetFormByIdOperationInputSchema, typeof formBuilderPermissions.form.read, SerializedForm>;
@@ -106,6 +114,15 @@ interface FormBuilderPrefetchForRoute {
106
114
  }
107
115
  /** Form Builder backend plugin backed by one operation inventory. */
108
116
  declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
117
+ readonly exportSubmissions: better_call.StrictEndpoint<"/forms/:formId/submissions/export", {
118
+ requireRequest: true;
119
+ } & {
120
+ method: "POST";
121
+ body: better_call.StandardSchemaV1<unknown, unknown>;
122
+ }, {
123
+ readonly csv: string;
124
+ readonly filename: string;
125
+ }>;
109
126
  readonly listForms: better_call.StrictEndpoint<"/forms", {
110
127
  requireRequest: true;
111
128
  } & {
@@ -127,13 +144,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
127
144
  readonly status: Form["status"];
128
145
  readonly createdAt: string;
129
146
  readonly updatedAt: string;
130
- readonly name: string;
131
- readonly slug: string;
132
- readonly description?: string | undefined;
133
147
  readonly schema: string;
148
+ readonly id: string;
149
+ readonly description?: string | undefined;
150
+ readonly slug: string;
151
+ readonly name: string;
134
152
  readonly successMessage?: string | undefined;
135
153
  readonly redirectUrl?: string | undefined;
136
- readonly id: string;
137
154
  readonly createdBy?: string | undefined;
138
155
  }[];
139
156
  readonly total: number;
@@ -151,13 +168,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
151
168
  readonly status: Form["status"];
152
169
  readonly createdAt: string;
153
170
  readonly updatedAt: string;
154
- readonly name: string;
155
- readonly slug: string;
156
- readonly description?: string | undefined;
157
171
  readonly schema: string;
172
+ readonly id: string;
173
+ readonly description?: string | undefined;
174
+ readonly slug: string;
175
+ readonly name: string;
158
176
  readonly successMessage?: string | undefined;
159
177
  readonly redirectUrl?: string | undefined;
160
- readonly id: string;
161
178
  readonly createdBy?: string | undefined;
162
179
  }>;
163
180
  readonly getFormById: better_call.StrictEndpoint<"/forms/id/:id", {
@@ -171,13 +188,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
171
188
  readonly status: Form["status"];
172
189
  readonly createdAt: string;
173
190
  readonly updatedAt: string;
174
- readonly name: string;
175
- readonly slug: string;
176
- readonly description?: string | undefined;
177
191
  readonly schema: string;
192
+ readonly id: string;
193
+ readonly description?: string | undefined;
194
+ readonly slug: string;
195
+ readonly name: string;
178
196
  readonly successMessage?: string | undefined;
179
197
  readonly redirectUrl?: string | undefined;
180
- readonly id: string;
181
198
  readonly createdBy?: string | undefined;
182
199
  }>;
183
200
  readonly getFormForUpdate: better_call.StrictEndpoint<"/forms/id/:id/edit", {
@@ -191,13 +208,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
191
208
  readonly status: Form["status"];
192
209
  readonly createdAt: string;
193
210
  readonly updatedAt: string;
194
- readonly name: string;
195
- readonly slug: string;
196
- readonly description?: string | undefined;
197
211
  readonly schema: string;
212
+ readonly id: string;
213
+ readonly description?: string | undefined;
214
+ readonly slug: string;
215
+ readonly name: string;
198
216
  readonly successMessage?: string | undefined;
199
217
  readonly redirectUrl?: string | undefined;
200
- readonly id: string;
201
218
  readonly createdBy?: string | undefined;
202
219
  }>;
203
220
  readonly createForm: better_call.StrictEndpoint<"/forms", {
@@ -225,13 +242,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
225
242
  readonly status: Form["status"];
226
243
  readonly createdAt: string;
227
244
  readonly updatedAt: string;
228
- readonly name: string;
229
- readonly slug: string;
230
- readonly description?: string | undefined;
231
245
  readonly schema: string;
246
+ readonly id: string;
247
+ readonly description?: string | undefined;
248
+ readonly slug: string;
249
+ readonly name: string;
232
250
  readonly successMessage?: string | undefined;
233
251
  readonly redirectUrl?: string | undefined;
234
- readonly id: string;
235
252
  readonly createdBy?: string | undefined;
236
253
  }>;
237
254
  readonly updateForm: better_call.StrictEndpoint<"/forms/:id", {
@@ -259,13 +276,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
259
276
  readonly status: Form["status"];
260
277
  readonly createdAt: string;
261
278
  readonly updatedAt: string;
262
- readonly name: string;
263
- readonly slug: string;
264
- readonly description?: string | undefined;
265
279
  readonly schema: string;
280
+ readonly id: string;
281
+ readonly description?: string | undefined;
282
+ readonly slug: string;
283
+ readonly name: string;
266
284
  readonly successMessage?: string | undefined;
267
285
  readonly redirectUrl?: string | undefined;
268
- readonly id: string;
269
286
  readonly createdBy?: string | undefined;
270
287
  }>;
271
288
  readonly deleteForm: better_call.StrictEndpoint<"/forms/:id", {
@@ -291,10 +308,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
291
308
  readonly redirectUrl?: string | undefined;
292
309
  };
293
310
  readonly submittedAt: string;
294
- readonly id: string;
295
- readonly data: string;
296
311
  readonly formId: string;
312
+ readonly id: string;
297
313
  readonly submittedBy?: string | undefined;
314
+ readonly data: string;
298
315
  readonly ipAddress?: string | undefined;
299
316
  readonly userAgent?: string | undefined;
300
317
  }>;
@@ -335,10 +352,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
335
352
  readonly [x: string]: any;
336
353
  } | null;
337
354
  readonly submittedAt: string;
338
- readonly id: string;
339
- readonly data: string;
340
355
  readonly formId: string;
356
+ readonly id: string;
341
357
  readonly submittedBy?: string | undefined;
358
+ readonly data: string;
342
359
  readonly ipAddress?: string | undefined;
343
360
  readonly userAgent?: string | undefined;
344
361
  }>;
@@ -404,5 +421,5 @@ declare const FORM_QUERY_KEYS: {
404
421
  }) => readonly ["formSubmissions", "list", SubmissionsListDiscriminator];
405
422
  };
406
423
 
407
- export { FORM_QUERY_KEYS as F, FormBuilderOperationError as b, createFormBuilderOperations as h, formBuilderBackendPlugin as i };
424
+ export { ExportSubmissionsOperationInputSchema as E, FORM_QUERY_KEYS as F, FormBuilderOperationError as b, createFormBuilderOperations as h, formBuilderBackendPlugin as i };
408
425
  export type { SubmissionDetailOperationResult as S, FormBuilderApiRouter as a, FormBuilderOperations as c, FormBuilderRouteKey as d, FormListOperationResult as e, SubmissionListOperationResult as f, SubmitOperationResult as g, FormsListDiscriminator as j, SubmissionsListDiscriminator as k };
@@ -48,6 +48,10 @@ declare const ListSubmissionsOperationInputSchema: z$1.ZodObject<{
48
48
  offset: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>>;
49
49
  }, z$1.core.$strip>;
50
50
  }, z$1.core.$strip>;
51
+ /** Input for exporting one form’s submissions. */
52
+ declare const ExportSubmissionsOperationInputSchema: z$1.ZodObject<{
53
+ formId: z$1.ZodString;
54
+ }, z$1.core.$strip>;
51
55
  declare const GetSubmissionOperationInputSchema: z$1.ZodObject<{
52
56
  formId: z$1.ZodString;
53
57
  submissionId: z$1.ZodString;
@@ -73,6 +77,10 @@ interface SubmitOperationResult extends SerializedFormSubmission {
73
77
  readonly form: Pick<SerializedForm, "successMessage" | "redirectUrl">;
74
78
  }
75
79
  type FormBuilderOperations = {
80
+ readonly exportSubmissions: Operation<typeof ExportSubmissionsOperationInputSchema, typeof formBuilderPermissions.submission.export, {
81
+ readonly csv: string;
82
+ readonly filename: string;
83
+ }>;
76
84
  readonly listForms: Operation<typeof listFormsQuerySchema, typeof formBuilderPermissions.form.read, FormListOperationResult>;
77
85
  readonly getFormBySlug: Operation<typeof GetFormBySlugOperationInputSchema, typeof formBuilderPermissions.form.render, SerializedForm>;
78
86
  readonly getFormById: Operation<typeof GetFormByIdOperationInputSchema, typeof formBuilderPermissions.form.read, SerializedForm>;
@@ -106,6 +114,15 @@ interface FormBuilderPrefetchForRoute {
106
114
  }
107
115
  /** Form Builder backend plugin backed by one operation inventory. */
108
116
  declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
117
+ readonly exportSubmissions: better_call.StrictEndpoint<"/forms/:formId/submissions/export", {
118
+ requireRequest: true;
119
+ } & {
120
+ method: "POST";
121
+ body: better_call.StandardSchemaV1<unknown, unknown>;
122
+ }, {
123
+ readonly csv: string;
124
+ readonly filename: string;
125
+ }>;
109
126
  readonly listForms: better_call.StrictEndpoint<"/forms", {
110
127
  requireRequest: true;
111
128
  } & {
@@ -127,13 +144,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
127
144
  readonly status: Form["status"];
128
145
  readonly createdAt: string;
129
146
  readonly updatedAt: string;
130
- readonly name: string;
131
- readonly slug: string;
132
- readonly description?: string | undefined;
133
147
  readonly schema: string;
148
+ readonly id: string;
149
+ readonly description?: string | undefined;
150
+ readonly slug: string;
151
+ readonly name: string;
134
152
  readonly successMessage?: string | undefined;
135
153
  readonly redirectUrl?: string | undefined;
136
- readonly id: string;
137
154
  readonly createdBy?: string | undefined;
138
155
  }[];
139
156
  readonly total: number;
@@ -151,13 +168,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
151
168
  readonly status: Form["status"];
152
169
  readonly createdAt: string;
153
170
  readonly updatedAt: string;
154
- readonly name: string;
155
- readonly slug: string;
156
- readonly description?: string | undefined;
157
171
  readonly schema: string;
172
+ readonly id: string;
173
+ readonly description?: string | undefined;
174
+ readonly slug: string;
175
+ readonly name: string;
158
176
  readonly successMessage?: string | undefined;
159
177
  readonly redirectUrl?: string | undefined;
160
- readonly id: string;
161
178
  readonly createdBy?: string | undefined;
162
179
  }>;
163
180
  readonly getFormById: better_call.StrictEndpoint<"/forms/id/:id", {
@@ -171,13 +188,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
171
188
  readonly status: Form["status"];
172
189
  readonly createdAt: string;
173
190
  readonly updatedAt: string;
174
- readonly name: string;
175
- readonly slug: string;
176
- readonly description?: string | undefined;
177
191
  readonly schema: string;
192
+ readonly id: string;
193
+ readonly description?: string | undefined;
194
+ readonly slug: string;
195
+ readonly name: string;
178
196
  readonly successMessage?: string | undefined;
179
197
  readonly redirectUrl?: string | undefined;
180
- readonly id: string;
181
198
  readonly createdBy?: string | undefined;
182
199
  }>;
183
200
  readonly getFormForUpdate: better_call.StrictEndpoint<"/forms/id/:id/edit", {
@@ -191,13 +208,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
191
208
  readonly status: Form["status"];
192
209
  readonly createdAt: string;
193
210
  readonly updatedAt: string;
194
- readonly name: string;
195
- readonly slug: string;
196
- readonly description?: string | undefined;
197
211
  readonly schema: string;
212
+ readonly id: string;
213
+ readonly description?: string | undefined;
214
+ readonly slug: string;
215
+ readonly name: string;
198
216
  readonly successMessage?: string | undefined;
199
217
  readonly redirectUrl?: string | undefined;
200
- readonly id: string;
201
218
  readonly createdBy?: string | undefined;
202
219
  }>;
203
220
  readonly createForm: better_call.StrictEndpoint<"/forms", {
@@ -225,13 +242,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
225
242
  readonly status: Form["status"];
226
243
  readonly createdAt: string;
227
244
  readonly updatedAt: string;
228
- readonly name: string;
229
- readonly slug: string;
230
- readonly description?: string | undefined;
231
245
  readonly schema: string;
246
+ readonly id: string;
247
+ readonly description?: string | undefined;
248
+ readonly slug: string;
249
+ readonly name: string;
232
250
  readonly successMessage?: string | undefined;
233
251
  readonly redirectUrl?: string | undefined;
234
- readonly id: string;
235
252
  readonly createdBy?: string | undefined;
236
253
  }>;
237
254
  readonly updateForm: better_call.StrictEndpoint<"/forms/:id", {
@@ -259,13 +276,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
259
276
  readonly status: Form["status"];
260
277
  readonly createdAt: string;
261
278
  readonly updatedAt: string;
262
- readonly name: string;
263
- readonly slug: string;
264
- readonly description?: string | undefined;
265
279
  readonly schema: string;
280
+ readonly id: string;
281
+ readonly description?: string | undefined;
282
+ readonly slug: string;
283
+ readonly name: string;
266
284
  readonly successMessage?: string | undefined;
267
285
  readonly redirectUrl?: string | undefined;
268
- readonly id: string;
269
286
  readonly createdBy?: string | undefined;
270
287
  }>;
271
288
  readonly deleteForm: better_call.StrictEndpoint<"/forms/:id", {
@@ -291,10 +308,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
291
308
  readonly redirectUrl?: string | undefined;
292
309
  };
293
310
  readonly submittedAt: string;
294
- readonly id: string;
295
- readonly data: string;
296
311
  readonly formId: string;
312
+ readonly id: string;
297
313
  readonly submittedBy?: string | undefined;
314
+ readonly data: string;
298
315
  readonly ipAddress?: string | undefined;
299
316
  readonly userAgent?: string | undefined;
300
317
  }>;
@@ -335,10 +352,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
335
352
  readonly [x: string]: any;
336
353
  } | null;
337
354
  readonly submittedAt: string;
338
- readonly id: string;
339
- readonly data: string;
340
355
  readonly formId: string;
356
+ readonly id: string;
341
357
  readonly submittedBy?: string | undefined;
358
+ readonly data: string;
342
359
  readonly ipAddress?: string | undefined;
343
360
  readonly userAgent?: string | undefined;
344
361
  }>;
@@ -404,5 +421,5 @@ declare const FORM_QUERY_KEYS: {
404
421
  }) => readonly ["formSubmissions", "list", SubmissionsListDiscriminator];
405
422
  };
406
423
 
407
- export { FORM_QUERY_KEYS as F, FormBuilderOperationError as b, createFormBuilderOperations as h, formBuilderBackendPlugin as i };
424
+ export { ExportSubmissionsOperationInputSchema as E, FORM_QUERY_KEYS as F, FormBuilderOperationError as b, createFormBuilderOperations as h, formBuilderBackendPlugin as i };
408
425
  export type { SubmissionDetailOperationResult as S, FormBuilderApiRouter as a, FormBuilderOperations as c, FormBuilderRouteKey as d, FormListOperationResult as e, SubmissionListOperationResult as f, SubmitOperationResult as g, FormsListDiscriminator as j, SubmissionsListDiscriminator as k };
@@ -48,6 +48,10 @@ declare const ListSubmissionsOperationInputSchema: z$1.ZodObject<{
48
48
  offset: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodCoercedNumber<unknown>>>;
49
49
  }, z$1.core.$strip>;
50
50
  }, z$1.core.$strip>;
51
+ /** Input for exporting one form’s submissions. */
52
+ declare const ExportSubmissionsOperationInputSchema: z$1.ZodObject<{
53
+ formId: z$1.ZodString;
54
+ }, z$1.core.$strip>;
51
55
  declare const GetSubmissionOperationInputSchema: z$1.ZodObject<{
52
56
  formId: z$1.ZodString;
53
57
  submissionId: z$1.ZodString;
@@ -73,6 +77,10 @@ interface SubmitOperationResult extends SerializedFormSubmission {
73
77
  readonly form: Pick<SerializedForm, "successMessage" | "redirectUrl">;
74
78
  }
75
79
  type FormBuilderOperations = {
80
+ readonly exportSubmissions: Operation<typeof ExportSubmissionsOperationInputSchema, typeof formBuilderPermissions.submission.export, {
81
+ readonly csv: string;
82
+ readonly filename: string;
83
+ }>;
76
84
  readonly listForms: Operation<typeof listFormsQuerySchema, typeof formBuilderPermissions.form.read, FormListOperationResult>;
77
85
  readonly getFormBySlug: Operation<typeof GetFormBySlugOperationInputSchema, typeof formBuilderPermissions.form.render, SerializedForm>;
78
86
  readonly getFormById: Operation<typeof GetFormByIdOperationInputSchema, typeof formBuilderPermissions.form.read, SerializedForm>;
@@ -106,6 +114,15 @@ interface FormBuilderPrefetchForRoute {
106
114
  }
107
115
  /** Form Builder backend plugin backed by one operation inventory. */
108
116
  declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _btst_stack_plugins_api.BackendPlugin<{
117
+ readonly exportSubmissions: better_call.StrictEndpoint<"/forms/:formId/submissions/export", {
118
+ requireRequest: true;
119
+ } & {
120
+ method: "POST";
121
+ body: better_call.StandardSchemaV1<unknown, unknown>;
122
+ }, {
123
+ readonly csv: string;
124
+ readonly filename: string;
125
+ }>;
109
126
  readonly listForms: better_call.StrictEndpoint<"/forms", {
110
127
  requireRequest: true;
111
128
  } & {
@@ -127,13 +144,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
127
144
  readonly status: Form["status"];
128
145
  readonly createdAt: string;
129
146
  readonly updatedAt: string;
130
- readonly name: string;
131
- readonly slug: string;
132
- readonly description?: string | undefined;
133
147
  readonly schema: string;
148
+ readonly id: string;
149
+ readonly description?: string | undefined;
150
+ readonly slug: string;
151
+ readonly name: string;
134
152
  readonly successMessage?: string | undefined;
135
153
  readonly redirectUrl?: string | undefined;
136
- readonly id: string;
137
154
  readonly createdBy?: string | undefined;
138
155
  }[];
139
156
  readonly total: number;
@@ -151,13 +168,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
151
168
  readonly status: Form["status"];
152
169
  readonly createdAt: string;
153
170
  readonly updatedAt: string;
154
- readonly name: string;
155
- readonly slug: string;
156
- readonly description?: string | undefined;
157
171
  readonly schema: string;
172
+ readonly id: string;
173
+ readonly description?: string | undefined;
174
+ readonly slug: string;
175
+ readonly name: string;
158
176
  readonly successMessage?: string | undefined;
159
177
  readonly redirectUrl?: string | undefined;
160
- readonly id: string;
161
178
  readonly createdBy?: string | undefined;
162
179
  }>;
163
180
  readonly getFormById: better_call.StrictEndpoint<"/forms/id/:id", {
@@ -171,13 +188,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
171
188
  readonly status: Form["status"];
172
189
  readonly createdAt: string;
173
190
  readonly updatedAt: string;
174
- readonly name: string;
175
- readonly slug: string;
176
- readonly description?: string | undefined;
177
191
  readonly schema: string;
192
+ readonly id: string;
193
+ readonly description?: string | undefined;
194
+ readonly slug: string;
195
+ readonly name: string;
178
196
  readonly successMessage?: string | undefined;
179
197
  readonly redirectUrl?: string | undefined;
180
- readonly id: string;
181
198
  readonly createdBy?: string | undefined;
182
199
  }>;
183
200
  readonly getFormForUpdate: better_call.StrictEndpoint<"/forms/id/:id/edit", {
@@ -191,13 +208,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
191
208
  readonly status: Form["status"];
192
209
  readonly createdAt: string;
193
210
  readonly updatedAt: string;
194
- readonly name: string;
195
- readonly slug: string;
196
- readonly description?: string | undefined;
197
211
  readonly schema: string;
212
+ readonly id: string;
213
+ readonly description?: string | undefined;
214
+ readonly slug: string;
215
+ readonly name: string;
198
216
  readonly successMessage?: string | undefined;
199
217
  readonly redirectUrl?: string | undefined;
200
- readonly id: string;
201
218
  readonly createdBy?: string | undefined;
202
219
  }>;
203
220
  readonly createForm: better_call.StrictEndpoint<"/forms", {
@@ -225,13 +242,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
225
242
  readonly status: Form["status"];
226
243
  readonly createdAt: string;
227
244
  readonly updatedAt: string;
228
- readonly name: string;
229
- readonly slug: string;
230
- readonly description?: string | undefined;
231
245
  readonly schema: string;
246
+ readonly id: string;
247
+ readonly description?: string | undefined;
248
+ readonly slug: string;
249
+ readonly name: string;
232
250
  readonly successMessage?: string | undefined;
233
251
  readonly redirectUrl?: string | undefined;
234
- readonly id: string;
235
252
  readonly createdBy?: string | undefined;
236
253
  }>;
237
254
  readonly updateForm: better_call.StrictEndpoint<"/forms/:id", {
@@ -259,13 +276,13 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
259
276
  readonly status: Form["status"];
260
277
  readonly createdAt: string;
261
278
  readonly updatedAt: string;
262
- readonly name: string;
263
- readonly slug: string;
264
- readonly description?: string | undefined;
265
279
  readonly schema: string;
280
+ readonly id: string;
281
+ readonly description?: string | undefined;
282
+ readonly slug: string;
283
+ readonly name: string;
266
284
  readonly successMessage?: string | undefined;
267
285
  readonly redirectUrl?: string | undefined;
268
- readonly id: string;
269
286
  readonly createdBy?: string | undefined;
270
287
  }>;
271
288
  readonly deleteForm: better_call.StrictEndpoint<"/forms/:id", {
@@ -291,10 +308,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
291
308
  readonly redirectUrl?: string | undefined;
292
309
  };
293
310
  readonly submittedAt: string;
294
- readonly id: string;
295
- readonly data: string;
296
311
  readonly formId: string;
312
+ readonly id: string;
297
313
  readonly submittedBy?: string | undefined;
314
+ readonly data: string;
298
315
  readonly ipAddress?: string | undefined;
299
316
  readonly userAgent?: string | undefined;
300
317
  }>;
@@ -335,10 +352,10 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
335
352
  readonly [x: string]: any;
336
353
  } | null;
337
354
  readonly submittedAt: string;
338
- readonly id: string;
339
- readonly data: string;
340
355
  readonly formId: string;
356
+ readonly id: string;
341
357
  readonly submittedBy?: string | undefined;
358
+ readonly data: string;
342
359
  readonly ipAddress?: string | undefined;
343
360
  readonly userAgent?: string | undefined;
344
361
  }>;
@@ -404,5 +421,5 @@ declare const FORM_QUERY_KEYS: {
404
421
  }) => readonly ["formSubmissions", "list", SubmissionsListDiscriminator];
405
422
  };
406
423
 
407
- export { FORM_QUERY_KEYS as F, FormBuilderOperationError as b, createFormBuilderOperations as h, formBuilderBackendPlugin as i };
424
+ export { ExportSubmissionsOperationInputSchema as E, FORM_QUERY_KEYS as F, FormBuilderOperationError as b, createFormBuilderOperations as h, formBuilderBackendPlugin as i };
408
425
  export type { SubmissionDetailOperationResult as S, FormBuilderApiRouter as a, FormBuilderOperations as c, FormBuilderRouteKey as d, FormListOperationResult as e, SubmissionListOperationResult as f, SubmitOperationResult as g, FormsListDiscriminator as j, SubmissionsListDiscriminator as k };
@@ -5,6 +5,15 @@ import * as z from 'zod';
5
5
 
6
6
  declare function FormListPageComponent(): react.JSX.Element;
7
7
 
8
+ /** A single visibility condition against a sibling field's value. */
9
+ type ShowIfCondition = {
10
+ field: string;
11
+ operator: "equals" | "notEquals" | "in" | "isTruthy";
12
+ value?: unknown;
13
+ };
14
+
15
+ declare function AutoFormFile({ field, fieldProps, fieldConfigItem, label, isRequired }: AutoFormInputComponentProps): react.JSX.Element;
16
+
8
17
  declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react.JSX.Element;
9
18
 
10
19
  declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react.JSX.Element;
@@ -22,6 +31,7 @@ declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fie
22
31
  declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react.JSX.Element;
23
32
 
24
33
  declare const INPUT_COMPONENTS: {
34
+ file: typeof AutoFormFile;
25
35
  checkbox: typeof AutoFormCheckbox;
26
36
  date: typeof AutoFormDate;
27
37
  select: typeof AutoFormEnum;
@@ -85,6 +95,10 @@ type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<H
85
95
  * so that JSON Schema properties can be easily converted to field configs.
86
96
  */
87
97
  type FieldConfigItem = {
98
+ /** Show this field only when the condition matches. */
99
+ showIf?: ShowIfCondition;
100
+ /** Standalone file upload handler; resolves to a stored URL. */
101
+ onUpload?: (file: File) => Promise<string>;
88
102
  /** Description text or React node */
89
103
  description?: React.ReactNode;
90
104
  /** Input props passed to the field component */
@@ -115,4 +129,4 @@ type AutoFormInputComponentProps = {
115
129
  };
116
130
 
117
131
  export { FormListPageComponent as F };
118
- export type { AutoFormInputComponentProps as A };
132
+ export type { AutoFormInputComponentProps as A, ShowIfCondition as S };
@@ -5,6 +5,15 @@ import * as z from 'zod';
5
5
 
6
6
  declare function FormListPageComponent(): react.JSX.Element;
7
7
 
8
+ /** A single visibility condition against a sibling field's value. */
9
+ type ShowIfCondition = {
10
+ field: string;
11
+ operator: "equals" | "notEquals" | "in" | "isTruthy";
12
+ value?: unknown;
13
+ };
14
+
15
+ declare function AutoFormFile({ field, fieldProps, fieldConfigItem, label, isRequired }: AutoFormInputComponentProps): react.JSX.Element;
16
+
8
17
  declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react.JSX.Element;
9
18
 
10
19
  declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react.JSX.Element;
@@ -22,6 +31,7 @@ declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fie
22
31
  declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react.JSX.Element;
23
32
 
24
33
  declare const INPUT_COMPONENTS: {
34
+ file: typeof AutoFormFile;
25
35
  checkbox: typeof AutoFormCheckbox;
26
36
  date: typeof AutoFormDate;
27
37
  select: typeof AutoFormEnum;
@@ -85,6 +95,10 @@ type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<H
85
95
  * so that JSON Schema properties can be easily converted to field configs.
86
96
  */
87
97
  type FieldConfigItem = {
98
+ /** Show this field only when the condition matches. */
99
+ showIf?: ShowIfCondition;
100
+ /** Standalone file upload handler; resolves to a stored URL. */
101
+ onUpload?: (file: File) => Promise<string>;
88
102
  /** Description text or React node */
89
103
  description?: React.ReactNode;
90
104
  /** Input props passed to the field component */
@@ -115,4 +129,4 @@ type AutoFormInputComponentProps = {
115
129
  };
116
130
 
117
131
  export { FormListPageComponent as F };
118
- export type { AutoFormInputComponentProps as A };
132
+ export type { AutoFormInputComponentProps as A, ShowIfCondition as S };
@@ -5,6 +5,15 @@ import * as z from 'zod';
5
5
 
6
6
  declare function FormListPageComponent(): react.JSX.Element;
7
7
 
8
+ /** A single visibility condition against a sibling field's value. */
9
+ type ShowIfCondition = {
10
+ field: string;
11
+ operator: "equals" | "notEquals" | "in" | "isTruthy";
12
+ value?: unknown;
13
+ };
14
+
15
+ declare function AutoFormFile({ field, fieldProps, fieldConfigItem, label, isRequired }: AutoFormInputComponentProps): react.JSX.Element;
16
+
8
17
  declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react.JSX.Element;
9
18
 
10
19
  declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react.JSX.Element;
@@ -22,6 +31,7 @@ declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fie
22
31
  declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react.JSX.Element;
23
32
 
24
33
  declare const INPUT_COMPONENTS: {
34
+ file: typeof AutoFormFile;
25
35
  checkbox: typeof AutoFormCheckbox;
26
36
  date: typeof AutoFormDate;
27
37
  select: typeof AutoFormEnum;
@@ -85,6 +95,10 @@ type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<H
85
95
  * so that JSON Schema properties can be easily converted to field configs.
86
96
  */
87
97
  type FieldConfigItem = {
98
+ /** Show this field only when the condition matches. */
99
+ showIf?: ShowIfCondition;
100
+ /** Standalone file upload handler; resolves to a stored URL. */
101
+ onUpload?: (file: File) => Promise<string>;
88
102
  /** Description text or React node */
89
103
  description?: React.ReactNode;
90
104
  /** Input props passed to the field component */
@@ -115,4 +129,4 @@ type AutoFormInputComponentProps = {
115
129
  };
116
130
 
117
131
  export { FormListPageComponent as F };
118
- export type { AutoFormInputComponentProps as A };
132
+ export type { AutoFormInputComponentProps as A, ShowIfCondition as S };
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const file = require('./fields/file.cjs');
3
4
  const checkbox = require('./fields/checkbox.cjs');
4
5
  const date = require('./fields/date.cjs');
5
6
  const _enum = require('./fields/enum.cjs');
@@ -10,6 +11,7 @@ const _switch = require('./fields/switch.cjs');
10
11
  const textarea = require('./fields/textarea.cjs');
11
12
 
12
13
  const INPUT_COMPONENTS = {
14
+ file: file.default,
13
15
  checkbox: checkbox,
14
16
  date: date,
15
17
  select: _enum,