Skip to content

Commit a4930cc

Browse files
authored
Merge pull request #1061 from andrewlayer/main
Added unpublish to api.ts
2 parents 51ed6ba + 38b75b5 commit a4930cc

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/api.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { publish as _publish, IPublishOptions } from './publish';
1+
import { publish as _publish, IPublishOptions, unpublish as _unpublish, IUnpublishOptions } from './publish';
22
import { packageCommand, listFiles as _listFiles, IPackageOptions } from './package';
33

44
/**
@@ -106,3 +106,17 @@ export function publishVSIX(packagePath: string | string[], options: IPublishVSI
106106
...{ target: undefined },
107107
});
108108
}
109+
110+
/**
111+
* Options for the `unpublishVSIX` function.
112+
* @public
113+
*/
114+
export type IUnpublishVSIXOptions = IPublishOptions & Pick<IUnpublishOptions, 'id'>;
115+
116+
/**
117+
* Deletes a specific extension from the marketplace.
118+
* @public
119+
*/
120+
export function unpublishVSIX(options: IUnpublishVSIXOptions = {}): Promise<any> {
121+
return _unpublish({ force: true, ...options });
122+
}

src/publish.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ async function _publishSignedPackage(api: GalleryApi, packageName: string, packa
294294
});
295295
}
296296

297+
/**
298+
* Options for the `unpublish` function.
299+
* @public
300+
*/
297301
export interface IUnpublishOptions extends IPublishOptions {
298302
id?: string;
299303
force?: boolean;

0 commit comments

Comments
 (0)