@xyo-network/node-system-info-plugin 2.97.0 → 2.97.1
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/browser/index.cjs +60 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +37 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +60 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +37 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +67 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +38 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +11 -11
package/dist/browser/index.cjs
CHANGED
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
NodeSystemInfoPlugin: () => NodeSystemInfoPlugin,
|
|
24
|
+
NodeSystemInfoWitness: () => NodeSystemInfoWitness,
|
|
25
|
+
NodeSystemInfoWitnessConfigSchema: () => NodeSystemInfoWitnessConfigSchema,
|
|
26
|
+
default: () => NodeSystemInfoPlugin
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/Config.ts
|
|
31
|
+
var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
|
|
32
|
+
|
|
33
|
+
// src/Plugin.ts
|
|
34
|
+
var import_node_system_info_payload_plugin2 = require("@xyo-network/node-system-info-payload-plugin");
|
|
35
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
36
|
+
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
37
|
+
|
|
38
|
+
// src/Witness.ts
|
|
39
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
40
|
+
var import_node_system_info_payload_plugin = require("@xyo-network/node-system-info-payload-plugin");
|
|
41
|
+
var import_systeminformation = require("systeminformation");
|
|
42
|
+
var NodeSystemInfoWitness = class extends import_abstract_witness.AbstractWitness {
|
|
43
|
+
static configSchemas = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema];
|
|
44
|
+
static defaultConfigSchema = NodeSystemInfoWitnessConfigSchema;
|
|
45
|
+
async observeHandler(payloads) {
|
|
46
|
+
const node = await (0, import_systeminformation.get)(this.config?.nodeValues ?? (0, import_node_system_info_payload_plugin.defaultSystemInfoConfig)());
|
|
47
|
+
return [{ ...node, ...payloads?.[0], schema: import_node_system_info_payload_plugin.NodeSystemInfoSchema }];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// src/Plugin.ts
|
|
52
|
+
var NodeSystemInfoPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
53
|
+
{ required: { [import_node_system_info_payload_plugin2.NodeSystemInfoSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
54
|
+
{
|
|
55
|
+
witness: async (params) => {
|
|
56
|
+
const result = await NodeSystemInfoWitness.create(params);
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
2
61
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Config'\nexport { NodeSystemInfoPlugin as default, NodeSystemInfoPlugin } from './Plugin'\nexport * from './Witness'\n","import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Config'\nexport { NodeSystemInfoPlugin as default, NodeSystemInfoPlugin } from './Plugin'\nexport * from './Witness'\n","import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,oCAAuE;;;ACHpF,IAAAA,0CAAqC;AACrC,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAEhC,6CAA8D;AAG9D,+BAAoB;AAMb,IAAM,wBAAN,cACG,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe,UAAsB;AAC5D,UAAM,OAAO,UAAM,8BAAI,KAAK,QAAQ,kBAAc,gEAAwB,CAAC;AAC3E,WAAO,CAAC,EAAE,GAAG,MAAM,GAAG,WAAW,CAAC,GAAG,QAAQ,4DAAqB,CAAC;AAAA,EACrE;AACF;;;ADhBO,IAAM,uBAAuB,UAClC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,4DAAoB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACpE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,sBAAsB,OAAO,MAAM;AACxD,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_node_system_info_payload_plugin"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Config.ts
|
|
2
|
+
var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
|
|
3
|
+
|
|
4
|
+
// src/Plugin.ts
|
|
5
|
+
import { NodeSystemInfoSchema as NodeSystemInfoSchema2 } from "@xyo-network/node-system-info-payload-plugin";
|
|
6
|
+
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
7
|
+
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
8
|
+
|
|
9
|
+
// src/Witness.ts
|
|
10
|
+
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
11
|
+
import { defaultSystemInfoConfig, NodeSystemInfoSchema } from "@xyo-network/node-system-info-payload-plugin";
|
|
12
|
+
import { get } from "systeminformation";
|
|
13
|
+
var NodeSystemInfoWitness = class extends AbstractWitness {
|
|
14
|
+
static configSchemas = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema];
|
|
15
|
+
static defaultConfigSchema = NodeSystemInfoWitnessConfigSchema;
|
|
16
|
+
async observeHandler(payloads) {
|
|
17
|
+
const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig());
|
|
18
|
+
return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }];
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/Plugin.ts
|
|
23
|
+
var NodeSystemInfoPlugin = () => createPayloadSetWitnessPlugin(
|
|
24
|
+
{ required: { [NodeSystemInfoSchema2]: 1 }, schema: PayloadSetSchema },
|
|
25
|
+
{
|
|
26
|
+
witness: async (params) => {
|
|
27
|
+
const result = await NodeSystemInfoWitness.create(params);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
export {
|
|
33
|
+
NodeSystemInfoPlugin,
|
|
34
|
+
NodeSystemInfoWitness,
|
|
35
|
+
NodeSystemInfoWitnessConfigSchema,
|
|
36
|
+
NodeSystemInfoPlugin as default
|
|
37
|
+
};
|
|
2
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":"AAGO,
|
|
1
|
+
{"version":3,"sources":["../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":";AAGO,IAAM,oCAAuE;;;ACHpF,SAAS,wBAAAA,6BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB,4BAA4B;AAG9D,SAAS,WAAW;AAMb,IAAM,wBAAN,cACG,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe,UAAsB;AAC5D,UAAM,OAAO,MAAM,IAAI,KAAK,QAAQ,cAAc,wBAAwB,CAAC;AAC3E,WAAO,CAAC,EAAE,GAAG,MAAM,GAAG,WAAW,CAAC,GAAG,QAAQ,qBAAqB,CAAC;AAAA,EACrE;AACF;;;ADhBO,IAAM,uBAAuB,MAClC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,qBAAoB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACpE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,sBAAsB,OAAO,MAAM;AACxD,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["NodeSystemInfoSchema","NodeSystemInfoSchema"]}
|
package/dist/neutral/index.cjs
CHANGED
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
NodeSystemInfoPlugin: () => NodeSystemInfoPlugin,
|
|
24
|
+
NodeSystemInfoWitness: () => NodeSystemInfoWitness,
|
|
25
|
+
NodeSystemInfoWitnessConfigSchema: () => NodeSystemInfoWitnessConfigSchema,
|
|
26
|
+
default: () => NodeSystemInfoPlugin
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/Config.ts
|
|
31
|
+
var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
|
|
32
|
+
|
|
33
|
+
// src/Plugin.ts
|
|
34
|
+
var import_node_system_info_payload_plugin2 = require("@xyo-network/node-system-info-payload-plugin");
|
|
35
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
36
|
+
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
37
|
+
|
|
38
|
+
// src/Witness.ts
|
|
39
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
40
|
+
var import_node_system_info_payload_plugin = require("@xyo-network/node-system-info-payload-plugin");
|
|
41
|
+
var import_systeminformation = require("systeminformation");
|
|
42
|
+
var NodeSystemInfoWitness = class extends import_abstract_witness.AbstractWitness {
|
|
43
|
+
static configSchemas = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema];
|
|
44
|
+
static defaultConfigSchema = NodeSystemInfoWitnessConfigSchema;
|
|
45
|
+
async observeHandler(payloads) {
|
|
46
|
+
const node = await (0, import_systeminformation.get)(this.config?.nodeValues ?? (0, import_node_system_info_payload_plugin.defaultSystemInfoConfig)());
|
|
47
|
+
return [{ ...node, ...payloads?.[0], schema: import_node_system_info_payload_plugin.NodeSystemInfoSchema }];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// src/Plugin.ts
|
|
52
|
+
var NodeSystemInfoPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
53
|
+
{ required: { [import_node_system_info_payload_plugin2.NodeSystemInfoSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
54
|
+
{
|
|
55
|
+
witness: async (params) => {
|
|
56
|
+
const result = await NodeSystemInfoWitness.create(params);
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
2
61
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Config'\nexport { NodeSystemInfoPlugin as default, NodeSystemInfoPlugin } from './Plugin'\nexport * from './Witness'\n","import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Config'\nexport { NodeSystemInfoPlugin as default, NodeSystemInfoPlugin } from './Plugin'\nexport * from './Witness'\n","import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,oCAAuE;;;ACHpF,IAAAA,0CAAqC;AACrC,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAEhC,6CAA8D;AAG9D,+BAAoB;AAMb,IAAM,wBAAN,cACG,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe,UAAsB;AAC5D,UAAM,OAAO,UAAM,8BAAI,KAAK,QAAQ,kBAAc,gEAAwB,CAAC;AAC3E,WAAO,CAAC,EAAE,GAAG,MAAM,GAAG,WAAW,CAAC,GAAG,QAAQ,4DAAqB,CAAC;AAAA,EACrE;AACF;;;ADhBO,IAAM,uBAAuB,UAClC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,4DAAoB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACpE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,sBAAsB,OAAO,MAAM;AACxD,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_node_system_info_payload_plugin"]}
|
package/dist/neutral/index.js
CHANGED
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Config.ts
|
|
2
|
+
var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
|
|
3
|
+
|
|
4
|
+
// src/Plugin.ts
|
|
5
|
+
import { NodeSystemInfoSchema as NodeSystemInfoSchema2 } from "@xyo-network/node-system-info-payload-plugin";
|
|
6
|
+
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
7
|
+
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
8
|
+
|
|
9
|
+
// src/Witness.ts
|
|
10
|
+
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
11
|
+
import { defaultSystemInfoConfig, NodeSystemInfoSchema } from "@xyo-network/node-system-info-payload-plugin";
|
|
12
|
+
import { get } from "systeminformation";
|
|
13
|
+
var NodeSystemInfoWitness = class extends AbstractWitness {
|
|
14
|
+
static configSchemas = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema];
|
|
15
|
+
static defaultConfigSchema = NodeSystemInfoWitnessConfigSchema;
|
|
16
|
+
async observeHandler(payloads) {
|
|
17
|
+
const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig());
|
|
18
|
+
return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }];
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/Plugin.ts
|
|
23
|
+
var NodeSystemInfoPlugin = () => createPayloadSetWitnessPlugin(
|
|
24
|
+
{ required: { [NodeSystemInfoSchema2]: 1 }, schema: PayloadSetSchema },
|
|
25
|
+
{
|
|
26
|
+
witness: async (params) => {
|
|
27
|
+
const result = await NodeSystemInfoWitness.create(params);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
export {
|
|
33
|
+
NodeSystemInfoPlugin,
|
|
34
|
+
NodeSystemInfoWitness,
|
|
35
|
+
NodeSystemInfoWitnessConfigSchema,
|
|
36
|
+
NodeSystemInfoPlugin as default
|
|
37
|
+
};
|
|
2
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":"AAGO,
|
|
1
|
+
{"version":3,"sources":["../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":";AAGO,IAAM,oCAAuE;;;ACHpF,SAAS,wBAAAA,6BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB,4BAA4B;AAG9D,SAAS,WAAW;AAMb,IAAM,wBAAN,cACG,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe,UAAsB;AAC5D,UAAM,OAAO,MAAM,IAAI,KAAK,QAAQ,cAAc,wBAAwB,CAAC;AAC3E,WAAO,CAAC,EAAE,GAAG,MAAM,GAAG,WAAW,CAAC,GAAG,QAAQ,qBAAqB,CAAC;AAAA,EACrE;AACF;;;ADhBO,IAAM,uBAAuB,MAClC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,qBAAoB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACpE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,sBAAsB,OAAO,MAAM;AACxD,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["NodeSystemInfoSchema","NodeSystemInfoSchema"]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -1,2 +1,68 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
NodeSystemInfoPlugin: () => NodeSystemInfoPlugin,
|
|
24
|
+
NodeSystemInfoWitness: () => NodeSystemInfoWitness,
|
|
25
|
+
NodeSystemInfoWitnessConfigSchema: () => NodeSystemInfoWitnessConfigSchema,
|
|
26
|
+
default: () => NodeSystemInfoPlugin
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/Config.ts
|
|
31
|
+
var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
|
|
32
|
+
|
|
33
|
+
// src/Plugin.ts
|
|
34
|
+
var import_node_system_info_payload_plugin2 = require("@xyo-network/node-system-info-payload-plugin");
|
|
35
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
36
|
+
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
37
|
+
|
|
38
|
+
// src/Witness.ts
|
|
39
|
+
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
40
|
+
var import_node_system_info_payload_plugin = require("@xyo-network/node-system-info-payload-plugin");
|
|
41
|
+
var import_systeminformation = require("systeminformation");
|
|
42
|
+
var NodeSystemInfoWitness = class extends import_abstract_witness.AbstractWitness {
|
|
43
|
+
static configSchemas = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema];
|
|
44
|
+
static defaultConfigSchema = NodeSystemInfoWitnessConfigSchema;
|
|
45
|
+
async observeHandler(payloads) {
|
|
46
|
+
var _a;
|
|
47
|
+
const node = await (0, import_systeminformation.get)(((_a = this.config) == null ? void 0 : _a.nodeValues) ?? (0, import_node_system_info_payload_plugin.defaultSystemInfoConfig)());
|
|
48
|
+
return [{ ...node, ...payloads == null ? void 0 : payloads[0], schema: import_node_system_info_payload_plugin.NodeSystemInfoSchema }];
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// src/Plugin.ts
|
|
53
|
+
var NodeSystemInfoPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
54
|
+
{ required: { [import_node_system_info_payload_plugin2.NodeSystemInfoSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
55
|
+
{
|
|
56
|
+
witness: async (params) => {
|
|
57
|
+
const result = await NodeSystemInfoWitness.create(params);
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
NodeSystemInfoPlugin,
|
|
65
|
+
NodeSystemInfoWitness,
|
|
66
|
+
NodeSystemInfoWitnessConfigSchema
|
|
67
|
+
});
|
|
2
68
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Config'\nexport { NodeSystemInfoPlugin as default, NodeSystemInfoPlugin } from './Plugin'\nexport * from './Witness'\n","import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Config'\nexport { NodeSystemInfoPlugin as default, NodeSystemInfoPlugin } from './Plugin'\nexport * from './Witness'\n","import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,oCAAuE;;;ACHpF,IAAAA,0CAAqC;AACrC,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAEhC,6CAA8D;AAG9D,+BAAoB;AAMb,IAAM,wBAAN,cACG,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe,UAAsB;AAlBhE;AAmBI,UAAM,OAAO,UAAM,gCAAI,UAAK,WAAL,mBAAa,mBAAc,gEAAwB,CAAC;AAC3E,WAAO,CAAC,EAAE,GAAG,MAAM,GAAG,qCAAW,IAAI,QAAQ,4DAAqB,CAAC;AAAA,EACrE;AACF;;;ADhBO,IAAM,uBAAuB,UAClC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,4DAAoB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACpE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,sBAAsB,OAAO,MAAM;AACxD,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_node_system_info_payload_plugin"]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,2 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Config.ts
|
|
2
|
+
var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
|
|
3
|
+
|
|
4
|
+
// src/Plugin.ts
|
|
5
|
+
import { NodeSystemInfoSchema as NodeSystemInfoSchema2 } from "@xyo-network/node-system-info-payload-plugin";
|
|
6
|
+
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
7
|
+
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
8
|
+
|
|
9
|
+
// src/Witness.ts
|
|
10
|
+
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
11
|
+
import { defaultSystemInfoConfig, NodeSystemInfoSchema } from "@xyo-network/node-system-info-payload-plugin";
|
|
12
|
+
import { get } from "systeminformation";
|
|
13
|
+
var NodeSystemInfoWitness = class extends AbstractWitness {
|
|
14
|
+
static configSchemas = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema];
|
|
15
|
+
static defaultConfigSchema = NodeSystemInfoWitnessConfigSchema;
|
|
16
|
+
async observeHandler(payloads) {
|
|
17
|
+
var _a;
|
|
18
|
+
const node = await get(((_a = this.config) == null ? void 0 : _a.nodeValues) ?? defaultSystemInfoConfig());
|
|
19
|
+
return [{ ...node, ...payloads == null ? void 0 : payloads[0], schema: NodeSystemInfoSchema }];
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/Plugin.ts
|
|
24
|
+
var NodeSystemInfoPlugin = () => createPayloadSetWitnessPlugin(
|
|
25
|
+
{ required: { [NodeSystemInfoSchema2]: 1 }, schema: PayloadSetSchema },
|
|
26
|
+
{
|
|
27
|
+
witness: async (params) => {
|
|
28
|
+
const result = await NodeSystemInfoWitness.create(params);
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
export {
|
|
34
|
+
NodeSystemInfoPlugin,
|
|
35
|
+
NodeSystemInfoWitness,
|
|
36
|
+
NodeSystemInfoWitnessConfigSchema,
|
|
37
|
+
NodeSystemInfoPlugin as default
|
|
38
|
+
};
|
|
2
39
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":"AAGO,
|
|
1
|
+
{"version":3,"sources":["../../src/Config.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\nexport const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config'\n\nexport type NodeSystemInfoWitnessConfig = WitnessConfig<{\n nodeValues?: Record<string, string>\n schema: NodeSystemInfoWitnessConfigSchema\n}>\n","import { NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { NodeSystemInfoWitness } from './Witness'\n\nexport const NodeSystemInfoPlugin = () =>\n createPayloadSetWitnessPlugin<NodeSystemInfoWitness>(\n { required: { [NodeSystemInfoSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await NodeSystemInfoWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessModule, WitnessParams } from '@xyo-network/witness-model'\nimport { get } from 'systeminformation'\n\nimport { NodeSystemInfoWitnessConfig, NodeSystemInfoWitnessConfigSchema } from './Config'\n\nexport type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>\n\nexport class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams>\n extends AbstractWitness<TParams>\n implements WitnessModule\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NodeSystemInfoWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NodeSystemInfoWitnessConfigSchema\n\n protected override async observeHandler(payloads?: Payload[]) {\n const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig())\n return [{ ...node, ...payloads?.[0], schema: NodeSystemInfoSchema }]\n }\n}\n"],"mappings":";AAGO,IAAM,oCAAuE;;;ACHpF,SAAS,wBAAAA,6BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB,4BAA4B;AAG9D,SAAS,WAAW;AAMb,IAAM,wBAAN,cACG,gBAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe,UAAsB;AAlBhE;AAmBI,UAAM,OAAO,MAAM,MAAI,UAAK,WAAL,mBAAa,eAAc,wBAAwB,CAAC;AAC3E,WAAO,CAAC,EAAE,GAAG,MAAM,GAAG,qCAAW,IAAI,QAAQ,qBAAqB,CAAC;AAAA,EACrE;AACF;;;ADhBO,IAAM,uBAAuB,MAClC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,qBAAoB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACpE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,sBAAsB,OAAO,MAAM;AACxD,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["NodeSystemInfoSchema","NodeSystemInfoSchema"]}
|
package/package.json
CHANGED
|
@@ -10,19 +10,19 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/abstract-witness": "^2.107.
|
|
14
|
-
"@xyo-network/module-model": "^2.107.
|
|
15
|
-
"@xyo-network/node-system-info-payload-plugin": "~2.97.
|
|
16
|
-
"@xyo-network/payload-model": "^2.107.
|
|
17
|
-
"@xyo-network/payloadset-plugin": "^2.107.
|
|
18
|
-
"@xyo-network/witness-model": "^2.107.
|
|
13
|
+
"@xyo-network/abstract-witness": "^2.107.4",
|
|
14
|
+
"@xyo-network/module-model": "^2.107.4",
|
|
15
|
+
"@xyo-network/node-system-info-payload-plugin": "~2.97.1",
|
|
16
|
+
"@xyo-network/payload-model": "^2.107.4",
|
|
17
|
+
"@xyo-network/payloadset-plugin": "^2.107.4",
|
|
18
|
+
"@xyo-network/witness-model": "^2.107.4",
|
|
19
19
|
"systeminformation": "^5.22.11"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@xylabs/ts-scripts-yarn3": "^3.11.
|
|
23
|
-
"@xylabs/tsconfig": "^3.11.
|
|
24
|
-
"@xyo-network/account": "^2.107.
|
|
25
|
-
"@xyo-network/payload-wrapper": "^2.107.
|
|
22
|
+
"@xylabs/ts-scripts-yarn3": "^3.11.10",
|
|
23
|
+
"@xylabs/tsconfig": "^3.11.10",
|
|
24
|
+
"@xyo-network/account": "^2.107.4",
|
|
25
|
+
"@xyo-network/payload-wrapper": "^2.107.4",
|
|
26
26
|
"typescript": "^5.5.2"
|
|
27
27
|
},
|
|
28
28
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
66
66
|
},
|
|
67
67
|
"sideEffects": false,
|
|
68
|
-
"version": "2.97.
|
|
68
|
+
"version": "2.97.1"
|
|
69
69
|
}
|