@xyo-network/node-system-info-plugin 2.73.3 → 2.74.0
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/Config.d.mts.map +1 -0
- package/dist/Config.d.ts +8 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Plugin.d.mts +55 -0
- package/dist/Plugin.d.mts.map +1 -0
- package/dist/{types/Plugin.d.ts → Plugin.d.ts} +5 -5
- package/dist/Plugin.d.ts.map +1 -0
- package/dist/Witness.d.mts.map +1 -0
- package/dist/Witness.d.ts +10 -0
- package/dist/Witness.d.ts.map +1 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/{esm/index.js → index.d.ts} +1 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +42 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +28 -21
- package/dist/cjs/Config.js +0 -5
- package/dist/cjs/Config.js.map +0 -1
- package/dist/cjs/Plugin.js +0 -16
- package/dist/cjs/Plugin.js.map +0 -1
- package/dist/cjs/Witness.js +0 -20
- package/dist/cjs/Witness.js.map +0 -1
- package/dist/cjs/index.js +0 -11
- package/dist/cjs/index.js.map +0 -1
- package/dist/docs.json +0 -23064
- package/dist/esm/Config.js +0 -2
- package/dist/esm/Config.js.map +0 -1
- package/dist/esm/Plugin.js +0 -11
- package/dist/esm/Plugin.js.map +0 -1
- package/dist/esm/Witness.js +0 -12
- package/dist/esm/Witness.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/types/Config.d.ts.map +0 -1
- package/dist/types/Plugin.d.ts.map +0 -1
- package/dist/types/Witness.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- /package/dist/{types/Config.d.ts → Config.d.mts} +0 -0
- /package/dist/{types/Witness.d.ts → Witness.d.mts} +0 -0
- /package/dist/{types/index.d.ts → index.d.mts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,MAAM,iCAAiC,GAAG,6CAA6C,CAAA;AAC7F,eAAO,MAAM,iCAAiC,EAAE,iCAAiF,CAAA;AAEjI,MAAM,MAAM,2BAA2B,GAAG,aAAa,CAAC;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,MAAM,EAAE,iCAAiC,CAAA;CAC1C,CAAC,CAAA"}
|
package/dist/Config.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WitnessConfig } from '@xyo-network/witness';
|
|
2
|
+
export type NodeSystemInfoWitnessConfigSchema = 'network.xyo.system.info.witness.node.config';
|
|
3
|
+
export declare const NodeSystemInfoWitnessConfigSchema: NodeSystemInfoWitnessConfigSchema;
|
|
4
|
+
export type NodeSystemInfoWitnessConfig = WitnessConfig<{
|
|
5
|
+
nodeValues?: Record<string, string>;
|
|
6
|
+
schema: NodeSystemInfoWitnessConfigSchema;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,MAAM,iCAAiC,GAAG,6CAA6C,CAAA;AAC7F,eAAO,MAAM,iCAAiC,EAAE,iCAAiF,CAAA;AAEjI,MAAM,MAAM,2BAA2B,GAAG,aAAa,CAAC;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,MAAM,EAAE,iCAAiC,CAAA;CAC1C,CAAC,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { NodeSystemInfoWitness } from './Witness';
|
|
2
|
+
export declare const NodeSystemInfoPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<NodeSystemInfoWitness<import("@xyo-network/core").BaseParamsFields & {
|
|
3
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
5
|
+
accountDerivationPath?: string | undefined;
|
|
6
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
7
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
|
+
readonly name?: string | undefined;
|
|
9
|
+
readonly paging?: Record<string, {
|
|
10
|
+
size?: number | undefined;
|
|
11
|
+
}> | undefined;
|
|
12
|
+
readonly security?: {
|
|
13
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
14
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
15
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly sign?: boolean | undefined;
|
|
18
|
+
readonly storeQueries?: boolean | undefined;
|
|
19
|
+
readonly timestamp?: boolean | undefined;
|
|
20
|
+
} & Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
21
|
+
accountDerivationPath?: string | undefined;
|
|
22
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
23
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
24
|
+
readonly name?: string | undefined;
|
|
25
|
+
readonly paging?: Record<string, {
|
|
26
|
+
size?: number | undefined;
|
|
27
|
+
}> | undefined;
|
|
28
|
+
readonly security?: {
|
|
29
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
30
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
31
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
readonly sign?: boolean | undefined;
|
|
34
|
+
readonly storeQueries?: boolean | undefined;
|
|
35
|
+
readonly timestamp?: boolean | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
archivist?: string | undefined;
|
|
38
|
+
schema: "network.xyo.system.info.witness.node.config";
|
|
39
|
+
targetSet?: (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/payload-model").PayloadSet & {
|
|
40
|
+
schema: "network.xyo.payload.set";
|
|
41
|
+
}) | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
nodeValues?: Record<string, string> | undefined;
|
|
44
|
+
schema: "network.xyo.system.info.witness.node.config";
|
|
45
|
+
}, "schema"> & {
|
|
46
|
+
schema: "network.xyo.system.info.witness.node.config";
|
|
47
|
+
}, "schema"> & {
|
|
48
|
+
schema: string;
|
|
49
|
+
}, "schema"> & {
|
|
50
|
+
schema: string;
|
|
51
|
+
};
|
|
52
|
+
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
53
|
+
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
54
|
+
}>>;
|
|
55
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAS9B,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { NodeSystemInfoWitness } from './Witness';
|
|
2
2
|
export declare const NodeSystemInfoPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<NodeSystemInfoWitness<import("@xyo-network/core").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
|
-
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
|
|
4
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
5
5
|
accountDerivationPath?: string | undefined;
|
|
6
6
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
7
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
7
8
|
readonly name?: string | undefined;
|
|
8
9
|
readonly paging?: Record<string, {
|
|
9
10
|
size?: number | undefined;
|
|
10
11
|
}> | undefined;
|
|
11
|
-
readonly schema: string;
|
|
12
12
|
readonly security?: {
|
|
13
13
|
readonly allowAnonymous?: boolean | undefined;
|
|
14
14
|
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
@@ -17,14 +17,14 @@ export declare const NodeSystemInfoPlugin: () => import("@xyo-network/payloadset
|
|
|
17
17
|
readonly sign?: boolean | undefined;
|
|
18
18
|
readonly storeQueries?: boolean | undefined;
|
|
19
19
|
readonly timestamp?: boolean | undefined;
|
|
20
|
-
} & Omit<
|
|
20
|
+
} & Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
21
21
|
accountDerivationPath?: string | undefined;
|
|
22
22
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
23
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
23
24
|
readonly name?: string | undefined;
|
|
24
25
|
readonly paging?: Record<string, {
|
|
25
26
|
size?: number | undefined;
|
|
26
27
|
}> | undefined;
|
|
27
|
-
readonly schema: "network.xyo.system.info.witness.node.config";
|
|
28
28
|
readonly security?: {
|
|
29
29
|
readonly allowAnonymous?: boolean | undefined;
|
|
30
30
|
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
@@ -33,7 +33,7 @@ export declare const NodeSystemInfoPlugin: () => import("@xyo-network/payloadset
|
|
|
33
33
|
readonly sign?: boolean | undefined;
|
|
34
34
|
readonly storeQueries?: boolean | undefined;
|
|
35
35
|
readonly timestamp?: boolean | undefined;
|
|
36
|
-
} &
|
|
36
|
+
} & {
|
|
37
37
|
archivist?: string | undefined;
|
|
38
38
|
schema: "network.xyo.system.info.witness.node.config";
|
|
39
39
|
targetSet?: (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/payload-model").PayloadSet & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAS9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../src/Witness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpF,OAAO,EAAE,2BAA2B,EAAqC,MAAM,UAAU,CAAA;AAEzF,MAAM,MAAM,2BAA2B,GAAG,aAAa,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC,CAAA;AAErG,qBAAa,qBAAqB,CAAC,OAAO,SAAS,2BAA2B,GAAG,2BAA2B,CAC1G,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,aAAa;IAExB,OAAgB,aAAa,kDAAsC;cAE1C,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE;CAI7D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyConfigSchema } from '@xyo-network/module';
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { AbstractWitness, WitnessModule, WitnessParams } from '@xyo-network/witness';
|
|
4
|
+
import { NodeSystemInfoWitnessConfig } from './Config';
|
|
5
|
+
export type NodeSystemInfoWitnessParams = WitnessParams<AnyConfigSchema<NodeSystemInfoWitnessConfig>>;
|
|
6
|
+
export declare class NodeSystemInfoWitness<TParams extends NodeSystemInfoWitnessParams = NodeSystemInfoWitnessParams> extends AbstractWitness<TParams> implements WitnessModule {
|
|
7
|
+
static configSchemas: "network.xyo.system.info.witness.node.config"[];
|
|
8
|
+
protected observeHandler(payloads?: Payload[]): Promise<any[]>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../src/Witness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpF,OAAO,EAAE,2BAA2B,EAAqC,MAAM,UAAU,CAAA;AAEzF,MAAM,MAAM,2BAA2B,GAAG,aAAa,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC,CAAA;AAErG,qBAAa,qBAAqB,CAAC,OAAO,SAAS,2BAA2B,GAAG,2BAA2B,CAC1G,SAAQ,eAAe,CAAC,OAAO,CAC/B,YAAW,aAAa;IAExB,OAAgB,aAAa,kDAAsC;cAE1C,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE;CAI7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAG/B,eAAe,oBAAoB,CAAA"}
|
|
@@ -2,6 +2,5 @@ import { NodeSystemInfoPlugin } from './Plugin';
|
|
|
2
2
|
export * from './Config';
|
|
3
3
|
export * from './Witness';
|
|
4
4
|
export { NodeSystemInfoPlugin };
|
|
5
|
-
// eslint-disable-next-line import/no-default-export
|
|
6
5
|
export default NodeSystemInfoPlugin;
|
|
7
|
-
//# sourceMappingURL=index.
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAG/B,eAAe,oBAAoB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
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_node_system_info_payload_plugin = require("@xyo-network/node-system-info-payload-plugin");
|
|
37
|
+
var import_witness = require("@xyo-network/witness");
|
|
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_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
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
NodeSystemInfoPlugin,
|
|
68
|
+
NodeSystemInfoWitness,
|
|
69
|
+
NodeSystemInfoWitnessConfigSchema
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=index.js.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 { AnyConfigSchema } from '@xyo-network/module'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness, WitnessModule, WitnessParams } from '@xyo-network/witness'\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'\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;;;ACD9C,6CAA8D;AAE9D,qBAA8D;AAC9D,+BAAoB;;;ACDb,IAAM,oCAAuE;;;ADO7E,IAAM,wBAAN,cACG,+BAEV;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;;;ADdO,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"]}
|
package/dist/index.mjs
ADDED
|
@@ -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 { defaultSystemInfoConfig, NodeSystemInfoSchema } from "@xyo-network/node-system-info-payload-plugin";
|
|
8
|
+
import { AbstractWitness } from "@xyo-network/witness";
|
|
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.mjs.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 { AnyConfigSchema } from '@xyo-network/module'\nimport { defaultSystemInfoConfig, NodeSystemInfoSchema } from '@xyo-network/node-system-info-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness, WitnessModule, WitnessParams } from '@xyo-network/witness'\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'\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;;;ACD9C,SAAS,yBAAyB,4BAA4B;AAE9D,SAAS,uBAAqD;AAC9D,SAAS,WAAW;;;ACDb,IAAM,oCAAuE;;;ADO7E,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;;;ADdO,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,40 +10,48 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/module": "~2.
|
|
14
|
-
"@xyo-network/node-system-info-payload-plugin": "~2.
|
|
15
|
-
"@xyo-network/payload-model": "~2.
|
|
16
|
-
"@xyo-network/payloadset-plugin": "~2.
|
|
17
|
-
"@xyo-network/witness": "~2.
|
|
18
|
-
"systeminformation": "^5.21.
|
|
13
|
+
"@xyo-network/module": "~2.74.0",
|
|
14
|
+
"@xyo-network/node-system-info-payload-plugin": "~2.74.0",
|
|
15
|
+
"@xyo-network/payload-model": "~2.74.0",
|
|
16
|
+
"@xyo-network/payloadset-plugin": "~2.74.0",
|
|
17
|
+
"@xyo-network/witness": "~2.74.0",
|
|
18
|
+
"systeminformation": "^5.21.6"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
22
|
-
"@xylabs/tsconfig": "^
|
|
21
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.27",
|
|
22
|
+
"@xylabs/tsconfig": "^3.0.27",
|
|
23
23
|
"typescript": "^5.2.2"
|
|
24
24
|
},
|
|
25
25
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
26
|
-
"browser": "dist/esm/index.js",
|
|
27
26
|
"docs": "dist/docs.json",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
}
|
|
38
|
-
"default": "./dist/esm/index.js"
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./dist/index.d.mts",
|
|
36
|
+
"default": "./dist/index.mjs"
|
|
37
|
+
}
|
|
39
38
|
},
|
|
40
39
|
"./dist/docs.json": {
|
|
41
40
|
"default": "./dist/docs.json"
|
|
42
41
|
},
|
|
42
|
+
"./cjs": {
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./docs": {
|
|
46
|
+
"default": "./dist/docs.json"
|
|
47
|
+
},
|
|
48
|
+
"./esm": {
|
|
49
|
+
"default": "./dist/index.mjs"
|
|
50
|
+
},
|
|
43
51
|
"./package.json": "./package.json"
|
|
44
52
|
},
|
|
45
|
-
"main": "dist/
|
|
46
|
-
"module": "dist/
|
|
53
|
+
"main": "dist/index.js",
|
|
54
|
+
"module": "dist/index.mjs",
|
|
47
55
|
"homepage": "https://xyo.network",
|
|
48
56
|
"license": "LGPL-3.0",
|
|
49
57
|
"publishConfig": {
|
|
@@ -54,6 +62,5 @@
|
|
|
54
62
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
55
63
|
},
|
|
56
64
|
"sideEffects": false,
|
|
57
|
-
"
|
|
58
|
-
"version": "2.73.3"
|
|
65
|
+
"version": "2.74.0"
|
|
59
66
|
}
|
package/dist/cjs/Config.js
DELETED
package/dist/cjs/Config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":";;;AAGa,QAAA,iCAAiC,GAAsC,6CAA6C,CAAA"}
|
package/dist/cjs/Plugin.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeSystemInfoPlugin = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_system_info_payload_plugin_1 = require("@xyo-network/node-system-info-payload-plugin");
|
|
6
|
-
const payload_model_1 = require("@xyo-network/payload-model");
|
|
7
|
-
const payloadset_plugin_1 = require("@xyo-network/payloadset-plugin");
|
|
8
|
-
const Witness_1 = require("./Witness");
|
|
9
|
-
const NodeSystemInfoPlugin = () => (0, payloadset_plugin_1.createPayloadSetWitnessPlugin)({ required: { [node_system_info_payload_plugin_1.NodeSystemInfoSchema]: 1 }, schema: payload_model_1.PayloadSetSchema }, {
|
|
10
|
-
witness: (params) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
const result = yield Witness_1.NodeSystemInfoWitness.create(params);
|
|
12
|
-
return result;
|
|
13
|
-
}),
|
|
14
|
-
});
|
|
15
|
-
exports.NodeSystemInfoPlugin = NodeSystemInfoPlugin;
|
|
16
|
-
//# sourceMappingURL=Plugin.js.map
|
package/dist/cjs/Plugin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":";;;;AAAA,kGAAmF;AACnF,8DAA6D;AAC7D,sEAA8E;AAE9E,uCAAiD;AAE1C,MAAM,oBAAoB,GAAG,GAAG,EAAE,CACvC,IAAA,iDAA6B,EAC3B,EAAE,QAAQ,EAAE,EAAE,CAAC,sDAAoB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gCAAgB,EAAE,EACrE;IACE,OAAO,EAAE,CAAO,MAAM,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,+BAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACzD,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;CACF,CACF,CAAA;AATU,QAAA,oBAAoB,wBAS9B"}
|
package/dist/cjs/Witness.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeSystemInfoWitness = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_system_info_payload_plugin_1 = require("@xyo-network/node-system-info-payload-plugin");
|
|
6
|
-
const witness_1 = require("@xyo-network/witness");
|
|
7
|
-
const systeminformation_1 = require("systeminformation");
|
|
8
|
-
const Config_1 = require("./Config");
|
|
9
|
-
class NodeSystemInfoWitness extends witness_1.AbstractWitness {
|
|
10
|
-
observeHandler(payloads) {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
const node = yield (0, systeminformation_1.get)((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.nodeValues) !== null && _b !== void 0 ? _b : (0, node_system_info_payload_plugin_1.defaultSystemInfoConfig)());
|
|
14
|
-
return [Object.assign(Object.assign(Object.assign({}, node), payloads === null || payloads === void 0 ? void 0 : payloads[0]), { schema: node_system_info_payload_plugin_1.NodeSystemInfoSchema })];
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.NodeSystemInfoWitness = NodeSystemInfoWitness;
|
|
19
|
-
NodeSystemInfoWitness.configSchemas = [Config_1.NodeSystemInfoWitnessConfigSchema];
|
|
20
|
-
//# sourceMappingURL=Witness.js.map
|
package/dist/cjs/Witness.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.js","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":";;;;AACA,kGAA4G;AAE5G,kDAAoF;AACpF,yDAAuC;AAEvC,qCAAyF;AAIzF,MAAa,qBACX,SAAQ,yBAAwB;IAKP,cAAc,CAAC,QAAoB;;;YAC1D,MAAM,IAAI,GAAG,MAAM,IAAA,uBAAG,EAAC,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,UAAU,mCAAI,IAAA,yDAAuB,GAAE,CAAC,CAAA;YAC5E,OAAO,+CAAM,IAAI,GAAK,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,KAAE,MAAM,EAAE,sDAAoB,IAAG,CAAA;;KACrE;;AATH,sDAUC;AANiB,mCAAa,GAAG,CAAC,0CAAiC,CAAC,CAAA"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeSystemInfoPlugin = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const Plugin_1 = require("./Plugin");
|
|
6
|
-
Object.defineProperty(exports, "NodeSystemInfoPlugin", { enumerable: true, get: function () { return Plugin_1.NodeSystemInfoPlugin; } });
|
|
7
|
-
tslib_1.__exportStar(require("./Config"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./Witness"), exports);
|
|
9
|
-
// eslint-disable-next-line import/no-default-export
|
|
10
|
-
exports.default = Plugin_1.NodeSystemInfoPlugin;
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qCAA+C;AAKtC,qGALA,6BAAoB,OAKA;AAH7B,mDAAwB;AACxB,oDAAyB;AAIzB,oDAAoD;AACpD,kBAAe,6BAAoB,CAAA"}
|