@yuants/vendor-trading-view 0.0.7 → 0.1.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.
@@ -27,50 +27,44 @@
27
27
  }
28
28
 
29
29
  var extension = (context) => {
30
+ const COMPONENT_NAME = 'app-vendor-trading-view';
30
31
  context.registerDeployProvider({
31
32
  make_json_schema: () => ({
32
33
  type: 'object',
33
34
  properties: {
34
35
  env: {
35
36
  type: 'object',
36
- required: ['HV_URL'],
37
+ required: ['HOST_URL'],
37
38
  properties: {
38
- HV_URL: {
39
+ HOST_URL: {
39
40
  type: 'string',
40
- title: '主机地址'
41
- },
42
- HEADLESS: {
43
- type: 'boolean'
41
+ title: '主机地址',
44
42
  },
45
43
  CONCURRENCY: {
46
44
  type: 'number',
47
- title: '拉取数据并发量'
48
- },
49
- NO_SANDBOX: {
50
- type: 'string',
51
- title: '是否禁用沙箱'
45
+ title: '拉取数据并发量',
52
46
  },
53
47
  LOG_LEVEL: {
54
48
  type: 'string',
55
- enum: ['INFO', 'DEBUG']
56
- }
57
- }
58
- }
59
- }
49
+ enum: ['INFO', 'DEBUG'],
50
+ },
51
+ },
52
+ },
53
+ },
60
54
  }),
61
55
  make_docker_compose_file: async (ctx, envCtx) => {
62
56
  var _a;
63
57
  return {
64
- [`trading-view`.replace(/\s/g, '')]: {
65
- image: `registry.ap-southeast-1.aliyuncs.com/ntnl-y/vendor-trading-view:${(_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version}`,
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}`,
66
60
  restart: 'always',
67
- cap_add: ['SYS_ADMIN'],
68
- environment: makeDockerEnvs(ctx.env)
69
- }
61
+ environment: makeDockerEnvs(ctx.env),
62
+ },
70
63
  };
71
64
  },
72
65
  make_k8s_resource_objects: async (ctx, envCtx) => {
73
66
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
67
+ const manifest_key = ctx.key;
74
68
  return {
75
69
  deployment: {
76
70
  apiVersion: 'apps/v1',
@@ -78,24 +72,27 @@
78
72
  metadata: {
79
73
  labels: {
80
74
  'y.ntnl.io/version': (_a = ctx.version) !== null && _a !== void 0 ? _a : envCtx.version,
81
- 'y.ntnl.io/component': 'trading-view'
75
+ 'y.ntnl.io/component': COMPONENT_NAME,
76
+ 'y.ntnl.io/manifest-key': manifest_key,
82
77
  },
83
- name: `trading-view`.replace(/\s/g, '').toLocaleLowerCase(),
84
- namespace: 'yuan'
78
+ name: COMPONENT_NAME.replace(/\s/g, '').toLocaleLowerCase(),
79
+ namespace: 'yuan',
85
80
  },
86
81
  spec: {
87
82
  replicas: 1,
88
83
  selector: {
89
84
  matchLabels: {
90
- 'y.ntnl.io/component': 'trading-view'
91
- }
85
+ 'y.ntnl.io/component': COMPONENT_NAME,
86
+ 'y.ntnl.io/manifest-key': manifest_key,
87
+ },
92
88
  },
93
89
  template: {
94
90
  metadata: {
95
91
  labels: {
96
92
  'y.ntnl.io/version': (_b = ctx.version) !== null && _b !== void 0 ? _b : envCtx.version,
97
- 'y.ntnl.io/component': 'trading-view'
98
- }
93
+ 'y.ntnl.io/component': COMPONENT_NAME,
94
+ 'y.ntnl.io/manifest-key': manifest_key,
95
+ },
99
96
  },
100
97
  spec: {
101
98
  containers: [
@@ -103,38 +100,33 @@
103
100
  command: ['node'],
104
101
  args: ['lib/index.js'],
105
102
  env: makeK8sEnvs(ctx.env),
106
- image: `registry.ap-southeast-1.aliyuncs.com/ntnl-y/vendor-trading-view:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
103
+ image: `ghcr.io/no-trade-no-life/${COMPONENT_NAME}:${(_c = ctx.version) !== null && _c !== void 0 ? _c : envCtx.version}`,
107
104
  imagePullPolicy: 'IfNotPresent',
108
- name: 'trading-view',
105
+ name: COMPONENT_NAME,
109
106
  resources: {
110
107
  limits: {
111
- cpu: (_e = (_d = ctx.cpu) === null || _d === void 0 ? void 0 : _d.max) !== null && _e !== void 0 ? _e : '1',
112
- memory: (_g = (_f = ctx.memory) === null || _f === void 0 ? void 0 : _f.max) !== null && _g !== void 0 ? _g : '1Gi'
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',
113
110
  },
114
111
  requests: {
115
- cpu: (_j = (_h = ctx.cpu) === null || _h === void 0 ? void 0 : _h.min) !== null && _j !== void 0 ? _j : '500m',
116
- memory: (_l = (_k = ctx.memory) === null || _k === void 0 ? void 0 : _k.min) !== null && _l !== void 0 ? _l : '256Mi'
117
- }
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
+ },
118
115
  },
119
- securityContext: {
120
- capabilities: {
121
- add: ['SYS_ADMIN']
122
- }
123
- }
124
- }
116
+ },
125
117
  ],
