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 Jan 6, 2024
1 parent 0941d9c commit 4280f15
Show file tree
Hide file tree
Showing 4 changed files with 876 additions and 475 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"type": "module",
"bugs": "https://github.com/cristiand391/sf-plugin-api/issues",
"dependencies": {
"@oclif/core": "^3.10.1",
"@salesforce/core": "^5.3.17",
"@salesforce/sf-plugins-core": "^4.0.0",
"@oclif/core": "^3.16.0",
"@salesforce/core": "^6.4.4",
"@salesforce/sf-plugins-core": "^7.0.0",
"chalk": "^5.3.0",
"got": "^13.0.0",
"proxy-agent": "^6.3.1"
Expand All @@ -22,16 +22,17 @@
"@types/inquirer": "^9.0.3",
"@types/mocha": "^10.0.1",
"@types/sinon": "^10.0.13",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"chai": "^4.3.6",
"eslint": "^8.26.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-salesforce": "^2.0.2",
"eslint-config-salesforce-typescript": "^1.1.1",
"eslint-config-salesforce-typescript": "^3.0.16",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsdoc": "^46.4.6",
"eslint-plugin-sf-plugin": "^1.16.2",
"eslint-plugin-sf-plugin": "^1.17.1",
"eslint-plugin-unicorn": "^49.0.0",
"mocha": "^10.2.0",
"nock": "^13.3.0",
"oclif": "^3.11.3",
Expand All @@ -40,7 +41,7 @@
"sinon": "^15.0.3",
"strip-ansi": "^7.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"typescript": "^5.3.3",
"wireit": "^0.10.0"
},
"engines": {
Expand Down
21 changes: 13 additions & 8 deletions src/commands/org/api.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { readFile } from 'node:fs/promises';
import { EOL } from 'node:os';
import got, { Headers, Method } from 'got';
import got, { Headers } from 'got';
import chalk from 'chalk';
import { ProxyAgent } from 'proxy-agent';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { SfError, Org } from '@salesforce/core';
import { Args, ux } from '@oclif/core';
import { fileExists } from '@oclif/core/lib/util/fs.js';

export class OrgApi extends SfCommand<void> {
public static readonly summary =
Expand All @@ -31,17 +32,14 @@ export class OrgApi extends SfCommand<void> {
// summary is already set in the org flag.
// eslint-disable-next-line sf-plugin/flag-summary
'target-org': Flags.requiredOrg({
// TODO: this is already set in the org flag but getting a wrong type if not set here.
// Fix flag types in oclif.
required: true,
helpValue: 'username',
}),
include: Flags.boolean({
char: 'i',
summary: 'Include HTTP response status and headers in the output.',
default: false,
}),
method: Flags.custom<Method>({
method: Flags.option({
options: [
'GET',
'POST',
Expand All @@ -51,7 +49,7 @@ export class OrgApi extends SfCommand<void> {
'DELETE',
'OPTIONS',
'TRACE',
],
] as const,
summary: 'The HTTP method for the request.',
char: 'X',
default: 'GET',
Expand All @@ -62,8 +60,14 @@ export class OrgApi extends SfCommand<void> {
char: 'H',
multiple: true,
}),
body: Flags.file({
summary: 'The file to use as the body for the request.',
body: Flags.string({
summary:
'The file to use as the body for the request (use "-" to read from standard input).',
parse: async (input) => {
if (input === '-') return input;
await fileExists(input);
},
allowStdin: true,
helpValue: 'file',
}),
};
Expand Down Expand Up @@ -120,6 +124,7 @@ export class OrgApi extends SfCommand<void> {
? await readFile(flags.body)
: undefined,
throwHttpErrors: false,
followRedirect: true,
});

// Print HTTP response status and headers.
Expand Down
5 changes: 4 additions & 1 deletion test/commands/org/api.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import nock = require('nock');
import { TestContext, MockTestOrgData } from '@salesforce/core/lib/testSetup.js';
import {
TestContext,
MockTestOrgData,
} from '@salesforce/core/lib/testSetup.js';
import { SfError } from '@salesforce/core';
import { expect } from 'chai';
import stripAnsi from 'strip-ansi';
Expand Down
Loading

0 comments on commit 4280f15

Please sign in to comment.