@modular-circuit/middleware 0.0.26 → 0.0.28
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/build/bom/bom_match.js +2 -0
- package/build/bom/index.js +17 -1
- package/build/index.js +18 -2
- package/build/mock/index.js +18 -2
- package/build/mock/module_circuits/index.js +40 -3
- package/build/mock/module_circuits_categories/index.js +38 -2
- package/build/registry/default_registry_mgr.js +7 -3
- package/build/registry/http_registry.js +10 -6
- package/build/registry/index.js +19 -3
- package/build/registry/registry_mgr.js +2 -0
- package/build/utils/index.js +8 -3
- package/package.json +3 -3
package/build/bom/bom_match.js
CHANGED
package/build/bom/index.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bom_match"), exports);
|
package/build/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./registry"), exports);
|
|
18
|
+
__exportStar(require("./bom"), exports);
|
package/build/mock/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./module_circuits"), exports);
|
|
18
|
+
__exportStar(require("./module_circuits_categories"), exports);
|
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Test_Module_B = exports.Test_Module_A = void 0;
|
|
37
|
+
const Test_Module_A = Promise.resolve().then(() => __importStar(require('./test_module_a.json')));
|
|
38
|
+
exports.Test_Module_A = Test_Module_A;
|
|
39
|
+
const Test_Module_B = Promise.resolve().then(() => __importStar(require('./test_module_b.json')));
|
|
40
|
+
exports.Test_Module_B = Test_Module_B;
|
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Categories = void 0;
|
|
37
|
+
const Categories = Promise.resolve().then(() => __importStar(require('./categories.json')));
|
|
38
|
+
exports.Categories = Categories;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultRegistryMgr = void 0;
|
|
4
|
+
const http_registry_1 = require("./http_registry");
|
|
5
|
+
class DefaultRegistryMgr {
|
|
3
6
|
registries = [];
|
|
4
7
|
constructor(http_registries) {
|
|
5
8
|
for (const cnf of http_registries) {
|
|
6
|
-
this.registries.push(new HttpRegistry(cnf));
|
|
9
|
+
this.registries.push(new http_registry_1.HttpRegistry(cnf));
|
|
7
10
|
}
|
|
8
11
|
}
|
|
9
12
|
async get_available_registries() {
|
|
@@ -22,3 +25,4 @@ export class DefaultRegistryMgr {
|
|
|
22
25
|
}, Promise.resolve(undefined));
|
|
23
26
|
}
|
|
24
27
|
}
|
|
28
|
+
exports.DefaultRegistryMgr = DefaultRegistryMgr;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpRegistry = void 0;
|
|
4
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
5
|
+
const utils_2 = require("../utils");
|
|
6
|
+
class HttpRegistry {
|
|
4
7
|
cnf;
|
|
5
8
|
zip_origin;
|
|
6
9
|
module_caches = {};
|
|
@@ -9,7 +12,7 @@ export class HttpRegistry {
|
|
|
9
12
|
this.zip_origin = cnf.zip_origin ?? cnf.module_achieve_url.origin;
|
|
10
13
|
}
|
|
11
14
|
async get_module_achieve(idx) {
|
|
12
|
-
const it = await do_fetch(this.cnf.module_achieve_url, idx);
|
|
15
|
+
const it = await (0, utils_2.do_fetch)(this.cnf.module_achieve_url, idx);
|
|
13
16
|
const pp = (await it.json()).result;
|
|
14
17
|
if (!pp)
|
|
15
18
|
return;
|
|
@@ -17,10 +20,11 @@ export class HttpRegistry {
|
|
|
17
20
|
return new URL(full);
|
|
18
21
|
}
|
|
19
22
|
async get_module_circuit(idx) {
|
|
20
|
-
const module_idx = stringify_dependency(idx);
|
|
23
|
+
const module_idx = (0, utils_1.stringify_dependency)(idx);
|
|
21
24
|
if (module_idx in this.module_caches)
|
|
22
25
|
return this.module_caches[module_idx];
|
|
23
|
-
const it = await do_fetch(this.cnf.module_circuit_url, idx);
|
|
26
|
+
const it = await (0, utils_2.do_fetch)(this.cnf.module_circuit_url, idx);
|
|
24
27
|
return (await it.json()).result;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
30
|
+
exports.HttpRegistry = HttpRegistry;
|
package/build/registry/index.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./default_registry_mgr"), exports);
|
|
18
|
+
__exportStar(require("./http_registry"), exports);
|
|
19
|
+
__exportStar(require("./registry_mgr"), exports);
|
package/build/utils/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fmt_parameter_to_url = void 0;
|
|
4
|
+
exports.do_fetch = do_fetch;
|
|
5
|
+
const fmt_parameter_to_url = (params) => {
|
|
2
6
|
return Object.entries(params)
|
|
3
7
|
.map(([k, v]) => `${k}=${v}`)
|
|
4
8
|
.join('&');
|
|
5
9
|
};
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
exports.fmt_parameter_to_url = fmt_parameter_to_url;
|
|
11
|
+
function do_fetch(url, params) {
|
|
12
|
+
return fetch(`${url}?${(0, exports.fmt_parameter_to_url)(params)}`);
|
|
8
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modular-circuit/middleware",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "Intermediate representation of the modular circuit",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"typescript": "^5.4.5"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@modular-circuit/ir": "0.0.
|
|
28
|
-
"@modular-circuit/utils": "0.0.
|
|
27
|
+
"@modular-circuit/ir": "0.0.54",
|
|
28
|
+
"@modular-circuit/utils": "0.0.32"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"clean": "rimraf build",
|