@managesome/eposmatic-toolkit 0.4.78 → 0.4.81

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.
@@ -290,6 +290,11 @@ export const BLACKLISTED_SMS_COUNTRY_CODES = [
290
290
  '+263', // Zimbabwe
291
291
  ];
292
292
  export const WHITELISTED_API_SMS_COUNTRY_CODES = ['+92']; // Pakistan
293
+ /**
294
+ * @deprecated WhatsApp is offered regardless of country now. Keep this export
295
+ * only until the POS/console/ordering consumers stop importing it; deleting it
296
+ * breaks their builds.
297
+ */
293
298
  export const BLACKLISTED_WHATSAPP_COUNTRY_CODES = ['+92']; // Pakistan
294
299
  // ======================>> <<====================== //
295
300
  export var ALERT_NOTIFICATIONS_TYPE_ENUM;
@@ -3,3 +3,16 @@ export var CUSTOMER_EMAIL_LOGIN_STATUS_ENUM;
3
3
  CUSTOMER_EMAIL_LOGIN_STATUS_ENUM["LOGGED_IN"] = "logged_in";
4
4
  CUSTOMER_EMAIL_LOGIN_STATUS_ENUM["NEEDS_PHONE"] = "needs_phone";
5
5
  })(CUSTOMER_EMAIL_LOGIN_STATUS_ENUM || (CUSTOMER_EMAIL_LOGIN_STATUS_ENUM = {}));
