@getcommunity/gc-validators 0.0.271-alpha.26 → 0.0.271-alpha.28
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 +2 -2
- package/dist/base/index.d.cts +1 -1
- package/dist/base/index.d.mts +1 -1
- package/dist/base/index.mjs +2 -2
- package/dist/{document-BWso8VC7.mjs → document-CCIFcvUz.mjs} +2 -2
- package/dist/{document-DwkycUz9.cjs → document-CxCEXgLG.cjs} +2 -2
- package/dist/{document-BCbxKqGE.mjs → document-DESBxiaO.mjs} +1 -1
- package/dist/{document-AqtoEbX8.cjs → document-vI8pMwjv.cjs} +1 -1
- package/dist/entities/audit-log/index.cjs +2 -2
- package/dist/entities/audit-log/index.d.cts +2 -2
- package/dist/entities/audit-log/index.d.mts +2 -2
- package/dist/entities/audit-log/index.mjs +2 -2
- package/dist/entities/blog-post/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/category/index.cjs +3 -3
- package/dist/entities/category/index.d.cts +3 -3
- package/dist/entities/category/index.d.mts +3 -3
- package/dist/entities/category/index.mjs +3 -3
- package/dist/entities/client/index.cjs +3 -3
- package/dist/entities/client/index.d.cts +1 -1
- package/dist/entities/client/index.d.mts +1 -1
- package/dist/entities/client/index.mjs +3 -3
- package/dist/entities/client-content-pillar/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/client-media-platform/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/client-project/index.cjs +2 -2
- 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 +2 -2
- package/dist/entities/client-report/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/client-styleguide/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/client-user/index.cjs +1 -1
- 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 +1 -1
- package/dist/entities/comment/index.cjs +3 -3
- package/dist/entities/comment/index.d.cts +1 -1
- package/dist/entities/comment/index.d.mts +1 -1
- package/dist/entities/comment/index.mjs +3 -3
- package/dist/entities/content-pillar/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/formatter/index.d.cts +5 -5
- package/dist/entities/formatter/index.d.mts +5 -5
- package/dist/entities/gcflytour/index.cjs +3 -3
- package/dist/entities/gcflytour/index.d.cts +1 -1
- package/dist/entities/gcflytour/index.d.mts +1 -1
- package/dist/entities/gcflytour/index.mjs +3 -3
- package/dist/entities/gcflytour-snap/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/media-content-type/index.cjs +3 -3
- package/dist/entities/media-content-type/index.d.cts +3 -3
- package/dist/entities/media-content-type/index.d.mts +3 -3
- package/dist/entities/media-content-type/index.mjs +3 -3
- package/dist/entities/media-creative-format/index.cjs +3 -3
- package/dist/entities/media-creative-format/index.d.cts +3 -3
- package/dist/entities/media-creative-format/index.d.mts +3 -3
- package/dist/entities/media-creative-format/index.mjs +3 -3
- package/dist/entities/media-medium/index.cjs +3 -3
- package/dist/entities/media-medium/index.d.cts +3 -3
- package/dist/entities/media-medium/index.d.mts +3 -3
- package/dist/entities/media-medium/index.mjs +3 -3
- package/dist/entities/media-platform/index.cjs +3 -3
- 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 +3 -3
- package/dist/entities/monday-workspace/index.cjs +3 -3
- 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 +3 -3
- 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/tag/index.cjs +2 -2
- package/dist/entities/tag/index.d.cts +2 -2
- package/dist/entities/tag/index.d.mts +2 -2
- package/dist/entities/tag/index.mjs +2 -2
- package/dist/entities/team-member/index.cjs +3 -3
- package/dist/entities/team-member/index.d.cts +1 -1
- package/dist/entities/team-member/index.d.mts +1 -1
- package/dist/entities/team-member/index.mjs +3 -3
- package/dist/entities/teamwork/index.cjs +1 -1
- package/dist/entities/teamwork/index.d.cts +2 -2
- package/dist/entities/teamwork/index.d.mts +2 -2
- package/dist/entities/teamwork/index.mjs +1 -1
- package/dist/entities/trend/index.cjs +1 -1
- package/dist/entities/trend/index.d.cts +1 -1
- package/dist/entities/trend/index.d.mts +1 -1
- package/dist/entities/trend/index.mjs +1 -1
- package/dist/entities/up-auth/index.cjs +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/entities/up-user/index.d.cts +1 -1
- package/dist/entities/up-user/index.d.mts +1 -1
- package/dist/entities/up-user/index.mjs +1 -1
- package/dist/entities/url-redirect/index.cjs +2 -2
- package/dist/entities/url-redirect/index.d.cts +2 -2
- package/dist/entities/url-redirect/index.d.mts +2 -2
- package/dist/entities/url-redirect/index.mjs +2 -2
- package/dist/entities/user-account/index.cjs +2 -2
- 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 +2 -2
- package/dist/entities/utm-tracking-link/index.cjs +3 -3
- package/dist/entities/utm-tracking-link/index.d.cts +1 -1
- package/dist/entities/utm-tracking-link/index.d.mts +1 -1
- package/dist/entities/utm-tracking-link/index.mjs +3 -3
- 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-C9Hbvjc8.d.mts → index-9S5fRfl_.d.mts} +3 -3
- package/dist/{index-Dm8G_OXX.d.cts → index-BQ-q8Rqt.d.cts} +3 -3
- package/dist/{index-D7QXaSOY.d.cts → index-BhOJmpYi.d.cts} +5 -5
- package/dist/{index-CTc84rze.d.cts → index-CKbtwmVl.d.cts} +19 -19
- package/dist/{index-DpOKOSqT.d.mts → index-Ceb7nLSG.d.mts} +19 -19
- package/dist/{index-Bjjp-2Sa.d.mts → index-CxuLg4Y8.d.mts} +5 -5
- package/dist/{index-Bd8ZGWzA.d.mts → index-DSCV3ifg.d.mts} +4 -4
- package/dist/{index-D5VpzV4T.d.cts → index-KxCfd05r.d.cts} +4 -4
- package/dist/permissions/index.d.cts +1 -1
- package/dist/permissions/index.d.mts +1 -1
- package/dist/{query-BR5Ze6T2.mjs → query-BuKHwaMn.mjs} +2 -2
- package/dist/{query-qQ_HLlxx.cjs → query-LyGctccO.cjs} +2 -2
- package/dist/{sort-D3WwshqQ.mjs → sort-BJrzr4Xl.mjs} +1 -1
- package/dist/{sort-CI87SH1y.cjs → sort-DIln8tn5.cjs} +1 -1
- package/dist/utilities/index.d.cts +2 -2
- package/dist/utilities/index.d.mts +2 -2
- package/package.json +19 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_document = require("../../document-
|
|
2
|
+
const require_document = require("../../document-CxCEXgLG.cjs");
|
|
3
3
|
exports.CreateUserDocument = require_document.CreateUserDocument;
|
|
4
4
|
exports.LIMIT_USER_PAGINATION_DEFAULT_SIZE = require_document.LIMIT_USER_PAGINATION_DEFAULT_SIZE;
|
|
5
5
|
exports.LIMIT_USER_PAGINATION_MAX_SIZE = require_document.LIMIT_USER_PAGINATION_MAX_SIZE;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Gn as ValidUsername, Hn as QueryStrapiUsersByIdentifier, Jn as USER_SORT_KEYS, Kn as LIMIT_USER_PAGINATION_DEFAULT_SIZE, Rn as UserDocument, Un as CreateUserDocument, Vn as QueryStrapiUsers, Wn as QuerySortUsers, qn as LIMIT_USER_PAGINATION_MAX_SIZE } from "../../index-
|
|
1
|
+
import { Gn as ValidUsername, Hn as QueryStrapiUsersByIdentifier, Jn as USER_SORT_KEYS, Kn as LIMIT_USER_PAGINATION_DEFAULT_SIZE, Rn as UserDocument, Un as CreateUserDocument, Vn as QueryStrapiUsers, Wn as QuerySortUsers, qn as LIMIT_USER_PAGINATION_MAX_SIZE } from "../../index-CKbtwmVl.cjs";
|
|
2
2
|
export { CreateUserDocument, LIMIT_USER_PAGINATION_DEFAULT_SIZE, LIMIT_USER_PAGINATION_MAX_SIZE, QuerySortUsers, QueryStrapiUsers, QueryStrapiUsersByIdentifier, USER_SORT_KEYS, UserDocument, ValidUsername };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Gn as ValidUsername, Hn as QueryStrapiUsersByIdentifier, Jn as USER_SORT_KEYS, Kn as LIMIT_USER_PAGINATION_DEFAULT_SIZE, Rn as UserDocument, Un as CreateUserDocument, Vn as QueryStrapiUsers, Wn as QuerySortUsers, qn as LIMIT_USER_PAGINATION_MAX_SIZE } from "../../index-
|
|
1
|
+
import { Gn as ValidUsername, Hn as QueryStrapiUsersByIdentifier, Jn as USER_SORT_KEYS, Kn as LIMIT_USER_PAGINATION_DEFAULT_SIZE, Rn as UserDocument, Un as CreateUserDocument, Vn as QueryStrapiUsers, Wn as QuerySortUsers, qn as LIMIT_USER_PAGINATION_MAX_SIZE } from "../../index-Ceb7nLSG.mjs";
|
|
2
2
|
export { CreateUserDocument, LIMIT_USER_PAGINATION_DEFAULT_SIZE, LIMIT_USER_PAGINATION_MAX_SIZE, QuerySortUsers, QueryStrapiUsers, QueryStrapiUsersByIdentifier, USER_SORT_KEYS, UserDocument, ValidUsername };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { D as USER_SORT_KEYS, E as LIMIT_USER_PAGINATION_MAX_SIZE, T as LIMIT_USER_PAGINATION_DEFAULT_SIZE, _ as ValidUsername, g as QuerySortUsers, h as CreateUserDocument, m as QueryStrapiUsersByIdentifier, p as QueryStrapiUsers, v as UserDocument } from "../../document-
|
|
1
|
+
import { D as USER_SORT_KEYS, E as LIMIT_USER_PAGINATION_MAX_SIZE, T as LIMIT_USER_PAGINATION_DEFAULT_SIZE, _ as ValidUsername, g as QuerySortUsers, h as CreateUserDocument, m as QueryStrapiUsersByIdentifier, p as QueryStrapiUsers, v as UserDocument } from "../../document-CCIFcvUz.mjs";
|
|
2
2
|
export { CreateUserDocument, LIMIT_USER_PAGINATION_DEFAULT_SIZE, LIMIT_USER_PAGINATION_MAX_SIZE, QuerySortUsers, QueryStrapiUsers, QueryStrapiUsersByIdentifier, USER_SORT_KEYS, UserDocument, ValidUsername };
|
|
@@ -3,7 +3,7 @@ const require_chunk = require("../../chunk-CKQMccvm.cjs");
|
|
|
3
3
|
const require_document = require("../../document-BAro2Mrj.cjs");
|
|
4
4
|
require("../../limits-CW6iJ7kB.cjs");
|
|
5
5
|
const require_pagination = require("../../pagination-DWZDPzR4.cjs");
|
|
6
|
-
const require_sort = require("../../sort-
|
|
6
|
+
const require_sort = require("../../sort-DIln8tn5.cjs");
|
|
7
7
|
let valibot = require("valibot");
|
|
8
8
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
9
9
|
//#region src/entities/url-redirect/constants.ts
|
|
@@ -51,7 +51,7 @@ const UrlRedirectDocument = valibot.object({
|
|
|
51
51
|
const QueryStrapiPaginatedUrlRedirects = valibot.object({
|
|
52
52
|
page: valibot.fallback(valibot.optional(require_pagination.VPage(), 1), 1),
|
|
53
53
|
size: valibot.fallback(valibot.optional(valibot.pipe(valibot.number(), valibot.minValue(1), valibot.maxValue(LIMIT_REDIRECT_PAGINATION_MAX_SIZE)), 100), 100),
|
|
54
|
-
sort: QuerySortUrlRedirects
|
|
54
|
+
sort: valibot.optional(QuerySortUrlRedirects)
|
|
55
55
|
});
|
|
56
56
|
const QueryStrapiUrlRedirectsByFrom = valibot.object({ from: valibot.string() });
|
|
57
57
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as QuerySortOutput } from "../../index-
|
|
1
|
+
import { Z as QuerySortOutput } from "../../index-BhOJmpYi.cjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
|
|
4
4
|
//#region src/entities/url-redirect/constants.d.ts
|
|
@@ -35,7 +35,7 @@ type QuerySortUrlRedirects = v.InferOutput<typeof QuerySortUrlRedirects>;
|
|
|
35
35
|
declare const QueryStrapiPaginatedUrlRedirects: v.ObjectSchema<{
|
|
36
36
|
readonly page: v.SchemaWithFallback<v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>, 1>, 1>;
|
|
37
37
|
readonly size: v.SchemaWithFallback<v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 1000, undefined>]>, 100>, 100>;
|
|
38
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "is_active" | "from" | "to" | "status_code" | "query_params"
|
|
38
|
+
readonly sort: v.OptionalSchema<v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "is_active" | "from" | "to" | "status_code" | "query_params">>, undefined>;
|
|
39
39
|
}, undefined>;
|
|
40
40
|
type QueryStrapiPaginatedUrlRedirects = v.InferOutput<typeof QueryStrapiPaginatedUrlRedirects>;
|
|
41
41
|
declare const QueryStrapiUrlRedirectsByFrom: v.ObjectSchema<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as QuerySortOutput } from "../../index-
|
|
1
|
+
import { Z as QuerySortOutput } from "../../index-CxuLg4Y8.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
|
|
4
4
|
//#region src/entities/url-redirect/constants.d.ts
|
|
@@ -35,7 +35,7 @@ type QuerySortUrlRedirects = v.InferOutput<typeof QuerySortUrlRedirects>;
|
|
|
35
35
|
declare const QueryStrapiPaginatedUrlRedirects: v.ObjectSchema<{
|
|
36
36
|
readonly page: v.SchemaWithFallback<v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>, 1>, 1>;
|
|
37
37
|
readonly size: v.SchemaWithFallback<v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 1000, undefined>]>, 100>, 100>;
|
|
38
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "is_active" | "from" | "to" | "status_code" | "query_params"
|
|
38
|
+
readonly sort: v.OptionalSchema<v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "is_active" | "from" | "to" | "status_code" | "query_params">>, undefined>;
|
|
39
39
|
}, undefined>;
|
|
40
40
|
type QueryStrapiPaginatedUrlRedirects = v.InferOutput<typeof QueryStrapiPaginatedUrlRedirects>;
|
|
41
41
|
declare const QueryStrapiUrlRedirectsByFrom: v.ObjectSchema<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as BaseDocument } from "../../document-Bqoi1MdT.mjs";
|
|
2
2
|
import "../../limits-CKGuEuKA.mjs";
|
|
3
3
|
import { t as VPage } from "../../pagination-D5l_UjyM.mjs";
|
|
4
|
-
import { r as createQuerySort } from "../../sort-
|
|
4
|
+
import { r as createQuerySort } from "../../sort-BJrzr4Xl.mjs";
|
|
5
5
|
import * as v from "valibot";
|
|
6
6
|
//#region src/entities/url-redirect/constants.ts
|
|
7
7
|
const LIMIT_REDIRECT_PAGINATION_DEFAULT_SIZE = 100;
|
|
@@ -48,7 +48,7 @@ const UrlRedirectDocument = v.object({
|
|
|
48
48
|
const QueryStrapiPaginatedUrlRedirects = v.object({
|
|
49
49
|
page: v.fallback(v.optional(VPage(), 1), 1),
|
|
50
50
|
size: v.fallback(v.optional(v.pipe(v.number(), v.minValue(1), v.maxValue(LIMIT_REDIRECT_PAGINATION_MAX_SIZE)), 100), 100),
|
|
51
|
-
sort: QuerySortUrlRedirects
|
|
51
|
+
sort: v.optional(QuerySortUrlRedirects)
|
|
52
52
|
});
|
|
53
53
|
const QueryStrapiUrlRedirectsByFrom = v.object({ from: v.string() });
|
|
54
54
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-CKQMccvm.cjs");
|
|
3
|
-
const require_query = require("../../query-
|
|
3
|
+
const require_query = require("../../query-LyGctccO.cjs");
|
|
4
4
|
const require_string = require("../../string-Yn-6xiAZ.cjs");
|
|
5
5
|
const require_relationships = require("../../relationships-DjHwYd4r.cjs");
|
|
6
|
-
const require_document = require("../../document-
|
|
6
|
+
const require_document = require("../../document-CxCEXgLG.cjs");
|
|
7
7
|
let valibot = require("valibot");
|
|
8
8
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
9
9
|
//#region src/entities/user-account/mutation.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as QueryStrapiByDocumentId, W as QueryStrapiById } from "../../index-
|
|
2
|
-
import { Bn as UserAccountDocument } from "../../index-
|
|
1
|
+
import { H as QueryStrapiByDocumentId, W as QueryStrapiById } from "../../index-BhOJmpYi.cjs";
|
|
2
|
+
import { Bn as UserAccountDocument } from "../../index-CKbtwmVl.cjs";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
|
|
5
5
|
//#region src/entities/user-account/mutation.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as QueryStrapiByDocumentId, W as QueryStrapiById } from "../../index-
|
|
2
|
-
import { Bn as UserAccountDocument } from "../../index-
|
|
1
|
+
import { H as QueryStrapiByDocumentId, W as QueryStrapiById } from "../../index-CxuLg4Y8.mjs";
|
|
2
|
+
import { Bn as UserAccountDocument } from "../../index-Ceb7nLSG.mjs";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
|
|
5
5
|
//#region src/entities/user-account/mutation.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as QueryStrapiById, t as QueryStrapiByDocumentId } from "../../query-
|
|
1
|
+
import { r as QueryStrapiById, t as QueryStrapiByDocumentId } from "../../query-BuKHwaMn.mjs";
|
|
2
2
|
import { a as VStringMinMax } from "../../string-BHHnD2Qu.mjs";
|
|
3
3
|
import { o as SAssociateOneEntity } from "../../relationships-yPO5SILR.mjs";
|
|
4
|
-
import { b as UserAccountDocument } from "../../document-
|
|
4
|
+
import { b as UserAccountDocument } from "../../document-CCIFcvUz.mjs";
|
|
5
5
|
import * as v from "valibot";
|
|
6
6
|
//#region src/entities/user-account/mutation.ts
|
|
7
7
|
const UpdateUserAccount = v.object({
|
|
@@ -2,13 +2,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_chunk = require("../../chunk-CKQMccvm.cjs");
|
|
3
3
|
const require_limits = require("../../limits-CW6iJ7kB.cjs");
|
|
4
4
|
const require_pagination = require("../../pagination-DWZDPzR4.cjs");
|
|
5
|
-
const require_sort = require("../../sort-
|
|
5
|
+
const require_sort = require("../../sort-DIln8tn5.cjs");
|
|
6
6
|
const require_regex = require("../../regex-BEFTMiHO.cjs");
|
|
7
7
|
const require_string = require("../../string-Yn-6xiAZ.cjs");
|
|
8
8
|
const require_relationships = require("../../relationships-DjHwYd4r.cjs");
|
|
9
9
|
require("../../constants/index.cjs");
|
|
10
10
|
const require_utm = require("../../utm-BqkYlpua.cjs");
|
|
11
|
-
const require_document = require("../../document-
|
|
11
|
+
const require_document = require("../../document-CxCEXgLG.cjs");
|
|
12
12
|
let valibot = require("valibot");
|
|
13
13
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
14
14
|
//#region src/entities/utm-tracking-link/constants.ts
|
|
@@ -160,7 +160,7 @@ const QueryStrapiSearchUtmTrackingLinks = valibot.object({
|
|
|
160
160
|
url: valibot.optional(require_utm.VStringUrlUtm()),
|
|
161
161
|
is_active: valibot.optional(valibot.boolean()),
|
|
162
162
|
notes: valibot.optional(require_string.VStringShort(0)),
|
|
163
|
-
sort: QuerySortUtmTrackingLinks
|
|
163
|
+
sort: valibot.optional(QuerySortUtmTrackingLinks)
|
|
164
164
|
});
|
|
165
165
|
//#endregion
|
|
166
166
|
exports.CreateUtmTrackingLinkDocument = CreateUtmTrackingLinkDocument;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as UTM_TRACKING_LINK_SORT_KEYS, Ct as ValidUtmContent, Dt as ValidUtmSource, Et as ValidUtmMedium, Ot as LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE, St as ValidUtmCampaign, Tt as ValidUtmId, _t as SFormCreateMultipleUtmTrackingLinkDocuments, bt as UpdateUtmTrackingLinkDocumentRequest, gt as CreateUtmTrackingLinkParts, ht as CreateUtmTrackingLinkDocumentRequest, kt as LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE, mt as CreateUtmTrackingLinkDocument, pt as QueryStrapiSearchUtmTrackingLinks, vt as SReadUtmTrackingLinkDocumentByUrl, wt as ValidUtmCreativeFormat, xt as QuerySortUtmTrackingLinks, yt as UpdateUtmTrackingLinkDocument, zn as UtmTrackingLinkDocument } from "../../index-
|
|
1
|
+
import { At as UTM_TRACKING_LINK_SORT_KEYS, Ct as ValidUtmContent, Dt as ValidUtmSource, Et as ValidUtmMedium, Ot as LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE, St as ValidUtmCampaign, Tt as ValidUtmId, _t as SFormCreateMultipleUtmTrackingLinkDocuments, bt as UpdateUtmTrackingLinkDocumentRequest, gt as CreateUtmTrackingLinkParts, ht as CreateUtmTrackingLinkDocumentRequest, kt as LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE, mt as CreateUtmTrackingLinkDocument, pt as QueryStrapiSearchUtmTrackingLinks, vt as SReadUtmTrackingLinkDocumentByUrl, wt as ValidUtmCreativeFormat, xt as QuerySortUtmTrackingLinks, yt as UpdateUtmTrackingLinkDocument, zn as UtmTrackingLinkDocument } from "../../index-CKbtwmVl.cjs";
|
|
2
2
|
export { CreateUtmTrackingLinkDocument, CreateUtmTrackingLinkDocumentRequest, CreateUtmTrackingLinkParts, LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE, LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE, QuerySortUtmTrackingLinks, QueryStrapiSearchUtmTrackingLinks, SFormCreateMultipleUtmTrackingLinkDocuments, SReadUtmTrackingLinkDocumentByUrl, UTM_TRACKING_LINK_SORT_KEYS, UpdateUtmTrackingLinkDocument, UpdateUtmTrackingLinkDocumentRequest, UtmTrackingLinkDocument, ValidUtmCampaign, ValidUtmContent, ValidUtmCreativeFormat, ValidUtmId, ValidUtmMedium, ValidUtmSource };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as UTM_TRACKING_LINK_SORT_KEYS, Ct as ValidUtmContent, Dt as ValidUtmSource, Et as ValidUtmMedium, Ot as LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE, St as ValidUtmCampaign, Tt as ValidUtmId, _t as SFormCreateMultipleUtmTrackingLinkDocuments, bt as UpdateUtmTrackingLinkDocumentRequest, gt as CreateUtmTrackingLinkParts, ht as CreateUtmTrackingLinkDocumentRequest, kt as LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE, mt as CreateUtmTrackingLinkDocument, pt as QueryStrapiSearchUtmTrackingLinks, vt as SReadUtmTrackingLinkDocumentByUrl, wt as ValidUtmCreativeFormat, xt as QuerySortUtmTrackingLinks, yt as UpdateUtmTrackingLinkDocument, zn as UtmTrackingLinkDocument } from "../../index-
|
|
1
|
+
import { At as UTM_TRACKING_LINK_SORT_KEYS, Ct as ValidUtmContent, Dt as ValidUtmSource, Et as ValidUtmMedium, Ot as LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE, St as ValidUtmCampaign, Tt as ValidUtmId, _t as SFormCreateMultipleUtmTrackingLinkDocuments, bt as UpdateUtmTrackingLinkDocumentRequest, gt as CreateUtmTrackingLinkParts, ht as CreateUtmTrackingLinkDocumentRequest, kt as LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE, mt as CreateUtmTrackingLinkDocument, pt as QueryStrapiSearchUtmTrackingLinks, vt as SReadUtmTrackingLinkDocumentByUrl, wt as ValidUtmCreativeFormat, xt as QuerySortUtmTrackingLinks, yt as UpdateUtmTrackingLinkDocument, zn as UtmTrackingLinkDocument } from "../../index-Ceb7nLSG.mjs";
|
|
2
2
|
export { CreateUtmTrackingLinkDocument, CreateUtmTrackingLinkDocumentRequest, CreateUtmTrackingLinkParts, LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE, LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE, QuerySortUtmTrackingLinks, QueryStrapiSearchUtmTrackingLinks, SFormCreateMultipleUtmTrackingLinkDocuments, SReadUtmTrackingLinkDocumentByUrl, UTM_TRACKING_LINK_SORT_KEYS, UpdateUtmTrackingLinkDocument, UpdateUtmTrackingLinkDocumentRequest, UtmTrackingLinkDocument, ValidUtmCampaign, ValidUtmContent, ValidUtmCreativeFormat, ValidUtmId, ValidUtmMedium, ValidUtmSource };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as LIMIT_MAX_UTM_CONTENT, d as LIMIT_MAX_UTM_MEDIUM, f as LIMIT_MAX_UTM_SOURCE, l as LIMIT_MAX_UTM_CREATIVE_FORMAT, s as LIMIT_MAX_UTM_CAMPAIGN, u as LIMIT_MAX_UTM_ID } from "../../limits-CKGuEuKA.mjs";
|
|
2
2
|
import { n as VSize, t as VPage } from "../../pagination-D5l_UjyM.mjs";
|
|
3
|
-
import { r as createQuerySort } from "../../sort-
|
|
3
|
+
import { r as createQuerySort } from "../../sort-BJrzr4Xl.mjs";
|
|
4
4
|
import { r as ERROR_MESSAGE_REGEX_UTM_VALUE, s as REGEX_UTM_VALUE } from "../../regex-pSdcbWzV.mjs";
|
|
5
5
|
import { a as VStringMinMax, c as VStringShortNullable, l as VStringShortToCSV, o as VStringMinMaxRegex, r as VStringLongNullable, s as VStringShort } from "../../string-BHHnD2Qu.mjs";
|
|
6
6
|
import { l as SQueryManyEntities, o as SAssociateOneEntity } from "../../relationships-yPO5SILR.mjs";
|
|
7
7
|
import "../../constants/index.mjs";
|
|
8
8
|
import { n as VStringUrlUtm, t as VStringUrlNoUtm } from "../../utm-ZUwmBoR2.mjs";
|
|
9
|
-
import { y as UtmTrackingLinkDocument } from "../../document-
|
|
9
|
+
import { y as UtmTrackingLinkDocument } from "../../document-CCIFcvUz.mjs";
|
|
10
10
|
import * as v from "valibot";
|
|
11
11
|
//#region src/entities/utm-tracking-link/constants.ts
|
|
12
12
|
const LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE = 10;
|
|
@@ -157,7 +157,7 @@ const QueryStrapiSearchUtmTrackingLinks = v.object({
|
|
|
157
157
|
url: v.optional(VStringUrlUtm()),
|
|
158
158
|
is_active: v.optional(v.boolean()),
|
|
159
159
|
notes: v.optional(VStringShort(0)),
|
|
160
|
-
sort: QuerySortUtmTrackingLinks
|
|
160
|
+
sort: v.optional(QuerySortUtmTrackingLinks)
|
|
161
161
|
});
|
|
162
162
|
//#endregion
|
|
163
163
|
export { CreateUtmTrackingLinkDocument, CreateUtmTrackingLinkDocumentRequest, CreateUtmTrackingLinkParts, LIMIT_UTM_TRACKING_LINK_PAGINATION_DEFAULT_SIZE, LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE, QuerySortUtmTrackingLinks, QueryStrapiSearchUtmTrackingLinks, SFormCreateMultipleUtmTrackingLinkDocuments, SReadUtmTrackingLinkDocumentByUrl, UTM_TRACKING_LINK_SORT_KEYS, UpdateUtmTrackingLinkDocument, UpdateUtmTrackingLinkDocumentRequest, UtmTrackingLinkDocument, ValidUtmCampaign, ValidUtmContent, ValidUtmCreativeFormat, ValidUtmId, ValidUtmMedium, ValidUtmSource };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../chunk-CKQMccvm.cjs");
|
|
3
|
+
const require_regex = require("../regex-BEFTMiHO.cjs");
|
|
4
|
+
let valibot = require("valibot");
|
|
5
|
+
valibot = require_chunk.__toESM(valibot, 1);
|
|
6
|
+
let randexp = require("randexp");
|
|
7
|
+
randexp = require_chunk.__toESM(randexp, 1);
|
|
8
|
+
//#region src/generators/index.ts
|
|
9
|
+
function generateValid(opts) {
|
|
10
|
+
const includeOptionalProb = opts?.includeOptionalProb ?? .7;
|
|
11
|
+
const maxAttempts = opts?.maxAttempts ?? 30;
|
|
12
|
+
const hooks = opts?.hooks ?? {};
|
|
13
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
14
|
+
const raw = _genWithHooks(opts.schema, { includeOptionalProb }, hooks, []);
|
|
15
|
+
const value = opts.overrides ? deepMerge(raw, opts.overrides) : raw;
|
|
16
|
+
const res = valibot.safeParse(opts.schema, value);
|
|
17
|
+
if (res.success) {
|
|
18
|
+
const output = res.output;
|
|
19
|
+
for (const field of opts.excludedFields ?? []) delete output[field];
|
|
20
|
+
return output;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
throw new Error("generateValid could not satisfy schema");
|
|
24
|
+
}
|
|
25
|
+
function _genWithHooks(schema, ctx, hooks, path) {
|
|
26
|
+
const val = _gen(schema, ctx, path);
|
|
27
|
+
const key = path[path.length - 1];
|
|
28
|
+
const pathKey = path.join(".");
|
|
29
|
+
if (hooks[pathKey]) return hooks[pathKey](val, schema, path);
|
|
30
|
+
if (key && hooks[key]) return hooks[key](val, schema, path);
|
|
31
|
+
return val;
|
|
32
|
+
}
|
|
33
|
+
function _gen(schema, ctx, path = []) {
|
|
34
|
+
switch (schema?.type) {
|
|
35
|
+
case "object": {
|
|
36
|
+
const out = {};
|
|
37
|
+
const entries = schema.entries ?? {};
|
|
38
|
+
for (const [key, sub] of Object.entries(entries)) {
|
|
39
|
+
const isOptional = sub?.type === "optional";
|
|
40
|
+
if (isOptional && Math.random() > ctx.includeOptionalProb) continue;
|
|
41
|
+
out[key] = _gen(isOptional ? unwrapOptional(sub) : sub, ctx, [...path, key]);
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
case "array": {
|
|
46
|
+
const item = schema.item ?? schema.items;
|
|
47
|
+
const min = getArrayMin(schema) ?? 0;
|
|
48
|
+
const len = randInt(min, Math.max(min, Math.min(5, getArrayMax(schema) ?? 3)));
|
|
49
|
+
return Array.from({ length: len }, () => _gen(item, ctx, [...path, String(len)]));
|
|
50
|
+
}
|
|
51
|
+
case "tuple": return (schema.items ?? schema.entries ?? []).map((s, i) => _gen(s, ctx, [...path, String(i)]));
|
|
52
|
+
case "union": {
|
|
53
|
+
const options = schema.options ?? schema.variants ?? [];
|
|
54
|
+
for (const opt of shuffle([...options])) {
|
|
55
|
+
const val = _gen(opt, ctx, path);
|
|
56
|
+
if (valibot.safeParse(opt, val).success) return val;
|
|
57
|
+
}
|
|
58
|
+
return _gen(options[0], ctx, path);
|
|
59
|
+
}
|
|
60
|
+
case "literal": return schema.literal;
|
|
61
|
+
case "enum": return randomItem(schema.options ?? schema.values ?? schema.variants ?? []);
|
|
62
|
+
case "picklist": return randomItem(schema.options ?? schema.values ?? schema.variants ?? []);
|
|
63
|
+
case "record": {
|
|
64
|
+
const keySchema = schema.key ?? schema.keySchema ?? valibot.string();
|
|
65
|
+
const valueSchema = schema.value ?? schema.valueSchema ?? valibot.unknown();
|
|
66
|
+
const count = randInt(1, 3);
|
|
67
|
+
const obj = {};
|
|
68
|
+
for (let i = 0; i < count; i++) {
|
|
69
|
+
const k = String(_gen(keySchema, ctx, [...path, "key"]));
|
|
70
|
+
obj[k] = _gen(valueSchema, ctx, [...path, k]);
|
|
71
|
+
}
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
74
|
+
case "string":
|
|
75
|
+
const stringPipe = schema?.pipe || [];
|
|
76
|
+
for (const p of stringPipe) {
|
|
77
|
+
if (p?.type === "iso_date") {
|
|
78
|
+
const [min, max] = getDateBounds(schema);
|
|
79
|
+
return new Date(randInt(min.getTime(), max.getTime())).toISOString().split("T")[0];
|
|
80
|
+
}
|
|
81
|
+
if (p?.type === "iso_datetime") {
|
|
82
|
+
const [min, max] = getDateBounds(schema);
|
|
83
|
+
return new Date(randInt(min.getTime(), max.getTime())).toISOString();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return makeString(schema);
|
|
87
|
+
case "number":
|
|
88
|
+
schema.pipe;
|
|
89
|
+
return makeNumber(schema);
|
|
90
|
+
case "boolean": return Math.random() < .5;
|
|
91
|
+
case "bigint": {
|
|
92
|
+
const n = makeNumber(schema);
|
|
93
|
+
return BigInt(Math.trunc(n));
|
|
94
|
+
}
|
|
95
|
+
case "date": {
|
|
96
|
+
const [min, max] = getDateBounds(schema);
|
|
97
|
+
return new Date(randInt(min.getTime(), max.getTime()));
|
|
98
|
+
}
|
|
99
|
+
case "nullable": {
|
|
100
|
+
const inner = schema.wrapped ?? schema.inner ?? schema.item;
|
|
101
|
+
return Math.random() < .2 ? null : _gen(inner, ctx, path);
|
|
102
|
+
}
|
|
103
|
+
case "optional": return _gen(unwrapOptional(schema), ctx, path);
|
|
104
|
+
default: return {};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function unwrapOptional(s) {
|
|
108
|
+
return s.wrapped ?? s.inner ?? s.item ?? s.schema ?? s;
|
|
109
|
+
}
|
|
110
|
+
function getChecks(schema) {
|
|
111
|
+
return Array.isArray(schema?.pipe) ? schema.pipe : [];
|
|
112
|
+
}
|
|
113
|
+
function getArrayMin(schema) {
|
|
114
|
+
const min = getChecks(schema).find((c) => c?.type === "min_length")?.requirement;
|
|
115
|
+
return typeof min === "number" ? min : void 0;
|
|
116
|
+
}
|
|
117
|
+
function getArrayMax(schema) {
|
|
118
|
+
const max = getChecks(schema).find((c) => c?.type === "max_length")?.requirement;
|
|
119
|
+
return typeof max === "number" ? max : void 0;
|
|
120
|
+
}
|
|
121
|
+
function makeString(schema) {
|
|
122
|
+
const checks = getChecks(schema);
|
|
123
|
+
const has = (k) => checks.some((c) => c?.type === k);
|
|
124
|
+
if (has("email")) return `${boundedAscii(5, 10).toLowerCase()}@${boundedAscii(3, 8).toLowerCase()}.com`;
|
|
125
|
+
if (has("url")) return `https://${boundedAscii(3, 8).toLowerCase()}.dev/${boundedAscii(3, 10)}`;
|
|
126
|
+
if (has("uuid")) return cryptoLikeRandomUUID();
|
|
127
|
+
if (checks.some((c) => c?.message?.includes("valid phone number"))) return `+1${fromPool("0123456789", 10)}`;
|
|
128
|
+
const minLen = checks.find((c) => c?.type === "min_length")?.requirement ?? 0;
|
|
129
|
+
const maxLen = checks.find((c) => c?.type === "max_length")?.requirement ?? Math.max(8, minLen + 8);
|
|
130
|
+
const targetLen = clamp(randInt(minLen, Math.max(minLen, Math.min(24, maxLen))), minLen, maxLen);
|
|
131
|
+
const rx = checks.find((c) => c?.type === "regex")?.requirement;
|
|
132
|
+
if (rx) {
|
|
133
|
+
pickPoolForRegex(rx);
|
|
134
|
+
const rxp = new randexp.default(rx);
|
|
135
|
+
for (let i = 0; i < 80; i++) {
|
|
136
|
+
const limit = randInt(minLen, Math.min(maxLen, targetLen));
|
|
137
|
+
let candidate = rxp.gen();
|
|
138
|
+
if (candidate.length > limit) candidate = candidate.slice(0, limit);
|
|
139
|
+
if (rx.test(candidate) && candidate.length >= minLen && candidate.length <= maxLen) return candidate;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return boundedAscii(minLen, targetLen);
|
|
143
|
+
}
|
|
144
|
+
function makeNumber(schema) {
|
|
145
|
+
const checks = getChecks(schema);
|
|
146
|
+
let min = checks.find((c) => c?.type === "min_value")?.requirement ?? 0;
|
|
147
|
+
let max = checks.find((c) => c?.type === "max_value")?.requirement ?? 1e3;
|
|
148
|
+
if (min > max) [min, max] = [max, min];
|
|
149
|
+
return checks.some((c) => c?.type === "number" || c?.type === "int") ? randInt(Math.ceil(min), Math.floor(max)) : randFloat(min, max);
|
|
150
|
+
}
|
|
151
|
+
function getDateBounds(schema) {
|
|
152
|
+
const checks = getChecks(schema);
|
|
153
|
+
const min = checks.find((c) => c?.type === "min_value")?.requirement;
|
|
154
|
+
const max = checks.find((c) => c?.type === "max_value")?.requirement;
|
|
155
|
+
return [min instanceof Date ? min : /* @__PURE__ */ new Date(Date.now() - 365 * 24 * 3600 * 1e3), max instanceof Date ? max : new Date(Date.now() + 365 * 24 * 3600 * 1e3)];
|
|
156
|
+
}
|
|
157
|
+
const ABC = "abcdefghijklmnopqrstuvwxyz";
|
|
158
|
+
const NUM = "0123456789";
|
|
159
|
+
const ALNUM = ABC + ABC.toUpperCase() + NUM;
|
|
160
|
+
const VALUE_SAFE = ALNUM + "._-";
|
|
161
|
+
function pickPoolForRegex(rx) {
|
|
162
|
+
const src = rx.source;
|
|
163
|
+
if (/^\^?[\(\[]?[A-Za-z0-9._-]+\+[\)\]]\??\$?$/.test(src) || require_regex.REGEX_UTM_VALUE.test(src)) return VALUE_SAFE;
|
|
164
|
+
if (/\[0-9\]|\\d/.test(src)) {
|
|
165
|
+
if (!/[a-zA-Z]/.test(src)) return NUM;
|
|
166
|
+
return ALNUM;
|
|
167
|
+
}
|
|
168
|
+
if (/\[a-z]/.test(src) && /\[A-Z]/.test(src)) return ALNUM;
|
|
169
|
+
if (/\[a-z]/.test(src)) return ABC;
|
|
170
|
+
if (/\[A-Z]/.test(src)) return ABC.toUpperCase();
|
|
171
|
+
return ALNUM;
|
|
172
|
+
}
|
|
173
|
+
function fromPool(pool, len) {
|
|
174
|
+
let s = "";
|
|
175
|
+
for (let i = 0; i < len; i++) s += pool[randInt(0, pool.length - 1)];
|
|
176
|
+
return s;
|
|
177
|
+
}
|
|
178
|
+
function boundedAscii(min, max) {
|
|
179
|
+
const len = randInt(min, Math.max(min, max));
|
|
180
|
+
let s = "";
|
|
181
|
+
for (let i = 0; i < len; i++) s += ALNUM[randInt(0, ALNUM.length - 1)];
|
|
182
|
+
return s;
|
|
183
|
+
}
|
|
184
|
+
function cryptoLikeRandomUUID() {
|
|
185
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return crypto.randomUUID();
|
|
186
|
+
const s = [];
|
|
187
|
+
const hex = "0123456789abcdef";
|
|
188
|
+
for (let i = 0; i < 36; i++) s[i] = hex[randInt(0, 15)];
|
|
189
|
+
s[14] = "4";
|
|
190
|
+
s[19] = hex[parseInt(s[19], 16) & 3 | 8];
|
|
191
|
+
s[8] = s[13] = s[18] = s[23] = "-";
|
|
192
|
+
return s.join("");
|
|
193
|
+
}
|
|
194
|
+
function randInt(min, max) {
|
|
195
|
+
const lo = Math.ceil(min);
|
|
196
|
+
return Math.floor(Math.random() * (Math.floor(max) - lo + 1)) + lo;
|
|
197
|
+
}
|
|
198
|
+
function randFloat(min, max) {
|
|
199
|
+
return Math.random() * (max - min) + min;
|
|
200
|
+
}
|
|
201
|
+
function randomItem(arr) {
|
|
202
|
+
return arr[randInt(0, arr.length - 1)];
|
|
203
|
+
}
|
|
204
|
+
function shuffle(arr) {
|
|
205
|
+
for (let i = arr.length - 1; i > 0; i--) {
|
|
206
|
+
const j = randInt(0, i);
|
|
207
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
208
|
+
}
|
|
209
|
+
return arr;
|
|
210
|
+
}
|
|
211
|
+
function deepMerge(a, b) {
|
|
212
|
+
if (Array.isArray(a) && Array.isArray(b)) return b;
|
|
213
|
+
if (isPlain(a) && isPlain(b)) {
|
|
214
|
+
const out = { ...a };
|
|
215
|
+
for (const [k, v] of Object.entries(b)) {
|
|
216
|
+
if (v === void 0) continue;
|
|
217
|
+
out[k] = k in a ? deepMerge(a[k], v) : v;
|
|
218
|
+
}
|
|
219
|
+
return out;
|
|
220
|
+
}
|
|
221
|
+
return b ?? a;
|
|
222
|
+
}
|
|
223
|
+
function isPlain(x) {
|
|
224
|
+
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
225
|
+
}
|
|
226
|
+
function clamp(n, lo, hi) {
|
|
227
|
+
return Math.max(lo, Math.min(hi, n));
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
exports.boundedAscii = boundedAscii;
|
|
231
|
+
exports.generateValid = generateValid;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
|
|
3
|
+
//#region src/generators/index.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Generate a random valid value for a given Valibot schema.
|
|
6
|
+
* Tuned to hit 100% validity for the user's CreateCampaign* schemas.
|
|
7
|
+
*/
|
|
8
|
+
type Hook = (input: unknown, schema: any, path: string[]) => unknown;
|
|
9
|
+
declare function generateValid<T, O = unknown>(opts: {
|
|
10
|
+
schema: v.BaseSchema<T, T, v.BaseIssue<O>>;
|
|
11
|
+
overrides?: Partial<T>;
|
|
12
|
+
excludedFields?: (keyof T)[];
|
|
13
|
+
includeOptionalProb?: number;
|
|
14
|
+
maxAttempts?: number;
|
|
15
|
+
hooks?: Record<string, Hook>;
|
|
16
|
+
}): T;
|
|
17
|
+
declare function boundedAscii(min: number, max: number): string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { boundedAscii, generateValid };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
|
|
3
|
+
//#region src/generators/index.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Generate a random valid value for a given Valibot schema.
|
|
6
|
+
* Tuned to hit 100% validity for the user's CreateCampaign* schemas.
|
|
7
|
+
*/
|
|
8
|
+
type Hook = (input: unknown, schema: any, path: string[]) => unknown;
|
|
9
|
+
declare function generateValid<T, O = unknown>(opts: {
|
|
10
|
+
schema: v.BaseSchema<T, T, v.BaseIssue<O>>;
|
|
11
|
+
overrides?: Partial<T>;
|
|
12
|
+
excludedFields?: (keyof T)[];
|
|
13
|
+
includeOptionalProb?: number;
|
|
14
|
+
maxAttempts?: number;
|
|
15
|
+
hooks?: Record<string, Hook>;
|
|
16
|
+
}): T;
|
|
17
|
+
declare function boundedAscii(min: number, max: number): string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { boundedAscii, generateValid };
|