@halcyontech/vscode-ibmi-types 2.14.5 → 2.15.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/{api/Instance.d.ts → Instance.d.ts} +25 -8
- package/api/CompileTools.d.ts +10 -6
- package/api/IBMi.d.ts +90 -46
- package/api/IBMiContent.d.ts +61 -10
- package/api/Search.d.ts +5 -5
- package/api/Tools.d.ts +3 -31
- package/{components → api/components}/component.d.ts +6 -1
- package/{components → api/components}/copyToImport.d.ts +2 -2
- package/{components → api/components}/cqsh/index.d.ts +4 -1
- package/{components → api/components}/getMemberInfo.d.ts +4 -3
- package/{components → api/components}/getNewLibl.d.ts +6 -1
- package/api/components/manager.d.ts +23 -0
- package/api/configVars.d.ts +1 -1
- package/api/{debug/config.d.ts → configuration/DebugConfiguration.d.ts} +9 -2
- package/api/configuration/config/ConnectionManager.d.ts +31 -0
- package/api/configuration/config/VirtualConfig.d.ts +9 -0
- package/api/configuration/config/types.d.ts +66 -0
- package/api/configuration/storage/BaseStorage.d.ts +11 -0
- package/api/configuration/storage/CodeForIStorage.d.ts +62 -0
- package/api/configuration/storage/ConnectionStorage.d.ts +36 -0
- package/api/errors/parser.d.ts +1 -1
- package/api/import/Objects.d.ts +1 -0
- package/api/types.d.ts +184 -0
- package/commands/actions.d.ts +3 -0
- package/commands/compare.d.ts +3 -0
- package/commands/connection.d.ts +3 -0
- package/commands/open.d.ts +7 -0
- package/commands/password.d.ts +3 -0
- package/config/Configuration.d.ts +9 -0
- package/config/Storage.d.ts +10 -0
- package/config/passwords.d.ts +4 -0
- package/{api/debug → debug}/certificates.d.ts +3 -6
- package/{api/debug → debug}/index.d.ts +1 -1
- package/{api/debug → debug}/server.d.ts +4 -4
- package/filesystems/ifsFs.d.ts +27 -0
- package/{api → filesystems}/local/actions.d.ts +1 -1
- package/{api → filesystems}/local/deployTools.d.ts +2 -1
- package/{api → filesystems}/local/deployment.d.ts +2 -2
- package/filesystems/qsys/FSUtils.d.ts +9 -0
- package/filesystems/qsys/QSysFs.d.ts +40 -0
- package/filesystems/qsys/extendedContent.d.ts +25 -0
- package/filesystems/qsys/sourceDateHandler.d.ts +26 -0
- package/instantiate.d.ts +2 -2
- package/package.json +2 -2
- package/typings.d.ts +13 -193
- package/ui/Tools.d.ts +52 -0
- package/ui/actions.d.ts +6 -0
- package/ui/connection.d.ts +3 -0
- package/ui/types.d.ts +26 -0
- package/{api → webviews}/CustomUI.d.ts +7 -0
- package/api/Configuration.d.ts +0 -95
- package/api/Storage.d.ts +0 -106
- package/components/manager.d.ts +0 -20
- /package/{api → filesystems}/local/LocalLanguageActions.d.ts +0 -0
- /package/{api → filesystems}/local/env.d.ts +0 -0
- /package/{api → filesystems}/local/git.d.ts +0 -0
- /package/{api → ui}/Terminal.d.ts +0 -0
- /package/{api/errors → ui}/diagnostics.d.ts +0 -0
@@ -1,20 +1,37 @@
|
|
1
1
|
import * as vscode from "vscode";
|
2
|
-
import { IBMiEvent } from "
|
3
|
-
import {
|
4
|
-
import
|
5
|
-
|
2
|
+
import { ConnectionConfig, ConnectionData, IBMiEvent } from "./typings";
|
3
|
+
import IBMi, { ConnectionResult } from "./api/IBMi";
|
4
|
+
import { ConnectionStorage } from "./api/configuration/storage/ConnectionStorage";
|
5
|
+
export interface ConnectionOptions {
|
6
|
+
data: ConnectionData;
|
7
|
+
reconnecting?: boolean;
|
8
|
+
reloadServerSettings?: boolean;
|
9
|
+
onConnectedOperations?: Function[];
|
10
|
+
}
|
6
11
|
export default class Instance {
|
7
12
|
private connection;
|
13
|
+
private output;
|
8
14
|
private storage;
|
9
15
|
private emitter;
|
10
16
|
private subscribers;
|
11
17
|
private deprecationCount;
|
12
18
|
constructor(context: vscode.ExtensionContext);
|
13
|
-
|
19
|
+
focusOutput(): void;
|
20
|
+
getOutputContent(): string;
|
21
|
+
private resetOutput;
|
22
|
+
connect(options: ConnectionOptions): Promise<ConnectionResult>;
|
23
|
+
disconnect(): Promise<void>;
|
24
|
+
private setConnection;
|
14
25
|
getConnection(): IBMi;
|
15
|
-
setConfig(newConfig:
|
16
|
-
|
17
|
-
|
26
|
+
setConfig(newConfig: ConnectionConfig): Promise<void>;
|
27
|
+
/**
|
28
|
+
* @deprecated Will be removed in `v3.0.0`; use {@link IBMi.getConfig()} instead
|
29
|
+
*/
|
30
|
+
getConfig(): ConnectionConfig;
|
31
|
+
/**
|
32
|
+
* @deprecated Will be removed in `v3.0.0`; use {@link IBMi.getContent()} instead
|
33
|
+
*/
|
34
|
+
getContent(): import("./api/IBMiContent").default;
|
18
35
|
getStorage(): ConnectionStorage;
|
19
36
|
/**
|
20
37
|
* Subscribe to an {@link IBMiEvent}. When the event is triggerred, the `func` function gets executed.
|
package/api/CompileTools.d.ts
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
import Instance from './Instance';
|
1
|
+
import IBMi from './IBMi';
|
2
|
+
import { RemoteCommand, CommandResult } from './types';
|
4
3
|
export interface ILELibrarySettings {
|
5
4
|
currentLibrary: string;
|
6
5
|
libraryList: string[];
|
7
6
|
}
|
8
7
|
export declare namespace CompileTools {
|
9
|
-
|
10
|
-
|
8
|
+
export const NEWLINE = "\r\n";
|
9
|
+
export const DID_NOT_RUN = -123;
|
10
|
+
interface RunCommandEvents {
|
11
|
+
writeEvent?: (content: string) => void;
|
12
|
+
commandConfirm?: (command: string) => Promise<string>;
|
13
|
+
}
|
11
14
|
/**
|
12
15
|
* Execute a command
|
13
16
|
*/
|
14
|
-
function runCommand(
|
17
|
+
export function runCommand(connection: IBMi, options: RemoteCommand, events?: RunCommandEvents): Promise<CommandResult>;
|
18
|
+
export {};
|
15
19
|
}
|
package/api/IBMi.d.ts
CHANGED
@@ -1,14 +1,40 @@
|
|
1
|
+
/// <reference types="node" />
|
1
2
|
import * as node_ssh from "node-ssh";
|
2
|
-
import
|
3
|
-
import { IBMiComponent } from "../components/component";
|
4
|
-
import { CommandData, CommandResult, ConnectionData, IBMiMember, RemoteCommand, SpecialAuthorities } from "../typings";
|
5
|
-
import { ConnectionConfiguration } from "./Configuration";
|
3
|
+
import { IBMiComponent } from "./components/component";
|
6
4
|
import IBMiContent from "./IBMiContent";
|
5
|
+
import { CodeForIStorage } from './configuration/storage/CodeForIStorage';
|
7
6
|
import { Tools } from './Tools';
|
7
|
+
import { ConnectionManager } from './configuration/config/ConnectionManager';
|
8
|
+
import { AspInfo, CommandData, CommandResult, ConnectionData, IBMiMember, RemoteCommand } from './types';
|
9
|
+
import { EventEmitter } from 'stream';
|
10
|
+
import { ConnectionConfig } from './configuration/config/types';
|
11
|
+
import { EditorPath } from '../typings';
|
8
12
|
export interface MemberParts extends IBMiMember {
|
9
13
|
basename: string;
|
10
14
|
}
|
15
|
+
export declare type ConnectionMessageType = 'info' | 'warning' | 'error';
|
16
|
+
export declare type ConnectionErrorCode = `shell_config` | `home_directory_creation` | `QCPTOIMPF_exists` | `QCPFRMIMPF_exists` | `default_not_bash` | `invalid_bashrc` | `invalid_temp_lib` | `no_auto_conv_ebcdic` | `not_loaded_debug_config` | `no_sql_runner` | `ccsid_warning`;
|
17
|
+
export interface ConnectionResult {
|
18
|
+
success: boolean;
|
19
|
+
errorCodes?: ConnectionErrorCode[];
|
20
|
+
}
|
21
|
+
declare type DisconnectCallback = (conn: IBMi) => Promise<void>;
|
22
|
+
interface ConnectionCallbacks {
|
23
|
+
onConnectedOperations?: Function[];
|
24
|
+
timeoutCallback?: (conn: IBMi) => Promise<void>;
|
25
|
+
uiErrorHandler: (connection: IBMi, error: ConnectionErrorCode, data?: any) => Promise<boolean>;
|
26
|
+
progress: (detail: {
|
27
|
+
message: string;
|
28
|
+
}) => void;
|
29
|
+
message: (type: ConnectionMessageType, message: string) => void;
|
30
|
+
cancelEmitter?: EventEmitter;
|
31
|
+
}
|
11
32
|
export default class IBMi {
|
33
|
+
static GlobalStorage: CodeForIStorage;
|
34
|
+
static connectionManager: ConnectionManager;
|
35
|
+
static readonly CCSID_NOCONVERSION = 65535;
|
36
|
+
static readonly CCSID_SYSVAL = -2;
|
37
|
+
static readonly bashShellPath = "/QOpenSys/pkgs/bin/bash";
|
12
38
|
private systemVersion;
|
13
39
|
private qccsid;
|
14
40
|
private userJobCcsid;
|
@@ -16,23 +42,33 @@ export default class IBMi {
|
|
16
42
|
private userDefaultCCSID;
|
17
43
|
private sshdCcsid;
|
18
44
|
private componentManager;
|
19
|
-
|
45
|
+
/**
|
46
|
+
* @deprecated Will become private in v3.0.0 - use {@link IBMi.getConfig} instead.
|
47
|
+
*/
|
48
|
+
config?: ConnectionConfig;
|
49
|
+
/**
|
50
|
+
* @deprecated Will become private in v3.0.0 - use {@link IBMi.getContent} instead.
|
51
|
+
*/
|
52
|
+
content: IBMiContent;
|
53
|
+
client: node_ssh.NodeSSH | undefined;
|
20
54
|
currentHost: string;
|
21
55
|
currentPort: number;
|
22
56
|
currentUser: string;
|
23
57
|
currentConnectionName: string;
|
24
|
-
tempRemoteFiles
|
25
|
-
[name: string]: string;
|
26
|
-
};
|
58
|
+
private tempRemoteFiles;
|
27
59
|
defaultUserLibraries: string[];
|
28
|
-
outputChannel?: vscode.OutputChannel;
|
29
|
-
outputChannelContent?: string;
|
30
60
|
/**
|
31
61
|
* Used to store ASP numbers and their names
|
32
62
|
* Their names usually maps up to a directory in
|
33
63
|
* the root of the IFS, thus why we store it.
|
34
64
|
*/
|
35
|
-
|
65
|
+
private iAspInfo;
|
66
|
+
private currentAsp;
|
67
|
+
private libraryAsps;
|
68
|
+
/**
|
69
|
+
* @deprecated Will be replaced with {@link IBMi.getAllIAsps} in v3.0.0
|
70
|
+
*/
|
71
|
+
get aspInfo(): {
|
36
72
|
[id: number]: string;
|
37
73
|
};
|
38
74
|
remoteFeatures: {
|
@@ -43,16 +79,14 @@ export default class IBMi {
|
|
43
79
|
local: string;
|
44
80
|
qsysNameRegex?: RegExp;
|
45
81
|
};
|
46
|
-
/**
|
47
|
-
* Strictly for storing errors from sendCommand.
|
48
|
-
* Used when creating issues on GitHub.
|
49
|
-
* */
|
50
|
-
lastErrors: object[];
|
51
|
-
config?: ConnectionConfiguration.Parameters;
|
52
|
-
content: IBMiContent;
|
53
82
|
shell?: string;
|
54
|
-
commandsExecuted: number;
|
55
83
|
maximumArgsLength: number;
|
84
|
+
appendOutput: (text: string) => void;
|
85
|
+
private disconnectedCallback;
|
86
|
+
/**
|
87
|
+
* Will only be called once per connection.
|
88
|
+
*/
|
89
|
+
setDisconnectedCallback(callback: DisconnectCallback): void;
|
56
90
|
get canUseCqsh(): boolean;
|
57
91
|
/**
|
58
92
|
* Primarily used for running SQL statements.
|
@@ -65,14 +99,17 @@ export default class IBMi {
|
|
65
99
|
*/
|
66
100
|
get requiresTranslation(): boolean;
|
67
101
|
get dangerousVariants(): boolean;
|
102
|
+
get connected(): boolean;
|
103
|
+
getContent(): IBMiContent;
|
104
|
+
getConfig(): ConnectionConfig;
|
105
|
+
setConfig(newConfig: ConnectionConfig): void;
|
68
106
|
constructor();
|
69
107
|
/**
|
70
108
|
* @returns {Promise<{success: boolean, error?: any}>} Was succesful at connecting or not.
|
71
109
|
*/
|
72
|
-
connect(connectionObject: ConnectionData, reconnecting?: boolean, reloadServerSettings?: boolean
|
73
|
-
|
74
|
-
|
75
|
-
}>;
|
110
|
+
connect(connectionObject: ConnectionData, callbacks: ConnectionCallbacks, reconnecting?: boolean, reloadServerSettings?: boolean): Promise<ConnectionResult>;
|
111
|
+
private ensureTempLibraryExists;
|
112
|
+
private ensureTempDirectory;
|
76
113
|
/**
|
77
114
|
* Can return 0 if the OS version was not detected.
|
78
115
|
*/
|
@@ -94,19 +131,13 @@ export default class IBMi {
|
|
94
131
|
* Commands sent here end up in the 'Code for IBM i' output channel.
|
95
132
|
*/
|
96
133
|
sendCommand(options: CommandData): Promise<CommandResult>;
|
97
|
-
private appendOutput;
|
98
|
-
private determineClear;
|
99
134
|
private disconnect;
|
100
|
-
|
135
|
+
dispose(): Promise<void>;
|
101
136
|
/**
|
102
137
|
* SQL only available when runner is installed and CCSID is valid.
|
103
138
|
*/
|
104
139
|
get enableSQL(): boolean;
|
105
140
|
sqlRunnerAvailable(): boolean;
|
106
|
-
private getSshCcsid;
|
107
|
-
getSysEnvVars(): Promise<{
|
108
|
-
[name: string]: string;
|
109
|
-
}>;
|
110
141
|
/**
|
111
142
|
* Generates path to a temp file on the IBM i
|
112
143
|
* @param {string} key Key to the temp file to be re-used
|
@@ -123,16 +154,8 @@ export default class IBMi {
|
|
123
154
|
* @returns {string} result
|
124
155
|
*/
|
125
156
|
sysNameInAmerican(string: string): string;
|
126
|
-
uploadFiles(files: {
|
127
|
-
local: string | vscode.Uri;
|
128
|
-
remote: string;
|
129
|
-
}[], options?: node_ssh.SSHPutFilesOptions): Promise<void>;
|
130
|
-
downloadFile(localFile: string | vscode.Uri, remoteFile: string): Promise<void>;
|
131
|
-
uploadDirectory(localDirectory: string | vscode.Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<void>;
|
132
|
-
downloadDirectory(localDirectory: string | vscode.Uri, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<void>;
|
133
157
|
getLastDownloadLocation(): string;
|
134
158
|
setLastDownloadLocation(location: string): Promise<void>;
|
135
|
-
fileToPath(file: string | vscode.Uri): string;
|
136
159
|
/**
|
137
160
|
* Creates a temporary directory and pass it on to a `process` function.
|
138
161
|
* The directory is guaranteed to be empty when created and deleted after the `process` is done.
|
@@ -145,10 +168,7 @@ export default class IBMi {
|
|
145
168
|
*/
|
146
169
|
upperCaseName(name: string): string;
|
147
170
|
getComponent<T extends IBMiComponent>(name: string, ignoreState?: boolean): T;
|
148
|
-
getComponentStates():
|
149
|
-
id: import("../components/component").ComponentIdentification;
|
150
|
-
state: import("../components/component").ComponentState;
|
151
|
-
}[];
|
171
|
+
getComponentStates(): import("./components/component").ComponentInstallState[];
|
152
172
|
/**
|
153
173
|
* Run SQL statements.
|
154
174
|
* Each statement must be separated by a semi-colon and a new line (i.e. ;\n).
|
@@ -169,8 +189,32 @@ export default class IBMi {
|
|
169
189
|
userDefaultCCSID: number;
|
170
190
|
sshdCcsid: number;
|
171
191
|
};
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
192
|
+
debugPTFInstalled(): boolean;
|
193
|
+
private getUserProfileAsp;
|
194
|
+
getAllIAsps(): AspInfo[];
|
195
|
+
getIAspDetail(by: string | number): AspInfo;
|
196
|
+
getIAspName(by: string | number): string | undefined;
|
197
|
+
getCurrentIAspName(): string;
|
198
|
+
lookupLibraryIAsp(library: string): Promise<string | undefined>;
|
199
|
+
getLibraryIAsp(library: string): string;
|
200
|
+
/**
|
201
|
+
* @deprecated Use {@link IBMiContent.uploadFiles} instead.
|
202
|
+
*/
|
203
|
+
uploadFiles(files: {
|
204
|
+
local: EditorPath;
|
205
|
+
remote: string;
|
206
|
+
}[], options?: node_ssh.SSHPutFilesOptions): Promise<void>;
|
207
|
+
/**
|
208
|
+
* @deprecated Use {@link IBMiContent.downloadFiles} instead.
|
209
|
+
*/
|
210
|
+
downloadFile(localFile: EditorPath, remoteFile: string): Promise<void>;
|
211
|
+
/**
|
212
|
+
* @deprecated Use {@link IBMiContent.uploadDirectory} instead.
|
213
|
+
*/
|
214
|
+
uploadDirectory(localDirectory: EditorPath, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<boolean>;
|
215
|
+
/**
|
216
|
+
* @deprecated Use {@link IBMiContent.downloadDirectory} instead.
|
217
|
+
*/
|
218
|
+
downloadDirectory(localDirectory: EditorPath, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<boolean>;
|
176
219
|
}
|
220
|
+
export {};
|
package/api/IBMiContent.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
/// <reference types="node" />
|
3
|
-
import
|
4
|
-
import {
|
3
|
+
import * as node_ssh from "node-ssh";
|
4
|
+
import { EditorPath } from '../typings';
|
5
5
|
import { FilterType } from './Filter';
|
6
6
|
import { default as IBMi } from './IBMi';
|
7
7
|
import { Tools } from './Tools';
|
8
|
+
import { AttrOperands, IBMiError, IBMiMember, IBMiObject, IFSFile, ModuleExport, ProgramExportImportInfo, QsysPath, SpecialAuthorities } from './types';
|
8
9
|
declare type Authority = "*ADD" | "*DLT" | "*EXECUTE" | "*READ" | "*UPD" | "*NONE" | "*ALL" | "*CHANGE" | "*USE" | "*EXCLUDE" | "*AUTLMGT";
|
9
10
|
export declare type SortOrder = `name` | `type`;
|
10
11
|
export declare type SortOptions = {
|
@@ -25,7 +26,7 @@ export default class IBMiContent {
|
|
25
26
|
*/
|
26
27
|
downloadStreamfileRaw(remotePath: string, localPath?: string): Promise<Buffer>;
|
27
28
|
/**
|
28
|
-
* @deprecated Use downloadStreamfileRaw instead
|
29
|
+
* @deprecated Use {@link IBMiContent.downloadStreamfileRaw()} instead
|
29
30
|
*/
|
30
31
|
downloadStreamfile(remotePath: string, localPath?: string): Promise<string>;
|
31
32
|
/**
|
@@ -36,15 +37,44 @@ export default class IBMiContent {
|
|
36
37
|
writeStreamfileRaw(originalPath: string, content: Uint8Array, encoding?: string): Promise<string | void>;
|
37
38
|
/**
|
38
39
|
* Write utf8 content to a streamfile
|
39
|
-
* @deprecated Use writeStreamfileRaw instead
|
40
|
+
* @deprecated Use {@link IBMiContent.writeStreamfileRaw()} instead
|
40
41
|
*/
|
41
42
|
writeStreamfile(originalPath: string, content: string): Promise<string | void>;
|
42
43
|
/**
|
43
|
-
* Download the
|
44
|
+
* Download the content of a source member
|
45
|
+
*
|
46
|
+
* @param library
|
47
|
+
* @param sourceFile
|
48
|
+
* @param member
|
49
|
+
* @param localPath
|
50
|
+
*/
|
51
|
+
downloadMemberContent(library: string, sourceFile: string, member: string, localPath?: string): Promise<string>;
|
52
|
+
/**
|
53
|
+
* @deprecated Will be removed in `v3.0.0`; use {@link IBMiContent.downloadMemberContent()} without the `asp` parameter instead.
|
54
|
+
*
|
55
|
+
* @param asp
|
56
|
+
* @param library
|
57
|
+
* @param sourceFile
|
58
|
+
* @param member
|
59
|
+
* @param localPath
|
44
60
|
*/
|
45
61
|
downloadMemberContent(asp: string | undefined, library: string, sourceFile: string, member: string, localPath?: string): Promise<string>;
|
46
62
|
/**
|
47
63
|
* Upload to a member
|
64
|
+
*
|
65
|
+
* @param library
|
66
|
+
* @param sourceFile
|
67
|
+
* @param member
|
68
|
+
* @param content
|
69
|
+
*/
|
70
|
+
uploadMemberContent(library: string, sourceFile: string, member: string, content: string | Uint8Array): Promise<boolean>;
|
71
|
+
/**
|
72
|
+
* @deprecated Will be removed in `v3.0.0`; use {@link IBMiContent.uploadMemberContent()} without the `asp` parameter instead.
|
73
|
+
* @param asp
|
74
|
+
* @param library
|
75
|
+
* @param sourceFile
|
76
|
+
* @param member
|
77
|
+
* @param content
|
48
78
|
*/
|
49
79
|
uploadMemberContent(asp: string | undefined, library: string, sourceFile: string, member: string, content: string | Uint8Array): Promise<boolean>;
|
50
80
|
/**
|
@@ -104,6 +134,16 @@ export default class IBMiContent {
|
|
104
134
|
types?: string[];
|
105
135
|
filterType?: FilterType;
|
106
136
|
}, sortOrder?: SortOrder): Promise<IBMiObject[]>;
|
137
|
+
/**
|
138
|
+
* @param object IBMiObject to get export and import info for
|
139
|
+
* @returns an array of ProgramExportImportInfo
|
140
|
+
*/
|
141
|
+
getProgramExportImportInfo(library: string, name: string, type: string): Promise<ProgramExportImportInfo[]>;
|
142
|
+
/**
|
143
|
+
* @param object IBMiObject to get module exports for
|
144
|
+
* @returns an array of ModuleExport
|
145
|
+
*/
|
146
|
+
getModuleExports(library: string, name: string): Promise<ModuleExport[]>;
|
107
147
|
/**
|
108
148
|
*
|
109
149
|
* @param filter: the criterias used to list the members
|
@@ -122,7 +162,7 @@ export default class IBMiContent {
|
|
122
162
|
* @param filter: the criterias used to list the members
|
123
163
|
* @returns
|
124
164
|
*/
|
125
|
-
getMemberInfo(library: string, sourceFile: string, member: string): Promise<
|
165
|
+
getMemberInfo(library: string, sourceFile: string, member: string): Promise<any>;
|
126
166
|
/**
|
127
167
|
* Get list of items in a path
|
128
168
|
* @param remotePath
|
@@ -165,15 +205,26 @@ export default class IBMiContent {
|
|
165
205
|
}), ...operands: AttrOperands[]): Promise<Record<string, string>>;
|
166
206
|
countMembers(path: QsysPath): Promise<number>;
|
167
207
|
countFiles(directory: string): Promise<number>;
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
208
|
+
checkUserSpecialAuthorities(authorities: SpecialAuthorities[], user?: string): Promise<{
|
209
|
+
valid: boolean;
|
210
|
+
missing: SpecialAuthorities[];
|
211
|
+
}>;
|
212
|
+
getSshCcsid(): Promise<number>;
|
213
|
+
getSysEnvVars(): Promise<{
|
214
|
+
[name: string]: string;
|
215
|
+
}>;
|
172
216
|
/**
|
173
217
|
* Creates an empty unicode streamfile
|
174
218
|
* @param path the full path to the streamfile
|
175
219
|
* @throws an Error if the file could not be correctly created
|
176
220
|
*/
|
177
221
|
createStreamFile(path: string): Promise<void>;
|
222
|
+
uploadFiles(files: {
|
223
|
+
local: EditorPath;
|
224
|
+
remote: string;
|
225
|
+
}[], options?: node_ssh.SSHPutFilesOptions): Promise<void>;
|
226
|
+
downloadFile(localFile: EditorPath, remoteFile: string): Promise<void>;
|
227
|
+
uploadDirectory(localDirectory: EditorPath, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<boolean>;
|
228
|
+
downloadDirectory(localDirectory: EditorPath, remoteDirectory: string, options?: node_ssh.SSHGetPutDirectoryOptions): Promise<boolean>;
|
178
229
|
}
|
179
230
|
export {};
|
package/api/Search.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { IBMiMember, SearchResults } from '
|
2
|
-
import
|
1
|
+
import { IBMiMember, SearchResults } from './types';
|
2
|
+
import IBMi from './IBMi';
|
3
3
|
export declare namespace Search {
|
4
|
-
function searchMembers(
|
5
|
-
function searchIFS(
|
6
|
-
function findIFS(
|
4
|
+
function searchMembers(connection: IBMi, library: string, sourceFile: string, searchTerm: string, members: string | IBMiMember[], readOnly?: boolean): Promise<SearchResults>;
|
5
|
+
function searchIFS(connection: IBMi, path: string, searchTerm: string): Promise<SearchResults | undefined>;
|
6
|
+
function findIFS(connection: IBMi, path: string, findTerm: string): Promise<SearchResults | undefined>;
|
7
7
|
}
|
package/api/Tools.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
import { API } from "./import/git";
|
1
|
+
import { IBMiMessages, QsysPath } from './types';
|
2
|
+
import { EditorPath } from "../typings";
|
4
3
|
export declare namespace Tools {
|
5
4
|
class SqlError extends Error {
|
6
5
|
sqlstate: string;
|
@@ -38,29 +37,11 @@ export declare namespace Tools {
|
|
38
37
|
* @returns the escaped path
|
39
38
|
*/
|
40
39
|
function escapePath(Path: string, alreadyQuoted?: boolean): string;
|
41
|
-
function getGitAPI(): API | undefined;
|
42
40
|
function distinct(value: any, index: number, array: any[]): boolean;
|
43
|
-
function md5Hash(file: vscode.Uri): string;
|
44
41
|
function capitalize(text: string): string;
|
45
42
|
function sanitizeObjNamesForPase(libraries: string[]): string[];
|
46
43
|
function parseMessages(output: string): IBMiMessages;
|
47
44
|
function parseQSysPath(path: string): QsysPath;
|
48
|
-
/**
|
49
|
-
* Check whether two given uris point to the same file/member
|
50
|
-
*/
|
51
|
-
function areEquivalentUris(uriA: vscode.Uri, uriB: vscode.Uri): boolean;
|
52
|
-
/**
|
53
|
-
* We do this to find previously opened files with the same path, but different case OR readonly flags.
|
54
|
-
* Without this, it's possible for the same document to be opened twice simply due to the readonly flag.
|
55
|
-
*/
|
56
|
-
function findExistingDocumentUri(uri: vscode.Uri): vscode.Uri;
|
57
|
-
function findExistingDocument(uri: vscode.Uri): vscode.TextDocument;
|
58
|
-
function findExistingDocumentByName(nameAndExt: string): vscode.Uri;
|
59
|
-
/**
|
60
|
-
* Given the uri of a member or other resource, find all
|
61
|
-
* (if any) open tabs where that resource is being edited.
|
62
|
-
*/
|
63
|
-
function findUriTabs(uriToFind: vscode.Uri | string): vscode.Tab[];
|
64
45
|
/**
|
65
46
|
* Fixes an SQL statement to make it compatible with db2 CLI program QZDFMDB2.
|
66
47
|
* - Changes `@clCommand` statements into Call `QSYS2.QCMDEX('clCommand')` procedure calls
|
@@ -69,18 +50,9 @@ export declare namespace Tools {
|
|
69
50
|
* @returns statement compatible with QZDFMDB2
|
70
51
|
*/
|
71
52
|
function fixSQL(statement: string, removeComments?: boolean): string;
|
72
|
-
function
|
53
|
+
function fileToPath(file: EditorPath): string;
|
73
54
|
function fixWindowsPath(path: string): string;
|
74
55
|
function assumeType(str: string): string | number;
|
75
|
-
/**
|
76
|
-
* Runs a function while a context value is set to true.
|
77
|
-
*
|
78
|
-
* If multiple callers call this function with the same context, only the last one returning will unset the context value.
|
79
|
-
*
|
80
|
-
* @param context the context value that will be set to `true` during `task` execution
|
81
|
-
* @param task the function to run while the context value is `true`
|
82
|
-
*/
|
83
|
-
function withContext<T>(context: string, task: () => Promise<T>): Promise<T>;
|
84
56
|
/**
|
85
57
|
* Converts a timestamp from the attr command (in the form `Thu Dec 21 21:47:02 2023`) into a Date object
|
86
58
|
* @param timestamp an attr timestamp string
|
@@ -1,9 +1,13 @@
|
|
1
|
-
import IBMi from "../
|
1
|
+
import IBMi from "../IBMi";
|
2
2
|
export declare type ComponentState = `NotChecked` | `NotInstalled` | `Installed` | `NeedsUpdate` | `Error`;
|
3
3
|
export declare type ComponentIdentification = {
|
4
4
|
name: string;
|
5
5
|
version: number;
|
6
6
|
};
|
7
|
+
export declare type ComponentInstallState = {
|
8
|
+
id: ComponentIdentification;
|
9
|
+
state: ComponentState;
|
10
|
+
};
|
7
11
|
/**
|
8
12
|
* Defines a component that is managed per IBM i.
|
9
13
|
*
|
@@ -34,6 +38,7 @@ export declare type IBMiComponent = {
|
|
34
38
|
* @returns a human-readable name
|
35
39
|
*/
|
36
40
|
getIdentification(): ComponentIdentification;
|
41
|
+
setInstallDirectory?(installDirectory: string): Promise<void>;
|
37
42
|
/**
|
38
43
|
* @returns the component's {@link ComponentState state} on the IBM i
|
39
44
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import IBMi from "../
|
2
|
-
import { WrapResult } from "../
|
1
|
+
import IBMi from "../IBMi";
|
2
|
+
import { WrapResult } from "../types";
|
3
3
|
import { ComponentState, IBMiComponent } from "./component";
|
4
4
|
export declare class CopyToImport implements IBMiComponent {
|
5
5
|
static ID: string;
|
@@ -1,13 +1,16 @@
|
|
1
|
-
import IBMi from "../../
|
1
|
+
import IBMi from "../../IBMi";
|
2
2
|
import { ComponentState, IBMiComponent } from "../component";
|
3
3
|
export declare class CustomQSh implements IBMiComponent {
|
4
4
|
static ID: string;
|
5
|
+
private localAssetPath;
|
6
|
+
setLocalAssetPath(newPath: string): void;
|
5
7
|
installPath: string;
|
6
8
|
getIdentification(): {
|
7
9
|
name: string;
|
8
10
|
version: number;
|
9
11
|
};
|
10
12
|
getFileName(): string;
|
13
|
+
setInstallDirectory(installDirectory: string): Promise<void>;
|
11
14
|
getRemoteState(connection: IBMi, installDirectory: string): Promise<ComponentState>;
|
12
15
|
update(connection: IBMi): Promise<ComponentState>;
|
13
16
|
testCommand(connection: IBMi): Promise<boolean>;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import IBMi from "../
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import IBMi from "../IBMi";
|
2
|
+
import { ComponentState, IBMiComponent } from "../components/component";
|
3
|
+
import { IBMiMember } from "../types";
|
4
4
|
export declare class GetMemberInfo implements IBMiComponent {
|
5
5
|
static ID: string;
|
6
6
|
private readonly procedureName;
|
@@ -13,6 +13,7 @@ export declare class GetMemberInfo implements IBMiComponent {
|
|
13
13
|
};
|
14
14
|
getRemoteState(connection: IBMi): Promise<ComponentState>;
|
15
15
|
update(connection: IBMi): Promise<ComponentState>;
|
16
|
+
private static parseDateString;
|
16
17
|
getMemberInfo(connection: IBMi, library: string, sourceFile: string, member: string): Promise<IBMiMember | undefined>;
|
17
18
|
getMultipleMemberInfo(connection: IBMi, members: IBMiMember[]): Promise<IBMiMember[] | undefined>;
|
18
19
|
}
|
@@ -1,7 +1,11 @@
|
|
1
|
-
import IBMi from "../
|
1
|
+
import IBMi from "../IBMi";
|
2
2
|
import { ComponentState, IBMiComponent } from "./component";
|
3
3
|
export declare class GetNewLibl implements IBMiComponent {
|
4
4
|
static ID: string;
|
5
|
+
private readonly procedureName;
|
6
|
+
private readonly currentVersion;
|
7
|
+
private installedVersion;
|
8
|
+
reset(): void;
|
5
9
|
getIdentification(): {
|
6
10
|
name: string;
|
7
11
|
version: number;
|
@@ -12,4 +16,5 @@ export declare class GetNewLibl implements IBMiComponent {
|
|
12
16
|
currentLibrary: string;
|
13
17
|
libraryList: string[];
|
14
18
|
}>;
|
19
|
+
private getSource;
|
15
20
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import IBMi from "../IBMi";
|
2
|
+
import { ComponentIdentification, ComponentInstallState, IBMiComponent } from "./component";
|
3
|
+
interface ExtensionContextI {
|
4
|
+
extension: {
|
5
|
+
id: string;
|
6
|
+
};
|
7
|
+
}
|
8
|
+
export declare class ComponentRegistry {
|
9
|
+
private readonly components;
|
10
|
+
registerComponent(context: ExtensionContextI | string, component: IBMiComponent): void;
|
11
|
+
getComponents(): Map<string, IBMiComponent[]>;
|
12
|
+
}
|
13
|
+
export declare const extensionComponentRegistry: ComponentRegistry;
|
14
|
+
export declare class ComponentManager {
|
15
|
+
private readonly connection;
|
16
|
+
private readonly registered;
|
17
|
+
constructor(connection: IBMi);
|
18
|
+
getComponentIds(): ComponentIdentification[];
|
19
|
+
getInstallState(): ComponentInstallState[];
|
20
|
+
startup(lastInstalled?: ComponentInstallState[]): Promise<void>;
|
21
|
+
get<T extends IBMiComponent>(id: string, ignoreState?: boolean): T;
|
22
|
+
}
|
23
|
+
export {};
|
package/api/configVars.d.ts
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
import IBMi from "../IBMi";
|
2
|
+
export declare const SERVICE_CERTIFICATE = "debug_service.pfx";
|
3
|
+
export declare const CLIENT_CERTIFICATE = "debug_service.crt";
|
4
|
+
export declare const LEGACY_CERT_DIRECTORY = "/QIBM/ProdData/IBMiDebugService/bin/certs";
|
2
5
|
declare type ConfigLine = {
|
3
6
|
key: string;
|
4
7
|
value?: string;
|
5
8
|
};
|
6
|
-
export declare const DEBUG_CONFIG_FILE = "/QIBM/
|
9
|
+
export declare const DEBUG_CONFIG_FILE = "/QIBM/UserData/IBMiDebugService/C4iDebugService.env";
|
10
|
+
export declare const ORIGINAL_DEBUG_CONFIG_FILE = "/QIBM/ProdData/IBMiDebugService/bin/DebugService.env";
|
7
11
|
export declare class DebugConfiguration {
|
12
|
+
private connection;
|
13
|
+
constructor(connection: IBMi);
|
8
14
|
readonly configLines: ConfigLine[];
|
15
|
+
private readOnly;
|
9
16
|
private getContent;
|
10
17
|
getOrDefault(key: string, defaultValue: string): string;
|
11
18
|
get(key: string): string;
|
@@ -31,6 +38,6 @@ interface DebugServiceDetails {
|
|
31
38
|
};
|
32
39
|
}
|
33
40
|
export declare function resetDebugServiceDetails(): void;
|
34
|
-
export declare function getDebugServiceDetails(): Promise<DebugServiceDetails>;
|
41
|
+
export declare function getDebugServiceDetails(connection: IBMi): Promise<DebugServiceDetails>;
|
35
42
|
export declare function getJavaHome(connection: IBMi, version: string): string;
|
36
43
|
export {};
|