@feedmepos/mf-inventory-portal 1.8.0-dev.19 → 1.8.0-dev.20
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.
- package/dist/{App-BXDscpMf.js → App-5GYyCfFq.js} +9 -9
- package/dist/{ApprovalView-CbP2H_8q.js → ApprovalView-DY1ayl1W.js} +9 -9
- package/dist/{BindingsDialog-C7OFDUAr.js → BindingsDialog-Dm7uKMfV.js} +2 -2
- package/dist/{BindingsPicker-BQjHQWPl.js → BindingsPicker-DhnMlj4x.js} +2 -2
- package/dist/{BindingsTable-grJZdI5F.js → BindingsTable-Cxibcjka.js} +4 -4
- package/dist/{BulkReceiveRequestPage-jZtPq5XF.js → BulkReceiveRequestPage-w4AA6BxB.js} +21 -21
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DOgwkHnO.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B3ESPbQp.js} +1 -1
- package/dist/{ClosingDraftView-UmNAyX_s.js → ClosingDraftView-DMaONEZ7.js} +19 -19
- package/dist/{ClosingHistoryView-CZcOYK98.js → ClosingHistoryView-BBYruOux.js} +7 -7
- package/dist/{ClosingTemplateView-CP2-ib2S.js → ClosingTemplateView-DcwgokRl.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DYZjiuAH.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-a72IldDO.js} +1 -1
- package/dist/{DefaultView-DOa4PWSU.js → DefaultView-BVr_7JDn.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DtFuSUby.js → DeliveryOrderPrintPreview-BXZFD3D5.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-CxsxIwZm.js → EmailDialog.vue_vue_type_script_setup_true_lang-Dne_9P3j.js} +25 -25
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-B3mPB7-O.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CYkPbFSA.js} +1 -1
- package/dist/FeatureCapabilityGate-DK_rTVyJ.js +82 -0
- package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-O58GGptu.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-DIhV51l7.js} +1 -1
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CCrEBis5.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B80EHMBT.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-YGOFZ7uY.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C94IFGoH.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-F36jHbKZ.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-COZPDuAM.js} +2 -2
- package/dist/{FmMultiselectDialog-BDCQmCSh.js → FmMultiselectDialog-C1P22sj2.js} +2 -2
- package/dist/{FmMultiselectDialog-Dd9oKz5m.js → FmMultiselectDialog-Kb3IftHf.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CUmlLKDV.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BqB71yfu.js} +5 -5
- package/dist/ImportView-EJ4u8NHM.js +1540 -0
- package/dist/{IngredientsView-Bcxo5AlS.js → IngredientsView-Bxsgm4E7.js} +15 -15
- package/dist/{IntegrationExplorerView-C2jsPi_3.js → IntegrationExplorerView-owEaOVeG.js} +6 -6
- package/dist/{IntegrationPlatformView-Cr7Fyt4p.js → IntegrationPlatformView-BuptPyjg.js} +2 -2
- package/dist/{IntegrationView-BTcnK-_q.js → IntegrationView-DAcdY_d_.js} +14 -14
- package/dist/{InventoryBindingForm-e1rSW4FA.js → InventoryBindingForm-BvjY4zrn.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BjDz4LFE.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DhbF-jgN.js} +4 -4
- package/dist/{InventoryBindingSummary-CAGMRuy4.js → InventoryBindingSummary-DPqm94GX.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-eygCK9vN.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DDsigNJ4.js} +2 -2
- package/dist/{ProductionRunDetailPage-CQz-U7Sw.js → ProductionRunDetailPage-BaPCJUqT.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BtnKFZy2.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CNRX3MYt.js} +8 -8
- package/dist/{ProductionRunPage-BZnmoyLo.js → ProductionRunPage-B6Jsv9Hh.js} +4 -4
- package/dist/{PublishView-BJFoRmsD.js → PublishView-DonUv6nP.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BQExGk_A.js → PurchaseOrderPrintPreview-CK3Cqdwp.js} +2 -2
- package/dist/{ReceiveRequestView-C4XUYhl5.js → ReceiveRequestView-CMAnKxzm.js} +13 -13
- package/dist/RecipeView-Bx13Bckq.js +3272 -0
- package/dist/{SettingsView-BDogzqxV.js → SettingsView-D1MiAkD8.js} +397 -425
- package/dist/StockView-CsxTjVEd.js +3003 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ce82k1-V.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BT73j9SA.js} +1 -1
- package/dist/{SupplierView-DRSh4m07.js → SupplierView-CFACoZya.js} +13 -13
- package/dist/{SurchargeView-gNIDCY22.js → SurchargeView-CShhZa3x.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DrP1vAZX.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-B2OdmdI_.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Cxpc2Wtp.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-x3N2Oypo.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D4kpyIAQ.js → TransferDetails.vue_vue_type_script_setup_true_lang-BISmGBJE.js} +517 -517
- package/dist/{TransferTemplateView-adEB_aZg.js → TransferTemplateView-kx2IPqEv.js} +19 -19
- package/dist/{UnitCostHistoryView-ClgafUAg.js → UnitCostHistoryView-DgPWsXaB.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpN-7H9P.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BtfJJgIP.js} +4 -4
- package/dist/{UnitView-DU-Kim1r.js → UnitView-aupXLRMk.js} +7 -7
- package/dist/{WarehouseView-Dw1xkcrx.js → WarehouseView-MTvbY4n4.js} +8 -8
- package/dist/{WastageTemplateView-CQj821yg.js → WastageTemplateView-Bs9HL-LK.js} +15 -15
- package/dist/api/bill.d.ts +4 -2
- package/dist/api/bill.spec.d.ts +1 -0
- package/dist/api/closing.d.ts +1 -0
- package/dist/api/feature-flags.d.ts +2 -0
- package/dist/api/license.d.ts +0 -1
- package/dist/api/stock.d.ts +1 -1
- package/dist/{app--e70sT_h.js → app-D38sV2ls.js} +2286 -2147
- package/dist/app.d.ts +92 -8
- package/dist/app.js +1 -1
- package/dist/bulk-edit-simulation.helper-DgniL8FN.js +178 -0
- package/dist/{closing-template-i0bDCk-x.js → closing-template-D_NAj_mU.js} +1 -1
- package/dist/{date2-CXI-d_rQ.js → date2-CvgxwuM1.js} +1 -1
- package/dist/{dayjs.min-Ivf4HAC3.js → dayjs.min-BOKV8T5Q.js} +1 -1
- package/dist/{decimal-d3XWw4d_.js → decimal-5xyg1WLu.js} +2 -2
- package/dist/{defineDeepModel-DrQmqGvi.js → defineDeepModel-BwB9XcMu.js} +1 -1
- package/dist/{duplicate-template-yVd6JWGz.js → duplicate-template-DvIgjm4K.js} +1 -1
- package/dist/{feature-CBrHj9bO.js → feature-CsPbMoeJ.js} +231 -221
- package/dist/{format-time-from-id-DpFUCBGw.js → format-time-from-id-DD6Ik9EK.js} +1 -1
- package/dist/{format-unit-display-CICNepRU.js → format-unit-display-DG564AN3.js} +12 -12
- package/dist/helper/country.spec.d.ts +1 -0
- package/dist/{id-to-date-BicEvFx1.js → id-to-date-DoN7OM21.js} +1 -1
- package/dist/{import-export.helper-Cy-nm8Ao.js → import-export.helper-CevBRFTZ.js} +6 -5
- package/dist/{index-CiWNQMAX.js → index-BIh1oTQH.js} +3 -3
- package/dist/{index-BfY6L-3r.js → index-BP3Avix6.js} +1 -1
- package/dist/{index-W7Q7cZGV.js → index-mzXhLwrZ.js} +1 -1
- package/dist/{lz-string-ClJ0qg4U.js → lz-string-DMjWYCk6.js} +1 -1
- package/dist/{netsuite-jSt2nlwO.js → netsuite-ZtoZBFBX.js} +2 -2
- package/dist/{netsuite-explorer-BWrO3KfB.js → netsuite-explorer-h_vID_ao.js} +1 -1
- package/dist/{predefined-templates-DKiqLY6F.js → predefined-templates-CdurFRJ4.js} +1 -1
- package/dist/{purchase-order-template-D-NkhbNh.js → purchase-order-template-BVdCftEo.js} +1 -1
- package/dist/{recalculationUtils-Bbe1w-wj.js → recalculationUtils-DBG8HGiJ.js} +1 -1
- package/dist/{row-action.enum-C8JhgYiR.js → row-action.enum-CGyAg4dC.js} +1 -1
- package/dist/{rules-CrAeAKSS.js → rules-DbFiOzUd.js} +3 -3
- package/dist/{stock-x072pQVW.js → stock-BATH4SoA.js} +1 -1
- package/dist/{stock-B27nWQ5z.js → stock-DXxsDPEO.js} +2 -2
- package/dist/stores/feature.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-sh98cdAW.js → supplier-CKXQmBZn.js} +2 -2
- package/dist/{surcharge-DsF53Jiz.js → surcharge-qupRJjjO.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-DuYrxEZK.js → uom-rules-ALtgjANX.js} +1 -1
- package/dist/{use-ingredient-select-dialog-DZJPaYJX.js → use-ingredient-select-dialog-C1sJpjfV.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CEr-Nctj.js → use-inventory-binding-dialog-tl7-epun.js} +2 -2
- package/dist/{use-template-enabled-locations-h-1Om4op.js → use-template-enabled-locations-DWk2ndDC.js} +2 -2
- package/dist/{use-transfer-locations-CuCYcO6G.js → use-transfer-locations-CsdYY996.js} +2 -2
- package/dist/{useHrmPermission-Db-rrPU-.js → useHrmPermission-BtuqUrwj.js} +1 -1
- package/dist/{useNavigationMenu-DJCT15IW.js → useNavigationMenu-DKxKXykI.js} +4 -4
- package/dist/{useSseClient-B2_SvHJ2.js → useSseClient-CRfpltKK.js} +1 -1
- package/dist/views/import/helper/submit-rows.d.ts +1 -1
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
- package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
- package/dist/views/recipe/helper/import-recipe.d.ts +30 -0
- package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +1 -14
- package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +3 -863
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
- package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
- package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
- package/dist/{vue-Co39mHJn.js → vue-CVco8McV.js} +2 -2
- package/dist/{vue-i18n-C2pkD_vQ.js → vue-i18n-C443zpcA.js} +280 -280
- package/dist/{xlsx.util-CLUjDX2E.js → xlsx.util-5_47Kslf.js} +2 -2
- package/package.json +2 -2
- package/dist/FeatureCapabilityGate-Dp_SfIlO.js +0 -77
- package/dist/ImportView-CbRrxlrW.js +0 -1290
- package/dist/RecipeView-Bd5--ENI.js +0 -3440
- package/dist/StockView-BCWwamwk.js +0 -2756
package/dist/app.d.ts
CHANGED
|
@@ -175,6 +175,18 @@ export declare const i18nMessages: {
|
|
|
175
175
|
basicInformation: string;
|
|
176
176
|
code: string;
|
|
177
177
|
validationErrors: string;
|
|
178
|
+
warnings: string;
|
|
179
|
+
recipeChanges: {
|
|
180
|
+
title: string;
|
|
181
|
+
item: string;
|
|
182
|
+
qtyBefore: string;
|
|
183
|
+
qtyAfter: string;
|
|
184
|
+
extraBefore: string;
|
|
185
|
+
extraAfter: string;
|
|
186
|
+
added: string;
|
|
187
|
+
changed: string;
|
|
188
|
+
same: string;
|
|
189
|
+
};
|
|
178
190
|
rawData: string;
|
|
179
191
|
errorType: string;
|
|
180
192
|
errorMessage: string;
|
|
@@ -370,8 +382,9 @@ export declare const i18nMessages: {
|
|
|
370
382
|
totalReceive: string;
|
|
371
383
|
totalConvert: string;
|
|
372
384
|
totalDamage: string;
|
|
373
|
-
|
|
374
|
-
|
|
385
|
+
firstAdjustmentBalance: string;
|
|
386
|
+
lastAdjustmentBalance: string;
|
|
387
|
+
lastClosingBalance: string;
|
|
375
388
|
};
|
|
376
389
|
loading: string;
|
|
377
390
|
noRecords: string;
|
|
@@ -395,6 +408,14 @@ export declare const i18nMessages: {
|
|
|
395
408
|
bill: string;
|
|
396
409
|
backdate: string;
|
|
397
410
|
createdBy: string;
|
|
411
|
+
billNotFound: string;
|
|
412
|
+
billItem: string;
|
|
413
|
+
billQuantity: string;
|
|
414
|
+
billStockChange: string;
|
|
415
|
+
billItemNoLongerExists: string;
|
|
416
|
+
closeBill: string;
|
|
417
|
+
selectedAdjustment: string;
|
|
418
|
+
selectedAdjustmentHint: string;
|
|
398
419
|
};
|
|
399
420
|
stock_adjustment: {
|
|
400
421
|
title: string;
|
|
@@ -2757,6 +2778,18 @@ export declare const i18nMessages: {
|
|
|
2757
2778
|
basicInformation: string;
|
|
2758
2779
|
code: string;
|
|
2759
2780
|
validationErrors: string;
|
|
2781
|
+
warnings: string;
|
|
2782
|
+
recipeChanges: {
|
|
2783
|
+
title: string;
|
|
2784
|
+
item: string;
|
|
2785
|
+
qtyBefore: string;
|
|
2786
|
+
qtyAfter: string;
|
|
2787
|
+
extraBefore: string;
|
|
2788
|
+
extraAfter: string;
|
|
2789
|
+
added: string;
|
|
2790
|
+
changed: string;
|
|
2791
|
+
same: string;
|
|
2792
|
+
};
|
|
2760
2793
|
rawData: string;
|
|
2761
2794
|
errorType: string;
|
|
2762
2795
|
errorMessage: string;
|
|
@@ -2952,8 +2985,9 @@ export declare const i18nMessages: {
|
|
|
2952
2985
|
totalReceive: string;
|
|
2953
2986
|
totalConvert: string;
|
|
2954
2987
|
totalDamage: string;
|
|
2955
|
-
|
|
2956
|
-
|
|
2988
|
+
firstAdjustmentBalance: string;
|
|
2989
|
+
lastAdjustmentBalance: string;
|
|
2990
|
+
lastClosingBalance: string;
|
|
2957
2991
|
};
|
|
2958
2992
|
loading: string;
|
|
2959
2993
|
noRecords: string;
|
|
@@ -2976,6 +3010,14 @@ export declare const i18nMessages: {
|
|
|
2976
3010
|
bill: string;
|
|
2977
3011
|
backdate: string;
|
|
2978
3012
|
createdBy: string;
|
|
3013
|
+
billNotFound: string;
|
|
3014
|
+
billItem: string;
|
|
3015
|
+
billQuantity: string;
|
|
3016
|
+
billStockChange: string;
|
|
3017
|
+
billItemNoLongerExists: string;
|
|
3018
|
+
closeBill: string;
|
|
3019
|
+
selectedAdjustment: string;
|
|
3020
|
+
selectedAdjustmentHint: string;
|
|
2979
3021
|
};
|
|
2980
3022
|
stock_adjustment: {
|
|
2981
3023
|
title: string;
|
|
@@ -5338,6 +5380,18 @@ export declare const i18nMessages: {
|
|
|
5338
5380
|
basicInformation: string;
|
|
5339
5381
|
code: string;
|
|
5340
5382
|
validationErrors: string;
|
|
5383
|
+
warnings: string;
|
|
5384
|
+
recipeChanges: {
|
|
5385
|
+
title: string;
|
|
5386
|
+
item: string;
|
|
5387
|
+
qtyBefore: string;
|
|
5388
|
+
qtyAfter: string;
|
|
5389
|
+
extraBefore: string;
|
|
5390
|
+
extraAfter: string;
|
|
5391
|
+
added: string;
|
|
5392
|
+
changed: string;
|
|
5393
|
+
same: string;
|
|
5394
|
+
};
|
|
5341
5395
|
rawData: string;
|
|
5342
5396
|
errorType: string;
|
|
5343
5397
|
errorMessage: string;
|
|
@@ -5533,8 +5587,9 @@ export declare const i18nMessages: {
|
|
|
5533
5587
|
totalReceive: string;
|
|
5534
5588
|
totalConvert: string;
|
|
5535
5589
|
totalDamage: string;
|
|
5536
|
-
|
|
5537
|
-
|
|
5590
|
+
firstAdjustmentBalance: string;
|
|
5591
|
+
lastAdjustmentBalance: string;
|
|
5592
|
+
lastClosingBalance: string;
|
|
5538
5593
|
};
|
|
5539
5594
|
loading: string;
|
|
5540
5595
|
noRecords: string;
|
|
@@ -5557,6 +5612,14 @@ export declare const i18nMessages: {
|
|
|
5557
5612
|
bill: string;
|
|
5558
5613
|
backdate: string;
|
|
5559
5614
|
createdBy: string;
|
|
5615
|
+
billNotFound: string;
|
|
5616
|
+
billItem: string;
|
|
5617
|
+
billQuantity: string;
|
|
5618
|
+
billStockChange: string;
|
|
5619
|
+
billItemNoLongerExists: string;
|
|
5620
|
+
closeBill: string;
|
|
5621
|
+
selectedAdjustment: string;
|
|
5622
|
+
selectedAdjustmentHint: string;
|
|
5560
5623
|
};
|
|
5561
5624
|
stock_adjustment: {
|
|
5562
5625
|
title: string;
|
|
@@ -7919,6 +7982,18 @@ export declare const i18nMessages: {
|
|
|
7919
7982
|
basicInformation: string;
|
|
7920
7983
|
code: string;
|
|
7921
7984
|
validationErrors: string;
|
|
7985
|
+
warnings: string;
|
|
7986
|
+
recipeChanges: {
|
|
7987
|
+
title: string;
|
|
7988
|
+
item: string;
|
|
7989
|
+
qtyBefore: string;
|
|
7990
|
+
qtyAfter: string;
|
|
7991
|
+
extraBefore: string;
|
|
7992
|
+
extraAfter: string;
|
|
7993
|
+
added: string;
|
|
7994
|
+
changed: string;
|
|
7995
|
+
same: string;
|
|
7996
|
+
};
|
|
7922
7997
|
rawData: string;
|
|
7923
7998
|
errorType: string;
|
|
7924
7999
|
errorMessage: string;
|
|
@@ -8114,8 +8189,9 @@ export declare const i18nMessages: {
|
|
|
8114
8189
|
totalReceive: string;
|
|
8115
8190
|
totalConvert: string;
|
|
8116
8191
|
totalDamage: string;
|
|
8117
|
-
|
|
8118
|
-
|
|
8192
|
+
firstAdjustmentBalance: string;
|
|
8193
|
+
lastAdjustmentBalance: string;
|
|
8194
|
+
lastClosingBalance: string;
|
|
8119
8195
|
};
|
|
8120
8196
|
loading: string;
|
|
8121
8197
|
noRecords: string;
|
|
@@ -8138,6 +8214,14 @@ export declare const i18nMessages: {
|
|
|
8138
8214
|
bill: string;
|
|
8139
8215
|
backdate: string;
|
|
8140
8216
|
createdBy: string;
|
|
8217
|
+
billNotFound: string;
|
|
8218
|
+
billItem: string;
|
|
8219
|
+
billQuantity: string;
|
|
8220
|
+
billStockChange: string;
|
|
8221
|
+
billItemNoLongerExists: string;
|
|
8222
|
+
closeBill: string;
|
|
8223
|
+
selectedAdjustment: string;
|
|
8224
|
+
selectedAdjustmentHint: string;
|
|
8141
8225
|
};
|
|
8142
8226
|
stock_adjustment: {
|
|
8143
8227
|
title: string;
|
package/dist/app.js
CHANGED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { F as y } from "./decimal-5xyg1WLu.js";
|
|
2
|
+
import { F as m } from "./app-D38sV2ls.js";
|
|
3
|
+
function h(n, a, t) {
|
|
4
|
+
const i = [];
|
|
5
|
+
for (const o of n)
|
|
6
|
+
if (o.type === m.enum.SKU)
|
|
7
|
+
i.push({ ...o, recipeIds: [...a] });
|
|
8
|
+
else if (o.type === m.enum.RECIPE) {
|
|
9
|
+
const e = t[o.id];
|
|
10
|
+
e && !a.has(o.id) && i.push(
|
|
11
|
+
...h(e.contains, /* @__PURE__ */ new Set([...a, o.id]), t)
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return i;
|
|
15
|
+
}
|
|
16
|
+
function k(n, a) {
|
|
17
|
+
return y.equal(n, a);
|
|
18
|
+
}
|
|
19
|
+
function c(n) {
|
|
20
|
+
if (n == null) return null;
|
|
21
|
+
const a = n.$and, t = n.$or;
|
|
22
|
+
return Array.isArray(a) && a.length === 0 || Array.isArray(t) && t.length === 0 || Object.keys(n).length === 0 ? null : JSON.stringify(n);
|
|
23
|
+
}
|
|
24
|
+
function p(n) {
|
|
25
|
+
const a = (n ?? []).map((t) => ({
|
|
26
|
+
_id: t._id,
|
|
27
|
+
trackingMeasurement: t.trackingMeasurement ?? null,
|
|
28
|
+
priority: t.priority ?? null,
|
|
29
|
+
default: t.default ?? null
|
|
30
|
+
})).sort((t, i) => t._id.localeCompare(i._id));
|
|
31
|
+
return JSON.stringify(a);
|
|
32
|
+
}
|
|
33
|
+
function g(n) {
|
|
34
|
+
return n.measurement ? y.multiplyDecimal(n.amount, n.measurement.conversion) : n.amount;
|
|
35
|
+
}
|
|
36
|
+
function f(n, a) {
|
|
37
|
+
var o, e;
|
|
38
|
+
if (n.type !== a.type || n.id !== a.id || !k(g(n), g(a))) return !1;
|
|
39
|
+
const t = ((o = n.measurement) == null ? void 0 : o.id) ?? null, i = ((e = a.measurement) == null ? void 0 : e.id) ?? null;
|
|
40
|
+
return !(t !== i || c(n.rules) !== c(a.rules) || p(n.alternatives) !== p(a.alternatives));
|
|
41
|
+
}
|
|
42
|
+
function b(n, a) {
|
|
43
|
+
return n.type === a.type && n.id === a.id;
|
|
44
|
+
}
|
|
45
|
+
function E(n, a) {
|
|
46
|
+
const t = [];
|
|
47
|
+
let i = [...n.contains];
|
|
48
|
+
for (const e of a)
|
|
49
|
+
switch (e.type) {
|
|
50
|
+
case "remove-binding": {
|
|
51
|
+
const r = i.findIndex(
|
|
52
|
+
(s) => s.type === e.target.type && s.id === e.target.id
|
|
53
|
+
);
|
|
54
|
+
r === -1 ? t.push({ change: e, outcome: "ignored", reason: "Source binding not found in target" }) : (i = [...i.slice(0, r), ...i.slice(r + 1)], t.push({ change: e, outcome: "applied" }));
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
case "add-binding": {
|
|
58
|
+
if (i.find((d) => f(d, e.binding))) {
|
|
59
|
+
t.push({ change: e, outcome: "already-satisfied", reason: "Exact binding already present" });
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
if (i.find((d) => b(d, e.binding))) {
|
|
63
|
+
t.push({ change: e, outcome: "blocked", reason: "A similar but non-exact binding already exists" });
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
if (n.version === "v2" && e.binding.type === "RECIPE") {
|
|
67
|
+
t.push({ change: e, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
if (n.version !== "v2" && (e.binding.alternatives ?? []).length > 0) {
|
|
71
|
+
t.push({ change: e, outcome: "blocked", reason: "Cannot add a binding with alternatives to a non-V2 recipe" });
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
i = [...i, e.binding], t.push({ change: e, outcome: "applied" });
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case "replace-binding": {
|
|
78
|
+
const r = i.findIndex(
|
|
79
|
+
(l) => l.type === e.from.type && l.id === e.from.id
|
|
80
|
+
), s = i.find((l) => f(l, e.to)), d = i.find((l, u) => u !== r && b(l, e.to) && !f(l, e.to));
|
|
81
|
+
if (r === -1) {
|
|
82
|
+
s ? t.push({ change: e, outcome: "already-satisfied", reason: "Target already has exact replacement" }) : t.push({ change: e, outcome: "ignored", reason: "Source binding not found in target" });
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
if (n.version === "v2" && e.to.type === "RECIPE") {
|
|
86
|
+
t.push({ change: e, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (n.version !== "v2" && (e.to.alternatives ?? []).length > 0) {
|
|
90
|
+
t.push({ change: e, outcome: "blocked", reason: "Cannot apply a binding with alternatives to a non-V2 recipe" });
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (d) {
|
|
94
|
+
t.push({ change: e, outcome: "blocked", reason: "A similar but non-exact replacement binding already exists" });
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
s ? (i = [...i.slice(0, r), ...i.slice(r + 1)], t.push({ change: e, outcome: "applied", reason: "Source removed; replacement already present" })) : (i = [
|
|
98
|
+
...i.slice(0, r),
|
|
99
|
+
e.to,
|
|
100
|
+
...i.slice(r + 1)
|
|
101
|
+
], t.push({ change: e, outcome: "applied" }));
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
case "update-binding-rule": {
|
|
105
|
+
const r = i.findIndex(
|
|
106
|
+
(u) => u.type === e.target.type && u.id === e.target.id
|
|
107
|
+
);
|
|
108
|
+
if (r === -1) {
|
|
109
|
+
t.push({ change: e, outcome: "ignored", reason: "Binding not found in target" });
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
const s = i[r], d = s.rules ?? null, l = e.rule ?? null;
|
|
113
|
+
if (c(d) === c(l)) {
|
|
114
|
+
t.push({ change: e, outcome: "already-satisfied", reason: "Rule already matches" });
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
i = [
|
|
118
|
+
...i.slice(0, r),
|
|
119
|
+
{ ...s, rules: l },
|
|
120
|
+
...i.slice(r + 1)
|
|
121
|
+
], t.push({ change: e, outcome: "applied" });
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
case "update-alternatives": {
|
|
125
|
+
if (n.version !== "v2") {
|
|
126
|
+
t.push({ change: e, outcome: "blocked", reason: "Cannot update alternatives on a non-V2 recipe" });
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
const r = i.findIndex(
|
|
130
|
+
(u) => u.type === e.target.type && u.id === e.target.id
|
|
131
|
+
);
|
|
132
|
+
if (r === -1) {
|
|
133
|
+
t.push({ change: e, outcome: "ignored", reason: "Binding not found in target" });
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
const s = i[r], d = p(s.alternatives), l = p(e.alternatives);
|
|
137
|
+
if (d === l) {
|
|
138
|
+
t.push({ change: e, outcome: "already-satisfied", reason: "Alternatives already match" });
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
i = [
|
|
142
|
+
...i.slice(0, r),
|
|
143
|
+
{ ...s, alternatives: e.alternatives },
|
|
144
|
+
...i.slice(r + 1)
|
|
145
|
+
], t.push({ change: e, outcome: "applied" });
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return { projected: { ...n, contains: i }, results: t };
|
|
150
|
+
}
|
|
151
|
+
function C(n) {
|
|
152
|
+
switch (n.type) {
|
|
153
|
+
case "add-binding":
|
|
154
|
+
return n.binding.id !== "";
|
|
155
|
+
case "remove-binding":
|
|
156
|
+
return n.target.id !== "";
|
|
157
|
+
case "replace-binding":
|
|
158
|
+
return n.from.id !== "" && n.to.id !== "";
|
|
159
|
+
case "update-binding-rule":
|
|
160
|
+
return n.target.id !== "";
|
|
161
|
+
case "update-alternatives":
|
|
162
|
+
return n.target.id !== "";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function I(n) {
|
|
166
|
+
if (n.length === 0) return "no-applicable-changes";
|
|
167
|
+
let a = 0, t = 0, i = 0, o = 0;
|
|
168
|
+
for (const e of n)
|
|
169
|
+
e.outcome === "applied" ? a++ : e.outcome === "blocked" ? t++ : e.outcome === "ignored" ? i++ : e.outcome === "already-satisfied" && o++;
|
|
170
|
+
return t > 0 && a === 0 ? "blocked" : o === n.length ? "already-satisfied" : a > 0 && (i > 0 || t > 0) ? "partially-ignored" : a > 0 ? "will-update" : "no-applicable-changes";
|
|
171
|
+
}
|
|
172
|
+
export {
|
|
173
|
+
I as d,
|
|
174
|
+
h as f,
|
|
175
|
+
C as i,
|
|
176
|
+
c as n,
|
|
177
|
+
E as s
|
|
178
|
+
};
|