@managesome/eposmatic-toolkit 0.2.632 → 0.2.634

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.
@@ -282,6 +282,7 @@ export declare const ALL_WAREHOUSE_MODERATOR_PERMISSION_NAMES: WAREHOUSE_USER_PE
282
282
  export declare const ALL_WAREHOUSE_SUPPORT_SPECIALIST_PERMISSION_NAMES: WAREHOUSE_USER_PERMISSIONS_ENUM[];
283
283
  export declare enum WAREHOUSE_CLIENT_TYPE_ENUM {
284
284
  EXTERNAL = "EXTERNAL",
285
+ EXTERNAL_WAREHOUSE = "EXTERNAL_WAREHOUSE",
285
286
  TENANT = "TENANT",
286
287
  WAREHOUSE = "WAREHOUSE"
287
288
  }
@@ -386,6 +386,7 @@ exports.ALL_WAREHOUSE_SUPPORT_SPECIALIST_PERMISSION_NAMES = [
386
386
  var WAREHOUSE_CLIENT_TYPE_ENUM;
387
387
  (function (WAREHOUSE_CLIENT_TYPE_ENUM) {
388
388
  WAREHOUSE_CLIENT_TYPE_ENUM["EXTERNAL"] = "EXTERNAL";
389
+ WAREHOUSE_CLIENT_TYPE_ENUM["EXTERNAL_WAREHOUSE"] = "EXTERNAL_WAREHOUSE";
389
390
  WAREHOUSE_CLIENT_TYPE_ENUM["TENANT"] = "TENANT";
390
391
  WAREHOUSE_CLIENT_TYPE_ENUM["WAREHOUSE"] = "WAREHOUSE";
391
392
  })(WAREHOUSE_CLIENT_TYPE_ENUM || (exports.WAREHOUSE_CLIENT_TYPE_ENUM = WAREHOUSE_CLIENT_TYPE_ENUM = {}));
@@ -43,3 +43,19 @@ export declare const BrandSchema: Schema<any, import("mongoose").Model<any, any,
43
43
  __v: number;
44
44
  }>;
45
45
  export declare const BRANDS_COLLECTION_NAME = "brands";
