Skip to content

Commit 3be9c54

Browse files
Revert "fix: parking orbit plugin-limits"
This reverts commit ce77180.
1 parent ce77180 commit 3be9c54

File tree

6 files changed

+1203
-1758
lines changed

6 files changed

+1203
-1758
lines changed

package.json

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

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

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

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

4955
return limits;
5056
} catch (err) {

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

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

5456
// if an object is requested, but there's 0 of them on the server, append that object to the result
5557
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').returns(Connection.prototype);
12+
$$.SANDBOX.stub(Org.prototype, 'getConnection').callsFake(() => 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').returns(Connection.prototype);
12+
$$.SANDBOX.stub(Org.prototype, 'getConnection').callsFake(() => Connection.prototype);
1313
$$.SANDBOX.stub(Connection.prototype, 'request').resolves({
1414
sObjects: [
1515
{ count: 34, name: 'Account' },

0 commit comments

Comments
 (0)