@wavy/util 0.0.2
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/README.md +3 -0
- package/dist/main.d.ts +824 -0
- package/dist/main.js +134 -0
- package/package.json +22 -0
package/README.md
ADDED
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,824 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const AuthProviders: z.ZodEnum<{
|
|
4
|
+
Google: "Google";
|
|
5
|
+
}>;
|
|
6
|
+
type AuthProviderType = z.infer<typeof AuthProviders>;
|
|
7
|
+
|
|
8
|
+
declare const FileAliases: z.ZodEnum<{
|
|
9
|
+
pdf: "pdf";
|
|
10
|
+
word: "word";
|
|
11
|
+
excel: "excel";
|
|
12
|
+
img: "img";
|
|
13
|
+
txt: "txt";
|
|
14
|
+
unknown: "unknown";
|
|
15
|
+
}>;
|
|
16
|
+
type FileAlias = z.infer<typeof FileAliases>;
|
|
17
|
+
declare const KnownFileAliases: z.ZodEnum<{
|
|
18
|
+
pdf: "pdf";
|
|
19
|
+
word: "word";
|
|
20
|
+
excel: "excel";
|
|
21
|
+
img: "img";
|
|
22
|
+
txt: "txt";
|
|
23
|
+
}>;
|
|
24
|
+
type KnownFileAlias = z.infer<typeof KnownFileAliases>;
|
|
25
|
+
declare const FileDetails: z.ZodObject<{
|
|
26
|
+
lastModified: z.ZodNullable<z.ZodNumber>;
|
|
27
|
+
uid: z.ZodOptional<z.ZodString>;
|
|
28
|
+
uploadDate: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
sizeInBytes: z.ZodNumber;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
path: z.ZodString;
|
|
32
|
+
extension: z.ZodString;
|
|
33
|
+
description: z.ZodOptional<z.ZodString>;
|
|
34
|
+
alias: z.ZodEnum<{
|
|
35
|
+
pdf: "pdf";
|
|
36
|
+
word: "word";
|
|
37
|
+
excel: "excel";
|
|
38
|
+
img: "img";
|
|
39
|
+
txt: "txt";
|
|
40
|
+
unknown: "unknown";
|
|
41
|
+
}>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
type FileDetails = z.infer<typeof FileDetails>;
|
|
44
|
+
declare const FILE_MIME_TYPES: Readonly<Record<"pdf" | "word" | "excel" | "img" | "txt" | "unknown", string[]>>;
|
|
45
|
+
|
|
46
|
+
declare const PhoneNumber: z.ZodString;
|
|
47
|
+
declare const nameKeys: z.ZodEnum<{
|
|
48
|
+
first: "first";
|
|
49
|
+
last: "last";
|
|
50
|
+
}>;
|
|
51
|
+
declare const Name: z.ZodRecord<z.ZodEnum<{
|
|
52
|
+
first: "first";
|
|
53
|
+
last: "last";
|
|
54
|
+
}>, z.ZodString>;
|
|
55
|
+
type Name = z.infer<typeof Name>;
|
|
56
|
+
declare const addressKeys: z.ZodEnum<{
|
|
57
|
+
streetAddress: "streetAddress";
|
|
58
|
+
city: "city";
|
|
59
|
+
parish: "parish";
|
|
60
|
+
country: "country";
|
|
61
|
+
}>;
|
|
62
|
+
declare const Address: z.ZodRecord<z.ZodEnum<{
|
|
63
|
+
streetAddress: "streetAddress";
|
|
64
|
+
city: "city";
|
|
65
|
+
parish: "parish";
|
|
66
|
+
country: "country";
|
|
67
|
+
}>, z.ZodString>;
|
|
68
|
+
type Address = z.infer<typeof Address>;
|
|
69
|
+
declare const PersonIdentity: z.ZodObject<{
|
|
70
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
71
|
+
first: "first";
|
|
72
|
+
last: "last";
|
|
73
|
+
}>, z.ZodString>;
|
|
74
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
75
|
+
email: z.ZodEmail;
|
|
76
|
+
phoneNumber: z.ZodString;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
type PersonIdentity = z.infer<typeof PersonIdentity>;
|
|
79
|
+
declare const UserModel: z.ZodObject<{
|
|
80
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
81
|
+
first: "first";
|
|
82
|
+
last: "last";
|
|
83
|
+
}>, z.ZodString>;
|
|
84
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
85
|
+
email: z.ZodEmail;
|
|
86
|
+
phoneNumber: z.ZodString;
|
|
87
|
+
"~standard": z.ZodStandardSchemaWithJSON<{
|
|
88
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
89
|
+
first: "first";
|
|
90
|
+
last: "last";
|
|
91
|
+
}>, z.ZodString>;
|
|
92
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
93
|
+
email: z.ZodEmail;
|
|
94
|
+
phoneNumber: z.ZodString;
|
|
95
|
+
} & z.ZodObject<{
|
|
96
|
+
uid: z.ZodString;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
shape: {
|
|
99
|
+
uid: z.ZodString;
|
|
100
|
+
};
|
|
101
|
+
keyof: () => z.ZodEnum<{
|
|
102
|
+
uid: "uid";
|
|
103
|
+
}>;
|
|
104
|
+
catchall: <T extends z.core.SomeType>(schema: T) => z.ZodObject<{
|
|
105
|
+
uid: z.ZodString;
|
|
106
|
+
}, z.core.$catchall<T>>;
|
|
107
|
+
passthrough: () => z.ZodObject<{
|
|
108
|
+
uid: z.ZodString;
|
|
109
|
+
}, z.core.$loose>;
|
|
110
|
+
loose: () => z.ZodObject<{
|
|
111
|
+
uid: z.ZodString;
|
|
112
|
+
}, z.core.$loose>;
|
|
113
|
+
strict: () => z.ZodObject<{
|
|
114
|
+
uid: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
strip: () => z.ZodObject<{
|
|
117
|
+
uid: z.ZodString;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
extend: <U extends z.core.$ZodLooseShape>(shape: U) => z.ZodObject<("uid" & keyof U extends never ? {
|
|
120
|
+
uid: z.ZodString;
|
|
121
|
+
} & U : ({
|
|
122
|
+
uid: z.ZodString;
|
|
123
|
+
} extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof U ? never : K]: T_1[K]; } : never) & { [K_1 in keyof U]: U[K_1]; }) extends infer T ? { [k in keyof T]: T[k]; } : never, z.core.$strip>;
|
|
124
|
+
safeExtend: <U extends z.core.$ZodLooseShape>(shape: z.SafeExtendShape<{
|
|
125
|
+
uid: z.ZodString;
|
|
126
|
+
}, U> & Partial<Record<"uid", z.core.SomeType>>) => z.ZodObject<("uid" & keyof U extends never ? {
|
|
127
|
+
uid: z.ZodString;
|
|
128
|
+
} & U : ({
|
|
129
|
+
uid: z.ZodString;
|
|
130
|
+
} extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof U ? never : K]: T_1[K]; } : never) & { [K_1 in keyof U]: U[K_1]; }) extends infer T ? { [k in keyof T]: T[k]; } : never, z.core.$strip>;
|
|
131
|
+
merge: <U extends z.ZodObject>(other: U) => z.ZodObject<("uid" & keyof U["shape"] extends never ? {
|
|
132
|
+
uid: z.ZodString;
|
|
133
|
+
} & U["shape"] : ({
|
|
134
|
+
uid: z.ZodString;
|
|
135
|
+
} extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof U["shape"] ? never : K]: T_1[K]; } : never) & (U["shape"] extends infer T_2 extends z.core.util.SomeObject ? { [K_1 in keyof T_2]: T_2[K_1]; } : never)) extends infer T ? { [k in keyof T]: T[k]; } : never, U["_zod"]["config"]>;
|
|
136
|
+
pick: <M extends z.core.util.Mask<"uid">>(mask: M) => z.ZodObject<Pick<{
|
|
137
|
+
uid: z.ZodString;
|
|
138
|
+
}, Extract<"uid", keyof M>> extends infer T ? { [k in keyof T]: T[k]; } : never, z.core.$strip>;
|
|
139
|
+
omit: <M extends z.core.util.Mask<"uid">>(mask: M) => z.ZodObject<Omit<{
|
|
140
|
+
uid: z.ZodString;
|
|
141
|
+
}, Extract<"uid", keyof M>> extends infer T ? { [k in keyof T]: T[k]; } : never, z.core.$strip>;
|
|
142
|
+
partial: {
|
|
143
|
+
(): z.ZodObject<{
|
|
144
|
+
uid: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
<M extends z.core.util.Mask<"uid">>(mask: M): z.ZodObject<{
|
|
147
|
+
uid: "uid" extends infer T ? T extends "uid" ? T extends keyof M ? z.ZodOptional<{
|
|
148
|
+
uid: z.ZodString;
|
|
149
|
+
}[T]> : {
|
|
150
|
+
uid: z.ZodString;
|
|
151
|
+
}[T] : never : never;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
};
|
|
154
|
+
required: {
|
|
155
|
+
(): z.ZodObject<{
|
|
156
|
+
uid: z.ZodNonOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
<M extends z.core.util.Mask<"uid">>(mask: M): z.ZodObject<{
|
|
159
|
+
uid: "uid" extends infer T ? T extends "uid" ? T extends keyof M ? z.ZodNonOptional<{
|
|
160
|
+
uid: z.ZodString;
|
|
161
|
+
}[T]> : {
|
|
162
|
+
uid: z.ZodString;
|
|
163
|
+
}[T] : never : never;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
};
|
|
166
|
+
def: z.core.$ZodObjectDef<{
|
|
167
|
+
uid: z.ZodString;
|
|
168
|
+
}>;
|
|
169
|
+
type: "object";
|
|
170
|
+
_def: z.core.$ZodObjectDef<{
|
|
171
|
+
uid: z.ZodString;
|
|
172
|
+
}>;
|
|
173
|
+
_output: {
|
|
174
|
+
uid: string;
|
|
175
|
+
};
|
|
176
|
+
_input: {
|
|
177
|
+
uid: string;
|
|
178
|
+
};
|
|
179
|
+
toJSONSchema: (params?: z.core.ToJSONSchemaParams) => z.core.ZodStandardJSONSchemaPayload<{
|
|
180
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
181
|
+
first: "first";
|
|
182
|
+
last: "last";
|
|
183
|
+
}>, z.ZodString>;
|
|
184
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
185
|
+
email: z.ZodEmail;
|
|
186
|
+
phoneNumber: z.ZodString;
|
|
187
|
+
} & z.ZodObject<{
|
|
188
|
+
uid: z.ZodString;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
check: (...checks: (z.core.CheckFn<{
|
|
191
|
+
uid: string;
|
|
192
|
+
}> | z.core.$ZodCheck<{
|
|
193
|
+
uid: string;
|
|
194
|
+
}>)[]) => {
|
|
195
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
196
|
+
first: "first";
|
|
197
|
+
last: "last";
|
|
198
|
+
}>, z.ZodString>;
|
|
199
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
200
|
+
email: z.ZodEmail;
|
|
201
|
+
phoneNumber: z.ZodString;
|
|
202
|
+
} & z.ZodObject<{
|
|
203
|
+
uid: z.ZodString;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
clone: (def?: z.core.$ZodObjectDef<{
|
|
206
|
+
uid: z.ZodString;
|
|
207
|
+
}> | undefined, params?: {
|
|
208
|
+
parent: boolean;
|
|
209
|
+
} | undefined) => {
|
|
210
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
211
|
+
first: "first";
|
|
212
|
+
last: "last";
|
|
213
|
+
}>, z.ZodString>;
|
|
214
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
215
|
+
email: z.ZodEmail;
|
|
216
|
+
phoneNumber: z.ZodString;
|
|
217
|
+
} & z.ZodObject<{
|
|
218
|
+
uid: z.ZodString;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
register: <R extends z.core.$ZodRegistry>(registry: R, ...meta: {
|
|
221
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
222
|
+
first: "first";
|
|
223
|
+
last: "last";
|
|
224
|
+
}>, z.ZodString>;
|
|
225
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
226
|
+
email: z.ZodEmail;
|
|
227
|
+
phoneNumber: z.ZodString;
|
|
228
|
+
} & z.ZodObject<{
|
|
229
|
+
uid: z.ZodString;
|
|
230
|
+
}, z.core.$strip> extends infer T ? T extends {
|
|
231
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
232
|
+
first: "first";
|
|
233
|
+
last: "last";
|
|
234
|
+
}>, z.ZodString>;
|
|
235
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
236
|
+
email: z.ZodEmail;
|
|
237
|
+
phoneNumber: z.ZodString;
|
|
238
|
+
} & z.ZodObject<{
|
|
239
|
+
uid: z.ZodString;
|
|
240
|
+
}, z.core.$strip> ? T extends R["_schema"] ? undefined extends R["_meta"] ? [(z.core.$replace<R["_meta"], R["_schema"] & {
|
|
241
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
242
|
+
first: "first";
|
|
243
|
+
last: "last";
|
|
244
|
+
}>, z.ZodString>;
|
|
245
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
246
|
+
email: z.ZodEmail;
|
|
247
|
+
phoneNumber: z.ZodString;
|
|
248
|
+
} & z.ZodObject<{
|
|
249
|
+
uid: z.ZodString;
|
|
250
|
+
}, z.core.$strip>> | undefined)?] : [z.core.$replace<R["_meta"], R["_schema"] & {
|
|
251
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
252
|
+
first: "first";
|
|
253
|
+
last: "last";
|
|
254
|
+
}>, z.ZodString>;
|
|
255
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
256
|
+
email: z.ZodEmail;
|
|
257
|
+
phoneNumber: z.ZodString;
|
|
258
|
+
} & z.ZodObject<{
|
|
259
|
+
uid: z.ZodString;
|
|
260
|
+
}, z.core.$strip>>] : ["Incompatible schema"] : never : never) => {
|
|
261
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
262
|
+
first: "first";
|
|
263
|
+
last: "last";
|
|
264
|
+
}>, z.ZodString>;
|
|
265
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
266
|
+
email: z.ZodEmail;
|
|
267
|
+
phoneNumber: z.ZodString;
|
|
268
|
+
} & z.ZodObject<{
|
|
269
|
+
uid: z.ZodString;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
brand: <T extends PropertyKey = PropertyKey>(value?: T | undefined) => PropertyKey extends T ? {
|
|
272
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
273
|
+
first: "first";
|
|
274
|
+
last: "last";
|
|
275
|
+
}>, z.ZodString>;
|
|
276
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
277
|
+
email: z.ZodEmail;
|
|
278
|
+
phoneNumber: z.ZodString;
|
|
279
|
+
} & z.ZodObject<{
|
|
280
|
+
uid: z.ZodString;
|
|
281
|
+
}, z.core.$strip> : z.core.$ZodBranded<{
|
|
282
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
283
|
+
first: "first";
|
|
284
|
+
last: "last";
|
|
285
|
+
}>, z.ZodString>;
|
|
286
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
287
|
+
email: z.ZodEmail;
|
|
288
|
+
phoneNumber: z.ZodString;
|
|
289
|
+
} & z.ZodObject<{
|
|
290
|
+
uid: z.ZodString;
|
|
291
|
+
}, z.core.$strip>, T>;
|
|
292
|
+
parse: (data: unknown, params?: z.core.ParseContext<z.core.$ZodIssue>) => {
|
|
293
|
+
uid: string;
|
|
294
|
+
};
|
|
295
|
+
safeParse: (data: unknown, params?: z.core.ParseContext<z.core.$ZodIssue>) => z.ZodSafeParseResult<{
|
|
296
|
+
uid: string;
|
|
297
|
+
}>;
|
|
298
|
+
parseAsync: (data: unknown, params?: z.core.ParseContext<z.core.$ZodIssue>) => Promise<{
|
|
299
|
+
uid: string;
|
|
300
|
+
}>;
|
|
301
|
+
safeParseAsync: (data: unknown, params?: z.core.ParseContext<z.core.$ZodIssue>) => Promise<z.ZodSafeParseResult<{
|
|
302
|
+
uid: string;
|
|
303
|
+
}>>;
|
|
304
|
+
spa: (data: unknown, params?: z.core.ParseContext<z.core.$ZodIssue>) => Promise<z.ZodSafeParseResult<{
|
|
305
|
+
uid: string;
|
|
306
|
+
}>>;
|
|
307
|
+
encode: (data: {
|
|
308
|
+
uid: string;
|
|
309
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => {
|
|
310
|
+
uid: string;
|
|
311
|
+
};
|
|
312
|
+
decode: (data: {
|
|
313
|
+
uid: string;
|
|
314
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => {
|
|
315
|
+
uid: string;
|
|
316
|
+
};
|
|
317
|
+
encodeAsync: (data: {
|
|
318
|
+
uid: string;
|
|
319
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => Promise<{
|
|
320
|
+
uid: string;
|
|
321
|
+
}>;
|
|
322
|
+
decodeAsync: (data: {
|
|
323
|
+
uid: string;
|
|
324
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => Promise<{
|
|
325
|
+
uid: string;
|
|
326
|
+
}>;
|
|
327
|
+
safeEncode: (data: {
|
|
328
|
+
uid: string;
|
|
329
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => z.ZodSafeParseResult<{
|
|
330
|
+
uid: string;
|
|
331
|
+
}>;
|
|
332
|
+
safeDecode: (data: {
|
|
333
|
+
uid: string;
|
|
334
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => z.ZodSafeParseResult<{
|
|
335
|
+
uid: string;
|
|
336
|
+
}>;
|
|
337
|
+
safeEncodeAsync: (data: {
|
|
338
|
+
uid: string;
|
|
339
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => Promise<z.ZodSafeParseResult<{
|
|
340
|
+
uid: string;
|
|
341
|
+
}>>;
|
|
342
|
+
safeDecodeAsync: (data: {
|
|
343
|
+
uid: string;
|
|
344
|
+
}, params?: z.core.ParseContext<z.core.$ZodIssue>) => Promise<z.ZodSafeParseResult<{
|
|
345
|
+
uid: string;
|
|
346
|
+
}>>;
|
|
347
|
+
refine: (check: (arg: {
|
|
348
|
+
uid: string;
|
|
349
|
+
}) => unknown | Promise<unknown>, params?: string | {
|
|
350
|
+
path?: PropertyKey[] | undefined | undefined;
|
|
351
|
+
abort?: boolean | undefined | undefined;
|
|
352
|
+
when?: ((payload: z.core.ParsePayload) => boolean) | undefined | undefined;
|
|
353
|
+
params?: Record<string, any> | undefined;
|
|
354
|
+
error?: string | z.core.$ZodErrorMap<NonNullable<z.core.$ZodIssue>> | undefined;
|
|
355
|
+
message?: string | undefined | undefined;
|
|
356
|
+
} | undefined) => {
|
|
357
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
358
|
+
first: "first";
|
|
359
|
+
last: "last";
|
|
360
|
+
}>, z.ZodString>;
|
|
361
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
362
|
+
email: z.ZodEmail;
|
|
363
|
+
phoneNumber: z.ZodString;
|
|
364
|
+
} & z.ZodObject<{
|
|
365
|
+
uid: z.ZodString;
|
|
366
|
+
}, z.core.$strip>;
|
|
367
|
+
superRefine: (refinement: (arg: {
|
|
368
|
+
uid: string;
|
|
369
|
+
}, ctx: z.core.$RefinementCtx<{
|
|
370
|
+
uid: string;
|
|
371
|
+
}>) => void | Promise<void>) => {
|
|
372
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
373
|
+
first: "first";
|
|
374
|
+
last: "last";
|
|
375
|
+
}>, z.ZodString>;
|
|
376
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
377
|
+
email: z.ZodEmail;
|
|
378
|
+
phoneNumber: z.ZodString;
|
|
379
|
+
} & z.ZodObject<{
|
|
380
|
+
uid: z.ZodString;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
overwrite: (fn: (x: {
|
|
383
|
+
uid: string;
|
|
384
|
+
}) => {
|
|
385
|
+
uid: string;
|
|
386
|
+
}) => {
|
|
387
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
388
|
+
first: "first";
|
|
389
|
+
last: "last";
|
|
390
|
+
}>, z.ZodString>;
|
|
391
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
392
|
+
email: z.ZodEmail;
|
|
393
|
+
phoneNumber: z.ZodString;
|
|
394
|
+
} & z.ZodObject<{
|
|
395
|
+
uid: z.ZodString;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
optional: () => z.ZodOptional<{
|
|
398
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
399
|
+
first: "first";
|
|
400
|
+
last: "last";
|
|
401
|
+
}>, z.ZodString>;
|
|
402
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
403
|
+
email: z.ZodEmail;
|
|
404
|
+
phoneNumber: z.ZodString;
|
|
405
|
+
} & z.ZodObject<{
|
|
406
|
+
uid: z.ZodString;
|
|
407
|
+
}, z.core.$strip>>;
|
|
408
|
+
nonoptional: (params?: string | z.core.$ZodNonOptionalParams) => z.ZodNonOptional<{
|
|
409
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
410
|
+
first: "first";
|
|
411
|
+
last: "last";
|
|
412
|
+
}>, z.ZodString>;
|
|
413
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
414
|
+
email: z.ZodEmail;
|
|
415
|
+
phoneNumber: z.ZodString;
|
|
416
|
+
} & z.ZodObject<{
|
|
417
|
+
uid: z.ZodString;
|
|
418
|
+
}, z.core.$strip>>;
|
|
419
|
+
nullable: () => z.ZodNullable<{
|
|
420
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
421
|
+
first: "first";
|
|
422
|
+
last: "last";
|
|
423
|
+
}>, z.ZodString>;
|
|
424
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
425
|
+
email: z.ZodEmail;
|
|
426
|
+
phoneNumber: z.ZodString;
|
|
427
|
+
} & z.ZodObject<{
|
|
428
|
+
uid: z.ZodString;
|
|
429
|
+
}, z.core.$strip>>;
|
|
430
|
+
nullish: () => z.ZodOptional<z.ZodNullable<{
|
|
431
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
432
|
+
first: "first";
|
|
433
|
+
last: "last";
|
|
434
|
+
}>, z.ZodString>;
|
|
435
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
436
|
+
email: z.ZodEmail;
|
|
437
|
+
phoneNumber: z.ZodString;
|
|
438
|
+
} & z.ZodObject<{
|
|
439
|
+
uid: z.ZodString;
|
|
440
|
+
}, z.core.$strip>>>;
|
|
441
|
+
default: {
|
|
442
|
+
(def: {
|
|
443
|
+
uid: string;
|
|
444
|
+
}): z.ZodDefault<{
|
|
445
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
446
|
+
first: "first";
|
|
447
|
+
last: "last";
|
|
448
|
+
}>, z.ZodString>;
|
|
449
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
450
|
+
email: z.ZodEmail;
|
|
451
|
+
phoneNumber: z.ZodString;
|
|
452
|
+
} & z.ZodObject<{
|
|
453
|
+
uid: z.ZodString;
|
|
454
|
+
}, z.core.$strip>>;
|
|
455
|
+
(def: () => {
|
|
456
|
+
uid: string;
|
|
457
|
+
}): z.ZodDefault<{
|
|
458
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
459
|
+
first: "first";
|
|
460
|
+
last: "last";
|
|
461
|
+
}>, z.ZodString>;
|
|
462
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
463
|
+
email: z.ZodEmail;
|
|
464
|
+
phoneNumber: z.ZodString;
|
|
465
|
+
} & z.ZodObject<{
|
|
466
|
+
uid: z.ZodString;
|
|
467
|
+
}, z.core.$strip>>;
|
|
468
|
+
};
|
|
469
|
+
prefault: {
|
|
470
|
+
(def: () => {
|
|
471
|
+
uid: string;
|
|
472
|
+
}): z.ZodPrefault<{
|
|
473
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
474
|
+
first: "first";
|
|
475
|
+
last: "last";
|
|
476
|
+
}>, z.ZodString>;
|
|
477
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
478
|
+
email: z.ZodEmail;
|
|
479
|
+
phoneNumber: z.ZodString;
|
|
480
|
+
} & z.ZodObject<{
|
|
481
|
+
uid: z.ZodString;
|
|
482
|
+
}, z.core.$strip>>;
|
|
483
|
+
(def: {
|
|
484
|
+
uid: string;
|
|
485
|
+
}): z.ZodPrefault<{
|
|
486
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
487
|
+
first: "first";
|
|
488
|
+
last: "last";
|
|
489
|
+
}>, z.ZodString>;
|
|
490
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
491
|
+
email: z.ZodEmail;
|
|
492
|
+
phoneNumber: z.ZodString;
|
|
493
|
+
} & z.ZodObject<{
|
|
494
|
+
uid: z.ZodString;
|
|
495
|
+
}, z.core.$strip>>;
|
|
496
|
+
};
|
|
497
|
+
array: () => z.ZodArray<{
|
|
498
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
499
|
+
first: "first";
|
|
500
|
+
last: "last";
|
|
501
|
+
}>, z.ZodString>;
|
|
502
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
503
|
+
email: z.ZodEmail;
|
|
504
|
+
phoneNumber: z.ZodString;
|
|
505
|
+
} & z.ZodObject<{
|
|
506
|
+
uid: z.ZodString;
|
|
507
|
+
}, z.core.$strip>>;
|
|
508
|
+
or: <T extends z.core.SomeType>(option: T) => z.ZodUnion<[{
|
|
509
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
510
|
+
first: "first";
|
|
511
|
+
last: "last";
|
|
512
|
+
}>, z.ZodString>;
|
|
513
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
514
|
+
email: z.ZodEmail;
|
|
515
|
+
phoneNumber: z.ZodString;
|
|
516
|
+
} & z.ZodObject<{
|
|
517
|
+
uid: z.ZodString;
|
|
518
|
+
}, z.core.$strip>, T]>;
|
|
519
|
+
and: <T extends z.core.SomeType>(incoming: T) => z.ZodIntersection<{
|
|
520
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
521
|
+
first: "first";
|
|
522
|
+
last: "last";
|
|
523
|
+
}>, z.ZodString>;
|
|
524
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
525
|
+
email: z.ZodEmail;
|
|
526
|
+
phoneNumber: z.ZodString;
|
|
527
|
+
} & z.ZodObject<{
|
|
528
|
+
uid: z.ZodString;
|
|
529
|
+
}, z.core.$strip>, T>;
|
|
530
|
+
transform: <NewOut>(transform: (arg: {
|
|
531
|
+
uid: string;
|
|
532
|
+
}, ctx: z.core.$RefinementCtx<{
|
|
533
|
+
uid: string;
|
|
534
|
+
}>) => NewOut | Promise<NewOut>) => z.ZodPipe<{
|
|
535
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
536
|
+
first: "first";
|
|
537
|
+
last: "last";
|
|
538
|
+
}>, z.ZodString>;
|
|
539
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
540
|
+
email: z.ZodEmail;
|
|
541
|
+
phoneNumber: z.ZodString;
|
|
542
|
+
} & z.ZodObject<{
|
|
543
|
+
uid: z.ZodString;
|
|
544
|
+
}, z.core.$strip>, z.ZodTransform<Awaited<NewOut>, {
|
|
545
|
+
uid: string;
|
|
546
|
+
}>>;
|
|
547
|
+
catch: {
|
|
548
|
+
(def: {
|
|
549
|
+
uid: string;
|
|
550
|
+
}): z.ZodCatch<{
|
|
551
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
552
|
+
first: "first";
|
|
553
|
+
last: "last";
|
|
554
|
+
}>, z.ZodString>;
|
|
555
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
556
|
+
email: z.ZodEmail;
|
|
557
|
+
phoneNumber: z.ZodString;
|
|
558
|
+
} & z.ZodObject<{
|
|
559
|
+
uid: z.ZodString;
|
|
560
|
+
}, z.core.$strip>>;
|
|
561
|
+
(def: (ctx: z.core.$ZodCatchCtx) => {
|
|
562
|
+
uid: string;
|
|
563
|
+
}): z.ZodCatch<{
|
|
564
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
565
|
+
first: "first";
|
|
566
|
+
last: "last";
|
|
567
|
+
}>, z.ZodString>;
|
|
568
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
569
|
+
email: z.ZodEmail;
|
|
570
|
+
phoneNumber: z.ZodString;
|
|
571
|
+
} & z.ZodObject<{
|
|
572
|
+
uid: z.ZodString;
|
|
573
|
+
}, z.core.$strip>>;
|
|
574
|
+
};
|
|
575
|
+
pipe: <T extends z.core.$ZodType<any, {
|
|
576
|
+
uid: string;
|
|
577
|
+
}, z.core.$ZodTypeInternals<any, {
|
|
578
|
+
uid: string;
|
|
579
|
+
}>>>(target: T | z.core.$ZodType<any, {
|
|
580
|
+
uid: string;
|
|
581
|
+
}, z.core.$ZodTypeInternals<any, {
|
|
582
|
+
uid: string;
|
|
583
|
+
}>>) => z.ZodPipe<{
|
|
584
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
585
|
+
first: "first";
|
|
586
|
+
last: "last";
|
|
587
|
+
}>, z.ZodString>;
|
|
588
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
589
|
+
email: z.ZodEmail;
|
|
590
|
+
phoneNumber: z.ZodString;
|
|
591
|
+
} & z.ZodObject<{
|
|
592
|
+
uid: z.ZodString;
|
|
593
|
+
}, z.core.$strip>, T>;
|
|
594
|
+
readonly: () => z.ZodReadonly<{
|
|
595
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
596
|
+
first: "first";
|
|
597
|
+
last: "last";
|
|
598
|
+
}>, z.ZodString>;
|
|
599
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
600
|
+
email: z.ZodEmail;
|
|
601
|
+
phoneNumber: z.ZodString;
|
|
602
|
+
} & z.ZodObject<{
|
|
603
|
+
uid: z.ZodString;
|
|
604
|
+
}, z.core.$strip>>;
|
|
605
|
+
describe: (description: string) => {
|
|
606
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
607
|
+
first: "first";
|
|
608
|
+
last: "last";
|
|
609
|
+
}>, z.ZodString>;
|
|
610
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
611
|
+
email: z.ZodEmail;
|
|
612
|
+
phoneNumber: z.ZodString;
|
|
613
|
+
} & z.ZodObject<{
|
|
614
|
+
uid: z.ZodString;
|
|
615
|
+
}, z.core.$strip>;
|
|
616
|
+
description?: string | undefined;
|
|
617
|
+
meta: {
|
|
618
|
+
(): {
|
|
619
|
+
[x: string]: unknown;
|
|
620
|
+
id?: string | undefined | undefined;
|
|
621
|
+
title?: string | undefined | undefined;
|
|
622
|
+
description?: string | undefined | undefined;
|
|
623
|
+
deprecated?: boolean | undefined | undefined;
|
|
624
|
+
} | undefined;
|
|
625
|
+
(data: {
|
|
626
|
+
[x: string]: unknown;
|
|
627
|
+
id?: string | undefined | undefined;
|
|
628
|
+
title?: string | undefined | undefined;
|
|
629
|
+
description?: string | undefined | undefined;
|
|
630
|
+
deprecated?: boolean | undefined | undefined;
|
|
631
|
+
}): {
|
|
632
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
633
|
+
first: "first";
|
|
634
|
+
last: "last";
|
|
635
|
+
}>, z.ZodString>;
|
|
636
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
637
|
+
email: z.ZodEmail;
|
|
638
|
+
phoneNumber: z.ZodString;
|
|
639
|
+
} & z.ZodObject<{
|
|
640
|
+
uid: z.ZodString;
|
|
641
|
+
}, z.core.$strip>;
|
|
642
|
+
};
|
|
643
|
+
isOptional: () => boolean;
|
|
644
|
+
isNullable: () => boolean;
|
|
645
|
+
_zod: z.core.$ZodObjectInternals<{
|
|
646
|
+
uid: z.ZodString;
|
|
647
|
+
}, z.core.$strip>;
|
|
648
|
+
}, z.core.$strip>;
|
|
649
|
+
type UserModel = z.infer<typeof UserModel>;
|
|
650
|
+
|
|
651
|
+
declare const Email: z.ZodObject<{
|
|
652
|
+
body: z.ZodObject<{
|
|
653
|
+
text: z.ZodString;
|
|
654
|
+
html: z.ZodOptional<z.ZodString>;
|
|
655
|
+
}, z.core.$strip>;
|
|
656
|
+
recipients: z.ZodArray<z.ZodString>;
|
|
657
|
+
subject: z.ZodString;
|
|
658
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
659
|
+
lastModified: z.ZodNullable<z.ZodNumber>;
|
|
660
|
+
uid: z.ZodOptional<z.ZodString>;
|
|
661
|
+
uploadDate: z.ZodOptional<z.ZodNumber>;
|
|
662
|
+
sizeInBytes: z.ZodNumber;
|
|
663
|
+
name: z.ZodString;
|
|
664
|
+
path: z.ZodString;
|
|
665
|
+
extension: z.ZodString;
|
|
666
|
+
description: z.ZodOptional<z.ZodString>;
|
|
667
|
+
alias: z.ZodEnum<{
|
|
668
|
+
pdf: "pdf";
|
|
669
|
+
word: "word";
|
|
670
|
+
excel: "excel";
|
|
671
|
+
img: "img";
|
|
672
|
+
txt: "txt";
|
|
673
|
+
unknown: "unknown";
|
|
674
|
+
}>;
|
|
675
|
+
}, z.core.$strip>>;
|
|
676
|
+
}, z.core.$strip>;
|
|
677
|
+
type Email = z.infer<typeof Email>;
|
|
678
|
+
|
|
679
|
+
declare const TaskLog: z.ZodObject<{
|
|
680
|
+
timestamp: z.ZodNumber;
|
|
681
|
+
status: z.ZodEnum<{
|
|
682
|
+
error: "error";
|
|
683
|
+
success: "success";
|
|
684
|
+
info: "info";
|
|
685
|
+
}>;
|
|
686
|
+
response: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodEnum<{
|
|
687
|
+
message: "message";
|
|
688
|
+
tag: "tag";
|
|
689
|
+
}>, z.ZodString>]>;
|
|
690
|
+
}, z.core.$strip>;
|
|
691
|
+
type TaskLog = z.infer<typeof TaskLog>;
|
|
692
|
+
declare const ErrorCode: z.ZodEnum<{
|
|
693
|
+
BAD_REQUEST: "BAD_REQUEST";
|
|
694
|
+
NOT_FOUND: "NOT_FOUND";
|
|
695
|
+
OUT_OF_BOUNDS: "OUT_OF_BOUNDS";
|
|
696
|
+
INVALID: "INVALID";
|
|
697
|
+
INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
698
|
+
MISSING_PERMISSIONS: "MISSING_PERMISSIONS";
|
|
699
|
+
PROHIBITED_ACTION: "PROHIBITED_ACTION";
|
|
700
|
+
INCOMPLETE_FORM: "INCOMPLETE_FORM";
|
|
701
|
+
SERVER_ERROR: "SERVER_ERROR";
|
|
702
|
+
REQUEST_TIMEDOUT: "REQUEST_TIMEDOUT";
|
|
703
|
+
UNKNOWN: "UNKNOWN";
|
|
704
|
+
UNVERIFIED: "UNVERIFIED";
|
|
705
|
+
INVALID_TOKEN: "INVALID_TOKEN";
|
|
706
|
+
CANCELLED: "CANCELLED";
|
|
707
|
+
}>;
|
|
708
|
+
type ErrorCode = z.infer<typeof ErrorCode>;
|
|
709
|
+
declare const ErrorMessage: z.ZodObject<{
|
|
710
|
+
code: z.ZodEnum<{
|
|
711
|
+
BAD_REQUEST: "BAD_REQUEST";
|
|
712
|
+
NOT_FOUND: "NOT_FOUND";
|
|
713
|
+
OUT_OF_BOUNDS: "OUT_OF_BOUNDS";
|
|
714
|
+
INVALID: "INVALID";
|
|
715
|
+
INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
716
|
+
MISSING_PERMISSIONS: "MISSING_PERMISSIONS";
|
|
717
|
+
PROHIBITED_ACTION: "PROHIBITED_ACTION";
|
|
718
|
+
INCOMPLETE_FORM: "INCOMPLETE_FORM";
|
|
719
|
+
SERVER_ERROR: "SERVER_ERROR";
|
|
720
|
+
REQUEST_TIMEDOUT: "REQUEST_TIMEDOUT";
|
|
721
|
+
UNKNOWN: "UNKNOWN";
|
|
722
|
+
UNVERIFIED: "UNVERIFIED";
|
|
723
|
+
INVALID_TOKEN: "INVALID_TOKEN";
|
|
724
|
+
CANCELLED: "CANCELLED";
|
|
725
|
+
}>;
|
|
726
|
+
title: z.ZodOptional<z.ZodString>;
|
|
727
|
+
message: z.ZodString;
|
|
728
|
+
cause: z.ZodOptional<z.ZodString>;
|
|
729
|
+
}, z.core.$strip>;
|
|
730
|
+
type ErrorMessage = z.infer<typeof ErrorMessage>;
|
|
731
|
+
declare const SuccessMessage: z.ZodObject<{
|
|
732
|
+
title: z.ZodString;
|
|
733
|
+
message: z.ZodString;
|
|
734
|
+
}, z.core.$strip>;
|
|
735
|
+
type SuccessMessage = z.infer<typeof SuccessMessage>;
|
|
736
|
+
type TaskResult<ResponseType extends object | "success" = "success"> = {
|
|
737
|
+
error: ErrorMessage;
|
|
738
|
+
response?: never | undefined | null;
|
|
739
|
+
} | {
|
|
740
|
+
error?: never | undefined | null;
|
|
741
|
+
response: ResponseType;
|
|
742
|
+
};
|
|
743
|
+
declare const TaskStatus: z.ZodEnum<{
|
|
744
|
+
error: "error";
|
|
745
|
+
success: "success";
|
|
746
|
+
pending: "pending";
|
|
747
|
+
}>;
|
|
748
|
+
type TaskStatus = z.infer<typeof TaskStatus>;
|
|
749
|
+
|
|
750
|
+
declare const TransactionCurrency: z.ZodEnum<{
|
|
751
|
+
JMD: "JMD";
|
|
752
|
+
}>;
|
|
753
|
+
type TransactionCurrency = z.infer<typeof TransactionCurrency>;
|
|
754
|
+
|
|
755
|
+
type UnsubscribeFunction = () => void;
|
|
756
|
+
type KeysWithType<O extends object, T> = {
|
|
757
|
+
[Key in keyof O]: O[Key] extends T ? Key : never;
|
|
758
|
+
}[keyof O];
|
|
759
|
+
type KeysWithoutType<O extends object, T> = {
|
|
760
|
+
[Key in keyof O]: O[Key] extends T ? never : Key;
|
|
761
|
+
}[keyof O];
|
|
762
|
+
type NonFunction<T> = T extends (...args: any) => any ? never : T;
|
|
763
|
+
type NoUndefinedField<T> = {
|
|
764
|
+
[P in keyof T]: Exclude<T[P], null | undefined>;
|
|
765
|
+
};
|
|
766
|
+
type OmitType<O extends object, T> = {
|
|
767
|
+
[Key in KeysWithoutType<O, T>]: Key extends keyof O ? O[Key] : never;
|
|
768
|
+
};
|
|
769
|
+
type SafeOmit<O extends object, K extends keyof O> = Omit<O, K>;
|
|
770
|
+
type SafeExclude<StringUnion extends string, ExcludedStringUnion extends StringUnion> = Exclude<StringUnion, ExcludedStringUnion>;
|
|
771
|
+
type SafeExtract<StringUnion extends string, ExtractedStringUnion extends StringUnion> = Extract<StringUnion, ExtractedStringUnion>;
|
|
772
|
+
type ReplaceReturnType<T extends (...a: any) => any, TNewReturn> = (...a: Parameters<T>) => TNewReturn;
|
|
773
|
+
type FlattenDictionary<Dictionary extends object, Key extends keyof Dictionary> = UnionToIntersection<Dictionary[Key]>;
|
|
774
|
+
type UnionToIntersection<U> = Prettify<(U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never>;
|
|
775
|
+
type SmartFn<Payload extends object | null, Return> = (...args: Payload extends null ? [] : [payload: Payload]) => Return;
|
|
776
|
+
type FlatDictionary<Dictionary extends object> = FlattenDictionary<Dictionary, keyof Dictionary>;
|
|
777
|
+
type ReplaceProperty<O extends object, KeyToReplace extends keyof O, ReplaceType> = {
|
|
778
|
+
[Prop in keyof O]: Prop extends KeyToReplace ? ReplaceType : O[Prop];
|
|
779
|
+
};
|
|
780
|
+
type Split<S extends string, D extends string> = string extends S ? string[] : S extends "" ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
|
|
781
|
+
type PropertyToString<O extends object, Key extends keyof O> = ReplaceProperty<O, Key, string>;
|
|
782
|
+
type StringArrayId<Name extends string> = `listOf${Capitalize<Name>}`;
|
|
783
|
+
type RevertStringArrayId<Id extends string> = Uncapitalize<RemovePrefix<Id, StringArrayId<"">>>;
|
|
784
|
+
type MDSADelim = ":";
|
|
785
|
+
type MultiDimStringArrayId<Name extends string, Dim extends 2 = 2, MapName extends string | null = null> = `${Dim}DListOf${Capitalize<Name>}${MapName extends string ? `${MDSADelim}${MapName}` : ""}`;
|
|
786
|
+
type SplitMDSA<Name extends string> = Split<Name, MDSADelim>;
|
|
787
|
+
type RevertMultiDimStringArrayId<Name extends string> = SplitMDSA<Uncapitalize<RemovePrefix<Name, MultiDimStringArrayId<"", 2>>>>[0];
|
|
788
|
+
type Partialize<O extends object, K extends keyof O> = Prettify<{
|
|
789
|
+
[Key in Exclude<keyof O, K>]: O[Key];
|
|
790
|
+
} & {
|
|
791
|
+
[Key in K]?: O[Key];
|
|
792
|
+
}>;
|
|
793
|
+
type Prettify<T> = {
|
|
794
|
+
[K in keyof T]: T[K];
|
|
795
|
+
} & {};
|
|
796
|
+
type RemovePrefix<Value extends string, Prefix extends string> = Value extends `${Prefix}${infer Suffix}` ? Suffix : Value;
|
|
797
|
+
type RemoveSuffix<Value extends string, Suffix extends string> = Value extends `${infer Prefix}${Suffix}` ? Prefix : Value;
|
|
798
|
+
type WithStringArray<O extends {
|
|
799
|
+
[key: string]: any;
|
|
800
|
+
}, StringArrayKeyMapper extends string | Record<string, string>> = StringArrayKeyMapper extends string ? {
|
|
801
|
+
[Key in keyof O | StringArrayId<StringArrayKeyMapper>]: Key extends StringArrayId<StringArrayKeyMapper> ? Array<string> : O[Key];
|
|
802
|
+
} : StringArrayKeyMapper extends Record<string, string> ? {
|
|
803
|
+
[Key in StringArrayId<keyof StringArrayKeyMapper extends string ? keyof StringArrayKeyMapper : never> | keyof O]: Key extends StringArrayId<keyof StringArrayKeyMapper extends string ? keyof StringArrayKeyMapper : never> ? StringArrayKeyMapper[RevertStringArrayId<Key>][] : O[Key];
|
|
804
|
+
} : never;
|
|
805
|
+
type WithMultiDimArray<O extends {
|
|
806
|
+
[key: string]: any;
|
|
807
|
+
}, MDArrayMapper extends string | Record<string, string>> = MDArrayMapper extends string ? {
|
|
808
|
+
[Key in keyof O | MultiDimStringArrayId<MDArrayMapper, 2>]: Key extends keyof O ? O[Key] : Key extends MultiDimStringArrayId<MDArrayMapper, 2> ? string[][] : never;
|
|
809
|
+
} : MDArrayMapper extends {
|
|
810
|
+
[key: string]: string;
|
|
811
|
+
} ? {
|
|
812
|
+
[Key in keyof O | MultiDimStringArrayId<keyof MDArrayMapper extends string ? keyof MDArrayMapper : never, 2, MDArrayMapper[keyof MDArrayMapper]>]: Key extends keyof O ? O[Key] : Key extends MultiDimStringArrayId<keyof MDArrayMapper extends string ? keyof MDArrayMapper : never, 2, MDArrayMapper[keyof MDArrayMapper]> ? Record<Key extends string ? SplitMDSA<Key> extends [string, string] ? SplitMDSA<Key>[1] : never : never, string>[][] : never;
|
|
813
|
+
} : never;
|
|
814
|
+
type CastFn<T> = T | (() => T);
|
|
815
|
+
type CastArray<T> = T | T[];
|
|
816
|
+
type TypeOrGetType<T> = T | (() => T);
|
|
817
|
+
type WithExpiryDate<Type> = Prettify<Type & {
|
|
818
|
+
expiryDate: number;
|
|
819
|
+
}>;
|
|
820
|
+
type AddPrefix<T, P extends string> = {
|
|
821
|
+
[Key in keyof T extends string ? `${P}${Capitalize<keyof T>}` : keyof T]: Key extends keyof T ? T[Key] : Key extends `${P}${infer Prop}` ? Uncapitalize<Prop> extends keyof T ? T[Uncapitalize<Prop>] : never : never;
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
export { type AddPrefix, Address, type AuthProviderType, AuthProviders, type CastArray, type CastFn, Email, ErrorCode, ErrorMessage, FILE_MIME_TYPES, type FileAlias, FileAliases, FileDetails, type FlatDictionary, type FlattenDictionary, type KeysWithType, type KeysWithoutType, type KnownFileAlias, KnownFileAliases, type MDSADelim, type MultiDimStringArrayId, Name, type NoUndefinedField, type NonFunction, type OmitType, type Partialize, PersonIdentity, PhoneNumber, type Prettify, type PropertyToString, type RemovePrefix, type RemoveSuffix, type ReplaceProperty, type ReplaceReturnType, type RevertMultiDimStringArrayId, type RevertStringArrayId, type SafeExclude, type SafeExtract, type SafeOmit, type SmartFn, type Split, type SplitMDSA, type StringArrayId, SuccessMessage, TaskLog, type TaskResult, TaskStatus, TransactionCurrency, type TypeOrGetType, type UnionToIntersection, type UnsubscribeFunction, UserModel, type WithExpiryDate, type WithMultiDimArray, type WithStringArray, addressKeys, nameKeys };
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// src/schemas/Auth.ts
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
var AuthProviders = z.enum(["Google"]);
|
|
4
|
+
|
|
5
|
+
// src/schemas/File.ts
|
|
6
|
+
import * as z2 from "zod";
|
|
7
|
+
var FileAliases = z2.enum([
|
|
8
|
+
"pdf",
|
|
9
|
+
"word",
|
|
10
|
+
"excel",
|
|
11
|
+
"img",
|
|
12
|
+
"txt",
|
|
13
|
+
"unknown"
|
|
14
|
+
]);
|
|
15
|
+
var KnownFileAliases = FileAliases.exclude(["unknown"]);
|
|
16
|
+
var FileDetails = z2.object({
|
|
17
|
+
lastModified: z2.number().nullable(),
|
|
18
|
+
uid: z2.string().trim().optional(),
|
|
19
|
+
uploadDate: z2.number().optional(),
|
|
20
|
+
sizeInBytes: z2.number(),
|
|
21
|
+
name: z2.string().trim(),
|
|
22
|
+
path: z2.string().trim(),
|
|
23
|
+
extension: z2.string().trim().startsWith(".").lowercase(),
|
|
24
|
+
description: z2.string().trim().optional(),
|
|
25
|
+
alias: FileAliases
|
|
26
|
+
});
|
|
27
|
+
var FILE_MIME_TYPES = Object.freeze({
|
|
28
|
+
txt: ["text/plain"],
|
|
29
|
+
img: ["image/jpeg", "image/png", "image/jpg"],
|
|
30
|
+
excel: [
|
|
31
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
32
|
+
"application/vnd.ms-excel",
|
|
33
|
+
"application/vnd.ms-excel.sheet.macroEnabled.12"
|
|
34
|
+
],
|
|
35
|
+
word: [
|
|
36
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
37
|
+
"application/msword",
|
|
38
|
+
"application/vnd.microsoft.portable-executable"
|
|
39
|
+
],
|
|
40
|
+
pdf: ["application/pdf"],
|
|
41
|
+
unknown: []
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// src/schemas/Identity.ts
|
|
45
|
+
import * as z3 from "zod";
|
|
46
|
+
var PhoneNumber = z3.string().regex(/^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/);
|
|
47
|
+
var nameKeys = z3.enum(["first", "last"]);
|
|
48
|
+
var Name = z3.record(nameKeys, z3.string().trim());
|
|
49
|
+
var addressKeys = z3.enum([
|
|
50
|
+
"streetAddress",
|
|
51
|
+
"city",
|
|
52
|
+
"parish",
|
|
53
|
+
"country"
|
|
54
|
+
]);
|
|
55
|
+
var Address = z3.record(addressKeys, z3.string().trim());
|
|
56
|
+
var PersonIdentity = z3.object({
|
|
57
|
+
name: Name,
|
|
58
|
+
photoUrl: z3.string().optional(),
|
|
59
|
+
email: z3.email(),
|
|
60
|
+
phoneNumber: PhoneNumber
|
|
61
|
+
});
|
|
62
|
+
var UserModel = PersonIdentity.extend(z3.object({ uid: z3.string() }));
|
|
63
|
+
|
|
64
|
+
// src/schemas/Payload.ts
|
|
65
|
+
import * as z4 from "zod";
|
|
66
|
+
var Email = z4.object({
|
|
67
|
+
body: z4.object({
|
|
68
|
+
text: z4.string().trim(),
|
|
69
|
+
html: z4.string().optional()
|
|
70
|
+
}),
|
|
71
|
+
recipients: z4.array(z4.string().trim()),
|
|
72
|
+
subject: z4.string().trim(),
|
|
73
|
+
attachments: z4.array(FileDetails)
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// src/schemas/Task.ts
|
|
77
|
+
import * as z5 from "zod";
|
|
78
|
+
var TaskLog = z5.object({
|
|
79
|
+
timestamp: z5.number(),
|
|
80
|
+
status: z5.enum(["success", "error", "info"]),
|
|
81
|
+
response: z5.string().trim().or(z5.record(z5.enum(["tag", "message"]), z5.string().trim()))
|
|
82
|
+
});
|
|
83
|
+
var ErrorCode = z5.enum([
|
|
84
|
+
"BAD_REQUEST",
|
|
85
|
+
"NOT_FOUND",
|
|
86
|
+
"OUT_OF_BOUNDS",
|
|
87
|
+
"INVALID",
|
|
88
|
+
"INTERNAL_ERROR",
|
|
89
|
+
"MISSING_PERMISSIONS",
|
|
90
|
+
"PROHIBITED_ACTION",
|
|
91
|
+
"INCOMPLETE_FORM",
|
|
92
|
+
"SERVER_ERROR",
|
|
93
|
+
"REQUEST_TIMEDOUT",
|
|
94
|
+
"UNKNOWN",
|
|
95
|
+
"UNVERIFIED",
|
|
96
|
+
"INVALID_TOKEN",
|
|
97
|
+
"CANCELLED"
|
|
98
|
+
]);
|
|
99
|
+
var ErrorMessage = z5.object({
|
|
100
|
+
code: ErrorCode,
|
|
101
|
+
title: z5.string().optional(),
|
|
102
|
+
message: z5.string().trim(),
|
|
103
|
+
cause: z5.string().optional()
|
|
104
|
+
});
|
|
105
|
+
var SuccessMessage = z5.object({
|
|
106
|
+
title: z5.string().trim(),
|
|
107
|
+
message: z5.string().trim()
|
|
108
|
+
});
|
|
109
|
+
var TaskStatus = z5.enum(["success", "pending", "error"]);
|
|
110
|
+
|
|
111
|
+
// src/schemas/Transaction.ts
|
|
112
|
+
import * as z6 from "zod";
|
|
113
|
+
var TransactionCurrency = z6.enum(["JMD"]);
|
|
114
|
+
export {
|
|
115
|
+
Address,
|
|
116
|
+
AuthProviders,
|
|
117
|
+
Email,
|
|
118
|
+
ErrorCode,
|
|
119
|
+
ErrorMessage,
|
|
120
|
+
FILE_MIME_TYPES,
|
|
121
|
+
FileAliases,
|
|
122
|
+
FileDetails,
|
|
123
|
+
KnownFileAliases,
|
|
124
|
+
Name,
|
|
125
|
+
PersonIdentity,
|
|
126
|
+
PhoneNumber,
|
|
127
|
+
SuccessMessage,
|
|
128
|
+
TaskLog,
|
|
129
|
+
TaskStatus,
|
|
130
|
+
TransactionCurrency,
|
|
131
|
+
UserModel,
|
|
132
|
+
addressKeys,
|
|
133
|
+
nameKeys
|
|
134
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wavy/util",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Yay, utils!",
|
|
5
|
+
"main": "./dist/main.js",
|
|
6
|
+
"types": "./dist/main.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup",
|
|
10
|
+
"publisher": "npm run build && npm version patch && npm publish -access=public && echo \"✨ Successfully published package! ✨\""
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"types"
|
|
14
|
+
],
|
|
15
|
+
"author": "wavy",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"tsup": "^8.5.0",
|
|
19
|
+
"typescript": "^5.9.2",
|
|
20
|
+
"zod": "^4.2.1"
|
|
21
|
+
}
|
|
22
|
+
}
|