@medusajs/utils 3.0.0-snapshot-20251104011621 → 3.0.0-snapshot-20251106143524
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/common/execute-with-concurrency.d.ts.map +1 -1
- package/dist/common/execute-with-concurrency.js +6 -4
- package/dist/common/execute-with-concurrency.js.map +1 -1
- package/dist/product/events.d.ts +6 -0
- package/dist/product/events.d.ts.map +1 -1
- package/dist/product/events.js +1 -0
- package/dist/product/events.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-with-concurrency.d.ts","sourceRoot":"","sources":["../../src/common/execute-with-concurrency.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execute-with-concurrency.d.ts","sourceRoot":"","sources":["../../src/common/execute-with-concurrency.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,SAAS,EAAE,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAC/B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAqB7C"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeWithConcurrency = executeWithConcurrency;
|
|
4
|
+
const promise_all_1 = require("./promise-all");
|
|
4
5
|
/**
|
|
5
6
|
* Execute functions with a concurrency limit
|
|
6
7
|
* @param functions Array of functions to execute in parallel
|
|
7
8
|
* @param concurrency Maximum number of concurrent executions
|
|
8
9
|
*/
|
|
9
10
|
async function executeWithConcurrency(functions, concurrency) {
|
|
10
|
-
const
|
|
11
|
+
const functionsLength = functions.length;
|
|
12
|
+
const results = new Array(functionsLength);
|
|
11
13
|
let currentIndex = 0;
|
|
12
14
|
const executeNext = async () => {
|
|
13
|
-
while (currentIndex <
|
|
15
|
+
while (currentIndex < functionsLength) {
|
|
14
16
|
const index = currentIndex++;
|
|
15
17
|
const result = await Promise.allSettled([functions[index]()]);
|
|
16
18
|
results[index] = result[0];
|
|
17
19
|
}
|
|
18
20
|
};
|
|
19
21
|
const workers = [];
|
|
20
|
-
for (let i = 0; i < concurrency; i++) {
|
|
22
|
+
for (let i = 0; i < Math.min(concurrency, functionsLength); i++) {
|
|
21
23
|
workers.push(executeNext());
|
|
22
24
|
}
|
|
23
|
-
await
|
|
25
|
+
await (0, promise_all_1.promiseAll)(workers);
|
|
24
26
|
return results;
|
|
25
27
|
}
|
|
26
28
|
//# sourceMappingURL=execute-with-concurrency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-with-concurrency.js","sourceRoot":"","sources":["../../src/common/execute-with-concurrency.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"execute-with-concurrency.js","sourceRoot":"","sources":["../../src/common/execute-with-concurrency.ts"],"names":[],"mappings":";;AAOA,wDAwBC;AA/BD,+CAA0C;AAE1C;;;;GAIG;AACI,KAAK,UAAU,sBAAsB,CAC1C,SAA+B,EAC/B,WAAmB;IAEnB,MAAM,eAAe,GAAG,SAAS,CAAC,MAAM,CAAA;IACxC,MAAM,OAAO,GAAuC,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IAC9E,IAAI,YAAY,GAAG,CAAC,CAAA;IAEpB,MAAM,WAAW,GAAG,KAAK,IAAmB,EAAE;QAC5C,OAAO,YAAY,GAAG,eAAe,EAAE,CAAC;YACtC,MAAM,KAAK,GAAG,YAAY,EAAE,CAAA;YAC5B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;YAC7D,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC,CAAA;IAED,MAAM,OAAO,GAAoB,EAAE,CAAA;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IAC7B,CAAC;IAED,MAAM,IAAA,wBAAU,EAAC,OAAO,CAAC,CAAA;IAEzB,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
package/dist/product/events.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const ProductEvents: {
|
|
|
2
2
|
PRODUCT_CREATED: "product.created";
|
|
3
3
|
PRODUCT_VARIANT_CREATED: "product-variant.created";
|
|
4
4
|
PRODUCT_OPTION_CREATED: "product-option.created";
|
|
5
|
+
PRODUCT_PRODUCT_OPTION_CREATED: "product-product-option.created";
|
|
5
6
|
PRODUCT_OPTION_VALUE_CREATED: "product-option-value.created";
|
|
6
7
|
PRODUCT_TYPE_CREATED: "product-type.created";
|
|
7
8
|
PRODUCT_TAG_CREATED: "product-tag.created";
|
|
@@ -12,6 +13,7 @@ export declare const ProductEvents: {
|
|
|
12
13
|
PRODUCT_UPDATED: "product.updated";
|
|
13
14
|
PRODUCT_VARIANT_UPDATED: "product-variant.updated";
|
|
14
15
|
PRODUCT_OPTION_UPDATED: "product-option.updated";
|
|
16
|
+
PRODUCT_PRODUCT_OPTION_UPDATED: "product-product-option.updated";
|
|
15
17
|
PRODUCT_OPTION_VALUE_UPDATED: "product-option-value.updated";
|
|
16
18
|
PRODUCT_TYPE_UPDATED: "product-type.updated";
|
|
17
19
|
PRODUCT_TAG_UPDATED: "product-tag.updated";
|
|
@@ -22,6 +24,7 @@ export declare const ProductEvents: {
|
|
|
22
24
|
PRODUCT_DELETED: "product.deleted";
|
|
23
25
|
PRODUCT_VARIANT_DELETED: "product-variant.deleted";
|
|
24
26
|
PRODUCT_OPTION_DELETED: "product-option.deleted";
|
|
27
|
+
PRODUCT_PRODUCT_OPTION_DELETED: "product-product-option.deleted";
|
|
25
28
|
PRODUCT_OPTION_VALUE_DELETED: "product-option-value.deleted";
|
|
26
29
|
PRODUCT_TYPE_DELETED: "product-type.deleted";
|
|
27
30
|
PRODUCT_TAG_DELETED: "product-tag.deleted";
|
|
@@ -32,6 +35,7 @@ export declare const ProductEvents: {
|
|
|
32
35
|
PRODUCT_RESTORED: "product.restored";
|
|
33
36
|
PRODUCT_VARIANT_RESTORED: "product-variant.restored";
|
|
34
37
|
PRODUCT_OPTION_RESTORED: "product-option.restored";
|
|
38
|
+
PRODUCT_PRODUCT_OPTION_RESTORED: "product-product-option.restored";
|
|
35
39
|
PRODUCT_OPTION_VALUE_RESTORED: "product-option-value.restored";
|
|
36
40
|
PRODUCT_TYPE_RESTORED: "product-type.restored";
|
|
37
41
|
PRODUCT_TAG_RESTORED: "product-tag.restored";
|
|
@@ -42,6 +46,7 @@ export declare const ProductEvents: {
|
|
|
42
46
|
PRODUCT_ATTACHED: "product.attached";
|
|
43
47
|
PRODUCT_VARIANT_ATTACHED: "product-variant.attached";
|
|
44
48
|
PRODUCT_OPTION_ATTACHED: "product-option.attached";
|
|
49
|
+
PRODUCT_PRODUCT_OPTION_ATTACHED: "product-product-option.attached";
|
|
45
50
|
PRODUCT_OPTION_VALUE_ATTACHED: "product-option-value.attached";
|
|
46
51
|
PRODUCT_TYPE_ATTACHED: "product-type.attached";
|
|
47
52
|
PRODUCT_TAG_ATTACHED: "product-tag.attached";
|
|
@@ -52,6 +57,7 @@ export declare const ProductEvents: {
|
|
|
52
57
|
PRODUCT_DETACHED: "product.detached";
|
|
53
58
|
PRODUCT_VARIANT_DETACHED: "product-variant.detached";
|
|
54
59
|
PRODUCT_OPTION_DETACHED: "product-option.detached";
|
|
60
|
+
PRODUCT_PRODUCT_OPTION_DETACHED: "product-product-option.detached";
|
|
55
61
|
PRODUCT_OPTION_VALUE_DETACHED: "product-option-value.detached";
|
|
56
62
|
PRODUCT_TYPE_DETACHED: "product-type.detached";
|
|
57
63
|
PRODUCT_TAG_DETACHED: "product-tag.detached";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/product/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/product/events.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGzB,CAAA"}
|
package/dist/product/events.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/product/events.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAC5D,gDAAwC;AAExC,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/product/events.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAC5D,gDAAwC;AAExC,MAAM,cAAc,GAWhB;IACF,SAAS;IACT,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,oBAAoB;IACpB,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,mBAAmB;IACnB,cAAc;CACf,CAAA;AAEY,QAAA,aAAa,GAAG,IAAA,yCAA6B,EACxD,cAAc,EACd,qBAAO,CAAC,OAAO,CAChB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/utils",
|
|
3
|
-
"version": "3.0.0-snapshot-
|
|
3
|
+
"version": "3.0.0-snapshot-20251106143524",
|
|
4
4
|
"description": "Medusa utilities functions shared by Medusa core and Modules",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"author": "Medusa",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@medusajs/types": "3.0.0-snapshot-
|
|
29
|
+
"@medusajs/types": "3.0.0-snapshot-20251106143524",
|
|
30
30
|
"express": "^4.21.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@graphql-codegen/typescript": "^4.0.9",
|
|
35
35
|
"@graphql-tools/merge": "^9.0.7",
|
|
36
36
|
"@graphql-tools/schema": "^10.0.6",
|
|
37
|
-
"@medusajs/deps": "3.0.0-snapshot-
|
|
37
|
+
"@medusajs/deps": "3.0.0-snapshot-20251106143524",
|
|
38
38
|
"@types/pluralize": "^0.0.33",
|
|
39
39
|
"bignumber.js": "^9.1.2",
|
|
40
40
|
"dotenv": "^16.4.5",
|