@halcyontech/vscode-ibmi-types 2.11.0 → 2.13.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.
@@ -47,7 +47,6 @@ export declare namespace ConnectionConfiguration {
47
47
  showDescInLibList: boolean;
48
48
  debugPort: string;
49
49
  debugSepPort: string;
50
- debugIsSecure: boolean;
51
50
  debugUpdateProductionFiles: boolean;
52
51
  debugEnableDebugTracing: boolean;
53
52
  readOnlyMode: boolean;
package/api/IBMi.d.ts CHANGED
@@ -24,6 +24,7 @@ export default class IBMi {
24
24
  };
25
25
  defaultUserLibraries: string[];
26
26
  outputChannel?: vscode.OutputChannel;
27
+ outputChannelContent?: string;
27
28
  /**
28
29
  * Used to store ASP numbers and their names
29
30
  * Their names usually maps up to a directory in
@@ -48,12 +49,13 @@ export default class IBMi {
48
49
  content: IBMiContent;
49
50
  shell?: string;
50
51
  commandsExecuted: number;
52
+ maximumArgsLength: number;
51
53
  dangerousVariants: boolean;
52
54
  constructor();
53
55
  /**
54
56
  * @returns {Promise<{success: boolean, error?: any}>} Was succesful at connecting or not.
55
57
  */
56
- connect(connectionObject: ConnectionData, reconnecting?: boolean, reloadServerSettings?: boolean): Promise<{
58
+ connect(connectionObject: ConnectionData, reconnecting?: boolean, reloadServerSettings?: boolean, onConnectedOperations?: Function[]): Promise<{
57
59
  success: boolean;
58
60
  error?: any;
59
61
  }>;
@@ -75,6 +77,7 @@ export default class IBMi {
75
77
  sendCommand(options: CommandData): Promise<CommandResult>;
76
78
  private appendOutput;
77
79
  private determineClear;
80
+ private disconnect;
78
81
  end(): Promise<void>;
79
82
  /**
80
83
  * SQL only available when runner is installed and CCSID is valid.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import { MarkdownString } from 'vscode';
2
3
  import { AttrOperands, IBMiError, IBMiMember, IBMiObject, IFSFile, QsysPath } from '../typings';
3
4
  import { FilterType } from './Filter';
4
5
  import { default as IBMi } from './IBMi';
@@ -164,5 +165,9 @@ export default class IBMiContent {
164
165
  }), ...operands: AttrOperands[]): Promise<Record<string, string>>;
165
166
  countMembers(path: QsysPath): Promise<number>;
166
167
  countFiles(directory: string): Promise<number>;
168
+ objectToToolTip(path: string, object: IBMiObject): MarkdownString;
169
+ sourcePhysicalFileToToolTip(path: string, object: IBMiObject): Promise<MarkdownString>;
170
+ memberToToolTip(path: string, member: IBMiMember): MarkdownString;
171
+ ifsFileToToolTip(path: string, ifsFile: IFSFile): MarkdownString;
167
172
  }
168
173
  export {};
package/api/Instance.d.ts CHANGED
@@ -7,7 +7,8 @@ export default class Instance {
7
7
  private connection;
8
8
  private storage;
9
9
  private emitter;
10
- private events;
10
+ private subscribers;
11
+ private deprecationCount;
11
12
  constructor(context: vscode.ExtensionContext);
12
13
  setConnection(connection?: IBMi): Promise<void>;
13
14
  getConnection(): IBMi;
@@ -15,6 +16,22 @@ export default class Instance {
15
16
  getConfig(): ConnectionConfiguration.Parameters;
16
17
  getContent(): import("./IBMiContent").default;
17
18
  getStorage(): ConnectionStorage;
19
+ /**
20
+ * Subscribe to an {@link IBMiEvent}. When the event is triggerred, the `func` function gets executed.
21
+ *
22
+ * Each `context`/`name` couple must be unique.
23
+ * @param context the extension subscribing to the event
24
+ * @param event the {@link IBMiEvent} to subscribe to
25
+ * @param name a human-readable name summarizing the function
26
+ * @param func the function to execute when the {@link IBMiEvent} is triggerred
27
+ * @param transient if `true`, the function will only be executed once during the lifetime of a connection
28
+ */
29
+ subscribe(context: vscode.ExtensionContext, event: IBMiEvent, name: string, func: Function, transient?: boolean): void;
30
+ private getSubscribers;
31
+ /**
32
+ * @deprecated Will be removed in `v3.0.0`; use {@link subscribe} instead
33
+ */
18
34
  onEvent(event: IBMiEvent, func: Function): void;
19
35
  fire(event: IBMiEvent): void;
36
+ processEvent(event: IBMiEvent): Promise<void>;
20
37
  }
package/api/Search.d.ts CHANGED
@@ -1,15 +1,7 @@
1
+ import { IBMiMember, SearchResults } from '../typings';
1
2
  import Instance from './Instance';
2
3
  export declare namespace Search {
3
- interface Result {
4
- path: string;
5
- lines: Line[];
6
- readonly?: boolean;
7
- label?: string;
8
- }
9
- interface Line {
10
- number: number;
11
- content: string;
12
- }
13
- function searchMembers(instance: Instance, library: string, sourceFile: string, memberFilter: string, searchTerm: string, readOnly?: boolean): Promise<Result[]>;
14
- function searchIFS(instance: Instance, path: string, searchTerm: string): Promise<Result[]>;
4
+ function searchMembers(instance: Instance, library: string, sourceFile: string, searchTerm: string, members: IBMiMember[] | string, readOnly?: boolean): Promise<SearchResults>;
5
+ function searchIFS(instance: Instance, path: string, searchTerm: string): Promise<SearchResults | undefined>;
6
+ function findIFS(instance: Instance, path: string, findTerm: string): Promise<SearchResults | undefined>;
15
7
  }
package/api/Storage.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import vscode from 'vscode';
2
+ import { ConnectionData } from '../typings';
2
3
  export declare type PathContent = Record<string, string[]>;
3
4
  export declare type DeploymentPath = Record<string, string>;
4
5
  export declare type DebugCommands = Record<string, string>;
@@ -11,6 +12,7 @@ declare type AuthorisedExtension = {
11
12
  declare abstract class Storage {
12
13
  protected readonly globalState: any;
13
14
  constructor(context: vscode.ExtensionContext);
15
+ protected keys(): readonly string[];
14
16
  protected get<T>(key: string): T | undefined;
15
17
  protected set(key: string, value: any): Promise<void>;
16
18
  protected abstract getStorageKey(key: string): string;
@@ -38,6 +40,7 @@ export declare type CachedServerSettings = {
38
40
  pathChecked?: boolean;
39
41
  userDefaultCCSID: number | null;
40
42
  debugConfigLoaded: boolean;
43
+ maximumArgsLength: number;
41
44
  } | undefined;
42
45
  export declare class GlobalStorage extends Storage {
43
46
  private static instance;
@@ -67,12 +70,18 @@ export declare class GlobalStorage extends Storage {
67
70
  pathChecked?: boolean;
68
71
  userDefaultCCSID: number;
69
72
  debugConfigLoaded: boolean;
73
+ maximumArgsLength: number;
70
74
  };
71
75
  setServerSettingsCache(name: string, serverSettings: CachedServerSettings): Promise<void>;
72
76
  setServerSettingsCacheSpecific(name: string, newSettings: Partial<CachedServerSettings>): Promise<void>;
73
77
  deleteServerSettingsCache(name: string): Promise<void>;
78
+ deleteStaleServerSettingsCache(connections: ConnectionData[]): Promise<void>;
74
79
  getPreviousSearchTerms(): string[];
75
- setPreviousSearchTerms(previousSearchTerms: string[]): Promise<void>;
80
+ addPreviousSearchTerm(term: string): Promise<void>;
81
+ clearPreviousSearchTerms(): Promise<void>;
82
+ getPreviousFindTerms(): string[];
83
+ addPreviousFindTerm(term: string): Promise<void>;
84
+ clearPreviousFindTerms(): Promise<void>;
76
85
  }
77
86
  export declare class ConnectionStorage extends Storage {
78
87
  private connectionName;
package/api/Terminal.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import vscode from 'vscode';
2
- import Instance from './Instance';
3
2
  export declare namespace Terminal {
4
3
  enum TerminalType {
5
4
  PASE = "PASE",
6
5
  _5250 = "5250"
7
6
  }
8
- function selectAndOpen(instance: Instance, openType?: TerminalType): Promise<vscode.Terminal>;
7
+ function registerTerminalCommands(context: vscode.ExtensionContext): vscode.Disposable[];
9
8
  }
package/api/Tools.d.ts CHANGED
@@ -27,7 +27,7 @@ export declare namespace Tools {
27
27
  * @param member Optional
28
28
  * @param iasp Optional: an iASP name
29
29
  */
30
- function qualifyPath(library: string, object: string, member?: string, iasp?: string, sanitise?: boolean): string;
30
+ function qualifyPath(library: string, object: string, member?: string, iasp?: string, noEscape?: boolean): string;
31
31
  /**
32
32
  * Unqualify member path from root
33
33
  */
@@ -54,11 +54,12 @@ export declare namespace Tools {
54
54
  */
55
55
  function findExistingDocumentUri(uri: vscode.Uri): vscode.Uri;
56
56
  function findExistingDocument(uri: vscode.Uri): vscode.TextDocument;
57
+ function findExistingDocumentByName(nameAndExt: string): vscode.Uri;
57
58
  /**
58
59
  * Given the uri of a member or other resource, find all
59
60
  * (if any) open tabs where that resource is being edited.
60
61
  */
61
- function findUriTabs(uriToFind: vscode.Uri): vscode.Tab[];
62
+ function findUriTabs(uriToFind: vscode.Uri | string): vscode.Tab[];
62
63
  /**
63
64
  * Fixes an SQL statement to make it compatible with db2 CLI program QZDFMDB2.
64
65
  * - Changes `@clCommand` statements into Call `QSYS2.QCMDEX('clCommand')` procedure calls
@@ -18,6 +18,7 @@ export declare const LEGACY_CERT_DIRECTORY = "/QIBM/ProdData/IBMiDebugService/bi
18
18
  * @param imported if defined, gives the location and password of a local or remote (i.e. on the IFS) service certificate to import
19
19
  */
20
20
  export declare function setup(connection: IBMi, imported?: ImportedCertificate): Promise<void>;
21
+ export declare function debugKeyFileExists(connection: IBMi, debugConfig: DebugConfiguration): Promise<boolean>;
21
22
  export declare function remoteCertificatesExists(debugConfig?: DebugConfiguration): Promise<boolean>;
22
23
  export declare function downloadClientCert(connection: IBMi): Promise<void>;
23
24
  export declare function getLocalCertPath(connection: IBMi): string;
@@ -17,6 +17,8 @@ export declare class DebugConfiguration {
17
17
  getRemoteServiceRoot(): string;
18
18
  getRemoteServiceBin(): string;
19
19
  getRemoteServiceWorkDir(): string;
20
+ getCode4iDebug(): string;
21
+ setCode4iDebug(value: string): void;
20
22
  }
21
23
  interface DebugServiceDetails {
22
24
  version: string;
package/instantiate.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import * as vscode from "vscode";
2
2
  import Instance from "./api/Instance";
3
- import { Search } from "./api/Search";
4
3
  export declare let instance: Instance;
5
- export declare function setSearchResults(term: string, results: Search.Result[]): void;
6
4
  export declare function disconnect(): Promise<boolean>;
7
5
  export declare function loadAllofExtension(context: vscode.ExtensionContext): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halcyontech/vscode-ibmi-types",
3
- "version": "2.11.0",
3
+ "version": "2.13.0",
4
4
  "description": "Types for vscode-ibmi",
5
5
  "typings": "./typings.d.ts",
6
6
  "scripts": {
package/typings.d.ts CHANGED
@@ -49,7 +49,7 @@ export interface CommandData extends StandardIO {
49
49
  env?: Record<string, string>;
50
50
  }
51
51
  export interface CommandResult {
52
- code: number | null;
52
+ code: number;
53
53
  stdout: string;
54
54
  stderr: string;
55
55
  command?: string;
@@ -189,3 +189,17 @@ export interface WrapResult {
189
189
  }
190
190
  export declare type SpecialAuthorities = "*ALLOBJ" | "*AUDIT" | "*IOSYSCFG" | "*JOBCTL" | "*SAVSYS" | "*SECADM" | "*SERVICE" | "*SPLCTL";
191
191
  export declare type AttrOperands = 'ACCESS_TIME' | 'ALLOC_SIZE' | 'ALLOC_SIZE_64' | 'ALWCKPWR' | 'ALWSAV' | 'ASP' | 'AUDIT' | 'AUTH_GROUP' | 'AUTH_LIST_NAME' | 'AUTH_OWNER' | 'AUTH_USERS' | 'CCSID' | 'CHANGE_TIME' | 'CHECKED_OUT' | 'CHECKED_OUT_USER' | 'CHECKED_OUT_TIME' | 'CODEPAGE' | 'CREATE_TIME' | 'CRTOBJAUD' | 'CRTOBJSCAN' | 'DATA_SIZE' | 'DATA_SIZE_64' | 'DIR_FORMAT' | 'DISK_STG_OPT' | 'EXTENDED_ATTR_SIZE' | 'FILE_FORMAT' | 'FILE_ID' | 'JOURNAL_APPLY_CHANGES' | 'JOURNAL_ID' | 'JOURNAL_LIBRARY' | 'JOURNAL_NAME' | 'JOURNAL_OPTIONS' | 'JOURNAL_RCVR_ASP' | 'JOURNAL_RCVR_LIBRARY' | 'JOURNAL_RCVR_NAME' | 'JOURNAL_ROLLBACK_ENDED' | 'JOURNAL_START_TIME' | 'JOURNAL_STATUS' | 'LOCAL_REMOTE' | 'MAIN_STG_OPT' | 'MODIFY_TIME' | 'MULT_SIGS' | 'OBJTYPE' | 'PC_ARCHIVE' | 'PC_HIDDEN' | 'PC_READ_ONLY' | 'PC_SYSTEM' | 'RSTDRNMUNL' | 'SCAN' | 'SCAN_BINARY' | 'SCAN_CCSID1' | 'SCAN_CCSID2' | 'SCAN_SIGS_DIFF' | 'SCAN_STATUS' | 'SGID' | 'SIGNED' | 'STG_FREE' | 'SUID' | 'SYSTEM_ARCHIVE' | 'SYSTEM_USE' | 'SYS_SIGNED' | 'UDFS_DEFAULT_FORMAT' | 'USAGE_DAYS_USED' | 'USAGE_LAST_USED_TIME' | 'USAGE_RESET_TIME';
192
+ export declare type SearchResults = {
193
+ term: string;
194
+ hits: SearchHit[];
195
+ };
196
+ export declare type SearchHit = {
197
+ path: string;
198
+ lines: SearchHitLine[];
199
+ readonly?: boolean;
200
+ label?: string;
201
+ };
202
+ export declare type SearchHitLine = {
203
+ number: number;
204
+ content: string;
205
+ };