126
- hostname: 'trading-view',
118
+ hostname: COMPONENT_NAME,
127
119
  imagePullSecrets: [
128
120
  {
129
- name: 'pull-secret'
130
- }
131
- ]
132
- }
133
- }
134
- }
135
- }
121
+ name: 'pull-secret',
122
+ },
123
+ ],
124
+ },
125
+ },
126
+ },
127
+ },
136
128
  };
137
- }
129
+ },
138
130
  });
139
131
  };
140
132
 
package/package.json CHANGED
@@ -1,40 +1,39 @@
1
1
  {
2
- "name": "@yuants/vendor-trading-view",
3
- "version": "0.0.7",
4
- "files": [
5
- "dist/extension.bundle.js"
6
- ],
7
- "scripts": {
8
- "build": "heft test --clean && api-extractor run --local && yuan-toolkit post-build"
9
- },
10
- "dependencies": {
11
- "@yuants/protocol": "0.11.1",
12
- "puppeteer": "~19.2.0",
13
- "rxjs": "~7.5.6",
14
- "@yuants/data-model": "0.5.1"
15
- },
16
- "devDependencies": {
17
- "@microsoft/api-extractor": "~7.30.0",
18
- "@rushstack/heft": "~0.47.5",
19
- "@rushstack/heft-jest-plugin": "~0.3.30",
20
- "@rushstack/heft-node-rig": "~1.10.7",
21
- "@types/heft-jest": "1.0.3",
22
- "@types/json-schema": "~7.0.11",
23
- "@types/node": "18",
24
- "@types/uuid": "~8.3.4",
25
- "@yuants/extension": "0.2.4",
26
- "@yuants/tool-kit": "0.1.4",
27
- "typescript": "~4.7.4"
28
- },
29
- "publishConfig": {
30
- "registry": "https://registry.npmjs.org",
31
- "access": "public"
32
- },
33
- "io_ntnl": {
34
- "deploy_files": [
35
- "dist",
36
- "lib",
37
- "temp"
38
- ]
39
- }
2
+ "name": "@yuants/vendor-trading-view",
3
+ "version": "0.1.0",
4
+ "files": [
5
+ "dist/extension.bundle.js"
6
+ ],
7
+ "dependencies": {
8
+ "@yuants/protocol": "0.27.0",
9
+ "rxjs": "~7.5.6",
10
+ "@mathieuc/tradingview": "~3.4.2",
11
+ "@yuants/data-model": "0.17.1"
12
+ },
13
+ "devDependencies": {
14
+ "@microsoft/api-extractor": "~7.30.0",
15
+ "@rushstack/heft": "~0.47.5",
16
+ "@rushstack/heft-jest-plugin": "~0.3.30",
17
+ "@rushstack/heft-node-rig": "~1.10.7",
18
+ "@types/heft-jest": "1.0.3",
19
+ "@types/json-schema": "~7.0.11",
20
+ "@types/node": "18",
21
+ "@yuants/extension": "0.2.11",
22
+ "@yuants/tool-kit": "0.1.5",
23
+ "typescript": "~4.7.4"
24
+ },
25
+ "publishConfig": {
26
+ "registry": "https://registry.npmjs.org",
27
+ "access": "public"
28
+ },
29
+ "io_ntnl": {
30
+ "deploy_files": [
31
+ "dist",
32
+ "lib",
33
+ "temp"
34
+ ]
35
+ },
36
+ "scripts": {
37
+ "build": "heft test --clean && api-extractor run --local && yuan-toolkit post-build"
38
+ }
40
39
  }