@wavy/util 0.0.4 → 0.0.5
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/main.d.ts +14 -14
- package/dist/main.js +17 -17
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
3
|
+
declare const authProviders: z.ZodEnum<{
|
|
4
4
|
Google: "Google";
|
|
5
5
|
}>;
|
|
6
|
-
type
|
|
6
|
+
type AuthProvider = z.infer<typeof authProviders>;
|
|
7
7
|
|
|
8
|
-
declare const
|
|
8
|
+
declare const fileAliases: z.ZodEnum<{
|
|
9
9
|
pdf: "pdf";
|
|
10
10
|
word: "word";
|
|
11
11
|
excel: "excel";
|
|
@@ -13,15 +13,15 @@ declare const FileAliases: z.ZodEnum<{
|
|
|
13
13
|
txt: "txt";
|
|
14
14
|
unknown: "unknown";
|
|
15
15
|
}>;
|
|
16
|
-
type FileAlias = z.infer<typeof
|
|
17
|
-
declare const
|
|
16
|
+
type FileAlias = z.infer<typeof fileAliases>;
|
|
17
|
+
declare const knownFileAliases: z.ZodEnum<{
|
|
18
18
|
pdf: "pdf";
|
|
19
19
|
word: "word";
|
|
20
20
|
excel: "excel";
|
|
21
21
|
img: "img";
|
|
22
22
|
txt: "txt";
|
|
23
23
|
}>;
|
|
24
|
-
type KnownFileAlias = z.infer<typeof
|
|
24
|
+
type KnownFileAlias = z.infer<typeof knownFileAliases>;
|
|
25
25
|
declare const FileDetails: z.ZodObject<{
|
|
26
26
|
lastModified: z.ZodNullable<z.ZodNumber>;
|
|
27
27
|
uid: z.ZodOptional<z.ZodString>;
|
|
@@ -41,7 +41,7 @@ declare const FileDetails: z.ZodObject<{
|
|
|
41
41
|
}>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
type FileDetails = z.infer<typeof FileDetails>;
|
|
44
|
-
declare const FILE_MIME_TYPES:
|
|
44
|
+
declare const FILE_MIME_TYPES: Record<FileAlias, string[]>;
|
|
45
45
|
|
|
46
46
|
declare const PhoneNumber: z.ZodString;
|
|
47
47
|
declare const nameKeys: z.ZodEnum<{
|
|
@@ -129,7 +129,7 @@ declare const TaskLog: z.ZodObject<{
|
|
|
129
129
|
}>, z.ZodString>]>;
|
|
130
130
|
}, z.core.$strip>;
|
|
131
131
|
type TaskLog = z.infer<typeof TaskLog>;
|
|
132
|
-
declare const
|
|
132
|
+
declare const errorCodes: z.ZodEnum<{
|
|
133
133
|
BAD_REQUEST: "BAD_REQUEST";
|
|
134
134
|
NOT_FOUND: "NOT_FOUND";
|
|
135
135
|
OUT_OF_BOUNDS: "OUT_OF_BOUNDS";
|
|
@@ -145,7 +145,7 @@ declare const ErrorCode: z.ZodEnum<{
|
|
|
145
145
|
INVALID_TOKEN: "INVALID_TOKEN";
|
|
146
146
|
CANCELLED: "CANCELLED";
|
|
147
147
|
}>;
|
|
148
|
-
type ErrorCode = z.infer<typeof
|
|
148
|
+
type ErrorCode = z.infer<typeof errorCodes>;
|
|
149
149
|
declare const ErrorMessage: z.ZodObject<{
|
|
150
150
|
code: z.ZodEnum<{
|
|
151
151
|
BAD_REQUEST: "BAD_REQUEST";
|
|
@@ -180,17 +180,17 @@ type TaskResult<ResponseType extends object | "success" = "success"> = {
|
|
|
180
180
|
error?: never | undefined | null;
|
|
181
181
|
response: ResponseType;
|
|
182
182
|
};
|
|
183
|
-
declare const
|
|
183
|
+
declare const taskStatuses: z.ZodEnum<{
|
|
184
184
|
error: "error";
|
|
185
185
|
success: "success";
|
|
186
186
|
pending: "pending";
|
|
187
187
|
}>;
|
|
188
|
-
type TaskStatus = z.infer<typeof
|
|
188
|
+
type TaskStatus = z.infer<typeof taskStatuses>;
|
|
189
189
|
|
|
190
|
-
declare const
|
|
190
|
+
declare const currencies: z.ZodEnum<{
|
|
191
191
|
JMD: "JMD";
|
|
192
192
|
}>;
|
|
193
|
-
type Currency = z.infer<typeof
|
|
193
|
+
type Currency = z.infer<typeof currencies>;
|
|
194
194
|
|
|
195
195
|
type UnsubscribeFunction = () => void;
|
|
196
196
|
type KeysWithType<O extends object, T> = {
|
|
@@ -261,4 +261,4 @@ type AddPrefix<T, P extends string> = {
|
|
|
261
261
|
[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;
|
|
262
262
|
};
|
|
263
263
|
|
|
264
|
-
export { type AddPrefix, Address, type
|
|
264
|
+
export { type AddPrefix, Address, type AuthProvider, type CastArray, type CastFn, type Currency, Email, type ErrorCode, ErrorMessage, FILE_MIME_TYPES, type FileAlias, FileDetails, type FlatDictionary, type FlattenDictionary, type KeysWithType, type KeysWithoutType, type KnownFileAlias, 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, type TaskStatus, type TypeOrGetType, type UnionToIntersection, type UnsubscribeFunction, UserModel, type WithExpiryDate, type WithMultiDimArray, type WithStringArray, addressKeys, authProviders, currencies, errorCodes, fileAliases, knownFileAliases, nameKeys, taskStatuses };
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/schemas/Auth.ts
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
var
|
|
3
|
+
var authProviders = z.enum(["Google"]);
|
|
4
4
|
|
|
5
5
|
// src/schemas/File.ts
|
|
6
6
|
import * as z2 from "zod";
|
|
7
|
-
var
|
|
7
|
+
var fileAliases = z2.enum([
|
|
8
8
|
"pdf",
|
|
9
9
|
"word",
|
|
10
10
|
"excel",
|
|
@@ -12,7 +12,7 @@ var FileAliases = z2.enum([
|
|
|
12
12
|
"txt",
|
|
13
13
|
"unknown"
|
|
14
14
|
]);
|
|
15
|
-
var
|
|
15
|
+
var knownFileAliases = fileAliases.exclude(["unknown"]);
|
|
16
16
|
var FileDetails = z2.object({
|
|
17
17
|
lastModified: z2.number().nullable(),
|
|
18
18
|
uid: z2.string().trim().optional(),
|
|
@@ -22,9 +22,9 @@ var FileDetails = z2.object({
|
|
|
22
22
|
path: z2.string().trim(),
|
|
23
23
|
extension: z2.string().trim().startsWith(".").lowercase(),
|
|
24
24
|
description: z2.string().trim().optional(),
|
|
25
|
-
alias:
|
|
25
|
+
alias: fileAliases
|
|
26
26
|
});
|
|
27
|
-
var FILE_MIME_TYPES =
|
|
27
|
+
var FILE_MIME_TYPES = {
|
|
28
28
|
txt: ["text/plain"],
|
|
29
29
|
img: ["image/jpeg", "image/png", "image/jpg"],
|
|
30
30
|
excel: [
|
|
@@ -39,7 +39,7 @@ var FILE_MIME_TYPES = Object.freeze({
|
|
|
39
39
|
],
|
|
40
40
|
pdf: ["application/pdf"],
|
|
41
41
|
unknown: []
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
|
|
44
44
|
// src/schemas/Identity.ts
|
|
45
45
|
import * as z3 from "zod";
|
|
@@ -80,7 +80,7 @@ var TaskLog = z5.object({
|
|
|
80
80
|
status: z5.enum(["success", "error", "info"]),
|
|
81
81
|
response: z5.string().trim().or(z5.record(z5.enum(["tag", "message"]), z5.string().trim()))
|
|
82
82
|
});
|
|
83
|
-
var
|
|
83
|
+
var errorCodes = z5.enum([
|
|
84
84
|
"BAD_REQUEST",
|
|
85
85
|
"NOT_FOUND",
|
|
86
86
|
"OUT_OF_BOUNDS",
|
|
@@ -97,7 +97,7 @@ var ErrorCode = z5.enum([
|
|
|
97
97
|
"CANCELLED"
|
|
98
98
|
]);
|
|
99
99
|
var ErrorMessage = z5.object({
|
|
100
|
-
code:
|
|
100
|
+
code: errorCodes,
|
|
101
101
|
title: z5.string().optional(),
|
|
102
102
|
message: z5.string().trim(),
|
|
103
103
|
cause: z5.string().optional()
|
|
@@ -106,29 +106,29 @@ var SuccessMessage = z5.object({
|
|
|
106
106
|
title: z5.string().trim(),
|
|
107
107
|
message: z5.string().trim()
|
|
108
108
|
});
|
|
109
|
-
var
|
|
109
|
+
var taskStatuses = z5.enum(["success", "pending", "error"]);
|
|
110
110
|
|
|
111
111
|
// src/schemas/Billing.ts
|
|
112
112
|
import * as z6 from "zod";
|
|
113
|
-
var
|
|
113
|
+
var currencies = z6.enum(["JMD"]);
|
|
114
114
|
export {
|
|
115
115
|
Address,
|
|
116
|
-
AuthProviders,
|
|
117
|
-
Currencies,
|
|
118
116
|
Email,
|
|
119
|
-
ErrorCode,
|
|
120
117
|
ErrorMessage,
|
|
121
118
|
FILE_MIME_TYPES,
|
|
122
|
-
FileAliases,
|
|
123
119
|
FileDetails,
|
|
124
|
-
KnownFileAliases,
|
|
125
120
|
Name,
|
|
126
121
|
PersonIdentity,
|
|
127
122
|
PhoneNumber,
|
|
128
123
|
SuccessMessage,
|
|
129
124
|
TaskLog,
|
|
130
|
-
TaskStatus,
|
|
131
125
|
UserModel,
|
|
132
126
|
addressKeys,
|
|
133
|
-
|
|
127
|
+
authProviders,
|
|
128
|
+
currencies,
|
|
129
|
+
errorCodes,
|
|
130
|
+
fileAliases,
|
|
131
|
+
knownFileAliases,
|
|
132
|
+
nameKeys,
|
|
133
|
+
taskStatuses
|
|
134
134
|
};
|