@floristcloud/api-lib 1.2.4 → 1.2.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.
@@ -9,6 +9,7 @@ exports.GetAvailableChannelsRequestSchema = zod_1.z.object({
9
9
  });
10
10
  exports.GetAvailableChannelsResponseSchema = zod_1.z.object({
11
11
  channels: zod_1.z.array(zod_1.z.nativeEnum(enum_1.NotificationChannelEnum)),
12
+ blockedReason: zod_1.z.nativeEnum(enum_1.SecurityCodeBlockedReasonEnum).optional(),
12
13
  });
13
14
  var GetAvailableChannelsContractCommand;
14
15
  (function (GetAvailableChannelsContractCommand) {
@@ -879,6 +879,9 @@ exports.ERRORS = {
879
879
  SECURITY_CODE_NOT_FOUND: { code: 'SC002', message: 'Security code not found', httpCode: 404 },
880
880
  SECURITY_CODE_INVALID: { code: 'SC003', message: 'Security code is invalid', httpCode: 400 },
881
881
  SECURITY_CODE_THROTTLED: { code: 'SC004', message: 'Security code creation too frequent', httpCode: 429 },
882
+ SECURITY_CODE_FRAUD: { code: 'SC005', message: 'Security code attempts exceeded. Contact administrator', httpCode: 403 },
883
+ SECURITY_CODE_DAILY_LIMIT: { code: 'SC006', message: 'Daily security code limit reached. Contact administrator', httpCode: 429 },
884
+ SECURITY_CODE_FRAUD_BLOCK: { code: 'SC007', message: 'Security code temporarily blocked after fraud detection', httpCode: 429 },
882
885
  // MESSENGER PROFILE
883
886
  MESSENGER_VERIFICATION_CODE_NOT_FOUND: { code: 'MP001', message: 'Verification code not found', httpCode: 404 },
884
887
  MESSENGER_VERIFICATION_CODE_EXPIRED: { code: 'MP002', message: 'Verification code expired', httpCode: 400 },
@@ -912,4 +915,11 @@ exports.ERRORS = {
912
915
  MOBILE_RATE_LIMIT_EXCEEDED: { code: 'MOB002', message: 'Too many requests to mobile login endpoint', httpCode: 429 },
913
916
  // UNIFIED AUTH (replaces separate USER_NOT_FOUND / INCORRECT_CREDENTIALS for login)
914
917
  INVALID_CREDENTIALS: { code: 'AUTH001', message: 'Invalid credentials', httpCode: 401 },
918
+ // DEVICE TOKEN
919
+ DEVICE_TOKEN_NOT_CREATED: { code: 'DT001', message: 'Failed to register device token', httpCode: 500 },
920
+ DEVICE_TOKEN_NOT_FOUND: { code: 'DT002', message: 'Device token not found', httpCode: 404 },
921
+ DEVICE_TOKEN_NOT_DELETED: { code: 'DT003', message: 'Failed to delete device token', httpCode: 500 },
922
+ // PUSH NOTIFICATION
923
+ PUSH_NOTIFICATION_SEND_FAILED: { code: 'PN001', message: 'Failed to send push notification', httpCode: 500 },
924
+ PUSH_NOTIFICATION_NO_DEVICES: { code: 'PN002', message: 'No active devices found for user', httpCode: 404 },
915
925
  };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DevicePlatformEnum = void 0;
4
+ var DevicePlatformEnum;
5
+ (function (DevicePlatformEnum) {
6
+ DevicePlatformEnum["IOS"] = "IOS";
7
+ DevicePlatformEnum["ANDROID"] = "ANDROID";
8
+ })(DevicePlatformEnum || (exports.DevicePlatformEnum = DevicePlatformEnum = {}));
@@ -80,3 +80,5 @@ __exportStar(require("./chat-has-manager-mode.enum"), exports);
80
80
  __exportStar(require("./chat-no-manager-mode.enum"), exports);
81
81
  __exportStar(require("./match-confidence.enum"), exports);
82
82
  __exportStar(require("./session-platform.enum"), exports);
83
+ __exportStar(require("./device-platform.enum"), exports);
84
+ __exportStar(require("./security-code-blocked-reason.enum"), exports);
@@ -13,5 +13,6 @@ var NotificationChannelEnum;
13
13
  NotificationChannelEnum["EMAIL"] = "EMAIL";
14
14
  NotificationChannelEnum["TELEGRAM_BOT"] = "TELEGRAM_BOT";
15
15
  NotificationChannelEnum["TELEGRAM_STAFF_BOT"] = "TELEGRAM_STAFF_BOT";
16
+ NotificationChannelEnum["MOBILE_PUSH"] = "MOBILE_PUSH";
16
17
  NotificationChannelEnum["SYSTEM"] = "SYSTEM";
17
18
  })(NotificationChannelEnum || (exports.NotificationChannelEnum = NotificationChannelEnum = {}));
@@ -9,4 +9,5 @@ var NotificationTypeEnum;
9
9
  NotificationTypeEnum["CART_EXPIRATION"] = "CART_EXPIRATION";
10
10
  NotificationTypeEnum["WRITE_OFF_REJECTED"] = "WRITE_OFF_REJECTED";
11
11
  NotificationTypeEnum["CLIENT_MESSAGE_TO_EMPLOYEE"] = "CLIENT_MESSAGE_TO_EMPLOYEE";
12
+ NotificationTypeEnum["PASSWORD_CHANGED"] = "PASSWORD_CHANGED";
12
13
  })(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecurityCodeBlockedReasonEnum = void 0;
4
+ var SecurityCodeBlockedReasonEnum;
5
+ (function (SecurityCodeBlockedReasonEnum) {
6
+ SecurityCodeBlockedReasonEnum["FRAUD_BLOCK"] = "fraud_block";
7
+ SecurityCodeBlockedReasonEnum["DAILY_LIMIT"] = "daily_limit";
8
+ })(SecurityCodeBlockedReasonEnum || (exports.SecurityCodeBlockedReasonEnum = SecurityCodeBlockedReasonEnum = {}));
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { NotificationChannelEnum } from '../../enum';
2
+ import { NotificationChannelEnum, SecurityCodeBlockedReasonEnum } from '../../enum';
3
3
 
4
4
  export const GetAvailableChannelsRequestSchema = z.object({
5
5
  email: z.email().toLowerCase().optional(),
@@ -8,6 +8,7 @@ export const GetAvailableChannelsRequestSchema = z.object({
8
8
 
9
9
  export const GetAvailableChannelsResponseSchema = z.object({
10
10
  channels: z.array(z.nativeEnum(NotificationChannelEnum)),
11
+ blockedReason: z.nativeEnum(SecurityCodeBlockedReasonEnum).optional(),
11
12
  });
12
13
 
13
14
  export namespace GetAvailableChannelsContractCommand {
package/constant/error.ts CHANGED
@@ -928,6 +928,9 @@ export const ERRORS = {
928
928
  SECURITY_CODE_NOT_FOUND: { code: 'SC002', message: 'Security code not found', httpCode: 404 },
929
929
  SECURITY_CODE_INVALID: { code: 'SC003', message: 'Security code is invalid', httpCode: 400 },
930
930
  SECURITY_CODE_THROTTLED: { code: 'SC004', message: 'Security code creation too frequent', httpCode: 429 },
931
+ SECURITY_CODE_FRAUD: { code: 'SC005', message: 'Security code attempts exceeded. Contact administrator', httpCode: 403 },
932
+ SECURITY_CODE_DAILY_LIMIT: { code: 'SC006', message: 'Daily security code limit reached. Contact administrator', httpCode: 429 },
933
+ SECURITY_CODE_FRAUD_BLOCK: { code: 'SC007', message: 'Security code temporarily blocked after fraud detection', httpCode: 429 },
931
934
 
932
935
  // MESSENGER PROFILE
933
936
  MESSENGER_VERIFICATION_CODE_NOT_FOUND: { code: 'MP001', message: 'Verification code not found', httpCode: 404 },
@@ -968,4 +971,13 @@ export const ERRORS = {
968
971
 
969
972
  // UNIFIED AUTH (replaces separate USER_NOT_FOUND / INCORRECT_CREDENTIALS for login)
970
973
  INVALID_CREDENTIALS: { code: 'AUTH001', message: 'Invalid credentials', httpCode: 401 },
974
+
975
+ // DEVICE TOKEN
976
+ DEVICE_TOKEN_NOT_CREATED: { code: 'DT001', message: 'Failed to register device token', httpCode: 500 },
977
+ DEVICE_TOKEN_NOT_FOUND: { code: 'DT002', message: 'Device token not found', httpCode: 404 },
978
+ DEVICE_TOKEN_NOT_DELETED: { code: 'DT003', message: 'Failed to delete device token', httpCode: 500 },
979
+
980
+ // PUSH NOTIFICATION
981
+ PUSH_NOTIFICATION_SEND_FAILED: { code: 'PN001', message: 'Failed to send push notification', httpCode: 500 },
982
+ PUSH_NOTIFICATION_NO_DEVICES: { code: 'PN002', message: 'No active devices found for user', httpCode: 404 },
971
983
  } as const;
@@ -0,0 +1,4 @@
1
+ export enum DevicePlatformEnum {
2
+ IOS = 'IOS',
3
+ ANDROID = 'ANDROID',
4
+ }
package/enum/index.ts CHANGED
@@ -64,3 +64,5 @@ export * from './chat-has-manager-mode.enum';
64
64
  export * from './chat-no-manager-mode.enum';
65
65
  export * from './match-confidence.enum';
66
66
  export * from './session-platform.enum';
67
+ export * from './device-platform.enum';
68
+ export * from './security-code-blocked-reason.enum';
@@ -9,5 +9,6 @@ export enum NotificationChannelEnum {
9
9
  EMAIL = 'EMAIL',
10
10
  TELEGRAM_BOT = 'TELEGRAM_BOT',
11
11
  TELEGRAM_STAFF_BOT = 'TELEGRAM_STAFF_BOT',
12
+ MOBILE_PUSH = 'MOBILE_PUSH',
12
13
  SYSTEM = 'SYSTEM',
13
14
  }
@@ -5,4 +5,5 @@ export enum NotificationTypeEnum {
5
5
  CART_EXPIRATION = 'CART_EXPIRATION',
6
6
  WRITE_OFF_REJECTED = 'WRITE_OFF_REJECTED',
7
7
  CLIENT_MESSAGE_TO_EMPLOYEE = 'CLIENT_MESSAGE_TO_EMPLOYEE',
8
+ PASSWORD_CHANGED = 'PASSWORD_CHANGED',
8
9
  }
@@ -0,0 +1,4 @@
1
+ export enum SecurityCodeBlockedReasonEnum {
2
+ FRAUD_BLOCK = 'fraud_block',
3
+ DAILY_LIMIT = 'daily_limit',
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {