@decaf-ts/integrations 0.7.0 → 0.8.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.
- package/dist/integrations.cjs +1 -1
- package/lib/cjs/index.cjs +3 -3
- package/lib/cjs/sftp/aws/AwsSftpService.cjs +120 -0
- package/lib/cjs/sftp/aws/AwsSftpService.cjs.map +1 -0
- package/lib/cjs/sftp/core/SftpSource.cjs +29 -0
- package/lib/cjs/sftp/core/SftpSource.cjs.map +1 -0
- package/lib/cjs/sftp/core/index.cjs +19 -0
- package/lib/cjs/sftp/core/index.cjs.map +1 -0
- package/lib/cjs/sftp/index.cjs +21 -0
- package/lib/cjs/sftp/index.cjs.map +1 -0
- package/lib/cjs/sftp/ssh2/Ssh2SftpService.cjs +172 -0
- package/lib/cjs/sftp/ssh2/Ssh2SftpService.cjs.map +1 -0
- package/lib/esm/index.js +3 -3
- package/lib/esm/sftp/aws/AwsSftpService.js +82 -0
- package/lib/esm/sftp/aws/AwsSftpService.js.map +1 -0
- package/lib/esm/sftp/core/SftpSource.js +23 -0
- package/lib/esm/sftp/core/SftpSource.js.map +1 -0
- package/lib/esm/sftp/core/index.js +2 -0
- package/lib/esm/sftp/core/index.js.map +1 -0
- package/lib/esm/sftp/index.js +4 -0
- package/lib/esm/sftp/index.js.map +1 -0
- package/lib/esm/sftp/ssh2/Ssh2SftpService.js +135 -0
- package/lib/esm/sftp/ssh2/Ssh2SftpService.js.map +1 -0
- package/lib/types/index.d.cts +2 -2
- package/lib/types/index.d.mts +2 -2
- package/lib/types/sftp/aws/AwsSftpService.d.cts +37 -0
- package/lib/types/sftp/aws/AwsSftpService.d.mts +37 -0
- package/lib/types/sftp/core/SftpSource.d.cts +40 -0
- package/lib/types/sftp/core/SftpSource.d.mts +40 -0
- package/lib/types/sftp/core/index.d.cts +1 -0
- package/lib/types/sftp/core/index.d.mts +1 -0
- package/lib/types/sftp/index.d.cts +3 -0
- package/lib/types/sftp/index.d.mts +3 -0
- package/lib/types/sftp/ssh2/Ssh2SftpService.d.cts +47 -0
- package/lib/types/sftp/ssh2/Ssh2SftpService.d.mts +47 -0
- package/package.json +15 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SftpSource.d.mts";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ContextualArgs, type MaybeContextualArg } from "@decaf-ts/core";
|
|
2
|
+
import { SftpSource, type SftpFileEntry, type SftpFileResult, type SftpSourceConfig } from "../core/SftpSource.d.cts";
|
|
3
|
+
export interface Ssh2SftpConfig extends SftpSourceConfig {
|
|
4
|
+
provider: "ssh2";
|
|
5
|
+
readyTimeout?: number;
|
|
6
|
+
}
|
|
7
|
+
interface Ssh2Client {
|
|
8
|
+
connect(config: unknown): void;
|
|
9
|
+
on(event: "ready", cb: () => void): void;
|
|
10
|
+
on(event: "error", cb: (err: Error) => void): void;
|
|
11
|
+
sftp(cb: (err: Error | null, sftp: Ssh2SftpHandle) => void): void;
|
|
12
|
+
end(): void;
|
|
13
|
+
}
|
|
14
|
+
interface Ssh2SftpHandle {
|
|
15
|
+
readdir(dir: string, cb: (err: Error | null, list: Array<{
|
|
16
|
+
filename: string;
|
|
17
|
+
attrs: {
|
|
18
|
+
size: number;
|
|
19
|
+
mtime: number;
|
|
20
|
+
mode: number;
|
|
21
|
+
};
|
|
22
|
+
}>) => void): void;
|
|
23
|
+
stat(path: string, cb: (err: Error | null, stat: {
|
|
24
|
+
size: number;
|
|
25
|
+
mtime: number;
|
|
26
|
+
mode: number;
|
|
27
|
+
}) => void): void;
|
|
28
|
+
open(path: string, flags: string, cb: (err: Error | null, handle: Buffer) => void): void;
|
|
29
|
+
read(handle: Buffer, buffer: Buffer, offset: number, length: number, position: number, cb: (err: Error | null, bytesRead: number, buffer: Buffer) => void): void;
|
|
30
|
+
close(handle: Buffer, cb: (err: Error | null) => void): void;
|
|
31
|
+
unlink(path: string, cb: (err: Error | null) => void): void;
|
|
32
|
+
end(cb?: () => void): void;
|
|
33
|
+
}
|
|
34
|
+
export declare class Ssh2SftpService extends SftpSource<Ssh2Client, Ssh2SftpConfig> {
|
|
35
|
+
private sftp?;
|
|
36
|
+
constructor();
|
|
37
|
+
initialize(...args: ContextualArgs<any>): Promise<{
|
|
38
|
+
config: Ssh2SftpConfig;
|
|
39
|
+
client: Ssh2Client;
|
|
40
|
+
}>;
|
|
41
|
+
list(remoteDir?: string, ...args: MaybeContextualArg<any>): Promise<SftpFileEntry[]>;
|
|
42
|
+
fetch(remotePath: string, ...args: MaybeContextualArg<any>): Promise<SftpFileResult>;
|
|
43
|
+
delete(remotePath: string, ...args: MaybeContextualArg<any>): Promise<void>;
|
|
44
|
+
close(...args: MaybeContextualArg<any>): Promise<void>;
|
|
45
|
+
private requireSftp;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ContextualArgs, type MaybeContextualArg } from "@decaf-ts/core";
|
|
2
|
+
import { SftpSource, type SftpFileEntry, type SftpFileResult, type SftpSourceConfig } from "../core/SftpSource.d.mts";
|
|
3
|
+
export interface Ssh2SftpConfig extends SftpSourceConfig {
|
|
4
|
+
provider: "ssh2";
|
|
5
|
+
readyTimeout?: number;
|
|
6
|
+
}
|
|
7
|
+
interface Ssh2Client {
|
|
8
|
+
connect(config: unknown): void;
|
|
9
|
+
on(event: "ready", cb: () => void): void;
|
|
10
|
+
on(event: "error", cb: (err: Error) => void): void;
|
|
11
|
+
sftp(cb: (err: Error | null, sftp: Ssh2SftpHandle) => void): void;
|
|
12
|
+
end(): void;
|
|
13
|
+
}
|
|
14
|
+
interface Ssh2SftpHandle {
|
|
15
|
+
readdir(dir: string, cb: (err: Error | null, list: Array<{
|
|
16
|
+
filename: string;
|
|
17
|
+
attrs: {
|
|
18
|
+
size: number;
|
|
19
|
+
mtime: number;
|
|
20
|
+
mode: number;
|
|
21
|
+
};
|
|
22
|
+
}>) => void): void;
|
|
23
|
+
stat(path: string, cb: (err: Error | null, stat: {
|
|
24
|
+
size: number;
|
|
25
|
+
mtime: number;
|
|
26
|
+
mode: number;
|
|
27
|
+
}) => void): void;
|
|
28
|
+
open(path: string, flags: string, cb: (err: Error | null, handle: Buffer) => void): void;
|
|
29
|
+
read(handle: Buffer, buffer: Buffer, offset: number, length: number, position: number, cb: (err: Error | null, bytesRead: number, buffer: Buffer) => void): void;
|
|
30
|
+
close(handle: Buffer, cb: (err: Error | null) => void): void;
|
|
31
|
+
unlink(path: string, cb: (err: Error | null) => void): void;
|
|
32
|
+
end(cb?: () => void): void;
|
|
33
|
+
}
|
|
34
|
+
export declare class Ssh2SftpService extends SftpSource<Ssh2Client, Ssh2SftpConfig> {
|
|
35
|
+
private sftp?;
|
|
36
|
+
constructor();
|
|
37
|
+
initialize(...args: ContextualArgs<any>): Promise<{
|
|
38
|
+
config: Ssh2SftpConfig;
|
|
39
|
+
client: Ssh2Client;
|
|
40
|
+
}>;
|
|
41
|
+
list(remoteDir?: string, ...args: MaybeContextualArg<any>): Promise<SftpFileEntry[]>;
|
|
42
|
+
fetch(remotePath: string, ...args: MaybeContextualArg<any>): Promise<SftpFileResult>;
|
|
43
|
+
delete(remotePath: string, ...args: MaybeContextualArg<any>): Promise<void>;
|
|
44
|
+
close(...args: MaybeContextualArg<any>): Promise<void>;
|
|
45
|
+
private requireSftp;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decaf-ts/integrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.mts",
|
|
@@ -269,6 +269,17 @@
|
|
|
269
269
|
},
|
|
270
270
|
"default": "./lib/esm/graph/index.js"
|
|
271
271
|
},
|
|
272
|
+
"./sftp": {
|
|
273
|
+
"import": {
|
|
274
|
+
"types": "./lib/types/sftp/index.d.mts",
|
|
275
|
+
"default": "./lib/esm/sftp/index.js"
|
|
276
|
+
},
|
|
277
|
+
"require": {
|
|
278
|
+
"types": "./lib/types/sftp/index.d.cts",
|
|
279
|
+
"default": "./lib/cjs/sftp/index.cjs"
|
|
280
|
+
},
|
|
281
|
+
"default": "./lib/esm/sftp/index.js"
|
|
282
|
+
},
|
|
272
283
|
"./graph/shared": {
|
|
273
284
|
"import": {
|
|
274
285
|
"types": "./lib/types/graph/shared/index.d.mts",
|
|
@@ -340,7 +351,7 @@
|
|
|
340
351
|
"lint": "eslint .",
|
|
341
352
|
"lint-fix": "eslint --fix .",
|
|
342
353
|
"prepare-pr": "npm run lint-fix && npm run build:prod && npm run coverage && npm run docs",
|
|
343
|
-
"prepare-release": "npm run lint-fix && npm run build:prod",
|
|
354
|
+
"prepare-release": "npm run lint-fix && npm run build:prod && npm run docs",
|
|
344
355
|
"release": "./bin/tag-release.sh",
|
|
345
356
|
"clean-publish": "npx clean-publish",
|
|
346
357
|
"drawings": "for FILE in workdocs/drawings/*.drawio; do echo \"converting $FILE to image...\" && docker run --rm -v $(pwd):/data rlespinasse/drawio-export --format png $FILE; done && cp -rf workdocs/drawings/export/* workdocs/resources/",
|
|
@@ -430,6 +441,7 @@
|
|
|
430
441
|
"hashicorp-vault": "^0.1.0",
|
|
431
442
|
"keycloak-admin": "^24.0.5",
|
|
432
443
|
"kubo-rpc-client": "^7.1.0",
|
|
433
|
-
"onelogin-node": "^0.1.0"
|
|
444
|
+
"onelogin-node": "^0.1.0",
|
|
445
|
+
"ssh2": "^1.16.0"
|
|
434
446
|
}
|
|
435
447
|
}
|