@floristcloud/api-lib 1.0.22 → 1.0.23

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.
@@ -4,7 +4,7 @@ exports.SendOrderInvoiceContractCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const notification_channel_enum_1 = require("../../enum/notification-channel.enum");
6
6
  const SendOrderInvoiceRequestSchema = zod_1.z.object({
7
- channel: zod_1.z.enum([notification_channel_enum_1.NotificationChannelEnum.WHATSAPP, notification_channel_enum_1.NotificationChannelEnum.EMAIL]).optional(),
7
+ channel: zod_1.z.enum([notification_channel_enum_1.NotificationChannelEnum.WHATSAPP, notification_channel_enum_1.NotificationChannelEnum.EMAIL, notification_channel_enum_1.NotificationChannelEnum.MAX]).optional(),
8
8
  });
9
9
  const SendOrderInvoiceResponseSchema = zod_1.z.object({
10
10
  message: zod_1.z.string().optional(),
@@ -447,6 +447,10 @@ exports.ERRORS = {
447
447
  WHATSAPP_PHONE_NOT_FOUND: { code: 'W004', message: 'Phone number not found or invalid', httpCode: 400 },
448
448
  WHATSAPP_STATUS_CHECK_FAILED: { code: 'W005', message: 'Failed to check WhatsApp message status', httpCode: 500 },
449
449
  WHATSAPP_MESSAGE_NOT_FOUND: { code: 'W006', message: 'Message not found in notification', httpCode: 400 },
450
+ //MAX MESSENGER
451
+ MAX_MESSENGER_TEXT_NOT_SENT: { code: 'MX001', message: 'Failed to send text message via Max Messenger', httpCode: 500 },
452
+ MAX_MESSENGER_FILE_NOT_SENT: { code: 'MX002', message: 'Failed to send file message via Max Messenger', httpCode: 500 },
453
+ MAX_MESSENGER_MESSAGE_MISSING: { code: 'MX003', message: 'Message is missing for Max Messenger notification', httpCode: 400 },
450
454
  //PACKAGE
451
455
  PACKAGE_NOT_CREATED: { code: 'PA001', message: 'Failed to create package', httpCode: 500 },
452
456
  PACKAGE_NOT_DELETED: { code: 'PA002', message: 'Failed to delete package', httpCode: 500 },
@@ -7,6 +7,7 @@ var NotificationChannelEnum;
7
7
  NotificationChannelEnum["NOTISEND_VOICE"] = "NOTISEND_VOICE";
8
8
  NotificationChannelEnum["NOTISEND_TG"] = "NOTISEND_TG";
9
9
  NotificationChannelEnum["WHATSAPP"] = "WHATSAPP";
10
+ NotificationChannelEnum["MAX"] = "MAX";
10
11
  NotificationChannelEnum["EMAIL"] = "EMAIL";
11
12
  NotificationChannelEnum["TELEGRAM_BOT"] = "TELEGRAM_BOT";
12
13
  NotificationChannelEnum["SYSTEM"] = "SYSTEM";
@@ -49,6 +49,7 @@ exports.SettingsSchema = zod_1.z.object({
49
49
  createdAt: zod_1.z.coerce.date(),
50
50
  updatedAt: zod_1.z.coerce.date(),
51
51
  isWhatsappActive: zod_1.z.boolean(),
52
+ isMaxActive: zod_1.z.boolean(),
52
53
  isPostTerminalActive: zod_1.z.boolean(),
53
54
  webshopMainDisplayMode: zod_1.z.nativeEnum(webshop_main_display_mode_enum_1.WebshopMainDisplayModeEnum).nullable(),
54
55
  webshopMode: zod_1.z.nativeEnum(enum_1.WebshopModeEnum).nullable(),
@@ -80,6 +81,9 @@ exports.SettingsForAdminSchema = exports.SettingsSchema.extend({
80
81
  // whatsapp settings
81
82
  whatsappIdInstance: zod_1.z.string().nullable(),
82
83
  whatsappApiTokenInstance: zod_1.z.string().nullable(),
84
+ // max settings
85
+ maxIdInstance: zod_1.z.string().nullable(),
86
+ maxApiTokenInstance: zod_1.z.string().nullable(),
83
87
  });
84
88
  exports.CreateSettingsSchema = zod_1.z.object({
85
89
  language: zod_1.z.nativeEnum(enum_1.LanguageEnum),
@@ -196,4 +200,7 @@ exports.UpdateSettingsRequestSchema = zod_1.z.object({
196
200
  // whatsapp settings
197
201
  whatsappIdInstance: zod_1.z.string().nullable().optional(),
198
202
  whatsappApiTokenInstance: zod_1.z.string().nullable().optional(),
203
+ // max settings
204
+ maxIdInstance: zod_1.z.string().nullable().optional(),
205
+ maxApiTokenInstance: zod_1.z.string().nullable().optional(),
199
206
  });
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { NotificationChannelEnum } from '../../enum/notification-channel.enum';
3
3
 
4
4
  const SendOrderInvoiceRequestSchema = z.object({
5
- channel: z.enum([NotificationChannelEnum.WHATSAPP, NotificationChannelEnum.EMAIL] as const).optional(),
5
+ channel: z.enum([NotificationChannelEnum.WHATSAPP, NotificationChannelEnum.EMAIL, NotificationChannelEnum.MAX] as const).optional(),
6
6
  });
7
7
 
8
8
  const SendOrderInvoiceResponseSchema = z.object({
package/constant/error.ts CHANGED
@@ -471,6 +471,11 @@ export const ERRORS = {
471
471
  WHATSAPP_STATUS_CHECK_FAILED: { code: 'W005', message: 'Failed to check WhatsApp message status', httpCode: 500 },
472
472
  WHATSAPP_MESSAGE_NOT_FOUND: { code: 'W006', message: 'Message not found in notification', httpCode: 400 },
473
473
 
474
+ //MAX MESSENGER
475
+ MAX_MESSENGER_TEXT_NOT_SENT: { code: 'MX001', message: 'Failed to send text message via Max Messenger', httpCode: 500 },
476
+ MAX_MESSENGER_FILE_NOT_SENT: { code: 'MX002', message: 'Failed to send file message via Max Messenger', httpCode: 500 },
477
+ MAX_MESSENGER_MESSAGE_MISSING: { code: 'MX003', message: 'Message is missing for Max Messenger notification', httpCode: 400 },
478
+
474
479
  //PACKAGE
475
480
  PACKAGE_NOT_CREATED: { code: 'PA001', message: 'Failed to create package', httpCode: 500 },
476
481
  PACKAGE_NOT_DELETED: { code: 'PA002', message: 'Failed to delete package', httpCode: 500 },
@@ -3,6 +3,7 @@ export enum NotificationChannelEnum {
3
3
  NOTISEND_VOICE = 'NOTISEND_VOICE',
4
4
  NOTISEND_TG = 'NOTISEND_TG',
5
5
  WHATSAPP = 'WHATSAPP',
6
+ MAX = 'MAX',
6
7
  EMAIL = 'EMAIL',
7
8
  TELEGRAM_BOT = 'TELEGRAM_BOT',
8
9
  SYSTEM = 'SYSTEM',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -48,6 +48,7 @@ export const SettingsSchema = z.object({
48
48
  createdAt: z.coerce.date(),
49
49
  updatedAt: z.coerce.date(),
50
50
  isWhatsappActive: z.boolean(),
51
+ isMaxActive: z.boolean(),
51
52
  isPostTerminalActive: z.boolean(),
52
53
  webshopMainDisplayMode: z.nativeEnum(WebshopMainDisplayModeEnum).nullable(),
53
54
  webshopMode: z.nativeEnum(WebshopModeEnum).nullable(),
@@ -80,6 +81,9 @@ export const SettingsForAdminSchema = SettingsSchema.extend({
80
81
  // whatsapp settings
81
82
  whatsappIdInstance: z.string().nullable(),
82
83
  whatsappApiTokenInstance: z.string().nullable(),
84
+ // max settings
85
+ maxIdInstance: z.string().nullable(),
86
+ maxApiTokenInstance: z.string().nullable(),
83
87
  });
84
88
 
85
89
  export const CreateSettingsSchema = z.object({
@@ -202,4 +206,7 @@ export const UpdateSettingsRequestSchema = z.object({
202
206
  // whatsapp settings
203
207
  whatsappIdInstance: z.string().nullable().optional(),
204
208
  whatsappApiTokenInstance: z.string().nullable().optional(),
209
+ // max settings
210
+ maxIdInstance: z.string().nullable().optional(),
211
+ maxApiTokenInstance: z.string().nullable().optional(),
205
212
  });