@things-factory/integration-git 10.1.113 → 10.1.116
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.
|
@@ -3,11 +3,17 @@ export declare class GitConnector implements Connector {
|
|
|
3
3
|
ready(connectionConfigs: any): Promise<void>;
|
|
4
4
|
connect(connection: any): Promise<void>;
|
|
5
5
|
disconnect(connection: Connection): Promise<void>;
|
|
6
|
-
get parameterSpec(): {
|
|
6
|
+
get parameterSpec(): ({
|
|
7
7
|
type: string;
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
10
|
-
|
|
10
|
+
useDomainAttribute?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
type: string;
|
|
13
|
+
name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
useDomainAttribute: boolean;
|
|
16
|
+
})[];
|
|
11
17
|
get taskPrefixes(): string[];
|
|
12
18
|
get help(): string;
|
|
13
19
|
}
|
|
@@ -56,7 +56,7 @@ class GitConnector {
|
|
|
56
56
|
get parameterSpec() {
|
|
57
57
|
return [
|
|
58
58
|
{ type: 'string', name: 'branch', label: 'git.branch' },
|
|
59
|
-
{ type: '
|
|
59
|
+
{ type: 'secret', name: 'token', label: 'git.token', useDomainAttribute: true },
|
|
60
60
|
{ type: 'string', name: 'sshKeyPath', label: 'git.ssh-key-path' }
|
|
61
61
|
];
|
|
62
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../server/engine/connector/git.ts"],"names":[],"mappings":";;;;AAAA,uEAA2F;AAC3F,oEAAkC;AAElC,MAAa,YAAY;IACvB,KAAK,CAAC,KAAK,CAAC,iBAAiB;QAC3B,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAEjE,oCAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,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,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,KAAK,CAAC,CAAA;IAChB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,qCAAqC,CAAA;IAC9C,CAAC;CACF;AAzED,oCAyEC;AAED,oCAAiB,CAAC,iBAAiB,CAAC,eAAe,EAAE,IAAI,YAAY,EAAE,CAAC,CAAA","sourcesContent":["import { Connection, ConnectionManager, Connector } from '@things-factory/integration-base'\nimport simpleGit from 'simple-git'\n\nexport class GitConnector implements Connector {\n async ready(connectionConfigs) {\n await Promise.all(connectionConfigs.map(this.connect.bind(this)))\n\n ConnectionManager.logger.info('Git connections are ready')\n }\n\n // async checkConnectionInstance(domain, connectionName): Promise<boolean> {\n // try {\n // const connection = await ConnectionManager.getConnectionInstanceByName(domain, connectionName)\n // return !!connection\n // } catch (e) {\n // return false\n // }\n // }\n\n async connect(connection) {\n var {\n endpoint, // Git 저장소 URL (ex: https://git.com/user/repo.git, https://gitlab.com/user/repo.git, ssh://git@bitbucket.org/user/repo.git)\n params: { branch = 'main', token, sshKeyPath }\n } = connection\n\n try {\n // ✅ Git 클라이언트 생성\n const client = simpleGit()\n\n // ✅ Git 인증 처리 (토큰 방식 vs SSH 방식)\n let remoteUrl = endpoint\n if (token) {\n // HTTP 인증 방식 (예: GitHub, GitLab의 PAT)\n remoteUrl = endpoint.replace('https://', `https://${token}@`)\n } else if (sshKeyPath) {\n // SSH 방식 인증 (예: Bitbucket, 사내 Git 서버)\n client.env({ GIT_SSH_COMMAND: `ssh -i ${sshKeyPath} -o StrictHostKeyChecking=no` })\n }\n\n // ✅ ConnectionManager에 저장할 때 `remoteUrl` 추가\n ConnectionManager.addConnectionInstance(connection, {\n client,\n branch,\n endpoint,\n remoteUrl, // ✅ remoteUrl 추가\n token,\n sshKeyPath\n })\n\n ConnectionManager.logger.info(`Git connection(${connection.name}:${endpoint}) is connected`)\n } catch (ex) {\n ConnectionManager.logger.error(`Git connection(${connection.name}:${endpoint}) failed to connect`, ex)\n throw ex\n }\n }\n\n async disconnect(connection: Connection) {\n ConnectionManager.removeConnectionInstance(connection)\n ConnectionManager.logger.info(`Git connection(${connection.name}) is disconnected`)\n }\n\n get parameterSpec() {\n return [\n { type: 'string', name: 'branch', label: 'git.branch' },\n { type: 'secret', name: 'token', label: 'git.token', useDomainAttribute: true },\n { type: 'string', name: 'sshKeyPath', label: 'git.ssh-key-path' }\n ]\n }\n\n get taskPrefixes() {\n return ['git']\n }\n\n get help() {\n return 'integration/connector/git-connector'\n }\n}\n\nConnectionManager.registerConnector('git-connector', new GitConnector())\n"]}
|