@halcyontech/vscode-ibmi-types 2.13.5 → 2.14.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.
@@ -1,4 +1,4 @@
1
- import vscode, { EventEmitter } from 'vscode';
1
+ import vscode, { EventEmitter, WorkspaceFolder } from 'vscode';
2
2
  import { Action, BrowserItem, CommandResult, DeploymentMethod, RemoteCommand } from '../typings';
3
3
  import Instance from './Instance';
4
4
  export interface ILELibrarySettings {
@@ -7,7 +7,7 @@ export interface ILELibrarySettings {
7
7
  }
8
8
  export declare namespace CompileTools {
9
9
  function register(context: vscode.ExtensionContext): void;
10
- function runAction(instance: Instance, uri: vscode.Uri, customAction?: Action, method?: DeploymentMethod, browserItem?: BrowserItem): Promise<boolean>;
10
+ function runAction(instance: Instance, uri: vscode.Uri, customAction?: Action, method?: DeploymentMethod, browserItem?: BrowserItem, workspaceFolder?: WorkspaceFolder): Promise<boolean>;
11
11
  /**
12
12
  * Execute a command
13
13
  */
@@ -3,6 +3,7 @@ import { ConnectionData, DeploymentMethod } from '../typings';
3
3
  import { FilterType } from './Filter';
4
4
  export declare type SourceDateMode = "edit" | "diff";
5
5
  export declare type DefaultOpenMode = "browse" | "edit";
6
+ export declare type ReconnectMode = "always" | "never" | "ask";
6
7
  export declare function onCodeForIBMiConfigurationChange<T>(props: string | string[], todo: (value: vscode.ConfigurationChangeEvent) => void): vscode.Disposable;
7
8
  export declare namespace GlobalConfiguration {
8
9
  function get<T>(key: string): T | undefined;
package/api/IBMi.d.ts CHANGED
@@ -9,10 +9,12 @@ export interface MemberParts extends IBMiMember {
9
9
  basename: string;
10
10
  }
11
11
  export default class IBMi {
12
+ private systemVersion;
12
13
  private qccsid;
13
- private jobCcsid;
14
+ private userJobCcsid;
14
15
  /** User default CCSID is job default CCSID */
15
16
  private userDefaultCCSID;
17
+ private sshdCcsid;
16
18
  private componentManager;
17
19
  client: node_ssh.NodeSSH;
18
20
  currentHost: string;
@@ -39,6 +41,7 @@ export default class IBMi {
39
41
  variantChars: {
40
42
  american: string;
41
43
  local: string;
44
+ qsysNameRegex?: RegExp;
42
45
  };
43
46
  /**
44
47
  * Strictly for storing errors from sendCommand.
@@ -50,7 +53,18 @@ export default class IBMi {
50
53
  shell?: string;
51
54
  commandsExecuted: number;
52
55
  maximumArgsLength: number;
53
- dangerousVariants: boolean;
56
+ get canUseCqsh(): boolean;
57
+ /**
58
+ * Primarily used for running SQL statements.
59
+ */
60
+ get userCcsidInvalid(): boolean;
61
+ /**
62
+ * Determines if the client should do variant translation.
63
+ * False when cqsh should be used.
64
+ * True when cqsh is not available and the job CCSID is not the same as the SSHD CCSID.
65
+ */
66
+ get requiresTranslation(): boolean;
67
+ get dangerousVariants(): boolean;
54
68
  constructor();
55
69
  /**
56
70
  * @returns {Promise<{success: boolean, error?: any}>} Was succesful at connecting or not.
@@ -59,6 +73,10 @@ export default class IBMi {
59
73
  success: boolean;
60
74
  error?: any;
61
75
  }>;
76
+ /**
77
+ * Can return 0 if the OS version was not detected.
78
+ */
79
+ getSystemVersion(): number;
62
80
  usingBash(): boolean;
63
81
  /**
64
82
  * - Send PASE/QSH/ILE commands simply
@@ -69,6 +87,7 @@ export default class IBMi {
69
87
  * `env` to customise them.
70
88
  */
71
89
  runCommand(data: RemoteCommand): Promise<CommandResult>;
90
+ static escapeForShell(command: string): string;
72
91
  sendQsh(options: CommandData): Promise<CommandResult>;
73
92
  /**
74
93
  * Send commands to pase through the SSH connection.
@@ -83,13 +102,11 @@ export default class IBMi {
83
102
  * SQL only available when runner is installed and CCSID is valid.
84
103
  */
85
104
  get enableSQL(): boolean;
86
- /**
87
- * Do not use this API directly.
88
- * It exists to support some backwards compatability.
89
- * @deprecated
90
- */
91
- set enableSQL(value: boolean);
92
105
  sqlRunnerAvailable(): boolean;
106
+ private getSshCcsid;
107
+ getSysEnvVars(): Promise<{
108
+ [name: string]: string;
109
+ }>;
93
110
  /**
94
111
  * Generates path to a temp file on the IBM i
95
112
  * @param {string} key Key to the temp file to be re-used
@@ -136,16 +153,17 @@ export default class IBMi {
136
153
  * @param statements
137
154
  * @returns a Result set
138
155
  */
139
- runSQL(statements: string): Promise<Tools.DB2Row[]>;
140
- getEncoding(): {
141
- fallback: boolean;
142
- ccsid: number;
143
- invalid: boolean;
144
- };
156
+ runSQL(statements: string, options?: {
157
+ fakeBindings?: (string | number)[];
158
+ forceSafe?: boolean;
159
+ }): Promise<Tools.DB2Row[]>;
160
+ validQsysName(name: string): boolean;
161
+ getCcsid(): number;
145
162
  getCcsids(): {
146
163
  qccsid: number;
147
164
  runtimeCcsid: number;
148
165
  userDefaultCCSID: number;
166
+ sshdCcsid: number;
149
167
  };
150
168
  checkUserSpecialAuthorities(authorities: SpecialAuthorities[], user?: string): Promise<{
151
169
  valid: boolean;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { MarkdownString } from 'vscode';
3
4
  import { AttrOperands, IBMiError, IBMiMember, IBMiObject, IFSFile, QsysPath } from '../typings';
4
5
  import { FilterType } from './Filter';
@@ -121,7 +122,7 @@ export default class IBMiContent {
121
122
  * @param filter: the criterias used to list the members
122
123
  * @returns
123
124
  */
124
- getMemberInfo(library: string, sourceFile: string, member: string): Promise<IBMiMember | undefined>;
125
+ getMemberInfo(library: string, sourceFile: string, member: string): Promise<IBMiMember>;
125
126
  /**
126
127
  * Get list of items in a path
127
128
  * @param remotePath
package/api/Storage.d.ts CHANGED
@@ -22,6 +22,7 @@ export declare type LastConnection = {
22
22
  timestamp: number;
23
23
  };
24
24
  export declare type CachedServerSettings = {
25
+ lastCheckedOnVersion: string | undefined;
25
26
  aspInfo: {
26
27
  [id: number]: string;
27
28
  };
@@ -31,10 +32,6 @@ export declare type CachedServerSettings = {
31
32
  [name: string]: string | undefined;
32
33
  };
33
34
  remoteFeaturesKeys: string | null;
34
- variantChars: {
35
- american: string;
36
- local: string;
37
- };
38
35
  badDataAreasChecked: boolean | null;
39
36
  libraryListValidated: boolean | null;
40
37
  pathChecked?: boolean;
@@ -52,6 +49,7 @@ export declare class GlobalStorage extends Storage {
52
49
  setLastConnection(name: string): Promise<void>;
53
50
  setLastConnections(lastConnections: LastConnection[]): Promise<void>;
54
51
  getServerSettingsCache(name: string): {
52
+ lastCheckedOnVersion: string;
55
53
  aspInfo: {
56
54
  [id: number]: string;
57
55
  };
@@ -61,10 +59,6 @@ export declare class GlobalStorage extends Storage {
61
59
  [name: string]: string;
62
60
  };
63
61
  remoteFeaturesKeys: string;
64
- variantChars: {
65
- american: string;
66
- local: string;
67
- };
68
62
  badDataAreasChecked: boolean;
69
63
  libraryListValidated: boolean;
70
64
  pathChecked?: boolean;
package/api/Tools.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare namespace Tools {
19
19
  * @returns rows
20
20
  */
21
21
  function db2Parse(output: string, input?: string): DB2Row[];
22
+ function bufferToUx(input: string): string;
22
23
  function makeid(length?: number): string;
23
24
  /**
24
25
  * Build the IFS path string to an object or member
@@ -36,12 +37,12 @@ export declare namespace Tools {
36
37
  * @param Path
37
38
  * @returns the escaped path
38
39
  */
39
- function escapePath(Path: string): string;
40
+ function escapePath(Path: string, alreadyQuoted?: boolean): string;
40
41
  function getGitAPI(): API | undefined;
41
42
  function distinct(value: any, index: number, array: any[]): boolean;
42
43
  function md5Hash(file: vscode.Uri): string;
43
44
  function capitalize(text: string): string;
44
- function sanitizeLibraryNames(libraries: string[]): string[];
45
+ function sanitizeObjNamesForPase(libraries: string[]): string[];
45
46
  function parseMessages(output: string): IBMiMessages;
46
47
  function parseQSysPath(path: string): QsysPath;
47
48
  /**
@@ -30,8 +30,11 @@ export declare type IBMiComponentType<T extends IBMiComponent> = new (c: IBMi) =
30
30
  */
31
31
  export declare abstract class IBMiComponent {
32
32
  protected readonly connection: IBMi;
33
+ static readonly InstallDirectory = "$HOME/.vscode/";
33
34
  private state;
35
+ private cachedInstallDirectory;
34
36
  constructor(connection: IBMi);
37
+ getInstallDirectory(): Promise<string>;
35
38
  getState(): ComponentState;
36
39
  check(): Promise<this>;
37
40
  toString(): string;
@@ -0,0 +1,12 @@
1
+ import { ComponentState, IBMiComponent } from "../component";
2
+ export declare class cqsh extends IBMiComponent {
3
+ getIdentification(): {
4
+ name: string;
5
+ version: number;
6
+ };
7
+ getFileName(): string;
8
+ getPath(): Promise<string>;
9
+ protected getRemoteState(): Promise<ComponentState>;
10
+ protected update(): Promise<ComponentState>;
11
+ testCommand(): Promise<boolean>;
12
+ }
@@ -1,6 +1,6 @@
1
1
  import vscode from "vscode";
2
2
  import IBMi from "../api/IBMi";
3
- import { IBMiComponent, IBMiComponentType } from "./component";
3
+ import { ComponentState, IBMiComponent, IBMiComponentType } from "./component";
4
4
  export declare class ComponentRegistry {
5
5
  private readonly components;
6
6
  registerComponent(context: vscode.ExtensionContext, component: IBMiComponentType<any>): void;
@@ -11,6 +11,10 @@ export declare class ComponentManager {
11
11
  private readonly connection;
12
12
  private readonly registered;
13
13
  constructor(connection: IBMi);
14
+ getState(): {
15
+ id: import("./component").ComponentIdentification;
16
+ state: ComponentState;
17
+ }[];
14
18
  startup(): Promise<void>;
15
19
  get<T extends IBMiComponent>(type: IBMiComponentType<T>, ignoreState?: boolean): T | undefined;
16
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halcyontech/vscode-ibmi-types",
3
- "version": "2.13.5",
3
+ "version": "2.14.0",
4
4
  "description": "Types for vscode-ibmi",
5
5
  "typings": "./typings.d.ts",
6
6
  "scripts": {
package/typings.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { Ignore } from 'ignore';
3
4
  import { MarkdownString, ProviderResult, Range, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
4
5
  import { ConnectionConfiguration } from './api/Configuration';
package/locale/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare type Locale = {
2
- [id: string]: string;
3
- };
4
- export declare function updateLocale(): void;
5
- export declare function t(id: string, ...values: any[]): string;