@salesforce/plugin-trust 2.2.8 → 2.3.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.
@@ -0,0 +1,3 @@
1
+ import { Hook } from '@oclif/core';
2
+ declare const hook: Hook<'jit_plugin_not_installed'>;
3
+ export default hook;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /*
4
+ * Copyright (c) 2022, salesforce.com, inc.
5
+ * All rights reserved.
6
+ * Licensed under the BSD 3-Clause license.
7
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
8
+ */
9
+ const os = require("os");
10
+ const core_1 = require("@salesforce/core");
11
+ const appInsights_1 = require("@salesforce/telemetry/lib/appInsights");
12
+ const hook = async function (opts) {
13
+ try {
14
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
15
+ global.cliTelemetry?.record({
16
+ eventName: 'JIT_INSTALL_STARTED',
17
+ type: 'EVENT',
18
+ version: opts.config.version,
19
+ plugin: opts.command.pluginName,
20
+ command: opts.command.id,
21
+ });
22
+ await opts.config.runCommand('plugins:install', [`${opts.command.pluginName}@${opts.pluginVersion}`]);
23
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
24
+ global.cliTelemetry?.record({
25
+ eventName: 'JIT_INSTALL_SUCCESS',
26
+ type: 'EVENT',
27
+ version: opts.config.version,
28
+ plugin: opts.command.pluginName,
29
+ command: opts.command.id,
30
+ });
31
+ }
32
+ catch (error) {
33
+ const err = error;
34
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
35
+ global.cliTelemetry?.record({
36
+ eventName: 'JIT_INSTALL_FAILED',
37
+ type: 'EVENT',
38
+ message: err.message,
39
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
40
+ stackTrace: err?.stack?.replace(new RegExp(os.homedir(), 'g'), appInsights_1.AppInsights.GDPR_HIDDEN),
41
+ version: opts.config.version,
42
+ plugin: opts.command.pluginName,
43
+ command: opts.command.id,
44
+ });
45
+ throw new core_1.SfError(`Could not install ${opts.command.pluginName}`, 'JitPluginInstallError');
46
+ }
47
+ };
48
+ exports.default = hook;
49
+ //# sourceMappingURL=jitPluginInstall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jitPluginInstall.js","sourceRoot":"","sources":["../../src/hooks/jitPluginInstall.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yBAAyB;AAEzB,2CAA2C;AAE3C,uEAAoE;AAIpE,MAAM,IAAI,GAAqC,KAAK,WAAW,IAAI;IACjE,IAAI;QACF,yGAAyG;QACzG,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC;YAC1B,SAAS,EAAE,qBAAqB;YAChC,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;YAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;SACzB,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;QAEtG,yGAAyG;QACzG,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC;YAC1B,SAAS,EAAE,qBAAqB;YAChC,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;YAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;SACzB,CAAC,CAAC;KACJ;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,GAAG,GAAG,KAAc,CAAC;QAE3B,yGAAyG;QACzG,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC;YAC1B,SAAS,EAAE,oBAAoB;YAC/B,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,6GAA6G;YAC7G,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE,yBAAW,CAAC,WAAW,CAAC;YACvF,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;YAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;SACzB,CAAC,CAAC;QAEH,MAAM,IAAI,cAAO,CAAC,qBAAqB,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,uBAAuB,CAAC,CAAC;KAC5F;AACH,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":"2.2.8","commands":{"plugins:trust:verify":{"id":"plugins:trust:verify","summary":"Validate a digital signature.","description":"Verifies the digital signature on an npm package matches the signature and key stored at the expected URLs.","strict":true,"pluginName":"@salesforce/plugin-trust","pluginAlias":"@salesforce/plugin-trust","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %> --npm @scope/npmName --registry http://my.repo.org:4874","<%= config.bin %> <%= command.id %> --npm @scope/npmName"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"npm":{"name":"npm","type":"option","char":"n","summary":"Specify the npm name. This can include a tag/version.","required":true,"multiple":false},"registry":{"name":"registry","type":"option","char":"r","summary":"The registry name. The behavior is the same as npm.","multiple":false},"loglevel":{"name":"loglevel","type":"option","hidden":true,"multiple":false,"deprecated":{"message":"The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."}}},"args":[]}}}
1
+ {"version":"2.3.0","commands":{"plugins:trust:verify":{"id":"plugins:trust:verify","summary":"Validate a digital signature.","description":"Verifies the digital signature on an npm package matches the signature and key stored at the expected URLs.","strict":true,"pluginName":"@salesforce/plugin-trust","pluginAlias":"@salesforce/plugin-trust","pluginType":"core","aliases":[],"examples":["<%= config.bin %> <%= command.id %> --npm @scope/npmName --registry http://my.repo.org:4874","<%= config.bin %> <%= command.id %> --npm @scope/npmName"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"npm":{"name":"npm","type":"option","char":"n","summary":"Specify the npm name. This can include a tag/version.","required":true,"multiple":false},"registry":{"name":"registry","type":"option","char":"r","summary":"The registry name. The behavior is the same as npm.","multiple":false},"loglevel":{"name":"loglevel","type":"option","hidden":true,"multiple":false,"deprecated":{"message":"The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."}}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-trust",
3
3
  "description": "validate a digital signature for a npm package",
4
- "version": "2.2.8",
4
+ "version": "2.3.0",
5
5
  "author": "Salesforce",
6
6
  "main": "lib/index.js",
7
7
  "bin": {
@@ -9,9 +9,11 @@
9
9
  },
10
10
  "bugs": "https://github.com/forcedotcom/cli/issues",
11
11
  "dependencies": {
12
- "@oclif/core": "^1.22.0",
12
+ "@oclif/core": "^1.25.0",
13
13
  "@salesforce/core": "^3.32.12",
14
+ "@salesforce/plugin-telemetry": "^2.0.5",
14
15
  "@salesforce/sf-plugins-core": "^1.22.1",
16
+ "@salesforce/telemetry": "^3.2.13",
15
17
  "got": "^11",
16
18
  "npm": "^8.19.3",
17
19
  "npm-run-path": "^4.0.1",
@@ -80,7 +82,8 @@
80
82
  "hooks": {
81
83
  "plugins:preinstall:verify:signature": [
82
84
  "./lib/hooks/verifyInstallSignature.js"
83
- ]
85
+ ],
86
+ "jit_plugin_not_installed": "./lib/hooks/jitPluginInstall.js"
84
87
  },
85
88
  "devPlugins": [
86
89
  "@oclif/plugin-help",
@@ -123,7 +126,7 @@
123
126
  "access": "public"
124
127
  },
125
128
  "sfdx": {
126
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-trust/2.2.8.crt",
127
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-trust/2.2.8.sig"
129
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-trust/2.3.0.crt",
130
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-trust/2.3.0.sig"
128
131
  }
129
132
  }