@yuants/vendor-binance 0.6.10 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuants/vendor-binance",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "bin": "lib/cli.js",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -1,17 +1,15 @@
1
1
  {
2
- "apps/vendor-binance/CHANGELOG.json": "b1dcff40fa392c3d1f7b1e5f8970805ae4236123",
3
- "apps/vendor-binance/CHANGELOG.md": "7ea7df5cd79a63d43f37a900f14bc5eb9b022553",
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": "0f4d35702a93e77a08ab70bae15fde58a6dc8256",
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",
@@ -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
@@ -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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ClC;yBACF;wBACD,QAAQ,EAAE;4BACR,QAAQ,EAAE;gCACR,MAAM,EAAE;oCACN,mBAAmB,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,MAAM,CAAC,OAAO;oCAClD,wBAAwB,EAAE,GAAG,CAAC,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"]}
@@ -1,4 +0,0 @@
1
- import { IExtensionContext } from '@yuants/extension';
2
- declare const _default: (context: IExtensionContext) => void;
3
- export default _default;
4
- //# sourceMappingURL=extension.d.ts.map
@@ -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
@@ -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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BACR,QAAQ,EAAE;gCACR,MAAM,EAAE;oCACN,mBAAmB,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,MAAM,CAAC,OAAO;oCAClD,wBAAwB,EAAE,GAAG,CAAC,GAAG;oCACjC,qBAAqB,EAAE,SAAS;iCACjC;6BACF;4BACD,IAAI,EAAE;gCACJ,UAAU,EAAE;oCACV;wCACE,GAAG,EAAE,IAAA,uBAAW,EAAC,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/temp/image-tag DELETED
@@ -1 +0,0 @@
1
- sha-8cc2fcdc4c7e66f6d60792aec70bef0eb5279226