6
+ export var CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM;
7
+ (function (CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM) {
8
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["AVAILABLE"] = "available";
9
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["LINKED_TO_CURRENT_PHONE"] = "linked_to_current_phone";
10
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["LINKED_TO_OTHER_PHONE"] = "linked_to_other_phone";
11
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["ACCOUNT_HAS_DIFFERENT_EMAIL"] = "account_has_different_email";
12
+ })(CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM || (CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM = {}));
13
+ export var CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM;
14
+ (function (CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM) {
15
+ CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM["AVAILABLE"] = "available";
16
+ CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM["PHONE_HAS_DIFFERENT_EMAIL"] = "phone_has_different_email";
17
+ CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM["EMAIL_HAS_OTHER_PHONE"] = "email_has_other_phone";
18
+ })(CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM || (CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM = {}));
@@ -46,6 +46,11 @@ export declare enum MARKETING_RECEIPIENT_ENUM {
46
46
  export declare const ALL_MARKETING_RECEIPIENT_TYPES: MARKETING_RECEIPIENT_ENUM[];
47
47
  export declare const BLACKLISTED_SMS_COUNTRY_CODES: string[];
48
48
  export declare const WHITELISTED_API_SMS_COUNTRY_CODES: string[];
49
+ /**
50
+ * @deprecated WhatsApp is offered regardless of country now. Keep this export
51
+ * only until the POS/console/ordering consumers stop importing it; deleting it
52
+ * breaks their builds.
53
+ */
49
54
  export declare const BLACKLISTED_WHATSAPP_COUNTRY_CODES: string[];
50
55
  export declare enum ALERT_NOTIFICATIONS_TYPE_ENUM {
51
56
  UNCONFIRMED_ORDER_DELAY = "UNCONFIRMED_ORDER_DELAY",
@@ -293,6 +293,11 @@ exports.BLACKLISTED_SMS_COUNTRY_CODES = [
293
293
  '+263', // Zimbabwe
294
294
  ];
295
295
  exports.WHITELISTED_API_SMS_COUNTRY_CODES = ['+92']; // Pakistan
296
+ /**
297
+ * @deprecated WhatsApp is offered regardless of country now. Keep this export
298
+ * only until the POS/console/ordering consumers stop importing it; deleting it
299
+ * breaks their builds.
300
+ */
296
301
  exports.BLACKLISTED_WHATSAPP_COUNTRY_CODES = ['+92']; // Pakistan
297
302
  // ======================>> <<====================== //
298
303
  var ALERT_NOTIFICATIONS_TYPE_ENUM;
@@ -2,3 +2,14 @@ export declare enum CUSTOMER_EMAIL_LOGIN_STATUS_ENUM {
2
2
  LOGGED_IN = "logged_in",
3
3
  NEEDS_PHONE = "needs_phone"
4
4
  }
5
+ export declare enum CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM {
6
+ AVAILABLE = "available",
7
+ LINKED_TO_CURRENT_PHONE = "linked_to_current_phone",
8
+ LINKED_TO_OTHER_PHONE = "linked_to_other_phone",
9
+ ACCOUNT_HAS_DIFFERENT_EMAIL = "account_has_different_email"
10
+ }
11
+ export declare enum CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM {
12
+ AVAILABLE = "available",
13
+ PHONE_HAS_DIFFERENT_EMAIL = "phone_has_different_email",
14
+ EMAIL_HAS_OTHER_PHONE = "email_has_other_phone"
15
+ }
@@ -1,8 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CUSTOMER_EMAIL_LOGIN_STATUS_ENUM = void 0;
3
+ exports.CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM = exports.CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM = exports.CUSTOMER_EMAIL_LOGIN_STATUS_ENUM = void 0;
4
4
  var CUSTOMER_EMAIL_LOGIN_STATUS_ENUM;
5
5
  (function (CUSTOMER_EMAIL_LOGIN_STATUS_ENUM) {
6
6
  CUSTOMER_EMAIL_LOGIN_STATUS_ENUM["LOGGED_IN"] = "logged_in";
7
7
  CUSTOMER_EMAIL_LOGIN_STATUS_ENUM["NEEDS_PHONE"] = "needs_phone";
8
8
  })(CUSTOMER_EMAIL_LOGIN_STATUS_ENUM || (exports.CUSTOMER_EMAIL_LOGIN_STATUS_ENUM = CUSTOMER_EMAIL_LOGIN_STATUS_ENUM = {}));
9
+ var CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM;
10
+ (function (CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM) {
11
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["AVAILABLE"] = "available";
12
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["LINKED_TO_CURRENT_PHONE"] = "linked_to_current_phone";
13
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["LINKED_TO_OTHER_PHONE"] = "linked_to_other_phone";
14
+ CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM["ACCOUNT_HAS_DIFFERENT_EMAIL"] = "account_has_different_email";
15
+ })(CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM || (exports.CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM = CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM = {}));
16
+ var CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM;
17
+ (function (CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM) {
18
+ CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM["AVAILABLE"] = "available";
19
+ CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM["PHONE_HAS_DIFFERENT_EMAIL"] = "phone_has_different_email";
20
+ CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM["EMAIL_HAS_OTHER_PHONE"] = "email_has_other_phone";
21
+ })(CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM || (exports.CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM = CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM = {}));
@@ -1,4 +1,5 @@
1
- import { CUSTOMER_EMAIL_LOGIN_STATUS_ENUM } from '../../constants/enums/customer';
1
+ import { CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM, CUSTOMER_EMAIL_LOGIN_STATUS_ENUM, CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM } from '../../constants/enums/customer';
2
+ import { ICustomer } from '../../schemas/types/customers';
2
3
  import { CUSTOMER_TARGET_MODE_ENUM, DIALER_TYPES_ENUM, WALLET_ASSET_TYPE_ENUM, WALLET_ASSIGNMENT_BEHAVIOR_ENUM } from '../../constants';
3
4
  /**
4
5
  * Request/response contracts for backend service APIs, shared between apps and
@@ -325,3 +326,32 @@ export type TCustomerEmailLoginResponse = {
325
326
  status: CUSTOMER_EMAIL_LOGIN_STATUS_ENUM.NEEDS_PHONE;
326
327
  email_proof: string;
327
328
  };
329
+ /** Body for /email/auth/send-otp and /email/auth/verify-otp (encrypted). */
330
+ export interface IEmailAuthTokenRequest {
331
+ token: string;
332
+ }
333
+ /** Body for /email/auth/link-check. */
334
+ export interface IEmailLinkCheckRequest {
335
+ tenant_id: string;
336
+ email: string;
337
+ }
338
+ export interface IEmailLinkCheckResponse {
339
+ status: CUSTOMER_EMAIL_LINK_CHECK_STATUS_ENUM;
340
+ }
341
+ /** Body for /email/auth/phone-check. */
342
+ export interface IEmailPhoneCheckRequest {
343
+ tenant_id: string;
344
+ phone_number: string;
345
+ email_proof: string;
346
+ }
347
+ export interface IEmailPhoneCheckResponse {
348
+ status: CUSTOMER_PHONE_LINK_CHECK_STATUS_ENUM;
349
+ }
350
+ /** Body for /email/auth/link-email (phone Firebase token required). */
351
+ export interface IEmailLinkRequest {
352
+ tenant_id: string;
353
+ email_proof: string;
354
+ }
355
+ export interface IEmailLinkResponse {
356
+ customer: ICustomer;
357
+ }
@@ -242,17 +242,25 @@ export interface IEmailTemplateForSaleOrder {
242
242
  description: string;
243
243
  theme_color?: string | null;
244
244
  }
245
+ /**
246
+ * Template model for the Postmark `otp-verification` template (id `48566213`).
247
+ *
248
+ * Every key listed in the template is REQUIRED here. Postmark renders a blank
249
+ * value for a missing key rather than failing, so callers must always send the
250
+ * full object and use `null` (or `""`) when a value does not apply.
251
+ */
245
252
  export interface IEmailTemplateForOTP {
253
+ otp_code: string;
246
254
  brand_name: string;
247
- brand_logo_url: string;
248
- header_color: string;
255
+ expiry_minutes: number;
256
+ theme_color: string;
257
+ brand_logo_url: string | null;
249
258
  theme_contrast: string;
250
259
  user_name: string;
251
260
  user_email: string;
252
- otp_code: string;
253
- expiry_minutes: number;
254
- anti_phishing_code?: string | null;
261
+ anti_phishing_code: string | null;
255
262
  support_email: string;
263
+ subject: string;
256
264
  }
257
265
  export type ITemplateModel = IEmailAccountActivated | IEmailAccountDeactivated | IEmailLateDeliveryAlert | IEmailLowInventoryAlert | IEmailOrderReceipt | IEmailOrderStatusUpdate | IEmailRateOrder | IEmailReceivedOrderReview | IEmailSubscriptionDueSoon | IEmailSubscriptionPending | IEmailSubscriptionExpired | IEmailSubscriptionRenewed | IEmailUnconfirmOrderAlert | IEmailWelcome | IEmailMarketingFormSubmission | IEmailTemplateForRFQ | IEmailTemplateForPurchaseOrder | IEmailTemplateForSaleOrder | IEmailTemplateForOTP;
258
266
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.78",
3
+ "version": "0.4.81",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",