@pisell/pisellos 2.3.38 → 2.3.40

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.
Files changed (229) hide show
  1. package/dist/core/index.d.ts +0 -2
  2. package/dist/core/index.js +0 -7
  3. package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -4
  4. package/dist/model/strategy/adapter/promotion/adapter.js +0 -23
  5. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
  6. package/dist/model/strategy/adapter/promotion/evaluator.js +6 -279
  7. package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -86
  8. package/dist/model/strategy/adapter/promotion/examples.js +0 -99
  9. package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
  10. package/dist/model/strategy/adapter/promotion/type.d.ts +2 -90
  11. package/dist/model/strategy/adapter/promotion/type.js +0 -45
  12. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -5
  13. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +3 -6
  14. package/dist/modules/Discount/index.d.ts +1 -0
  15. package/dist/modules/Discount/index.js +40 -11
  16. package/dist/modules/Discount/types.d.ts +1 -0
  17. package/dist/modules/Holder/index.d.ts +48 -0
  18. package/dist/modules/Holder/index.js +640 -0
  19. package/dist/modules/Holder/types.d.ts +123 -0
  20. package/dist/modules/Holder/types.js +1 -0
  21. package/dist/modules/Holder/utils.d.ts +13 -0
  22. package/dist/modules/Holder/utils.js +34 -0
  23. package/dist/modules/OpenData/index.d.ts +0 -2
  24. package/dist/modules/OpenData/index.js +2 -10
  25. package/dist/modules/Order/index.d.ts +11 -28
  26. package/dist/modules/Order/index.js +509 -750
  27. package/dist/modules/Order/types.d.ts +10 -33
  28. package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
  29. package/dist/modules/Order/utils.d.ts +10 -0
  30. package/dist/modules/Order/utils.js +41 -13
  31. package/dist/modules/Payment/index.d.ts +0 -2
  32. package/dist/modules/Payment/index.js +50 -79
  33. package/dist/modules/Payment/types.d.ts +28 -99
  34. package/dist/modules/Payment/types.js +3 -20
  35. package/dist/modules/Payment/walletpass.d.ts +1 -25
  36. package/dist/modules/Payment/walletpass.js +157 -707
  37. package/dist/modules/Product/types.d.ts +1 -0
  38. package/dist/modules/ProductList/index.js +33 -14
  39. package/dist/modules/Quotation/index.d.ts +1 -1
  40. package/dist/modules/Quotation/index.js +2 -2
  41. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  42. package/dist/modules/ResourcePlanner/index.js +181 -0
  43. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  44. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  45. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  46. package/dist/modules/ResourcePlanner/types.js +1 -0
  47. package/dist/modules/Rules/index.d.ts +0 -1
  48. package/dist/modules/Rules/index.js +96 -89
  49. package/dist/modules/SalesSummary/index.js +12 -13
  50. package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
  51. package/dist/modules/ScanOrderLogger/index.js +15 -2
  52. package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
  53. package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
  54. package/dist/modules/Schedule/index.d.ts +3 -1
  55. package/dist/modules/Schedule/index.js +21 -16
  56. package/dist/modules/Summary/utils.js +38 -13
  57. package/dist/modules/index.d.ts +2 -0
  58. package/dist/modules/index.js +3 -1
  59. package/dist/plugins/window.d.ts +1 -0
  60. package/dist/server/index.d.ts +14 -16
  61. package/dist/server/index.js +1148 -1930
  62. package/dist/server/modules/order/index.d.ts +4 -54
  63. package/dist/server/modules/order/index.js +695 -1595
  64. package/dist/server/modules/order/types.d.ts +3 -11
  65. package/dist/server/modules/order/types.js +1 -1
  66. package/dist/solution/BaseSales/index.d.ts +20 -109
  67. package/dist/solution/BaseSales/index.js +481 -1797
  68. package/dist/solution/BaseSales/types.d.ts +0 -52
  69. package/dist/solution/BaseSales/types.js +1 -2
  70. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
  71. package/dist/solution/BaseSales/utils/cartPromotion.js +31 -90
  72. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  73. package/dist/solution/BookingByStep/index.d.ts +17 -2
  74. package/dist/solution/BookingByStep/index.js +294 -215
  75. package/dist/solution/BookingByStep/types.d.ts +2 -1
  76. package/dist/solution/BookingByStep/types.js +3 -1
  77. package/dist/solution/BookingByStep/utils/capacity.js +17 -1
  78. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  79. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  80. package/dist/solution/BookingTicket/index.d.ts +4 -8
  81. package/dist/solution/BookingTicket/index.js +51 -134
  82. package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -6
  83. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
  84. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +82 -172
  85. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  86. package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
  87. package/dist/solution/Sales/index.d.ts +0 -1
  88. package/dist/solution/Sales/index.js +2 -10
  89. package/dist/solution/ScanOrder/index.d.ts +26 -14
  90. package/dist/solution/ScanOrder/index.js +1148 -756
  91. package/dist/solution/ScanOrder/types.d.ts +21 -1
  92. package/dist/solution/ScanOrder/utils.d.ts +8 -0
  93. package/dist/solution/ScanOrder/utils.js +66 -25
  94. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  95. package/dist/solution/ShopDiscount/index.js +125 -87
  96. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  97. package/dist/solution/UnifiedBookingSales/index.js +1871 -0
  98. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  99. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  100. package/dist/solution/VenueBooking/index.d.ts +39 -11
  101. package/dist/solution/VenueBooking/index.js +1176 -860
  102. package/dist/solution/VenueBooking/types.d.ts +3 -0
  103. package/dist/solution/VenueBooking/utils/resource.js +1 -0
  104. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  105. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
  106. package/dist/solution/index.d.ts +1 -0
  107. package/dist/solution/index.js +2 -1
  108. package/dist/types/index.d.ts +1 -1
  109. package/lib/core/index.d.ts +0 -2
  110. package/lib/core/index.js +0 -4
  111. package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -4
  112. package/lib/model/strategy/adapter/promotion/adapter.js +0 -20
  113. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
  114. package/lib/model/strategy/adapter/promotion/evaluator.js +0 -235
  115. package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -86
  116. package/lib/model/strategy/adapter/promotion/examples.js +0 -91
  117. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  118. package/lib/model/strategy/adapter/promotion/index.js +0 -2
  119. package/lib/model/strategy/adapter/promotion/type.d.ts +2 -90
  120. package/lib/model/strategy/adapter/promotion/type.js +0 -2
  121. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +1 -2
  122. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +1 -2
  123. package/lib/modules/Discount/index.d.ts +1 -0
  124. package/lib/modules/Discount/index.js +9 -0
  125. package/lib/modules/Discount/types.d.ts +1 -0
  126. package/lib/modules/Holder/index.d.ts +48 -0
  127. package/lib/modules/Holder/index.js +402 -0
  128. package/lib/modules/Holder/types.d.ts +123 -0
  129. package/lib/modules/Holder/types.js +17 -0
  130. package/lib/modules/Holder/utils.d.ts +13 -0
  131. package/lib/modules/Holder/utils.js +71 -0
  132. package/lib/modules/OpenData/index.d.ts +0 -2
  133. package/lib/modules/OpenData/index.js +1 -6
  134. package/lib/modules/Order/index.d.ts +11 -28
  135. package/lib/modules/Order/index.js +86 -196
  136. package/lib/modules/Order/types.d.ts +10 -33
  137. package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
  138. package/lib/modules/Order/utils.d.ts +10 -0
  139. package/lib/modules/Order/utils.js +40 -16
  140. package/lib/modules/Payment/index.d.ts +0 -2
  141. package/lib/modules/Payment/index.js +13 -34
  142. package/lib/modules/Payment/types.d.ts +28 -99
  143. package/lib/modules/Payment/types.js +3 -4
  144. package/lib/modules/Payment/walletpass.d.ts +1 -25
  145. package/lib/modules/Payment/walletpass.js +21 -470
  146. package/lib/modules/Product/types.d.ts +1 -0
  147. package/lib/modules/ProductList/index.js +40 -31
  148. package/lib/modules/Quotation/index.d.ts +1 -1
  149. package/lib/modules/Quotation/index.js +2 -2
  150. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  151. package/lib/modules/ResourcePlanner/index.js +148 -0
  152. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  153. package/lib/modules/ResourcePlanner/planner.js +933 -0
  154. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  155. package/lib/modules/ResourcePlanner/types.js +17 -0
  156. package/lib/modules/Rules/index.d.ts +0 -1
  157. package/lib/modules/Rules/index.js +40 -47
  158. package/lib/modules/SalesSummary/index.js +6 -7
  159. package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
  160. package/lib/modules/ScanOrderLogger/index.js +13 -1
  161. package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
  162. package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
  163. package/lib/modules/Schedule/index.d.ts +3 -1
  164. package/lib/modules/Schedule/index.js +10 -8
  165. package/lib/modules/Summary/utils.js +21 -1
  166. package/lib/modules/index.d.ts +2 -0
  167. package/lib/modules/index.js +5 -1
  168. package/lib/plugins/window.d.ts +1 -0
  169. package/lib/server/index.d.ts +14 -16
  170. package/lib/server/index.js +83 -675
  171. package/lib/server/modules/order/index.d.ts +4 -54
  172. package/lib/server/modules/order/index.js +66 -679
  173. package/lib/server/modules/order/types.d.ts +3 -11
  174. package/lib/solution/BaseSales/index.d.ts +20 -109
  175. package/lib/solution/BaseSales/index.js +70 -881
  176. package/lib/solution/BaseSales/types.d.ts +0 -52
  177. package/lib/solution/BaseSales/types.js +1 -2
  178. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
  179. package/lib/solution/BaseSales/utils/cartPromotion.js +12 -63
  180. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  181. package/lib/solution/BookingByStep/index.d.ts +17 -2
  182. package/lib/solution/BookingByStep/index.js +60 -18
  183. package/lib/solution/BookingByStep/types.d.ts +2 -1
  184. package/lib/solution/BookingByStep/types.js +5 -0
  185. package/lib/solution/BookingByStep/utils/capacity.js +20 -1
  186. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  187. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  188. package/lib/solution/BookingTicket/index.d.ts +4 -8
  189. package/lib/solution/BookingTicket/index.js +19 -64
  190. package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -4
  191. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
  192. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +4 -36
  193. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  194. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  195. package/lib/solution/Sales/index.d.ts +0 -1
  196. package/lib/solution/Sales/index.js +3 -5
  197. package/lib/solution/ScanOrder/index.d.ts +26 -14
  198. package/lib/solution/ScanOrder/index.js +449 -190
  199. package/lib/solution/ScanOrder/types.d.ts +21 -1
  200. package/lib/solution/ScanOrder/utils.d.ts +8 -0
  201. package/lib/solution/ScanOrder/utils.js +31 -0
  202. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  203. package/lib/solution/ShopDiscount/index.js +14 -0
  204. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  205. package/lib/solution/UnifiedBookingSales/index.js +1076 -0
  206. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  207. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  208. package/lib/solution/VenueBooking/index.d.ts +39 -11
  209. package/lib/solution/VenueBooking/index.js +328 -123
  210. package/lib/solution/VenueBooking/types.d.ts +3 -0
  211. package/lib/solution/VenueBooking/utils/resource.js +1 -0
  212. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  213. package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
  214. package/lib/solution/index.d.ts +1 -0
  215. package/lib/solution/index.js +3 -1
  216. package/lib/types/index.d.ts +1 -1
  217. package/package.json +1 -1
  218. package/dist/modules/Order/payment-utils.d.ts +0 -26
  219. package/dist/modules/Order/payment-utils.js +0 -225
  220. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  221. package/dist/solution/BookingTicket/utils/weighingProductSku.js +0 -45
  222. package/dist/utils/payment-number.d.ts +0 -9
  223. package/dist/utils/payment-number.js +0 -69
  224. package/lib/modules/Order/payment-utils.d.ts +0 -26
  225. package/lib/modules/Order/payment-utils.js +0 -224
  226. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  227. package/lib/solution/BookingTicket/utils/weighingProductSku.js +0 -63
  228. package/lib/utils/payment-number.d.ts +0 -9
  229. package/lib/utils/payment-number.js +0 -64
