@yuants/vendor-binance 0.6.9 → 0.6.11
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/package.json +12 -12
- package/temp/package-deps.json +14 -16
- package/dist/extension.bundle.js +0 -120
- package/dist/extension.js +0 -90
- package/dist/extension.js.map +0 -1
- package/lib/extension.d.ts +0 -4
- package/lib/extension.d.ts.map +0 -1
- package/lib/extension.js +0 -92
- package/lib/extension.js.map +0 -1
- package/temp/image-tag +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuants/vendor-binance",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"bin": "lib/cli.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"temp"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@yuants/protocol": "0.42.
|
|
13
|
-
"@yuants/data-account": "0.4.
|
|
14
|
-
"@yuants/utils": "0.
|
|
15
|
-
"@yuants/data-series": "0.3.
|
|
16
|
-
"@yuants/sql": "0.9.
|
|
17
|
-
"@yuants/data-product": "0.2.
|
|
18
|
-
"@yuants/data-ohlc": "0.3.
|
|
19
|
-
"@yuants/data-order": "0.2.
|
|
20
|
-
"@yuants/data-interest-rate": "0.1.
|
|
21
|
-
"@yuants/transfer": "0.2.
|
|
12
|
+
"@yuants/protocol": "0.42.1",
|
|
13
|
+
"@yuants/data-account": "0.4.1",
|
|
14
|
+
"@yuants/utils": "0.8.0",
|
|
15
|
+
"@yuants/data-series": "0.3.25",
|
|
16
|
+
"@yuants/sql": "0.9.4",
|
|
17
|
+
"@yuants/data-product": "0.2.14",
|
|
18
|
+
"@yuants/data-ohlc": "0.3.21",
|
|
19
|
+
"@yuants/data-order": "0.2.10",
|
|
20
|
+
"@yuants/data-interest-rate": "0.1.22",
|
|
21
|
+
"@yuants/transfer": "0.2.13",
|
|
22
22
|
"rxjs": "~7.5.6",
|
|
23
23
|
"crypto-js": "^4.2.0"
|
|
24
24
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@rushstack/heft-node-rig": "~1.10.7",
|
|
30
30
|
"@types/heft-jest": "1.0.3",
|
|
31
31
|
"@types/node": "22",
|
|
32
|
-
"@yuants/extension": "0.2.
|
|
32
|
+
"@yuants/extension": "0.2.24",
|
|
33
33
|
"@yuants/tool-kit": "0.2.0",
|
|
34
34
|
"typescript": "~4.7.4",
|
|
35
35
|
"ts-node": "~10.9.2"
|
package/temp/package-deps.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"apps/vendor-binance/CHANGELOG.json": "
|
|
3
|
-
"apps/vendor-binance/CHANGELOG.md": "
|
|
2
|
+
"apps/vendor-binance/CHANGELOG.json": "95d6f4bbb0dea978a4144c5e142ec0badcfbcddb",
|
|
3
|
+
"apps/vendor-binance/CHANGELOG.md": "402e63ee47f23f8efafe0b1d85a4d4be841c64f8",
|
|
4
4
|
"apps/vendor-binance/README.md": "4ab94c08b3d07398aee74c3264a4f87d554d20fa",
|
|
5
5
|
"apps/vendor-binance/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",
|
|
6
|
-
"apps/vendor-binance/build/Dockerfile": "bcf1c8d7b51c3106affd0579545e92af1a505b56",
|
|
7
6
|
"apps/vendor-binance/config/jest.config.json": "4bb17bde3ee911163a3edb36a6eb71491d80b1bd",
|
|
8
7
|
"apps/vendor-binance/config/rig.json": "f6c7b5537dc77a3170ba9f008bae3b6c3ee11956",
|
|
9
8
|
"apps/vendor-binance/config/typescript.json": "854907e8a821f2050f6533368db160c649c25348",
|
|
10
9
|
"apps/vendor-binance/etc/vendor-binance.api.md": "2094b84e9b5e7503f5c42b31fffee8d7db47fe7b",
|
|
11
|
-
"apps/vendor-binance/package.json": "
|
|
10
|
+
"apps/vendor-binance/package.json": "5d05e6eb5d99cfc5e7936c2adb041c486c7eda5e",
|
|
12
11
|
"apps/vendor-binance/src/api.ts": "6278b55e9330d8f49362f9ab4f7df1d9d021b93e",
|
|
13
12
|
"apps/vendor-binance/src/cli.ts": "9bf6b5559a6c6f33da20e74cc6c5d702c60ec891",
|
|
14
|
-
"apps/vendor-binance/src/extension.ts": "20c19da6bd0224b891dbbb94e3f63458ba7ae57b",
|
|
15
13
|
"apps/vendor-binance/src/index.ts": "fdac26f4c4a5093e3d647bddcd3c9998c2de7b4c",
|
|
16
14
|
"apps/vendor-binance/src/interest_rate.ts": "473562c8e0a772338809705ba5d908c0489c5dcb",
|
|
17
15
|
"apps/vendor-binance/src/legacy_index.ts": "77c0fa39308f870286280f55ef77a11d0eddbdfa",
|
|
@@ -19,16 +17,16 @@
|
|
|
19
17
|
"apps/vendor-binance/src/terminal.ts": "04776a178d253a2e53f9c84c802e80f67aa9179b",
|
|
20
18
|
"apps/vendor-binance/tsconfig.json": "81da8f78196974b5d15da0edb6b2d9f48641063c",
|
|
21
19
|
"apps/vendor-binance/.rush/temp/shrinkwrap-deps.json": "80a5c76b2afe850118bafcd332e4a9d737d2e08e",
|
|
22
|
-
"libraries/protocol/temp/package-deps.json": "
|
|
23
|
-
"libraries/data-account/temp/package-deps.json": "
|
|
24
|
-
"libraries/utils/temp/package-deps.json": "
|
|
25
|
-
"libraries/data-series/temp/package-deps.json": "
|
|
26
|
-
"libraries/sql/temp/package-deps.json": "
|
|
27
|
-
"libraries/data-product/temp/package-deps.json": "
|
|
28
|
-
"libraries/data-ohlc/temp/package-deps.json": "
|
|
29
|
-
"libraries/data-order/temp/package-deps.json": "
|
|
30
|
-
"libraries/data-interest-rate/temp/package-deps.json": "
|
|
31
|
-
"libraries/transfer/temp/package-deps.json": "
|
|
32
|
-
"libraries/extension/temp/package-deps.json": "
|
|
20
|
+
"libraries/protocol/temp/package-deps.json": "68f1211ef6fa964309505e53f0b94ddcaf6d2909",
|
|
21
|
+
"libraries/data-account/temp/package-deps.json": "9be03165ffc03d1ebe7c93f1acba11bd35e4b89c",
|
|
22
|
+
"libraries/utils/temp/package-deps.json": "c0ccd6946461153e7eb1b04a3061e075788fad2a",
|
|
23
|
+
"libraries/data-series/temp/package-deps.json": "d165e48d81cb126840dea31435e03776c76baf4d",
|
|
24
|
+
"libraries/sql/temp/package-deps.json": "0d5252756a74ebb7ec08680f8a8b4be12241a90d",
|
|
25
|
+
"libraries/data-product/temp/package-deps.json": "bc7c03c62de2df960d705469d0c42d851cd51a62",
|
|
26
|
+
"libraries/data-ohlc/temp/package-deps.json": "106c33d9c2f3ff01b21e764bf9a6ffd383353d0e",
|
|
27
|
+
"libraries/data-order/temp/package-deps.json": "731f14faef09e1d43637a778fe2214c940d15ce3",
|
|
28
|
+
"libraries/data-interest-rate/temp/package-deps.json": "aa7bfce06421a83b35809a13b8cecb2f35c21b12",
|
|
29
|
+
"libraries/transfer/temp/package-deps.json": "c7e6540230425de9372b9817e0311a13a51d3422",
|
|
30
|
+
"libraries/extension/temp/package-deps.json": "abcd1ce716b9fd88f33173d01f02c4c3a9462009",
|
|
33
31
|
"tools/toolkit/temp/package-deps.json": "3bef053db16659f0cdaceea64c8a8580c0131633"
|
|
34
32
|
}
|
package/dist/extension.bundle.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
(function () {
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Generates environment variables in the format of a Docker Compose file.
|
|
9
|
-
* @public
|
|
10
|
-
* @param env - The environment variables.
|
|
11
|
-
* @returns The environment variables in the format of a Docker Compose file.
|
|
12
|
-
*/
|
|
13
|
-
function makeDockerEnvs(env) {
|
|
14
|
-
return Object.entries(env !== null && env !== void 0 ? env : {}).map(([k, v]) => `${k}=${v}`);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Generates environment variables in the format of a Kubernetes pod.
|
|
18
|
-
* @public
|
|
19
|
-
* @param env - The environment variables.
|
|
20
|
-
* @returns The environment variables in the format of a Kubernetes pod.
|
|
21
|
-
*/
|
|
22
|
-
function makeK8sEnvs(env) {
|
|
23
|
-
return Object.entries(env !== null && env !== void 0 ? env : {}).map(([k, v]) => ({
|
|
24
|
-
name: k,
|
|
25
|
-
value: `${v}`,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var extension = (context) => {
|
|
30
|
-
context.registerDeployProvider({
|
|
31
|
-
make_json_schema: () => ({
|
|
32
|
-
type: 'object',
|
|
33
|
-
properties: {
|
|
34
|
-
env: {
|
|
35
|
-
type: 'object',
|
|
36
|
-
required: ['HOST_URL'],
|
|
37
|
-
properties: {
|
|
38
|
-
//
|
|
39
|
-
PUBLIC_ONLY: { type: 'boolean' },
|
|
40
|
-
HOST_URL: { type: 'string' },
|
|
41
|
-
TERMINAL_ID: { type: 'string' },
|
|
42
|
-
ACCESS_KEY: { type: 'string' },
|
|
43
|
-
SECRET_KEY: { type: 'string' },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
make_docker_compose_file: async (ctx, envCtx) => {
|
|
49
|
-
var _a;
|
|
50
|
-
return {
|
|
51
|
-
[`binance-${ctx.env.ACCESS_KEY}`.replace(/\s/g, '')]: {
|
|
52
|
-
image: `ghcr.io/no-trade-no-life/vendor-binance:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
|
|
53
|
-
restart: 'always',
|
|
54
|
-
environment: makeDockerEnvs(ctx.env),
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
make_k8s_resource_objects: async (ctx, envCtx) => {
|
|
59
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
60
|
-
return {
|
|
61
|
-
deployment: {
|
|
62
|
-
apiVersion: 'apps/v1',
|
|
63
|
-
kind: 'Deployment',
|
|
64
|
-
metadata: {
|
|
65
|
-
labels: {
|
|
66
|
-
'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
|
|
67
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
68
|
-
'y.ntnl.io/component': 'binance',
|
|
69
|
-
},
|
|
70
|
-
name: `binance-${ctx.key}`.replace(/\s/g, '').toLocaleLowerCase(),
|
|
71
|
-
namespace: 'yuan',
|
|
72
|
-
},
|
|
73
|
-
spec: {
|
|
74
|
-
replicas: 1,
|
|
75
|
-
selector: {
|
|
76
|
-
matchLabels: {
|
|
77
|
-
'y.ntnl.io/component': 'binance',
|
|
78
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
template: {
|
|
82
|
-
metadata: {
|
|
83
|
-
labels: {
|
|
84
|
-
'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
|
|
85
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
86
|
-
'y.ntnl.io/component': 'binance',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
spec: {
|
|
90
|
-
containers: [
|
|
91
|
-
{
|
|
92
|
-
env: makeK8sEnvs(ctx.env),
|
|
93
|
-
image: `ghcr.io/no-trade-no-life/vendor-binance:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
|
|
94
|
-
imagePullPolicy: 'IfNotPresent',
|
|
95
|
-
name: 'binance',
|
|
96
|
-
resources: {
|
|
97
|
-
limits: {
|
|
98
|
-
cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '1',
|
|
99
|
-
memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '512Mi',
|
|
100
|
-
},
|
|
101
|
-
requests: {
|
|
102
|
-
cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '200m',
|
|
103
|
-
memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '256Mi',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
hostname: 'binance',
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
return extension;
|
|
119
|
-
|
|
120
|
-
})();
|
package/dist/extension.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';
|
|
2
|
-
export default (context) => {
|
|
3
|
-
context.registerDeployProvider({
|
|
4
|
-
make_json_schema: () => ({
|
|
5
|
-
type: 'object',
|
|
6
|
-
properties: {
|
|
7
|
-
env: {
|
|
8
|
-
type: 'object',
|
|
9
|
-
required: ['HOST_URL'],
|
|
10
|
-
properties: {
|
|
11
|
-
//
|
|
12
|
-
PUBLIC_ONLY: { type: 'boolean' },
|
|
13
|
-
HOST_URL: { type: 'string' },
|
|
14
|
-
TERMINAL_ID: { type: 'string' },
|
|
15
|
-
ACCESS_KEY: { type: 'string' },
|
|
16
|
-
SECRET_KEY: { type: 'string' },
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
}),
|
|
21
|
-
make_docker_compose_file: async (ctx, envCtx) => {
|
|
22
|
-
var _a;
|
|
23
|
-
return {
|
|
24
|
-
[`binance-${ctx.env.ACCESS_KEY}`.replace(/\s/g, '')]: {
|
|
25
|
-
image: `ghcr.io/no-trade-no-life/vendor-binance:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
|
|
26
|
-
restart: 'always',
|
|
27
|
-
environment: makeDockerEnvs(ctx.env),
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
make_k8s_resource_objects: async (ctx, envCtx) => {
|
|
32
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
33
|
-
return {
|
|
34
|
-
deployment: {
|
|
35
|
-
apiVersion: 'apps/v1',
|
|
36
|
-
kind: 'Deployment',
|
|
37
|
-
metadata: {
|
|
38
|
-
labels: {
|
|
39
|
-
'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
|
|
40
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
41
|
-
'y.ntnl.io/component': 'binance',
|
|
42
|
-
},
|
|
43
|
-
name: `binance-${ctx.key}`.replace(/\s/g, '').toLocaleLowerCase(),
|
|
44
|
-
namespace: 'yuan',
|
|
45
|
-
},
|
|
46
|
-
spec: {
|
|
47
|
-
replicas: 1,
|
|
48
|
-
selector: {
|
|
49
|
-
matchLabels: {
|
|
50
|
-
'y.ntnl.io/component': 'binance',
|
|
51
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
template: {
|
|
55
|
-
metadata: {
|
|
56
|
-
labels: {
|
|
57
|
-
'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
|
|
58
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
59
|
-
'y.ntnl.io/component': 'binance',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
spec: {
|
|
63
|
-
containers: [
|
|
64
|
-
{
|
|
65
|
-
env: makeK8sEnvs(ctx.env),
|
|
66
|
-
image: `ghcr.io/no-trade-no-life/vendor-binance:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
|
|
67
|
-
imagePullPolicy: 'IfNotPresent',
|
|
68
|
-
name: 'binance',
|
|
69
|
-
resources: {
|
|
70
|
-
limits: {
|
|
71
|
-
cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '1',
|
|
72
|
-
memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '512Mi',
|
|
73
|
-
},
|
|
74
|
-
requests: {
|
|
75
|
-
cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '200m',
|
|
76
|
-
memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '256Mi',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
hostname: 'binance',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL=extension.js.map
|
package/dist/extension.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnF,eAAe,CAAC,OAA0B,EAAE,EAAE;IAC5C,OAAO,CAAC,sBAAsB,CAAC;QAC7B,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;YACvB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,CAAC,UAAU,CAAC;oBACtB,UAAU,EAAE;wBACV,EAAE;wBACF,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;wBAChC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC5B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC/B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC9B,UAAU,EAAE,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GAAG;oCACjC,qBAAqB,EAAE,SAAS;iCACjC;6BACF;4BACD,IAAI,EAAE;gCACJ,UAAU,EAAE;oCACV;wCACE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC;wCACzB,KAAK,EAAE,2CAA2C,MAAA,GAAG,CAAC,OAAO,mCAAI,MAAM,CAAC,OAAO,EAAE;wCACjF,eAAe,EAAE,cAAc;wCAC/B,IAAI,EAAE,SAAS;wCACf,SAAS,EAAE;4CACT,MAAM,EAAE;gDACN,GAAG,EAAE,MAAA,MAAA,GAAG,CAAC,GAAG,0CAAE,GAAG,mCAAI,GAAG;gDACxB,MAAM,EAAE,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,mCAAI,OAAO;6CACnC;4CACD,QAAQ,EAAE;gDACR,GAAG,EAAE,MAAA,MAAA,GAAG,CAAC,GAAG,0CAAE,GAAG,mCAAI,MAAM;gDAC3B,MAAM,EAAE,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,mCAAI,OAAO;6CACnC;yCACF;qCACF;iCACF;gCACD,QAAQ,EAAE,SAAS;6BACpB;yBACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { IExtensionContext, makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';\nexport default (context: IExtensionContext) => {\n context.registerDeployProvider({\n make_json_schema: () => ({\n type: 'object',\n properties: {\n env: {\n type: 'object',\n required: ['HOST_URL'],\n properties: {\n //\n PUBLIC_ONLY: { type: 'boolean' },\n HOST_URL: { type: 'string' },\n TERMINAL_ID: { type: 'string' },\n ACCESS_KEY: { type: 'string' },\n SECRET_KEY: { type: 'string' },\n },\n },\n },\n }),\n make_docker_compose_file: async (ctx, envCtx) => {\n return {\n [`binance-${ctx.env!.ACCESS_KEY}`.replace(/\\s/g, '')]: {\n image: `ghcr.io/no-trade-no-life/vendor-binance:${ctx.version ?? envCtx.version}`,\n restart: 'always',\n\n environment: makeDockerEnvs(ctx.env),\n },\n };\n },\n make_k8s_resource_objects: async (ctx, envCtx) => {\n return {\n deployment: {\n apiVersion: 'apps/v1',\n kind: 'Deployment',\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'binance',\n },\n name: `binance-${ctx.key}`.replace(/\\s/g, '').toLocaleLowerCase(),\n namespace: 'yuan',\n },\n spec: {\n replicas: 1,\n selector: {\n matchLabels: {\n 'y.ntnl.io/component': 'binance',\n 'y.ntnl.io/manifest_key': ctx.key,\n },\n },\n template: {\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'binance',\n },\n },\n spec: {\n containers: [\n {\n env: makeK8sEnvs(ctx.env),\n image: `ghcr.io/no-trade-no-life/vendor-binance:${ctx.version ?? envCtx.version}`,\n imagePullPolicy: 'IfNotPresent',\n name: 'binance',\n resources: {\n limits: {\n cpu: ctx.cpu?.max ?? '1',\n memory: ctx.memory?.max ?? '512Mi',\n },\n requests: {\n cpu: ctx.cpu?.min ?? '200m',\n memory: ctx.memory?.min ?? '256Mi',\n },\n },\n },\n ],\n hostname: 'binance',\n },\n },\n },\n },\n };\n },\n });\n};\n"]}
|
package/lib/extension.d.ts
DELETED
package/lib/extension.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,mBAAmB,CAAC;kCAC1D,iBAAiB;AAA1C,wBAsFE"}
|
package/lib/extension.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const extension_1 = require("@yuants/extension");
|
|
4
|
-
exports.default = (context) => {
|
|
5
|
-
context.registerDeployProvider({
|
|
6
|
-
make_json_schema: () => ({
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {
|
|
9
|
-
env: {
|
|
10
|
-
type: 'object',
|
|
11
|
-
required: ['HOST_URL'],
|
|
12
|
-
properties: {
|
|
13
|
-
//
|
|
14
|
-
PUBLIC_ONLY: { type: 'boolean' },
|
|
15
|
-
HOST_URL: { type: 'string' },
|
|
16
|
-
TERMINAL_ID: { type: 'string' },
|
|
17
|
-
ACCESS_KEY: { type: 'string' },
|
|
18
|
-
SECRET_KEY: { type: 'string' },
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
}),
|
|
23
|
-
make_docker_compose_file: async (ctx, envCtx) => {
|
|
24
|
-
var _a;
|
|
25
|
-
return {
|
|
26
|
-
[`binance-${ctx.env.ACCESS_KEY}`.replace(/\s/g, '')]: {
|
|
27
|
-
image: `ghcr.io/no-trade-no-life/vendor-binance:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
|
|
28
|
-
restart: 'always',
|
|
29
|
-
environment: (0, extension_1.makeDockerEnvs)(ctx.env),
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
make_k8s_resource_objects: async (ctx, envCtx) => {
|
|
34
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
35
|
-
return {
|
|
36
|
-
deployment: {
|
|
37
|
-
apiVersion: 'apps/v1',
|
|
38
|
-
kind: 'Deployment',
|
|
39
|
-
metadata: {
|
|
40
|
-
labels: {
|
|
41
|
-
'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
|
|
42
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
43
|
-
'y.ntnl.io/component': 'binance',
|
|
44
|
-
},
|
|
45
|
-
name: `binance-${ctx.key}`.replace(/\s/g, '').toLocaleLowerCase(),
|
|
46
|
-
namespace: 'yuan',
|
|
47
|
-
},
|
|
48
|
-
spec: {
|
|
49
|
-
replicas: 1,
|
|
50
|
-
selector: {
|
|
51
|
-
matchLabels: {
|
|
52
|
-
'y.ntnl.io/component': 'binance',
|
|
53
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
template: {
|
|
57
|
-
metadata: {
|
|
58
|
-
labels: {
|
|
59
|
-
'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
|
|
60
|
-
'y.ntnl.io/manifest_key': ctx.key,
|
|
61
|
-
'y.ntnl.io/component': 'binance',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
spec: {
|
|
65
|
-
containers: [
|
|
66
|
-
{
|
|
67
|
-
env: (0, extension_1.makeK8sEnvs)(ctx.env),
|
|
68
|
-
image: `ghcr.io/no-trade-no-life/vendor-binance:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
|
|
69
|
-
imagePullPolicy: 'IfNotPresent',
|
|
70
|
-
name: 'binance',
|
|
71
|
-
resources: {
|
|
72
|
-
limits: {
|
|
73
|
-
cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '1',
|
|
74
|
-
memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '512Mi',
|
|
75
|
-
},
|
|
76
|
-
requests: {
|
|
77
|
-
cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '200m',
|
|
78
|
-
memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '256Mi',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
hostname: 'binance',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=extension.js.map
|
package/lib/extension.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;AAAA,iDAAmF;AACnF,kBAAe,CAAC,OAA0B,EAAE,EAAE;IAC5C,OAAO,CAAC,sBAAsB,CAAC;QAC7B,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;YACvB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,CAAC,UAAU,CAAC;oBACtB,UAAU,EAAE;wBACV,EAAE;wBACF,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;wBAChC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC5B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC/B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC/B;iBACF;aACF;SACF,CAAC;QACF,wBAAwB,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;;YAC9C,OAAO;gBACL,CAAC,WAAW,GAAG,CAAC,GAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE;oBACrD,KAAK,EAAE,2CAA2C,MAAA,GAAG,CAAC,OAAO,mCAAI,MAAM,CAAC,OAAO,EAAE;oBACjF,OAAO,EAAE,QAAQ;oBAEjB,WAAW,EAAE,IAAA,0BAAc,EAAC,GAAG,CAAC,GAAG,CAAC;iBACrC;aACF,CAAC;QACJ,CAAC;QACD,yBAAyB,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;;YAC/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G,EAAE,MAAA,MAAA,GAAG,CAAC,GAAG,0CAAE,GAAG,mCAAI,MAAM;gDAC3B,MAAM,EAAE,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,mCAAI,OAAO;6CACnC;yCACF;qCACF;iCACF;gCACD,QAAQ,EAAE,SAAS;6BACpB;yBACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { IExtensionContext, makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';\nexport default (context: IExtensionContext) => {\n context.registerDeployProvider({\n make_json_schema: () => ({\n type: 'object',\n properties: {\n env: {\n type: 'object',\n required: ['HOST_URL'],\n properties: {\n //\n PUBLIC_ONLY: { type: 'boolean' },\n HOST_URL: { type: 'string' },\n TERMINAL_ID: { type: 'string' },\n ACCESS_KEY: { type: 'string' },\n SECRET_KEY: { type: 'string' },\n },\n },\n },\n }),\n make_docker_compose_file: async (ctx, envCtx) => {\n return {\n [`binance-${ctx.env!.ACCESS_KEY}`.replace(/\\s/g, '')]: {\n image: `ghcr.io/no-trade-no-life/vendor-binance:${ctx.version ?? envCtx.version}`,\n restart: 'always',\n\n environment: makeDockerEnvs(ctx.env),\n },\n };\n },\n make_k8s_resource_objects: async (ctx, envCtx) => {\n return {\n deployment: {\n apiVersion: 'apps/v1',\n kind: 'Deployment',\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'binance',\n },\n name: `binance-${ctx.key}`.replace(/\\s/g, '').toLocaleLowerCase(),\n namespace: 'yuan',\n },\n spec: {\n replicas: 1,\n selector: {\n matchLabels: {\n 'y.ntnl.io/component': 'binance',\n 'y.ntnl.io/manifest_key': ctx.key,\n },\n },\n template: {\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/manifest_key': ctx.key,\n 'y.ntnl.io/component': 'binance',\n },\n },\n spec: {\n containers: [\n {\n env: makeK8sEnvs(ctx.env),\n image: `ghcr.io/no-trade-no-life/vendor-binance:${ctx.version ?? envCtx.version}`,\n imagePullPolicy: 'IfNotPresent',\n name: 'binance',\n resources: {\n limits: {\n cpu: ctx.cpu?.max ?? '1',\n memory: ctx.memory?.max ?? '512Mi',\n },\n requests: {\n cpu: ctx.cpu?.min ?? '200m',\n memory: ctx.memory?.min ?? '256Mi',\n },\n },\n },\n ],\n hostname: 'binance',\n },\n },\n },\n },\n };\n },\n });\n};\n"]}
|
package/temp/image-tag
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
sha-297f48afe8cbc860a3425535fe1544f6b656bfc5
|