Skip to content

Commit

Permalink
Merge pull request #1061 from andrewlayer/main
Browse files Browse the repository at this point in the history
Added unpublish to api.ts
  • Loading branch information
benibenj authored Oct 15, 2024
2 parents 51ed6ba + 38b75b5 commit a4930cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
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

0 comments on commit a4930cc

Please sign in to comment.