@cdp-forge/plugin-pipeline-sdk 1.2.0 → 1.2.1
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 +2 -1
- package/dist/config/default.ts +0 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdp-forge/plugin-pipeline-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "SDK for pipeline plugins for CDP Forge platform",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"test": "npx jest",
|
|
15
15
|
"test:build": "tsc -p tsconfig.test.json",
|
|
16
16
|
"build": "tsc",
|
|
17
|
+
"prebuild": "npm run clean",
|
|
17
18
|
"prepublishOnly": "npm run build",
|
|
18
19
|
"clean": "rm -rf dist"
|
|
19
20
|
},
|
package/dist/config/default.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Config } from "@cdp-forge/types";
|
|
2
|
-
type Parsed = string | number | boolean | string[] | number[];
|
|
3
|
-
|
|
4
|
-
function env<T extends Parsed>(key: string, fallback: T, type: 'string' | 'number' | 'boolean' | 'string[]' | 'number[]' = 'string'): T {
|
|
5
|
-
const val = process.env[key];
|
|
6
|
-
if (val === undefined) return fallback;
|
|
7
|
-
switch (type) {
|
|
8
|
-
case "string[]":
|
|
9
|
-
return val.split(',').map(s => s.trim()) as T;
|
|
10
|
-
case "number[]":
|
|
11
|
-
return val.split(',').map(s => Number(s.trim())) as T;
|
|
12
|
-
case "boolean":
|
|
13
|
-
return (val.toLowerCase() === 'true') as T;
|
|
14
|
-
case "number":
|
|
15
|
-
return Number(val) as T;
|
|
16
|
-
case "string":
|
|
17
|
-
return val as T;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const config: Config = {
|
|
22
|
-
kafka: {
|
|
23
|
-
brokers: env<string[]>('KAFKA_BROKERS', ['cdp-forge-kafka-kafka-bootstrap:9092'], 'string[]')
|
|
24
|
-
},
|
|
25
|
-
mysql: {
|
|
26
|
-
uri: env("MYSQL_URI","mysql://root:cdp-forge-root-2024@cdp-forge-mysql:3306/cdpforge")
|
|
27
|
-
},
|
|
28
|
-
opensearch:{
|
|
29
|
-
url: env("OPENSEARCH_URL","https://opensearch-cluster-master:9200"),
|
|
30
|
-
username: env("OPENSEARCH_USERNAME","admin"),
|
|
31
|
-
password: env("OPENSEARCH_PASSWORD","CdpForge@2024!")
|
|
32
|
-
},
|
|
33
|
-
pipelinemanager: {
|
|
34
|
-
config_topic: env("PIPELINEMANAGER_CONFIG_TOPIC","config"),
|
|
35
|
-
url: env("PIPELINEMANAGER_URL","http://cdp-forge-core-pipeline-manager"),
|
|
36
|
-
first_topic: env("PIPELINEMANAGER_FIRST_TOPIC", "logs")
|
|
37
|
-
},
|
|
38
|
-
pod: {
|
|
39
|
-
name: env("CLIENT_ID", Math.random().toString(36).substring(2, 10))
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default config;
|