@xyo-network/plugins 2.79.8 → 2.80.3
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/README.md +84 -3
- package/babel.config.json +6 -0
- package/dist/node/index.cjs +27 -0
- package/dist/node/{index.mjs.map → index.cjs.map} +1 -1
- package/dist/node/index.js +2 -25
- package/dist/node/index.js.map +1 -1
- package/jest.config.ts +31 -0
- package/jestSetup/globalSetup.ts +16 -0
- package/jestSetup/globalTeardown.ts +9 -0
- package/jestSetup/setupFiles.ts +10 -0
- package/package.json +66 -15
- package/scripts/clear-scrollback-buffer.sh +3 -0
- package/typedoc.json +6 -1
- package/dist/node/index.mjs +0 -4
package/README.md
CHANGED
|
@@ -1,13 +1,94 @@
|
|
|
1
1
|
[![logo][]](https://xyo.network)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# plugins
|
|
4
|
+
|
|
5
|
+
[![main-build][]][main-build-link]
|
|
6
|
+
[![npm-badge][]][npm-link]
|
|
7
|
+
[![codacy-badge][]][codacy-link]
|
|
8
|
+
[![codeclimate-badge][]][codeclimate-link]
|
|
9
|
+
[![snyk-badge][]][snyk-link]
|
|
10
|
+
[![license-badge][]][license-link]
|
|
11
|
+
|
|
12
|
+
> The XYO Foundation provides this source code in our efforts to
|
|
13
|
+
> advance the understanding of the XYO Protocol and its possible uses.
|
|
14
|
+
> We continue to maintain this software in the interest of developer education.
|
|
15
|
+
|
|
16
|
+
## Table of Contents
|
|
17
|
+
- [Title](#plugins)
|
|
18
|
+
- [Table of Contents](#table-of-contents)
|
|
19
|
+
- [Description](#description)
|
|
20
|
+
- [Install](#install)
|
|
21
|
+
- [Maintainers](#maintainers)
|
|
22
|
+
- [License](#license)
|
|
23
|
+
- [Credits](#credits)
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
|
|
27
|
+
> Plugins (Witnesses, Diviners, etc...) to be used with the XYO Platform
|
|
28
|
+
> Designed to work in both browser based and Node JS based solutions.
|
|
29
|
+
|
|
30
|
+
## Use the sdk in another project
|
|
31
|
+
|
|
32
|
+
Using npm:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm i --save @xyo-network/plugins
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Using yarn:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
yarn add @xyo-network/plugins
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Building the sdk locally
|
|
45
|
+
|
|
46
|
+
First clone the repo to your local computer. Once you have done that, from
|
|
47
|
+
inside the folder where it was cloned, these are some commands you can do.
|
|
48
|
+
|
|
49
|
+
See list of XY scripts.
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
yarn xy help
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Compile the mono repo
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
yarn xy compile
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Maintainers
|
|
62
|
+
|
|
63
|
+
- [Arie Trouw](https://github.com/arietrouw) [(arietrouw.com)](https://arietrouw.com)
|
|
64
|
+
- [Matt Jones](https://github.com/jonesmac)
|
|
65
|
+
- [Joel Carter](https://github.com/JoelBCarter)
|
|
4
66
|
|
|
5
67
|
## License
|
|
6
68
|
|
|
7
|
-
> See the [LICENSE](LICENSE)
|
|
69
|
+
> See the [LICENSE](https://raw.githubusercontent.com/XYOracleNetwork/plugins/main/LICENSE)
|
|
70
|
+
> file for license details
|
|
8
71
|
|
|
9
72
|
## Credits
|
|
10
73
|
|
|
11
74
|
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
12
75
|
|
|
13
|
-
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
76
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
77
|
+
|
|
78
|
+
[main-build]: https://github.com/XYOracleNetwork/plugins/actions/workflows/build.yml/badge.svg
|
|
79
|
+
[main-build-link]: https://github.com/XYOracleNetwork/plugins/actions/workflows/build.yml
|
|
80
|
+
|
|
81
|
+
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/plugins.svg
|
|
82
|
+
[npm-link]: https://www.npmjs.com/package/@xyo-network/plugins
|
|
83
|
+
|
|
84
|
+
[codacy-badge]: https://app.codacy.com/project/badge/Grade/ba1f344ae34e4bfe999331cf4e27b9f5
|
|
85
|
+
[codacy-link]: https://www.codacy.com/gh/XYOracleNetwork/plugins/dashboard?utm_source=github.com&utm_medium=referral&utm_content=XYOracleNetwork/plugins&utm_campaign=Badge_Grade
|
|
86
|
+
|
|
87
|
+
[codeclimate-badge]: https://api.codeclimate.com/v1/badges/0e76349c9541f3866948/maintainability
|
|
88
|
+
[codeclimate-link]: https://codeclimate.com/github/XYOracleNetwork/plugins/maintainability
|
|
89
|
+
|
|
90
|
+
[snyk-badge]: https://snyk.io/test/github/XYOracleNetwork/plugins/badge.svg?targetFile=package.json
|
|
91
|
+
[snyk-link]: https://snyk.io/test/github/XYOracleNetwork/plugins?targetFile=package.json
|
|
92
|
+
|
|
93
|
+
[license-badge]: https://img.shields.io/github/license/XYOracleNetwork/plugins
|
|
94
|
+
[license-link]: https://github.com/XYOracleNetwork/plugins/blob/main/LICENSE
|
|
@@ -0,0 +1,27 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/index.ts
|
|
18
|
+
var src_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(src_exports);
|
|
20
|
+
__reExport(src_exports, require("@xyo-network/payload-plugins"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("@xyo-network/payloadset-plugins"), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require("@xyo-network/payload-plugins"),
|
|
25
|
+
...require("@xyo-network/payloadset-plugins")
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from '@xyo-network/payload-plugins'\nexport * from '@xyo-network/payloadset-plugins'\n"],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from '@xyo-network/payload-plugins'\nexport * from '@xyo-network/payloadset-plugins'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yCAAd;AACA,wBAAc,4CADd;","names":[]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
|
|
17
1
|
// src/index.ts
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
__reExport(src_exports, require("@xyo-network/payload-plugins"), module.exports);
|
|
21
|
-
__reExport(src_exports, require("@xyo-network/payloadset-plugins"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("@xyo-network/payload-plugins"),
|
|
25
|
-
...require("@xyo-network/payloadset-plugins")
|
|
26
|
-
});
|
|
2
|
+
export * from "@xyo-network/payload-plugins";
|
|
3
|
+
export * from "@xyo-network/payloadset-plugins";
|
|
27
4
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from '@xyo-network/payload-plugins'\nexport * from '@xyo-network/payloadset-plugins'\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from '@xyo-network/payload-plugins'\nexport * from '@xyo-network/payloadset-plugins'\n"],"mappings":";AAAA,cAAc;AACd,cAAc;","names":[]}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const generateJestConfig = ({ esModules }: { esModules: string[] }) => {
|
|
2
|
+
const esModulesList = Array.isArray(esModules) ? esModules.join('|') : esModules
|
|
3
|
+
return {
|
|
4
|
+
coveragePathIgnorePatterns: ['<rootDir>/(.*)/dist'],
|
|
5
|
+
globalSetup: './jestSetup/globalSetup.ts',
|
|
6
|
+
globalTeardown: './jestSetup/globalTeardown.ts',
|
|
7
|
+
moduleNameMapper: {
|
|
8
|
+
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
9
|
+
},
|
|
10
|
+
preset: 'ts-jest/presets/default-esm',
|
|
11
|
+
setupFiles: ['dotenv/config'],
|
|
12
|
+
setupFilesAfterEnv: ['jest-sorted', 'jest-extended/all', './jestSetup/setupFiles.ts'],
|
|
13
|
+
testRegex: '(/__tests__/.*|(\\.|/)((!perf\\.)test|spec))\\.tsx?$',
|
|
14
|
+
testTimeout: 200000,
|
|
15
|
+
transform: {
|
|
16
|
+
[`(${esModulesList}).+\\.js$`]: 'babel-jest',
|
|
17
|
+
'^.+\\.tsx?$': [
|
|
18
|
+
'ts-jest',
|
|
19
|
+
{
|
|
20
|
+
tsconfig: 'tsconfig.test.json',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
transformIgnorePatterns: [`./node_modules/(?!${esModulesList})`],
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const config = generateJestConfig({ esModules: ['is-ip', 'ip-regex', 'lodash-es', 'uuid', 'lodash-es', 'quick-lru'] })
|
|
29
|
+
|
|
30
|
+
// eslint-disable-next-line import/no-default-export
|
|
31
|
+
export default config
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable no-var */
|
|
2
|
+
import { config } from 'dotenv'
|
|
3
|
+
config()
|
|
4
|
+
import { Config } from 'jest'
|
|
5
|
+
import { SuperTest, Test } from 'supertest'
|
|
6
|
+
|
|
7
|
+
// Augment global scope with shared variables (must be var)
|
|
8
|
+
declare global {
|
|
9
|
+
var req: SuperTest<Test>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Jest global setup method runs before any tests are run
|
|
14
|
+
* https://jestjs.io/docs/configuration#globalsetup-string
|
|
15
|
+
*/
|
|
16
|
+
module.exports = async (_globalConfig: Config, _projectConfig: Config) => {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { config } from 'dotenv'
|
|
2
|
+
config()
|
|
3
|
+
import { Config } from 'jest'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Jest global teardown method runs after all tests are run
|
|
7
|
+
* https://jestjs.io/docs/configuration#globalteardown-string
|
|
8
|
+
*/
|
|
9
|
+
module.exports = async (_globalConfig: Config, _projectConfig: Config) => {}
|
package/package.json
CHANGED
|
@@ -7,19 +7,54 @@
|
|
|
7
7
|
},
|
|
8
8
|
"bugs": {
|
|
9
9
|
"email": "support@xyo.network",
|
|
10
|
-
"url": "https://github.com/XYOracleNetwork/
|
|
10
|
+
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
|
+
"workspaces": [
|
|
13
|
+
"packages/**/*"
|
|
14
|
+
],
|
|
12
15
|
"dependencies": {
|
|
13
|
-
"@xyo-network/payload-plugins": "~2.
|
|
14
|
-
"@xyo-network/payloadset-plugins": "~2.
|
|
16
|
+
"@xyo-network/payload-plugins": "~2.80.3",
|
|
17
|
+
"@xyo-network/payloadset-plugins": "~2.80.3"
|
|
15
18
|
},
|
|
16
19
|
"devDependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
20
|
+
"@babel/core": "^7.23.3",
|
|
21
|
+
"@babel/preset-env": "^7.23.3",
|
|
22
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
23
|
+
"@types/jest": "^29.5.8",
|
|
24
|
+
"@types/supertest": "^2.0.16",
|
|
25
|
+
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
26
|
+
"@typescript-eslint/parser": "^6.11.0",
|
|
27
|
+
"@xylabs/eslint-config": "^3.2.2",
|
|
28
|
+
"@xylabs/forget": "^2.13.9",
|
|
29
|
+
"@xylabs/ts-scripts-yarn3": "^3.2.2",
|
|
30
|
+
"@xylabs/tsconfig": "^3.2.2",
|
|
31
|
+
"@xylabs/tsconfig-dom-jest": "^3.2.2",
|
|
32
|
+
"babel-jest": "^29.7.0",
|
|
33
|
+
"dotenv": "^16.3.1",
|
|
34
|
+
"eslint": "^8.53.0",
|
|
35
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
36
|
+
"eslint-plugin-deprecation": "^2.0.0",
|
|
37
|
+
"eslint-plugin-import": "^2.29.0",
|
|
38
|
+
"jest": "^29.7.0",
|
|
39
|
+
"jest-docblock": "^29.7.0",
|
|
40
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
41
|
+
"jest-extended": "^4.0.2",
|
|
42
|
+
"jest-runner": "^29.7.0",
|
|
43
|
+
"jest-runner-groups": "^2.2.0",
|
|
44
|
+
"jest-sorted": "^1.0.14",
|
|
45
|
+
"nodemon": "^3.0.1",
|
|
46
|
+
"reflect-metadata": "^0.1.13",
|
|
47
|
+
"supertest": "^6.3.3",
|
|
48
|
+
"ts-jest": "^29.1.1",
|
|
49
|
+
"ts-node": "^10.9.1",
|
|
19
50
|
"typescript": "^5.2.2"
|
|
20
51
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
52
|
+
"resolutions": {
|
|
53
|
+
"axios": "^1",
|
|
54
|
+
"bn.js": "^5",
|
|
55
|
+
"quick-lru": "^5"
|
|
56
|
+
},
|
|
57
|
+
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
23
58
|
"exports": {
|
|
24
59
|
".": {
|
|
25
60
|
"browser": {
|
|
@@ -34,19 +69,20 @@
|
|
|
34
69
|
},
|
|
35
70
|
"node": {
|
|
36
71
|
"require": {
|
|
37
|
-
"types": "./dist/node/index.d.
|
|
38
|
-
"default": "./dist/node/index.
|
|
72
|
+
"types": "./dist/node/index.d.cts",
|
|
73
|
+
"default": "./dist/node/index.cjs"
|
|
39
74
|
},
|
|
40
75
|
"import": {
|
|
41
76
|
"types": "./dist/node/index.d.mts",
|
|
42
|
-
"default": "./dist/node/index.
|
|
77
|
+
"default": "./dist/node/index.js"
|
|
43
78
|
}
|
|
44
79
|
}
|
|
45
80
|
},
|
|
46
81
|
"./package.json": "./package.json"
|
|
47
82
|
},
|
|
48
|
-
"main": "dist/node/index.
|
|
49
|
-
"module": "dist/node/index.
|
|
83
|
+
"main": "dist/node/index.cjs",
|
|
84
|
+
"module": "dist/node/index.js",
|
|
85
|
+
"types": "dist/node/index.d.ts",
|
|
50
86
|
"homepage": "https://xyo.network",
|
|
51
87
|
"license": "LGPL-3.0-only",
|
|
52
88
|
"publishConfig": {
|
|
@@ -54,9 +90,24 @@
|
|
|
54
90
|
},
|
|
55
91
|
"repository": {
|
|
56
92
|
"type": "git",
|
|
57
|
-
"url": "https://github.com/XYOracleNetwork/
|
|
93
|
+
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
94
|
+
},
|
|
95
|
+
"scripts": {
|
|
96
|
+
"coverage": "yarn jest --coverage --forceExit",
|
|
97
|
+
"compile": "./scripts/clear-scrollback-buffer.sh && yarn xy compile",
|
|
98
|
+
"build": "xy build && xy statics",
|
|
99
|
+
"deploy": "xy deploy",
|
|
100
|
+
"lint-pkg": "npmPkgJsonLint .",
|
|
101
|
+
"test-esm": "node $(yarn jest --no-cache --forceExit)",
|
|
102
|
+
"test": "jest --no-cache --forceExit",
|
|
103
|
+
"build-typedoc-site": "xy gen-docs @xyo-network/plugins"
|
|
58
104
|
},
|
|
59
105
|
"sideEffects": false,
|
|
60
|
-
"
|
|
61
|
-
"
|
|
106
|
+
"version": "2.80.3",
|
|
107
|
+
"packageManager": "yarn@4.0.2",
|
|
108
|
+
"volta": {
|
|
109
|
+
"node": "18.17.1",
|
|
110
|
+
"yarn": "1.22.19"
|
|
111
|
+
},
|
|
112
|
+
"type": "module"
|
|
62
113
|
}
|
package/typedoc.json
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://typedoc.org/schema.json",
|
|
3
|
-
"
|
|
3
|
+
"entryPointStrategy": "packages",
|
|
4
|
+
"entryPoints": [
|
|
5
|
+
"**/packages/*"
|
|
6
|
+
],
|
|
7
|
+
"includeVersion": true,
|
|
8
|
+
"name": "XYO Plugins",
|
|
4
9
|
"tsconfig": "./tsconfig.typedoc.json"
|
|
5
10
|
}
|
package/dist/node/index.mjs
DELETED