@vscode/vsce 2.29.0 → 2.29.1-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.
package/out/auth.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAzureCredentialAccessToken = void 0;
4
+ const identity_1 = require("@azure/identity");
5
+ function createChainedTokenCredential() {
6
+ return new identity_1.ChainedTokenCredential(new identity_1.EnvironmentCredential(), new identity_1.AzureCliCredential(), new identity_1.ManagedIdentityCredential({ clientId: process.env.AZURE_CLIENT_ID }), new identity_1.AzurePowerShellCredential({ tenantId: process.env.AZURE_TENANT_ID }), new identity_1.AzureDeveloperCliCredential({ tenantId: process.env.AZURE_TENANT_ID }));
7
+ }
8
+ async function getAzureCredentialAccessToken() {
9
+ try {
10
+ const credential = createChainedTokenCredential();
11
+ const token = await credential.getToken('499b84ac-1321-427f-aa17-267ca6975798/.default', {
12
+ tenantId: process.env.AZURE_TENANT_ID
13
+ });
14
+ return token.token;
15
+ }
16
+ catch (error) {
17
+ throw new Error('Can not acquire a Microsoft Entra ID access token. Additional information:\n\n' + error);
18
+ }
19
+ }
20
+ exports.getAzureCredentialAccessToken = getAzureCredentialAccessToken;
21
+ //# sourceMappingURL=auth.js.map
package/out/publish.js CHANGED
@@ -40,6 +40,7 @@ const validation_1 = require("./validation");
40
40
  const form_data_1 = __importDefault(require("form-data"));
41
41
  const path_1 = require("path");
42
42
  const cockatiel_1 = require("cockatiel");
43
+ const auth_1 = require("./auth");
43
44
  const tmpName = (0, util_1.promisify)(tmp.tmpName);
44
45
  async function publish(options = {}) {
45
46
  if (options.packagePath) {
@@ -251,7 +252,7 @@ async function getPAT(publisher, options) {
251
252
  return options.pat;
252
253
  }
253
254
  if (options.azureCredential) {
254
- return await (0, util_2.getAzureCredentialAccessToken)();
255
+ return await (0, auth_1.getAzureCredentialAccessToken)();
255
256
  }
256
257
  return (await (0, store_1.getPublisher)(publisher)).pat;
257
258
  }
package/out/util.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.patchOptionsWithManifest = exports.log = exports.sequence = exports.CancellationToken = exports.isCancelledError = exports.nonnull = exports.flatten = exports.chain = exports.normalize = exports.getAzureCredentialAccessToken = exports.getPublicGalleryAPI = exports.getSecurityRolesAPI = exports.getGalleryAPI = exports.getHubUrl = exports.getMarketplaceUrl = exports.getPublishedUrl = exports.read = void 0;
6
+ exports.patchOptionsWithManifest = exports.log = exports.sequence = exports.CancellationToken = exports.isCancelledError = exports.nonnull = exports.flatten = exports.chain = exports.normalize = exports.getPublicGalleryAPI = exports.getSecurityRolesAPI = exports.getGalleryAPI = exports.getHubUrl = exports.getMarketplaceUrl = exports.getPublishedUrl = exports.read = void 0;
7
7
  const util_1 = require("util");
8
8
  const read_1 = __importDefault(require("read"));
9
9
  const WebApi_1 = require("azure-devops-node-api/WebApi");
@@ -11,7 +11,6 @@ const GalleryApi_1 = require("azure-devops-node-api/GalleryApi");
11
11
  const chalk_1 = __importDefault(require("chalk"));
12
12
  const publicgalleryapi_1 = require("./publicgalleryapi");
13
13
  const os_1 = require("os");
14
- const identity_1 = require("@azure/identity");
15
14
  const __read = (0, util_1.promisify)(read_1.default);
16
15
  function read(prompt, options = {}) {
17
16
  if (process.env['VSCE_TESTS'] || !process.stdout.isTTY) {
@@ -51,17 +50,6 @@ function getPublicGalleryAPI() {
51
50
  return new publicgalleryapi_1.PublicGalleryAPI(marketplaceUrl, '3.0-preview.1');
52
51
  }
53
52
  exports.getPublicGalleryAPI = getPublicGalleryAPI;
54
- async function getAzureCredentialAccessToken() {
55
- try {
56
- const credential = new identity_1.DefaultAzureCredential();
57
- const token = await credential.getToken('499b84ac-1321-427f-aa17-267ca6975798/.default');
58
- return token.token;
59
- }
60
- catch (error) {
61
- throw new Error('Can not acquire a Microsoft Entra ID access token. Additional information:\n\n' + error);
62
- }
63
- }
64
- exports.getAzureCredentialAccessToken = getAzureCredentialAccessToken;
65
53
  function normalize(path) {
66
54
  return path.replace(/\\/g, '/');
67
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/vsce",
3
- "version": "2.29.0",
3
+ "version": "2.29.1-0",
4
4
  "description": "VS Code Extensions Manager",
5
5
  "repository": {
6
6
  "type": "git",