46
+ /**
47
+ * Describes the indexes for `brands`. Values are Mongo key patterns that can be
48
+ * passed straight to `.hint()`.
49
+ * - `_id`: unique primary key.
50
+ * - `multi_tenant_website`: PARTIAL index — create with
51
+ * `partialFilterExpression: { multi_tenant_website: { $exists: true } }`
52
+ * (multi_tenant_website is nullable). Lookups by multi-tenant website.
53
+ */
54
+ export declare const BRANDS_COLLECTION_INDEXES: {
55
+ _id: {
56
+ _id: number;
57
+ };
58
+ multi_tenant_website: {
59
+ multi_tenant_website: number;
60
+ };
61
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BRANDS_COLLECTION_NAME = exports.BrandSchema = void 0;
3
+ exports.BRANDS_COLLECTION_INDEXES = exports.BRANDS_COLLECTION_NAME = exports.BrandSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.BrandSchema = new mongoose_1.Schema({
@@ -43,3 +43,17 @@ exports.BrandSchema = new mongoose_1.Schema({
43
43
  minimize: false,
44
44
  });
45
45
  exports.BRANDS_COLLECTION_NAME = 'brands';
46
+ /**
47
+ * Describes the indexes for `brands`. Values are Mongo key patterns that can be
48
+ * passed straight to `.hint()`.
49
+ * - `_id`: unique primary key.
50
+ * - `multi_tenant_website`: PARTIAL index — create with
51
+ * `partialFilterExpression: { multi_tenant_website: { $exists: true } }`
52
+ * (multi_tenant_website is nullable). Lookups by multi-tenant website.
53
+ */
54
+ exports.BRANDS_COLLECTION_INDEXES = {
55
+ _id: { _id: 1 }, // Unique Index
56
+ multi_tenant_website: {
57
+ multi_tenant_website: 1,
58
+ }, // partial index (partialFilterExpression: { multi_tenant_website: { $exists: true } }) — brands by multi-tenant website
59
+ };
@@ -58,3 +58,17 @@ export declare const CategorySchema: Schema<any, import("mongoose").Model<any, a
58
58
  __v: number;
59
59
  }>;
60
60
  export declare const CATEGORIES_COLLECTION_NAME = "categories";
61
+ /**
62
+ * Describes the indexes for `categories`. Values are Mongo key patterns that can
63
+ * be passed straight to `.hint()`.
64
+ * - `_id`: unique primary key.
65
+ * - `tenants`: multikey index on the tenants array for per-tenant category lookups.
66
+ */
67
+ export declare const CATEGORIES_COLLECTION_INDEXES: {
68
+ _id: {
69
+ _id: number;
70
+ };
71
+ tenants: {
72
+ tenants: number;
73
+ };
74
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CATEGORIES_COLLECTION_NAME = exports.CategorySchema = void 0;
3
+ exports.CATEGORIES_COLLECTION_INDEXES = exports.CATEGORIES_COLLECTION_NAME = exports.CategorySchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.CategorySchema = new mongoose_1.Schema({
@@ -65,3 +65,13 @@ exports.CategorySchema = new mongoose_1.Schema({
65
65
  minimize: false,
66
66
  });
67
67
  exports.CATEGORIES_COLLECTION_NAME = 'categories';
68
+ /**
69
+ * Describes the indexes for `categories`. Values are Mongo key patterns that can
70
+ * be passed straight to `.hint()`.
71
+ * - `_id`: unique primary key.
72
+ * - `tenants`: multikey index on the tenants array for per-tenant category lookups.
73
+ */
74
+ exports.CATEGORIES_COLLECTION_INDEXES = {
75
+ _id: { _id: 1 }, // Unique Index
76
+ tenants: { tenants: 1 }, // multikey index — per-tenant category lookups
77
+ };
@@ -48,3 +48,17 @@ export declare const CloseDatesSchema: Schema<any, import("mongoose").Model<any,
48
48
  __v: number;
49
49
  }>;
50
50
  export declare const CLOSE_DATES_COLLECTION_NAME = "close_dates";
51
+ /**
52
+ * Describes the indexes for `close_dates`. Values are Mongo key patterns that can
53
+ * be passed straight to `.hint()`.
54
+ * - `_id`: unique primary key.
55
+ * - `tenant_id`: per-tenant close-date lookups.
56
+ */
57
+ export declare const CLOSE_DATES_COLLECTION_INDEXES: {
58
+ _id: {
59
+ _id: number;
60
+ };
61
+ tenant_id: {
62
+ tenant_id: number;
63
+ };
64
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLOSE_DATES_COLLECTION_NAME = exports.CloseDatesSchema = void 0;
3
+ exports.CLOSE_DATES_COLLECTION_INDEXES = exports.CLOSE_DATES_COLLECTION_NAME = exports.CloseDatesSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const items_1 = require("./items");
6
6
  exports.CloseDatesSchema = new mongoose_1.Schema({
@@ -54,3 +54,13 @@ exports.CloseDatesSchema = new mongoose_1.Schema({
54
54
  minimize: false,
55
55
  });
56
56
  exports.CLOSE_DATES_COLLECTION_NAME = 'close_dates';
57
+ /**
58
+ * Describes the indexes for `close_dates`. Values are Mongo key patterns that can
59
+ * be passed straight to `.hint()`.
60
+ * - `_id`: unique primary key.
61
+ * - `tenant_id`: per-tenant close-date lookups.
62
+ */
63
+ exports.CLOSE_DATES_COLLECTION_INDEXES = {
64
+ _id: { _id: 1 }, // Unique Index
65
+ tenant_id: { tenant_id: 1 }, // per-tenant close-date lookups
66
+ };
@@ -75,3 +75,17 @@ export declare const CourseSchema: Schema<any, import("mongoose").Model<any, any
75
75
  __v: number;
76
76
  }>;
77
77
  export declare const COURSES_COLLECTION_NAME = "courses";
78
+ /**
79
+ * Describes the indexes for `courses`. Values are Mongo key patterns that can be
80
+ * passed straight to `.hint()`.
81
+ * - `_id`: unique primary key.
82
+ * - `tenant_id`: per-tenant course lookups.
83
+ */
84
+ export declare const COURSES_COLLECTION_INDEXES: {
85
+ _id: {
86
+ _id: number;
87
+ };
88
+ tenant_id: {
89
+ tenant_id: number;
90
+ };
91
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COURSES_COLLECTION_NAME = exports.CourseSchema = void 0;
3
+ exports.COURSES_COLLECTION_INDEXES = exports.COURSES_COLLECTION_NAME = exports.CourseSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const common_models_1 = require("./common-models");
6
6
  exports.CourseSchema = new mongoose_1.Schema({
@@ -53,3 +53,13 @@ exports.CourseSchema = new mongoose_1.Schema({
53
53
  minimize: false,
54
54
  });
55
55
  exports.COURSES_COLLECTION_NAME = 'courses';
56
+ /**
57
+ * Describes the indexes for `courses`. Values are Mongo key patterns that can be
58
+ * passed straight to `.hint()`.
59
+ * - `_id`: unique primary key.
60
+ * - `tenant_id`: per-tenant course lookups.
61
+ */
62
+ exports.COURSES_COLLECTION_INDEXES = {
63
+ _id: { _id: 1 }, // Unique Index
64
+ tenant_id: { tenant_id: 1 }, // per-tenant course lookups
65
+ };
@@ -54,3 +54,21 @@ export declare const CustomerRedemptionSchema: Schema<any, import("mongoose").Mo
54
54
  __v: number;
55
55
  }>;
56
56
  export declare const CUSTOMER_REDEMPTIONS_COLLECTION_NAME = "customer_redemptions";
57
+ /**
58
+ * Describes the indexes for `customer_redemptions`. Values are Mongo key patterns
59
+ * that can be passed straight to `.hint()`.
60
+ * - `_id`: unique primary key.
61
+ * - `brand_id__ref_id__customer_phone__type`: per-brand redemption lookups by
62
+ * ref_id and customer phone, scoped by redemption type.
63
+ */
64
+ export declare const CUSTOMER_REDEMPTIONS_COLLECTION_INDEXES: {
65
+ _id: {
66
+ _id: number;
67
+ };
68
+ brand_id__ref_id__customer_phone__type: {
69
+ brand_id: number;
70
+ ref_id: number;
71
+ customer_phone: number;
72
+ type: number;
73
+ };
74
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CUSTOMER_REDEMPTIONS_COLLECTION_NAME = exports.CustomerRedemptionSchema = void 0;
3
+ exports.CUSTOMER_REDEMPTIONS_COLLECTION_INDEXES = exports.CUSTOMER_REDEMPTIONS_COLLECTION_NAME = exports.CustomerRedemptionSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.CustomerRedemptionSchema = new mongoose_1.Schema({
@@ -67,3 +67,19 @@ exports.CustomerRedemptionSchema = new mongoose_1.Schema({
67
67
  minimize: false,
68
68
  });
69
69
  exports.CUSTOMER_REDEMPTIONS_COLLECTION_NAME = 'customer_redemptions';
70
+ /**
71
+ * Describes the indexes for `customer_redemptions`. Values are Mongo key patterns
72
+ * that can be passed straight to `.hint()`.
73
+ * - `_id`: unique primary key.
74
+ * - `brand_id__ref_id__customer_phone__type`: per-brand redemption lookups by
75
+ * ref_id and customer phone, scoped by redemption type.
76
+ */
77
+ exports.CUSTOMER_REDEMPTIONS_COLLECTION_INDEXES = {
78
+ _id: { _id: 1 }, // Unique Index
79
+ brand_id__ref_id__customer_phone__type: {
80
+ brand_id: 1,
81
+ ref_id: 1,
82
+ customer_phone: 1,
83
+ type: 1,
84
+ }, // per-brand redemption lookups by ref_id and customer phone, scoped by type
85
+ };
@@ -61,3 +61,41 @@ export declare const MessagingDeviceSchema: Schema<any, import("mongoose").Model
61
61
  __v: number;
62
62
  }>;
63
63
  export declare const MESSAGING_DEVICE_COLLECTION_NAME = "messaging_devices";
64
+ /**
65
+ * Describes the indexes for `messaging_devices`. Values are Mongo key patterns
66
+ * that can be passed straight to `.hint()`.
67
+ * - `_id`: unique primary key.
68
+ * - `domain__phone_number`: per-domain lookups by phone number.
69
+ * - `domain__uid__device_id`: per-domain lookups by uid and device id.
70
+ * - `domain__active__provider_id__uid__createdAt`: per-domain active devices
71
+ * by provider and uid, newest first.
72
+ * - `domain__uid__active__createdAt`: per-domain lookups by uid and active state,
73
+ * newest first.
74
+ */
75
+ export declare const MESSAGING_DEVICE_COLLECTION_INDEXES: {
76
+ _id: {
77
+ _id: number;
78
+ };
79
+ domain__phone_number: {
80
+ domain: number;
81
+ phone_number: number;
82
+ };
83
+ domain__uid__device_id: {
84
+ domain: number;
85
+ uid: number;
86
+ device_id: number;
87
+ };
88
+ domain__active__provider_id__uid__createdAt: {
89
+ domain: number;
90
+ active: number;
91
+ provider_id: number;
92
+ uid: number;
93
+ createdAt: number;
94
+ };
95
+ domain__uid__active__createdAt: {
96
+ domain: number;
97
+ uid: number;
98
+ active: number;
99
+ createdAt: number;
100
+ };
101
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MESSAGING_DEVICE_COLLECTION_NAME = exports.MessagingDeviceSchema = void 0;
3
+ exports.MESSAGING_DEVICE_COLLECTION_INDEXES = exports.MESSAGING_DEVICE_COLLECTION_NAME = exports.MessagingDeviceSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.MessagingDeviceSchema = new mongoose_1.Schema({
@@ -72,3 +72,39 @@ exports.MessagingDeviceSchema = new mongoose_1.Schema({
72
72
  minimize: false,
73
73
  });
74
74
  exports.MESSAGING_DEVICE_COLLECTION_NAME = 'messaging_devices';
75
+ /**
76
+ * Describes the indexes for `messaging_devices`. Values are Mongo key patterns
77
+ * that can be passed straight to `.hint()`.
78
+ * - `_id`: unique primary key.
79
+ * - `domain__phone_number`: per-domain lookups by phone number.
80
+ * - `domain__uid__device_id`: per-domain lookups by uid and device id.
81
+ * - `domain__active__provider_id__uid__createdAt`: per-domain active devices
82
+ * by provider and uid, newest first.
83
+ * - `domain__uid__active__createdAt`: per-domain lookups by uid and active state,
84
+ * newest first.
85
+ */
86
+ exports.MESSAGING_DEVICE_COLLECTION_INDEXES = {
87
+ _id: { _id: 1 }, // Unique Index
88
+ domain__phone_number: {
89
+ domain: 1,
90
+ phone_number: 1,
91
+ }, // per-domain lookups by phone number
92
+ domain__uid__device_id: {
93
+ domain: 1,
94
+ uid: 1,
95
+ device_id: 1,
96
+ }, // per-domain lookups by uid and device id
97
+ domain__active__provider_id__uid__createdAt: {
98
+ domain: 1,
99
+ active: 1,
100
+ provider_id: 1,
101
+ uid: 1,
102
+ createdAt: -1,
103
+ }, // per-domain active devices by provider and uid, newest first
104
+ domain__uid__active__createdAt: {
105
+ domain: 1,
106
+ uid: 1,
107
+ active: 1,
108
+ createdAt: -1,
109
+ }, // per-domain lookups by uid and active state, newest first
110
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.632",
3
+ "version": "0.2.634",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",