@getcommunity/gc-validators 0.0.271-alpha.26 → 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/entities/blog-post/index.d.cts +1 -1
- package/dist/entities/blog-post/index.d.mts +1 -1
- package/dist/entities/category/index.d.cts +1 -1
- package/dist/entities/category/index.d.mts +1 -1
- package/dist/entities/client/index.d.cts +1 -1
- package/dist/entities/client/index.d.mts +1 -1
- 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-media-platform/index.d.cts +1 -1
- package/dist/entities/client-media-platform/index.d.mts +1 -1
- package/dist/entities/client-project/index.d.cts +1 -1
- package/dist/entities/client-project/index.d.mts +1 -1
- package/dist/entities/client-report/index.d.cts +1 -1
- package/dist/entities/client-report/index.d.mts +1 -1
- package/dist/entities/client-styleguide/index.d.cts +1 -1
- package/dist/entities/client-styleguide/index.d.mts +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/comment/index.d.cts +1 -1
- package/dist/entities/comment/index.d.mts +1 -1
- package/dist/entities/content-pillar/index.d.cts +1 -1
- package/dist/entities/content-pillar/index.d.mts +1 -1
- package/dist/entities/formatter/index.d.cts +5 -5
- package/dist/entities/formatter/index.d.mts +5 -5
- package/dist/entities/gcflytour/index.d.cts +1 -1
- package/dist/entities/gcflytour/index.d.mts +1 -1
- package/dist/entities/gcflytour-snap/index.d.cts +1 -1
- package/dist/entities/gcflytour-snap/index.d.mts +1 -1
- package/dist/entities/media-content-type/index.d.cts +1 -1
- package/dist/entities/media-content-type/index.d.mts +1 -1
- package/dist/entities/media-creative-format/index.d.cts +1 -1
- package/dist/entities/media-creative-format/index.d.mts +1 -1
- package/dist/entities/media-medium/index.d.cts +1 -1
- package/dist/entities/media-medium/index.d.mts +1 -1
- package/dist/entities/media-platform/index.d.cts +1 -1
- package/dist/entities/media-platform/index.d.mts +1 -1
- package/dist/entities/monday-workspace/index.d.cts +1 -1
- package/dist/entities/monday-workspace/index.d.mts +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/team-member/index.d.cts +1 -1
- package/dist/entities/team-member/index.d.mts +1 -1
- package/dist/entities/trend/index.d.cts +1 -1
- package/dist/entities/trend/index.d.mts +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-permission/index.d.cts +1 -1
- package/dist/entities/up-permission/index.d.mts +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-user/index.d.cts +1 -1
- package/dist/entities/up-user/index.d.mts +1 -1
- package/dist/entities/user-account/index.d.cts +1 -1
- package/dist/entities/user-account/index.d.mts +1 -1
- package/dist/entities/utm-tracking-link/index.d.cts +1 -1
- package/dist/entities/utm-tracking-link/index.d.mts +1 -1
- 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-CTc84rze.d.cts → index-C1GoH-4v.d.cts} +9 -9
- package/dist/{index-Dm8G_OXX.d.cts → index-CBW5QmNu.d.cts} +3 -3
- package/dist/{index-DpOKOSqT.d.mts → index-ClQOYhKi.d.mts} +9 -9
- package/dist/{index-Bd8ZGWzA.d.mts → index-Cqmmzi2g.d.mts} +3 -3
- package/dist/{index-C9Hbvjc8.d.mts → index-DKFW5ay8.d.mts} +3 -3
- package/dist/{index-D5VpzV4T.d.cts → index-WN2TBKki.d.cts} +3 -3
- package/dist/permissions/index.d.cts +1 -1
- package/dist/permissions/index.d.mts +1 -1
- package/dist/utilities/index.d.cts +1 -1
- package/dist/utilities/index.d.mts +1 -1
- package/package.json +19 -2
|
@@ -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 };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { s as REGEX_UTM_VALUE } from "../regex-pSdcbWzV.mjs";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
import RandExp from "randexp";
|
|
4
|
+
//#region src/generators/index.ts
|
|
5
|
+
function generateValid(opts) {
|
|
6
|
+
const includeOptionalProb = opts?.includeOptionalProb ?? .7;
|
|
7
|
+
const maxAttempts = opts?.maxAttempts ?? 30;
|
|
8
|
+
const hooks = opts?.hooks ?? {};
|
|
9
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
10
|
+
const raw = _genWithHooks(opts.schema, { includeOptionalProb }, hooks, []);
|
|
11
|
+
const value = opts.overrides ? deepMerge(raw, opts.overrides) : raw;
|
|
12
|
+
const res = v.safeParse(opts.schema, value);
|
|
13
|
+
if (res.success) {
|
|
14
|
+
const output = res.output;
|
|
15
|
+
for (const field of opts.excludedFields ?? []) delete output[field];
|
|
16
|
+
return output;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
throw new Error("generateValid could not satisfy schema");
|
|
20
|
+
}
|
|
21
|
+
function _genWithHooks(schema, ctx, hooks, path) {
|
|
22
|
+
const val = _gen(schema, ctx, path);
|
|
23
|
+
const key = path[path.length - 1];
|
|
24
|
+
const pathKey = path.join(".");
|
|
25
|
+
if (hooks[pathKey]) return hooks[pathKey](val, schema, path);
|
|
26
|
+
if (key && hooks[key]) return hooks[key](val, schema, path);
|
|
27
|
+
return val;
|
|
28
|
+
}
|
|
29
|
+
function _gen(schema, ctx, path = []) {
|
|
30
|
+
switch (schema?.type) {
|
|
31
|
+
case "object": {
|
|
32
|
+
const out = {};
|
|
33
|
+
const entries = schema.entries ?? {};
|
|
34
|
+
for (const [key, sub] of Object.entries(entries)) {
|
|
35
|
+
const isOptional = sub?.type === "optional";
|
|
36
|
+
if (isOptional && Math.random() > ctx.includeOptionalProb) continue;
|
|
37
|
+
out[key] = _gen(isOptional ? unwrapOptional(sub) : sub, ctx, [...path, key]);
|
|
38
|
+
}
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
case "array": {
|
|
42
|
+
const item = schema.item ?? schema.items;
|
|
43
|
+
const min = getArrayMin(schema) ?? 0;
|
|
44
|
+
const len = randInt(min, Math.max(min, Math.min(5, getArrayMax(schema) ?? 3)));
|
|
45
|
+
return Array.from({ length: len }, () => _gen(item, ctx, [...path, String(len)]));
|
|
46
|
+
}
|
|
47
|
+
case "tuple": return (schema.items ?? schema.entries ?? []).map((s, i) => _gen(s, ctx, [...path, String(i)]));
|
|
48
|
+
case "union": {
|
|
49
|
+
const options = schema.options ?? schema.variants ?? [];
|
|
50
|
+
for (const opt of shuffle([...options])) {
|
|
51
|
+
const val = _gen(opt, ctx, path);
|
|
52
|
+
if (v.safeParse(opt, val).success) return val;
|
|
53
|
+
}
|
|
54
|
+
return _gen(options[0], ctx, path);
|
|
55
|
+
}
|
|
56
|
+
case "literal": return schema.literal;
|
|
57
|
+
case "enum": return randomItem(schema.options ?? schema.values ?? schema.variants ?? []);
|
|
58
|
+
case "picklist": return randomItem(schema.options ?? schema.values ?? schema.variants ?? []);
|
|
59
|
+
case "record": {
|
|
60
|
+
const keySchema = schema.key ?? schema.keySchema ?? v.string();
|
|
61
|
+
const valueSchema = schema.value ?? schema.valueSchema ?? v.unknown();
|
|
62
|
+
const count = randInt(1, 3);
|
|
63
|
+
const obj = {};
|
|
64
|
+
for (let i = 0; i < count; i++) {
|
|
65
|
+
const k = String(_gen(keySchema, ctx, [...path, "key"]));
|
|
66
|
+
obj[k] = _gen(valueSchema, ctx, [...path, k]);
|
|
67
|
+
}
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
|
70
|
+
case "string":
|
|
71
|
+
const stringPipe = schema?.pipe || [];
|
|
72
|
+
for (const p of stringPipe) {
|
|
73
|
+
if (p?.type === "iso_date") {
|
|
74
|
+
const [min, max] = getDateBounds(schema);
|
|
75
|
+
return new Date(randInt(min.getTime(), max.getTime())).toISOString().split("T")[0];
|
|
76
|
+
}
|
|
77
|
+
if (p?.type === "iso_datetime") {
|
|
78
|
+
const [min, max] = getDateBounds(schema);
|
|
79
|
+
return new Date(randInt(min.getTime(), max.getTime())).toISOString();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return makeString(schema);
|
|
83
|
+
case "number":
|
|
84
|
+
schema.pipe;
|
|
85
|
+
return makeNumber(schema);
|
|
86
|
+
case "boolean": return Math.random() < .5;
|
|
87
|
+
case "bigint": {
|
|
88
|
+
const n = makeNumber(schema);
|
|
89
|
+
return BigInt(Math.trunc(n));
|
|
90
|
+
}
|
|
91
|
+
case "date": {
|
|
92
|
+
const [min, max] = getDateBounds(schema);
|
|
93
|
+
return new Date(randInt(min.getTime(), max.getTime()));
|
|
94
|
+
}
|
|
95
|
+
case "nullable": {
|
|
96
|
+
const inner = schema.wrapped ?? schema.inner ?? schema.item;
|
|
97
|
+
return Math.random() < .2 ? null : _gen(inner, ctx, path);
|
|
98
|
+
}
|
|
99
|
+
case "optional": return _gen(unwrapOptional(schema), ctx, path);
|
|
100
|
+
default: return {};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function unwrapOptional(s) {
|
|
104
|
+
return s.wrapped ?? s.inner ?? s.item ?? s.schema ?? s;
|
|
105
|
+
}
|
|
106
|
+
function getChecks(schema) {
|
|
107
|
+
return Array.isArray(schema?.pipe) ? schema.pipe : [];
|
|
108
|
+
}
|
|
109
|
+
function getArrayMin(schema) {
|
|
110
|
+
const min = getChecks(schema).find((c) => c?.type === "min_length")?.requirement;
|
|
111
|
+
return typeof min === "number" ? min : void 0;
|
|
112
|
+
}
|
|
113
|
+
function getArrayMax(schema) {
|
|
114
|
+
const max = getChecks(schema).find((c) => c?.type === "max_length")?.requirement;
|
|
115
|
+
return typeof max === "number" ? max : void 0;
|
|
116
|
+
}
|
|
117
|
+
function makeString(schema) {
|
|
118
|
+
const checks = getChecks(schema);
|
|
119
|
+
const has = (k) => checks.some((c) => c?.type === k);
|
|
120
|
+
if (has("email")) return `${boundedAscii(5, 10).toLowerCase()}@${boundedAscii(3, 8).toLowerCase()}.com`;
|
|
121
|
+
if (has("url")) return `https://${boundedAscii(3, 8).toLowerCase()}.dev/${boundedAscii(3, 10)}`;
|
|
122
|
+
if (has("uuid")) return cryptoLikeRandomUUID();
|
|
123
|
+
if (checks.some((c) => c?.message?.includes("valid phone number"))) return `+1${fromPool("0123456789", 10)}`;
|
|
124
|
+
const minLen = checks.find((c) => c?.type === "min_length")?.requirement ?? 0;
|
|
125
|
+
const maxLen = checks.find((c) => c?.type === "max_length")?.requirement ?? Math.max(8, minLen + 8);
|
|
126
|
+
const targetLen = clamp(randInt(minLen, Math.max(minLen, Math.min(24, maxLen))), minLen, maxLen);
|
|
127
|
+
const rx = checks.find((c) => c?.type === "regex")?.requirement;
|
|
128
|
+
if (rx) {
|
|
129
|
+
pickPoolForRegex(rx);
|
|
130
|
+
const rxp = new RandExp(rx);
|
|
131
|
+
for (let i = 0; i < 80; i++) {
|
|
132
|
+
const limit = randInt(minLen, Math.min(maxLen, targetLen));
|
|
133
|
+
let candidate = rxp.gen();
|
|
134
|
+
if (candidate.length > limit) candidate = candidate.slice(0, limit);
|
|
135
|
+
if (rx.test(candidate) && candidate.length >= minLen && candidate.length <= maxLen) return candidate;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return boundedAscii(minLen, targetLen);
|
|
139
|
+
}
|
|
140
|
+
function makeNumber(schema) {
|
|
141
|
+
const checks = getChecks(schema);
|
|
142
|
+
let min = checks.find((c) => c?.type === "min_value")?.requirement ?? 0;
|
|
143
|
+
let max = checks.find((c) => c?.type === "max_value")?.requirement ?? 1e3;
|
|
144
|
+
if (min > max) [min, max] = [max, min];
|
|
145
|
+
return checks.some((c) => c?.type === "number" || c?.type === "int") ? randInt(Math.ceil(min), Math.floor(max)) : randFloat(min, max);
|
|
146
|
+
}
|
|
147
|
+
function getDateBounds(schema) {
|
|
148
|
+
const checks = getChecks(schema);
|
|
149
|
+
const min = checks.find((c) => c?.type === "min_value")?.requirement;
|
|
150
|
+
const max = checks.find((c) => c?.type === "max_value")?.requirement;
|
|
151
|
+
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)];
|
|
152
|
+
}
|
|
153
|
+
const ABC = "abcdefghijklmnopqrstuvwxyz";
|
|
154
|
+
const NUM = "0123456789";
|
|
155
|
+
const ALNUM = ABC + ABC.toUpperCase() + NUM;
|
|
156
|
+
const VALUE_SAFE = ALNUM + "._-";
|
|
157
|
+
function pickPoolForRegex(rx) {
|
|
158
|
+
const src = rx.source;
|
|
159
|
+
if (/^\^?[\(\[]?[A-Za-z0-9._-]+\+[\)\]]\??\$?$/.test(src) || REGEX_UTM_VALUE.test(src)) return VALUE_SAFE;
|
|
160
|
+
if (/\[0-9\]|\\d/.test(src)) {
|
|
161
|
+
if (!/[a-zA-Z]/.test(src)) return NUM;
|
|
162
|
+
return ALNUM;
|
|
163
|
+
}
|
|
164
|
+
if (/\[a-z]/.test(src) && /\[A-Z]/.test(src)) return ALNUM;
|
|
165
|
+
if (/\[a-z]/.test(src)) return ABC;
|
|
166
|
+
if (/\[A-Z]/.test(src)) return ABC.toUpperCase();
|
|
167
|
+
return ALNUM;
|
|
168
|
+
}
|
|
169
|
+
function fromPool(pool, len) {
|
|
170
|
+
let s = "";
|
|
171
|
+
for (let i = 0; i < len; i++) s += pool[randInt(0, pool.length - 1)];
|
|
172
|
+
return s;
|
|
173
|
+
}
|
|
174
|
+
function boundedAscii(min, max) {
|
|
175
|
+
const len = randInt(min, Math.max(min, max));
|
|
176
|
+
let s = "";
|
|
177
|
+
for (let i = 0; i < len; i++) s += ALNUM[randInt(0, ALNUM.length - 1)];
|
|
178
|
+
return s;
|
|
179
|
+
}
|
|
180
|
+
function cryptoLikeRandomUUID() {
|
|
181
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return crypto.randomUUID();
|
|
182
|
+
const s = [];
|
|
183
|
+
const hex = "0123456789abcdef";
|
|
184
|
+
for (let i = 0; i < 36; i++) s[i] = hex[randInt(0, 15)];
|
|
185
|
+
s[14] = "4";
|
|
186
|
+
s[19] = hex[parseInt(s[19], 16) & 3 | 8];
|
|
187
|
+
s[8] = s[13] = s[18] = s[23] = "-";
|
|
188
|
+
return s.join("");
|
|
189
|
+
}
|
|
190
|
+
function randInt(min, max) {
|
|
191
|
+
const lo = Math.ceil(min);
|
|
192
|
+
return Math.floor(Math.random() * (Math.floor(max) - lo + 1)) + lo;
|
|
193
|
+
}
|
|
194
|
+
function randFloat(min, max) {
|
|
195
|
+
return Math.random() * (max - min) + min;
|
|
196
|
+
}
|
|
197
|
+
function randomItem(arr) {
|
|
198
|
+
return arr[randInt(0, arr.length - 1)];
|
|
199
|
+
}
|
|
200
|
+
function shuffle(arr) {
|
|
201
|
+
for (let i = arr.length - 1; i > 0; i--) {
|
|
202
|
+
const j = randInt(0, i);
|
|
203
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
204
|
+
}
|
|
205
|
+
return arr;
|
|
206
|
+
}
|
|
207
|
+
function deepMerge(a, b) {
|
|
208
|
+
if (Array.isArray(a) && Array.isArray(b)) return b;
|
|
209
|
+
if (isPlain(a) && isPlain(b)) {
|
|
210
|
+
const out = { ...a };
|
|
211
|
+
for (const [k, v] of Object.entries(b)) {
|
|
212
|
+
if (v === void 0) continue;
|
|
213
|
+
out[k] = k in a ? deepMerge(a[k], v) : v;
|
|
214
|
+
}
|
|
215
|
+
return out;
|
|
216
|
+
}
|
|
217
|
+
return b ?? a;
|
|
218
|
+
}
|
|
219
|
+
function isPlain(x) {
|
|
220
|
+
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
221
|
+
}
|
|
222
|
+
function clamp(n, lo, hi) {
|
|
223
|
+
return Math.max(lo, Math.min(hi, n));
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
226
|
+
export { boundedAscii, generateValid };
|
|
@@ -5,7 +5,7 @@ import { i as ComponentBrandStyleguideColor, n as ComponentBrandStyleguideFont }
|
|
|
5
5
|
import { l as RichTextBlock } from "./index-COpLbpQC.cjs";
|
|
6
6
|
import { n as UtmClassificationKey } from "./index-D11tQdCv.cjs";
|
|
7
7
|
import { t as TagDocument } from "./document-i-h3Orv7.cjs";
|
|
8
|
-
import { c as CommentAuthor, d as CommentThread, f as CommentApprovalStatus, l as CommentDocument } from "./index-
|
|
8
|
+
import { c as CommentAuthor, d as CommentThread, f as CommentApprovalStatus, l as CommentDocument } from "./index-CBW5QmNu.cjs";
|
|
9
9
|
import { t as ProductDocument } from "./document-3h6g5Qqr.cjs";
|
|
10
10
|
import * as v from "valibot";
|
|
11
11
|
|
|
@@ -477,7 +477,7 @@ declare const CLIENT_SORT_KEYS: readonly ["id", "title", "teamwork_id", "teamwor
|
|
|
477
477
|
declare const CLIENT_CLASSIFICATIONS: readonly ["organic", "paid"];
|
|
478
478
|
//#endregion
|
|
479
479
|
//#region src/entities/client/fields.d.ts
|
|
480
|
-
declare const QuerySortClients: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "is_active" | "
|
|
480
|
+
declare const QuerySortClients: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "is_active" | "is_organic_social" | "is_paid_media" | "is_hidden" | "teamwork_id" | "teamwork_name" | "utm_sheet_id" | "is_featured" | "allow_create_utm_link">>;
|
|
481
481
|
type QuerySortClients = v.InferOutput<typeof QuerySortClients>;
|
|
482
482
|
declare const ClientClassification: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["organic", "paid"], undefined>, undefined>, v.MaxLengthAction<("organic" | "paid")[], 2, undefined>]>;
|
|
483
483
|
//#endregion
|
|
@@ -547,7 +547,7 @@ declare const QueryStrapiSearchClients: v.ObjectSchema<{
|
|
|
547
547
|
readonly is_paid_media: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
548
548
|
readonly is_organic_social: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
549
549
|
readonly classification: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["organic", "paid"], undefined>, undefined>, v.MaxLengthAction<("organic" | "paid")[], 2, undefined>]>, undefined>;
|
|
550
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "is_active" | "
|
|
550
|
+
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "is_active" | "is_organic_social" | "is_paid_media" | "is_hidden" | "teamwork_id" | "teamwork_name" | "utm_sheet_id" | "is_featured" | "allow_create_utm_link">>;
|
|
551
551
|
}, undefined>;
|
|
552
552
|
type QueryStrapiSearchClients = v.InferOutput<typeof QueryStrapiSearchClients>;
|
|
553
553
|
//#endregion
|
|
@@ -790,7 +790,7 @@ declare const MondayWorkspaceDocument: v.GenericSchema<{
|
|
|
790
790
|
type MondayWorkspaceDocument = v.InferOutput<typeof MondayWorkspaceDocument>;
|
|
791
791
|
//#endregion
|
|
792
792
|
//#region src/entities/monday-workspace/fields.d.ts
|
|
793
|
-
declare const QuerySortMondayWorkspaces: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "
|
|
793
|
+
declare const QuerySortMondayWorkspaces: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "clients.title" | "clients.teamwork_name" | "workspace_id">>;
|
|
794
794
|
type QuerySortMondayWorkspaces = v.InferOutput<typeof QuerySortMondayWorkspaces>;
|
|
795
795
|
//#endregion
|
|
796
796
|
//#region src/entities/monday-workspace/mutation.d.ts
|
|
@@ -823,7 +823,7 @@ declare const QueryStrapiSearchMondayWorkspaces: v.ObjectSchema<{
|
|
|
823
823
|
readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
824
824
|
readonly workspace_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
825
825
|
readonly clients: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>]>, undefined>;
|
|
826
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "
|
|
826
|
+
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "clients.title" | "clients.teamwork_name" | "workspace_id">>;
|
|
827
827
|
}, undefined>;
|
|
828
828
|
type QueryStrapiSearchMondayWorkspaces = v.InferOutput<typeof QueryStrapiSearchMondayWorkspaces>;
|
|
829
829
|
//#endregion
|
|
@@ -833,7 +833,7 @@ declare const LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE = 100;
|
|
|
833
833
|
declare const UTM_TRACKING_LINK_SORT_KEYS: readonly ["id", "creator", "client", "url_destination", "utm_medium", "utm_source", "utm_campaign", "utm_content", "utm_creative_format", "utm_id", "campaign_phase", "campaign_product", "campaign_targeting", "campaign_key", "creative_format", "creative_format_variants", "url", "is_active", "createdAt", "updatedAt"];
|
|
834
834
|
//#endregion
|
|
835
835
|
//#region src/entities/utm-tracking-link/fields.d.ts
|
|
836
|
-
declare const QuerySortUtmTrackingLinks: v.GenericSchema<QuerySortOutput<"client" | "id" | "createdAt" | "updatedAt" | "url" | "is_active" | "
|
|
836
|
+
declare const QuerySortUtmTrackingLinks: v.GenericSchema<QuerySortOutput<"client" | "id" | "createdAt" | "updatedAt" | "url" | "is_active" | "creator" | "url_destination" | "utm_medium" | "utm_source" | "utm_campaign" | "utm_content" | "utm_creative_format" | "utm_id" | "campaign_phase" | "campaign_product" | "campaign_targeting" | "campaign_key" | "creative_format" | "creative_format_variants">>;
|
|
837
837
|
type QuerySortUtmTrackingLinks = v.InferOutput<typeof QuerySortUtmTrackingLinks>;
|
|
838
838
|
declare const ValidUtmSource: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, string>]>;
|
|
839
839
|
type ValidUtmSource = v.InferOutput<typeof ValidUtmSource>;
|
|
@@ -1041,7 +1041,7 @@ declare const QueryStrapiSearchUtmTrackingLinks: v.ObjectSchema<{
|
|
|
1041
1041
|
readonly url: v.OptionalSchema<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.">]>, undefined>;
|
|
1042
1042
|
readonly is_active: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1043
1043
|
readonly notes: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
|
|
1044
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"client" | "id" | "createdAt" | "updatedAt" | "url" | "is_active" | "
|
|
1044
|
+
readonly sort: v.GenericSchema<QuerySortOutput<"client" | "id" | "createdAt" | "updatedAt" | "url" | "is_active" | "creator" | "url_destination" | "utm_medium" | "utm_source" | "utm_campaign" | "utm_content" | "utm_creative_format" | "utm_id" | "campaign_phase" | "campaign_product" | "campaign_targeting" | "campaign_key" | "creative_format" | "creative_format_variants">>;
|
|
1045
1045
|
}, undefined>;
|
|
1046
1046
|
type QueryStrapiSearchUtmTrackingLinks = v.InferOutput<typeof QueryStrapiSearchUtmTrackingLinks>;
|
|
1047
1047
|
//#endregion
|
|
@@ -1295,7 +1295,7 @@ declare const LIMIT_MEDIA_PLATFORM_PAGINATION_MAX_SIZE = 1000;
|
|
|
1295
1295
|
declare const MEDIA_PLATFORM_SORT_KEYS: readonly ["id", "title", "slug", "utm_key", "is_active", "is_organic_social", "is_paid_media", "createdAt", "updatedAt", "clients.title", "clients.teamwork_id", "clients.teamwork_name", "clients.is_organic_social", "clients.is_paid_media", "clients.createdAt", "clients.updatedAt", "media_content_types.title", "media_content_types.slug", "media_content_types.is_active", "media_content_types.is_organic_social", "media_content_types.is_paid_media", "media_content_types.createdAt", "media_content_types.updatedAt", "media_mediums.title", "media_mediums.slug", "media_mediums.is_active", "media_mediums.is_organic_social", "media_mediums.is_paid_media", "media_mediums.createdAt", "media_mediums.updatedAt"];
|
|
1296
1296
|
//#endregion
|
|
1297
1297
|
//#region src/entities/media-platform/fields.d.ts
|
|
1298
|
-
declare const QuerySortMediaPlatforms: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "slug" | "is_active" | "
|
|
1298
|
+
declare const QuerySortMediaPlatforms: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "slug" | "is_active" | "media_content_types.title" | "media_content_types.slug" | "media_content_types.is_active" | "media_content_types.is_organic_social" | "media_content_types.is_paid_media" | "media_content_types.createdAt" | "media_content_types.updatedAt" | "is_organic_social" | "is_paid_media" | "utm_key" | "clients.title" | "clients.teamwork_id" | "clients.teamwork_name" | "clients.is_organic_social" | "clients.is_paid_media" | "clients.createdAt" | "clients.updatedAt" | "media_mediums.title" | "media_mediums.slug" | "media_mediums.is_active" | "media_mediums.is_organic_social" | "media_mediums.is_paid_media" | "media_mediums.createdAt" | "media_mediums.updatedAt">>;
|
|
1299
1299
|
type QuerySortMediaPlatforms = v.InferOutput<typeof QuerySortMediaPlatforms>;
|
|
1300
1300
|
//#endregion
|
|
1301
1301
|
//#region src/entities/media-platform/mutation.d.ts
|
|
@@ -1355,7 +1355,7 @@ declare const QueryStrapiSearchMediaPlatforms: v.ObjectSchema<{
|
|
|
1355
1355
|
readonly clients: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>]>, undefined>;
|
|
1356
1356
|
readonly media_content_types: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>]>, undefined>;
|
|
1357
1357
|
readonly media_mediums: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>]>, undefined>;
|
|
1358
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "slug" | "is_active" | "
|
|
1358
|
+
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "title" | "slug" | "is_active" | "media_content_types.title" | "media_content_types.slug" | "media_content_types.is_active" | "media_content_types.is_organic_social" | "media_content_types.is_paid_media" | "media_content_types.createdAt" | "media_content_types.updatedAt" | "is_organic_social" | "is_paid_media" | "utm_key" | "clients.title" | "clients.teamwork_id" | "clients.teamwork_name" | "clients.is_organic_social" | "clients.is_paid_media" | "clients.createdAt" | "clients.updatedAt" | "media_mediums.title" | "media_mediums.slug" | "media_mediums.is_active" | "media_mediums.is_organic_social" | "media_mediums.is_paid_media" | "media_mediums.createdAt" | "media_mediums.updatedAt">>;
|
|
1359
1359
|
}, undefined>;
|
|
1360
1360
|
type QueryStrapiSearchMediaPlatforms = v.InferOutput<typeof QueryStrapiSearchMediaPlatforms>;
|
|
1361
1361
|
//#endregion
|
|
@@ -21,7 +21,7 @@ declare const CommentApprovalStatus: v.PicklistSchema<("PENDING" | "APPROVED" |
|
|
|
21
21
|
type CommentApprovalStatus = v.InferOutput<typeof CommentApprovalStatus>;
|
|
22
22
|
declare const ReportCommentReason: v.PicklistSchema<("BAD_LANGUAGE" | "DISCRIMINATION" | "OTHER")[], undefined>;
|
|
23
23
|
type ReportCommentReason = v.InferOutput<typeof ReportCommentReason>;
|
|
24
|
-
declare const QuerySortStrapiComments: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "blocked" | "content" | "
|
|
24
|
+
declare const QuerySortStrapiComments: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "blocked" | "content" | "approvalStatus" | "blockedThread">>;
|
|
25
25
|
type QuerySortStrapiComments = v.InferOutput<typeof QuerySortStrapiComments>;
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/entities/comment/document.d.ts
|
|
@@ -138,7 +138,7 @@ declare const QueryFilterStrapiComments: v.ObjectSchema<{
|
|
|
138
138
|
type QueryFilterStrapiComments = v.InferOutput<typeof QueryFilterStrapiComments>;
|
|
139
139
|
declare const QueryStrapiCommentsInHeirarchy: v.ObjectSchema<{
|
|
140
140
|
readonly relation: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, number, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
141
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "blocked" | "content" | "
|
|
141
|
+
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "blocked" | "content" | "approvalStatus" | "blockedThread">>;
|
|
142
142
|
readonly filters: v.OptionalSchema<v.ObjectSchema<{
|
|
143
143
|
readonly approvalStatus: v.OptionalSchema<v.ObjectSchema<{
|
|
144
144
|
readonly eq: v.PicklistSchema<("PENDING" | "APPROVED" | "REJECTED")[], undefined>;
|
|
@@ -194,7 +194,7 @@ declare const QueryStrapiCommentsFlat: v.ObjectSchema<{
|
|
|
194
194
|
readonly page: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
195
195
|
readonly pageSize: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, undefined>;
|
|
196
196
|
}, undefined>, undefined>;
|
|
197
|
-
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "blocked" | "content" | "
|
|
197
|
+
readonly sort: v.GenericSchema<QuerySortOutput<"id" | "createdAt" | "updatedAt" | "blocked" | "content" | "approvalStatus" | "blockedThread">>;
|
|
198
198
|
}, undefined>;
|
|
199
199
|
type QueryStrapiCommentsFlat = v.InferOutput<typeof QueryStrapiCommentsFlat>;
|
|
200
200
|
//#endregion
|