Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unpublish to api.ts #1061

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { publish as _publish, IPublishOptions } from './publish';
import { publish as _publish, IPublishOptions, unpublish as _unpublish, IUnpublishOptions } from './publish';
import { packageCommand, listFiles as _listFiles, IPackageOptions } from './package';

/**
Expand Down Expand Up @@ -106,3 +106,17 @@ export function publishVSIX(packagePath: string | string[], options: IPublishVSI
...{ target: undefined },
});
}

/**
* Options for the `unpublishVSIX` function.
* @public
*/
export type IUnpublishVSIXOptions = IPublishOptions & Pick<IUnpublishOptions, 'id'>;

/**
* Deletes a specific extension from the marketplace.
* @public
*/
export function unpublishVSIX(options: IUnpublishVSIXOptions = {}): Promise<any> {
return _unpublish({ force: true, ...options });
}
4 changes: 4 additions & 0 deletions src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ async function _publishSignedPackage(api: GalleryApi, packageName: string, packa
});
}

/**
* Options for the `unpublish` function.
* @public
*/
export interface IUnpublishOptions extends IPublishOptions {
id?: string;
force?: boolean;
Expand Down