Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into prep/ftp-v3

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
  • Loading branch information
zFernand0 committed Apr 30, 2024
2 parents 0128f96 + 50eeee8 commit c5dbe78
Show file tree
Hide file tree
Showing 45 changed files with 1,259 additions and 1,362 deletions.
8 changes: 8 additions & 0 deletions docs/early-access/v3/Extenders.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- Removed support for v1 Profiles
- Updated supported VS Code engine to 1.79.0
- Drop support for Theia IDE
- Removed the `zowe.jobs.zosJobsOpenSpool` command in favor of using `vscode.open` with a spool URI.
- Removed the `zowe.ds.ZoweNode.openPS` command in favor of using `vscode.open` with a data set URI.
- Removed the `zowe.uss.ZoweUSSNode.open` command in favor of using `vscode.open` with a USS URI.

## Removal of deprecated APIs from Extensibility API for Zowe Explorer

Expand Down Expand Up @@ -68,3 +71,8 @@
- `ICommand.issueUnixCommand` added for issuing Unix Commands
- Optional `ICommand.sshProfileRequired` API returning a boolean value for extenders that would like to use the ssh profile for issuing UNIX commands via Zowe Explorer.
- `ProfilesCache.convertV1ProfToConfig()` added for migrating v1 profiles to a global team configuration file.
- Marked `getJobsByParameters` as a required function for the `MainframeInteraction.IJes` interface.
- Added the `uploadFromBuffer` required function to the `MainframeInteraction.IMvs` and `MainframeInteraction.IUss` interfaces. This function will be used in v3 to upload contents of data sets and USS files to the mainframe.
- Added optional function `move` to the `MainframeInteraction.IUss` interface to move USS folders/files from one path to another.
- Added the `buildUniqueSpoolName` function to build spool names for Zowe resource URIs and VS Code editor tabs.
- Added the `isNodeInEditor` function to determine whether a tree node's resource URI is open in the editor.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"vscode": "^1.79.0"
},
"dependencies": {
"@vscode/l10n": "^0.0.18"
"@vscode/l10n": "^0.0.18",
"disposablestack": "^1.1.4"
},
"devDependencies": {
"@types/jest": "^29.2.3",
Expand All @@ -28,6 +29,7 @@
"@vscode/l10n-dev": "^0.0.35",
"@vscode/test-electron": "^1.6.0",
"@vscode/vsce": "2.15.0",
"concurrently": "^6.5.1",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
Expand All @@ -43,7 +45,6 @@
"mocha-junit-reporter": "^2.2.0",
"mocha-multi-reporters": "^1.5.1",
"node-loader": "^2.0.0",
"ovsx": "^0.8.3",
"prettier": "2.6.0",
"rimraf": "^3.0.2",
"terser-webpack-plugin": "^5.3.10",
Expand Down
7 changes: 7 additions & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

- Deprecated the following properties on Zowe tree interfaces in favor of setters and getters to incentivize encapsulation: [#2026](https://github.com/zowe/zowe-explorer-vscode/issues/2026)
- `binary` property on the `IZoweDatasetTreeNode` interface - use the `getEncoding` and `setEncoding` functions instead.
- `encodingMap` property on the `IZoweDatasetTreeNode` and `IZoweUSSTreeNode` interfaces - use the `getEncodingInMap` and `updateEncodingInMap` functions instead.
- `stats` property on the `IZoweDatasetTreeNode` interface - use the `getStats` and `setStats` functions instead.
- `encoding` property on the `IZoweDatasetTreeNode` and `IZoweUSSTreeNode` interfaces - use the `getEncoding` and `setEncoding` functions instead.
- `shortLabel` property on the `IZoweUSSTreeNode` interface - use the `getBaseName` function instead.
- `attributes` property on the `IZoweUSSTreeNode` interface - use the `getAttributes` and `setAttributes` functions instead.
- **Breaking:** Added return type of `Promise<void>` to `MainframeInteractions.ICommon.logout`. [#2783](https://github.com/zowe/vscode-extension-for-zowe/pull/2783).

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer-api/src/fs/types/abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class FileEntry implements IFileSystemEntry {
public name: string;
public metadata: EntryMetadata;
public type: vscode.FileType;
public data: Uint8Array;
public data?: Uint8Array;
public wasAccessed: boolean;
public ctime: number;
public mtime: number;
Expand Down
13 changes: 11 additions & 2 deletions packages/zowe-explorer-api/src/fs/types/datasets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,35 @@
*
*/

import { Types } from "../..";
import { DirEntry, EntryMetadata, FileEntry } from "../types";
import { IProfileLoaded } from "@zowe/imperative";

export class DsEntry extends FileEntry {
interface DsEntryProps {
stats: Types.DatasetStats;
}

export class DsEntry extends FileEntry implements DsEntryProps {
public metadata: DsEntryMetadata;

public constructor(name: string) {
super(name);
}

public stats: Types.DatasetStats;
}

export class MemberEntry extends DsEntry {}

export class PdsEntry extends DirEntry {
export class PdsEntry extends DirEntry implements DsEntryProps {
public entries: Map<string, MemberEntry>;

public constructor(name: string) {
super(name);
this.entries = new Map();
}

public stats: Types.DatasetStats;
}

export class DsEntryMetadata implements EntryMetadata {
Expand Down
13 changes: 10 additions & 3 deletions packages/zowe-explorer-api/src/fs/types/uss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@

import * as vscode from "vscode";
import { ConflictData, DirEntry, EntryMetadata, FileEntry } from ".";
import { Types } from "../..";

export class UssFile extends FileEntry {
export interface UssEntryProps {
attributes?: Types.FileAttributes;
}

export class UssFile extends FileEntry implements UssEntryProps {
public name: string;
public metadata: EntryMetadata;
public type: vscode.FileType;
public wasAccessed: boolean;
public attributes: Types.FileAttributes;

public ctime: number;
public mtime: number;
public size: number;
public conflictData?: ConflictData;
public data: Uint8Array;
public data?: Uint8Array;
public etag?: string;
public permissions?: vscode.FilePermission;

Expand All @@ -31,8 +37,9 @@ export class UssFile extends FileEntry {
}
}

export class UssDirectory extends DirEntry {
export class UssDirectory extends DirEntry implements UssEntryProps {
public constructor(name?: string) {
super(name ?? "");
}
public attributes: Types.FileAttributes;
}
83 changes: 74 additions & 9 deletions packages/zowe-explorer-api/src/tree/IZoweTreeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface OtherEncoding {
}

export type ZosEncoding = TextEncoding | BinaryEncoding | OtherEncoding;
export type EncodingMap = Record<string, ZosEncoding>;

/**
* The base interface for Zowe tree nodes that are implemented by vscode.TreeItem.
Expand Down Expand Up @@ -120,6 +121,8 @@ export interface IZoweDatasetTreeNode extends IZoweTreeNode {
*/
memberPattern?: string;
/**
* @deprecated Please use `setStats` and `getStats` instead.
*
* Additional statistics about this data set
*/
stats?: Partial<Types.DatasetStats>;
Expand All @@ -128,14 +131,20 @@ export interface IZoweDatasetTreeNode extends IZoweTreeNode {
*/
filter?: Sorting.DatasetFilter;
/**
* @deprecated Please use `getEncodingInMap` and `updateEncodingInMap` instead.
*
* List of child nodes and user-selected encodings
*/
encodingMap?: Record<string, ZosEncoding>;
/**
* @deprecated Please use `setEncoding` and `getEncoding` instead.
*
* Binary indicator. Default false (text)
*/
binary?: boolean;
/**
* @deprecated Please use `setEncoding` and `getEncoding` instead.
*
* Remote encoding of the data set
*
* * `null` = user selected z/OS default codepage
Expand All @@ -153,13 +162,13 @@ export interface IZoweDatasetTreeNode extends IZoweTreeNode {
*
* @returns {string}
*/
getEtag?(): string;
getEtag(): string | PromiseLike<string>;
/**
* Sets the etag value for the file
*
* @param {string}
*/
setEtag?(etag: string);
setEtag(etag: string): void | PromiseLike<void>;
/**
* Downloads and displays a file in a text editor view
*
Expand All @@ -173,13 +182,33 @@ export interface IZoweDatasetTreeNode extends IZoweTreeNode {
*
* @param {string}
*/
getEncoding?(): ZosEncoding;
getEncoding(): ZosEncoding | PromiseLike<ZosEncoding>;
/**
* Sets the codepage value for the file
*
* @param {string}
*/
setEncoding?(encoding: ZosEncoding);
setEncoding(encoding: ZosEncoding): void | PromiseLike<void>;

/**
* Returns the encoding map for the USS tree node.
*/
getEncodingInMap(uriPath: string): ZosEncoding | PromiseLike<ZosEncoding>;

/**
* Sets the encoding map for the USS tree node.
*/
updateEncodingInMap(uriPath: string, encoding: ZosEncoding): void | PromiseLike<void>;

/**
* Returns the stats for a data set.
*/
getStats(): Types.DatasetStats;

/**
* Sets the stats for a data set.
*/
setStats(stats: Partial<Types.DatasetStats>): void | PromiseLike<void>;
}

/**
Expand All @@ -190,48 +219,84 @@ export interface IZoweDatasetTreeNode extends IZoweTreeNode {
*/
export interface IZoweUSSTreeNode extends IZoweTreeNode {
/**
* @deprecated Please use `getBaseName` instead.
*
* Retrieves an abridged for of the label
*/
shortLabel?: string;
/**
* @deprecated Please use `getEncodingInMap` and `updateEncodingInMap` instead.
*
* List of child nodes and user-selected encodings
*/
encodingMap?: Record<string, ZosEncoding>;
/**
* @deprecated Please use `getEncoding` and `setEncoding` instead.
*
* Binary indicator. Default false (text)
*/
binary?: boolean;

/**
* @deprecated Please use `setAttributes` and `getAttributes` instead.
*
* File attributes
*/
attributes?: Types.FileAttributes;
/**
* Event that fires whenever an existing node is updated.
*/
onUpdateEmitter?: vscode.EventEmitter<IZoweUSSTreeNode>;

/**
* Event that fires whenever an existing node is updated.
*/
onUpdate?: vscode.Event<IZoweUSSTreeNode>;

/**
* Returns the base name of the USS tree node.
*/
getBaseName(): string | PromiseLike<string>;

/**
* Retrieves child nodes of this IZoweUSSTreeNode
*
* @returns {Promise<IZoweUSSTreeNode[]>}
*/
getChildren(): Promise<IZoweUSSTreeNode[]>;

/**
* Returns the last-saved encoding from the encoding map for the USS tree node.
*/
getEncodingInMap(uriPath: string): ZosEncoding | PromiseLike<ZosEncoding>;

/**
* Update the encoding map to contain the encoding for the USS tree node.
*/
updateEncodingInMap(path: string, encoding: ZosEncoding): void | PromiseLike<void>;

/**
* Retrieves the etag value for the file
*
* @returns {string}
*/
getEtag?(): string;
getEtag(): string | PromiseLike<string>;
/**
* Sets the etag value for the file
*
* @param {string}
*/
setEtag?(etag: string);
setEtag(etag: string): void | PromiseLike<void>;

/**
* Gets the attributes for the USS file/folder.
*/
getAttributes(): Types.FileAttributes | PromiseLike<Types.FileAttributes>;

/**
* Sets the attributes for the USS file/folder.
*/
setAttributes(attributes: Partial<Types.FileAttributes>): void | PromiseLike<void>;

/**
* Renaming a USS Node. This could be a Favorite Node
*
Expand All @@ -243,13 +308,13 @@ export interface IZoweUSSTreeNode extends IZoweTreeNode {
*
* @param {string}
*/
getEncoding?(): ZosEncoding;
getEncoding(): ZosEncoding | PromiseLike<ZosEncoding>;
/**
* Sets the codepage value for the file
*
* @param {string}
*/
setEncoding?(encoding: ZosEncoding);
setEncoding(encoding: ZosEncoding): void | PromiseLike<void>;
// /**
// * Opens the text document
// * @return vscode.TextDocument
Expand Down
5 changes: 2 additions & 3 deletions packages/zowe-explorer-ftp-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@
"@zowe/zos-ftp-for-zowe-cli": "3.0.0-next.202403191358",
"@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202404032038",
"@zowe/zowe-explorer-api": "3.0.0-next-SNAPSHOT",
"tmp": "0.2.1"
"tmp": "0.2.3"
},
"devDependencies": {
"@types/tmp": "0.2.0",
"concurrently": "^5.2.0"
"@types/tmp": "0.2.6"
},
"jest": {
"moduleFileExtensions": [
Expand Down
3 changes: 3 additions & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### New features and enhancements

- Renamed `isHomeProfile` context helper function to `isGlobalProfile` for clarity.

### Bug fixes

- Fixed vNext-only issue where users are not able to create data sets. [#2783](https://github.com/zowe/vscode-extension-for-zowe/pull/2783).
Expand All @@ -20,6 +22,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- **Breaking:** Removed the `zowe.uss.ZoweUSSNode.open` command in favor of using `vscode.open` with a USS URI. See the [FileSystemProvider wiki page](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider#file-paths-vs-uris) for more information on USS URIs. [#2207](https://github.com/zowe/zowe-explorer-vscode/issues/2207)
- Added the `onResourceChanged` function to the `ZoweExplorerApiRegister` class to allow extenders to subscribe to any changes to Zowe resources (Data Sets, USS files/folders, Jobs, etc.). See the [FileSystemProvider wiki page](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider) for more information on Zowe resources.
- Added the `addFileSystemEvent` function to the `ZoweExplorerApiRegister` class to allow extenders to register their FileSystemProvider "onDidChangeFile" events. See the [FileSystemProvider wiki page](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider) for more information on the FileSystemProvider.
- Refactored behavior and management of Favorites in Zowe Explorer. [#2026](https://github.com/zowe/zowe-explorer-vscode/issues/2026)

### Bug fixes

Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer/__mocks__/mockCreators/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export function createAltTypeIProfile(): imperative.IProfileLoaded {
};
}

export function createTreeView(selection?): vscode.TreeView<ZoweTreeProvider> {
export function createTreeView(selection?): vscode.TreeView<ZoweTreeProvider<any>> {
const currSelection = selection ? selection : [];
return {
reveal: jest.fn(),
Expand All @@ -285,7 +285,7 @@ export function createTreeView(selection?): vscode.TreeView<ZoweTreeProvider> {
onDidChangeVisibility: jest.fn(),
dispose: jest.fn(),
addSingleSession: jest.fn(),
} as unknown as vscode.TreeView<ZoweTreeProvider>;
} as unknown as vscode.TreeView<ZoweTreeProvider<any>>;
}

export function createTextDocument(name: string, sessionNode?: ZoweDatasetNode | ZoweUSSNode): vscode.TextDocument {
Expand Down
Loading

0 comments on commit c5dbe78

Please sign in to comment.