Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
chore: bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Aug 15, 2023
1 parent f3dc714 commit 0e4fd62
Show file tree
Hide file tree
Showing 6 changed files with 1,093 additions and 851 deletions.
3 changes: 0 additions & 3 deletions .prettierrc.json

This file was deleted.

4 changes: 3 additions & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"command": "env:api",
"plugin": "@cristiand391/sf-plugin-api",
"flags": ["body", "header", "include", "method", "target-org"],
"alias": []
"alias": [],
"flagChars": ["H", "X", "i", "o"],
"flagAliases": []
}
]
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@
},
"bugs": "https://github.com/cristiand391/sf-plugin-api/issues",
"dependencies": {
"@oclif/core": "^2.8.0",
"@salesforce/core": "^3.34.6",
"@salesforce/sf-plugins-core": "^2.2.7",
"@oclif/core": "^2.11.8",
"@salesforce/core": "^5.2.1",
"@salesforce/sf-plugins-core": "^3.1.15",
"chalk": "^4",
"got": "11.8.5",
"proxy-agent": "^5.0.0",
"proxy-from-env": "^1.1.0"
"proxy-agent": "^6.3.0"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^3.3.10",
"@salesforce/ts-sinon": "1.4.0",
"@oclif/plugin-command-snapshot": "^4.0.12",
"@salesforce/ts-sinon": "^1.4.14",
"@swc/core": "^1.3.11",
"@types/chai": "^4.3.4",
"@types/inquirer": "^9.0.3",
"@types/mocha": "^10.0.1",
"@types/proxy-from-env": "^1.0.1",
"@types/sinon": "^10.0.13",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.1",
Expand All @@ -34,19 +32,22 @@
"eslint-config-salesforce-typescript": "^1.1.1",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsdoc": "^39.3.6",
"eslint-plugin-sf-plugin": "^1.14.0",
"mocha": "^9.2.2",
"eslint-plugin-sf-plugin": "^1.16.2",
"mocha": "^10.2.0",
"nock": "^13.3.0",
"oclif": "^3.7.3",
"prettier": "^2.8.7",
"oclif": "^3.11.3",
"prettier": "^3.0.1",
"shx": "0.3.4",
"sinon": "^15.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"wireit": "^0.9.5"
"wireit": "^0.10.0"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"prettier": {
"singleQuote": true
},
"files": [
"/lib",
Expand All @@ -70,7 +71,6 @@
"bin": "sf",
"topicSeparator": " ",
"devPlugins": [
"@oclif/plugin-help",
"@oclif/plugin-command-snapshot"
]
},
Expand Down
11 changes: 5 additions & 6 deletions src/commands/env/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
*/

import { readFile } from 'node:fs/promises';
import { EOL } from 'node:os'
import { EOL } from 'node:os';
import got, { Headers, Method } from 'got';
import * as chalk from 'chalk';
import * as ProxyAgent from 'proxy-agent';
import { getProxyForUrl } from 'proxy-from-env';
import { ProxyAgent } from 'proxy-agent';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { SfError, Messages, Org } from '@salesforce/core';
import { Args, ux } from '@oclif/core';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages(
'@cristiand391/sf-plugin-api',
'env.api'
'env.api',
);

export default class EnvApi extends SfCommand<void> {
Expand Down Expand Up @@ -83,7 +82,7 @@ export default class EnvApi extends SfCommand<void> {
'',
[
'Make sure the header is in a "key:value" format, e.g. "Accept: application/json"',
]
],
);
}
headers[split[0]] = split[1].trim();
Expand All @@ -104,7 +103,7 @@ export default class EnvApi extends SfCommand<void> {
}`;

const res = await got(url, {
agent: { https: ProxyAgent(getProxyForUrl(url)) },
agent: { https: new ProxyAgent() },
method: flags.method,
headers: {
Authorization: `Bearer ${
Expand Down
4 changes: 2 additions & 2 deletions test/commands/env/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ describe('env api', () => {
} catch (e) {
const err = e as SfError;
expect(err.message).to.equal(
'Failed to parse HTTP header: "Accept application/xml".'
'Failed to parse HTTP header: "Accept application/xml".',
);
if (!err.actions || err.actions?.length === 0) {
expect.fail('Missing action message for invalid header error.');
}
expect(err.actions[0]).to.equal(
'Make sure the header is in a "key:value" format, e.g. "Accept: application/json"'
'Make sure the header is in a "key:value" format, e.g. "Accept: application/json"',
);
}
});
Expand Down
Loading

0 comments on commit 0e4fd62

Please sign in to comment.