@getcommunity/gc-validators 0.0.271-alpha.25 → 0.0.271-alpha.27
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/base/index.cjs +9 -27
- package/dist/base/index.d.cts +2 -2
- package/dist/base/index.d.mts +4 -4
- package/dist/base/index.mjs +5 -5
- package/dist/components/blocks/index.cjs +5 -4
- package/dist/components/blocks/index.d.cts +1 -1
- package/dist/components/blocks/index.d.mts +1 -1
- package/dist/components/blocks/index.mjs +5 -4
- package/dist/components/brand/index.cjs +3 -2
- package/dist/components/brand/index.d.cts +1 -1
- package/dist/components/brand/index.d.mts +1 -1
- package/dist/components/brand/index.mjs +3 -2
- package/dist/components/forms/index.cjs +2 -1
- package/dist/components/forms/index.d.cts +280 -280
- package/dist/components/forms/index.d.mts +280 -280
- package/dist/components/forms/index.mjs +2 -1
- package/dist/components/shared/index.cjs +5 -4
- package/dist/components/shared/index.d.cts +1 -1
- package/dist/components/shared/index.d.mts +1 -1
- package/dist/components/shared/index.mjs +5 -4
- package/dist/components/slideshow/index.d.cts +280 -280
- package/dist/components/slideshow/index.d.mts +280 -280
- package/dist/components/utm/index.d.mts +1 -1
- package/dist/constants/index.cjs +45 -43
- package/dist/constants/index.mjs +4 -2
- package/dist/{document-TlMeVEGy.d.cts → document-3h6g5Qqr.d.cts} +1 -1
- package/dist/{document-DjM6F56Q.cjs → document-AqtoEbX8.cjs} +19 -24
- package/dist/{document-aEa-gTmH.mjs → document-BCbxKqGE.mjs} +20 -19
- package/dist/{document-kvIqz0p6.mjs → document-BWso8VC7.mjs} +62 -56
- package/dist/{document-CwIvc2p7.cjs → document-DJJFS5o8.cjs} +2 -1
- package/dist/{document-CDavjuJ-.mjs → document-DRyRy2Mw.mjs} +2 -1
- package/dist/{document-CAkRm1Y_.d.mts → document-DqE9ISOk.d.mts} +2 -2
- package/dist/{document-DOVZwQRq.cjs → document-DwkycUz9.cjs} +74 -62
- package/dist/email-ByTEdUjg.cjs +13 -0
- package/dist/email-Cnyi5Neo.mjs +6 -0
- package/dist/entities/audit-log/index.cjs +44 -41
- package/dist/entities/audit-log/index.d.cts +3 -2
- package/dist/entities/audit-log/index.d.mts +4 -3
- package/dist/entities/audit-log/index.mjs +6 -3
- package/dist/entities/blog-page/index.d.cts +1 -1
- package/dist/entities/blog-page/index.d.mts +1 -1
- package/dist/entities/blog-post/index.cjs +10 -9
- package/dist/entities/blog-post/index.d.cts +1 -1
- package/dist/entities/blog-post/index.d.mts +1 -1
- package/dist/entities/blog-post/index.mjs +4 -3
- package/dist/entities/careers-page/index.d.cts +1 -1
- package/dist/entities/careers-page/index.d.mts +1 -1
- package/dist/entities/category/index.cjs +15 -13
- package/dist/entities/category/index.d.cts +7 -6
- package/dist/entities/category/index.d.mts +7 -6
- package/dist/entities/category/index.mjs +11 -9
- package/dist/entities/client/index.cjs +23 -22
- package/dist/entities/client/index.d.cts +1 -1
- package/dist/entities/client/index.d.mts +1 -1
- package/dist/entities/client/index.mjs +16 -15
- package/dist/entities/client-content-pillar/index.cjs +14 -13
- package/dist/entities/client-content-pillar/index.d.cts +1 -1
- package/dist/entities/client-content-pillar/index.d.mts +1 -1
- package/dist/entities/client-content-pillar/index.mjs +12 -11
- package/dist/entities/client-media-platform/index.cjs +18 -16
- package/dist/entities/client-media-platform/index.d.cts +1 -1
- package/dist/entities/client-media-platform/index.d.mts +1 -1
- package/dist/entities/client-media-platform/index.mjs +13 -11
- package/dist/entities/client-project/index.cjs +47 -41
- package/dist/entities/client-project/index.d.cts +1 -1
- package/dist/entities/client-project/index.d.mts +1 -1
- package/dist/entities/client-project/index.mjs +11 -5
- package/dist/entities/client-report/index.cjs +18 -16
- package/dist/entities/client-report/index.d.cts +1 -1
- package/dist/entities/client-report/index.d.mts +1 -1
- package/dist/entities/client-report/index.mjs +14 -12
- package/dist/entities/client-styleguide/index.cjs +14 -13
- package/dist/entities/client-styleguide/index.d.cts +1 -1
- package/dist/entities/client-styleguide/index.d.mts +1 -1
- package/dist/entities/client-styleguide/index.mjs +11 -10
- package/dist/entities/client-user/index.cjs +7 -7
- package/dist/entities/client-user/index.d.cts +1 -1
- package/dist/entities/client-user/index.d.mts +1 -1
- package/dist/entities/client-user/index.mjs +5 -5
- package/dist/entities/comment/index.cjs +18 -16
- package/dist/entities/comment/index.d.cts +1 -1
- package/dist/entities/comment/index.d.mts +1 -1
- package/dist/entities/comment/index.mjs +12 -10
- package/dist/entities/content-pillar/index.cjs +20 -18
- package/dist/entities/content-pillar/index.d.cts +1 -1
- package/dist/entities/content-pillar/index.d.mts +1 -1
- package/dist/entities/content-pillar/index.mjs +15 -13
- package/dist/entities/faq-page/index.cjs +2 -1
- package/dist/entities/faq-page/index.d.cts +2 -2
- package/dist/entities/faq-page/index.d.mts +3 -3
- package/dist/entities/faq-page/index.mjs +2 -1
- package/dist/entities/formatter/index.d.cts +5 -5
- package/dist/entities/formatter/index.d.mts +5 -5
- package/dist/entities/gcflytour/index.cjs +21 -19
- package/dist/entities/gcflytour/index.d.cts +1 -1
- package/dist/entities/gcflytour/index.d.mts +1 -1
- package/dist/entities/gcflytour/index.mjs +17 -15
- package/dist/entities/gcflytour-snap/index.cjs +20 -18
- package/dist/entities/gcflytour-snap/index.d.cts +1 -1
- package/dist/entities/gcflytour-snap/index.d.mts +1 -1
- package/dist/entities/gcflytour-snap/index.mjs +16 -14
- package/dist/entities/landing-page/index.d.cts +2 -2
- package/dist/entities/landing-page/index.d.mts +3 -3
- package/dist/entities/lead/index.cjs +25 -23
- package/dist/entities/lead/index.mjs +15 -13
- package/dist/entities/media-content-type/index.cjs +21 -19
- package/dist/entities/media-content-type/index.d.cts +7 -6
- package/dist/entities/media-content-type/index.d.mts +7 -6
- package/dist/entities/media-content-type/index.mjs +17 -15
- package/dist/entities/media-creative-format/index.cjs +19 -17
- package/dist/entities/media-creative-format/index.d.cts +7 -6
- package/dist/entities/media-creative-format/index.d.mts +7 -6
- package/dist/entities/media-creative-format/index.mjs +15 -13
- package/dist/entities/media-medium/index.cjs +19 -17
- package/dist/entities/media-medium/index.d.cts +7 -6
- package/dist/entities/media-medium/index.d.mts +7 -6
- package/dist/entities/media-medium/index.mjs +15 -13
- package/dist/entities/media-platform/index.cjs +27 -24
- package/dist/entities/media-platform/index.d.cts +1 -1
- package/dist/entities/media-platform/index.d.mts +1 -1
- package/dist/entities/media-platform/index.mjs +23 -20
- package/dist/entities/monday-workspace/index.cjs +17 -15
- package/dist/entities/monday-workspace/index.d.cts +1 -1
- package/dist/entities/monday-workspace/index.d.mts +1 -1
- package/dist/entities/monday-workspace/index.mjs +11 -9
- package/dist/entities/newsletter-signup/index.cjs +25 -23
- package/dist/entities/newsletter-signup/index.mjs +13 -11
- package/dist/entities/policy-page/index.cjs +2 -1
- package/dist/entities/policy-page/index.d.cts +1 -1
- package/dist/entities/policy-page/index.d.mts +2 -2
- package/dist/entities/policy-page/index.mjs +2 -1
- package/dist/entities/product/index.cjs +1 -1
- package/dist/entities/product/index.d.cts +1 -1
- package/dist/entities/product/index.d.mts +1 -1
- package/dist/entities/product/index.mjs +1 -1
- package/dist/entities/product-highlight/index.cjs +1 -1
- package/dist/entities/product-highlight/index.d.cts +1 -1
- package/dist/entities/product-highlight/index.d.mts +1 -1
- package/dist/entities/product-highlight/index.mjs +1 -1
- package/dist/entities/resume/index.cjs +43 -40
- package/dist/entities/resume/index.mjs +16 -13
- package/dist/entities/sharpspring/index.cjs +9 -8
- package/dist/entities/sharpspring/index.mjs +6 -5
- package/dist/entities/tag/index.cjs +15 -13
- package/dist/entities/tag/index.d.cts +6 -5
- package/dist/entities/tag/index.d.mts +7 -6
- package/dist/entities/tag/index.mjs +11 -9
- package/dist/entities/team-member/index.cjs +11 -9
- package/dist/entities/team-member/index.d.cts +2 -2
- package/dist/entities/team-member/index.d.mts +2 -2
- package/dist/entities/team-member/index.mjs +7 -4
- package/dist/entities/team-page/index.d.cts +1 -1
- package/dist/entities/team-page/index.d.mts +1 -1
- package/dist/entities/teamwork/index.cjs +12 -11
- package/dist/entities/teamwork/index.d.mts +1 -1
- package/dist/entities/teamwork/index.mjs +7 -6
- package/dist/entities/trend/index.cjs +2 -2
- package/dist/entities/trend/index.d.cts +1 -1
- package/dist/entities/trend/index.d.mts +1 -1
- package/dist/entities/trend/index.mjs +2 -2
- package/dist/entities/up-auth/index.cjs +18 -15
- package/dist/entities/up-auth/index.d.cts +1 -1
- package/dist/entities/up-auth/index.d.mts +1 -1
- package/dist/entities/up-auth/index.mjs +6 -3
- package/dist/entities/up-permission/index.cjs +1 -1
- package/dist/entities/up-permission/index.d.cts +1 -1
- package/dist/entities/up-permission/index.d.mts +1 -1
- package/dist/entities/up-permission/index.mjs +1 -1
- package/dist/entities/up-role/index.cjs +1 -1
- package/dist/entities/up-role/index.d.cts +1 -1
- package/dist/entities/up-role/index.d.mts +1 -1
- package/dist/entities/up-role/index.mjs +1 -1
- package/dist/entities/up-user/index.cjs +2 -1
- package/dist/entities/up-user/index.d.cts +2 -2
- package/dist/entities/up-user/index.d.mts +2 -2
- package/dist/entities/up-user/index.mjs +2 -2
- package/dist/entities/upload/index.cjs +11 -11
- package/dist/entities/upload/index.mjs +7 -7
- package/dist/entities/url-redirect/index.cjs +5 -4
- package/dist/entities/url-redirect/index.d.cts +3 -2
- package/dist/entities/url-redirect/index.d.mts +3 -2
- package/dist/entities/url-redirect/index.mjs +4 -3
- package/dist/entities/user-account/index.cjs +10 -11
- package/dist/entities/user-account/index.d.cts +2 -2
- package/dist/entities/user-account/index.d.mts +2 -2
- package/dist/entities/user-account/index.mjs +10 -11
- package/dist/entities/utm-link-builder/index.cjs +30 -36
- package/dist/entities/utm-link-builder/index.d.cts +6 -6
- package/dist/entities/utm-link-builder/index.d.mts +6 -6
- package/dist/entities/utm-link-builder/index.mjs +22 -28
- package/dist/entities/utm-tracking-link/index.cjs +110 -104
- package/dist/entities/utm-tracking-link/index.d.cts +2 -2
- package/dist/entities/utm-tracking-link/index.d.mts +2 -2
- package/dist/entities/utm-tracking-link/index.mjs +68 -68
- package/dist/error-messages-9ZhRqNGW.mjs +10 -0
- package/dist/error-messages-C0I1kOur.cjs +51 -0
- package/dist/generators/index.cjs +231 -0
- package/dist/generators/index.d.cts +19 -0
- package/dist/generators/index.d.mts +19 -0
- package/dist/generators/index.mjs +226 -0
- package/dist/index-BOxQLeAK.d.cts +317 -0
- package/dist/index-BSYaAtme.d.mts +486 -0
- package/dist/index-BT8Pa9XY.d.mts +317 -0
- package/dist/{index-DXo7B4ng.d.mts → index-Bjjp-2Sa.d.mts} +20 -99
- package/dist/{index-DXUuI-fJ.d.cts → index-C1GoH-4v.d.cts} +91 -76
- package/dist/{index-D_YPjLxv.d.cts → index-CBW5QmNu.d.cts} +4 -3
- package/dist/index-COpLbpQC.d.cts +486 -0
- package/dist/{index-DEm89ERm.d.mts → index-ClQOYhKi.d.mts} +94 -79
- package/dist/index-Cqmmzi2g.d.mts +944 -0
- package/dist/{index-B_L_83Q2.d.cts → index-D7QXaSOY.d.cts} +19 -98
- package/dist/index-DG_Lwaa7.d.cts +1324 -0
- package/dist/{index-D3KnOYr7.d.mts → index-DKFW5ay8.d.mts} +4 -3
- package/dist/index-Dvu63a8_.d.mts +1324 -0
- package/dist/index-WN2TBKki.d.cts +944 -0
- package/dist/limits-CKGuEuKA.mjs +37 -0
- package/dist/{regex-Cl5goNwp.cjs → limits-CW6iJ7kB.cjs} +0 -102
- package/dist/number-Bt4nZKCU.cjs +19 -0
- package/dist/number-OMFRufFt.mjs +6 -0
- package/dist/pagination-D5l_UjyM.mjs +7 -0
- package/dist/pagination-DWZDPzR4.cjs +20 -0
- package/dist/permissions/index.cjs +2 -2
- package/dist/permissions/index.d.cts +1 -1
- package/dist/permissions/index.d.mts +1 -1
- package/dist/permissions/index.mjs +2 -2
- package/dist/phone-C9TNVDm_.mjs +8 -0
- package/dist/phone-D_ZLG1Qv.cjs +21 -0
- package/dist/{query-DHY-nlUQ.mjs → query-BR5Ze6T2.mjs} +7 -11
- package/dist/{query-DelNcssC.cjs → query-qQ_HLlxx.cjs} +13 -29
- package/dist/regex-BEFTMiHO.cjs +51 -0
- package/dist/regex-pSdcbWzV.mjs +10 -0
- package/dist/relation-Bd-xUcj8.cjs +33 -0
- package/dist/relation-DMhLjp7K.mjs +8 -0
- package/dist/{relationships-HTBNe0F-.cjs → relationships-DjHwYd4r.cjs} +23 -9
- package/dist/{relationships-C6xfgdwR.mjs → relationships-yPO5SILR.mjs} +7 -5
- package/dist/slug-BUtm1t-B.mjs +7 -0
- package/dist/slug-cWXTZEIT.cjs +14 -0
- package/dist/sort-CI87SH1y.cjs +33 -0
- package/dist/sort-D3WwshqQ.mjs +14 -0
- package/dist/{strapi-DvyAfgFF.mjs → strapi-B2cNPAao.mjs} +1 -1
- package/dist/{strapi-QFDWi4vD.cjs → strapi-RlhF30B7.cjs} +1 -1
- package/dist/string-BHHnD2Qu.mjs +42 -0
- package/dist/string-Yn-6xiAZ.cjs +97 -0
- package/dist/urls-UOvhCu0z.mjs +14 -0
- package/dist/urls-og5upHgL.cjs +27 -0
- package/dist/utilities/index.cjs +1 -1
- package/dist/utilities/index.d.cts +6 -6
- package/dist/utilities/index.d.mts +6 -6
- package/dist/utilities/index.mjs +1 -1
- package/dist/utm-BqkYlpua.cjs +47 -0
- package/dist/utm-ZUwmBoR2.mjs +28 -0
- package/dist/validators/index.cjs +36 -0
- package/dist/validators/index.d.cts +94 -0
- package/dist/validators/index.d.mts +94 -0
- package/dist/validators/index.mjs +10 -0
- package/package.json +29 -2
- package/dist/index-B3VtiObV.d.mts +0 -317
- package/dist/index-BxEBUjx2.d.mts +0 -486
- package/dist/index-CQP_vcmO.d.cts +0 -317
- package/dist/index-CRoWUxGV.d.cts +0 -1324
- package/dist/index-DYSlcIkJ.d.mts +0 -945
- package/dist/index-Dmtom8iC.d.cts +0 -945
- package/dist/index-auU0DaW5.d.cts +0 -486
- package/dist/index-oCLNrzIj.d.mts +0 -1324
- package/dist/regex-BnKGcdS4.mjs +0 -55
- package/dist/validators-Bc9Is5Sr.cjs +0 -222
- package/dist/validators-P5E_3qzc.mjs +0 -95
- /package/dist/{abac-DPd9oLKR.mjs → abac-BPxkvVVy.mjs} +0 -0
- /package/dist/{abac-BeKQtxIF.cjs → abac-YYI2Ckwv.cjs} +0 -0
- /package/dist/{constants-Htf-MeCA.mjs → constants-C4cy6LoY.mjs} +0 -0
- /package/dist/{constants-f1GP2eiq.cjs → constants-D6DsS_A0.cjs} +0 -0
- /package/dist/{document-DaICHS9G.cjs → document-B4FY2KXQ.cjs} +0 -0
- /package/dist/{document-c3GNPelp.mjs → document-De-prPhc.mjs} +0 -0
- /package/dist/{document-CbE38CzE.d.mts → document-DxjJgk8X.d.mts} +0 -0
- /package/dist/{index-DLICmJ_-.d.mts → index-BSEaV9wd.d.mts} +0 -0
- /package/dist/{json-BrVkpLbC.d.mts → json--oetJLQY.d.mts} +0 -0
- /package/dist/{media-upload-DKeA1eD-.d.mts → media-upload-DBG7YyU4.d.mts} +0 -0
- /package/dist/{strapi-BDLWeEyv.mjs → strapi-CE9bz7Kc.mjs} +0 -0
- /package/dist/{strapi-C4HuWGb_.cjs → strapi-D8C1C0D7.cjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as STRAPI_SPECIAL_ENTITIES, i as STRAPI_SINGLE_ENTITY_ENDPOINTS, n as STRAPI_COLLECTION_ENTITY_ENDPOINTS, t as CONTENT_STATUS } from "./strapi-
|
|
1
|
+
import { a as STRAPI_SPECIAL_ENTITIES, i as STRAPI_SINGLE_ENTITY_ENDPOINTS, n as STRAPI_COLLECTION_ENTITY_ENDPOINTS, t as CONTENT_STATUS } from "./strapi-CE9bz7Kc.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
//#region src/base/strapi.ts
|
|
4
4
|
const ContentStatus = v.picklist(CONTENT_STATUS);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
|
-
const require_strapi = require("./strapi-
|
|
2
|
+
const require_strapi = require("./strapi-D8C1C0D7.cjs");
|
|
3
3
|
let valibot = require("valibot");
|
|
4
4
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
5
5
|
//#region src/base/strapi.ts
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { t as LIMIT_LONG_STRING_MAX_LENGTH } from "./limits-CKGuEuKA.mjs";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
//#region src/validators/string.ts
|
|
4
|
+
/**
|
|
5
|
+
* Basic string validator with trim and min length
|
|
6
|
+
*/
|
|
7
|
+
const VString = (minLength = 1) => v.pipe(v.string(), v.trim(), v.minLength(minLength));
|
|
8
|
+
/**
|
|
9
|
+
* String validator with trim, min length, and max length (Short)
|
|
10
|
+
*/
|
|
11
|
+
const VStringShort = (minLength = 1) => v.pipe(v.string(), v.trim(), v.minLength(minLength), v.maxLength(255));
|
|
12
|
+
/**
|
|
13
|
+
* String validator with trim, min length, and max length (Long)
|
|
14
|
+
*/
|
|
15
|
+
const VStringLong = (minLength = 1) => v.pipe(v.string(), v.trim(), v.minLength(minLength), v.maxLength(LIMIT_LONG_STRING_MAX_LENGTH));
|
|
16
|
+
/**
|
|
17
|
+
* String validator with trim, and max length
|
|
18
|
+
*/
|
|
19
|
+
const VStringMax = (maxLength = 255) => v.pipe(v.string(), v.trim(), v.maxLength(maxLength));
|
|
20
|
+
/**
|
|
21
|
+
* String validator with trim, min length, and max length
|
|
22
|
+
*/
|
|
23
|
+
const VStringMinMax = (minLength = 1, maxLength = 255) => v.pipe(v.string(), v.trim(), v.minLength(minLength), v.maxLength(maxLength));
|
|
24
|
+
/**
|
|
25
|
+
* String validator with trim, min length, max length, and regex pattern
|
|
26
|
+
*/
|
|
27
|
+
const VStringMinMaxRegex = (minLength = 1, maxLength = 255, pattern, message) => v.pipe(v.string(), v.trim(), v.minLength(minLength), v.maxLength(maxLength), v.regex(pattern, message));
|
|
28
|
+
/**
|
|
29
|
+
* Optional Nullable String validator (Long)
|
|
30
|
+
*/
|
|
31
|
+
const VStringLongNullable = () => v.optional(v.nullable(v.pipe(v.string(), v.trim(), v.maxLength(LIMIT_LONG_STRING_MAX_LENGTH))));
|
|
32
|
+
/**
|
|
33
|
+
* Optional Nullable String validator
|
|
34
|
+
* Commonly used for optional fields that might be null in the database or API
|
|
35
|
+
*/
|
|
36
|
+
const VStringShortNullable = () => v.optional(v.nullable(v.pipe(v.string(), v.trim(), v.maxLength(255))));
|
|
37
|
+
/**
|
|
38
|
+
* Array of short strings validator transformed to CSV
|
|
39
|
+
*/
|
|
40
|
+
const VStringShortToCSV = () => v.pipe(v.array(VStringShort()), v.transform((value) => value.join(",")));
|
|
41
|
+
//#endregion
|
|
42
|
+
export { VStringMinMax as a, VStringShortNullable as c, VStringMax as i, VStringShortToCSV as l, VStringLong as n, VStringMinMaxRegex as o, VStringLongNullable as r, VStringShort as s, VString as t };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
|
+
const require_limits = require("./limits-CW6iJ7kB.cjs");
|
|
3
|
+
let valibot = require("valibot");
|
|
4
|
+
valibot = require_chunk.__toESM(valibot, 1);
|
|
5
|
+
//#region src/validators/string.ts
|
|
6
|
+
/**
|
|
7
|
+
* Basic string validator with trim and min length
|
|
8
|
+
*/
|
|
9
|
+
const VString = (minLength = 1) => valibot.pipe(valibot.string(), valibot.trim(), valibot.minLength(minLength));
|
|
10
|
+
/**
|
|
11
|
+
* String validator with trim, min length, and max length (Short)
|
|
12
|
+
*/
|
|
13
|
+
const VStringShort = (minLength = 1) => valibot.pipe(valibot.string(), valibot.trim(), valibot.minLength(minLength), valibot.maxLength(255));
|
|
14
|
+
/**
|
|
15
|
+
* String validator with trim, min length, and max length (Long)
|
|
16
|
+
*/
|
|
17
|
+
const VStringLong = (minLength = 1) => valibot.pipe(valibot.string(), valibot.trim(), valibot.minLength(minLength), valibot.maxLength(require_limits.LIMIT_LONG_STRING_MAX_LENGTH));
|
|
18
|
+
/**
|
|
19
|
+
* String validator with trim, and max length
|
|
20
|
+
*/
|
|
21
|
+
const VStringMax = (maxLength = 255) => valibot.pipe(valibot.string(), valibot.trim(), valibot.maxLength(maxLength));
|
|
22
|
+
/**
|
|
23
|
+
* String validator with trim, min length, and max length
|
|
24
|
+
*/
|
|
25
|
+
const VStringMinMax = (minLength = 1, maxLength = 255) => valibot.pipe(valibot.string(), valibot.trim(), valibot.minLength(minLength), valibot.maxLength(maxLength));
|
|
26
|
+
/**
|
|
27
|
+
* String validator with trim, min length, max length, and regex pattern
|
|
28
|
+
*/
|
|
29
|
+
const VStringMinMaxRegex = (minLength = 1, maxLength = 255, pattern, message) => valibot.pipe(valibot.string(), valibot.trim(), valibot.minLength(minLength), valibot.maxLength(maxLength), valibot.regex(pattern, message));
|
|
30
|
+
/**
|
|
31
|
+
* Optional Nullable String validator (Long)
|
|
32
|
+
*/
|
|
33
|
+
const VStringLongNullable = () => valibot.optional(valibot.nullable(valibot.pipe(valibot.string(), valibot.trim(), valibot.maxLength(require_limits.LIMIT_LONG_STRING_MAX_LENGTH))));
|
|
34
|
+
/**
|
|
35
|
+
* Optional Nullable String validator
|
|
36
|
+
* Commonly used for optional fields that might be null in the database or API
|
|
37
|
+
*/
|
|
38
|
+
const VStringShortNullable = () => valibot.optional(valibot.nullable(valibot.pipe(valibot.string(), valibot.trim(), valibot.maxLength(255))));
|
|
39
|
+
/**
|
|
40
|
+
* Array of short strings validator transformed to CSV
|
|
41
|
+
*/
|
|
42
|
+
const VStringShortToCSV = () => valibot.pipe(valibot.array(VStringShort()), valibot.transform((value) => value.join(",")));
|
|
43
|
+
//#endregion
|
|
44
|
+
Object.defineProperty(exports, "VString", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function() {
|
|
47
|
+
return VString;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "VStringLong", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function() {
|
|
53
|
+
return VStringLong;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "VStringLongNullable", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function() {
|
|
59
|
+
return VStringLongNullable;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "VStringMax", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function() {
|
|
65
|
+
return VStringMax;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "VStringMinMax", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function() {
|
|
71
|
+
return VStringMinMax;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, "VStringMinMaxRegex", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function() {
|
|
77
|
+
return VStringMinMaxRegex;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "VStringShort", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function() {
|
|
83
|
+
return VStringShort;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, "VStringShortNullable", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function() {
|
|
89
|
+
return VStringShortNullable;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "VStringShortToCSV", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function() {
|
|
95
|
+
return VStringShortToCSV;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as ERROR_MESSAGE_INVALID_URL, o as ERROR_MESSAGE_URL_PREFIX } from "./error-messages-9ZhRqNGW.mjs";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
//#region src/validators/urls.ts
|
|
4
|
+
/**
|
|
5
|
+
* URL Validator
|
|
6
|
+
* Checks for http/https prefix and valid URL format
|
|
7
|
+
*/
|
|
8
|
+
const VStringUrl = () => v.pipe(v.string(), v.trim(), v.startsWith("http", ERROR_MESSAGE_URL_PREFIX), v.url(ERROR_MESSAGE_INVALID_URL));
|
|
9
|
+
/**
|
|
10
|
+
* Optional Nullable URL Validator
|
|
11
|
+
*/
|
|
12
|
+
const VStringUrlNullable = () => v.optional(v.nullable(v.pipe(v.string(), v.trim(), v.startsWith("http", ERROR_MESSAGE_URL_PREFIX), v.url(ERROR_MESSAGE_INVALID_URL))));
|
|
13
|
+
//#endregion
|
|
14
|
+
export { VStringUrlNullable as n, VStringUrl as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
|
+
const require_error_messages = require("./error-messages-C0I1kOur.cjs");
|
|
3
|
+
let valibot = require("valibot");
|
|
4
|
+
valibot = require_chunk.__toESM(valibot, 1);
|
|
5
|
+
//#region src/validators/urls.ts
|
|
6
|
+
/**
|
|
7
|
+
* URL Validator
|
|
8
|
+
* Checks for http/https prefix and valid URL format
|
|
9
|
+
*/
|
|
10
|
+
const VStringUrl = () => valibot.pipe(valibot.string(), valibot.trim(), valibot.startsWith("http", require_error_messages.ERROR_MESSAGE_URL_PREFIX), valibot.url(require_error_messages.ERROR_MESSAGE_INVALID_URL));
|
|
11
|
+
/**
|
|
12
|
+
* Optional Nullable URL Validator
|
|
13
|
+
*/
|
|
14
|
+
const VStringUrlNullable = () => valibot.optional(valibot.nullable(valibot.pipe(valibot.string(), valibot.trim(), valibot.startsWith("http", require_error_messages.ERROR_MESSAGE_URL_PREFIX), valibot.url(require_error_messages.ERROR_MESSAGE_INVALID_URL))));
|
|
15
|
+
//#endregion
|
|
16
|
+
Object.defineProperty(exports, "VStringUrl", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return VStringUrl;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "VStringUrlNullable", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return VStringUrlNullable;
|
|
26
|
+
}
|
|
27
|
+
});
|
package/dist/utilities/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../chunk-CKQMccvm.cjs");
|
|
3
|
-
const require_abac = require("../abac-
|
|
3
|
+
const require_abac = require("../abac-YYI2Ckwv.cjs");
|
|
4
4
|
let valibot = require("valibot");
|
|
5
5
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
6
6
|
//#region src/utilities/permissions.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as StrapiAttributeErrorResponse, T as StrapiErrorResponse } from "../index-D7QXaSOY.cjs";
|
|
2
|
+
import { Ln as RoleType, Pn as AuthorizedUserDocument, d as Permissions, l as ClientUserDocumentStatus } from "../index-C1GoH-4v.cjs";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
|
|
5
5
|
//#region src/utilities/permissions.d.ts
|
|
@@ -11,10 +11,10 @@ declare function isStrapiAttributeError<T>(result: unknown): result is StrapiAtt
|
|
|
11
11
|
declare function isStrapiStandardError<T>(result: unknown): result is StrapiErrorResponse<T>;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/utilities/typescript.d.ts
|
|
14
|
-
type KeysWhere<T extends Record<string,
|
|
15
|
-
type PickWhere<T extends Record<string,
|
|
16
|
-
type KeysWhereValue<T extends Record<string,
|
|
17
|
-
type PickWhereValue<T extends Record<string,
|
|
14
|
+
type KeysWhere<T extends Record<string, unknown>, K extends PropertyKey> = { [P in keyof T]: K extends keyof T[P] ? (T[P][K] extends true ? P : never) : never }[keyof T];
|
|
15
|
+
type PickWhere<T extends Record<string, unknown>, K extends PropertyKey> = Pick<T, KeysWhere<T, K>>;
|
|
16
|
+
type KeysWhereValue<T extends Record<string, unknown>, K extends PropertyKey, V> = { [P in keyof T]: K extends keyof T[P] ? (T[P][K] extends V ? P : never) : never }[keyof T];
|
|
17
|
+
type PickWhereValue<T extends Record<string, unknown>, K extends PropertyKey, V> = Pick<T, KeysWhereValue<T, K, V>>;
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/utilities/validation.d.ts
|
|
20
20
|
type ValidateAndCleanSuccess<T> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as StrapiAttributeErrorResponse, T as StrapiErrorResponse } from "../index-Bjjp-2Sa.mjs";
|
|
2
|
+
import { Ln as RoleType, Pn as AuthorizedUserDocument, d as Permissions, l as ClientUserDocumentStatus } from "../index-ClQOYhKi.mjs";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
|
|
5
5
|
//#region src/utilities/permissions.d.ts
|
|
@@ -11,10 +11,10 @@ declare function isStrapiAttributeError<T>(result: unknown): result is StrapiAtt
|
|
|
11
11
|
declare function isStrapiStandardError<T>(result: unknown): result is StrapiErrorResponse<T>;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/utilities/typescript.d.ts
|
|
14
|
-
type KeysWhere<T extends Record<string,
|
|
15
|
-
type PickWhere<T extends Record<string,
|
|
16
|
-
type KeysWhereValue<T extends Record<string,
|
|
17
|
-
type PickWhereValue<T extends Record<string,
|
|
14
|
+
type KeysWhere<T extends Record<string, unknown>, K extends PropertyKey> = { [P in keyof T]: K extends keyof T[P] ? (T[P][K] extends true ? P : never) : never }[keyof T];
|
|
15
|
+
type PickWhere<T extends Record<string, unknown>, K extends PropertyKey> = Pick<T, KeysWhere<T, K>>;
|
|
16
|
+
type KeysWhereValue<T extends Record<string, unknown>, K extends PropertyKey, V> = { [P in keyof T]: K extends keyof T[P] ? (T[P][K] extends V ? P : never) : never }[keyof T];
|
|
17
|
+
type PickWhereValue<T extends Record<string, unknown>, K extends PropertyKey, V> = Pick<T, KeysWhereValue<T, K, V>>;
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/utilities/validation.d.ts
|
|
20
20
|
type ValidateAndCleanSuccess<T> = {
|
package/dist/utilities/index.mjs
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const require_chunk = require("./chunk-CKQMccvm.cjs");
|
|
2
|
+
require("./limits-CW6iJ7kB.cjs");
|
|
3
|
+
const require_regex = require("./regex-BEFTMiHO.cjs");
|
|
4
|
+
const require_string = require("./string-Yn-6xiAZ.cjs");
|
|
5
|
+
const require_error_messages = require("./error-messages-C0I1kOur.cjs");
|
|
6
|
+
let valibot = require("valibot");
|
|
7
|
+
valibot = require_chunk.__toESM(valibot, 1);
|
|
8
|
+
//#region src/validators/utm.ts
|
|
9
|
+
/**
|
|
10
|
+
* UTM URL Validator
|
|
11
|
+
* Checks for valid URL format that does contain utm params
|
|
12
|
+
*/
|
|
13
|
+
const VStringUrlUtm = () => valibot.pipe(valibot.string(), valibot.trim(), valibot.url(require_error_messages.ERROR_MESSAGE_INVALID_URL), valibot.check((input) => {
|
|
14
|
+
return input.includes("utm_");
|
|
15
|
+
}, require_error_messages.ERROR_MESSAGE_UTM_URL));
|
|
16
|
+
/**
|
|
17
|
+
* URL no utm params Validator
|
|
18
|
+
* Checks for valid URL format that does not contain utm params
|
|
19
|
+
*/
|
|
20
|
+
const VStringUrlNoUtm = () => valibot.pipe(valibot.string(), valibot.trim(), valibot.url(require_error_messages.ERROR_MESSAGE_INVALID_URL), valibot.check((input) => {
|
|
21
|
+
if (input === "") return false;
|
|
22
|
+
return input.indexOf("utm_") === -1;
|
|
23
|
+
}, require_error_messages.ERROR_MESSAGE_URL_NO_QUERY_PARAMS));
|
|
24
|
+
/**
|
|
25
|
+
* UTM Key Validator
|
|
26
|
+
* Checks for a valid utm parameter value
|
|
27
|
+
*/
|
|
28
|
+
const VStringUtmKey = () => require_string.VStringMinMaxRegex(1, 255, require_regex.REGEX_UTM_VALUE, require_regex.ERROR_MESSAGE_REGEX_UTM_VALUE);
|
|
29
|
+
//#endregion
|
|
30
|
+
Object.defineProperty(exports, "VStringUrlNoUtm", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function() {
|
|
33
|
+
return VStringUrlNoUtm;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "VStringUrlUtm", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function() {
|
|
39
|
+
return VStringUrlUtm;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "VStringUtmKey", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function() {
|
|
45
|
+
return VStringUtmKey;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./limits-CKGuEuKA.mjs";
|
|
2
|
+
import { r as ERROR_MESSAGE_REGEX_UTM_VALUE, s as REGEX_UTM_VALUE } from "./regex-pSdcbWzV.mjs";
|
|
3
|
+
import { o as VStringMinMaxRegex } from "./string-BHHnD2Qu.mjs";
|
|
4
|
+
import { a as ERROR_MESSAGE_URL_NO_QUERY_PARAMS, n as ERROR_MESSAGE_INVALID_URL, s as ERROR_MESSAGE_UTM_URL } from "./error-messages-9ZhRqNGW.mjs";
|
|
5
|
+
import * as v from "valibot";
|
|
6
|
+
//#region src/validators/utm.ts
|
|
7
|
+
/**
|
|
8
|
+
* UTM URL Validator
|
|
9
|
+
* Checks for valid URL format that does contain utm params
|
|
10
|
+
*/
|
|
11
|
+
const VStringUrlUtm = () => v.pipe(v.string(), v.trim(), v.url(ERROR_MESSAGE_INVALID_URL), v.check((input) => {
|
|
12
|
+
return input.includes("utm_");
|
|
13
|
+
}, ERROR_MESSAGE_UTM_URL));
|
|
14
|
+
/**
|
|
15
|
+
* URL no utm params Validator
|
|
16
|
+
* Checks for valid URL format that does not contain utm params
|
|
17
|
+
*/
|
|
18
|
+
const VStringUrlNoUtm = () => v.pipe(v.string(), v.trim(), v.url(ERROR_MESSAGE_INVALID_URL), v.check((input) => {
|
|
19
|
+
if (input === "") return false;
|
|
20
|
+
return input.indexOf("utm_") === -1;
|
|
21
|
+
}, ERROR_MESSAGE_URL_NO_QUERY_PARAMS));
|
|
22
|
+
/**
|
|
23
|
+
* UTM Key Validator
|
|
24
|
+
* Checks for a valid utm parameter value
|
|
25
|
+
*/
|
|
26
|
+
const VStringUtmKey = () => VStringMinMaxRegex(1, 255, REGEX_UTM_VALUE, ERROR_MESSAGE_REGEX_UTM_VALUE);
|
|
27
|
+
//#endregion
|
|
28
|
+
export { VStringUrlUtm as n, VStringUtmKey as r, VStringUrlNoUtm as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_pagination = require("../pagination-DWZDPzR4.cjs");
|
|
3
|
+
const require_email = require("../email-ByTEdUjg.cjs");
|
|
4
|
+
const require_phone = require("../phone-D_ZLG1Qv.cjs");
|
|
5
|
+
const require_string = require("../string-Yn-6xiAZ.cjs");
|
|
6
|
+
const require_number = require("../number-Bt4nZKCU.cjs");
|
|
7
|
+
const require_relation = require("../relation-Bd-xUcj8.cjs");
|
|
8
|
+
const require_slug = require("../slug-cWXTZEIT.cjs");
|
|
9
|
+
const require_urls = require("../urls-og5upHgL.cjs");
|
|
10
|
+
const require_utm = require("../utm-BqkYlpua.cjs");
|
|
11
|
+
exports.VDocumentRelationMany = require_relation.VDocumentRelationMany;
|
|
12
|
+
exports.VDocumentRelationManyRequired = require_relation.VDocumentRelationManyRequired;
|
|
13
|
+
exports.VDocumentRelationOne = require_relation.VDocumentRelationOne;
|
|
14
|
+
exports.VDocumentRelationOneRequired = require_relation.VDocumentRelationOneRequired;
|
|
15
|
+
exports.VIntegerNullable = require_number.VIntegerNullable;
|
|
16
|
+
exports.VNumberNullable = require_number.VNumberNullable;
|
|
17
|
+
exports.VPage = require_pagination.VPage;
|
|
18
|
+
exports.VSize = require_pagination.VSize;
|
|
19
|
+
exports.VString = require_string.VString;
|
|
20
|
+
exports.VStringEmail = require_email.VStringEmail;
|
|
21
|
+
exports.VStringLong = require_string.VStringLong;
|
|
22
|
+
exports.VStringLongNullable = require_string.VStringLongNullable;
|
|
23
|
+
exports.VStringMax = require_string.VStringMax;
|
|
24
|
+
exports.VStringMinMax = require_string.VStringMinMax;
|
|
25
|
+
exports.VStringMinMaxRegex = require_string.VStringMinMaxRegex;
|
|
26
|
+
exports.VStringPhone = require_phone.VStringPhone;
|
|
27
|
+
exports.VStringPhoneNullable = require_phone.VStringPhoneNullable;
|
|
28
|
+
exports.VStringShort = require_string.VStringShort;
|
|
29
|
+
exports.VStringShortNullable = require_string.VStringShortNullable;
|
|
30
|
+
exports.VStringShortToCSV = require_string.VStringShortToCSV;
|
|
31
|
+
exports.VStringSlug = require_slug.VStringSlug;
|
|
32
|
+
exports.VStringUrl = require_urls.VStringUrl;
|
|
33
|
+
exports.VStringUrlNoUtm = require_utm.VStringUrlNoUtm;
|
|
34
|
+
exports.VStringUrlNullable = require_urls.VStringUrlNullable;
|
|
35
|
+
exports.VStringUrlUtm = require_utm.VStringUrlUtm;
|
|
36
|
+
exports.VStringUtmKey = require_utm.VStringUtmKey;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
|
|
3
|
+
//#region src/validators/email.d.ts
|
|
4
|
+
declare const VStringEmail: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 5, undefined>, v.MaxLengthAction<string, 255, undefined>, v.EmailAction<string, undefined>]>;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/validators/number.d.ts
|
|
7
|
+
declare const VNumberNullable: () => v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
8
|
+
declare const VIntegerNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>, undefined>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/validators/pagination.d.ts
|
|
11
|
+
declare const VPage: () => v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
12
|
+
declare const VSize: (maxSize: number) => v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/validators/phone.d.ts
|
|
15
|
+
declare const VStringPhone: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 7, undefined>, v.MaxLengthAction<string, 24, undefined>, v.RegexAction<string, "Please provide a valid phone number.">]>;
|
|
16
|
+
declare const VStringPhoneNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 7, undefined>, v.MaxLengthAction<string, 24, undefined>, v.RegexAction<string, "Please provide a valid phone number.">]>, undefined>, undefined>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/validators/relation.d.ts
|
|
19
|
+
declare const VDocumentRelationOne: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput | null | undefined>;
|
|
20
|
+
declare const VDocumentRelationOneRequired: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput | undefined>;
|
|
21
|
+
declare const VDocumentRelationMany: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput[] | null | undefined>;
|
|
22
|
+
declare const VDocumentRelationManyRequired: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput[] | undefined>;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/validators/slug.d.ts
|
|
25
|
+
declare const VStringSlug: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>, v.RegexAction<string, "can only contain letters, numbers, and the special characters: - _ .">]>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/validators/string.d.ts
|
|
28
|
+
/**
|
|
29
|
+
* Basic string validator with trim and min length
|
|
30
|
+
*/
|
|
31
|
+
declare const VString: (minLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>]>;
|
|
32
|
+
/**
|
|
33
|
+
* String validator with trim, min length, and max length (Short)
|
|
34
|
+
*/
|
|
35
|
+
declare const VStringShort: (minLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
36
|
+
/**
|
|
37
|
+
* String validator with trim, min length, and max length (Long)
|
|
38
|
+
*/
|
|
39
|
+
declare const VStringLong: (minLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, 5000, undefined>]>;
|
|
40
|
+
/**
|
|
41
|
+
* String validator with trim, and max length
|
|
42
|
+
*/
|
|
43
|
+
declare const VStringMax: (maxLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, number, undefined>]>;
|
|
44
|
+
/**
|
|
45
|
+
* String validator with trim, min length, and max length
|
|
46
|
+
*/
|
|
47
|
+
declare const VStringMinMax: (minLength?: number, maxLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
48
|
+
/**
|
|
49
|
+
* String validator with trim, min length, max length, and regex pattern
|
|
50
|
+
*/
|
|
51
|
+
declare const VStringMinMaxRegex: (minLength: number | undefined, maxLength: number | undefined, pattern: RegExp, message: string) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, string>]>;
|
|
52
|
+
/**
|
|
53
|
+
* Optional Nullable String validator (Long)
|
|
54
|
+
*/
|
|
55
|
+
declare const VStringLongNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 5000, undefined>]>, undefined>, undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* Optional Nullable String validator
|
|
58
|
+
* Commonly used for optional fields that might be null in the database or API
|
|
59
|
+
*/
|
|
60
|
+
declare const VStringShortNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* Array of short strings validator transformed to CSV
|
|
63
|
+
*/
|
|
64
|
+
declare const VStringShortToCSV: () => v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, v.TransformAction<string[], string>]>;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/validators/urls.d.ts
|
|
67
|
+
/**
|
|
68
|
+
* URL Validator
|
|
69
|
+
* Checks for http/https prefix and valid URL format
|
|
70
|
+
*/
|
|
71
|
+
declare const VStringUrl: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.StartsWithAction<string, "http", "Please enter a valid URL starting with http or https.">, v.UrlAction<string, "Please enter a valid URL.">]>;
|
|
72
|
+
/**
|
|
73
|
+
* Optional Nullable URL Validator
|
|
74
|
+
*/
|
|
75
|
+
declare const VStringUrlNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.StartsWithAction<string, "http", "Please enter a valid URL starting with http or https.">, v.UrlAction<string, "Please enter a valid URL.">]>, undefined>, undefined>;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/validators/utm.d.ts
|
|
78
|
+
/**
|
|
79
|
+
* UTM URL Validator
|
|
80
|
+
* Checks for valid URL format that does contain utm params
|
|
81
|
+
*/
|
|
82
|
+
declare const VStringUrlUtm: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, "Please enter a valid URL.">, v.CheckAction<string, "Please enter a valid URL with UTM parameters.">]>;
|
|
83
|
+
/**
|
|
84
|
+
* URL no utm params Validator
|
|
85
|
+
* Checks for valid URL format that does not contain utm params
|
|
86
|
+
*/
|
|
87
|
+
declare const VStringUrlNoUtm: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, "Please enter a valid URL.">, v.CheckAction<string, "Please remove any query parameters from the URL.">]>;
|
|
88
|
+
/**
|
|
89
|
+
* UTM Key Validator
|
|
90
|
+
* Checks for a valid utm parameter value
|
|
91
|
+
*/
|
|
92
|
+
declare const VStringUtmKey: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, string>]>;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { VDocumentRelationMany, VDocumentRelationManyRequired, VDocumentRelationOne, VDocumentRelationOneRequired, VIntegerNullable, VNumberNullable, VPage, VSize, VString, VStringEmail, VStringLong, VStringLongNullable, VStringMax, VStringMinMax, VStringMinMaxRegex, VStringPhone, VStringPhoneNullable, VStringShort, VStringShortNullable, VStringShortToCSV, VStringSlug, VStringUrl, VStringUrlNoUtm, VStringUrlNullable, VStringUrlUtm, VStringUtmKey };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
|
|
3
|
+
//#region src/validators/email.d.ts
|
|
4
|
+
declare const VStringEmail: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 5, undefined>, v.MaxLengthAction<string, 255, undefined>, v.EmailAction<string, undefined>]>;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/validators/number.d.ts
|
|
7
|
+
declare const VNumberNullable: () => v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
8
|
+
declare const VIntegerNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>, undefined>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/validators/pagination.d.ts
|
|
11
|
+
declare const VPage: () => v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
12
|
+
declare const VSize: (maxSize: number) => v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/validators/phone.d.ts
|
|
15
|
+
declare const VStringPhone: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 7, undefined>, v.MaxLengthAction<string, 24, undefined>, v.RegexAction<string, "Please provide a valid phone number.">]>;
|
|
16
|
+
declare const VStringPhoneNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 7, undefined>, v.MaxLengthAction<string, 24, undefined>, v.RegexAction<string, "Please provide a valid phone number.">]>, undefined>, undefined>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/validators/relation.d.ts
|
|
19
|
+
declare const VDocumentRelationOne: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput | null | undefined>;
|
|
20
|
+
declare const VDocumentRelationOneRequired: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput | undefined>;
|
|
21
|
+
declare const VDocumentRelationMany: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput[] | null | undefined>;
|
|
22
|
+
declare const VDocumentRelationManyRequired: <TOutput>(getSchema: () => v.GenericSchema<TOutput>) => v.GenericSchema<TOutput[] | undefined>;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/validators/slug.d.ts
|
|
25
|
+
declare const VStringSlug: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>, v.RegexAction<string, "can only contain letters, numbers, and the special characters: - _ .">]>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/validators/string.d.ts
|
|
28
|
+
/**
|
|
29
|
+
* Basic string validator with trim and min length
|
|
30
|
+
*/
|
|
31
|
+
declare const VString: (minLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>]>;
|
|
32
|
+
/**
|
|
33
|
+
* String validator with trim, min length, and max length (Short)
|
|
34
|
+
*/
|
|
35
|
+
declare const VStringShort: (minLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
|
|
36
|
+
/**
|
|
37
|
+
* String validator with trim, min length, and max length (Long)
|
|
38
|
+
*/
|
|
39
|
+
declare const VStringLong: (minLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, 5000, undefined>]>;
|
|
40
|
+
/**
|
|
41
|
+
* String validator with trim, and max length
|
|
42
|
+
*/
|
|
43
|
+
declare const VStringMax: (maxLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, number, undefined>]>;
|
|
44
|
+
/**
|
|
45
|
+
* String validator with trim, min length, and max length
|
|
46
|
+
*/
|
|
47
|
+
declare const VStringMinMax: (minLength?: number, maxLength?: number) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
48
|
+
/**
|
|
49
|
+
* String validator with trim, min length, max length, and regex pattern
|
|
50
|
+
*/
|
|
51
|
+
declare const VStringMinMaxRegex: (minLength: number | undefined, maxLength: number | undefined, pattern: RegExp, message: string) => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, string>]>;
|
|
52
|
+
/**
|
|
53
|
+
* Optional Nullable String validator (Long)
|
|
54
|
+
*/
|
|
55
|
+
declare const VStringLongNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 5000, undefined>]>, undefined>, undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* Optional Nullable String validator
|
|
58
|
+
* Commonly used for optional fields that might be null in the database or API
|
|
59
|
+
*/
|
|
60
|
+
declare const VStringShortNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* Array of short strings validator transformed to CSV
|
|
63
|
+
*/
|
|
64
|
+
declare const VStringShortToCSV: () => v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, v.TransformAction<string[], string>]>;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/validators/urls.d.ts
|
|
67
|
+
/**
|
|
68
|
+
* URL Validator
|
|
69
|
+
* Checks for http/https prefix and valid URL format
|
|
70
|
+
*/
|
|
71
|
+
declare const VStringUrl: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.StartsWithAction<string, "http", "Please enter a valid URL starting with http or https.">, v.UrlAction<string, "Please enter a valid URL.">]>;
|
|
72
|
+
/**
|
|
73
|
+
* Optional Nullable URL Validator
|
|
74
|
+
*/
|
|
75
|
+
declare const VStringUrlNullable: () => v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.StartsWithAction<string, "http", "Please enter a valid URL starting with http or https.">, v.UrlAction<string, "Please enter a valid URL.">]>, undefined>, undefined>;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/validators/utm.d.ts
|
|
78
|
+
/**
|
|
79
|
+
* UTM URL Validator
|
|
80
|
+
* Checks for valid URL format that does contain utm params
|
|
81
|
+
*/
|
|
82
|
+
declare const VStringUrlUtm: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, "Please enter a valid URL.">, v.CheckAction<string, "Please enter a valid URL with UTM parameters.">]>;
|
|
83
|
+
/**
|
|
84
|
+
* URL no utm params Validator
|
|
85
|
+
* Checks for valid URL format that does not contain utm params
|
|
86
|
+
*/
|
|
87
|
+
declare const VStringUrlNoUtm: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.UrlAction<string, "Please enter a valid URL.">, v.CheckAction<string, "Please remove any query parameters from the URL.">]>;
|
|
88
|
+
/**
|
|
89
|
+
* UTM Key Validator
|
|
90
|
+
* Checks for a valid utm parameter value
|
|
91
|
+
*/
|
|
92
|
+
declare const VStringUtmKey: () => v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, string>]>;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { VDocumentRelationMany, VDocumentRelationManyRequired, VDocumentRelationOne, VDocumentRelationOneRequired, VIntegerNullable, VNumberNullable, VPage, VSize, VString, VStringEmail, VStringLong, VStringLongNullable, VStringMax, VStringMinMax, VStringMinMaxRegex, VStringPhone, VStringPhoneNullable, VStringShort, VStringShortNullable, VStringShortToCSV, VStringSlug, VStringUrl, VStringUrlNoUtm, VStringUrlNullable, VStringUrlUtm, VStringUtmKey };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { n as VSize, t as VPage } from "../pagination-D5l_UjyM.mjs";
|
|
2
|
+
import { t as VStringEmail } from "../email-Cnyi5Neo.mjs";
|
|
3
|
+
import { n as VStringPhoneNullable, t as VStringPhone } from "../phone-C9TNVDm_.mjs";
|
|
4
|
+
import { a as VStringMinMax, c as VStringShortNullable, i as VStringMax, l as VStringShortToCSV, n as VStringLong, o as VStringMinMaxRegex, r as VStringLongNullable, s as VStringShort, t as VString } from "../string-BHHnD2Qu.mjs";
|
|
5
|
+
import { n as VNumberNullable, t as VIntegerNullable } from "../number-OMFRufFt.mjs";
|
|
6
|
+
import { i as VDocumentRelationOneRequired, n as VDocumentRelationManyRequired, r as VDocumentRelationOne, t as VDocumentRelationMany } from "../relation-DMhLjp7K.mjs";
|
|
7
|
+
import { t as VStringSlug } from "../slug-BUtm1t-B.mjs";
|
|
8
|
+
import { n as VStringUrlNullable, t as VStringUrl } from "../urls-UOvhCu0z.mjs";
|
|
9
|
+
import { n as VStringUrlUtm, r as VStringUtmKey, t as VStringUrlNoUtm } from "../utm-ZUwmBoR2.mjs";
|
|
10
|
+
export { VDocumentRelationMany, VDocumentRelationManyRequired, VDocumentRelationOne, VDocumentRelationOneRequired, VIntegerNullable, VNumberNullable, VPage, VSize, VString, VStringEmail, VStringLong, VStringLongNullable, VStringMax, VStringMinMax, VStringMinMaxRegex, VStringPhone, VStringPhoneNullable, VStringShort, VStringShortNullable, VStringShortToCSV, VStringSlug, VStringUrl, VStringUrlNoUtm, VStringUrlNullable, VStringUrlUtm, VStringUtmKey };
|