@medusajs/order 0.1.3-snapshot-20240718073308 → 0.1.3-snapshot-20240719080828
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/models/order-summary.d.ts +0 -5
- package/dist/models/order-summary.d.ts.map +1 -1
- package/dist/models/order-summary.js.map +1 -1
- package/dist/services/actions/receive-return.d.ts.map +1 -1
- package/dist/services/actions/receive-return.js +0 -1
- package/dist/services/actions/receive-return.js.map +1 -1
- package/dist/services/order-module-service.d.ts.map +1 -1
- package/dist/services/order-module-service.js +2 -0
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/types/utils/index.d.ts +0 -13
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/index.js +0 -1
- package/dist/types/utils/index.js.map +1 -1
- package/dist/utils/actions/cancel-item-fulfillment.js +0 -5
- package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -1
- package/dist/utils/actions/cancel-return.js +0 -5
- package/dist/utils/actions/cancel-return.js.map +1 -1
- package/dist/utils/actions/fulfill-item.js +0 -5
- package/dist/utils/actions/fulfill-item.js.map +1 -1
- package/dist/utils/actions/index.d.ts +0 -1
- package/dist/utils/actions/index.d.ts.map +1 -1
- package/dist/utils/actions/index.js +0 -1
- package/dist/utils/actions/index.js.map +1 -1
- package/dist/utils/actions/item-add.js +0 -12
- package/dist/utils/actions/item-add.js.map +1 -1
- package/dist/utils/actions/item-remove.js +0 -15
- package/dist/utils/actions/item-remove.js.map +1 -1
- package/dist/utils/actions/receive-damaged-return-item.js +2 -29
- package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
- package/dist/utils/actions/receive-return-item.js +0 -30
- package/dist/utils/actions/receive-return-item.js.map +1 -1
- package/dist/utils/actions/reinstate-item.js +0 -5
- package/dist/utils/actions/reinstate-item.js.map +1 -1
- package/dist/utils/actions/return-item.js +0 -5
- package/dist/utils/actions/return-item.js.map +1 -1
- package/dist/utils/actions/ship-item.js +0 -5
- package/dist/utils/actions/ship-item.js.map +1 -1
- package/dist/utils/actions/shipping-add.js +0 -9
- package/dist/utils/actions/shipping-add.js.map +1 -1
- package/dist/utils/actions/shipping-remove.js +0 -16
- package/dist/utils/actions/shipping-remove.js.map +1 -1
- package/dist/utils/actions/write-off-item.js +0 -5
- package/dist/utils/actions/write-off-item.js.map +1 -1
- package/dist/utils/apply-order-changes.js +1 -1
- package/dist/utils/apply-order-changes.js.map +1 -1
- package/dist/utils/calculate-order-change.d.ts +0 -3
- package/dist/utils/calculate-order-change.d.ts.map +1 -1
- package/dist/utils/calculate-order-change.js +6 -129
- package/dist/utils/calculate-order-change.js.map +1 -1
- package/dist/utils/set-action-reference.d.ts +0 -1
- package/dist/utils/set-action-reference.d.ts.map +1 -1
- package/dist/utils/set-action-reference.js +1 -7
- package/dist/utils/set-action-reference.js.map +1 -1
- package/package.json +5 -5
- package/dist/utils/actions/cancel.d.ts +0 -2
- package/dist/utils/actions/cancel.d.ts.map +0 -1
- package/dist/utils/actions/cancel.js +0 -8
- package/dist/utils/actions/cancel.js.map +0 -1
@@ -29,11 +29,8 @@ class OrderChangeProcessing {
|
|
29
29
|
}
|
30
30
|
(0, utils_1.transformPropertiesToBigNumber)(this.order.metadata);
|
31
31
|
this.summary = {
|
32
|
-
future_difference: 0,
|
33
|
-
future_temporary_difference: 0,
|
34
32
|
temporary_difference: 0,
|
35
33
|
pending_difference: 0,
|
36
|
-
future_temporary_sum: 0,
|
37
34
|
difference_sum: 0,
|
38
35
|
current_order_total: this.order.total ?? 0,
|
39
36
|
original_order_total: this.order.total ?? 0,
|
@@ -52,10 +49,6 @@ class OrderChangeProcessing {
|
|
52
49
|
const status = action.status;
|
53
50
|
return status === _types_1.EVENT_STATUS.DONE;
|
54
51
|
}
|
55
|
-
isEventPending(action) {
|
56
|
-
const status = action.status;
|
57
|
-
return status === undefined || status === _types_1.EVENT_STATUS.PENDING;
|
58
|
-
}
|
59
52
|
processActions() {
|
60
53
|
for (const action of this.actions) {
|
61
54
|
this.processAction_(action);
|
@@ -70,32 +63,21 @@ class OrderChangeProcessing {
|
|
70
63
|
...OrderChangeProcessing.typeDefinition[action.action],
|
71
64
|
};
|
72
65
|
const amount = utils_1.MathBN.mult(action.amount, type.isDeduction ? -1 : 1);
|
73
|
-
if (action.change_id
|
66
|
+
if (action.change_id) {
|
74
67
|
this.groupTotal[action.change_id] ??= 0;
|
75
68
|
this.groupTotal[action.change_id] = utils_1.MathBN.add(this.groupTotal[action.change_id], amount);
|
76
69
|
}
|
77
|
-
if (type.awaitRequired
|
78
|
-
|
79
|
-
summary.future_temporary_sum = utils_1.MathBN.add(summary.future_temporary_sum, amount);
|
80
|
-
}
|
81
|
-
else {
|
82
|
-
summary.temporary_difference = utils_1.MathBN.add(summary.temporary_difference, amount);
|
83
|
-
}
|
70
|
+
if (type.awaitRequired) {
|
71
|
+
summary.temporary_difference = utils_1.MathBN.add(summary.temporary_difference, amount);
|
84
72
|
}
|
85
|
-
if (action.
|
86
|
-
summary.
|
87
|
-
}
|
88
|
-
else {
|
89
|
-
if (!this.isEventDone(action) && !action.change_id) {
|
90
|
-
summary.difference_sum = utils_1.MathBN.add(summary.difference_sum, amount);
|
91
|
-
}
|
92
|
-
summary.current_order_total = utils_1.MathBN.add(summary.current_order_total, amount);
|
73
|
+
if (!this.isEventDone(action) && !action.change_id) {
|
74
|
+
summary.difference_sum = utils_1.MathBN.add(summary.difference_sum, amount);
|
93
75
|
}
|
76
|
+
summary.current_order_total = utils_1.MathBN.add(summary.current_order_total, amount);
|
94
77
|
}
|
95
78
|
const groupSum = utils_1.MathBN.add(...Object.values(this.groupTotal));
|
96
79
|
summary.difference_sum = utils_1.MathBN.add(summary.difference_sum, groupSum);
|
97
80
|
summary.transaction_total = utils_1.MathBN.sum(...this.transactions.map((tr) => tr.amount));
|
98
|
-
summary.future_temporary_difference = utils_1.MathBN.sub(summary.future_difference, summary.future_temporary_sum);
|
99
81
|
summary.temporary_difference = utils_1.MathBN.sub(summary.difference_sum, summary.temporary_difference);
|
100
82
|
summary.pending_difference = utils_1.MathBN.sub(summary.current_order_total, summary.transaction_total);
|
101
83
|
}
|
@@ -112,16 +94,10 @@ class OrderChangeProcessing {
|
|
112
94
|
if (!isReplay) {
|
113
95
|
this.actionsProcessed[action.action].push(action);
|
114
96
|
}
|
115
|
-
let previousEvents;
|
116
|
-
if (type.commitsAction) {
|
117
|
-
previousEvents = (this.actionsProcessed[type.commitsAction] ?? []).filter((ac_) => ac_.reference_id === action.reference_id &&
|
118
|
-
ac_.status !== _types_1.EVENT_STATUS.VOIDED);
|
119
|
-
}
|
120
97
|
let calculatedAmount = action.amount ?? 0;
|
121
98
|
const params = {
|
122
99
|
actions: this.actions,
|
123
100
|
action,
|
124
|
-
previousEvents,
|
125
101
|
currentOrder: this.order,
|
126
102
|
summary: this.summary,
|
127
103
|
transactions: this.transactions,
|
@@ -138,104 +114,8 @@ class OrderChangeProcessing {
|
|
138
114
|
action.amount = calculatedAmount ?? 0;
|
139
115
|
}
|
140
116
|
}
|
141
|
-
// If an action commits previous ones, replay them with updated values
|
142
|
-
if (type.commitsAction) {
|
143
|
-
for (const previousEvent of previousEvents ?? []) {
|
144
|
-
this.processAction_(previousEvent, true);
|
145
|
-
}
|
146
|
-
}
|
147
|
-
if (action.resolve) {
|
148
|
-
if (action.resolve.reference_id) {
|
149
|
-
this.resolveReferences(action);
|
150
|
-
}
|
151
|
-
const groupId = action.resolve.change_id ?? "__default";
|
152
|
-
if (action.resolve.change_id) {
|
153
|
-
// resolve all actions in the same group
|
154
|
-
this.resolveGroup(action);
|
155
|
-
}
|
156
|
-
if (action.resolve.amount && !action.evaluationOnly) {
|
157
|
-
this.groupTotal[groupId] ??= 0;
|
158
|
-
this.groupTotal[groupId] = utils_1.MathBN.sub(this.groupTotal[groupId], action.resolve.amount);
|
159
|
-
}
|
160
|
-
}
|
161
117
|
return calculatedAmount;
|
162
118
|
}
|
163
|
-
resolveReferences(self) {
|
164
|
-
const resolve = self.resolve;
|
165
|
-
const resolveType = OrderChangeProcessing.typeDefinition[self.action];
|
166
|
-
Object.keys(this.actionsProcessed).forEach((actionKey) => {
|
167
|
-
const type = OrderChangeProcessing.typeDefinition[actionKey];
|
168
|
-
const actions = this.actionsProcessed[actionKey];
|
169
|
-
for (const action of actions) {
|
170
|
-
if (action === self ||
|
171
|
-
!this.isEventPending(action) ||
|
172
|
-
action.reference_id !== resolve?.reference_id) {
|
173
|
-
continue;
|
174
|
-
}
|
175
|
-
if (type.revert && (action.evaluationOnly || resolveType.void)) {
|
176
|
-
let previousEvents;
|
177
|
-
if (type.commitsAction) {
|
178
|
-
previousEvents = (this.actionsProcessed[type.commitsAction] ?? []).filter((ac_) => ac_.reference_id === action.reference_id &&
|
179
|
-
ac_.status !== _types_1.EVENT_STATUS.VOIDED);
|
180
|
-
}
|
181
|
-
type.revert({
|
182
|
-
actions: this.actions,
|
183
|
-
action,
|
184
|
-
previousEvents,
|
185
|
-
currentOrder: this.order,
|
186
|
-
summary: this.summary,
|
187
|
-
transactions: this.transactions,
|
188
|
-
type,
|
189
|
-
});
|
190
|
-
for (const previousEvent of previousEvents ?? []) {
|
191
|
-
this.processAction_(previousEvent, true);
|
192
|
-
}
|
193
|
-
action.status =
|
194
|
-
action.evaluationOnly || resolveType.void
|
195
|
-
? _types_1.EVENT_STATUS.VOIDED
|
196
|
-
: _types_1.EVENT_STATUS.DONE;
|
197
|
-
}
|
198
|
-
}
|
199
|
-
});
|
200
|
-
}
|
201
|
-
resolveGroup(self) {
|
202
|
-
const resolve = self.resolve;
|
203
|
-
Object.keys(this.actionsProcessed).forEach((actionKey) => {
|
204
|
-
const type = OrderChangeProcessing.typeDefinition[actionKey];
|
205
|
-
const actions = this.actionsProcessed[actionKey];
|
206
|
-
for (const action of actions) {
|
207
|
-
if (!resolve?.change_id || action?.change_id !== resolve.change_id) {
|
208
|
-
continue;
|
209
|
-
}
|
210
|
-
if (type.revert &&
|
211
|
-
action.status !== _types_1.EVENT_STATUS.DONE &&
|
212
|
-
action.status !== _types_1.EVENT_STATUS.VOIDED &&
|
213
|
-
(action.evaluationOnly || type.void)) {
|
214
|
-
let previousEvents;
|
215
|
-
if (type.commitsAction) {
|
216
|
-
previousEvents = (this.actionsProcessed[type.commitsAction] ?? []).filter((ac_) => ac_.reference_id === action.reference_id &&
|
217
|
-
ac_.status !== _types_1.EVENT_STATUS.VOIDED);
|
218
|
-
}
|
219
|
-
type.revert({
|
220
|
-
actions: this.actions,
|
221
|
-
action: action,
|
222
|
-
previousEvents,
|
223
|
-
currentOrder: this.order,
|
224
|
-
summary: this.summary,
|
225
|
-
transactions: this.transactions,
|
226
|
-
type: OrderChangeProcessing.typeDefinition[action.action],
|
227
|
-
});
|
228
|
-
for (const previousEvent of previousEvents ?? []) {
|
229
|
-
this.processAction_(previousEvent, true);
|
230
|
-
}
|
231
|
-
action.status =
|
232
|
-
action.evaluationOnly || type.void
|
233
|
-
? _types_1.EVENT_STATUS.VOIDED
|
234
|
-
: _types_1.EVENT_STATUS.DONE;
|
235
|
-
}
|
236
|
-
}
|
237
|
-
});
|
238
|
-
}
|
239
119
|
getSummary() {
|
240
120
|
const summary = this.summary;
|
241
121
|
const orderSummary = {
|
@@ -243,8 +123,6 @@ class OrderChangeProcessing {
|
|
243
123
|
original_order_total: new utils_1.BigNumber(summary.original_order_total),
|
244
124
|
current_order_total: new utils_1.BigNumber(summary.current_order_total),
|
245
125
|
temporary_difference: new utils_1.BigNumber(summary.temporary_difference),
|
246
|
-
future_difference: new utils_1.BigNumber(summary.future_difference),
|
247
|
-
future_temporary_difference: new utils_1.BigNumber(summary.future_temporary_difference),
|
248
126
|
pending_difference: new utils_1.BigNumber(summary.pending_difference),
|
249
127
|
difference_sum: new utils_1.BigNumber(summary.difference_sum),
|
250
128
|
paid_total: new utils_1.BigNumber(summary.paid_total),
|
@@ -259,7 +137,6 @@ class OrderChangeProcessing {
|
|
259
137
|
exports.OrderChangeProcessing = OrderChangeProcessing;
|
260
138
|
OrderChangeProcessing.typeDefinition = {};
|
261
139
|
OrderChangeProcessing.defaultConfig = {
|
262
|
-
awaitRequired: false,
|
263
140
|
isDeduction: false,
|
264
141
|
};
|
265
142
|
function calculateOrderChange({ order, transactions = [], actions = [], options = {}, }) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"calculate-order-change.js","sourceRoot":"","sources":["../../src/utils/calculate-order-change.ts"],"names":[],"mappings":";;;AACA,2CAMwB;AACxB,mCAQe;AAUf,MAAa,qBAAqB;IAgBzB,MAAM,CAAC,kBAAkB,CAAC,GAAW,EAAE,IAA0B;QACtE,qBAAqB,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;IAClD,CAAC;IAED,YAAY,EACV,KAAK,EACL,YAAY,EACZ,OAAO,EACP,OAAO,GAMR;QApBO,YAAO,GAAmB,EAAE,CAAA;QAE5B,qBAAgB,GAAkD,EAAE,CAAA;QACpE,eAAU,GAAmC,EAAE,CAAA;QAkBrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAC9C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,CAAA;QAClE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAA;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEtB,IAAI,IAAI,GAAG,cAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAC5B,IAAI,QAAQ,GAAG,cAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAChC,IAAI,gBAAgB,GAAG,cAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAExC,KAAK,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC;YAC9B,IAAI,cAAM,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAA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c,EAAE,IAAI,iBAAS,CAAC,OAAO,CAAC,cAAc,CAAC;SACxB,CAAA;QAE/B,OAAO,YAAY,CAAA;IACrB,CAAC;IAEM,eAAe;QACpB,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;;AAxMH,sDAyMC;AAxMgB,oCAAc,GAA4C,EAAE,AAA9C,CAA8C;AAC5D,mCAAa,GAAG;IAC7B,WAAW,EAAE,KAAK;CACnB,AAF2B,CAE3B;AAuMH,SAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,YAAY,GAAG,EAAE,EACjB,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,EAAE,GAMb;IACC,MAAM,IAAI,GAAG,IAAI,qBAAqB,CAAC;QACrC,KAAK;QACL,YAAY;QACZ,OAAO;QACP,OAAO;KACR,CAAC,CAAA;IACF,IAAI,CAAC,cAAc,EAAE,CAAA;IAErB,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;QAC1B,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE;KAC9B,CAAA;AACH,CAAC;AAvBD,oDAuBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"set-action-reference.d.ts","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,QAAQ,KAAA,EAAE,MAAM,KAAA,EAAE,OAAO,KAAA,QAK3D
|
1
|
+
{"version":3,"file":"set-action-reference.d.ts","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,QAAQ,KAAA,EAAE,MAAM,KAAA,EAAE,OAAO,KAAA,QAK3D"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.setActionReference = void 0;
|
4
4
|
function setActionReference(existing, action, options) {
|
5
5
|
if (options?.addActionReferenceToObject) {
|
6
6
|
existing.actions ??= [];
|
@@ -8,10 +8,4 @@ function setActionReference(existing, action, options) {
|
|
8
8
|
}
|
9
9
|
}
|
10
10
|
exports.setActionReference = setActionReference;
|
11
|
-
function unsetActionReference(existing, action) {
|
12
|
-
if (Array.isArray(existing?.actions)) {
|
13
|
-
existing.actions = existing.actions.filter((a) => a.id !== action.id);
|
14
|
-
}
|
15
|
-
}
|
16
|
-
exports.unsetActionReference = unsetActionReference;
|
17
11
|
//# sourceMappingURL=set-action-reference.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"set-action-reference.js","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IAC1D,IAAI,OAAO,EAAE,0BAA0B,EAAE,CAAC;QACxC,QAAQ,CAAC,OAAO,KAAK,EAAE,CAAA;QACvB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;AACH,CAAC;AALD,gDAKC
|
1
|
+
{"version":3,"file":"set-action-reference.js","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IAC1D,IAAI,OAAO,EAAE,0BAA0B,EAAE,CAAC;QACxC,QAAQ,CAAC,OAAO,KAAK,EAAE,CAAA;QACvB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;AACH,CAAC;AALD,gDAKC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/order",
|
3
|
-
"version": "0.1.3-snapshot-
|
3
|
+
"version": "0.1.3-snapshot-20240719080828",
|
4
4
|
"description": "Medusa Order module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -34,19 +34,19 @@
|
|
34
34
|
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
37
|
-
"@medusajs/
|
37
|
+
"@medusajs/modules-sdk": "1.13.0-snapshot-20240719080828",
|
38
|
+
"@medusajs/types": "1.12.0-snapshot-20240719080828",
|
38
39
|
"@mikro-orm/cli": "5.9.7",
|
39
40
|
"cross-env": "^5.2.1",
|
40
41
|
"jest": "^29.7.0",
|
41
|
-
"medusa-test-utils": "1.1.45-snapshot-
|
42
|
+
"medusa-test-utils": "1.1.45-snapshot-20240719080828",
|
42
43
|
"rimraf": "^3.0.2",
|
43
44
|
"ts-node": "^10.9.1",
|
44
45
|
"tsc-alias": "^1.8.6",
|
45
46
|
"typescript": "^5.1.6"
|
46
47
|
},
|
47
48
|
"dependencies": {
|
48
|
-
"@medusajs/
|
49
|
-
"@medusajs/utils": "1.12.0-snapshot-20240718073308",
|
49
|
+
"@medusajs/utils": "1.12.0-snapshot-20240719080828",
|
50
50
|
"@mikro-orm/core": "5.9.7",
|
51
51
|
"@mikro-orm/migrations": "5.9.7",
|
52
52
|
"@mikro-orm/postgresql": "5.9.7",
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/cancel.ts"],"names":[],"mappings":""}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const utils_1 = require("@medusajs/utils");
|
4
|
-
const calculate_order_change_1 = require("../calculate-order-change");
|
5
|
-
calculate_order_change_1.OrderChangeProcessing.registerActionType(utils_1.ChangeActionType.CANCEL, {
|
6
|
-
void: true,
|
7
|
-
});
|
8
|
-
//# sourceMappingURL=cancel.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../src/utils/actions/cancel.ts"],"names":[],"mappings":";;AAAA,2CAAkD;AAClD,sEAAiE;AAEjE,8CAAqB,CAAC,kBAAkB,CAAC,wBAAgB,CAAC,MAAM,EAAE;IAChE,IAAI,EAAE,IAAI;CACX,CAAC,CAAA"}
|