@final-commerce/common 1.1.4-beta.4

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,144 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // pos-types/index.ts
20
+ var pos_types_exports = {};
21
+ __export(pos_types_exports, {
22
+ ActiveEntityType: () => ActiveEntityType,
23
+ EnvironmentDataKeys: () => EnvironmentDataKeys,
24
+ EnvironmentDataSubKeys: () => EnvironmentDataSubKeys,
25
+ PaymentStatus: () => PaymentStatus,
26
+ ProcessorType: () => ProcessorType
27
+ });
28
+ module.exports = __toCommonJS(pos_types_exports);
29
+
30
+ // pos-types/active/PaymentStatus.ts
31
+ var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
32
+ PaymentStatus2["FAILED"] = "failed";
33
+ PaymentStatus2["SUCCESS"] = "success";
34
+ PaymentStatus2["CANCELED"] = "canceled";
35
+ PaymentStatus2["IN_PROGRESS"] = "inProgress";
36
+ return PaymentStatus2;
37
+ })(PaymentStatus || {});
38
+
39
+ // pos-types/active/ProcessorType.ts
40
+ var ProcessorType = /* @__PURE__ */ ((ProcessorType2) => {
41
+ ProcessorType2["FINAL_PAY"] = "Terminal";
42
+ ProcessorType2["TAP_TO_PAY"] = "TapToPay";
43
+ ProcessorType2["MOTO"] = "Moto";
44
+ ProcessorType2["CLOUD"] = "Cloud";
45
+ ProcessorType2["BLUETOOTH"] = "Bluetooth";
46
+ ProcessorType2["CASH"] = "Cash";
47
+ ProcessorType2["CUSTOM_PAY"] = "CustomPay";
48
+ ProcessorType2["VENDARA"] = "Vendara";
49
+ ProcessorType2["REDEEM"] = "Redeem";
50
+ ProcessorType2["INTEGRATION"] = "Integration";
51
+ return ProcessorType2;
52
+ })(ProcessorType || {});
53
+
54
+ // pos-types/active/pos-runtime.ts
55
+ var ActiveEntityType = /* @__PURE__ */ ((ActiveEntityType2) => {
56
+ ActiveEntityType2["TAX"] = "tax";
57
+ ActiveEntityType2["CART"] = "cart";
58
+ ActiveEntityType2["USER"] = "user";
59
+ ActiveEntityType2["ORDER"] = "order";
60
+ ActiveEntityType2["PRODUCT"] = "product";
61
+ ActiveEntityType2["FULL_PRODUCT"] = "fullProduct";
62
+ ActiveEntityType2["CUSTOMER"] = "customer";
63
+ ActiveEntityType2["OUTLET"] = "outlet";
64
+ ActiveEntityType2["CHANGES"] = "changes";
65
+ ActiveEntityType2["SPLIT_PAYMENT"] = "splitPayment";
66
+ ActiveEntityType2["CALCULATED_TAX"] = "calculatedTaxDetails";
67
+ ActiveEntityType2["TIPS_DETAILS"] = "tipsDetails";
68
+ ActiveEntityType2["CASH_PAYMENT_SETTINGS"] = "cashPaymentSettings";
69
+ ActiveEntityType2["REFUND_DETAILS"] = "refundDetails";
70
+ ActiveEntityType2["COMPANY"] = "company";
71
+ ActiveEntityType2["IS_AUTHENTICATED"] = "isAuthenticated";
72
+ ActiveEntityType2["TIMER"] = "timer";
73
+ ActiveEntityType2["UPDATED_ORDER_ACTIONS"] = "updatedOrderActions";
74
+ ActiveEntityType2["BUILD"] = "activeBuild";
75
+ ActiveEntityType2["BUILD_UPDATE_INFO"] = "buildUpdateInfo";
76
+ ActiveEntityType2["GLOBAL_BLOCKS"] = "globalBlocks";
77
+ ActiveEntityType2["ACTIVE_STATION"] = "activeStation";
78
+ ActiveEntityType2["SMART_GRID"] = "smartGrid";
79
+ ActiveEntityType2["CUSTOM_SALE"] = "customSale";
80
+ ActiveEntityType2["ACTIVE_FLOW"] = "activeFlow";
81
+ ActiveEntityType2["ACTIVE_FLOW_VERSION_URL"] = "activeFlowVersionUrl";
82
+ return ActiveEntityType2;
83
+ })(ActiveEntityType || {});
84
+ var EnvironmentDataKeys = /* @__PURE__ */ ((EnvironmentDataKeys2) => {
85
+ EnvironmentDataKeys2["NETWORK_INFO"] = "Network Info";
86
+ EnvironmentDataKeys2["DISPLAY"] = "Display";
87
+ EnvironmentDataKeys2["APP_INFO"] = "App Info";
88
+ EnvironmentDataKeys2["LOCATION"] = "Location";
89
+ EnvironmentDataKeys2["DEVICE_INFO"] = "Device Info";
90
+ EnvironmentDataKeys2["SYSTEM_HEALTH"] = "System Health";
91
+ EnvironmentDataKeys2["DEVELOPER"] = "Developer";
92
+ EnvironmentDataKeys2["PERIPHERAL_DEVICES"] = "Peripheral Devices";
93
+ return EnvironmentDataKeys2;
94
+ })(EnvironmentDataKeys || {});
95
+ var EnvironmentDataSubKeys = /* @__PURE__ */ ((EnvironmentDataSubKeys2) => {
96
+ EnvironmentDataSubKeys2["DEVICE_STATUS"] = "Device Status";
97
+ EnvironmentDataSubKeys2["LAST_ONLINE_TIME"] = "Last Online Time";
98
+ EnvironmentDataSubKeys2["NETWORK_TYPE"] = "Network Type";
99
+ EnvironmentDataSubKeys2["SIGNAL_STRENGTH"] = "Signal Strength";
100
+ EnvironmentDataSubKeys2["NETWORK_NAME"] = "Network name";
101
+ EnvironmentDataSubKeys2["IP_ADDRESS"] = "IP Address";
102
+ EnvironmentDataSubKeys2["SCREEN_RESOLUTION"] = "Screen Resolution";
103
+ EnvironmentDataSubKeys2["PIXEL_RATIO"] = "Pixel Ratio";
104
+ EnvironmentDataSubKeys2["ORIENTATION"] = "Orientation";
105
+ EnvironmentDataSubKeys2["APP_VERSION"] = "App Version";
106
+ EnvironmentDataSubKeys2["BUILD_NUMBER"] = "Build Number";
107
+ EnvironmentDataSubKeys2["BUNDLE_ID"] = "Bundle ID";
108
+ EnvironmentDataSubKeys2["INSTALLED"] = "Installed";
109
+ EnvironmentDataSubKeys2["LAST_UPDATED"] = "Last Updated";
110
+ EnvironmentDataSubKeys2["LOCATION_ACCESS"] = "Location Access";
111
+ EnvironmentDataSubKeys2["CURRENT_LOCATION"] = "Current Location";
112
+ EnvironmentDataSubKeys2["MODEL"] = "Model";
113
+ EnvironmentDataSubKeys2["SYSTEM_VERSION"] = "System Version";
114
+ EnvironmentDataSubKeys2["FIRMWARE_VERSION"] = "Firmware Version";
115
+ EnvironmentDataSubKeys2["SERIAL_NUMBER"] = "Serial Number";
116
+ EnvironmentDataSubKeys2["IMEI_NUMBER"] = "IMEI Number";
117
+ EnvironmentDataSubKeys2["MAC_ADDRESS"] = "MAC Address";
118
+ EnvironmentDataSubKeys2["ACTIVATION_TIME"] = "Activation Time";
119
+ EnvironmentDataSubKeys2["TIME_ZONE"] = "Time Zone";
120
+ EnvironmentDataSubKeys2["DEVICE_LANGUAGE"] = "Device Language";
121
+ EnvironmentDataSubKeys2["TOTAL_RAM"] = "Total RAM";
122
+ EnvironmentDataSubKeys2["BATTERY_LEVEL"] = "Battery Level";
123
+ EnvironmentDataSubKeys2["BATTERY_STATUS"] = "Battery Status";
124
+ EnvironmentDataSubKeys2["LOW_POWER_MODE"] = "Low Power Mode";
125
+ EnvironmentDataSubKeys2["AVERAGE_CPU_USAGE"] = "Average CPU Usage";
126
+ EnvironmentDataSubKeys2["CPU_SPEED"] = "CPU Speed";
127
+ EnvironmentDataSubKeys2["AVAILABLE_STORAGE"] = "Available Storage";
128
+ EnvironmentDataSubKeys2["TOTAL_STORAGE"] = "Total Storage";
129
+ EnvironmentDataSubKeys2["UPTIME"] = "Uptime";
130
+ EnvironmentDataSubKeys2["FLUTTER_VERSION"] = "Flutter Version";
131
+ EnvironmentDataSubKeys2["DART_VERSION"] = "Dart Version";
132
+ EnvironmentDataSubKeys2["ENVIRONMENT"] = "Environment";
133
+ EnvironmentDataSubKeys2["CONNECTED_PRINTER"] = "Connected Printer";
134
+ return EnvironmentDataSubKeys2;
135
+ })(EnvironmentDataSubKeys || {});
136
+ // Annotate the CommonJS export names for ESM import in node:
137
+ 0 && (module.exports = {
138
+ ActiveEntityType,
139
+ EnvironmentDataKeys,
140
+ EnvironmentDataSubKeys,
141
+ PaymentStatus,
142
+ ProcessorType
143
+ });
144
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../pos-types/index.ts","../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["// @final-commerce/common/pos-types\n//\n// Public POS contract types for Final Commerce terminals — consumed by render\n// and command-frame. These mirror the public (wire) subset of data-layer's\n// Mongoose schemas (option D: manually mirrored, no data-layer dependency),\n// public-scrubbed: `_id`→`id`, `__v`/`_class`/`isDeleted` omitted, ObjectId\n// refs stringified, dates as ISO 8601 strings, secrets dropped.\n//\n// Shared primitives (CurrencyCode and the other enums, the order-state-machine\n// engine types) live elsewhere in this package — import them from\n// `@final-commerce/common` directly.\n\n// Type-level helpers (e.g. `Enrich` — builds Active* types from wire bases).\nexport type { Enrich } from './util';\n\n// Public bases for entities (BaseDocument = no companyId; BaseEntity adds it).\nexport type { BaseDocument, BaseEntity } from './base';\n\n// Embedded sub-document shapes.\nexport * from './embedded';\n\n// Entity shapes (wire).\nexport * from './entities';\n\n// Enriched (Render in-memory) `Active*` layer.\nexport * from './active';\n\n// Seam contract — the frozen station-home (HOST) ↔ pos-brain (runtime)\n// interface: selection-context snapshot + ServiceChannel message union.\nexport * from './seam';\n","export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) */\n lineNetWithFees?: number;\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,aAAU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AACf,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,uBAAoB;AA7CV,SAAAA;AAAA,GAAA;","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
@@ -0,0 +1,114 @@
1
+ // pos-types/active/PaymentStatus.ts
2
+ var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
3
+ PaymentStatus2["FAILED"] = "failed";
4
+ PaymentStatus2["SUCCESS"] = "success";
5
+ PaymentStatus2["CANCELED"] = "canceled";
6
+ PaymentStatus2["IN_PROGRESS"] = "inProgress";
7
+ return PaymentStatus2;
8
+ })(PaymentStatus || {});
9
+
10
+ // pos-types/active/ProcessorType.ts
11
+ var ProcessorType = /* @__PURE__ */ ((ProcessorType2) => {
12
+ ProcessorType2["FINAL_PAY"] = "Terminal";
13
+ ProcessorType2["TAP_TO_PAY"] = "TapToPay";
14
+ ProcessorType2["MOTO"] = "Moto";
15
+ ProcessorType2["CLOUD"] = "Cloud";
16
+ ProcessorType2["BLUETOOTH"] = "Bluetooth";
17
+ ProcessorType2["CASH"] = "Cash";
18
+ ProcessorType2["CUSTOM_PAY"] = "CustomPay";
19
+ ProcessorType2["VENDARA"] = "Vendara";
20
+ ProcessorType2["REDEEM"] = "Redeem";
21
+ ProcessorType2["INTEGRATION"] = "Integration";
22
+ return ProcessorType2;
23
+ })(ProcessorType || {});
24
+
25
+ // pos-types/active/pos-runtime.ts
26
+ var ActiveEntityType = /* @__PURE__ */ ((ActiveEntityType2) => {
27
+ ActiveEntityType2["TAX"] = "tax";
28
+ ActiveEntityType2["CART"] = "cart";
29
+ ActiveEntityType2["USER"] = "user";
30
+ ActiveEntityType2["ORDER"] = "order";
31
+ ActiveEntityType2["PRODUCT"] = "product";
32
+ ActiveEntityType2["FULL_PRODUCT"] = "fullProduct";
33
+ ActiveEntityType2["CUSTOMER"] = "customer";
34
+ ActiveEntityType2["OUTLET"] = "outlet";
35
+ ActiveEntityType2["CHANGES"] = "changes";
36
+ ActiveEntityType2["SPLIT_PAYMENT"] = "splitPayment";
37
+ ActiveEntityType2["CALCULATED_TAX"] = "calculatedTaxDetails";
38
+ ActiveEntityType2["TIPS_DETAILS"] = "tipsDetails";
39
+ ActiveEntityType2["CASH_PAYMENT_SETTINGS"] = "cashPaymentSettings";
40
+ ActiveEntityType2["REFUND_DETAILS"] = "refundDetails";
41
+ ActiveEntityType2["COMPANY"] = "company";
42
+ ActiveEntityType2["IS_AUTHENTICATED"] = "isAuthenticated";
43
+ ActiveEntityType2["TIMER"] = "timer";
44
+ ActiveEntityType2["UPDATED_ORDER_ACTIONS"] = "updatedOrderActions";
45
+ ActiveEntityType2["BUILD"] = "activeBuild";
46
+ ActiveEntityType2["BUILD_UPDATE_INFO"] = "buildUpdateInfo";
47
+ ActiveEntityType2["GLOBAL_BLOCKS"] = "globalBlocks";
48
+ ActiveEntityType2["ACTIVE_STATION"] = "activeStation";
49
+ ActiveEntityType2["SMART_GRID"] = "smartGrid";
50
+ ActiveEntityType2["CUSTOM_SALE"] = "customSale";
51
+ ActiveEntityType2["ACTIVE_FLOW"] = "activeFlow";
52
+ ActiveEntityType2["ACTIVE_FLOW_VERSION_URL"] = "activeFlowVersionUrl";
53
+ return ActiveEntityType2;
54
+ })(ActiveEntityType || {});
55
+ var EnvironmentDataKeys = /* @__PURE__ */ ((EnvironmentDataKeys2) => {
56
+ EnvironmentDataKeys2["NETWORK_INFO"] = "Network Info";
57
+ EnvironmentDataKeys2["DISPLAY"] = "Display";
58
+ EnvironmentDataKeys2["APP_INFO"] = "App Info";
59
+ EnvironmentDataKeys2["LOCATION"] = "Location";
60
+ EnvironmentDataKeys2["DEVICE_INFO"] = "Device Info";
61
+ EnvironmentDataKeys2["SYSTEM_HEALTH"] = "System Health";
62
+ EnvironmentDataKeys2["DEVELOPER"] = "Developer";
63
+ EnvironmentDataKeys2["PERIPHERAL_DEVICES"] = "Peripheral Devices";
64
+ return EnvironmentDataKeys2;
65
+ })(EnvironmentDataKeys || {});
66
+ var EnvironmentDataSubKeys = /* @__PURE__ */ ((EnvironmentDataSubKeys2) => {
67
+ EnvironmentDataSubKeys2["DEVICE_STATUS"] = "Device Status";
68
+ EnvironmentDataSubKeys2["LAST_ONLINE_TIME"] = "Last Online Time";
69
+ EnvironmentDataSubKeys2["NETWORK_TYPE"] = "Network Type";
70
+ EnvironmentDataSubKeys2["SIGNAL_STRENGTH"] = "Signal Strength";
71
+ EnvironmentDataSubKeys2["NETWORK_NAME"] = "Network name";
72
+ EnvironmentDataSubKeys2["IP_ADDRESS"] = "IP Address";
73
+ EnvironmentDataSubKeys2["SCREEN_RESOLUTION"] = "Screen Resolution";
74
+ EnvironmentDataSubKeys2["PIXEL_RATIO"] = "Pixel Ratio";
75
+ EnvironmentDataSubKeys2["ORIENTATION"] = "Orientation";
76
+ EnvironmentDataSubKeys2["APP_VERSION"] = "App Version";
77
+ EnvironmentDataSubKeys2["BUILD_NUMBER"] = "Build Number";
78
+ EnvironmentDataSubKeys2["BUNDLE_ID"] = "Bundle ID";
79
+ EnvironmentDataSubKeys2["INSTALLED"] = "Installed";
80
+ EnvironmentDataSubKeys2["LAST_UPDATED"] = "Last Updated";
81
+ EnvironmentDataSubKeys2["LOCATION_ACCESS"] = "Location Access";
82
+ EnvironmentDataSubKeys2["CURRENT_LOCATION"] = "Current Location";
83
+ EnvironmentDataSubKeys2["MODEL"] = "Model";
84
+ EnvironmentDataSubKeys2["SYSTEM_VERSION"] = "System Version";
85
+ EnvironmentDataSubKeys2["FIRMWARE_VERSION"] = "Firmware Version";
86
+ EnvironmentDataSubKeys2["SERIAL_NUMBER"] = "Serial Number";
87
+ EnvironmentDataSubKeys2["IMEI_NUMBER"] = "IMEI Number";
88
+ EnvironmentDataSubKeys2["MAC_ADDRESS"] = "MAC Address";
89
+ EnvironmentDataSubKeys2["ACTIVATION_TIME"] = "Activation Time";
90
+ EnvironmentDataSubKeys2["TIME_ZONE"] = "Time Zone";
91
+ EnvironmentDataSubKeys2["DEVICE_LANGUAGE"] = "Device Language";
92
+ EnvironmentDataSubKeys2["TOTAL_RAM"] = "Total RAM";
93
+ EnvironmentDataSubKeys2["BATTERY_LEVEL"] = "Battery Level";
94
+ EnvironmentDataSubKeys2["BATTERY_STATUS"] = "Battery Status";
95
+ EnvironmentDataSubKeys2["LOW_POWER_MODE"] = "Low Power Mode";
96
+ EnvironmentDataSubKeys2["AVERAGE_CPU_USAGE"] = "Average CPU Usage";
97
+ EnvironmentDataSubKeys2["CPU_SPEED"] = "CPU Speed";
98
+ EnvironmentDataSubKeys2["AVAILABLE_STORAGE"] = "Available Storage";
99
+ EnvironmentDataSubKeys2["TOTAL_STORAGE"] = "Total Storage";
100
+ EnvironmentDataSubKeys2["UPTIME"] = "Uptime";
101
+ EnvironmentDataSubKeys2["FLUTTER_VERSION"] = "Flutter Version";
102
+ EnvironmentDataSubKeys2["DART_VERSION"] = "Dart Version";
103
+ EnvironmentDataSubKeys2["ENVIRONMENT"] = "Environment";
104
+ EnvironmentDataSubKeys2["CONNECTED_PRINTER"] = "Connected Printer";
105
+ return EnvironmentDataSubKeys2;
106
+ })(EnvironmentDataSubKeys || {});
107
+ export {
108
+ ActiveEntityType,
109
+ EnvironmentDataKeys,
110
+ EnvironmentDataSubKeys,
111
+ PaymentStatus,
112
+ ProcessorType
113
+ };
114
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) */\n lineNetWithFees?: number;\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":";AAAO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,aAAU;AACV,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;ACEL,IAAK,gBAAL,kBAAKC,mBAAL;AACL,EAAAA,eAAA,eAAY;AACZ,EAAAA,eAAA,gBAAa;AACb,EAAAA,eAAA,UAAO;AACP,EAAAA,eAAA,WAAQ;AACR,EAAAA,eAAA,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AACL,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,sBAAmB;AACnB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,gBAAa;AAEb,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,kBAAe;AAEf,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,sBAAmB;AAEnB,EAAAA,wBAAA,WAAQ;AACR,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,sBAAmB;AACnB,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,iBAAc;AACd,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,qBAAkB;AAElB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,oBAAiB;AACjB,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,eAAY;AACZ,EAAAA,wBAAA,uBAAoB;AACpB,EAAAA,wBAAA,mBAAgB;AAChB,EAAAA,wBAAA,YAAS;AAET,EAAAA,wBAAA,qBAAkB;AAClB,EAAAA,wBAAA,kBAAe;AACf,EAAAA,wBAAA,iBAAc;AAEd,EAAAA,wBAAA,uBAAoB;AA7CV,SAAAA;AAAA,GAAA;","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
@@ -0,0 +1,30 @@
1
+ import tseslint from 'typescript-eslint';
2
+ import eslint from '@eslint/js';
3
+
4
+ export default tseslint.config(
5
+ eslint.configs.recommended,
6
+ ...tseslint.configs.recommendedTypeChecked,
7
+ {
8
+ languageOptions: {
9
+ parserOptions: {
10
+ project: true,
11
+ },
12
+ },
13
+ rules: {
14
+ // Disabled to prevent Husky gate pollution on large NestJS codebases
15
+ '@typescript-eslint/no-explicit-any': 'off',
16
+ // Error-level: unhandled promises are a real runtime risk in NestJS async contexts
17
+ '@typescript-eslint/no-floating-promises': 'error',
18
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
19
+ '@typescript-eslint/explicit-function-return-type': 'off',
20
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
21
+ '@typescript-eslint/no-unsafe-assignment': 'warn',
22
+ '@typescript-eslint/no-unsafe-member-access': 'warn',
23
+ '@typescript-eslint/no-unsafe-call': 'warn',
24
+ '@typescript-eslint/no-unsafe-return': 'warn',
25
+ },
26
+ },
27
+ {
28
+ ignores: ['dist/**', 'node_modules/**'],
29
+ },
30
+ );
@@ -0,0 +1,27 @@
1
+ import tseslint from 'typescript-eslint';
2
+ import eslint from '@eslint/js';
3
+ import reactRefresh from 'eslint-plugin-react-refresh';
4
+ import reactHooks from 'eslint-plugin-react-hooks';
5
+
6
+ export default tseslint.config(
7
+ eslint.configs.recommended,
8
+ ...tseslint.configs.recommended,
9
+ {
10
+ plugins: {
11
+ 'react-refresh': reactRefresh,
12
+ 'react-hooks': reactHooks,
13
+ },
14
+ rules: {
15
+ // Disabled to prevent Husky gate pollution across large React codebases
16
+ '@typescript-eslint/no-explicit-any': 'off',
17
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
18
+ // allowConstantExport: supports Vite HMR pattern for re-exported constants
19
+ 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
20
+ 'react-hooks/rules-of-hooks': 'error',
21
+ 'react-hooks/exhaustive-deps': 'warn',
22
+ },
23
+ },
24
+ {
25
+ ignores: ['dist/**', 'node_modules/**'],
26
+ },
27
+ );
@@ -0,0 +1,19 @@
1
+ import tseslint from 'typescript-eslint';
2
+ import eslint from '@eslint/js';
3
+
4
+ export default tseslint.config(
5
+ eslint.configs.recommended,
6
+ ...tseslint.configs.recommended,
7
+ {
8
+ rules: {
9
+ // Disabled to prevent Husky gate pollution in shared library packages
10
+ '@typescript-eslint/no-explicit-any': 'off',
11
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
12
+ '@typescript-eslint/explicit-function-return-type': 'off',
13
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
14
+ },
15
+ },
16
+ {
17
+ ignores: ['dist/**', 'node_modules/**'],
18
+ },
19
+ );
@@ -0,0 +1,4 @@
1
+ export default {
2
+ '*.{ts,tsx}': ['eslint --fix', 'prettier --write'],
3
+ '*.{json,md,yml,yaml}': ['prettier --write'],
4
+ };
package/package.json ADDED
@@ -0,0 +1,160 @@
1
+ {
2
+ "name": "@final-commerce/common",
3
+ "version": "1.1.4-beta.4",
4
+ "description": "Shared utilities, types, constants, and engineering governance configs for the Final Commerce platform.",
5
+ "homepage": "https://github.com/Final-Commerce/common#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/Final-Commerce/common/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Final-Commerce/common.git"
12
+ },
13
+ "author": "Final-Commerce",
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "engines": {
18
+ "node": ">=22.0.0"
19
+ },
20
+ "main": "./dist/index.js",
21
+ "module": "./dist/index.mjs",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "import": {
26
+ "types": "./dist/index.d.mts",
27
+ "default": "./dist/index.mjs"
28
+ },
29
+ "require": {
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.js"
32
+ }
33
+ },
34
+ "./pos-types": {
35
+ "import": {
36
+ "types": "./dist/pos-types/index.d.mts",
37
+ "default": "./dist/pos-types/index.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./dist/pos-types/index.d.ts",
41
+ "default": "./dist/pos-types/index.js"
42
+ }
43
+ },
44
+ "./dist": {
45
+ "import": {
46
+ "types": "./dist/index.d.mts",
47
+ "default": "./dist/index.mjs"
48
+ },
49
+ "require": {
50
+ "types": "./dist/index.d.ts",
51
+ "default": "./dist/index.js"
52
+ }
53
+ },
54
+ "./dist/*": {
55
+ "types": "./dist/*.d.ts",
56
+ "require": "./dist/*.js",
57
+ "import": "./dist/*.mjs"
58
+ },
59
+ "./prettier": "./prettier/index.json",
60
+ "./typescript/base": "./typescript/base.json",
61
+ "./typescript/backend-nestjs": "./typescript/backend-nestjs.json",
62
+ "./typescript/frontend-react": "./typescript/frontend-react.json",
63
+ "./typescript/library": "./typescript/library.json",
64
+ "./eslint/backend-nestjs": "./eslint/backend-nestjs.mjs",
65
+ "./eslint/frontend-react": "./eslint/frontend-react.mjs",
66
+ "./eslint/library": "./eslint/library.mjs",
67
+ "./vitest/backend": "./vitest/backend.ts",
68
+ "./vitest/frontend": "./vitest/frontend.ts",
69
+ "./vitest/library": "./vitest/library.ts",
70
+ "./commitlint": "./commitlint/index.mjs",
71
+ "./lint-staged": "./lint-staged/index.mjs"
72
+ },
73
+ "bin": {
74
+ "gate-start": "./bin/gate-start.mjs",
75
+ "gate-save": "./bin/gate-save.mjs",
76
+ "gate-done": "./bin/gate-done.mjs",
77
+ "gate-setup": "./bin/gate-setup.mjs",
78
+ "gate-i18n-sync": "./bin/gate-i18n-sync.mjs"
79
+ },
80
+ "files": [
81
+ "dist/**/*",
82
+ "prettier",
83
+ "typescript",
84
+ "eslint",
85
+ "vitest",
86
+ "commitlint",
87
+ "lint-staged",
88
+ "bin"
89
+ ],
90
+ "scripts": {
91
+ "build": "tsup",
92
+ "dev": "tsup --watch",
93
+ "postinstall": "node ./bin/gate-setup.mjs",
94
+ "test": "vitest",
95
+ "test:run": "vitest run",
96
+ "test:ui": "vitest --ui",
97
+ "test:coverage": "vitest run --coverage",
98
+ "prepublishOnly": "npm run build",
99
+ "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
100
+ "prepare": "husky"
101
+ },
102
+ "lint-staged": {
103
+ "*.{ts,mjs,cjs}": [
104
+ "eslint --fix",
105
+ "prettier --write"
106
+ ],
107
+ "*.{json,md,yml,yaml}": [
108
+ "prettier --write"
109
+ ]
110
+ },
111
+ "devDependencies": {
112
+ "@commitlint/cli": "^21.0.1",
113
+ "@commitlint/config-conventional": "^21.0.1",
114
+ "@eslint/js": "^10.0.1",
115
+ "@modelcontextprotocol/sdk": "^1.29.0",
116
+ "@typescript-eslint/eslint-plugin": "^8.59.4",
117
+ "@typescript-eslint/parser": "^8.59.4",
118
+ "@vitest/coverage-v8": "^4.0.10",
119
+ "@vitest/ui": "^4.0.10",
120
+ "eslint": "^10.4.0",
121
+ "eslint-config-prettier": "^10.1.8",
122
+ "globals": "^17.6.0",
123
+ "husky": "^9.1.7",
124
+ "lint-staged": "^17.0.5",
125
+ "prettier": "^3.8.1",
126
+ "tsup": "^8.5.1",
127
+ "typescript": "^5.9.3",
128
+ "typescript-eslint": "^8.60.0",
129
+ "vitest": "^4.0.10"
130
+ },
131
+ "peerDependencies": {
132
+ "@commitlint/cli": "^19.0.0",
133
+ "@commitlint/config-conventional": "^19.0.0",
134
+ "@eslint/js": "^9.0.0",
135
+ "@vitejs/plugin-react": "^4.0.0",
136
+ "eslint": "^9.0.0",
137
+ "eslint-plugin-react-hooks": "^5.0.0 || ^7.0.0",
138
+ "eslint-plugin-react-refresh": "^0.4.0",
139
+ "typescript-eslint": "^8.0.0",
140
+ "vitest": "^4.0.0"
141
+ },
142
+ "peerDependenciesMeta": {
143
+ "@commitlint/cli": {
144
+ "optional": true
145
+ },
146
+ "@commitlint/config-conventional": {
147
+ "optional": true
148
+ },
149
+ "@vitejs/plugin-react": {
150
+ "optional": true
151
+ },
152
+ "eslint-plugin-react-hooks": {
153
+ "optional": true
154
+ },
155
+ "eslint-plugin-react-refresh": {
156
+ "optional": true
157
+ }
158
+ },
159
+ "prettier": "@final-commerce/common/prettier"
160
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "semi": true,
3
+ "bracketSpacing": true,
4
+ "singleQuote": true,
5
+ "tabWidth": 2,
6
+ "trailingComma": "all",
7
+ "printWidth": 120,
8
+ "arrowParens": "always",
9
+ "endOfLine": "auto"
10
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "@final-commerce/common/typescript/base",
4
+ "compilerOptions": {
5
+ "module": "CommonJS",
6
+ "moduleResolution": "node",
7
+ "emitDecoratorMetadata": true,
8
+ "experimentalDecorators": true,
9
+ "lib": ["ES2020"],
10
+ "outDir": "dist",
11
+ "rootDir": "src"
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ES2020",
5
+ "strict": true,
6
+ "skipLibCheck": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "esModuleInterop": true,
9
+ "allowSyntheticDefaultImports": true,
10
+ "noFallthroughCasesInSwitch": true,
11
+ "sourceMap": true
12
+ }
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "@final-commerce/common/typescript/base",
4
+ "compilerOptions": {
5
+ "target": "ES2020",
6
+ "module": "ESNext",
7
+ "moduleResolution": "bundler",
8
+ "jsx": "react-jsx",
9
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
10
+ "noEmit": true,
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true
14
+ }
15
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "@final-commerce/common/typescript/base",
4
+ "compilerOptions": {
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "declaration": true,
8
+ "declarationMap": true,
9
+ "outDir": "dist",
10
+ "rootDir": "src"
11
+ }
12
+ }