@yuants/vendor-trading-view 0.3.8 → 0.3.10
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 +5 -5
- package/temp/package-deps.json +7 -9
- package/dist/extension.bundle.js +0 -135
- package/dist/extension.js +0 -105
- 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 -107
- 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-trading-view",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"bin": "lib/cli.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@yuants/protocol": "0.42.1",
|
|
13
|
-
"@yuants/data-series": "0.3.
|
|
14
|
-
"@yuants/sql": "0.9.
|
|
15
|
-
"@yuants/data-product": "0.2.
|
|
13
|
+
"@yuants/data-series": "0.3.26",
|
|
14
|
+
"@yuants/sql": "0.9.5",
|
|
15
|
+
"@yuants/data-product": "0.2.15",
|
|
16
16
|
"@yuants/utils": "0.8.0",
|
|
17
|
-
"@yuants/data-ohlc": "0.3.
|
|
17
|
+
"@yuants/data-ohlc": "0.3.22",
|
|
18
18
|
"rxjs": "~7.5.6",
|
|
19
19
|
"@mathieuc/tradingview": "~3.4.2"
|
|
20
20
|
},
|
package/temp/package-deps.json
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"apps/vendor-trading-view/CHANGELOG.json": "
|
|
3
|
-
"apps/vendor-trading-view/CHANGELOG.md": "
|
|
2
|
+
"apps/vendor-trading-view/CHANGELOG.json": "6f2a77a6261d655d67cfa6bdde299ffd4e5ef97e",
|
|
3
|
+
"apps/vendor-trading-view/CHANGELOG.md": "aa6f8facebe72dc87a8484819153ca9caac8f615",
|
|
4
4
|
"apps/vendor-trading-view/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",
|
|
5
|
-
"apps/vendor-trading-view/build/Dockerfile": "7816c8d8a127707ee40487326bbde4bcfbb6280d",
|
|
6
5
|
"apps/vendor-trading-view/config/jest.config.json": "4bb17bde3ee911163a3edb36a6eb71491d80b1bd",
|
|
7
6
|
"apps/vendor-trading-view/config/rig.json": "f6c7b5537dc77a3170ba9f008bae3b6c3ee11956",
|
|
8
7
|
"apps/vendor-trading-view/config/typescript.json": "854907e8a821f2050f6533368db160c649c25348",
|
|
9
8
|
"apps/vendor-trading-view/etc/vendor-trading-view.api.md": "341d99a0258ce3dff77a871b518a458d33bb3df5",
|
|
10
|
-
"apps/vendor-trading-view/package.json": "
|
|
9
|
+
"apps/vendor-trading-view/package.json": "833bbdd04ce649a43e3fada444adb07064246c5b",
|
|
11
10
|
"apps/vendor-trading-view/src/cli.ts": "9bf6b5559a6c6f33da20e74cc6c5d702c60ec891",
|
|
12
|
-
"apps/vendor-trading-view/src/extension.ts": "452b7d7f0ee1b60de27648ae107f10cd683b2c48",
|
|
13
11
|
"apps/vendor-trading-view/src/index.ts": "be3c727ebe6e6bfad920f66d3d75b39a91e1a755",
|
|
14
12
|
"apps/vendor-trading-view/tsconfig.json": "c96157f0fbf3503af6f84e03a0df4ac624a82d47",
|
|
15
13
|
"apps/vendor-trading-view/.rush/temp/shrinkwrap-deps.json": "c7628aefb2275d409bfbd57b3355bd5f24683160",
|
|
16
14
|
"libraries/protocol/temp/package-deps.json": "68f1211ef6fa964309505e53f0b94ddcaf6d2909",
|
|
17
|
-
"libraries/data-series/temp/package-deps.json": "
|
|
18
|
-
"libraries/sql/temp/package-deps.json": "
|
|
19
|
-
"libraries/data-product/temp/package-deps.json": "
|
|
15
|
+
"libraries/data-series/temp/package-deps.json": "e449261379774595e4fd0b1033bb8409afe4fb9c",
|
|
16
|
+
"libraries/sql/temp/package-deps.json": "ad3a35187374a87704492b34a5d287432d96b6f5",
|
|
17
|
+
"libraries/data-product/temp/package-deps.json": "e9a9715ab74c3d2c301ef5e301d14fa8a0e4e445",
|
|
20
18
|
"libraries/utils/temp/package-deps.json": "c0ccd6946461153e7eb1b04a3061e075788fad2a",
|
|
21
|
-
"libraries/data-ohlc/temp/package-deps.json": "
|
|
19
|
+
"libraries/data-ohlc/temp/package-deps.json": "5c888fdba40a855dcd84a6ed170a2af4eb07fedf",
|
|
22
20
|
"libraries/extension/temp/package-deps.json": "abcd1ce716b9fd88f33173d01f02c4c3a9462009",
|
|
23
21
|
"tools/toolkit/temp/package-deps.json": "3bef053db16659f0cdaceea64c8a8580c0131633"
|
|
24
22
|
}
|
package/dist/extension.bundle.js
DELETED
|
@@ -1,135 +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
|
-
const COMPONENT_NAME = 'vendor-trading-view';
|
|
31
|
-
context.registerDeployProvider({
|
|
32
|
-
make_json_schema: () => ({
|
|
33
|
-
type: 'object',
|
|
34
|
-
properties: {
|
|
35
|
-
env: {
|
|
36
|
-
type: 'object',
|
|
37
|
-
required: ['HOST_URL'],
|
|
38
|
-
properties: {
|
|
39
|
-
HOST_URL: {
|
|
40
|
-
type: 'string',
|
|
41
|
-
title: '主机地址',
|
|
42
|
-
},
|
|
43
|
-
CONCURRENCY: {
|
|
44
|
-
type: 'number',
|
|
45
|
-
title: '拉取数据并发量',
|
|
46
|
-
},
|
|
47
|
-
LOG_LEVEL: {
|
|
48
|
-
type: 'string',
|
|
49
|
-
enum: ['INFO', 'DEBUG'],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
make_docker_compose_file: async (ctx, envCtx) => {
|
|
56
|
-
var _a;
|
|
57
|
-
return {
|
|
58
|
-
[COMPONENT_NAME.replace(/\s/g, '')]: {
|
|
59
|
-
image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
|
|
60
|
-
restart: 'always',
|
|
61
|
-
environment: makeDockerEnvs(ctx.env),
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
make_k8s_resource_objects: async (ctx, envCtx) => {
|
|
66
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
67
|
-
const manifest_key = ctx.key;
|
|
68
|
-
return {
|
|
69
|
-
deployment: {
|
|
70
|
-
apiVersion: 'apps/v1',
|
|
71
|
-
kind: 'Deployment',
|
|
72
|
-
metadata: {
|
|
73
|
-
labels: {
|
|
74
|
-
'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
|
|
75
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
76
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
77
|
-
},
|
|
78
|
-
name: COMPONENT_NAME.replace(/\s/g, '').toLocaleLowerCase(),
|
|
79
|
-
namespace: 'yuan',
|
|
80
|
-
},
|
|
81
|
-
spec: {
|
|
82
|
-
replicas: 1,
|
|
83
|
-
selector: {
|
|
84
|
-
matchLabels: {
|
|
85
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
86
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
template: {
|
|
90
|
-
metadata: {
|
|
91
|
-
labels: {
|
|
92
|
-
'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
|
|
93
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
94
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
spec: {
|
|
98
|
-
containers: [
|
|
99
|
-
{
|
|
100
|
-
command: ['node'],
|
|
101
|
-
args: ['lib/index.js'],
|
|
102
|
-
env: makeK8sEnvs(ctx.env),
|
|
103
|
-
image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
|
|
104
|
-
imagePullPolicy: 'IfNotPresent',
|
|
105
|
-
name: COMPONENT_NAME,
|
|
106
|
-
resources: {
|
|
107
|
-
limits: {
|
|
108
|
-
cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '500m',
|
|
109
|
-
memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '512Mi',
|
|
110
|
-
},
|
|
111
|
-
requests: {
|
|
112
|
-
cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '250m',
|
|
113
|
-
memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '256Mi',
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
hostname: COMPONENT_NAME,
|
|
119
|
-
imagePullSecrets: [
|
|
120
|
-
{
|
|
121
|
-
name: 'pull-secret',
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
return extension;
|
|
134
|
-
|
|
135
|
-
})();
|
package/dist/extension.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';
|
|
2
|
-
export default (context) => {
|
|
3
|
-
const COMPONENT_NAME = 'vendor-trading-view';
|
|
4
|
-
context.registerDeployProvider({
|
|
5
|
-
make_json_schema: () => ({
|
|
6
|
-
type: 'object',
|
|
7
|
-
properties: {
|
|
8
|
-
env: {
|
|
9
|
-
type: 'object',
|
|
10
|
-
required: ['HOST_URL'],
|
|
11
|
-
properties: {
|
|
12
|
-
HOST_URL: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
title: '主机地址',
|
|
15
|
-
},
|
|
16
|
-
CONCURRENCY: {
|
|
17
|
-
type: 'number',
|
|
18
|
-
title: '拉取数据并发量',
|
|
19
|
-
},
|
|
20
|
-
LOG_LEVEL: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
enum: ['INFO', 'DEBUG'],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
}),
|
|
28
|
-
make_docker_compose_file: async (ctx, envCtx) => {
|
|
29
|
-
var _a;
|
|
30
|
-
return {
|
|
31
|
-
[COMPONENT_NAME.replace(/\s/g, '')]: {
|
|
32
|
-
image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
|
|
33
|
-
restart: 'always',
|
|
34
|
-
environment: makeDockerEnvs(ctx.env),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
make_k8s_resource_objects: async (ctx, envCtx) => {
|
|
39
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
40
|
-
const manifest_key = ctx.key;
|
|
41
|
-
return {
|
|
42
|
-
deployment: {
|
|
43
|
-
apiVersion: 'apps/v1',
|
|
44
|
-
kind: 'Deployment',
|
|
45
|
-
metadata: {
|
|
46
|
-
labels: {
|
|
47
|
-
'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
|
|
48
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
49
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
50
|
-
},
|
|
51
|
-
name: COMPONENT_NAME.replace(/\s/g, '').toLocaleLowerCase(),
|
|
52
|
-
namespace: 'yuan',
|
|
53
|
-
},
|
|
54
|
-
spec: {
|
|
55
|
-
replicas: 1,
|
|
56
|
-
selector: {
|
|
57
|
-
matchLabels: {
|
|
58
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
59
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
template: {
|
|
63
|
-
metadata: {
|
|
64
|
-
labels: {
|
|
65
|
-
'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
|
|
66
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
67
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
spec: {
|
|
71
|
-
containers: [
|
|
72
|
-
{
|
|
73
|
-
command: ['node'],
|
|
74
|
-
args: ['lib/index.js'],
|
|
75
|
-
env: makeK8sEnvs(ctx.env),
|
|
76
|
-
image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
|
|
77
|
-
imagePullPolicy: 'IfNotPresent',
|
|
78
|
-
name: COMPONENT_NAME,
|
|
79
|
-
resources: {
|
|
80
|
-
limits: {
|
|
81
|
-
cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '500m',
|
|
82
|
-
memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '512Mi',
|
|
83
|
-
},
|
|
84
|
-
requests: {
|
|
85
|
-
cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '250m',
|
|
86
|
-
memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '256Mi',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
hostname: COMPONENT_NAME,
|
|
92
|
-
imagePullSecrets: [
|
|
93
|
-
{
|
|
94
|
-
name: 'pull-secret',
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
//# 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,MAAM,cAAc,GAAG,qBAAqB,CAAC;IAC7C,OAAO,CAAC,sBAAsB,CAAC;QAC7B,gBAAgB,E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C;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { IExtensionContext, makeDockerEnvs, makeK8sEnvs } from '@yuants/extension';\nexport default (context: IExtensionContext) => {\n const COMPONENT_NAME = 'vendor-trading-view';\n context.registerDeployProvider({\n make_json_schema: () => ({\n type: 'object',\n properties: {\n env: {\n type: 'object',\n required: ['HOST_URL'],\n properties: {\n HOST_URL: {\n type: 'string',\n title: '主机地址',\n },\n CONCURRENCY: {\n type: 'number',\n title: '拉取数据并发量',\n },\n LOG_LEVEL: {\n type: 'string',\n enum: ['INFO', 'DEBUG'],\n },\n },\n },\n },\n }),\n make_docker_compose_file: async (ctx, envCtx) => {\n return {\n [COMPONENT_NAME.replace(/\\s/g, '')]: {\n image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${ctx.version ?? envCtx.version}`,\n restart: 'always',\n environment: makeDockerEnvs(ctx.env),\n },\n };\n },\n make_k8s_resource_objects: async (ctx, envCtx) => {\n const manifest_key = ctx.key;\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/component': COMPONENT_NAME,\n 'y.ntnl.io/manifest-key': manifest_key,\n },\n name: COMPONENT_NAME.replace(/\\s/g, '').toLocaleLowerCase(),\n namespace: 'yuan',\n },\n spec: {\n replicas: 1,\n selector: {\n matchLabels: {\n 'y.ntnl.io/component': COMPONENT_NAME,\n 'y.ntnl.io/manifest-key': manifest_key,\n },\n },\n template: {\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/component': COMPONENT_NAME,\n 'y.ntnl.io/manifest-key': manifest_key,\n },\n },\n spec: {\n containers: [\n {\n command: ['node'],\n args: ['lib/index.js'],\n env: makeK8sEnvs(ctx.env),\n image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${ctx.version ?? envCtx.version}`,\n imagePullPolicy: 'IfNotPresent',\n name: COMPONENT_NAME,\n resources: {\n limits: {\n cpu: ctx.cpu?.max ?? '500m',\n memory: ctx.memory?.max ?? '512Mi',\n },\n requests: {\n cpu: ctx.cpu?.min ?? '250m',\n memory: ctx.memory?.min ?? '256Mi',\n },\n },\n },\n ],\n hostname: COMPONENT_NAME,\n imagePullSecrets: [\n {\n name: 'pull-secret',\n },\n ],\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,wBAoGE"}
|
package/lib/extension.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const extension_1 = require("@yuants/extension");
|
|
4
|
-
exports.default = (context) => {
|
|
5
|
-
const COMPONENT_NAME = 'vendor-trading-view';
|
|
6
|
-
context.registerDeployProvider({
|
|
7
|
-
make_json_schema: () => ({
|
|
8
|
-
type: 'object',
|
|
9
|
-
properties: {
|
|
10
|
-
env: {
|
|
11
|
-
type: 'object',
|
|
12
|
-
required: ['HOST_URL'],
|
|
13
|
-
properties: {
|
|
14
|
-
HOST_URL: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
title: '主机地址',
|
|
17
|
-
},
|
|
18
|
-
CONCURRENCY: {
|
|
19
|
-
type: 'number',
|
|
20
|
-
title: '拉取数据并发量',
|
|
21
|
-
},
|
|
22
|
-
LOG_LEVEL: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
enum: ['INFO', 'DEBUG'],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
}),
|
|
30
|
-
make_docker_compose_file: async (ctx, envCtx) => {
|
|
31
|
-
var _a;
|
|
32
|
-
return {
|
|
33
|
-
[COMPONENT_NAME.replace(/\s/g, '')]: {
|
|
34
|
-
image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
|
|
35
|
-
restart: 'always',
|
|
36
|
-
environment: (0, extension_1.makeDockerEnvs)(ctx.env),
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
make_k8s_resource_objects: async (ctx, envCtx) => {
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
42
|
-
const manifest_key = ctx.key;
|
|
43
|
-
return {
|
|
44
|
-
deployment: {
|
|
45
|
-
apiVersion: 'apps/v1',
|
|
46
|
-
kind: 'Deployment',
|
|
47
|
-
metadata: {
|
|
48
|
-
labels: {
|
|
49
|
-
'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
|
|
50
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
51
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
52
|
-
},
|
|
53
|
-
name: COMPONENT_NAME.replace(/\s/g, '').toLocaleLowerCase(),
|
|
54
|
-
namespace: 'yuan',
|
|
55
|
-
},
|
|
56
|
-
spec: {
|
|
57
|
-
replicas: 1,
|
|
58
|
-
selector: {
|
|
59
|
-
matchLabels: {
|
|
60
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
61
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
template: {
|
|
65
|
-
metadata: {
|
|
66
|
-
labels: {
|
|
67
|
-
'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
|
|
68
|
-
'y.ntnl.io/component': COMPONENT_NAME,
|
|
69
|
-
'y.ntnl.io/manifest-key': manifest_key,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
spec: {
|
|
73
|
-
containers: [
|
|
74
|
-
{
|
|
75
|
-
command: ['node'],
|
|
76
|
-
args: ['lib/index.js'],
|
|
77
|
-
env: (0, extension_1.makeK8sEnvs)(ctx.env),
|
|
78
|
-
image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
|
|
79
|
-
imagePullPolicy: 'IfNotPresent',
|
|
80
|
-
name: COMPONENT_NAME,
|
|
81
|
-
resources: {
|
|
82
|
-
limits: {
|
|
83
|
-
cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '500m',
|
|
84
|
-
memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '512Mi',
|
|
85
|
-
},
|
|
86
|
-
requests: {
|
|
87
|
-
cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '250m',
|
|
88
|
-
memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '256Mi',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
hostname: COMPONENT_NAME,
|
|
94
|
-
imagePullSecrets: [
|
|
95
|
-
{
|
|
96
|
-
name: 'pull-secret',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
//# 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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QAAQ,EAAE,cAAc;gCACxB,gBAAgB,EAAE;oCAChB;wCACE,IAAI,EAAE,aAAa;qCACpB;iCACF;6BACF;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 const COMPONENT_NAME = 'vendor-trading-view';\n context.registerDeployProvider({\n make_json_schema: () => ({\n type: 'object',\n properties: {\n env: {\n type: 'object',\n required: ['HOST_URL'],\n properties: {\n HOST_URL: {\n type: 'string',\n title: '主机地址',\n },\n CONCURRENCY: {\n type: 'number',\n title: '拉取数据并发量',\n },\n LOG_LEVEL: {\n type: 'string',\n enum: ['INFO', 'DEBUG'],\n },\n },\n },\n },\n }),\n make_docker_compose_file: async (ctx, envCtx) => {\n return {\n [COMPONENT_NAME.replace(/\\s/g, '')]: {\n image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${ctx.version ?? envCtx.version}`,\n restart: 'always',\n environment: makeDockerEnvs(ctx.env),\n },\n };\n },\n make_k8s_resource_objects: async (ctx, envCtx) => {\n const manifest_key = ctx.key;\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/component': COMPONENT_NAME,\n 'y.ntnl.io/manifest-key': manifest_key,\n },\n name: COMPONENT_NAME.replace(/\\s/g, '').toLocaleLowerCase(),\n namespace: 'yuan',\n },\n spec: {\n replicas: 1,\n selector: {\n matchLabels: {\n 'y.ntnl.io/component': COMPONENT_NAME,\n 'y.ntnl.io/manifest-key': manifest_key,\n },\n },\n template: {\n metadata: {\n labels: {\n 'y.ntnl.io/version': ctx.version ?? envCtx.version,\n 'y.ntnl.io/component': COMPONENT_NAME,\n 'y.ntnl.io/manifest-key': manifest_key,\n },\n },\n spec: {\n containers: [\n {\n command: ['node'],\n args: ['lib/index.js'],\n env: makeK8sEnvs(ctx.env),\n image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${ctx.version ?? envCtx.version}`,\n imagePullPolicy: 'IfNotPresent',\n name: COMPONENT_NAME,\n resources: {\n limits: {\n cpu: ctx.cpu?.max ?? '500m',\n memory: ctx.memory?.max ?? '512Mi',\n },\n requests: {\n cpu: ctx.cpu?.min ?? '250m',\n memory: ctx.memory?.min ?? '256Mi',\n },\n },\n },\n ],\n hostname: COMPONENT_NAME,\n imagePullSecrets: [\n {\n name: 'pull-secret',\n },\n ],\n },\n },\n },\n },\n };\n },\n });\n};\n"]}
|
package/temp/image-tag
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
sha-0617c2c0a729543f80f3ff7b9186663d2ac4b113
|