@halcyontech/vscode-ibmi-types 1.6.2 → 1.6.8

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/api/IBMi.d.ts CHANGED
@@ -72,5 +72,13 @@ export default class IBMi {
72
72
  * @returns {string} result
73
73
  */
74
74
  sysNameInAmerican(string: string): string;
75
+ uploadFiles(files: {
76
+ local: string | vscode.Uri;
77
+ remote: string;
78
+ }[], options?: node_ssh.SSHPutFilesOptions): Promise<void>;
79
+ downloadFile(localFile: string | vscode.Uri, remoteFile: string): Promise<void>;
80
+ uploadDirectory(localDirectory: string | vscode.Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<void>;
81
+ downloadDirectory(localDirectory: string | vscode.Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<void>;
82
+ fileToPath(file: string | vscode.Uri): string;
75
83
  }
76
84
  export {};
@@ -1,109 +1,69 @@
1
- /// <reference types="node" />
2
- export = IBMiContent;
3
- declare class IBMiContent {
4
- /**
5
- * @param {IBMi} instance
6
- */
7
- constructor(instance: IBMi);
8
- ibmi: IBMi;
9
- /**
10
- * @param {string} remotePath
11
- * @param {string} localPath
12
- */
1
+ import { default as IBMi } from './IBMi';
2
+ import { Tools } from './Tools';
3
+ import { IBMiError, IBMiFile, IBMiMember, IBMiObject, IFSFile } from '../typings';
4
+ export default class IBMiContent {
5
+ readonly ibmi: IBMi;
6
+ constructor(ibmi: IBMi);
7
+ private get config();
8
+ private getTempRemote;
9
+ private getNotUTF8CCSID;
10
+ private convertToUTF8;
13
11
  downloadStreamfile(remotePath: string, localPath?: string): Promise<string>;
14
- writeStreamfile(originalPath: any, content: any): Promise<void | String | import("../typings").CommandResult>;
12
+ writeStreamfile(originalPath: any, content: any): Promise<string | void>;
15
13
  /**
16
14
  * Download the contents of a source member
17
- * @param {string|undefined} asp
18
- * @param {string} lib
19
- * @param {string} spf
20
- * @param {string} mbr
21
15
  */
22
- downloadMemberContent(asp: string | undefined, lib: string, spf: string, mbr: string): Promise<string>;
16
+ downloadMemberContent(asp: string | undefined, library: string, sourceFile: string, member: string): Promise<string>;
23
17
  /**
24
18
  * Upload to a member
25
- * @param {string|undefined} asp
26
- * @param {string} lib
27
- * @param {string} spf
28
- * @param {string} mbr
29
- * @param {string|Uint8Array} content
30
19
  */
31
- uploadMemberContent(asp: string | undefined, lib: string, spf: string, mbr: string, content: string | Uint8Array): Promise<boolean>;
20
+ uploadMemberContent(asp: string | undefined, library: string, sourceFile: string, member: string, content: string | Uint8Array): Promise<boolean>;
32
21
  /**
33
22
  * Run an SQL statement
34
- * @param {string} statement
35
- * @returns {Promise<Tools.DB2Row[]>} Result set
23
+ * @param statement
24
+ * @returns a Result set
36
25
  */
37
26
  runSQL(statement: string): Promise<Tools.DB2Row[]>;
38
27
  /**
39
28
  * Download the contents of a table.
40
- * @param {string} lib
41
- * @param {string} file
42
- * @param {string} [mbr] Will default to file provided
43
- * @param {boolean} [deleteTable] Will delete the table after download
29
+ * @param library
30
+ * @param file
31
+ * @param member Will default to file provided
32
+ * @param deleteTable Will delete the table after download
44
33
  */
45
- getTable(lib: string, file: string, mbr?: string, deleteTable?: boolean): Promise<any>;
34
+ getTable(library: string, file: string, member: string, deleteTable: boolean): Promise<Tools.DB2Row[]>;
46
35
  /**
47
36
  * Get list of libraries with description and attribute
48
- * @param {string[]} libraries Array of libraries to retrieve
49
- * @returns {Promise<{name: string, text: string, attribute: string}[]>} List of libraries
37
+ * @param libraries Array of libraries to retrieve
38
+ * @returns an array of libraries as IBMiObject
50
39
  */
51
- getLibraryList(libraries: string[]): Promise<{
52
- name: string;
53
- text: string;
54
- attribute: string;
55
- }[]>;
40
+ getLibraryList(libraries: string[]): Promise<IBMiObject[]>;
56
41
  /**
57
- * @param {{library: string, object?: string, types?: string[]}} filters
58
- * @param {string?} sortOrder
59
- * @returns {Promise<{library: string, name: string, type: string, text: string, attribute: string, count?: number}[]>} List of members
42
+ * @param filters
43
+ * @param sortOrder
44
+ * @returns an array of IBMiFile
60
45
  */
61
46
  getObjectList(filters: {
62
47
  library: string;
63
48
  object?: string;
64
49
  types?: string[];
65
- }, sortOrder?: string | null): Promise<{
66
- library: string;
67
- name: string;
68
- type: string;
69
- text: string;
70
- attribute: string;
71
- count?: number;
72
- }[]>;
50
+ }, sortOrder?: `name` | `type`): Promise<IBMiFile[]>;
73
51
  /**
74
- * @param {string} lib
75
- * @param {string} spf
76
- * @param {string} [mbr]
77
- * @returns {Promise<{asp?: string, library: string, file: string, name: string, extension: string, recordLength: number, text: string}[]>} List of members
52
+ * @param lib
53
+ * @param spf
54
+ * @param mbr
55
+ * @returns an array of IBMiMember
78
56
  */
79
- getMemberList(lib: string, spf: string, mbr?: string, ext?: string): Promise<{
80
- asp?: string;
81
- library: string;
82
- file: string;
83
- name: string;
84
- extension: string;
85
- recordLength: number;
86
- text: string;
87
- }[]>;
57
+ getMemberList(lib: string, spf: string, mbr?: string, ext?: string): Promise<IBMiMember[]>;
88
58
  /**
89
59
  * Get list of items in a path
90
- * @param {string} remotePath
91
- * @return {Promise<{type: "directory"|"streamfile", name: string, path: string}[]>} Resulting list
60
+ * @param remotePath
61
+ * @return an array of IFSFile
92
62
  */
93
- getFileList(remotePath: string): Promise<{
94
- type: "directory" | "streamfile";
95
- name: string;
96
- path: string;
97
- }[]>;
63
+ getFileList(remotePath: string): Promise<IFSFile[]>;
98
64
  /**
99
- * @param {string} errorsString
100
- * @returns {{code: string, text: string}[]} errors
65
+ * @param errorsString; several lines of `code:text`...
66
+ * @returns errors
101
67
  */
102
- parseIBMiErrors(errorsString: string): {
103
- code: string;
104
- text: string;
105
- }[];
68
+ parseIBMiErrors(errorsString: string): IBMiError[];
106
69
  }
107
- import { default as IBMi } from "./IBMi";
108
- import { Tools } from "./Tools";
109
- import path = require("path");
package/api/Instance.d.ts CHANGED
@@ -18,4 +18,5 @@ export default class Instance {
18
18
  getConfig(): ConnectionConfiguration.Parameters;
19
19
  getContent(): IBMiContent;
20
20
  getStorage(): Storage;
21
+ onEvent(event: "connected", func: Function): void;
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halcyontech/vscode-ibmi-types",
3
- "version": "1.6.2",
3
+ "version": "1.6.8",
4
4
  "description": "Types for vscode-ibmi",
5
5
  "typings": "./typings.d.ts",
6
6
  "scripts": {
package/typings.d.ts CHANGED
@@ -67,3 +67,24 @@ export interface IBMiObject {
67
67
  text: string;
68
68
  attribute?: string;
69
69
  }
70
+ export interface IBMiFile extends IBMiObject {
71
+ count?: number;
72
+ }
73
+ export interface IBMiMember {
74
+ library: string;
75
+ file: string;
76
+ name: string;
77
+ extension: string;
78
+ recordLength: number;
79
+ text: string;
80
+ asp?: string;
81
+ }
82
+ export interface IFSFile {
83
+ type: "directory" | "streamfile";
84
+ name: string;
85
+ path: string;
86
+ }
87
+ export interface IBMiError {
88
+ code: string;
89
+ text: string;
90
+ }