@halcyontech/vscode-ibmi-types 1.6.2 → 1.6.13
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/CompileTools.d.ts +69 -0
- package/api/IBMi.d.ts +8 -0
- package/api/IBMiContent.d.ts +38 -78
- package/api/Instance.d.ts +1 -0
- package/api/Storage.d.ts +4 -4
- package/api/configVars.d.ts +3 -0
- package/api/errors/handler.d.ts +4 -0
- package/api/errors/handlers/new.d.ts +9 -0
- package/api/errors/handlers/old.d.ts +9 -0
- package/api/local/actions.d.ts +7 -0
- package/api/local/deployment.d.ts +27 -0
- package/api/local/env.d.ts +4 -0
- package/package.json +1 -1
- package/sandbox.d.ts +3 -0
- package/typings.d.ts +37 -1
@@ -0,0 +1,69 @@
|
|
1
|
+
export = CompileTools;
|
2
|
+
declare class CompileTools {
|
3
|
+
/**
|
4
|
+
* @param {vscode.ExtensionContext} context
|
5
|
+
*/
|
6
|
+
static register(context: vscode.ExtensionContext): void;
|
7
|
+
/**
|
8
|
+
* Does what it says on the tin.
|
9
|
+
*/
|
10
|
+
static clearDiagnostics(): void;
|
11
|
+
/**
|
12
|
+
* @param {Instance} instance
|
13
|
+
* @param {{asp?: string, lib: string, object: string, ext?: string, workspace?: number}} evfeventInfo
|
14
|
+
*/
|
15
|
+
static refreshDiagnostics(instance: Instance, evfeventInfo: {
|
16
|
+
asp?: string;
|
17
|
+
lib: string;
|
18
|
+
object: string;
|
19
|
+
ext?: string;
|
20
|
+
workspace?: number;
|
21
|
+
}): Promise<void>;
|
22
|
+
/**
|
23
|
+
*
|
24
|
+
* @param {string} string
|
25
|
+
* @param {{[name: string]: string}} variables
|
26
|
+
*/
|
27
|
+
static replaceValues(string: string, variables: {
|
28
|
+
[name: string]: string;
|
29
|
+
}): string;
|
30
|
+
/**
|
31
|
+
*
|
32
|
+
* @param {Instance} instance
|
33
|
+
* @returns
|
34
|
+
*/
|
35
|
+
static getDefaultVariables(instance: Instance): {
|
36
|
+
[name: string]: string;
|
37
|
+
};
|
38
|
+
/**
|
39
|
+
* @param {Instance} instance
|
40
|
+
* @param {vscode.Uri} uri
|
41
|
+
*/
|
42
|
+
static RunAction(instance: Instance, uri: vscode.Uri): Promise<void>;
|
43
|
+
/**
|
44
|
+
* Execute command
|
45
|
+
* @param {Instance} instance
|
46
|
+
* @param {import("../typings").RemoteCommand} options
|
47
|
+
* @returns {Promise<import("../typings").CommandResult|null>}
|
48
|
+
*/
|
49
|
+
static runCommand(instance: Instance, options: import("../typings").RemoteCommand): Promise<import("../typings").CommandResult | null>;
|
50
|
+
static showOutput(): void;
|
51
|
+
static appendOutput(output: any): void;
|
52
|
+
/**
|
53
|
+
* @param {string} name Name of action
|
54
|
+
* @param {string} command Command string
|
55
|
+
* @return {Promise<string>} new command
|
56
|
+
*/
|
57
|
+
static showCustomInputs(name: string, command: string): Promise<string>;
|
58
|
+
/**
|
59
|
+
*
|
60
|
+
* @param {string} baseCommand
|
61
|
+
* @returns {{lib?: string, object: string}}
|
62
|
+
*/
|
63
|
+
static getObjectFromCommand(baseCommand: string): {
|
64
|
+
lib?: string;
|
65
|
+
object: string;
|
66
|
+
};
|
67
|
+
}
|
68
|
+
import vscode = require("vscode");
|
69
|
+
import { default as Instance } from "./Instance";
|
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 {};
|
package/api/IBMiContent.d.ts
CHANGED
@@ -1,109 +1,69 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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<
|
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,
|
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,
|
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
|
35
|
-
* @returns
|
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
|
41
|
-
* @param
|
42
|
-
* @param
|
43
|
-
* @param
|
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(
|
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
|
49
|
-
* @returns
|
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
|
58
|
-
* @param
|
59
|
-
* @returns
|
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?:
|
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
|
75
|
-
* @param
|
76
|
-
* @param
|
77
|
-
* @returns
|
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
|
91
|
-
* @return
|
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
|
100
|
-
* @returns
|
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
package/api/Storage.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import vscode from 'vscode';
|
2
|
-
export
|
3
|
-
|
2
|
+
export declare type PathContent = Record<string, string[]>;
|
3
|
+
export declare type DeploymentPath = Record<string, string>;
|
4
4
|
export declare class Storage {
|
5
5
|
readonly context: vscode.ExtensionContext;
|
6
6
|
readonly connectionName: string;
|
@@ -13,6 +13,6 @@ export declare class Storage {
|
|
13
13
|
setLastProfile(lastProfile: string): Promise<void>;
|
14
14
|
getPreviousCurLibs(): string[];
|
15
15
|
setPreviousCurLibs(previousCurLibs: string[]): Promise<void>;
|
16
|
-
getDeployment():
|
17
|
-
setDeployment(existingPaths:
|
16
|
+
getDeployment(): DeploymentPath;
|
17
|
+
setDeployment(existingPaths: DeploymentPath): Promise<void>;
|
18
18
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { FileError } from '../../../typings';
|
2
|
+
export declare namespace NewHandler {
|
3
|
+
/**
|
4
|
+
* Returns object of files and their errors
|
5
|
+
* @param lines file contents
|
6
|
+
* @returns Errors object
|
7
|
+
*/
|
8
|
+
function parse(lines: string[]): Map<string, FileError[]>;
|
9
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { FileError } from '../../../typings';
|
2
|
+
export declare namespace OldHandler {
|
3
|
+
/**
|
4
|
+
* Returns object of files and their errors
|
5
|
+
* @param lines file contents
|
6
|
+
* @returns Errors object
|
7
|
+
*/
|
8
|
+
function parse(lines: string[]): Map<string, FileError[]>;
|
9
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { WorkspaceFolder } from "vscode";
|
2
|
+
import { Action } from "../../typings";
|
3
|
+
export declare function getLocalActions(currentWorkspace: WorkspaceFolder): Promise<Action[]>;
|
4
|
+
/**
|
5
|
+
* Gets actions from the `iproj.json` file
|
6
|
+
*/
|
7
|
+
export declare function getiProjActions(currentWorkspace: WorkspaceFolder): Promise<Action[]>;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import vscode from 'vscode';
|
2
|
+
import Instance from '../Instance';
|
3
|
+
import { Ignore } from 'ignore';
|
4
|
+
export declare namespace Deployment {
|
5
|
+
interface DeploymentParameters {
|
6
|
+
method: Method;
|
7
|
+
localFolder: vscode.Uri;
|
8
|
+
remotePath: string;
|
9
|
+
ignoreRules?: Ignore;
|
10
|
+
}
|
11
|
+
enum Method {
|
12
|
+
"all" = 0,
|
13
|
+
"staged" = 1,
|
14
|
+
"unstaged" = 2,
|
15
|
+
"changed" = 3,
|
16
|
+
"compare" = 4
|
17
|
+
}
|
18
|
+
function initialize(context: vscode.ExtensionContext, instance: Instance): void;
|
19
|
+
/**
|
20
|
+
* Deploy a workspace to a remote IFS location.
|
21
|
+
* @param workspaceIndex if no index is provided, a prompt will be shown to pick one if there are multiple workspaces,
|
22
|
+
* otherwise the current workspace will be used.
|
23
|
+
* @returns the index of the deployed workspace or `undefined` if the deployment failed
|
24
|
+
*/
|
25
|
+
function launchDeploy(workspaceIndex?: number): Promise<number | undefined>;
|
26
|
+
function deploy(parameters: DeploymentParameters): Promise<boolean>;
|
27
|
+
}
|
package/package.json
CHANGED
package/sandbox.d.ts
ADDED
package/typings.d.ts
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { ExtensionContext } from "vscode";
|
3
3
|
import Instance from "./api/Instance";
|
4
|
+
import { Deployment } from "./api/local/deployment";
|
4
5
|
export interface CodeForIBMi {
|
5
6
|
instance: Instance;
|
6
7
|
baseContext: ExtensionContext;
|
7
8
|
CustomUI: object;
|
8
9
|
Field: object;
|
10
|
+
deploy: (parameters: Deployment.DeploymentParameters) => Promise<boolean>;
|
11
|
+
evfeventParser: (lines: string[]) => Map<string, FileError[]>;
|
9
12
|
}
|
10
13
|
export interface StandardIO {
|
11
14
|
onStdout?: (data: Buffer) => void;
|
@@ -52,7 +55,7 @@ export interface ConnectionData {
|
|
52
55
|
username: string;
|
53
56
|
password?: string;
|
54
57
|
privateKey: string | null;
|
55
|
-
keepaliveInterval
|
58
|
+
keepaliveInterval?: number;
|
56
59
|
}
|
57
60
|
export interface Server {
|
58
61
|
name: string;
|
@@ -67,3 +70,36 @@ export interface IBMiObject {
|
|
67
70
|
text: string;
|
68
71
|
attribute?: string;
|
69
72
|
}
|
73
|
+
export interface IBMiFile extends IBMiObject {
|
74
|
+
count?: number;
|
75
|
+
}
|
76
|
+
export interface IBMiMember {
|
77
|
+
library: string;
|
78
|
+
file: string;
|
79
|
+
name: string;
|
80
|
+
extension: string;
|
81
|
+
recordLength: number;
|
82
|
+
text: string;
|
83
|
+
asp?: string;
|
84
|
+
}
|
85
|
+
export interface IFSFile {
|
86
|
+
type: "directory" | "streamfile";
|
87
|
+
name: string;
|
88
|
+
path: string;
|
89
|
+
}
|
90
|
+
export interface IBMiError {
|
91
|
+
code: string;
|
92
|
+
text: string;
|
93
|
+
}
|
94
|
+
export interface Filter {
|
95
|
+
library: string;
|
96
|
+
filter: string;
|
97
|
+
}
|
98
|
+
export interface FileError {
|
99
|
+
sev: number;
|
100
|
+
linenum: number;
|
101
|
+
column: number;
|
102
|
+
toColumn: number;
|
103
|
+
text: string;
|
104
|
+
code: string;
|
105
|
+
}
|