@bizmap/sdk 0.0.50 → 0.0.51
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 +5 -5
- package/dist/main.js +15 -4
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -133,7 +133,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
133
133
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
134
134
|
}, z.core.$strip>;
|
|
135
135
|
notifications: z.ZodArray<z.ZodObject<{
|
|
136
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
136
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
137
137
|
payload: z.ZodString;
|
|
138
138
|
seen: z.ZodBoolean;
|
|
139
139
|
src: z.ZodObject<{
|
|
@@ -143,7 +143,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
143
143
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
144
144
|
createdAt: z.ZodInt;
|
|
145
145
|
}, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
146
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
146
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
147
147
|
payload: z.ZodString;
|
|
148
148
|
seen: z.ZodBoolean;
|
|
149
149
|
src: z.ZodObject<{
|
|
@@ -521,7 +521,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
521
521
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
522
522
|
}, z.core.$strip>;
|
|
523
523
|
notifications: z.ZodArray<z.ZodObject<{
|
|
524
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
524
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
525
525
|
payload: z.ZodString;
|
|
526
526
|
seen: z.ZodBoolean;
|
|
527
527
|
src: z.ZodObject<{
|
|
@@ -531,7 +531,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
531
531
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
532
532
|
createdAt: z.ZodInt;
|
|
533
533
|
}, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
534
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
534
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
535
535
|
payload: z.ZodString;
|
|
536
536
|
seen: z.ZodBoolean;
|
|
537
537
|
src: z.ZodObject<{
|
|
@@ -889,7 +889,7 @@ declare const TierList: z.ZodRecord<z.ZodEnum<{
|
|
|
889
889
|
}, z.core.$strip>>;
|
|
890
890
|
type TierList = z.infer<typeof TierList>;
|
|
891
891
|
declare const Notification: z.ZodObject<{
|
|
892
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
892
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
893
893
|
payload: z.ZodString;
|
|
894
894
|
seen: z.ZodBoolean;
|
|
895
895
|
src: z.ZodObject<{
|
package/dist/main.js
CHANGED
|
@@ -99,7 +99,12 @@ var TierList = z5.record(
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
var Notification = z5.object({
|
|
102
|
-
code: z5.literal([
|
|
102
|
+
code: z5.literal([
|
|
103
|
+
"COMPANY_INVITE",
|
|
104
|
+
"INVITE_RESPONSE",
|
|
105
|
+
"DEV_MESSAGE",
|
|
106
|
+
"ALERT"
|
|
107
|
+
]),
|
|
103
108
|
payload: z5.string(),
|
|
104
109
|
seen: z5.boolean(),
|
|
105
110
|
src: z5.object({
|
|
@@ -109,6 +114,11 @@ var Notification = z5.object({
|
|
|
109
114
|
expiresAt: Timestamp.nullish(),
|
|
110
115
|
createdAt: Timestamp
|
|
111
116
|
}).superRefine((data, ctx) => {
|
|
117
|
+
const expectMessage = () => {
|
|
118
|
+
if ((data.payload?.length ?? 0) < 3) {
|
|
119
|
+
ctx.addIssue("The payload must have at least (3) characters.");
|
|
120
|
+
}
|
|
121
|
+
};
|
|
112
122
|
switch (data.code) {
|
|
113
123
|
case "COMPANY_INVITE":
|
|
114
124
|
if (!Jwt.safeParse(data.payload).success) {
|
|
@@ -116,9 +126,10 @@ var Notification = z5.object({
|
|
|
116
126
|
}
|
|
117
127
|
break;
|
|
118
128
|
case "DEV_MESSAGE":
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
expectMessage();
|
|
130
|
+
break;
|
|
131
|
+
case "ALERT":
|
|
132
|
+
expectMessage();
|
|
122
133
|
break;
|
|
123
134
|
case "INVITE_RESPONSE":
|
|
124
135
|
if (!InviteResponse.safeParse(data.payload).success) {
|