@fragno-dev/forms 0.0.0-canary-20576600552-1-20251229153717 → 0.0.0-canary-20592511303-1-20251230084048
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/browser/client/react.d.ts +83 -83
- package/dist/browser/client/react.js +1 -1
- package/dist/browser/client/solid.d.ts +83 -83
- package/dist/browser/client/solid.js +1 -1
- package/dist/browser/client/svelte.d.ts +83 -83
- package/dist/browser/client/svelte.js +1 -1
- package/dist/browser/client/vanilla.d.ts +83 -83
- package/dist/browser/client/vanilla.js +1 -1
- package/dist/browser/client/vue.d.ts +6 -6
- package/dist/browser/client/vue.js +1 -1
- package/dist/browser/index.d.ts +211 -201
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/{src-DbMX_NY6.js → src-BVDqShCx.js} +8 -8
- package/dist/browser/src-BVDqShCx.js.map +1 -0
- package/dist/node/index.d.ts +31 -21
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +7 -7
- package/dist/node/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/browser/src-DbMX_NY6.js.map +0 -1
package/dist/node/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ declare const FormStatusSchema: z.ZodEnum<{
|
|
|
33
33
|
declare const FormSchema: z.ZodObject<{
|
|
34
34
|
id: z.ZodString;
|
|
35
35
|
title: z.ZodString;
|
|
36
|
-
description: z.ZodNullable<z.ZodString
|
|
36
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
37
|
slug: z.ZodString;
|
|
38
38
|
status: z.ZodEnum<{
|
|
39
39
|
draft: "draft";
|
|
@@ -55,7 +55,7 @@ declare const NewFormSchema: z.ZodObject<{
|
|
|
55
55
|
static: "static";
|
|
56
56
|
}>;
|
|
57
57
|
title: z.ZodString;
|
|
58
|
-
description: z.ZodNullable<z.ZodString
|
|
58
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
59
|
slug: z.ZodString;
|
|
60
60
|
dataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
61
61
|
uiSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -68,12 +68,16 @@ declare const UpdateFormSchema: z.ZodObject<{
|
|
|
68
68
|
static: "static";
|
|
69
69
|
}>>;
|
|
70
70
|
title: z.ZodOptional<z.ZodString>;
|
|
71
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString
|
|
71
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
72
72
|
slug: z.ZodOptional<z.ZodString>;
|
|
73
73
|
dataSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
74
74
|
uiSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
75
75
|
}, z.core.$strip>;
|
|
76
|
-
declare const
|
|
76
|
+
declare const ResponseMetadataSchema: z.ZodObject<{
|
|
77
|
+
ip: z.ZodNullable<z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>>;
|
|
78
|
+
userAgent: z.ZodNullable<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
declare const FormResponseSchema: z.ZodObject<{
|
|
77
81
|
id: z.ZodString;
|
|
78
82
|
formId: z.ZodNullable<z.ZodString>;
|
|
79
83
|
formVersion: z.ZodNumber;
|
|
@@ -82,10 +86,16 @@ declare const ResponseSchema: z.ZodObject<{
|
|
|
82
86
|
ip: z.ZodNullable<z.ZodString>;
|
|
83
87
|
userAgent: z.ZodNullable<z.ZodString>;
|
|
84
88
|
}, z.core.$strip>;
|
|
89
|
+
declare const NewFormResponseSchema: z.ZodObject<{
|
|
90
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
91
|
+
securityToken: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>;
|
|
85
93
|
type NewForm = z.infer<typeof NewFormSchema>;
|
|
86
94
|
type UpdateForm = z.infer<typeof UpdateFormSchema>;
|
|
87
95
|
type Form = z.infer<typeof FormSchema>;
|
|
88
|
-
type
|
|
96
|
+
type NewFormResponse = z.infer<typeof NewFormResponseSchema>;
|
|
97
|
+
type FormResponse = z.infer<typeof FormResponseSchema>;
|
|
98
|
+
type FormResponseMetadata = z.infer<typeof ResponseMetadataSchema>;
|
|
89
99
|
type FormStatus = z.infer<typeof FormStatusSchema>;
|
|
90
100
|
type JSONSchema = z.infer<typeof JSONSchemaSchema>;
|
|
91
101
|
type UIElementSchema = z.infer<typeof UISchemaElementSchema>;
|
|
@@ -216,7 +226,7 @@ interface StaticForm {
|
|
|
216
226
|
}
|
|
217
227
|
interface FormsConfig {
|
|
218
228
|
onFormCreated?: (form: Omit<Form, "version" | "createdAt" | "updatedAt">) => Promise<void>;
|
|
219
|
-
onResponseSubmitted?: (response:
|
|
229
|
+
onResponseSubmitted?: (response: FormResponse) => Promise<void>;
|
|
220
230
|
staticForms?: StaticForm[];
|
|
221
231
|
}
|
|
222
232
|
declare const routes: readonly [_fragno_dev_core0.RouteFactory<FormsConfig, {
|
|
@@ -311,7 +321,7 @@ declare const routes: readonly [_fragno_dev_core0.RouteFactory<FormsConfig, {
|
|
|
311
321
|
}>, {}, readonly [_fragno_dev_core0.FragnoRouteConfig<"GET", "/:slug", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod0.ZodObject<{
|
|
312
322
|
id: zod0.ZodString;
|
|
313
323
|
title: zod0.ZodString;
|
|
314
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
324
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
315
325
|
slug: zod0.ZodString;
|
|
316
326
|
status: zod0.ZodEnum<{
|
|
317
327
|
draft: "draft";
|
|
@@ -419,7 +429,7 @@ declare const routes: readonly [_fragno_dev_core0.RouteFactory<FormsConfig, {
|
|
|
419
429
|
}>, {}, readonly [_fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/forms", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod0.ZodArray<zod0.ZodObject<{
|
|
420
430
|
id: zod0.ZodString;
|
|
421
431
|
title: zod0.ZodString;
|
|
422
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
432
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
423
433
|
slug: zod0.ZodString;
|
|
424
434
|
status: zod0.ZodEnum<{
|
|
425
435
|
draft: "draft";
|
|
@@ -440,7 +450,7 @@ declare const routes: readonly [_fragno_dev_core0.RouteFactory<FormsConfig, {
|
|
|
440
450
|
static: "static";
|
|
441
451
|
}>;
|
|
442
452
|
title: zod0.ZodString;
|
|
443
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
453
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
444
454
|
slug: zod0.ZodString;
|
|
445
455
|
dataSchema: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
446
456
|
uiSchema: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
@@ -452,7 +462,7 @@ declare const routes: readonly [_fragno_dev_core0.RouteFactory<FormsConfig, {
|
|
|
452
462
|
static: "static";
|
|
453
463
|
}>>;
|
|
454
464
|
title: zod0.ZodOptional<zod0.ZodString>;
|
|
455
|
-
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString
|
|
465
|
+
description: zod0.ZodOptional<zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>>;
|
|
456
466
|
slug: zod0.ZodOptional<zod0.ZodString>;
|
|
457
467
|
dataSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
458
468
|
uiSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
@@ -476,7 +486,7 @@ declare const routes: readonly [_fragno_dev_core0.RouteFactory<FormsConfig, {
|
|
|
476
486
|
declare function createFormsFragment(config: FormsConfig | undefined, options: FragnoPublicConfigWithDatabase): _fragno_dev_core0.FragnoInstantiatedFragment<[_fragno_dev_core0.FragnoRouteConfig<"GET", "/:slug", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod0.ZodObject<{
|
|
477
487
|
id: zod0.ZodString;
|
|
478
488
|
title: zod0.ZodString;
|
|
479
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
489
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
480
490
|
slug: zod0.ZodString;
|
|
481
491
|
status: zod0.ZodEnum<{
|
|
482
492
|
draft: "draft";
|
|
@@ -495,7 +505,7 @@ declare function createFormsFragment(config: FormsConfig | undefined, options: F
|
|
|
495
505
|
}, zod_v4_core0.$strip>, zod0.ZodString, "NOT_FOUND" | "VALIDATION_ERROR" | "FORM_NOT_OPEN", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/forms", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | undefined, zod0.ZodArray<zod0.ZodObject<{
|
|
496
506
|
id: zod0.ZodString;
|
|
497
507
|
title: zod0.ZodString;
|
|
498
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
508
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
499
509
|
slug: zod0.ZodString;
|
|
500
510
|
status: zod0.ZodEnum<{
|
|
501
511
|
draft: "draft";
|
|
@@ -516,7 +526,7 @@ declare function createFormsFragment(config: FormsConfig | undefined, options: F
|
|
|
516
526
|
static: "static";
|
|
517
527
|
}>;
|
|
518
528
|
title: zod0.ZodString;
|
|
519
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
529
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
520
530
|
slug: zod0.ZodString;
|
|
521
531
|
dataSchema: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
522
532
|
uiSchema: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
@@ -528,7 +538,7 @@ declare function createFormsFragment(config: FormsConfig | undefined, options: F
|
|
|
528
538
|
static: "static";
|
|
529
539
|
}>>;
|
|
530
540
|
title: zod0.ZodOptional<zod0.ZodString>;
|
|
531
|
-
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString
|
|
541
|
+
description: zod0.ZodOptional<zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>>;
|
|
532
542
|
slug: zod0.ZodOptional<zod0.ZodString>;
|
|
533
543
|
dataSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
534
544
|
uiSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
@@ -644,7 +654,7 @@ declare function createFormsClients(fragnoConfig: FragnoPublicClientConfig): {
|
|
|
644
654
|
useForm: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/:slug", zod0.ZodObject<{
|
|
645
655
|
id: zod0.ZodString;
|
|
646
656
|
title: zod0.ZodString;
|
|
647
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
657
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
648
658
|
slug: zod0.ZodString;
|
|
649
659
|
status: zod0.ZodEnum<{
|
|
650
660
|
draft: "draft";
|
|
@@ -665,7 +675,7 @@ declare function createFormsClients(fragnoConfig: FragnoPublicClientConfig): {
|
|
|
665
675
|
useForms: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/forms", NonNullable<zod0.ZodString | zod0.ZodArray<zod0.ZodObject<{
|
|
666
676
|
id: zod0.ZodString;
|
|
667
677
|
title: zod0.ZodString;
|
|
668
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
678
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
669
679
|
slug: zod0.ZodString;
|
|
670
680
|
status: zod0.ZodEnum<{
|
|
671
681
|
draft: "draft";
|
|
@@ -687,14 +697,14 @@ declare function createFormsClients(fragnoConfig: FragnoPublicClientConfig): {
|
|
|
687
697
|
static: "static";
|
|
688
698
|
}>;
|
|
689
699
|
title: zod0.ZodString;
|
|
690
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
700
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
691
701
|
slug: zod0.ZodString;
|
|
692
702
|
dataSchema: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
693
703
|
uiSchema: zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>;
|
|
694
704
|
}, zod_v4_core0.$strip> | undefined, zod0.ZodString | zod0.ZodArray<zod0.ZodObject<{
|
|
695
705
|
id: zod0.ZodString;
|
|
696
706
|
title: zod0.ZodString;
|
|
697
|
-
description: zod0.ZodNullable<zod0.ZodString
|
|
707
|
+
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>;
|
|
698
708
|
slug: zod0.ZodString;
|
|
699
709
|
status: zod0.ZodEnum<{
|
|
700
710
|
draft: "draft";
|
|
@@ -716,7 +726,7 @@ declare function createFormsClients(fragnoConfig: FragnoPublicClientConfig): {
|
|
|
716
726
|
static: "static";
|
|
717
727
|
}>>;
|
|
718
728
|
title: zod0.ZodOptional<zod0.ZodString>;
|
|
719
|
-
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString
|
|
729
|
+
description: zod0.ZodOptional<zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>>;
|
|
720
730
|
slug: zod0.ZodOptional<zod0.ZodString>;
|
|
721
731
|
dataSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
722
732
|
uiSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
@@ -729,7 +739,7 @@ declare function createFormsClients(fragnoConfig: FragnoPublicClientConfig): {
|
|
|
729
739
|
static: "static";
|
|
730
740
|
}>>;
|
|
731
741
|
title: zod0.ZodOptional<zod0.ZodString>;
|
|
732
|
-
description: zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString
|
|
742
|
+
description: zod0.ZodOptional<zod0.ZodOptional<zod0.ZodNullable<zod0.ZodString>>>;
|
|
733
743
|
slug: zod0.ZodOptional<zod0.ZodString>;
|
|
734
744
|
dataSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
735
745
|
uiSchema: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodUnknown>>;
|
|
@@ -763,5 +773,5 @@ declare function createFormsClients(fragnoConfig: FragnoPublicClientConfig): {
|
|
|
763
773
|
}, zod_v4_core0.$strip> | undefined, "NOT_FOUND", string>;
|
|
764
774
|
};
|
|
765
775
|
//#endregion
|
|
766
|
-
export { FormsConfig, type FragnoRouteConfig, StaticForm, type SubmissionSortOptions, createFormsClients, createFormsFragment, formsFragmentDef, routes };
|
|
776
|
+
export { type Form, type FormResponse, type FormResponseMetadata, type FormStatus, FormsConfig, type FragnoRouteConfig, type NewForm, type NewFormResponse, StaticForm, type SubmissionSortOptions, type UpdateForm, createFormsClients, createFormsFragment, formsFragmentDef, routes };
|
|
767
777
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/models.ts","../../../src/definition.ts","../../../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;cAEa,kBAAgB,CAAA,CAAA,UAAA,CAAA,CAAA,WAAA,CAAA,CAAA;cAChB,uBAAqB,CAAA,CAAA,UAAA,CAAA,CAAA,WAAA,CAAA,CAAA;cAErB,kBAAgB,CAAA,CAAA;;;;;;cAEhB,YAAU,CAAA,CAAA;MAWrB,CAAA,CAAA;;;;;;;;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kBAAA,eAAiC;;QAAwB,IAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/models.ts","../../../src/definition.ts","../../../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;cAEa,kBAAgB,CAAA,CAAA,UAAA,CAAA,CAAA,WAAA,CAAA,CAAA;cAChB,uBAAqB,CAAA,CAAA,UAAA,CAAA,CAAA,WAAA,CAAA,CAAA;cAErB,kBAAgB,CAAA,CAAA;;;;;;cAEhB,YAAU,CAAA,CAAA;MAWrB,CAAA,CAAA;;;;;;;;;;;;;;EAhBW,SAAA,WAAoD;CAAA,eAAA,CAAA;AAApC,cAkBhB,aAlBgB,EAkBH,CAAA,CAAA,SAlBG,CAAA;EAAA,MAAA,EAuB3B,CAAA,CAAA,OAvB2B,CAAA;IAAA,KAAA,EAAA,OAAA;IAAA,IAAA,EAAA,MAAA;IAChB,MAAA,EAAA,QAAA;IAAyD,MAAA,EAAA,QAAA;EAAA,CAAA,CAAA;EAApC,KAAA,aAAA;EAAA,WAAA,eAAA,cAAA,YAAA,CAAA,CAAA;EAAA,IAAA,aAAA;EAErB,UAAA,aAAgE,YAAhD,cAAA,CAAA;EAEhB,QAAA,aAWX,YAAA,cAAA,CAAA;CAAA,eAAA,CAAA;AAAA,cASW,gBATX,EAS2B,CAAA,CAAA,SAT3B,CAAA;wBASqD,CAAA,CAAA;;;;;;;;;;;;cAE1C,wBAAsB,CAAA,CAAA;yCAGjC,CAAA,CAAA;;;AAzBqB,cA2BV,kBA3BU,EA2BQ,CAAA,CAAA,SA3BR,CAAA;EAAA,EAAA,EAmCrB,CAAA,CAAA,SAnCqB;EAaV,MAAA,eAKX,YAAA,CAAA;EAAA,WAAA,aAAA;EAAA,IAAA,aAAA,YAAA,cAAA,CAAA;;;;;cAmBW,uBAAqB,CAAA,CAAA;oBAShC,CAAA,CAAA;;;KAEU,OAAA,GAAU,CAAA,CAAE,aAAa;KACzB,UAAA,GA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
123
|
title: z.string(),
|
|
124
|
-
description: z.string().nullable(),
|
|
125
|
-
slug: z.string(),
|
|
124
|
+
description: z.string().nullable().optional(),
|
|
125
|
+
slug: z.string().min(1).max(255).toLowerCase().trim(),
|
|
126
126
|
status: FormStatusSchema,
|
|
127
127
|
dataSchema: JSONSchemaSchema,
|
|
128
128
|
uiSchema: UISchemaElementSchema,
|
|
@@ -141,7 +141,7 @@ const ResponseMetadataSchema = z.object({
|
|
|
141
141
|
ip: z.union([z.ipv4(), z.ipv6()]).nullable(),
|
|
142
142
|
userAgent: z.string().max(4096).nullable()
|
|
143
143
|
});
|
|
144
|
-
const
|
|
144
|
+
const FormResponseSchema = z.object({
|
|
145
145
|
id: z.string(),
|
|
146
146
|
formId: z.string().nullable().describe("Form ID (static form ID or database form external ID)"),
|
|
147
147
|
formVersion: z.number(),
|
|
@@ -150,7 +150,7 @@ const ResponseSchema = z.object({
|
|
|
150
150
|
ip: z.string().max(45).nullable(),
|
|
151
151
|
userAgent: z.string().max(512).nullable()
|
|
152
152
|
});
|
|
153
|
-
const
|
|
153
|
+
const NewFormResponseSchema = FormResponseSchema.omit({
|
|
154
154
|
id: true,
|
|
155
155
|
submittedAt: true,
|
|
156
156
|
formId: true,
|
|
@@ -205,7 +205,7 @@ const publicRoutes = defineRoutes(formsFragmentDef).create(({ services, defineRo
|
|
|
205
205
|
}), defineRoute({
|
|
206
206
|
method: "POST",
|
|
207
207
|
path: "/:slug/submit",
|
|
208
|
-
inputSchema:
|
|
208
|
+
inputSchema: NewFormResponseSchema,
|
|
209
209
|
outputSchema: z.string(),
|
|
210
210
|
errorCodes: [
|
|
211
211
|
"NOT_FOUND",
|
|
@@ -313,7 +313,7 @@ const adminRoutes = defineRoutes(formsFragmentDef).create(({ services, defineRou
|
|
|
313
313
|
method: "GET",
|
|
314
314
|
path: "/admin/forms/:id/submissions",
|
|
315
315
|
queryParameters: ["sortOrder"],
|
|
316
|
-
outputSchema: z.array(
|
|
316
|
+
outputSchema: z.array(FormResponseSchema),
|
|
317
317
|
handler: async ({ pathParams, query }, { json }) => {
|
|
318
318
|
const sortOrder = query.get("sortOrder") === "asc" ? "asc" : "desc";
|
|
319
319
|
const responses = await services.listResponses(pathParams.id, {
|
|
@@ -326,7 +326,7 @@ const adminRoutes = defineRoutes(formsFragmentDef).create(({ services, defineRou
|
|
|
326
326
|
defineRoute({
|
|
327
327
|
method: "GET",
|
|
328
328
|
path: "/admin/submissions/:id",
|
|
329
|
-
outputSchema:
|
|
329
|
+
outputSchema: FormResponseSchema,
|
|
330
330
|
errorCodes: ["NOT_FOUND"],
|
|
331
331
|
handler: async ({ pathParams }, { json, error }) => {
|
|
332
332
|
const response = await services.getResponse(pathParams.id);
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["form: T","response: T","input: NewForm","id: string","slug: string","input: UpdateForm","schema: Schema","data: Record<string, unknown>","schema","formId: string","formVersion: number","data: ValidatedData","metadata?: { ip?: string | null; userAgent?: string | null }","sort: SubmissionSortOptions","headers: Headers","sf: StaticForm","config: FormsConfig","options: FragnoPublicConfigWithDatabase","fragnoConfig: FragnoPublicClientConfig"],"sources":["../../src/schema.ts","../../src/definition.ts","../../src/models.ts","../../src/routes.ts","../../src/index.ts"],"sourcesContent":["import { column, idColumn, schema } from \"@fragno-dev/db/schema\";\n\nexport const formsSchema = schema((s) => {\n return s\n .addTable(\"form\", (t) => {\n return t\n .addColumn(\"id\", idColumn())\n .addColumn(\"title\", column(\"string\"))\n .addColumn(\"description\", column(\"string\").nullable())\n .addColumn(\"slug\", column(\"string\"))\n .addColumn(\n \"status\",\n column(\"string\").defaultTo(() => \"draft\"),\n )\n .addColumn(\"dataSchema\", column(\"json\"))\n .addColumn(\"uiSchema\", column(\"json\"))\n .addColumn(\n \"version\",\n column(\"integer\").defaultTo(() => 1),\n )\n .addColumn(\n \"createdAt\",\n column(\"timestamp\").defaultTo((b) => b.now()),\n )\n .addColumn(\n \"updatedAt\",\n column(\"timestamp\").defaultTo((b) => b.now()),\n )\n .createIndex(\"idx_form_status\", [\"status\"])\n .createIndex(\"idx_form_slug\", [\"slug\"], { unique: true });\n })\n .addTable(\"response\", (t) => {\n return t\n .addColumn(\"id\", idColumn())\n .addColumn(\"formId\", column(\"string\"))\n .addColumn(\"formVersion\", column(\"integer\"))\n .addColumn(\"data\", column(\"json\"))\n .addColumn(\n \"submittedAt\",\n column(\"timestamp\").defaultTo((b) => b.now()),\n )\n .addColumn(\"userAgent\", column(\"string\").nullable())\n .addColumn(\"ip\", column(\"string\").nullable())\n .createIndex(\"idx_response_form\", [\"formId\"])\n .createIndex(\"idx_response_submitted_at\", [\"submittedAt\"]);\n });\n});\n","import { defineFragment } from \"@fragno-dev/core\";\nimport { withDatabase } from \"@fragno-dev/db\";\nimport { formsSchema } from \"./schema\";\nimport type { FormsConfig } from \".\";\nimport type { JSONSchema, NewForm, UpdateForm, FormStatus, UIElementSchema } from \"./models\";\nimport { Validator, type Schema } from \"@cfworker/json-schema\";\n\nexport type ValidatedData<T = Record<string, unknown>> = T;\nexport type ValidationResult =\n | { success: true; data: ValidatedData }\n | {\n success: false;\n error: { message: string; errors: Array<{ path: string; message: string }> };\n };\n\n// External to this fragment\nconst asExternalForm = <\n T extends { id: { externalId: string }; status: string; dataSchema: unknown; uiSchema: unknown },\n>(\n form: T,\n) => ({\n ...form,\n id: form.id.externalId,\n status: form.status as FormStatus,\n dataSchema: form.dataSchema as JSONSchema,\n uiSchema: form.uiSchema as UIElementSchema,\n});\n\nconst asExternalResponse = <\n T extends {\n id: { externalId: string };\n formId: string | null;\n data: unknown;\n ip: string | null;\n userAgent: string | null;\n },\n>(\n response: T,\n) => ({\n ...response,\n id: response.id.externalId,\n data: response.data as Record<string, unknown>,\n});\n\nexport interface SubmissionSortOptions {\n field: \"submittedAt\";\n order: \"asc\" | \"desc\";\n}\n\nexport const formsFragmentDef = defineFragment<FormsConfig>(\"forms\")\n .extend(withDatabase(formsSchema))\n .withDependencies(({ db }) => ({ db }))\n .providesBaseService(({ deps }) => {\n return {\n createForm: async (input: NewForm) => {\n return (await deps.db.create(\"form\", input)).externalId;\n },\n\n getForm: async (id: string) => {\n const form = await deps.db.findFirst(\"form\", (b) =>\n b.whereIndex(\"primary\", (eb) => eb(\"id\", \"=\", id)),\n );\n return form ? asExternalForm(form) : null;\n },\n\n getFormBySlug: async (slug: string) => {\n const form = await deps.db.findFirst(\"form\", (b) =>\n b.whereIndex(\"idx_form_slug\", (eb) => eb(\"slug\", \"=\", slug)),\n );\n return form ? asExternalForm(form) : null;\n },\n\n updateForm: async (id: string, input: UpdateForm) => {\n const uow = deps.db\n .createUnitOfWork()\n .find(\"form\", (b) => b.whereIndex(\"primary\", (eb) => eb(\"id\", \"=\", id)));\n\n const [currentForms] = await uow.executeRetrieve();\n\n if (currentForms.length === 0) {\n return { success: false };\n }\n // TODO: length > 1 ?\n\n const currentForm = currentForms[0];\n\n // Only increment version if changing data schema\n const newVersion = input.dataSchema ? currentForm.version + 1 : currentForm.version;\n\n uow.update(\"form\", currentForm.id, (b) => {\n b.set({ ...input, version: newVersion, updatedAt: new Date() }).check();\n });\n return uow.executeMutations();\n },\n\n listForms: async () => {\n const forms = await deps.db.find(\"form\", (b) => b.whereIndex(\"primary\"));\n return forms.map(asExternalForm);\n },\n\n deleteForm: async (id: string) => {\n await deps.db.delete(\"form\", id);\n },\n\n validateData: (schema: Schema, data: Record<string, unknown>): ValidationResult => {\n const validator = new Validator(schema);\n const result = validator.validate(data);\n\n if (result.valid) {\n return { success: true, data: data as ValidatedData };\n }\n console.error(\"ERROR\", JSON.stringify(result.errors));\n return {\n success: false,\n // TODO: better error type for validation errors?\n // see: https://jsonforms.io/docs/validation/#external-validation-errors\n error: {\n message: \"Validation failed\",\n errors: result.errors.map((e) => ({\n path: e.instanceLocation || \"\",\n message: e.error ?? \"Invalid value\",\n })),\n },\n };\n },\n\n createResponse: async (\n formId: string,\n formVersion: number,\n data: ValidatedData,\n metadata?: { ip?: string | null; userAgent?: string | null },\n ) => {\n return (\n await deps.db.create(\"response\", {\n formId,\n formVersion,\n data,\n ip: metadata?.ip ?? null,\n userAgent: metadata?.userAgent ?? null,\n })\n ).externalId;\n },\n\n getResponse: async (id: string) => {\n const response = await deps.db.findFirst(\"response\", (b) =>\n b.whereIndex(\"primary\", (eb) => eb(\"id\", \"=\", id)),\n );\n return response ? asExternalResponse(response) : null;\n },\n\n listResponses: async (\n formId: string,\n sort: SubmissionSortOptions = { field: \"submittedAt\", order: \"desc\" },\n ) => {\n const responses = await deps.db.find(\"response\", (b) =>\n b\n .whereIndex(\"idx_response_form\", (eb) => eb(\"formId\", \"=\", formId))\n .orderByIndex(\"idx_response_submitted_at\", sort.order),\n );\n return responses.map(asExternalResponse);\n },\n\n deleteResponse: async (id: string) => {\n return await deps.db.delete(\"response\", id);\n },\n };\n })\n .build();\n","import { z } from \"zod\";\n\nexport const JSONSchemaSchema = z.record(z.string(), z.unknown());\nexport const UISchemaElementSchema = z.record(z.string(), z.unknown());\n\nexport const FormStatusSchema = z.enum([\"draft\", \"open\", \"closed\", \"static\"]);\n\nexport const FormSchema = z.object({\n id: z.string(),\n title: z.string(),\n description: z.string().nullable(),\n slug: z.string(),\n status: FormStatusSchema,\n dataSchema: JSONSchemaSchema,\n uiSchema: UISchemaElementSchema,\n version: z.number(),\n createdAt: z.date(),\n updatedAt: z.date(),\n});\n\nexport const NewFormSchema = FormSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n version: true,\n});\n\nexport const UpdateFormSchema = NewFormSchema.partial();\n\nexport const ResponseMetadataSchema = z.object({\n ip: z.union([z.ipv4(), z.ipv6()]).nullable(),\n userAgent: z.string().max(4096).nullable(),\n});\n\nexport const ResponseSchema = z.object({\n id: z.string(),\n formId: z.string().nullable().describe(\"Form ID (static form ID or database form external ID)\"),\n formVersion: z.number(),\n data: z.record(z.string(), z.unknown()),\n submittedAt: z.date(),\n ip: z.string().max(45).nullable(),\n userAgent: z.string().max(512).nullable(),\n});\n\nexport const NewResponseSchema = ResponseSchema.omit({\n id: true,\n submittedAt: true,\n formId: true,\n formVersion: true,\n ip: true,\n userAgent: true,\n}).extend({\n securityToken: z.string().optional(),\n});\n\nexport type NewForm = z.infer<typeof NewFormSchema>;\nexport type UpdateForm = z.infer<typeof UpdateFormSchema>;\nexport type Form = z.infer<typeof FormSchema>;\nexport type NewResponse = z.infer<typeof NewResponseSchema>;\nexport type Response = z.infer<typeof ResponseSchema>;\nexport type ResponseMetadata = z.infer<typeof ResponseMetadataSchema>;\nexport type FormStatus = z.infer<typeof FormStatusSchema>;\nexport type JSONSchema = z.infer<typeof JSONSchemaSchema>;\nexport type UIElementSchema = z.infer<typeof UISchemaElementSchema>;\n","import { defineRoutes } from \"@fragno-dev/core\";\nimport type { Schema } from \"@cfworker/json-schema\";\nimport { z } from \"zod\";\nimport { formsFragmentDef } from \"./definition\";\nimport {\n FormSchema,\n NewFormSchema,\n NewResponseSchema,\n ResponseMetadataSchema,\n ResponseSchema,\n UpdateFormSchema,\n} from \"./models\";\nimport type { Form } from \"./models\";\nimport type { StaticForm } from \".\";\n\n/** Extract and validate request metadata from headers (untrusted input) */\nfunction extractRequestMetadata(headers: Headers) {\n const rawUserAgent = headers.get(\"User-Agent\");\n const rawIp =\n headers.get(\"CF-Connecting-IP\") ||\n headers.get(\"X-Forwarded-For\")?.split(\",\")[0].trim() ||\n headers.get(\"X-Real-IP\") ||\n null;\n const result = ResponseMetadataSchema.safeParse({\n ip: rawIp,\n userAgent: rawUserAgent,\n });\n\n // Return validated data or null values if validation fails\n return result.success ? result.data : { ip: null, userAgent: null };\n}\n\nconst staticAsRegularForm = (sf: StaticForm): Form => ({\n id: sf.id,\n title: sf.title,\n description: sf.description,\n slug: sf.slug,\n status: \"static\",\n dataSchema: sf.dataSchema,\n uiSchema: sf.uiSchema as unknown as Form[\"uiSchema\"],\n version: sf.version,\n createdAt: new Date(),\n updatedAt: new Date(),\n});\n\n// Public routes\nexport const publicRoutes = defineRoutes(formsFragmentDef).create(\n ({ services, defineRoute, config }) => {\n return [\n defineRoute({\n method: \"GET\",\n path: \"/:slug\",\n outputSchema: FormSchema,\n errorCodes: [\"NOT_FOUND\"] as const,\n handler: async ({ pathParams }, { json, error }) => {\n // Check static forms first\n const staticForm = config.staticForms?.find((f) => f.slug === pathParams.slug);\n if (staticForm) {\n return json(staticAsRegularForm(staticForm));\n }\n\n const form = await services.getFormBySlug(pathParams.slug);\n if (!form) {\n return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n }\n\n return json(form);\n },\n }),\n\n defineRoute({\n method: \"POST\",\n path: \"/:slug/submit\",\n inputSchema: NewResponseSchema,\n outputSchema: z.string(),\n errorCodes: [\"NOT_FOUND\", \"VALIDATION_ERROR\", \"FORM_NOT_OPEN\"] as const,\n handler: async ({ input, pathParams, headers }, { json, error }) => {\n const { data } = await input.valid();\n\n // Check static forms first\n const staticFormConfig = config.staticForms?.find((f) => f.slug === pathParams.slug);\n const form = staticFormConfig\n ? staticAsRegularForm(staticFormConfig)\n : await services.getFormBySlug(pathParams.slug);\n\n if (!form) {\n return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n }\n\n // Static forms and open forms accept submissions\n if (form.status !== \"open\" && form.status !== \"static\") {\n return error(\n { message: \"Form is not open, has status \" + form.status, code: \"FORM_NOT_OPEN\" },\n 400,\n );\n }\n\n // Form validation\n const result = services.validateData(form.dataSchema as Schema, data);\n\n if (!result.success) {\n const message = result.error.errors.map((e) => e.message).join(\" \");\n return error({ message, code: \"VALIDATION_ERROR\" }, 400);\n }\n\n // Extract and validate request metadata from headers\n const metadata = extractRequestMetadata(headers);\n\n const responseId = await services.createResponse(\n form.id,\n form.version,\n result.data,\n metadata,\n );\n\n if (config.onResponseSubmitted) {\n await config.onResponseSubmitted({\n id: responseId,\n formId: form.id,\n formVersion: form.version,\n data,\n submittedAt: new Date(),\n ip: metadata?.ip,\n userAgent: metadata?.userAgent,\n });\n }\n\n return json(responseId);\n },\n }),\n ];\n },\n);\n\n// Admin routes\nexport const adminRoutes = defineRoutes(formsFragmentDef).create(\n ({ services, defineRoute, config }) => {\n return [\n defineRoute({\n method: \"GET\",\n path: \"/admin/forms\",\n outputSchema: z.array(FormSchema),\n handler: async (_ctx, { json }) => {\n const dbForms = await services.listForms();\n const staticForms = (config.staticForms ?? []).map(staticAsRegularForm);\n return json([...staticForms, ...dbForms]);\n },\n }),\n\n defineRoute({\n method: \"POST\",\n path: \"/admin/forms\",\n inputSchema: NewFormSchema,\n outputSchema: z.string(),\n errorCodes: [\"CREATE_FAILED\"] as const,\n handler: async ({ input }, { json }) => {\n const data = await input.valid();\n const formId = await services.createForm(data);\n if (config.onFormCreated) {\n await config.onFormCreated({ ...data, id: formId });\n }\n return json(formId);\n },\n }),\n\n defineRoute({\n method: \"PUT\",\n path: \"/admin/forms/:id\",\n inputSchema: UpdateFormSchema,\n errorCodes: [\"NOT_FOUND\", \"STATIC_FORM_READ_ONLY\"] as const,\n handler: async ({ input, pathParams }, { json, error }) => {\n const isStatic = config.staticForms?.some((f) => f.id === pathParams.id);\n if (isStatic) {\n return error(\n { message: \"Static forms cannot be modified\", code: \"STATIC_FORM_READ_ONLY\" },\n 403,\n );\n }\n const data = await input.valid();\n const { success } = await services.updateForm(pathParams.id, data);\n if (!success) {\n return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n }\n return json(success);\n },\n }),\n\n defineRoute({\n method: \"DELETE\",\n path: \"/admin/forms/:id\",\n errorCodes: [\"NOT_FOUND\", \"STATIC_FORM_READ_ONLY\"] as const,\n handler: async ({ pathParams }, { json, error }) => {\n const isStatic = config.staticForms?.some((f) => f.id === pathParams.id);\n if (isStatic) {\n return error(\n { message: \"Static forms cannot be deleted\", code: \"STATIC_FORM_READ_ONLY\" },\n 403,\n );\n }\n await services.deleteForm(pathParams.id);\n // TODO: 404 when form not found\n // if (!deleted) {\n // return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n // }\n return json(true);\n },\n }),\n\n defineRoute({\n method: \"GET\",\n path: \"/admin/forms/:id/submissions\",\n queryParameters: [\"sortOrder\"] as const,\n outputSchema: z.array(ResponseSchema),\n handler: async ({ pathParams, query }, { json }) => {\n const sortOrder = query.get(\"sortOrder\") === \"asc\" ? \"asc\" : \"desc\";\n const responses = await services.listResponses(pathParams.id, {\n field: \"submittedAt\",\n order: sortOrder,\n });\n return json(responses);\n },\n }),\n\n defineRoute({\n method: \"GET\",\n path: \"/admin/submissions/:id\",\n outputSchema: ResponseSchema,\n errorCodes: [\"NOT_FOUND\"] as const,\n handler: async ({ pathParams }, { json, error }) => {\n const response = await services.getResponse(pathParams.id);\n if (!response) {\n return error({ message: \"Submission not found\", code: \"NOT_FOUND\" }, 404);\n }\n return json(response);\n },\n }),\n\n defineRoute({\n method: \"DELETE\",\n path: \"/admin/submissions/:id\",\n errorCodes: [\"NOT_FOUND\"] as const,\n handler: async ({ pathParams }, { json }) => {\n await services.deleteResponse(pathParams.id);\n // TODO: 404 when response not found\n // if (!deleted) {\n // return error({ message: \"Submission not found\", code: \"NOT_FOUND\" }, 404);\n // }\n return json(true);\n },\n }),\n ];\n },\n);\n","import { createClientBuilder } from \"@fragno-dev/core/client\";\nimport type { FragnoPublicClientConfig } from \"@fragno-dev/core/client\";\nimport type { FragnoPublicConfigWithDatabase } from \"@fragno-dev/db\";\nimport { instantiate } from \"@fragno-dev/core\";\nimport { publicRoutes, adminRoutes } from \"./routes\";\nimport { formsFragmentDef } from \"./definition\";\nimport type { Form, JSONSchema, Response } from \"./models\";\nimport type { UISchemaElement } from \"@jsonforms/core\";\n\n// Forms that exist in code, but submissions are stored in the DB\n// Static forms always have status: \"static\" and accept submissions\nexport interface StaticForm {\n id: string;\n title: string;\n description: string | null;\n slug: string;\n dataSchema: JSONSchema;\n uiSchema: UISchemaElement;\n version: number;\n}\n\nexport interface FormsConfig {\n onFormCreated?: (form: Omit<Form, \"version\" | \"createdAt\" | \"updatedAt\">) => Promise<void>;\n onResponseSubmitted?: (response: Response) => Promise<void>;\n staticForms?: StaticForm[];\n}\n\nexport const routes = [publicRoutes, adminRoutes] as const;\n\nexport function createFormsFragment(\n config: FormsConfig = {},\n options: FragnoPublicConfigWithDatabase,\n) {\n return instantiate(formsFragmentDef)\n .withConfig(config)\n .withRoutes(routes)\n .withOptions(options)\n .build();\n}\n\nexport function createFormsClients(fragnoConfig: FragnoPublicClientConfig) {\n const b = createClientBuilder(formsFragmentDef, fragnoConfig, routes);\n\n return {\n // Public\n useForm: b.createHook(\"/:slug\"),\n useSubmitForm: b.createMutator(\"POST\", \"/:slug/submit\"),\n\n // Admin - Forms\n useForms: b.createHook(\"/admin/forms\"),\n useCreateForm: b.createMutator(\"POST\", \"/admin/forms\"),\n useUpdateForm: b.createMutator(\"PUT\", \"/admin/forms/:id\"),\n useDeleteForm: b.createMutator(\"DELETE\", \"/admin/forms/:id\"),\n\n // Admin - Submissions\n useSubmissions: b.createHook(\"/admin/forms/:id/submissions\"),\n useSubmission: b.createHook(\"/admin/submissions/:id\"),\n useDeleteSubmission: b.createMutator(\"DELETE\", \"/admin/submissions/:id\"),\n };\n}\n\nexport { formsFragmentDef } from \"./definition\";\nexport type { SubmissionSortOptions } from \"./definition\";\nexport type { FragnoRouteConfig } from \"@fragno-dev/core\";\n"],"mappings":";;;;;;;;AAEA,MAAa,cAAc,OAAO,CAAC,MAAM;AACvC,QAAO,EACJ,SAAS,QAAQ,CAAC,MAAM;AACvB,SAAO,EACJ,UAAU,MAAM,UAAU,CAAC,CAC3B,UAAU,SAAS,OAAO,SAAS,CAAC,CACpC,UAAU,eAAe,OAAO,SAAS,CAAC,UAAU,CAAC,CACrD,UAAU,QAAQ,OAAO,SAAS,CAAC,CACnC,UACC,UACA,OAAO,SAAS,CAAC,UAAU,MAAM,QAAQ,CAC1C,CACA,UAAU,cAAc,OAAO,OAAO,CAAC,CACvC,UAAU,YAAY,OAAO,OAAO,CAAC,CACrC,UACC,WACA,OAAO,UAAU,CAAC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eAAe,EAAE,cAAc,UAAU,mBAAmB;EAG5D,gBAAgB,EAAE,WAAW,+BAA+B;EAC5D,eAAe,EAAE,WAAW,yBAAyB;EACrD,qBAAqB,EAAE,cAAc,UAAU,yBAAyB;CACzE;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["form: T","response: T","input: NewForm","id: string","slug: string","input: UpdateForm","schema: Schema","data: Record<string, unknown>","schema","formId: string","formVersion: number","data: ValidatedData","metadata?: { ip?: string | null; userAgent?: string | null }","sort: SubmissionSortOptions","headers: Headers","sf: StaticForm","config: FormsConfig","options: FragnoPublicConfigWithDatabase","fragnoConfig: FragnoPublicClientConfig"],"sources":["../../src/schema.ts","../../src/definition.ts","../../src/models.ts","../../src/routes.ts","../../src/index.ts"],"sourcesContent":["import { column, idColumn, schema } from \"@fragno-dev/db/schema\";\n\nexport const formsSchema = schema((s) => {\n return s\n .addTable(\"form\", (t) => {\n return t\n .addColumn(\"id\", idColumn())\n .addColumn(\"title\", column(\"string\"))\n .addColumn(\"description\", column(\"string\").nullable())\n .addColumn(\"slug\", column(\"string\"))\n .addColumn(\n \"status\",\n column(\"string\").defaultTo(() => \"draft\"),\n )\n .addColumn(\"dataSchema\", column(\"json\"))\n .addColumn(\"uiSchema\", column(\"json\"))\n .addColumn(\n \"version\",\n column(\"integer\").defaultTo(() => 1),\n )\n .addColumn(\n \"createdAt\",\n column(\"timestamp\").defaultTo((b) => b.now()),\n )\n .addColumn(\n \"updatedAt\",\n column(\"timestamp\").defaultTo((b) => b.now()),\n )\n .createIndex(\"idx_form_status\", [\"status\"])\n .createIndex(\"idx_form_slug\", [\"slug\"], { unique: true });\n })\n .addTable(\"response\", (t) => {\n return t\n .addColumn(\"id\", idColumn())\n .addColumn(\"formId\", column(\"string\"))\n .addColumn(\"formVersion\", column(\"integer\"))\n .addColumn(\"data\", column(\"json\"))\n .addColumn(\n \"submittedAt\",\n column(\"timestamp\").defaultTo((b) => b.now()),\n )\n .addColumn(\"userAgent\", column(\"string\").nullable())\n .addColumn(\"ip\", column(\"string\").nullable())\n .createIndex(\"idx_response_form\", [\"formId\"])\n .createIndex(\"idx_response_submitted_at\", [\"submittedAt\"]);\n });\n});\n","import { defineFragment } from \"@fragno-dev/core\";\nimport { withDatabase } from \"@fragno-dev/db\";\nimport { formsSchema } from \"./schema\";\nimport type { FormsConfig } from \".\";\nimport type { JSONSchema, NewForm, UpdateForm, FormStatus, UIElementSchema } from \"./models\";\nimport { Validator, type Schema } from \"@cfworker/json-schema\";\n\nexport type ValidatedData<T = Record<string, unknown>> = T;\nexport type ValidationResult =\n | { success: true; data: ValidatedData }\n | {\n success: false;\n error: { message: string; errors: Array<{ path: string; message: string }> };\n };\n\n// External to this fragment\nconst asExternalForm = <\n T extends { id: { externalId: string }; status: string; dataSchema: unknown; uiSchema: unknown },\n>(\n form: T,\n) => ({\n ...form,\n id: form.id.externalId,\n status: form.status as FormStatus,\n dataSchema: form.dataSchema as JSONSchema,\n uiSchema: form.uiSchema as UIElementSchema,\n});\n\nconst asExternalResponse = <\n T extends {\n id: { externalId: string };\n formId: string | null;\n data: unknown;\n ip: string | null;\n userAgent: string | null;\n },\n>(\n response: T,\n) => ({\n ...response,\n id: response.id.externalId,\n data: response.data as Record<string, unknown>,\n});\n\nexport interface SubmissionSortOptions {\n field: \"submittedAt\";\n order: \"asc\" | \"desc\";\n}\n\nexport const formsFragmentDef = defineFragment<FormsConfig>(\"forms\")\n .extend(withDatabase(formsSchema))\n .withDependencies(({ db }) => ({ db }))\n .providesBaseService(({ deps }) => {\n return {\n createForm: async (input: NewForm) => {\n return (await deps.db.create(\"form\", input)).externalId;\n },\n\n getForm: async (id: string) => {\n const form = await deps.db.findFirst(\"form\", (b) =>\n b.whereIndex(\"primary\", (eb) => eb(\"id\", \"=\", id)),\n );\n return form ? asExternalForm(form) : null;\n },\n\n getFormBySlug: async (slug: string) => {\n const form = await deps.db.findFirst(\"form\", (b) =>\n b.whereIndex(\"idx_form_slug\", (eb) => eb(\"slug\", \"=\", slug)),\n );\n return form ? asExternalForm(form) : null;\n },\n\n updateForm: async (id: string, input: UpdateForm) => {\n const uow = deps.db\n .createUnitOfWork()\n .find(\"form\", (b) => b.whereIndex(\"primary\", (eb) => eb(\"id\", \"=\", id)));\n\n const [currentForms] = await uow.executeRetrieve();\n\n if (currentForms.length === 0) {\n return { success: false };\n }\n // TODO: length > 1 ?\n\n const currentForm = currentForms[0];\n\n // Only increment version if changing data schema\n const newVersion = input.dataSchema ? currentForm.version + 1 : currentForm.version;\n\n uow.update(\"form\", currentForm.id, (b) => {\n b.set({ ...input, version: newVersion, updatedAt: new Date() }).check();\n });\n return uow.executeMutations();\n },\n\n listForms: async () => {\n const forms = await deps.db.find(\"form\", (b) => b.whereIndex(\"primary\"));\n return forms.map(asExternalForm);\n },\n\n deleteForm: async (id: string) => {\n await deps.db.delete(\"form\", id);\n },\n\n validateData: (schema: Schema, data: Record<string, unknown>): ValidationResult => {\n const validator = new Validator(schema);\n const result = validator.validate(data);\n\n if (result.valid) {\n return { success: true, data: data as ValidatedData };\n }\n console.error(\"ERROR\", JSON.stringify(result.errors));\n return {\n success: false,\n // TODO: better error type for validation errors?\n // see: https://jsonforms.io/docs/validation/#external-validation-errors\n error: {\n message: \"Validation failed\",\n errors: result.errors.map((e) => ({\n path: e.instanceLocation || \"\",\n message: e.error ?? \"Invalid value\",\n })),\n },\n };\n },\n\n createResponse: async (\n formId: string,\n formVersion: number,\n data: ValidatedData,\n metadata?: { ip?: string | null; userAgent?: string | null },\n ) => {\n return (\n await deps.db.create(\"response\", {\n formId,\n formVersion,\n data,\n ip: metadata?.ip ?? null,\n userAgent: metadata?.userAgent ?? null,\n })\n ).externalId;\n },\n\n getResponse: async (id: string) => {\n const response = await deps.db.findFirst(\"response\", (b) =>\n b.whereIndex(\"primary\", (eb) => eb(\"id\", \"=\", id)),\n );\n return response ? asExternalResponse(response) : null;\n },\n\n listResponses: async (\n formId: string,\n sort: SubmissionSortOptions = { field: \"submittedAt\", order: \"desc\" },\n ) => {\n const responses = await deps.db.find(\"response\", (b) =>\n b\n .whereIndex(\"idx_response_form\", (eb) => eb(\"formId\", \"=\", formId))\n .orderByIndex(\"idx_response_submitted_at\", sort.order),\n );\n return responses.map(asExternalResponse);\n },\n\n deleteResponse: async (id: string) => {\n return await deps.db.delete(\"response\", id);\n },\n };\n })\n .build();\n","import { z } from \"zod\";\n\nexport const JSONSchemaSchema = z.record(z.string(), z.unknown());\nexport const UISchemaElementSchema = z.record(z.string(), z.unknown());\n\nexport const FormStatusSchema = z.enum([\"draft\", \"open\", \"closed\", \"static\"]);\n\nexport const FormSchema = z.object({\n id: z.string(),\n title: z.string(),\n description: z.string().nullable().optional(),\n slug: z.string().min(1).max(255).toLowerCase().trim(),\n status: FormStatusSchema,\n dataSchema: JSONSchemaSchema,\n uiSchema: UISchemaElementSchema,\n version: z.number(),\n createdAt: z.date(),\n updatedAt: z.date(),\n});\n\nexport const NewFormSchema = FormSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n version: true,\n});\n\nexport const UpdateFormSchema = NewFormSchema.partial();\n\nexport const ResponseMetadataSchema = z.object({\n ip: z.union([z.ipv4(), z.ipv6()]).nullable(),\n userAgent: z.string().max(4096).nullable(),\n});\n\nexport const FormResponseSchema = z.object({\n id: z.string(),\n formId: z.string().nullable().describe(\"Form ID (static form ID or database form external ID)\"),\n formVersion: z.number(),\n data: z.record(z.string(), z.unknown()),\n submittedAt: z.date(),\n ip: z.string().max(45).nullable(),\n userAgent: z.string().max(512).nullable(),\n});\n\nexport const NewFormResponseSchema = FormResponseSchema.omit({\n id: true,\n submittedAt: true,\n formId: true,\n formVersion: true,\n ip: true,\n userAgent: true,\n}).extend({\n securityToken: z.string().optional(),\n});\n\nexport type NewForm = z.infer<typeof NewFormSchema>;\nexport type UpdateForm = z.infer<typeof UpdateFormSchema>;\nexport type Form = z.infer<typeof FormSchema>;\nexport type NewFormResponse = z.infer<typeof NewFormResponseSchema>;\nexport type FormResponse = z.infer<typeof FormResponseSchema>;\nexport type FormResponseMetadata = z.infer<typeof ResponseMetadataSchema>;\nexport type FormStatus = z.infer<typeof FormStatusSchema>;\nexport type JSONSchema = z.infer<typeof JSONSchemaSchema>;\nexport type UIElementSchema = z.infer<typeof UISchemaElementSchema>;\n","import { defineRoutes } from \"@fragno-dev/core\";\nimport type { Schema } from \"@cfworker/json-schema\";\nimport { z } from \"zod\";\nimport { formsFragmentDef } from \"./definition\";\nimport {\n FormSchema,\n NewFormSchema,\n NewFormResponseSchema,\n ResponseMetadataSchema,\n FormResponseSchema,\n UpdateFormSchema,\n} from \"./models\";\nimport type { Form } from \"./models\";\nimport type { StaticForm } from \".\";\n\n/** Extract and validate request metadata from headers (untrusted input) */\nfunction extractRequestMetadata(headers: Headers) {\n const rawUserAgent = headers.get(\"User-Agent\");\n const rawIp =\n headers.get(\"CF-Connecting-IP\") ||\n headers.get(\"X-Forwarded-For\")?.split(\",\")[0].trim() ||\n headers.get(\"X-Real-IP\") ||\n null;\n const result = ResponseMetadataSchema.safeParse({\n ip: rawIp,\n userAgent: rawUserAgent,\n });\n\n // Return validated data or null values if validation fails\n return result.success ? result.data : { ip: null, userAgent: null };\n}\n\nconst staticAsRegularForm = (sf: StaticForm): Form => ({\n id: sf.id,\n title: sf.title,\n description: sf.description,\n slug: sf.slug,\n status: \"static\",\n dataSchema: sf.dataSchema,\n uiSchema: sf.uiSchema as unknown as Form[\"uiSchema\"],\n version: sf.version,\n createdAt: new Date(),\n updatedAt: new Date(),\n});\n\n// Public routes\nexport const publicRoutes = defineRoutes(formsFragmentDef).create(\n ({ services, defineRoute, config }) => {\n return [\n defineRoute({\n method: \"GET\",\n path: \"/:slug\",\n outputSchema: FormSchema,\n errorCodes: [\"NOT_FOUND\"] as const,\n handler: async ({ pathParams }, { json, error }) => {\n // Check static forms first\n const staticForm = config.staticForms?.find((f) => f.slug === pathParams.slug);\n if (staticForm) {\n return json(staticAsRegularForm(staticForm));\n }\n\n const form = await services.getFormBySlug(pathParams.slug);\n if (!form) {\n return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n }\n\n return json(form);\n },\n }),\n\n defineRoute({\n method: \"POST\",\n path: \"/:slug/submit\",\n inputSchema: NewFormResponseSchema,\n outputSchema: z.string(),\n errorCodes: [\"NOT_FOUND\", \"VALIDATION_ERROR\", \"FORM_NOT_OPEN\"] as const,\n handler: async ({ input, pathParams, headers }, { json, error }) => {\n const { data } = await input.valid();\n\n // Check static forms first\n const staticFormConfig = config.staticForms?.find((f) => f.slug === pathParams.slug);\n const form = staticFormConfig\n ? staticAsRegularForm(staticFormConfig)\n : await services.getFormBySlug(pathParams.slug);\n\n if (!form) {\n return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n }\n\n // Static forms and open forms accept submissions\n if (form.status !== \"open\" && form.status !== \"static\") {\n return error(\n { message: \"Form is not open, has status \" + form.status, code: \"FORM_NOT_OPEN\" },\n 400,\n );\n }\n\n // Form validation\n const result = services.validateData(form.dataSchema as Schema, data);\n\n if (!result.success) {\n const message = result.error.errors.map((e) => e.message).join(\" \");\n return error({ message, code: \"VALIDATION_ERROR\" }, 400);\n }\n\n // Extract and validate request metadata from headers\n const metadata = extractRequestMetadata(headers);\n\n const responseId = await services.createResponse(\n form.id,\n form.version,\n result.data,\n metadata,\n );\n\n if (config.onResponseSubmitted) {\n await config.onResponseSubmitted({\n id: responseId,\n formId: form.id,\n formVersion: form.version,\n data,\n submittedAt: new Date(),\n ip: metadata?.ip,\n userAgent: metadata?.userAgent,\n });\n }\n\n return json(responseId);\n },\n }),\n ];\n },\n);\n\n// Admin routes\nexport const adminRoutes = defineRoutes(formsFragmentDef).create(\n ({ services, defineRoute, config }) => {\n return [\n defineRoute({\n method: \"GET\",\n path: \"/admin/forms\",\n outputSchema: z.array(FormSchema),\n handler: async (_ctx, { json }) => {\n const dbForms = await services.listForms();\n const staticForms = (config.staticForms ?? []).map(staticAsRegularForm);\n return json([...staticForms, ...dbForms]);\n },\n }),\n\n defineRoute({\n method: \"POST\",\n path: \"/admin/forms\",\n inputSchema: NewFormSchema,\n outputSchema: z.string(),\n errorCodes: [\"CREATE_FAILED\"] as const,\n handler: async ({ input }, { json }) => {\n const data = await input.valid();\n const formId = await services.createForm(data);\n if (config.onFormCreated) {\n await config.onFormCreated({ ...data, id: formId });\n }\n return json(formId);\n },\n }),\n\n defineRoute({\n method: \"PUT\",\n path: \"/admin/forms/:id\",\n inputSchema: UpdateFormSchema,\n errorCodes: [\"NOT_FOUND\", \"STATIC_FORM_READ_ONLY\"] as const,\n handler: async ({ input, pathParams }, { json, error }) => {\n const isStatic = config.staticForms?.some((f) => f.id === pathParams.id);\n if (isStatic) {\n return error(\n { message: \"Static forms cannot be modified\", code: \"STATIC_FORM_READ_ONLY\" },\n 403,\n );\n }\n const data = await input.valid();\n const { success } = await services.updateForm(pathParams.id, data);\n if (!success) {\n return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n }\n return json(success);\n },\n }),\n\n defineRoute({\n method: \"DELETE\",\n path: \"/admin/forms/:id\",\n errorCodes: [\"NOT_FOUND\", \"STATIC_FORM_READ_ONLY\"] as const,\n handler: async ({ pathParams }, { json, error }) => {\n const isStatic = config.staticForms?.some((f) => f.id === pathParams.id);\n if (isStatic) {\n return error(\n { message: \"Static forms cannot be deleted\", code: \"STATIC_FORM_READ_ONLY\" },\n 403,\n );\n }\n await services.deleteForm(pathParams.id);\n // TODO: 404 when form not found\n // if (!deleted) {\n // return error({ message: \"Form not found\", code: \"NOT_FOUND\" }, 404);\n // }\n return json(true);\n },\n }),\n\n defineRoute({\n method: \"GET\",\n path: \"/admin/forms/:id/submissions\",\n queryParameters: [\"sortOrder\"] as const,\n outputSchema: z.array(FormResponseSchema),\n handler: async ({ pathParams, query }, { json }) => {\n const sortOrder = query.get(\"sortOrder\") === \"asc\" ? \"asc\" : \"desc\";\n const responses = await services.listResponses(pathParams.id, {\n field: \"submittedAt\",\n order: sortOrder,\n });\n return json(responses);\n },\n }),\n\n defineRoute({\n method: \"GET\",\n path: \"/admin/submissions/:id\",\n outputSchema: FormResponseSchema,\n errorCodes: [\"NOT_FOUND\"] as const,\n handler: async ({ pathParams }, { json, error }) => {\n const response = await services.getResponse(pathParams.id);\n if (!response) {\n return error({ message: \"Submission not found\", code: \"NOT_FOUND\" }, 404);\n }\n return json(response);\n },\n }),\n\n defineRoute({\n method: \"DELETE\",\n path: \"/admin/submissions/:id\",\n errorCodes: [\"NOT_FOUND\"] as const,\n handler: async ({ pathParams }, { json }) => {\n await services.deleteResponse(pathParams.id);\n // TODO: 404 when response not found\n // if (!deleted) {\n // return error({ message: \"Submission not found\", code: \"NOT_FOUND\" }, 404);\n // }\n return json(true);\n },\n }),\n ];\n },\n);\n","import { createClientBuilder } from \"@fragno-dev/core/client\";\nimport type { FragnoPublicClientConfig } from \"@fragno-dev/core/client\";\nimport type { FragnoPublicConfigWithDatabase } from \"@fragno-dev/db\";\nimport { instantiate } from \"@fragno-dev/core\";\nimport { publicRoutes, adminRoutes } from \"./routes\";\nimport { formsFragmentDef } from \"./definition\";\nimport type { Form, JSONSchema, FormResponse } from \"./models\";\nimport type { UISchemaElement } from \"@jsonforms/core\";\n\n// Forms that exist in code, but submissions are stored in the DB\n// Static forms always have status: \"static\" and accept submissions\nexport interface StaticForm {\n id: string;\n title: string;\n description: string | null;\n slug: string;\n dataSchema: JSONSchema;\n uiSchema: UISchemaElement;\n version: number;\n}\n\nexport interface FormsConfig {\n onFormCreated?: (form: Omit<Form, \"version\" | \"createdAt\" | \"updatedAt\">) => Promise<void>;\n onResponseSubmitted?: (response: FormResponse) => Promise<void>;\n staticForms?: StaticForm[];\n}\n\nexport const routes = [publicRoutes, adminRoutes] as const;\n\nexport function createFormsFragment(\n config: FormsConfig = {},\n options: FragnoPublicConfigWithDatabase,\n) {\n return instantiate(formsFragmentDef)\n .withConfig(config)\n .withRoutes(routes)\n .withOptions(options)\n .build();\n}\n\nexport function createFormsClients(fragnoConfig: FragnoPublicClientConfig) {\n const b = createClientBuilder(formsFragmentDef, fragnoConfig, routes);\n\n return {\n // Public\n useForm: b.createHook(\"/:slug\"),\n useSubmitForm: b.createMutator(\"POST\", \"/:slug/submit\"),\n\n // Admin - Forms\n useForms: b.createHook(\"/admin/forms\"),\n useCreateForm: b.createMutator(\"POST\", \"/admin/forms\"),\n useUpdateForm: b.createMutator(\"PUT\", \"/admin/forms/:id\"),\n useDeleteForm: b.createMutator(\"DELETE\", \"/admin/forms/:id\"),\n\n // Admin - Submissions\n useSubmissions: b.createHook(\"/admin/forms/:id/submissions\"),\n useSubmission: b.createHook(\"/admin/submissions/:id\"),\n useDeleteSubmission: b.createMutator(\"DELETE\", \"/admin/submissions/:id\"),\n };\n}\n\nexport { formsFragmentDef } from \"./definition\";\nexport type { SubmissionSortOptions } from \"./definition\";\nexport type { FragnoRouteConfig } from \"@fragno-dev/core\";\nexport type {\n NewForm,\n UpdateForm,\n Form,\n NewFormResponse,\n FormResponse,\n FormResponseMetadata,\n FormStatus,\n} from \"./models\";\n"],"mappings":";;;;;;;;AAEA,MAAa,cAAc,OAAO,CAAC,MAAM;AACvC,QAAO,EACJ,SAAS,QAAQ,CAAC,MAAM;AACvB,SAAO,EACJ,UAAU,MAAM,UAAU,CAAC,CAC3B,UAAU,SAAS,OAAO,SAAS,CAAC,CACpC,UAAU,eAAe,OAAO,SAAS,CAAC,UAAU,CAAC,CACrD,UAAU,QAAQ,OAAO,SAAS,CAAC,CACnC,UACC,UACA,OAAO,SAAS,CAAC,UAAU,MAAM,QAAQ,CAC1C,CACA,UAAU,cAAc,OAAO,OAAO,CAAC,CACvC,UAAU,YAAY,OAAO,OAAO,CAAC,CACrC,UACC,WACA,OAAO,UAAU,CAAC,UAAU,MAAM,EAAE,CACrC,CACA,UACC,aACA,OAAO,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAC9C,CACA,UACC,aACA,OAAO,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAC9C,CACA,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EACrD,qBAAqB,EAAE,cAAc,UAAU,yBAAyB;CACzE;AACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Form builder fragment",
|
|
3
3
|
"name": "@fragno-dev/forms",
|
|
4
|
-
"version": "0.0.0-canary-
|
|
4
|
+
"version": "0.0.0-canary-20592511303-1-20251230084048",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
"@cfworker/json-schema": "^4.1.1",
|
|
69
69
|
"@jsonforms/core": "^3.7.0",
|
|
70
70
|
"zod": "^4.0.5",
|
|
71
|
-
"@fragno-dev/core": "0.1
|
|
72
|
-
"@fragno-dev/db": "0.
|
|
71
|
+
"@fragno-dev/core": "0.0.0-canary-20592511303-1-20251230084048",
|
|
72
|
+
"@fragno-dev/db": "0.2.2"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/node": "^22",
|
|
76
76
|
"@vitest/coverage-istanbul": "^3.2.4",
|
|
77
77
|
"tsdown": "^0.11.9",
|
|
78
78
|
"vitest": "^3.2.4",
|
|
79
|
-
"@fragno-dev/test": "0.0.0-canary-
|
|
79
|
+
"@fragno-dev/test": "0.0.0-canary-20592511303-1-20251230084048",
|
|
80
80
|
"@fragno-dev/unplugin-fragno": "0.0.7",
|
|
81
81
|
"@fragno-private/typescript-config": "0.0.1",
|
|
82
82
|
"@fragno-private/vitest-config": "0.0.0"
|