@xyo-network/node-system-info-plugin 2.80.4 → 2.81.0-rc.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.
@@ -0,0 +1,65 @@
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: () => src_default
27
+ });
28
+ module.exports = __toCommonJS(src_exports);
29
+
30
+ // src/Plugin.ts
31
+ var import_node_system_info_payload_plugin2 = require("@xyo-network/node-system-info-payload-plugin");
32
+ var import_payload_model = require("@xyo-network/payload-model");
33
+ var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
34
+
35
+ // src/Witness.ts
36
+ var import_abstract_witness = require("@xyo-network/abstract-witness");
37
+ var import_node_system_info_payload_plugin = require("@xyo-network/node-system-info-payload-plugin");
38
+ var import_systeminformation = require("systeminformation");
39
+
40
+ // src/Config.ts
41
+ var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
42
+
43
+ // src/Witness.ts
44
+ var NodeSystemInfoWitness = class extends import_abstract_witness.AbstractWitness {
45
+ static configSchemas = [NodeSystemInfoWitnessConfigSchema];
46
+ async observeHandler(payloads) {
47
+ const node = await (0, import_systeminformation.get)(this.config?.nodeValues ?? (0, import_node_system_info_payload_plugin.defaultSystemInfoConfig)());
48
+ return [{ ...node, ...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
+
63
+ // src/index.ts
64
+ var src_default = NodeSystemInfoPlugin;
65
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/Config.ts"],"sourcesContent":["import { NodeSystemInfoPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './Witness'\n\nexport { NodeSystemInfoPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default NodeSystemInfoPlugin\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 } 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 configSchemas = [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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,0CAAqC;AACrC,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAEhC,6CAA8D;AAG9D,+BAAoB;;;ACFb,IAAM,oCAAuE;;;ADQ7E,IAAM,wBAAN,cACG,wCAEV;AAAA,EACE,OAAgB,gBAAgB,CAAC,iCAAiC;AAAA,EAElE,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;;;ADfO,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;;;ADPF,IAAO,cAAQ;","names":["import_node_system_info_payload_plugin"]}
@@ -0,0 +1,42 @@
1
+ // src/Plugin.ts
2
+ import { NodeSystemInfoSchema as NodeSystemInfoSchema2 } from "@xyo-network/node-system-info-payload-plugin";
3
+ import { PayloadSetSchema } from "@xyo-network/payload-model";
4
+ import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
+
6
+ // src/Witness.ts
7
+ import { AbstractWitness } from "@xyo-network/abstract-witness";
8
+ import { defaultSystemInfoConfig, NodeSystemInfoSchema } from "@xyo-network/node-system-info-payload-plugin";
9
+ import { get } from "systeminformation";
10
+
11
+ // src/Config.ts
12
+ var NodeSystemInfoWitnessConfigSchema = "network.xyo.system.info.witness.node.config";
13
+
14
+ // src/Witness.ts
15
+ var NodeSystemInfoWitness = class extends AbstractWitness {
16
+ static configSchemas = [NodeSystemInfoWitnessConfigSchema];
17
+ async observeHandler(payloads) {
18
+ const node = await get(this.config?.nodeValues ?? defaultSystemInfoConfig());
19
+ return [{ ...node, ...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
+
34
+ // src/index.ts
35
+ var src_default = NodeSystemInfoPlugin;
36
+ export {
37
+ NodeSystemInfoPlugin,
38
+ NodeSystemInfoWitness,
39
+ NodeSystemInfoWitnessConfigSchema,
40
+ src_default as default
41
+ };
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/Config.ts","../../src/index.ts"],"sourcesContent":["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 } 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 configSchemas = [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","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 { NodeSystemInfoPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './Witness'\n\nexport { NodeSystemInfoPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default NodeSystemInfoPlugin\n"],"mappings":";AAAA,SAAS,wBAAAA,6BAA4B;AACrC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB,4BAA4B;AAG9D,SAAS,WAAW;;;ACFb,IAAM,oCAAuE;;;ADQ7E,IAAM,wBAAN,cACG,gBAEV;AAAA,EACE,OAAgB,gBAAgB,CAAC,iCAAiC;AAAA,EAElE,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;;;ADfO,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;;;AGPF,IAAO,cAAQ;","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.79.8",
14
- "@xyo-network/module-model": "^2.79.8",
15
- "@xyo-network/node-system-info-payload-plugin": "~2.80.4",
16
- "@xyo-network/payload-model": "^2.79.8",
17
- "@xyo-network/payloadset-plugin": "^2.79.8",
18
- "@xyo-network/witness-model": "^2.79.8",
13
+ "@xyo-network/abstract-witness": "^2.81.0-rc.1",
14
+ "@xyo-network/module-model": "^2.81.0-rc.1",
15
+ "@xyo-network/node-system-info-payload-plugin": "~2.81.0-rc.1",
16
+ "@xyo-network/payload-model": "^2.81.0-rc.1",
17
+ "@xyo-network/payloadset-plugin": "^2.81.0-rc.1",
18
+ "@xyo-network/witness-model": "^2.81.0-rc.1",
19
19
  "systeminformation": "^5.21.17"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@xylabs/ts-scripts-yarn3": "^3.2.2",
23
23
  "@xylabs/tsconfig": "^3.2.2",
24
- "@xyo-network/account": "^2.79.8",
25
- "@xyo-network/payload-wrapper": "^2.79.8",
24
+ "@xyo-network/account": "^2.81.0-rc.1",
25
+ "@xyo-network/payload-wrapper": "^2.81.0-rc.1",
26
26
  "typescript": "^5.2.2"
27
27
  },
28
28
  "description": "Typescript/Javascript Plugins for XYO Platform",
@@ -31,11 +31,11 @@
31
31
  "browser": {
32
32
  "require": {
33
33
  "types": "./dist/browser/index.d.cts",
34
- "default": "./dist/browser/stub.cjs"
34
+ "default": "./dist/browser/index.cjs"
35
35
  },
36
36
  "import": {
37
37
  "types": "./dist/browser/index.d.mts",
38
- "default": "./dist/browser/stub.js"
38
+ "default": "./dist/browser/index.js"
39
39
  }
40
40
  },
41
41
  "node": {
@@ -65,5 +65,6 @@
65
65
  "url": "https://github.com/XYOracleNetwork/plugins.git"
66
66
  },
67
67
  "sideEffects": false,
68
- "version": "2.80.4"
68
+ "version": "2.81.0-rc.1",
69
+ "stableVersion": "2.80.5"
69
70
  }
package/xy.config.ts CHANGED
@@ -2,7 +2,7 @@ import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
2
  const config: XyTsupConfig = {
3
3
  compile: {
4
4
  browser: {
5
- src: { entry: ['./src/stub.ts'] },
5
+ src: true,
6
6
  },
7
7
  node: {
8
8
  src: true,
@@ -1,27 +0,0 @@
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/stub.ts
21
- var stub_exports = {};
22
- __export(stub_exports, {
23
- default: () => stub_default
24
- });
25
- module.exports = __toCommonJS(stub_exports);
26
- var stub_default = {};
27
- //# sourceMappingURL=stub.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stub.ts"],"sourcesContent":["// eslint-disable-next-line import/no-default-export\nexport default {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAO,eAAQ,CAAC;","names":[]}
@@ -1,3 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- //# sourceMappingURL=stub.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/stub.ts"],"names":[],"mappings":";AACA,wBAAiB"}
@@ -1,3 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- //# sourceMappingURL=stub.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/stub.ts"],"names":[],"mappings":";AACA,wBAAiB"}
@@ -1,3 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- //# sourceMappingURL=stub.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/stub.ts"],"names":[],"mappings":";AACA,wBAAiB"}
@@ -1,6 +0,0 @@
1
- // src/stub.ts
2
- var stub_default = {};
3
- export {
4
- stub_default as default
5
- };
6
- //# sourceMappingURL=stub.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stub.ts"],"sourcesContent":["// eslint-disable-next-line import/no-default-export\nexport default {}\n"],"mappings":";AACA,IAAO,eAAQ,CAAC;","names":[]}
@@ -1,3 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- //# sourceMappingURL=stub.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/stub.ts"],"names":[],"mappings":";AACA,wBAAiB"}
@@ -1,3 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- //# sourceMappingURL=stub.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/stub.ts"],"names":[],"mappings":";AACA,wBAAiB"}
@@ -1,3 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- //# sourceMappingURL=stub.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub.d.ts","sourceRoot":"","sources":["../../src/stub.ts"],"names":[],"mappings":";AACA,wBAAiB"}
package/src/stub.ts DELETED
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line import/no-default-export
2
- export default {}