@managesome/eposmatic-toolkit 0.2.692 → 0.2.694

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.
@@ -0,0 +1,23 @@
1
+ import { PLATFORMS_ENUM } from '../../constants';
2
+ import { IMinifiedItemSpecialHour, IMinifiedPrice } from './catalog';
3
+ /**
4
+ * Simplified wire representation of a halfhalf setup (mirrors ISimplifiedItem).
5
+ *
6
+ * - Prices are minified (IMinifiedPrice: number | IPrice | null | undefined).
7
+ * - sold_out is a per-tenant boolean (replaces string[]).
8
+ * - Simplified halfhalf items expose only menu-list data: no segments, no
9
+ * constituent items, and no ref rules.
10
+ */
11
+ export interface ISimplifiedHalfHalfSetup {
12
+ sold_out?: boolean;
13
+ is_discount_percentage?: boolean;
14
+ discount_amount?: IMinifiedPrice;
15
+ item_special_hours?: IMinifiedItemSpecialHour[];
16
+ _id: string;
17
+ category_id: string;
18
+ name: string;
19
+ included_platforms: PLATFORMS_ENUM[];
20
+ description: string;
21
+ active: boolean;
22
+ image_url: string;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,6 +7,7 @@ export * from './dialer';
7
7
  export * from './email-templates';
8
8
  export * from './fbr-generate-invoice';
9
9
  export * from './google-maps';
10
+ export * from './halfhalf';
10
11
  export * from './hubrise_catalog';
11
12
  export * from './hubrise_customers';
12
13
  export * from './hubrise_deliveries';
@@ -21,6 +22,7 @@ export * from './pra-generate-invoice';
21
22
  export * from './report-webview';
22
23
  export * from './reports';
23
24
  export * from './smartpay-apis';
25
+ export * from './specials';
24
26
  export * from './split_bill';
25
27
  export * from './srb-generate-invoice';
26
28
  export * from './switchpay';
@@ -23,6 +23,7 @@ __exportStar(require("./dialer"), exports);
23
23
  __exportStar(require("./email-templates"), exports);
24
24
  __exportStar(require("./fbr-generate-invoice"), exports);
25
25
  __exportStar(require("./google-maps"), exports);
26
+ __exportStar(require("./halfhalf"), exports);
26
27
  __exportStar(require("./hubrise_catalog"), exports);
27
28
  __exportStar(require("./hubrise_customers"), exports);
28
29
  __exportStar(require("./hubrise_deliveries"), exports);
@@ -37,6 +38,7 @@ __exportStar(require("./pra-generate-invoice"), exports);
37
38
  __exportStar(require("./report-webview"), exports);
38
39
  __exportStar(require("./reports"), exports);
39
40
  __exportStar(require("./smartpay-apis"), exports);
41
+ __exportStar(require("./specials"), exports);
40
42
  __exportStar(require("./split_bill"), exports);
41
43
  __exportStar(require("./srb-generate-invoice"), exports);
42
44
  __exportStar(require("./switchpay"), exports);
@@ -0,0 +1,27 @@
1
+ import { PLATFORMS_ENUM } from '../../constants';
2
+ import { IMinifiedItemSpecialHour, IMinifiedPrice } from './catalog';
3
+ /**
4
+ * Simplified wire representation of a special (mirrors ISimplifiedItem).
5
+ *
6
+ * - Prices are minified (IMinifiedPrice: number | IPrice | null | undefined).
7
+ * - sold_out is a per-tenant boolean (replaces string[]).
8
+ * - Simplified specials expose only menu-list data: no modifier/selection
9
+ * structure (modifier_specials is dropped for the simplified flow).
10
+ */
11
+ export interface ISimplifiedSpecial {
12
+ sold_out?: boolean;
13
+ display_price?: number | null;
14
+ show_starting_from?: boolean;
15
+ is_discount_percentage?: boolean;
16
+ price?: IMinifiedPrice;
17
+ discount_amount?: IMinifiedPrice;
18
+ item_special_hours?: IMinifiedItemSpecialHour[];
19
+ _id: string;
20
+ category_id: string;
21
+ name: string;
22
+ included_platforms: PLATFORMS_ENUM[];
23
+ description: string;
24
+ active: boolean;
25
+ sort_id: number;
26
+ image_url: string;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -31,10 +31,19 @@ export declare function convertHalfHalfSetupToWorkableHalfHalfSetup<T extends II
31
31
  * item, priced as `(item price + upsells) / segments`), so duplicates across
32
32
  * segments are allowed and each segment must be filled exactly once.
33
33
  *
34
- * Returns null if the halfhalf setup is inactive, doesn't match platform/tenant,
35
- * or has no applicable schedule / no resolvable items.
34
+ * PURE CONVERSION ONLY — no availability filtering (active / tenants /
35
+ * included_platforms) and no special-hours / platform-based price
36
+ * resolution happens here. Setup fields are copied through as-is:
37
+ * - `item_special_hours` is preserved on the output item,
38
+ * - each option's `excluded_platforms` is derived (complement) from its
39
+ * source item's `included_platforms`, so platform availability can be
40
+ * applied by the filter layer downstream,
41
+ * - `choose_expensive_segment_price` compares segment prices by `BASE_PRICE`
42
+ * (platform-neutral) and copies the actual IPrice object through.
43
+ *
44
+ * Returns null only when no option can be resolved from the items map.
36
45
  */
37
- export declare function convertHalfHalfToItem(halfhalfSetup: IHalfHalfSetup, itemsMap: Record<string, IItem>, platform: PLATFORMS_ENUM, tenant_id: string): IItem | null;
46
+ export declare function convertHalfHalfToItem(halfhalfSetup: IHalfHalfSetup, itemsMap: Record<string, IItem>): IItem | null;
38
47
  interface IConvertHalfHalfToOrderItem {
39
48
  halfHalfItem: IWorkableHalfHalfSetup<IItem>;
40
49
  selectedHalfHalfItems: (IOrderItem | null)[];
@@ -187,32 +187,23 @@ function convertHalfHalfSetupToWorkableHalfHalfSetup(halfhalfSetups, itemsMap, p
187
187
  * item, priced as `(item price + upsells) / segments`), so duplicates across
188
188
  * segments are allowed and each segment must be filled exactly once.
189
189
  *
190
- * Returns null if the halfhalf setup is inactive, doesn't match platform/tenant,
191
- * or has no applicable schedule / no resolvable items.
190
+ * PURE CONVERSION ONLY — no availability filtering (active / tenants /
191
+ * included_platforms) and no special-hours / platform-based price
192
+ * resolution happens here. Setup fields are copied through as-is:
193
+ * - `item_special_hours` is preserved on the output item,
194
+ * - each option's `excluded_platforms` is derived (complement) from its
195
+ * source item's `included_platforms`, so platform availability can be
196
+ * applied by the filter layer downstream,
197
+ * - `choose_expensive_segment_price` compares segment prices by `BASE_PRICE`
198
+ * (platform-neutral) and copies the actual IPrice object through.
199
+ *
200
+ * Returns null only when no option can be resolved from the items map.
192
201
  */
193
- function convertHalfHalfToItem(halfhalfSetup, itemsMap, platform, tenant_id) {
194
- // ── Guard: active, tenant, platform ────────────────────────────
195
- if (!halfhalfSetup.active ||
196
- !halfhalfSetup.tenants.includes(tenant_id) ||
197
- !halfhalfSetup.included_platforms.includes(platform)) {
198
- return null;
199
- }
200
- // ── Schedule resolution ────────────────────────────────────────
201
- const applicableSchedule = (0, platform_catalog_1.findApplicableSchedule)(halfhalfSetup.item_special_hours, platform);
202
- if (applicableSchedule === false)
203
- return null;
204
- let upsell_price = halfhalfSetup.upsell_price;
205
- let discount_amount = halfhalfSetup.discount_amount;
206
- let is_discount_percentage = halfhalfSetup.is_discount_percentage;
207
- if (applicableSchedule !== true) {
208
- if (applicableSchedule.price != null)
209
- upsell_price = applicableSchedule.price;
210
- if (applicableSchedule.discount_amount != null) {
211
- discount_amount = applicableSchedule.discount_amount;
212
- // the schedule also carries the percentage flag (same as IItem)
213
- is_discount_percentage = applicableSchedule.is_discount_percentage;
214
- }
215
- }
202
+ function convertHalfHalfToItem(halfhalfSetup, itemsMap) {
203
+ // Fields are carried through as-is (no schedule resolution here).
204
+ const upsell_price = halfhalfSetup.upsell_price;
205
+ const discount_amount = halfhalfSetup.discount_amount;
206
+ const is_discount_percentage = halfhalfSetup.is_discount_percentage;
216
207
  // ── Build shared option list (segment-neutral ids) ─────────────
217
208
  const halfHalfItems = [...halfhalfSetup.items]
218
209
  // Respect excluded_refs: items whose item_id (ref) is listed are removed
@@ -230,38 +221,35 @@ function convertHalfHalfToItem(halfhalfSetup, itemsMap, platform, tenant_id) {
230
221
  const catalogItem = itemsMap[halfHalfItem.item_id];
231
222
  if (!catalogItem)
232
223
  continue;
233
- const workableItem = (0, platform_catalog_1.convertItemToWorkableItem)(catalogItem, platform, tenant_id);
234
- if (!workableItem)
235
- continue;
236
- allKeywords.push(...(workableItem.keywords ?? []));
237
- allCaveats.push(...(workableItem.caveats ?? []));
238
- allDietaryPreferences.push(...(workableItem.dietary_preferences ?? []));
224
+ allKeywords.push(...(catalogItem.keywords ?? []));
225
+ allCaveats.push(...(catalogItem.caveats ?? []));
226
+ allDietaryPreferences.push(...(catalogItem.dietary_preferences ?? []));
239
227
  optionEntries.push({
240
- workableItem,
241
- itemUpsell: halfHalfItem.upsell_price,
242
228
  catalogItem,
229
+ itemUpsell: halfHalfItem.upsell_price,
243
230
  sortId: halfHalfItem.sort_id,
244
231
  });
245
232
  }
246
233
  // choose_expensive_segment_price: copy the most expensive segment's BASE
247
234
  // price into every segment's base price (each half still keeps its own
248
- // item-level upsell).
235
+ // item-level upsell). Comparison uses BASE_PRICE (platform-neutral); the
236
+ // actual IPrice object is copied through unresolved.
249
237
  let expensiveBasePrice = null;
250
238
  if (halfhalfSetup.choose_expensive_segment_price && optionEntries.length > 0) {
251
- expensiveBasePrice = optionEntries[0].workableItem.price;
252
- let maxValue = (0, platform_catalog_1.getPriceEnum)(expensiveBasePrice, platform);
239
+ expensiveBasePrice = optionEntries[0].catalogItem.price;
240
+ let maxValue = expensiveBasePrice?.BASE_PRICE ?? 0;
253
241
  for (const entry of optionEntries) {
254
- const value = (0, platform_catalog_1.getPriceEnum)(entry.workableItem.price, platform);
242
+ const value = entry.catalogItem.price?.BASE_PRICE ?? 0;
255
243
  if (value > maxValue) {
256
244
  maxValue = value;
257
- expensiveBasePrice = entry.workableItem.price;
245
+ expensiveBasePrice = entry.catalogItem.price;
258
246
  }
259
247
  }
260
248
  }
261
249
  const baseOptions = [];
262
250
  for (const entry of optionEntries) {
263
- const { workableItem, itemUpsell, catalogItem, sortId } = entry;
264
- let optionPrice = expensiveBasePrice != null ? expensiveBasePrice : workableItem.price;
251
+ const { catalogItem, itemUpsell, sortId } = entry;
252
+ let optionPrice = expensiveBasePrice != null ? expensiveBasePrice : catalogItem.price;
265
253
  // Each half keeps its own item-level upsell. The half-half upsell is a
266
254
  // ONE-TIME addition on the item price, not merged per segment.
267
255
  if (itemUpsell != null) {
@@ -280,9 +268,14 @@ function convertHalfHalfToItem(halfhalfSetup, itemsMap, platform, tenant_id) {
280
268
  active: catalogItem.active,
281
269
  sold_out: catalogItem.sold_out,
282
270
  sort_id: sortId,
283
- excluded_platforms: [],
271
+ // Derived from the source item's included platforms (pure mapping),
272
+ // so platform availability can be applied by the filter layer downstream.
273
+ excluded_platforms: (0, platform_catalog_1.getExcludedPlatformsFromIncludedPlatforms)(catalogItem.included_platforms),
274
+ // Carry the source item's special hours so the filter layer can apply
275
+ // schedule availability (pure mapping, no resolution here).
276
+ item_modifier_option_special_hours: catalogItem.item_special_hours,
284
277
  price: optionPrice,
285
- modifiers: (0, specials_helpers_1.applyModifierSpecialRefRules)(workableItem.modifiers, halfhalfSetup.exclusive_refs, halfhalfSetup.excluded_refs),
278
+ modifiers: (0, specials_helpers_1.applyModifierSpecialRefRules)(catalogItem.modifiers, halfhalfSetup.exclusive_refs, halfhalfSetup.excluded_refs),
286
279
  });
287
280
  }
288
281
  if (baseOptions.length === 0)
@@ -336,7 +329,7 @@ function convertHalfHalfToItem(halfhalfSetup, itemsMap, platform, tenant_id) {
336
329
  keywords: Array.from(new Set(allKeywords)),
337
330
  image_url: halfhalfSetup.image_url,
338
331
  ingredients: null,
339
- item_special_hours: null, // already resolved into upsell_price / discount_amount
332
+ item_special_hours: halfhalfSetup.item_special_hours, // preserved for the availability layer
340
333
  modifiers: modifiers.length > 0 ? modifiers : null,
341
334
  is_featured: false,
342
335
  featured_sort_id: 0,
@@ -55,6 +55,8 @@ export * from './sales-comparitive-report-helpers';
55
55
  export * from './sales-overview-report-helpers';
56
56
  export * from './sales-summary-report-helpers';
57
57
  export * from './simplified-catalog';
58
+ export * from './simplified-halfhalf';
59
+ export * from './simplified-specials';
58
60
  export * from './simplified-tenant';
59
61
  export * from './specials-helpers';
60
62
  export * from './tenant-calendar-helpers';
@@ -71,6 +71,8 @@ __exportStar(require("./sales-comparitive-report-helpers"), exports);
71
71
  __exportStar(require("./sales-overview-report-helpers"), exports);
72
72
  __exportStar(require("./sales-summary-report-helpers"), exports);
73
73
  __exportStar(require("./simplified-catalog"), exports);
74
+ __exportStar(require("./simplified-halfhalf"), exports);
75
+ __exportStar(require("./simplified-specials"), exports);
74
76
  __exportStar(require("./simplified-tenant"), exports);
75
77
  __exportStar(require("./specials-helpers"), exports);
76
78
  __exportStar(require("./tenant-calendar-helpers"), exports);
@@ -5,8 +5,54 @@ import { ICatalog, ISimplifiedCatalog, ISimplifiedCatalogItem } from '../types';
5
5
  export declare function getPriceEnum(price: IPrice | null | undefined, platform: PLATFORMS_ENUM | null | undefined): number;
6
6
  export declare function areAllSchedulesExpired(special_hours: IItemSpecialHour[] | null | undefined): boolean;
7
7
  export declare function findApplicableSchedule(special_hours: IItemSpecialHour[] | null | undefined, platform: PLATFORMS_ENUM): IItemSpecialHour | boolean;
8
+ /**
9
+ * Pure mapping: converts a list of platforms an entity is INCLUDED in into the
10
+ * list of platforms it is EXCLUDED from (complement over all platforms).
11
+ * Used by convert*ToItem to surface a source item's platform membership on
12
+ * the produced options, so the platform filter layer can apply it without
13
+ * the converter itself knowing the target platform.
14
+ */
15
+ export declare function getExcludedPlatformsFromIncludedPlatforms(includedPlatforms: PLATFORMS_ENUM[]): PLATFORMS_ENUM[];
16
+ /**
17
+ * Availability predicate for entities that share the special / half-half
18
+ * availability shape (active + tenant membership + platform membership +
19
+ * an applicable special-hours schedule right now).
20
+ *
21
+ * Pure conversion functions must NOT perform these checks; availability-aware
22
+ * consumers compose this predicate with the pure converters instead.
23
+ */
24
+ export interface ISetupApplicabilityContext {
25
+ tenant_id: string;
26
+ platform: PLATFORMS_ENUM;
27
+ }
28
+ type ISetupWithAvailability = {
29
+ active: boolean;
30
+ tenants: string[];
31
+ included_platforms: PLATFORMS_ENUM[];
32
+ item_special_hours: IItemSpecialHour[] | null | undefined;
33
+ };
34
+ export declare function isSetupApplicable(setup: ISetupWithAvailability, { tenant_id, platform }: ISetupApplicabilityContext): boolean;
8
35
  export declare function getPlatformModifierOptions(options: IModifierOption[], platform: PLATFORMS_ENUM, excludeIds?: string[]): IModifierOption[];
9
36
  export declare function getPlatformModifiers(modifiers: IModifier[] | null | undefined, platform: PLATFORMS_ENUM | undefined, excludeIds?: string[]): IModifier[] | null;
10
37
  export declare function convertItemToWorkableItem<T extends IItem | ISimplifiedCatalogItem>(item: T, platform: PLATFORMS_ENUM, tenantId: string | undefined, omitSchedule?: boolean, omitSchedulePricing?: boolean): T | null;
11
38
  export declare function convertOptionToWorkableOption(option: IModifierOption, platform: PLATFORMS_ENUM): IModifierOption | null;
12
39
  export declare function convertCatalogToWorkableCatalog<T extends ICatalog | ISimplifiedCatalog>(catalogs: T[], platform: PLATFORMS_ENUM | undefined, tenantId: string | undefined): T[];
40
+ /**
41
+ * Filters a converted item's modifier groups down to the ones that have at
42
+ * least one platform-available option (reuses getPlatformModifierOptions:
43
+ * active + excluded_platforms + option schedule).
44
+ */
45
+ export declare function getPlatformAvailableModifiers(modifiers: IModifier[] | null | undefined, platform: PLATFORMS_ENUM): IModifier[];
46
+ /**
47
+ * True when the converted item has at least one selectable (platform-available)
48
+ * option anywhere. Used for half-half: a half-half is invalid/not selectable
49
+ * when none of its portion items are available for the platform.
50
+ */
51
+ export declare function hasPlatformAvailableOptions(item: IItem, platform: PLATFORMS_ENUM): boolean;
52
+ /**
53
+ * True when EVERY modifier group of the converted item has at least one
54
+ * platform-available option. Used for specials: a special is invalid/not
55
+ * selectable when any of its modifier groups ends up with zero items.
56
+ */
57
+ export declare function hasAllModifierOptionsAvailable(item: IItem, platform: PLATFORMS_ENUM): boolean;
58
+ export {};
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPriceEnum = getPriceEnum;
4
4
  exports.areAllSchedulesExpired = areAllSchedulesExpired;
5
5
  exports.findApplicableSchedule = findApplicableSchedule;
6
+ exports.getExcludedPlatformsFromIncludedPlatforms = getExcludedPlatformsFromIncludedPlatforms;
7
+ exports.isSetupApplicable = isSetupApplicable;
6
8
  exports.getPlatformModifierOptions = getPlatformModifierOptions;
7
9
  exports.getPlatformModifiers = getPlatformModifiers;
8
10
  exports.convertItemToWorkableItem = convertItemToWorkableItem;
9
11
  exports.convertOptionToWorkableOption = convertOptionToWorkableOption;
10
12
  exports.convertCatalogToWorkableCatalog = convertCatalogToWorkableCatalog;
13
+ exports.getPlatformAvailableModifiers = getPlatformAvailableModifiers;
14
+ exports.hasPlatformAvailableOptions = hasPlatformAvailableOptions;
15
+ exports.hasAllModifierOptionsAvailable = hasAllModifierOptionsAvailable;
11
16
  const constants_1 = require("../../constants");
12
17
  /* ==========================================================><==================================================== */
13
18
  function getPriceEnum(price, platform) {
@@ -99,6 +104,24 @@ function findApplicableSchedule(special_hours, platform) {
99
104
  availableSchedulesForDayAndTime.some((schedule) => !schedule.disabled_outside_date_range));
100
105
  }
101
106
  // ==========================================================><====================================================
107
+ /**
108
+ * Pure mapping: converts a list of platforms an entity is INCLUDED in into the
109
+ * list of platforms it is EXCLUDED from (complement over all platforms).
110
+ * Used by convert*ToItem to surface a source item's platform membership on
111
+ * the produced options, so the platform filter layer can apply it without
112
+ * the converter itself knowing the target platform.
113
+ */
114
+ function getExcludedPlatformsFromIncludedPlatforms(includedPlatforms) {
115
+ return Object.values(constants_1.PLATFORMS_ENUM).filter((platform) => !includedPlatforms.includes(platform));
116
+ }
117
+ function isSetupApplicable(setup, { tenant_id, platform }) {
118
+ if (!setup.active || !setup.tenants.includes(tenant_id) || !setup.included_platforms.includes(platform)) {
119
+ return false;
120
+ }
121
+ const applicableSchedule = findApplicableSchedule(setup.item_special_hours, platform);
122
+ return applicableSchedule !== false;
123
+ }
124
+ // ==========================================================><====================================================
102
125
  function getPlatformModifierOptions(options, platform, excludeIds = []) {
103
126
  const platformOptions = [];
104
127
  const optionsLength = options.length;
@@ -248,3 +271,41 @@ function convertCatalogToWorkableCatalog(catalogs, platform, tenantId) {
248
271
  return catalogItems;
249
272
  }
250
273
  // ==========================================================><====================================================
274
+ /**
275
+ * Filters a converted item's modifier groups down to the ones that have at
276
+ * least one platform-available option (reuses getPlatformModifierOptions:
277
+ * active + excluded_platforms + option schedule).
278
+ */
279
+ function getPlatformAvailableModifiers(modifiers, platform) {
280
+ if (!modifiers || modifiers.length === 0)
281
+ return [];
282
+ const availableModifiers = [];
283
+ for (let i = 0; i < modifiers.length; i++) {
284
+ const modifier = modifiers[i];
285
+ const options = getPlatformModifierOptions(modifier.options, platform);
286
+ if (options.length === 0)
287
+ continue;
288
+ availableModifiers.push({ ...modifier, options });
289
+ }
290
+ return availableModifiers;
291
+ }
292
+ /**
293
+ * True when the converted item has at least one selectable (platform-available)
294
+ * option anywhere. Used for half-half: a half-half is invalid/not selectable
295
+ * when none of its portion items are available for the platform.
296
+ */
297
+ function hasPlatformAvailableOptions(item, platform) {
298
+ return getPlatformAvailableModifiers(item.modifiers, platform).length > 0;
299
+ }
300
+ /**
301
+ * True when EVERY modifier group of the converted item has at least one
302
+ * platform-available option. Used for specials: a special is invalid/not
303
+ * selectable when any of its modifier groups ends up with zero items.
304
+ */
305
+ function hasAllModifierOptionsAvailable(item, platform) {
306
+ const modifiers = item.modifiers;
307
+ if (!modifiers || modifiers.length === 0)
308
+ return false;
309
+ return getPlatformAvailableModifiers(modifiers, platform).length === modifiers.length;
310
+ }
311
+ // ==========================================================><====================================================
@@ -0,0 +1,4 @@
1
+ import { IHalfHalfSetup } from '../../schemas';
2
+ import { ISimplifiedHalfHalfSetup } from '../types';
3
+ export declare function convertHalfHalfSetupToSimplifiedHalfHalfSetup(halfhalfSetup: IHalfHalfSetup, tenantId: string): ISimplifiedHalfHalfSetup;
4
+ export declare function convertHalfHalfSetupsToSimplifiedHalfHalfSetups(halfhalfSetups: IHalfHalfSetup[], tenantId: string): ISimplifiedHalfHalfSetup[];
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertHalfHalfSetupToSimplifiedHalfHalfSetup = convertHalfHalfSetupToSimplifiedHalfHalfSetup;
4
+ exports.convertHalfHalfSetupsToSimplifiedHalfHalfSetups = convertHalfHalfSetupsToSimplifiedHalfHalfSetups;
5
+ const minified_catalog_1 = require("./minified-catalog");
6
+ function convertHalfHalfSetupToSimplifiedHalfHalfSetup(halfhalfSetup, tenantId) {
7
+ return {
8
+ sold_out: halfhalfSetup.sold_out.includes(tenantId) || undefined,
9
+ is_discount_percentage: halfhalfSetup.is_discount_percentage || undefined,
10
+ discount_amount: (0, minified_catalog_1.convertOriginalPlatformNumToMinifiedPlatformNum)(halfhalfSetup.discount_amount),
11
+ item_special_hours: (0, minified_catalog_1.convertOriginalSpecialHoursToMinifiedSpecialHours)(halfhalfSetup.item_special_hours),
12
+ _id: halfhalfSetup._id,
13
+ category_id: halfhalfSetup.category_id,
14
+ name: halfhalfSetup.name,
15
+ description: halfhalfSetup.description,
16
+ active: halfhalfSetup.active,
17
+ image_url: halfhalfSetup.image_url,
18
+ included_platforms: halfhalfSetup.included_platforms,
19
+ };
20
+ }
21
+ function convertHalfHalfSetupsToSimplifiedHalfHalfSetups(halfhalfSetups, tenantId) {
22
+ const newHalfHalfSetups = [];
23
+ for (let i = 0; i < halfhalfSetups.length; i++) {
24
+ const halfhalfSetup = halfhalfSetups[i];
25
+ newHalfHalfSetups.push(convertHalfHalfSetupToSimplifiedHalfHalfSetup(halfhalfSetup, tenantId));
26
+ }
27
+ return newHalfHalfSetups;
28
+ }
@@ -0,0 +1,4 @@
1
+ import { ISpecial } from '../../schemas';
2
+ import { ISimplifiedSpecial } from '../types';
3
+ export declare function convertSpecialToSimplifiedSpecial(special: ISpecial, tenantId: string): ISimplifiedSpecial;
4
+ export declare function convertSpecialsToSimplifiedSpecials(specials: ISpecial[], tenantId: string): ISimplifiedSpecial[];
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertSpecialToSimplifiedSpecial = convertSpecialToSimplifiedSpecial;
4
+ exports.convertSpecialsToSimplifiedSpecials = convertSpecialsToSimplifiedSpecials;
5
+ const minified_catalog_1 = require("./minified-catalog");
6
+ function convertSpecialToSimplifiedSpecial(special, tenantId) {
7
+ return {
8
+ sold_out: special.sold_out.includes(tenantId) || undefined,
9
+ display_price: special.display_price ?? undefined,
10
+ show_starting_from: special.show_starting_from || undefined,
11
+ is_discount_percentage: special.is_discount_percentage || undefined,
12
+ price: (0, minified_catalog_1.convertOriginalPlatformNumToMinifiedPlatformNum)(special.price),
13
+ discount_amount: (0, minified_catalog_1.convertOriginalPlatformNumToMinifiedPlatformNum)(special.discount_amount),
14
+ item_special_hours: (0, minified_catalog_1.convertOriginalSpecialHoursToMinifiedSpecialHours)(special.item_special_hours),
15
+ _id: special._id,
16
+ category_id: special.category_id,
17
+ name: special.name,
18
+ description: special.description,
19
+ active: special.active,
20
+ sort_id: special.sort_id,
21
+ image_url: special.image_url,
22
+ included_platforms: special.included_platforms,
23
+ };
24
+ }
25
+ function convertSpecialsToSimplifiedSpecials(specials, tenantId) {
26
+ const newSpecials = [];
27
+ for (let i = 0; i < specials.length; i++) {
28
+ const special = specials[i];
29
+ newSpecials.push(convertSpecialToSimplifiedSpecial(special, tenantId));
30
+ }
31
+ return newSpecials;
32
+ }
@@ -74,14 +74,25 @@ export declare function deStructureSpecialOrderItem(orderItem: IOrderItem, speci
74
74
  * Each `IModifierSpecial` becomes an `IModifier` on the item, and each
75
75
  * item within a modifier special becomes an `IModifierOption`.
76
76
  *
77
+ * PURE CONVERSION ONLY — no availability filtering (active / tenants /
78
+ * included_platforms) and no special-hours / platform-based price
79
+ * resolution happens here. Setup fields are copied through as-is:
80
+ * - `item_special_hours` is preserved on the output item,
81
+ * - each option's `excluded_platforms` is derived (complement) from its
82
+ * source item's `included_platforms`, so platform availability can be
83
+ * applied by the filter layer downstream.
84
+ *
85
+ * Availability-aware consumers compose this with `isSetupApplicable(...)`
86
+ * (and `convertItemToWorkableItem(...)` / `getPlatformModifiers(...)` for
87
+ * schedule/pricing).
88
+ *
77
89
  * Pricing model (mirrors convertSpecialsToWorkableSpecials):
78
90
  * - Special-level price overrides individual item prices (options get null price).
79
91
  * - Upsell prices are merged on top.
80
92
  * - num_free_items → num_free_options (drawer handles free vs paid).
81
93
  * - Item modifiers are pre-filtered by excluded_refs / exclusive_refs.
82
94
  *
83
- * Returns null if the special is inactive, doesn't match platform/tenant,
84
- * or has no applicable schedule.
95
+ * Returns null only when no option can be resolved from the items map.
85
96
  */
86
- export declare function convertSpecialToItem(special: ISpecial, itemsMap: Record<string, IItem>, platform: PLATFORMS_ENUM, tenant_id: string): IItem | null;
97
+ export declare function convertSpecialToItem(special: ISpecial, itemsMap: Record<string, IItem>): IItem | null;
87
98
  export {};
@@ -142,6 +142,7 @@ function convertSpecialsToWorkableSpecials(specials, itemsMap, platform, tenant_
142
142
  is_discount_percentage = applicableSchedule.is_discount_percentage;
143
143
  }
144
144
  const modifierSpecials = [];
145
+ let hasEmptyGroup = false;
145
146
  for (let j = 0; j < special.modifier_specials.length; j++) {
146
147
  const modifierSpecial = special.modifier_specials[j];
147
148
  const omitItemLevelSchedule = modifierSpecial.omit_items_schedule;
@@ -168,8 +169,12 @@ function convertSpecialsToWorkableSpecials(specials, itemsMap, platform, tenant_
168
169
  workableItem.modifiers = applyModifierSpecialRefRules(workableItem.modifiers, modifierSpecial.exclusive_refs, modifierSpecial.excluded_refs);
169
170
  items.push(workableItem);
170
171
  }
171
- if (items.length === 0)
172
+ // A modifier group with zero items makes the special invalid (cannot be
173
+ // completed) — the whole special is not selectable.
174
+ if (items.length === 0) {
175
+ hasEmptyGroup = true;
172
176
  continue;
177
+ }
173
178
  modifierSpecials.push({
174
179
  _id: modifierSpecial._id,
175
180
  name: modifierSpecial.name,
@@ -180,6 +185,9 @@ function convertSpecialsToWorkableSpecials(specials, itemsMap, platform, tenant_
180
185
  items,
181
186
  });
182
187
  }
188
+ // Not selectable if any modifier group is empty (or there are no groups).
189
+ if (hasEmptyGroup || modifierSpecials.length === 0)
190
+ continue;
183
191
  const specialMenu = {
184
192
  _id: special._id,
185
193
  name: special.name,
@@ -372,35 +380,31 @@ function deStructureSpecialOrderItem(orderItem, specialItem) {
372
380
  * Each `IModifierSpecial` becomes an `IModifier` on the item, and each
373
381
  * item within a modifier special becomes an `IModifierOption`.
374
382
  *
383
+ * PURE CONVERSION ONLY — no availability filtering (active / tenants /
384
+ * included_platforms) and no special-hours / platform-based price
385
+ * resolution happens here. Setup fields are copied through as-is:
386
+ * - `item_special_hours` is preserved on the output item,
387
+ * - each option's `excluded_platforms` is derived (complement) from its
388
+ * source item's `included_platforms`, so platform availability can be
389
+ * applied by the filter layer downstream.
390
+ *
391
+ * Availability-aware consumers compose this with `isSetupApplicable(...)`
392
+ * (and `convertItemToWorkableItem(...)` / `getPlatformModifiers(...)` for
393
+ * schedule/pricing).
394
+ *
375
395
  * Pricing model (mirrors convertSpecialsToWorkableSpecials):
376
396
  * - Special-level price overrides individual item prices (options get null price).
377
397
  * - Upsell prices are merged on top.
378
398
  * - num_free_items → num_free_options (drawer handles free vs paid).
379
399
  * - Item modifiers are pre-filtered by excluded_refs / exclusive_refs.
380
400
  *
381
- * Returns null if the special is inactive, doesn't match platform/tenant,
382
- * or has no applicable schedule.
401
+ * Returns null only when no option can be resolved from the items map.
383
402
  */
384
- function convertSpecialToItem(special, itemsMap, platform, tenant_id) {
385
- // ── Guard: active, tenant, platform ────────────────────────────
386
- if (!special.active || !special.tenants.includes(tenant_id) || !special.included_platforms.includes(platform)) {
387
- return null;
388
- }
389
- // ── Schedule resolution ────────────────────────────────────────
390
- const applicableSchedule = (0, platform_catalog_1.findApplicableSchedule)(special.item_special_hours, platform);
391
- if (applicableSchedule === false)
392
- return null;
393
- let price = special.price;
394
- if (applicableSchedule !== true && applicableSchedule.price) {
395
- price = applicableSchedule.price;
396
- }
397
- let discount_amount = special.discount_amount;
398
- let is_discount_percentage = special.is_discount_percentage;
399
- if (applicableSchedule !== true && applicableSchedule.discount_amount) {
400
- discount_amount = applicableSchedule.discount_amount;
401
- // the schedule also carries the percentage flag (same as IItem)
402
- is_discount_percentage = applicableSchedule.is_discount_percentage;
403
- }
403
+ function convertSpecialToItem(special, itemsMap) {
404
+ // Fields are carried through as-is (no schedule resolution here).
405
+ const price = special.price;
406
+ const discount_amount = special.discount_amount;
407
+ const is_discount_percentage = special.is_discount_percentage;
404
408
  // ── Build modifiers from modifier_specials ─────────────────────
405
409
  const modifiers = [];
406
410
  const allKeywords = [];
@@ -408,7 +412,6 @@ function convertSpecialToItem(special, itemsMap, platform, tenant_id) {
408
412
  const allDietaryPreferences = [];
409
413
  for (let j = 0; j < special.modifier_specials.length; j++) {
410
414
  const modifierSpecial = special.modifier_specials[j];
411
- const omitItemLevelSchedule = modifierSpecial.omit_items_schedule;
412
415
  const modifierSpecialItems = [...modifierSpecial.items];
413
416
  modifierSpecialItems.sort((a, b) => a.sort_id - b.sort_id);
414
417
  const options = [];
@@ -417,24 +420,21 @@ function convertSpecialToItem(special, itemsMap, platform, tenant_id) {
417
420
  const catalogItem = itemsMap[specialItem.item_id];
418
421
  if (!catalogItem)
419
422
  continue;
420
- const workableItem = (0, platform_catalog_1.convertItemToWorkableItem)(catalogItem, platform, tenant_id, omitItemLevelSchedule, true);
421
- if (!workableItem)
422
- continue;
423
- allKeywords.push(...(workableItem.keywords ?? []));
424
- allCaveats.push(...(workableItem.caveats ?? []));
425
- allDietaryPreferences.push(...(workableItem.dietary_preferences ?? []));
423
+ allKeywords.push(...(catalogItem.keywords ?? []));
424
+ allCaveats.push(...(catalogItem.caveats ?? []));
425
+ allDietaryPreferences.push(...(catalogItem.dietary_preferences ?? []));
426
426
  // Determine option price:
427
427
  // special has its own price → options carry null price
428
428
  // (num_free_options in the drawer handles free-vs-paid)
429
429
  // no special price → use item's own price
430
430
  // upsell_price is always merged on top
431
- let optionPrice = special.price != null ? null : workableItem.price;
431
+ let optionPrice = special.price != null ? null : catalogItem.price;
432
432
  if (specialItem.upsell_price != null) {
433
433
  optionPrice = (0, platform_num_1.mergePriceObjs)(optionPrice, specialItem.upsell_price);
434
434
  }
435
- // Pre-filter the item's own modifiers using excluded_refs / exclusive_refs:
436
- // excluded_refs removes modifiers/options, exclusive_refs removes their price.
437
- const itemModifiers = applyModifierSpecialRefRules(workableItem.modifiers, modifierSpecial.exclusive_refs, modifierSpecial.excluded_refs);
435
+ // Apply the modifier-special group's ref rules to the source item's own
436
+ // modifiers (excluded_refs removes, exclusive_refs zeroes price).
437
+ const itemModifiers = applyModifierSpecialRefRules(catalogItem.modifiers, modifierSpecial.exclusive_refs, modifierSpecial.excluded_refs);
438
438
  options.push({
439
439
  // `_id` is the real item `_id` (like a catalog option id —
440
440
  // deterministic, identical across lines of the same selection);
@@ -445,13 +445,20 @@ function convertSpecialToItem(special, itemsMap, platform, tenant_id) {
445
445
  active: catalogItem.active,
446
446
  sold_out: catalogItem.sold_out,
447
447
  sort_id: specialItem.sort_id,
448
- excluded_platforms: [],
448
+ // Derived from the source item's included platforms (pure mapping),
449
+ // so platform availability can be applied by the filter layer downstream.
450
+ excluded_platforms: (0, platform_catalog_1.getExcludedPlatformsFromIncludedPlatforms)(catalogItem.included_platforms),
451
+ // Carry the source item's special hours so the filter layer can apply
452
+ // schedule availability (pure mapping, no resolution here).
453
+ item_modifier_option_special_hours: catalogItem.item_special_hours,
449
454
  price: optionPrice,
450
455
  modifiers: itemModifiers,
451
456
  });
452
457
  }
458
+ // A modifier group with zero resolvable items makes the special invalid
459
+ // (cannot be completed) — the whole conversion fails.
453
460
  if (options.length === 0)
454
- continue;
461
+ return null;
455
462
  modifiers.push({
456
463
  // `_id` is the real modifier-special `_id` (like a catalog modifier id);
457
464
  // `ref` points to the same source modifier-special.
@@ -490,7 +497,7 @@ function convertSpecialToItem(special, itemsMap, platform, tenant_id) {
490
497
  keywords: Array.from(new Set(allKeywords)),
491
498
  image_url: special.image_url,
492
499
  ingredients: null,
493
- item_special_hours: null, // already resolved into price / discount_amount
500
+ item_special_hours: special.item_special_hours, // preserved for the availability layer
494
501
  modifiers: modifiers.length > 0 ? modifiers : null,
495
502
  is_featured: false,
496
503
  featured_sort_id: 0,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constants_1 = require("../constants");
4
+ const simplified_halfhalf_1 = require("../helpers/utils/simplified-halfhalf");
5
+ const TENANT_ID = 'tenant-1';
6
+ function makeHalfHalfSetup(overrides = {}) {
7
+ return {
8
+ _id: 'halfhalf-1',
9
+ brand_id: 'brand-1',
10
+ tenants: ['tenant-1', 'tenant-2'],
11
+ category_id: 'category-1',
12
+ included_platforms: [constants_1.PLATFORMS_ENUM.POS_WALK_IN],
13
+ segments: [
14
+ { _id: 'segment-1', name: 'Half 1', sort_id: 1 },
15
+ { _id: 'segment-2', name: 'Half 2', sort_id: 2 },
16
+ ],
17
+ image_url: 'https://example.com/halfhalf.jpg',
18
+ name: 'Half & Half',
19
+ description: 'Two halves combo',
20
+ active: true,
21
+ sold_out: ['tenant-2'],
22
+ upsell_price: { BASE_PRICE: 1000 },
23
+ discount_amount: null,
24
+ is_discount_percentage: false,
25
+ choose_expensive_segment_price: true,
26
+ item_special_hours: null,
27
+ items: [{ item_id: 'item-1', sort_id: 1, upsell_price: { BASE_PRICE: 500 } }],
28
+ excluded_refs: ['item-2'],
29
+ exclusive_refs: [],
30
+ createdAt: new Date('2024-01-01'),
31
+ updatedAt: new Date('2024-01-02'),
32
+ ...overrides,
33
+ };
34
+ }
35
+ describe('convertHalfHalfSetupToSimplifiedHalfHalfSetup', () => {
36
+ it('drops full-only fields and resolves sold_out per tenant', () => {
37
+ const simplified = (0, simplified_halfhalf_1.convertHalfHalfSetupToSimplifiedHalfHalfSetup)(makeHalfHalfSetup(), TENANT_ID);
38
+ expect(simplified._id).toBe('halfhalf-1');
39
+ expect(simplified.category_id).toBe('category-1');
40
+ expect(simplified.name).toBe('Half & Half');
41
+ expect(simplified.description).toBe('Two halves combo');
42
+ expect(simplified.active).toBe(true);
43
+ expect(simplified.image_url).toBe('https://example.com/halfhalf.jpg');
44
+ expect(simplified.included_platforms).toEqual([constants_1.PLATFORMS_ENUM.POS_WALK_IN]);
45
+ // full-only fields are dropped
46
+ expect(simplified).not.toHaveProperty('brand_id');
47
+ expect(simplified).not.toHaveProperty('tenants');
48
+ expect(simplified).not.toHaveProperty('createdAt');
49
+ expect(simplified).not.toHaveProperty('updatedAt');
50
+ // sold_out resolved to boolean for the requested tenant (omitted when not sold out)
51
+ expect(simplified.sold_out).toBeUndefined();
52
+ });
53
+ it('does not expose segments, items, ref rules or upsell fields', () => {
54
+ const simplified = (0, simplified_halfhalf_1.convertHalfHalfSetupToSimplifiedHalfHalfSetup)(makeHalfHalfSetup(), TENANT_ID);
55
+ expect(simplified).not.toHaveProperty('segments');
56
+ expect(simplified).not.toHaveProperty('items');
57
+ expect(simplified).not.toHaveProperty('excluded_refs');
58
+ expect(simplified).not.toHaveProperty('exclusive_refs');
59
+ expect(simplified).not.toHaveProperty('choose_expensive_segment_price');
60
+ expect(simplified).not.toHaveProperty('upsell_price');
61
+ });
62
+ it('minifies setup prices', () => {
63
+ const simplified = (0, simplified_halfhalf_1.convertHalfHalfSetupToSimplifiedHalfHalfSetup)(makeHalfHalfSetup({
64
+ discount_amount: { BASE_PRICE: 300 },
65
+ }), TENANT_ID);
66
+ expect(simplified.discount_amount).toBe(300);
67
+ });
68
+ it('handles a halfhalf sold out for the tenant', () => {
69
+ const simplified = (0, simplified_halfhalf_1.convertHalfHalfSetupToSimplifiedHalfHalfSetup)(makeHalfHalfSetup({ sold_out: ['tenant-1'] }), TENANT_ID);
70
+ expect(simplified.sold_out).toBe(true);
71
+ });
72
+ });
73
+ describe('convertHalfHalfSetupsToSimplifiedHalfHalfSetups', () => {
74
+ it('maps every halfhalf setup', () => {
75
+ const simplifiedList = (0, simplified_halfhalf_1.convertHalfHalfSetupsToSimplifiedHalfHalfSetups)([makeHalfHalfSetup({ _id: 'hh-1' }), makeHalfHalfSetup({ _id: 'hh-2' })], TENANT_ID);
76
+ expect(simplifiedList).toHaveLength(2);
77
+ expect(simplifiedList.map((h) => h._id)).toEqual(['hh-1', 'hh-2']);
78
+ });
79
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constants_1 = require("../constants");
4
+ const simplified_specials_1 = require("../helpers/utils/simplified-specials");
5
+ const TENANT_ID = 'tenant-1';
6
+ function makeSpecial(overrides = {}) {
7
+ return {
8
+ _id: 'special-1',
9
+ brand_id: 'brand-1',
10
+ tenants: ['tenant-1', 'tenant-2'],
11
+ category_id: 'category-1',
12
+ included_platforms: [constants_1.PLATFORMS_ENUM.POS_WALK_IN],
13
+ image_url: 'https://example.com/special.jpg',
14
+ name: 'Pizza Deal',
15
+ description: 'Special combo',
16
+ active: true,
17
+ sold_out: ['tenant-2'],
18
+ sort_id: 1,
19
+ price: { BASE_PRICE: 1500 },
20
+ discount_amount: null,
21
+ is_discount_percentage: false,
22
+ display_price: 1200,
23
+ show_starting_from: true,
24
+ item_special_hours: null,
25
+ modifier_specials: [
26
+ {
27
+ _id: 'ms-1',
28
+ name: 'Choose 1',
29
+ sort_id: 1,
30
+ quantity: 1,
31
+ num_free_items: 0,
32
+ excluded_refs: [],
33
+ exclusive_refs: [],
34
+ omit_items_schedule: false,
35
+ items: [{ item_id: 'item-1', sort_id: 1, upsell_price: null }],
36
+ },
37
+ ],
38
+ createdAt: new Date('2024-01-01'),
39
+ updatedAt: new Date('2024-01-02'),
40
+ ...overrides,
41
+ };
42
+ }
43
+ describe('convertSpecialToSimplifiedSpecial', () => {
44
+ it('drops full-only fields and resolves sold_out per tenant', () => {
45
+ const simplified = (0, simplified_specials_1.convertSpecialToSimplifiedSpecial)(makeSpecial(), TENANT_ID);
46
+ expect(simplified._id).toBe('special-1');
47
+ expect(simplified.category_id).toBe('category-1');
48
+ expect(simplified.name).toBe('Pizza Deal');
49
+ expect(simplified.description).toBe('Special combo');
50
+ expect(simplified.active).toBe(true);
51
+ expect(simplified.sort_id).toBe(1);
52
+ expect(simplified.image_url).toBe('https://example.com/special.jpg');
53
+ expect(simplified.included_platforms).toEqual([constants_1.PLATFORMS_ENUM.POS_WALK_IN]);
54
+ // full-only fields are dropped
55
+ expect(simplified).not.toHaveProperty('brand_id');
56
+ expect(simplified).not.toHaveProperty('tenants');
57
+ expect(simplified).not.toHaveProperty('createdAt');
58
+ expect(simplified).not.toHaveProperty('updatedAt');
59
+ // sold_out resolved to boolean for the requested tenant (omitted when not sold out)
60
+ expect(simplified.sold_out).toBeUndefined();
61
+ });
62
+ it('does not expose modifier_specials', () => {
63
+ const simplified = (0, simplified_specials_1.convertSpecialToSimplifiedSpecial)(makeSpecial(), TENANT_ID);
64
+ expect(simplified).not.toHaveProperty('modifier_specials');
65
+ });
66
+ it('minifies price and discount_amount', () => {
67
+ const simplified = (0, simplified_specials_1.convertSpecialToSimplifiedSpecial)(makeSpecial({
68
+ price: { BASE_PRICE: 1500, [constants_1.PLATFORMS_ENUM.POS_WALK_IN]: 1500 },
69
+ discount_amount: { BASE_PRICE: 300 },
70
+ }), TENANT_ID);
71
+ expect(simplified.price).toBe(1500);
72
+ expect(simplified.discount_amount).toBe(300);
73
+ });
74
+ it('handles a special sold out for the tenant', () => {
75
+ const simplified = (0, simplified_specials_1.convertSpecialToSimplifiedSpecial)(makeSpecial({ sold_out: ['tenant-1'] }), TENANT_ID);
76
+ expect(simplified.sold_out).toBe(true);
77
+ });
78
+ });
79
+ describe('convertSpecialsToSimplifiedSpecials', () => {
80
+ it('maps every special', () => {
81
+ const simplifiedList = (0, simplified_specials_1.convertSpecialsToSimplifiedSpecials)([makeSpecial({ _id: 'special-1' }), makeSpecial({ _id: 'special-2' })], TENANT_ID);
82
+ expect(simplifiedList).toHaveLength(2);
83
+ expect(simplifiedList.map((s) => s._id)).toEqual(['special-1', 'special-2']);
84
+ });
85
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.692",
3
+ "version": "0.2.694",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",