@xyo-network/manifest 2.57.4
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/LICENSE +165 -0
- package/README.md +13 -0
- package/dist/cjs/ManifestWrapper.js +75 -0
- package/dist/cjs/ManifestWrapper.js.map +1 -0
- package/dist/cjs/ModuleFactory.js +15 -0
- package/dist/cjs/ModuleFactory.js.map +1 -0
- package/dist/cjs/Payload.js +5 -0
- package/dist/cjs/Payload.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/docs.json +8 -0
- package/dist/esm/ManifestWrapper.js +56 -0
- package/dist/esm/ManifestWrapper.js.map +1 -0
- package/dist/esm/ModuleFactory.js +12 -0
- package/dist/esm/ModuleFactory.js.map +1 -0
- package/dist/esm/Payload.js +2 -0
- package/dist/esm/Payload.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/ManifestWrapper.d.ts +40 -0
- package/dist/types/ManifestWrapper.d.ts.map +1 -0
- package/dist/types/ModuleFactory.d.ts +3 -0
- package/dist/types/ModuleFactory.d.ts.map +1 -0
- package/dist/types/Payload.d.ts +26 -0
- package/dist/types/Payload.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +62 -0
- package/src/ManifestWrapper.ts +90 -0
- package/src/ModuleFactory.ts +12 -0
- package/src/Payload.ts +33 -0
- package/src/index.ts +0 -0
- package/src/schema.json +197 -0
- package/src/spec/simple-node-indirect-manifest.json +38 -0
- package/src/spec/simple-node-inline-manifest.json +30 -0
- package/typedoc.json +5 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[![logo][]](https://xyo.network)
|
|
2
|
+
|
|
3
|
+
Part of [sdk-xyo-clint-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
|
|
4
|
+
|
|
5
|
+
## License
|
|
6
|
+
|
|
7
|
+
> See the [LICENSE](LICENSE) file for license details
|
|
8
|
+
|
|
9
|
+
## Credits
|
|
10
|
+
|
|
11
|
+
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
12
|
+
|
|
13
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManifestWrapper = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const assert_1 = require("@xylabs/assert");
|
|
6
|
+
const node_1 = require("@xyo-network/node");
|
|
7
|
+
const payload_wrapper_1 = require("@xyo-network/payload-wrapper");
|
|
8
|
+
const ModuleFactory_1 = require("./ModuleFactory");
|
|
9
|
+
class ManifestWrapper extends payload_wrapper_1.PayloadWrapper {
|
|
10
|
+
dAppManifest(id) {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = this.payload.dapps) === null || _a === void 0 ? void 0 : _a.find((dapp) => dapp.id === id);
|
|
13
|
+
}
|
|
14
|
+
loadDappFromId(node, id, additionalCreatableModules) {
|
|
15
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
return yield this.loadDappFromManifest(node, (0, assert_1.assertEx)(this.dAppManifest(id), 'Failed to find dApp Manifest'), additionalCreatableModules);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
loadDappFromManifest(node, manifest, additionalCreatableModules) {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f;
|
|
21
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const nodeWrapper = node_1.NodeWrapper.wrap(node);
|
|
23
|
+
// Load Private Modules
|
|
24
|
+
yield Promise.all((_c = (_b = (_a = manifest.modules) === null || _a === void 0 ? void 0 : _a.private) === null || _b === void 0 ? void 0 : _b.map((moduleManifest) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield this.loadModule(nodeWrapper, (0, assert_1.assertEx)(this.resolveModuleManifest(moduleManifest), 'Unable to resolve module manifest'), false, additionalCreatableModules);
|
|
26
|
+
}))) !== null && _c !== void 0 ? _c : [() => null]);
|
|
27
|
+
// Load Public Modules
|
|
28
|
+
yield Promise.all((_f = (_e = (_d = manifest.modules) === null || _d === void 0 ? void 0 : _d.public) === null || _e === void 0 ? void 0 : _e.map((moduleManifest) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
yield this.loadModule(nodeWrapper, (0, assert_1.assertEx)(this.resolveModuleManifest(moduleManifest), 'Unable to resolve module manifest'), true, additionalCreatableModules);
|
|
30
|
+
}))) !== null && _f !== void 0 ? _f : [() => null]);
|
|
31
|
+
return node;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
loadDapps(node, additionalCreatableModules) {
|
|
35
|
+
var _a;
|
|
36
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
return yield Promise.all((_a = this.payload.dapps) === null || _a === void 0 ? void 0 : _a.map((dappManifest) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const subNode = yield node_1.MemoryNode.create();
|
|
39
|
+
yield (node === null || node === void 0 ? void 0 : node.register(subNode));
|
|
40
|
+
yield this.loadDappFromManifest(subNode, dappManifest, additionalCreatableModules);
|
|
41
|
+
return subNode;
|
|
42
|
+
})));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
loadModule(node, manifest, external = true, additionalCreatableModules) {
|
|
46
|
+
var _a;
|
|
47
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const creatableModules = Object.assign(Object.assign({}, ModuleFactory_1.standardCreatableModules), additionalCreatableModules);
|
|
49
|
+
const nodeWrapper = node_1.NodeWrapper.wrap(node);
|
|
50
|
+
if (!manifest.name || (yield (external ? nodeWrapper.downResolver : nodeWrapper.upResolver).resolve({ name: [manifest.name] })).length === 0) {
|
|
51
|
+
if (manifest.language && manifest.language === 'javascript') {
|
|
52
|
+
const id = manifest.id;
|
|
53
|
+
(0, assert_1.assertEx)((_a = (manifest.name && (yield node.attach(manifest.name, external)))) !== null && _a !== void 0 ? _a : (id ? yield node.attach((yield this.registerModule(node, manifest, creatableModules)).address, external) : undefined), `No module named [${manifest.name}] registered`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
registerModule(node, manifest, creatableModules) {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const creatableModule = (0, assert_1.assertEx)(creatableModules === null || creatableModules === void 0 ? void 0 : creatableModules[(0, assert_1.assertEx)(manifest.id, 'Attempting to create a module without an id')], `No module with [${manifest.id}] id available for registration`);
|
|
61
|
+
const module = yield creatableModule.create(manifest.config ? { config: manifest.config } : undefined);
|
|
62
|
+
yield node.module.register(module);
|
|
63
|
+
return module;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
resolveModuleManifest(manifest) {
|
|
67
|
+
var _a;
|
|
68
|
+
if ((manifest === null || manifest === void 0 ? void 0 : manifest.name) && !manifest.id) {
|
|
69
|
+
return (_a = this.payload.modules) === null || _a === void 0 ? void 0 : _a[manifest.name];
|
|
70
|
+
}
|
|
71
|
+
return manifest;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.ManifestWrapper = ManifestWrapper;
|
|
75
|
+
//# sourceMappingURL=ManifestWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManifestWrapper.js","sourceRoot":"","sources":["../../src/ManifestWrapper.ts"],"names":[],"mappings":";;;;AAAA,2CAAyC;AAEzC,4CAA2D;AAC3D,kEAA6D;AAE7D,mDAA0D;AAG1D,MAAa,eAAgB,SAAQ,gCAA+B;IAClE,YAAY,CAAC,EAAU;;QACrB,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,KAAK,0CAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3D,CAAC;IAEK,cAAc,CAAC,IAAgB,EAAE,EAAU,EAAE,0BAAsD;;YACvG,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,I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AC,CAAC,CAAC,CAAC,SAAS,CAAC,EACvH,oBAAoB,QAAQ,CAAC,IAAI,cAAc,CAChD,CAAA;iBACF;aACF;;KACF;IAEK,cAAc,CAAC,IAA6B,EAAE,QAAwB,EAAE,gBAA4C;;YACxH,MAAM,eAAe,GAAG,IAAA,iBAAQ,EAC9B,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAG,IAAA,iBAAQ,EAAC,QAAQ,CAAC,EAAE,EAAE,6CAA6C,CAAC,CAAC,EACxF,mBAAmB,QAAQ,CAAC,EAAE,iCAAiC,CAChE,CAAA;YAED,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;YACtG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;YAClC,OAAO,MAAM,CAAA;QACf,CAAC;KAAA;IAED,qBAAqB,CAAC,QAAyB;;QAC7C,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,KAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAClC,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,OAAO,0CAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;SAC7C;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAjFD,0CAiFC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.standardCreatableModules = void 0;
|
|
4
|
+
const http_bridge_1 = require("@xyo-network/http-bridge");
|
|
5
|
+
const memory_archivist_1 = require("@xyo-network/memory-archivist");
|
|
6
|
+
const module_1 = require("@xyo-network/module");
|
|
7
|
+
const node_1 = require("@xyo-network/node");
|
|
8
|
+
const sentinel_1 = require("@xyo-network/sentinel");
|
|
9
|
+
exports.standardCreatableModules = {
|
|
10
|
+
'network.xyo.archivist': memory_archivist_1.MemoryArchivist,
|
|
11
|
+
'network.xyo.bridge.http': module_1.ModuleFactory.withParams(http_bridge_1.HttpBridge, { config: { schema: http_bridge_1.HttpBridge.configSchema } }),
|
|
12
|
+
'network.xyo.node': node_1.MemoryNode,
|
|
13
|
+
'network.xyo.sentinel': sentinel_1.MemorySentinel,
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=ModuleFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleFactory.js","sourceRoot":"","sources":["../../src/ModuleFactory.ts"],"names":[],"mappings":";;;AAAA,0DAAqD;AACrD,oEAA+D;AAC/D,gDAA8E;AAC9E,4CAA8C;AAC9C,oDAAsD;AAEzC,QAAA,wBAAwB,GAA8B;IACjE,uBAAuB,EAAE,kCAAe;IACxC,yBAAyB,EAAE,sBAAa,CAAC,UAAU,CAAC,wBAAU,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,wBAAU,CAAC,YAAY,EAAE,EAAE,CAAC;IAChH,kBAAkB,EAAE,iBAAU;IAC9B,sBAAsB,EAAE,yBAAc;CACvC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Payload.js","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":";;;AAIa,QAAA,qBAAqB,GAA0B,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { assertEx } from '@xylabs/assert';
|
|
2
|
+
import { MemoryNode, NodeWrapper } from '@xyo-network/node';
|
|
3
|
+
import { PayloadWrapper } from '@xyo-network/payload-wrapper';
|
|
4
|
+
import { standardCreatableModules } from './ModuleFactory';
|
|
5
|
+
export class ManifestWrapper extends PayloadWrapper {
|
|
6
|
+
dAppManifest(id) {
|
|
7
|
+
return this.payload.dapps?.find((dapp) => dapp.id === id);
|
|
8
|
+
}
|
|
9
|
+
async loadDappFromId(node, id, additionalCreatableModules) {
|
|
10
|
+
return await this.loadDappFromManifest(node, assertEx(this.dAppManifest(id), 'Failed to find dApp Manifest'), additionalCreatableModules);
|
|
11
|
+
}
|
|
12
|
+
async loadDappFromManifest(node, manifest, additionalCreatableModules) {
|
|
13
|
+
const nodeWrapper = NodeWrapper.wrap(node);
|
|
14
|
+
// Load Private Modules
|
|
15
|
+
await Promise.all(manifest.modules?.private?.map(async (moduleManifest) => {
|
|
16
|
+
await this.loadModule(nodeWrapper, assertEx(this.resolveModuleManifest(moduleManifest), 'Unable to resolve module manifest'), false, additionalCreatableModules);
|
|
17
|
+
}) ?? [() => null]);
|
|
18
|
+
// Load Public Modules
|
|
19
|
+
await Promise.all(manifest.modules?.public?.map(async (moduleManifest) => {
|
|
20
|
+
await this.loadModule(nodeWrapper, assertEx(this.resolveModuleManifest(moduleManifest), 'Unable to resolve module manifest'), true, additionalCreatableModules);
|
|
21
|
+
}) ?? [() => null]);
|
|
22
|
+
return node;
|
|
23
|
+
}
|
|
24
|
+
async loadDapps(node, additionalCreatableModules) {
|
|
25
|
+
return await Promise.all(this.payload.dapps?.map(async (dappManifest) => {
|
|
26
|
+
const subNode = await MemoryNode.create();
|
|
27
|
+
await node?.register(subNode);
|
|
28
|
+
await this.loadDappFromManifest(subNode, dappManifest, additionalCreatableModules);
|
|
29
|
+
return subNode;
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
async loadModule(node, manifest, external = true, additionalCreatableModules) {
|
|
33
|
+
const creatableModules = { ...standardCreatableModules, ...additionalCreatableModules };
|
|
34
|
+
const nodeWrapper = NodeWrapper.wrap(node);
|
|
35
|
+
if (!manifest.name || (await (external ? nodeWrapper.downResolver : nodeWrapper.upResolver).resolve({ name: [manifest.name] })).length === 0) {
|
|
36
|
+
if (manifest.language && manifest.language === 'javascript') {
|
|
37
|
+
const id = manifest.id;
|
|
38
|
+
assertEx((manifest.name && (await node.attach(manifest.name, external))) ??
|
|
39
|
+
(id ? await node.attach((await this.registerModule(node, manifest, creatableModules)).address, external) : undefined), `No module named [${manifest.name}] registered`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async registerModule(node, manifest, creatableModules) {
|
|
44
|
+
const creatableModule = assertEx(creatableModules?.[assertEx(manifest.id, 'Attempting to create a module without an id')], `No module with [${manifest.id}] id available for registration`);
|
|
45
|
+
const module = await creatableModule.create(manifest.config ? { config: manifest.config } : undefined);
|
|
46
|
+
await node.module.register(module);
|
|
47
|
+
return module;
|
|
48
|
+
}
|
|
49
|
+
resolveModuleManifest(manifest) {
|
|
50
|
+
if (manifest?.name && !manifest.id) {
|
|
51
|
+
return this.payload.modules?.[manifest.name];
|
|
52
|
+
}
|
|
53
|
+
return manifest;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=ManifestWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManifestWrapper.js","sourceRoot":"","sources":["../../src/ManifestWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAG1D,MAAM,OAAO,eAAgB,SAAQ,cAA+B;IAClE,YAAY,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3D,CAAC;IAED,KA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AO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EACvH,oBAAoB,QAAQ,CAAC,IAAI,cAAc,CAChD,CAAA;aACF;SACF;IACH,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,IAA6B,EAAE,QAAwB,EAAE,gBAA4C;QACxH,MAAM,eAAe,GAAG,QAAQ,CAC9B,gBAAgB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,6CAA6C,CAAC,CAAC,EACxF,mBAAmB,QAAQ,CAAC,EAAE,iCAAiC,CAChE,CAAA;QAED,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QACtG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAClC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,qBAAqB,CAAC,QAAyB;QAC7C,IAAI,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAClC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;SAC7C;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpBridge } from '@xyo-network/http-bridge';
|
|
2
|
+
import { MemoryArchivist } from '@xyo-network/memory-archivist';
|
|
3
|
+
import { ModuleFactory } from '@xyo-network/module';
|
|
4
|
+
import { MemoryNode } from '@xyo-network/node';
|
|
5
|
+
import { MemorySentinel } from '@xyo-network/sentinel';
|
|
6
|
+
export const standardCreatableModules = {
|
|
7
|
+
'network.xyo.archivist': MemoryArchivist,
|
|
8
|
+
'network.xyo.bridge.http': ModuleFactory.withParams(HttpBridge, { config: { schema: HttpBridge.configSchema } }),
|
|
9
|
+
'network.xyo.node': MemoryNode,
|
|
10
|
+
'network.xyo.sentinel': MemorySentinel,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=ModuleFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleFactory.js","sourceRoot":"","sources":["../../src/ModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAA6B,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,CAAC,MAAM,wBAAwB,GAA8B;IACjE,uBAAuB,EAAE,eAAe;IACxC,yBAAyB,EAAE,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;IAChH,kBAAkB,EAAE,UAAU;IAC9B,sBAAsB,EAAE,cAAc;CACvC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Payload.js","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,qBAAqB,GAA0B,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CreatableModuleDictionary } from '@xyo-network/module';
|
|
2
|
+
import { MemoryNode, NodeWrapper } from '@xyo-network/node';
|
|
3
|
+
import { PayloadWrapper } from '@xyo-network/payload-wrapper';
|
|
4
|
+
import { DappManifest, ManifestPayload, ModuleManifest } from './Payload';
|
|
5
|
+
export declare class ManifestWrapper extends PayloadWrapper<ManifestPayload> {
|
|
6
|
+
dAppManifest(id: string): DappManifest | undefined;
|
|
7
|
+
loadDappFromId(node: MemoryNode, id: string, additionalCreatableModules?: CreatableModuleDictionary): Promise<MemoryNode<import("@xyo-network/node").MemoryNodeParams, import("@xyo-network/node").NodeModuleEventData>>;
|
|
8
|
+
loadDappFromManifest(node: MemoryNode, manifest: DappManifest, additionalCreatableModules?: CreatableModuleDictionary): Promise<MemoryNode<import("@xyo-network/node").MemoryNodeParams, import("@xyo-network/node").NodeModuleEventData>>;
|
|
9
|
+
loadDapps(node?: MemoryNode, additionalCreatableModules?: CreatableModuleDictionary): Promise<MemoryNode<import("@xyo-network/node").MemoryNodeParams, import("@xyo-network/node").NodeModuleEventData>[]>;
|
|
10
|
+
loadModule(node: NodeWrapper<MemoryNode>, manifest: ModuleManifest, external?: boolean, additionalCreatableModules?: CreatableModuleDictionary): Promise<void>;
|
|
11
|
+
registerModule(node: NodeWrapper<MemoryNode>, manifest: ModuleManifest, creatableModules?: CreatableModuleDictionary): Promise<import("@xyo-network/module").Module<import("@xyo-network/module").ModuleParams<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
paging?: Record<string, {
|
|
14
|
+
size?: number | undefined;
|
|
15
|
+
}> | undefined;
|
|
16
|
+
schema: string;
|
|
17
|
+
security?: {
|
|
18
|
+
allowAnonymous?: boolean | undefined;
|
|
19
|
+
allowed?: Record<string, (string | import("@xyo-network/module").CosigningAddressSet)[]> | undefined;
|
|
20
|
+
disallowed?: Record<string, string[]> | undefined;
|
|
21
|
+
} | undefined;
|
|
22
|
+
storeQueries?: boolean | undefined;
|
|
23
|
+
} & Omit<Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
paging?: Record<string, {
|
|
26
|
+
size?: number | undefined;
|
|
27
|
+
}> | undefined;
|
|
28
|
+
schema: "network.xyo.module.config";
|
|
29
|
+
security?: {
|
|
30
|
+
allowAnonymous?: boolean | undefined;
|
|
31
|
+
allowed?: Record<string, (string | import("@xyo-network/module").CosigningAddressSet)[]> | undefined;
|
|
32
|
+
disallowed?: Record<string, string[]> | undefined;
|
|
33
|
+
} | undefined;
|
|
34
|
+
storeQueries?: boolean | undefined;
|
|
35
|
+
} & Omit<undefined, "schema">, "schema"> & {
|
|
36
|
+
schema: string;
|
|
37
|
+
}, "schema">, undefined>, import("@xyo-network/module").ModuleEventData>>;
|
|
38
|
+
resolveModuleManifest(manifest?: ModuleManifest): ModuleManifest | undefined;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ManifestWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManifestWrapper.d.ts","sourceRoot":"","sources":["../../src/ManifestWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAG7D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEzE,qBAAa,eAAgB,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE,YAAY,CAAC,EAAE,EAAE,MAAM;IAIjB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,0BAA0B,CAAC,EAAE,yBAAyB;IAInG,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,0BAA0B,CAAC,EAAE,yBAAyB;IA6BrH,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,0BAA0B,CAAC,EAAE,yBAAyB;IAWnF,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,UAAO,EAAE,0BAA0B,CAAC,EAAE,yBAAyB;IAe3I,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,CAAC,EAAE,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;IAW1H,qBAAqB,CAAC,QAAQ,CAAC,EAAE,cAAc;CAMhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleFactory.d.ts","sourceRoot":"","sources":["../../src/ModuleFactory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAiB,MAAM,qBAAqB,CAAA;AAI9E,eAAO,MAAM,wBAAwB,EAAE,yBAKtC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ModuleConfig } from '@xyo-network/module-model';
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
export type ManifestPayloadSchema = 'network.xyo.manifest';
|
|
4
|
+
export declare const ManifestPayloadSchema: ManifestPayloadSchema;
|
|
5
|
+
export interface Manifest {
|
|
6
|
+
description?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DappManifest extends Manifest {
|
|
11
|
+
modules?: {
|
|
12
|
+
private?: ModuleManifest[];
|
|
13
|
+
public?: ModuleManifest[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ModuleManifest extends Manifest {
|
|
17
|
+
config?: ModuleConfig;
|
|
18
|
+
features?: string[];
|
|
19
|
+
language?: string;
|
|
20
|
+
os?: string;
|
|
21
|
+
}
|
|
22
|
+
export type ManifestPayload = Payload<{
|
|
23
|
+
dapps: DappManifest[];
|
|
24
|
+
modules?: Record<string, ModuleManifest>;
|
|
25
|
+
}, ManifestPayloadSchema>;
|
|
26
|
+
//# sourceMappingURL=Payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAA;AAC1D,eAAO,MAAM,qBAAqB,EAAE,qBAA8C,CAAA;AAElF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;QAC1B,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;KAC1B,CAAA;CACF;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC;IACE,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CACzC,EACD,qBAAqB,CACtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": {
|
|
3
|
+
"email": "support@xyo.network",
|
|
4
|
+
"name": "XYO Development Team",
|
|
5
|
+
"url": "https://xyo.network"
|
|
6
|
+
},
|
|
7
|
+
"bugs": {
|
|
8
|
+
"email": "support@xyo.network",
|
|
9
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
10
|
+
},
|
|
11
|
+
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
12
|
+
"browser": "dist/esm/index.js",
|
|
13
|
+
"docs": "dist/docs.json",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@xylabs/assert": "^2.7.6",
|
|
16
|
+
"@xyo-network/http-bridge": "^2.57.4",
|
|
17
|
+
"@xyo-network/memory-archivist": "^2.57.4",
|
|
18
|
+
"@xyo-network/module": "^2.57.4",
|
|
19
|
+
"@xyo-network/module-model": "^2.57.4",
|
|
20
|
+
"@xyo-network/node": "^2.57.4",
|
|
21
|
+
"@xyo-network/payload-model": "^2.57.4",
|
|
22
|
+
"@xyo-network/payload-wrapper": "^2.57.4",
|
|
23
|
+
"@xyo-network/sentinel": "^2.57.4"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@xylabs/ts-scripts-yarn3": "^2.17.12",
|
|
27
|
+
"@xylabs/tsconfig": "^2.17.12",
|
|
28
|
+
"typescript": "^5.0.4"
|
|
29
|
+
},
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"node": {
|
|
33
|
+
"import": "./dist/esm/index.js",
|
|
34
|
+
"require": "./dist/cjs/index.js"
|
|
35
|
+
},
|
|
36
|
+
"browser": {
|
|
37
|
+
"import": "./dist/esm/index.js",
|
|
38
|
+
"require": "./dist/cjs/index.js"
|
|
39
|
+
},
|
|
40
|
+
"default": "./dist/esm/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./dist/docs.json": {
|
|
43
|
+
"default": "./dist/docs.json"
|
|
44
|
+
},
|
|
45
|
+
"./package.json": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
"main": "dist/cjs/index.js",
|
|
48
|
+
"module": "dist/esm/index.js",
|
|
49
|
+
"homepage": "https://xyo.network",
|
|
50
|
+
"license": "LGPL-3.0",
|
|
51
|
+
"name": "@xyo-network/manifest",
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
58
|
+
},
|
|
59
|
+
"sideEffects": false,
|
|
60
|
+
"types": "dist/types/index.d.ts",
|
|
61
|
+
"version": "2.57.4"
|
|
62
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { assertEx } from '@xylabs/assert'
|
|
2
|
+
import { CreatableModuleDictionary } from '@xyo-network/module'
|
|
3
|
+
import { MemoryNode, NodeWrapper } from '@xyo-network/node'
|
|
4
|
+
import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
5
|
+
|
|
6
|
+
import { standardCreatableModules } from './ModuleFactory'
|
|
7
|
+
import { DappManifest, ManifestPayload, ModuleManifest } from './Payload'
|
|
8
|
+
|
|
9
|
+
export class ManifestWrapper extends PayloadWrapper<ManifestPayload> {
|
|
10
|
+
dAppManifest(id: string) {
|
|
11
|
+
return this.payload.dapps?.find((dapp) => dapp.id === id)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async loadDappFromId(node: MemoryNode, id: string, additionalCreatableModules?: CreatableModuleDictionary) {
|
|
15
|
+
return await this.loadDappFromManifest(node, assertEx(this.dAppManifest(id), 'Failed to find dApp Manifest'), additionalCreatableModules)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async loadDappFromManifest(node: MemoryNode, manifest: DappManifest, additionalCreatableModules?: CreatableModuleDictionary) {
|
|
19
|
+
const nodeWrapper = NodeWrapper.wrap<NodeWrapper<MemoryNode>>(node)
|
|
20
|
+
// Load Private Modules
|
|
21
|
+
await Promise.all(
|
|
22
|
+
manifest.modules?.private?.map(async (moduleManifest) => {
|
|
23
|
+
await this.loadModule(
|
|
24
|
+
nodeWrapper,
|
|
25
|
+
assertEx(this.resolveModuleManifest(moduleManifest), 'Unable to resolve module manifest'),
|
|
26
|
+
false,
|
|
27
|
+
additionalCreatableModules,
|
|
28
|
+
)
|
|
29
|
+
}) ?? [() => null],
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
// Load Public Modules
|
|
33
|
+
await Promise.all(
|
|
34
|
+
manifest.modules?.public?.map(async (moduleManifest) => {
|
|
35
|
+
await this.loadModule(
|
|
36
|
+
nodeWrapper,
|
|
37
|
+
assertEx(this.resolveModuleManifest(moduleManifest), 'Unable to resolve module manifest'),
|
|
38
|
+
true,
|
|
39
|
+
additionalCreatableModules,
|
|
40
|
+
)
|
|
41
|
+
}) ?? [() => null],
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
return node
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async loadDapps(node?: MemoryNode, additionalCreatableModules?: CreatableModuleDictionary) {
|
|
48
|
+
return await Promise.all(
|
|
49
|
+
this.payload.dapps?.map(async (dappManifest) => {
|
|
50
|
+
const subNode = await MemoryNode.create()
|
|
51
|
+
await node?.register(subNode)
|
|
52
|
+
await this.loadDappFromManifest(subNode, dappManifest, additionalCreatableModules)
|
|
53
|
+
return subNode
|
|
54
|
+
}),
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async loadModule(node: NodeWrapper<MemoryNode>, manifest: ModuleManifest, external = true, additionalCreatableModules?: CreatableModuleDictionary) {
|
|
59
|
+
const creatableModules = { ...standardCreatableModules, ...additionalCreatableModules }
|
|
60
|
+
const nodeWrapper = NodeWrapper.wrap(node)
|
|
61
|
+
if (!manifest.name || (await (external ? nodeWrapper.downResolver : nodeWrapper.upResolver).resolve({ name: [manifest.name] })).length === 0) {
|
|
62
|
+
if (manifest.language && manifest.language === 'javascript') {
|
|
63
|
+
const id = manifest.id
|
|
64
|
+
assertEx(
|
|
65
|
+
(manifest.name && (await node.attach(manifest.name, external))) ??
|
|
66
|
+
(id ? await node.attach((await this.registerModule(node, manifest, creatableModules)).address, external) : undefined),
|
|
67
|
+
`No module named [${manifest.name}] registered`,
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async registerModule(node: NodeWrapper<MemoryNode>, manifest: ModuleManifest, creatableModules?: CreatableModuleDictionary) {
|
|
74
|
+
const creatableModule = assertEx(
|
|
75
|
+
creatableModules?.[assertEx(manifest.id, 'Attempting to create a module without an id')],
|
|
76
|
+
`No module with [${manifest.id}] id available for registration`,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
const module = await creatableModule.create(manifest.config ? { config: manifest.config } : undefined)
|
|
80
|
+
await node.module.register(module)
|
|
81
|
+
return module
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
resolveModuleManifest(manifest?: ModuleManifest) {
|
|
85
|
+
if (manifest?.name && !manifest.id) {
|
|
86
|
+
return this.payload.modules?.[manifest.name]
|
|
87
|
+
}
|
|
88
|
+
return manifest
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpBridge } from '@xyo-network/http-bridge'
|
|
2
|
+
import { MemoryArchivist } from '@xyo-network/memory-archivist'
|
|
3
|
+
import { CreatableModuleDictionary, ModuleFactory } from '@xyo-network/module'
|
|
4
|
+
import { MemoryNode } from '@xyo-network/node'
|
|
5
|
+
import { MemorySentinel } from '@xyo-network/sentinel'
|
|
6
|
+
|
|
7
|
+
export const standardCreatableModules: CreatableModuleDictionary = {
|
|
8
|
+
'network.xyo.archivist': MemoryArchivist,
|
|
9
|
+
'network.xyo.bridge.http': ModuleFactory.withParams(HttpBridge, { config: { schema: HttpBridge.configSchema } }),
|
|
10
|
+
'network.xyo.node': MemoryNode,
|
|
11
|
+
'network.xyo.sentinel': MemorySentinel,
|
|
12
|
+
}
|
package/src/Payload.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ModuleConfig } from '@xyo-network/module-model'
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
3
|
+
|
|
4
|
+
export type ManifestPayloadSchema = 'network.xyo.manifest'
|
|
5
|
+
export const ManifestPayloadSchema: ManifestPayloadSchema = 'network.xyo.manifest'
|
|
6
|
+
|
|
7
|
+
export interface Manifest {
|
|
8
|
+
description?: string
|
|
9
|
+
id?: string
|
|
10
|
+
name?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface DappManifest extends Manifest {
|
|
14
|
+
modules?: {
|
|
15
|
+
private?: ModuleManifest[]
|
|
16
|
+
public?: ModuleManifest[]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ModuleManifest extends Manifest {
|
|
21
|
+
config?: ModuleConfig
|
|
22
|
+
features?: string[]
|
|
23
|
+
language?: string
|
|
24
|
+
os?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type ManifestPayload = Payload<
|
|
28
|
+
{
|
|
29
|
+
dapps: DappManifest[]
|
|
30
|
+
modules?: Record<string, ModuleManifest>
|
|
31
|
+
},
|
|
32
|
+
ManifestPayloadSchema
|
|
33
|
+
>
|
package/src/index.ts
ADDED
|
File without changes
|
package/src/schema.json
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"additionalProperties": false,
|
|
4
|
+
"definitions": {
|
|
5
|
+
"dapp": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"description": "dApp Definition - Generally loaded into an existing or new Node Module",
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"properties": {
|
|
12
|
+
"description": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"modules": {
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"description": "dApp Modules",
|
|
18
|
+
"properties": {
|
|
19
|
+
"private": {
|
|
20
|
+
"$ref": "#/definitions/modules"
|
|
21
|
+
},
|
|
22
|
+
"public": {
|
|
23
|
+
"$ref": "#/definitions/modules"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"required": [],
|
|
27
|
+
"type": "object"
|
|
28
|
+
},
|
|
29
|
+
"name": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": [],
|
|
34
|
+
"type": "object"
|
|
35
|
+
},
|
|
36
|
+
"dapps": {
|
|
37
|
+
"description": "List of dApps",
|
|
38
|
+
"items": {
|
|
39
|
+
"$ref": "#/definitions/dapp"
|
|
40
|
+
},
|
|
41
|
+
"nullable": true,
|
|
42
|
+
"type": "array"
|
|
43
|
+
},
|
|
44
|
+
"feature": {
|
|
45
|
+
"description": "Framework",
|
|
46
|
+
"enum": [
|
|
47
|
+
"angular",
|
|
48
|
+
"asp.net",
|
|
49
|
+
"browser",
|
|
50
|
+
"cryengine",
|
|
51
|
+
"corona",
|
|
52
|
+
"django",
|
|
53
|
+
"flutter",
|
|
54
|
+
"ionic",
|
|
55
|
+
"jquery",
|
|
56
|
+
"nodejs",
|
|
57
|
+
"phonegap",
|
|
58
|
+
"react",
|
|
59
|
+
"react-native",
|
|
60
|
+
"spring",
|
|
61
|
+
"unity",
|
|
62
|
+
"unreal",
|
|
63
|
+
"vue",
|
|
64
|
+
"xamarin"
|
|
65
|
+
],
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"language": {
|
|
69
|
+
"description": "Language",
|
|
70
|
+
"enum": [
|
|
71
|
+
"c",
|
|
72
|
+
"c++",
|
|
73
|
+
"c#",
|
|
74
|
+
"go",
|
|
75
|
+
"java",
|
|
76
|
+
"javascript",
|
|
77
|
+
"kotlin",
|
|
78
|
+
"lua",
|
|
79
|
+
"python",
|
|
80
|
+
"ruby",
|
|
81
|
+
"rust",
|
|
82
|
+
"scala",
|
|
83
|
+
"solidity",
|
|
84
|
+
"swift"
|
|
85
|
+
],
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"module": {
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"description": "Module Definition",
|
|
91
|
+
"properties": {
|
|
92
|
+
"architecture": {
|
|
93
|
+
"description": "Architecture",
|
|
94
|
+
"enum": [
|
|
95
|
+
"386",
|
|
96
|
+
"amd64",
|
|
97
|
+
"arm",
|
|
98
|
+
"arm64",
|
|
99
|
+
"loong64",
|
|
100
|
+
"mips",
|
|
101
|
+
"mipsle",
|
|
102
|
+
"mips64",
|
|
103
|
+
"mips64le",
|
|
104
|
+
"ppc64",
|
|
105
|
+
"ppc64le",
|
|
106
|
+
"riscv64",
|
|
107
|
+
"s390x",
|
|
108
|
+
"wasm"
|
|
109
|
+
],
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"config": {
|
|
113
|
+
"description": "The default config for the module",
|
|
114
|
+
"type": "object"
|
|
115
|
+
},
|
|
116
|
+
"description": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"features": {
|
|
120
|
+
"items": {
|
|
121
|
+
"$ref": "#/definitions/feature"
|
|
122
|
+
},
|
|
123
|
+
"type": "array"
|
|
124
|
+
},
|
|
125
|
+
"id": {
|
|
126
|
+
"description": "The canonical id that tells the loader how to find the correct registered module implementation",
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"language": {
|
|
130
|
+
"$ref": "#/definitions/language"
|
|
131
|
+
},
|
|
132
|
+
"name": {
|
|
133
|
+
"description": "The friendly name for this module",
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
"os": {
|
|
137
|
+
"$ref": "#/definitions/os"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"required": [],
|
|
141
|
+
"type": "object"
|
|
142
|
+
},
|
|
143
|
+
"modules": {
|
|
144
|
+
"description": "List of Modules",
|
|
145
|
+
"items": {
|
|
146
|
+
"$ref": "#/definitions/module"
|
|
147
|
+
},
|
|
148
|
+
"nullable": true,
|
|
149
|
+
"type": "array"
|
|
150
|
+
},
|
|
151
|
+
"os": {
|
|
152
|
+
"description": "Operating System",
|
|
153
|
+
"enum": [
|
|
154
|
+
"aix",
|
|
155
|
+
"android",
|
|
156
|
+
"darwin",
|
|
157
|
+
"dragonfly",
|
|
158
|
+
"freebsd",
|
|
159
|
+
"illumos",
|
|
160
|
+
"ios",
|
|
161
|
+
"linux",
|
|
162
|
+
"netbsd",
|
|
163
|
+
"openbsd",
|
|
164
|
+
"osx",
|
|
165
|
+
"plan9",
|
|
166
|
+
"solaris",
|
|
167
|
+
"windows"
|
|
168
|
+
],
|
|
169
|
+
"type": "string"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"description": "Describes an XYO Package which is a collection of XYO Modules",
|
|
173
|
+
"properties": {
|
|
174
|
+
"$schema": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"dapps": {
|
|
178
|
+
"$ref": "#/definitions/dapps",
|
|
179
|
+
"description": "The list of dApps that are defined in the manifest"
|
|
180
|
+
},
|
|
181
|
+
"description": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
},
|
|
184
|
+
"modules": {
|
|
185
|
+
"additionalProperties": {
|
|
186
|
+
"$ref": "#/definitions/module"
|
|
187
|
+
},
|
|
188
|
+
"description": "The list of global modules that are defined in the manifest",
|
|
189
|
+
"type": "object"
|
|
190
|
+
},
|
|
191
|
+
"schema": {
|
|
192
|
+
"type": "string"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"required": [],
|
|
196
|
+
"title": "XYO Manifest"
|
|
197
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schema.json",
|
|
3
|
+
"dapps": [
|
|
4
|
+
{
|
|
5
|
+
"modules": {
|
|
6
|
+
"private": [
|
|
7
|
+
{
|
|
8
|
+
"name": "ScratchArchivist"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"public": [
|
|
12
|
+
{
|
|
13
|
+
"name": "SimpleArchivist"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "SimpleSentinel"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"name": "SimpleMemoryDapp"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"modules": {
|
|
24
|
+
"ScratchArchivist": {
|
|
25
|
+
"id": "network.xyo.archivist",
|
|
26
|
+
"language": "javascript"
|
|
27
|
+
},
|
|
28
|
+
"SimpleArchivist": {
|
|
29
|
+
"id": "network.xyo.archivist",
|
|
30
|
+
"language": "javascript"
|
|
31
|
+
},
|
|
32
|
+
"SimpleSentinel": {
|
|
33
|
+
"id": "network.xyo.sentinel",
|
|
34
|
+
"language": "javascript"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"schema": "network.xyo.manifest"
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schema.json",
|
|
3
|
+
"dapps": [
|
|
4
|
+
{
|
|
5
|
+
"modules": {
|
|
6
|
+
"private": [
|
|
7
|
+
{
|
|
8
|
+
"id": "network.xyo.archivist",
|
|
9
|
+
"language": "javascript",
|
|
10
|
+
"name": "ScratchArchivist"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"public": [
|
|
14
|
+
{
|
|
15
|
+
"id": "network.xyo.archivist",
|
|
16
|
+
"language": "javascript",
|
|
17
|
+
"name": "SimpleArchivist"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "network.xyo.sentinel",
|
|
21
|
+
"language": "javascript",
|
|
22
|
+
"name": "SimpleSentinel"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"name": "SimpleMemoryDapp"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"schema": "network.xyo.manifest"
|
|
30
|
+
}
|