@wavy/util 0.0.4 → 0.0.6

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