Skip to content

Commit ce77180

Browse files
fix: parking orbit plugin-limits
1 parent 13b16b7 commit ce77180

File tree

6 files changed

+1758
-1203
lines changed

6 files changed

+1758
-1203
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "@salesforce/plugin-limits",
33
"description": "commands to display api limits to your org",
4-
"version": "1.3.0",
4+
"version": "2.0.0",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
7+
"main": "lib/index.js",
78
"dependencies": {
8-
"@oclif/config": "^1",
9-
"@salesforce/command": "^4.2.0",
10-
"@salesforce/core": "^2.31.0",
9+
"@oclif/core": "^1.6.3",
10+
"@salesforce/command": "^5.0.1",
11+
"@salesforce/core": "^3.10.1",
1112
"tslib": "^2"
1213
},
1314
"devDependencies": {

src/commands/force/limits/api/display.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@ export class LimitsApiDisplayCommand extends SfdxCommand {
4444
});
4545
});
4646

47-
this.ux.table(limits, {
48-
columns: [
49-
{ key: 'name', label: 'Name' },
50-
{ key: 'remaining', label: 'Remaining' },
51-
{ key: 'max', label: 'Max' },
52-
],
53-
});
47+
this.ux.table(limits, { name: { header: 'Name' }, remaining: { header: 'Remaining' }, max: { header: 'Max' } });
5448

5549
return limits;
5650
} catch (err) {

src/commands/force/limits/recordcounts/display.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ export class LimitsRecordCountsDisplayCommand extends SfdxCommand {
2626
public static readonly requiresUsername = true;
2727
public static readonly result: SfdxResult = {
2828
tableColumnData: {
29-
columns: [
30-
{ key: 'name', label: 'sObject' },
31-
{ key: 'count', label: 'Record Count' },
32-
],
29+
name: { header: 'sObject' },
30+
count: { header: 'Record Count' },
3331
},
3432
display() {
3533
if (Array.isArray(this.data) && this.data.length) {
@@ -51,7 +49,7 @@ export class LimitsRecordCountsDisplayCommand extends SfdxCommand {
5149
const sobjecttypeString = (this.flags.sobjecttype as string[]).join();
5250
const conn = this.org.getConnection();
5351
const geturl = `${conn.baseUrl()}/limits/recordCount?sObjects=${sobjecttypeString}`;
54-
const result = (await conn.request(geturl)) as unknown as Result;
52+
const result = await conn.request<Result>(geturl);
5553

5654
// if an object is requested, but there's 0 of them on the server, append that object to the result
5755
sobjecttypeString.split(',').forEach((name) => {

test/commands/display.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { $$, test, expect } from '@salesforce/command/lib/test';
99

1010
describe('force:limits:api:display', () => {
1111
async function prepareStubs() {
12-
$$.SANDBOX.stub(Org.prototype, 'getConnection').callsFake(() => Connection.prototype);
12+
$$.SANDBOX.stub(Org.prototype, 'getConnection').returns(Connection.prototype);
1313
$$.SANDBOX.stub(Connection.prototype, 'request').resolves({
1414
AnalyticsExternalDataSizeMB: {
1515
Max: 40960,

test/commands/recordcounts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { $$, test, expect } from '@salesforce/command/lib/test';
99

1010
describe('force:limits:recordcounts:display', () => {
1111
async function prepareStubs() {
12-
$$.SANDBOX.stub(Org.prototype, 'getConnection').callsFake(() => Connection.prototype);
12+
$$.SANDBOX.stub(Org.prototype, 'getConnection').returns(Connection.prototype);
1313
$$.SANDBOX.stub(Connection.prototype, 'request').resolves({
1414
sObjects: [
1515
{ count: 34, name: 'Account' },

0 commit comments

Comments
 (0)