@usefillo/core 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -299,7 +299,7 @@ interface ValidationResult {
|
|
|
299
299
|
declare function validateResponse(form: FormSchema, data: ResponseData): ValidationResult;
|
|
300
300
|
|
|
301
301
|
declare const FILLO_SCHEMA_VERSION: 1;
|
|
302
|
-
declare const FILLO_SDK_VERSION = "0.
|
|
302
|
+
declare const FILLO_SDK_VERSION = "0.5.0";
|
|
303
303
|
interface SchemaValidationResult {
|
|
304
304
|
ok: boolean;
|
|
305
305
|
/** Present when ok — a normalized, structurally-valid schema. */
|
package/dist/index.js
CHANGED
|
@@ -229,7 +229,7 @@ function validateField(field, value) {
|
|
|
229
229
|
return null;
|
|
230
230
|
}
|
|
231
231
|
case "email": {
|
|
232
|
-
const r = z.
|
|
232
|
+
const r = z.email().safeParse(value);
|
|
233
233
|
return r.success ? null : "Enter a valid email address";
|
|
234
234
|
}
|
|
235
235
|
case "url": {
|
|
@@ -415,11 +415,11 @@ var schemaShape = z2.object({
|
|
|
415
415
|
title: z2.string().max(2e3).optional().default(""),
|
|
416
416
|
description: z2.string().max(5e3).optional(),
|
|
417
417
|
pages: z2.array(pageSchema).min(1).max(50),
|
|
418
|
-
settings: z2.record(z2.unknown()).optional().default({})
|
|
418
|
+
settings: z2.record(z2.string(), z2.unknown()).optional().default({})
|
|
419
419
|
});
|
|
420
420
|
var MAX_SCHEMA_VERSION = 1;
|
|
421
421
|
var FILLO_SCHEMA_VERSION = 1;
|
|
422
|
-
var FILLO_SDK_VERSION = "0.
|
|
422
|
+
var FILLO_SDK_VERSION = "0.5.0";
|
|
423
423
|
function str(value, max, fallback = "") {
|
|
424
424
|
return typeof value === "string" ? value.trim().slice(0, max) : fallback;
|
|
425
425
|
}
|
|
@@ -505,7 +505,7 @@ function normalizeSettings(value) {
|
|
|
505
505
|
redirectUrl: normalizeUrl(rec.redirectUrl),
|
|
506
506
|
showProgress: bool(rec.showProgress),
|
|
507
507
|
submissionLimit,
|
|
508
|
-
notifyEmail: z2.
|
|
508
|
+
notifyEmail: z2.email().max(254).safeParse(rec.notifyEmail).success ? rec.notifyEmail : void 0,
|
|
509
509
|
sendReceipt: bool(rec.sendReceipt)
|
|
510
510
|
};
|
|
511
511
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usefillo/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Form schema, validation, logic engine and JS client for Fillo. Framework-agnostic.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"zod": "^
|
|
32
|
+
"zod": "^4.4.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"tsup": "^8.4.0",
|