@@ -0,0 +1,24 @@
1
+ import { BaseModule } from '../BaseModule';
2
+ import type { Module, ModuleOptions, PisellCore } from '../../types';
3
+ import type { ResourcePlannerAssignmentResult, ResourcePlannerAssignableSlotResult, ResourcePlannerContextInput, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerSelectionPatch, ResourcePlannerSnapshot, ResourcePlannerValidationResult } from './types';
4
+ export * from './types';
5
+ export * from './planner';
6
+ export declare enum ResourcePlannerHooks {
7
+ onContextChanged = "resourcePlanner:onContextChanged",
8
+ onSelectionChanged = "resourcePlanner:onSelectionChanged",
9
+ onProjectionChanged = "resourcePlanner:onProjectionChanged"
10
+ }
11
+ export declare class ResourcePlannerModule extends BaseModule implements Module {
12
+ protected defaultName: string;
13
+ protected defaultVersion: string;
14
+ private store;
15
+ initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
16
+ setContext(input: ResourcePlannerContextInput): ResourcePlannerSnapshot;
17
+ mergeContext(input: ResourcePlannerContextInput): ResourcePlannerSnapshot;
18
+ setSelectionPatch(patch: ResourcePlannerSelectionPatch): ResourcePlannerSnapshot;
19
+ queryAvailability(query?: ResourcePlannerQuery): ResourcePlannerProjection;
20
+ autoAssign(query?: ResourcePlannerQuery): ResourcePlannerAssignmentResult;
21
+ resolveAssignableSlots(query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
22
+ validateSelection(): ResourcePlannerValidationResult;
23
+ getSnapshot(): ResourcePlannerSnapshot;
24
+ }
@@ -0,0 +1,148 @@
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/modules/ResourcePlanner/index.ts
21
+ var ResourcePlanner_exports = {};
22
+ __export(ResourcePlanner_exports, {
23
+ ResourcePlannerHooks: () => ResourcePlannerHooks,
24
+ ResourcePlannerModule: () => ResourcePlannerModule
25
+ });
26
+ module.exports = __toCommonJS(ResourcePlanner_exports);
27
+ var import_BaseModule = require("../BaseModule");
28
+ var import_planner = require("./planner");
29
+ __reExport(ResourcePlanner_exports, require("./types"), module.exports);
30
+ __reExport(ResourcePlanner_exports, require("./planner"), module.exports);
31
+ var ResourcePlannerHooks = /* @__PURE__ */ ((ResourcePlannerHooks2) => {
32
+ ResourcePlannerHooks2["onContextChanged"] = "resourcePlanner:onContextChanged";
33
+ ResourcePlannerHooks2["onSelectionChanged"] = "resourcePlanner:onSelectionChanged";
34
+ ResourcePlannerHooks2["onProjectionChanged"] = "resourcePlanner:onProjectionChanged";
35
+ return ResourcePlannerHooks2;
36
+ })(ResourcePlannerHooks || {});
37
+ var ResourcePlannerModule = class extends import_BaseModule.BaseModule {
38
+ constructor() {
39
+ super(...arguments);
40
+ this.defaultName = "resourcePlanner";
41
+ this.defaultVersion = "1.0.0";
42
+ }
43
+ async initialize(core, options) {
44
+ this.core = core;
45
+ const initialState = options.initialState;
46
+ this.store = {
47
+ context: (0, import_planner.normalizePlannerContext)((initialState == null ? void 0 : initialState.context) || import_planner.DEFAULT_RESOURCE_PLANNER_CONTEXT),
48
+ selection: (initialState == null ? void 0 : initialState.selection) || { ...import_planner.DEFAULT_RESOURCE_PLANNER_SELECTION },
49
+ projection: (initialState == null ? void 0 : initialState.projection) || null,
50
+ version: (initialState == null ? void 0 : initialState.version) || 0
51
+ };
52
+ }
53
+ setContext(input) {
54
+ this.store.context = (0, import_planner.normalizePlannerContext)(input);
55
+ this.store.version += 1;
56
+ this.store.projection = null;
57
+ const snapshot = this.getSnapshot();
58
+ void this.core.effects.emit(`${this.name}:contextChanged`, snapshot);
59
+ return snapshot;
60
+ }
61
+ mergeContext(input) {
62
+ return this.setContext({
63
+ ...this.store.context,
64
+ ...input,
65
+ products: input.products || this.store.context.products,
66
+ resources: input.resources || this.store.context.resources,
67
+ externalEvents: input.externalEvents || this.store.context.externalEvents
68
+ });
69
+ }
70
+ setSelectionPatch(patch) {
71
+ const assignments = patch.assignments ? patch.replaceAssignments === false ? [...this.store.selection.assignments, ...patch.assignments] : patch.assignments : this.store.selection.assignments;
72
+ this.store.selection = {
73
+ ...this.store.selection,
74
+ ...patch,
75
+ productIds: patch.productIds || this.store.selection.productIds,
76
+ resourceIds: patch.resourceIds || this.store.selection.resourceIds,
77
+ assignments
78
+ };
79
+ this.store.version += 1;
80
+ const snapshot = this.getSnapshot();
81
+ void this.core.effects.emit(`${this.name}:selectionChanged`, snapshot);
82
+ return snapshot;
83
+ }
84
+ queryAvailability(query = {}) {
85
+ const mergedQuery = {
86
+ mode: this.store.selection.mode,
87
+ productIds: this.store.selection.productIds,
88
+ date: this.store.selection.date,
89
+ startTime: this.store.selection.startTime,
90
+ endTime: this.store.selection.endTime,
91
+ resourceIds: this.store.selection.resourceIds,
92
+ ...query
93
+ };
94
+ const projection = (0, import_planner.queryPlannerAvailability)(this.store.context, mergedQuery);
95
+ this.store.projection = projection;
96
+ this.store.version += 1;
97
+ void this.core.effects.emit(`${this.name}:projectionChanged`, this.getSnapshot());
98
+ return projection;
99
+ }
100
+ autoAssign(query = {}) {
101
+ const result = (0, import_planner.autoAssignResources)(this.store.context, {
102
+ mode: this.store.selection.mode,
103
+ productIds: this.store.selection.productIds,
104
+ date: this.store.selection.date,
105
+ startTime: this.store.selection.startTime,
106
+ endTime: this.store.selection.endTime,
107
+ resourceIds: this.store.selection.resourceIds,
108
+ ...query
109
+ });
110
+ const resourceIds = Array.from(new Map(
111
+ result.assignments.map((assignment) => [String(assignment.resourceId), assignment.resourceId])
112
+ ).values());
113
+ this.setSelectionPatch({
114
+ assignments: result.assignments,
115
+ ...resourceIds.length ? { resourceIds } : {}
116
+ });
117
+ return result;
118
+ }
119
+ resolveAssignableSlots(query = {}) {
120
+ return (0, import_planner.resolveAssignableSlots)(this.store.context, {
121
+ mode: this.store.selection.mode,
122
+ productIds: this.store.selection.productIds,
123
+ date: this.store.selection.date,
124
+ startTime: this.store.selection.startTime,
125
+ endTime: this.store.selection.endTime,
126
+ resourceIds: this.store.selection.resourceIds,
127
+ ...query
128
+ });
129
+ }
130
+ validateSelection() {
131
+ return (0, import_planner.validateAssignments)(this.store.context, this.store.selection);
132
+ }
133
+ getSnapshot() {
134
+ return {
135
+ context: this.store.context,
136
+ selection: this.store.selection,
137
+ projection: this.store.projection,
138
+ version: this.store.version
139
+ };
140
+ }
141
+ };
142
+ // Annotate the CommonJS export names for ESM import in node:
143
+ 0 && (module.exports = {
144
+ ResourcePlannerHooks,
145
+ ResourcePlannerModule,
146
+ ...require("./types"),
147
+ ...require("./planner")
148
+ });
@@ -0,0 +1,14 @@
1
+ import type { ResourcePlannerAssignmentResult, ResourcePlannerAssignableSlotResult, ResourcePlannerAvailabilityCell, ResourcePlannerContextInput, ResourcePlannerDemandInterval, ResourcePlannerProduct, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerResource, ResourcePlannerSelection, ResourcePlannerValidationResult } from './types';
2
+ export declare const DEFAULT_RESOURCE_PLANNER_CONTEXT: Required<ResourcePlannerContextInput>;
3
+ export declare const DEFAULT_RESOURCE_PLANNER_SELECTION: ResourcePlannerSelection;
4
+ export declare function normalizePlannerContext(input?: ResourcePlannerContextInput): Required<ResourcePlannerContextInput>;
5
+ export declare function buildDemandIntervals(products: ResourcePlannerProduct[], query: ResourcePlannerQuery, context?: Required<ResourcePlannerContextInput>): ResourcePlannerDemandInterval[];
6
+ export declare function evaluateResourceForInterval(params: {
7
+ resource: ResourcePlannerResource;
8
+ interval: ResourcePlannerDemandInterval;
9
+ context: Required<ResourcePlannerContextInput>;
10
+ }): ResourcePlannerAvailabilityCell;
11
+ export declare function queryPlannerAvailability(contextInput: ResourcePlannerContextInput, query?: ResourcePlannerQuery): ResourcePlannerProjection;
12
+ export declare function resolveAssignableSlots(contextInput: ResourcePlannerContextInput, query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
13
+ export declare function autoAssignResources(contextInput: ResourcePlannerContextInput, query?: ResourcePlannerQuery): ResourcePlannerAssignmentResult;
14
+ export declare function validateAssignments(contextInput: ResourcePlannerContextInput, selection: ResourcePlannerSelection): ResourcePlannerValidationResult;