@wavy/util 0.0.9 → 0.0.10
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 -1
- package/dist/main.js +22 -2
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -185,6 +185,10 @@ type TaskStatus = z.infer<typeof taskStatuses>;
|
|
|
185
185
|
|
|
186
186
|
declare const currencies: z.ZodEnum<{
|
|
187
187
|
JMD: "JMD";
|
|
188
|
+
USD: "USD";
|
|
189
|
+
EUR: "EUR";
|
|
190
|
+
GBP: "GBP";
|
|
191
|
+
CAD: "CAD";
|
|
188
192
|
}>;
|
|
189
193
|
type Currency = z.infer<typeof currencies>;
|
|
190
194
|
|
|
@@ -257,4 +261,13 @@ type AddPrefix<T, P extends string> = {
|
|
|
257
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;
|
|
258
262
|
};
|
|
259
263
|
|
|
260
|
-
|
|
264
|
+
declare class TaskError {
|
|
265
|
+
constructor(message: ErrorMessage);
|
|
266
|
+
constructor(code: ErrorCode, message: string);
|
|
267
|
+
code: ErrorCode;
|
|
268
|
+
title?: string;
|
|
269
|
+
cause?: string;
|
|
270
|
+
message: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
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, TaskError, TaskLog, type TaskResult, type TaskStatus, type TypeOrGetType, type UnionToIntersection, type UnsubscribeFunction, UserModel, type WithExpiryDate, type WithMultiDimArray, type WithStringArray, authProviders, currencies, errorCodes, fileAliases, knownFileAliases, nameKeys, taskStatuses };
|
package/dist/main.js
CHANGED
|
@@ -46,7 +46,7 @@ var FILE_MIME_TYPES = {
|
|
|
46
46
|
import * as z3 from "zod";
|
|
47
47
|
var PhoneNumber = z3.string().regex(/^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/);
|
|
48
48
|
var nameKeys = z3.enum(["first", "last"]);
|
|
49
|
-
var Name = z3.record(nameKeys, z3.string().trim());
|
|
49
|
+
var Name = z3.record(nameKeys, z3.string().trim().min(2));
|
|
50
50
|
var addressValue = z3.string().trim();
|
|
51
51
|
var Address = z3.object({
|
|
52
52
|
streetAddress: addressValue,
|
|
@@ -111,7 +111,26 @@ var taskStatuses = z5.enum(["success", "pending", "error"]);
|
|
|
111
111
|
|
|
112
112
|
// src/schemas/Billing.ts
|
|
113
113
|
import * as z6 from "zod";
|
|
114
|
-
var currencies = z6.enum(["JMD"]);
|
|
114
|
+
var currencies = z6.enum(["JMD", "USD", "EUR", "GBP", "CAD"]);
|
|
115
|
+
|
|
116
|
+
// src/classes/TaskError.ts
|
|
117
|
+
var TaskError = class {
|
|
118
|
+
constructor(param, message) {
|
|
119
|
+
if (typeof param === "string") {
|
|
120
|
+
this.code = param;
|
|
121
|
+
this.message = message ?? "";
|
|
122
|
+
} else {
|
|
123
|
+
this.code = param.code;
|
|
124
|
+
this.title = param.title;
|
|
125
|
+
this.message = param.message;
|
|
126
|
+
this.cause = param.cause;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
code;
|
|
130
|
+
title;
|
|
131
|
+
cause;
|
|
132
|
+
message;
|
|
133
|
+
};
|
|
115
134
|
export {
|
|
116
135
|
Address,
|
|
117
136
|
Email,
|
|
@@ -122,6 +141,7 @@ export {
|
|
|
122
141
|
PersonIdentity,
|
|
123
142
|
PhoneNumber,
|
|
124
143
|
SuccessMessage,
|
|
144
|
+
TaskError,
|
|
125
145
|
TaskLog,
|
|
126
146
|
UserModel,
|
|
127
147
|
authProviders,
|