Skip to content

Commit c2977fc

Browse files
Merge pull request #1026 from salesforcecli/updateTable
fix: update dependency and new table format
2 parents 671d501 + 3a11f3a commit c2977fc

File tree

6 files changed

+287
-16
lines changed

6 files changed

+287
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
88
"@salesforce/core": "^8.5.7",
9-
"@salesforce/sf-plugins-core": "^11.3.12"
9+
"@salesforce/sf-plugins-core": "^12.0.4"
1010
},
1111
"devDependencies": {
1212
"@oclif/core": "^4.0.29",

src/commands/org/list/limits.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Result = {
2727
Max: number;
2828
Remaining: number;
2929
};
30-
}
30+
};
3131

3232
export type ApiLimits = ApiLimit[];
3333

@@ -54,7 +54,10 @@ export class LimitsApiDisplayCommand extends SfCommand<ApiLimits> {
5454
remaining: Remaining,
5555
}));
5656

57-
this.table(limits, { name: { header: 'Name' }, remaining: { header: 'Remaining' }, max: { header: 'Max' } });
57+
this.table({
58+
data: limits,
59+
columns: ['name', 'remaining', 'max'],
60+
});
5861

5962
return limits;
6063
} catch (err) {

src/commands/org/list/sobject/record-counts.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type RecordCounts = RecordCount[];
2626

2727
type Result = {
2828
sObjects: RecordCounts;
29-
}
29+
};
3030

3131
export class LimitsRecordCountsDisplayCommand extends SfCommand<RecordCounts> {
3232
public static readonly aliases = ['force:limits:recordcounts:display', 'limits:recordcounts:display'];
@@ -59,10 +59,20 @@ export class LimitsRecordCountsDisplayCommand extends SfCommand<RecordCounts> {
5959
.filter((record) => (flags.sobject.length > 0 ? flags.sobject.includes(record.name) : result.sObjects))
6060
.sort((a, b) => a.name.localeCompare(b.name));
6161

62-
this.table(recordCounts, {
63-
name: { header: 'sObject' },
64-
count: { header: 'Record Count' },
62+
this.table({
63+
data: recordCounts,
64+
columns: [
65+
{
66+
key: 'name',
67+
name: 'sObject',
68+
},
69+
{
70+
key: 'count',
71+
name: 'Record Count',
72+
},
73+
],
6574
});
75+
6676
return recordCounts;
6777
} catch (err) {
6878
if (err instanceof Error || typeof err === 'string') {

test/commands/display.nut.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ describe('Limits display', () => {
2929
});
3030

3131
it('Displays the limits (json)', () => {
32-
const output = execCmd<ListApiDisplayOutput>(`limits:api:display -u ${username} --json`, {
32+
const output = execCmd<ListApiDisplayOutput>(`org:list:limits -o ${username} --json`, {
3333
ensureExitCode: 0,
3434
}).jsonOutput;
3535
expect(output?.result).length.greaterThan(0);
3636
expect(output?.status).to.equal(0);
3737
});
3838

3939
it('Displays the limits (human readable)', () => {
40-
const command = `limits:api:display -u ${username}`;
40+
const command = `org:list:limits -o ${username}`;
4141
const result = execCmd(command, { ensureExitCode: 0 });
4242
const output = getString(result, 'shellOutput.stdout');
4343
expect(output).to.include('ActiveScratchOrgs');

test/commands/recordcounts.nut.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('recordcounts:display', () => {
2525
});
2626

2727
it('Displays the records (json)', () => {
28-
const output = execCmd<RecordCount[]>(`limits:recordcounts:display -s Account,Contact -u ${username} --json`, {
28+
const output = execCmd<RecordCount[]>(`org list sobject record-counts -s Account,Contact -o ${username} --json`, {
2929
ensureExitCode: 0,
3030
}).jsonOutput;
3131
expect(output?.result).length.greaterThan(0);
@@ -36,7 +36,7 @@ describe('recordcounts:display', () => {
3636
});
3737

3838
it('Displays all records (json)', () => {
39-
const output = execCmd<RecordCount[]>(`limits:recordcounts:display -u ${username} --json`, {
39+
const output = execCmd<RecordCount[]>(`org list sobject record-counts -o ${username} --json`, {
4040
ensureExitCode: 0,
4141
}).jsonOutput;
4242

@@ -45,7 +45,7 @@ describe('recordcounts:display', () => {
4545
});
4646

4747
it('Displays the records (human readable)', () => {
48-
const command = `limits:recordcounts:display -s Account -u ${username}`;
48+
const command = `org list sobject record-counts -s Account -o ${username}`;
4949
const result = execCmd(command, { ensureExitCode: 0 });
5050
const output = getString(result, 'shellOutput.stdout');
5151
expect(output).to.include('Account');

0 commit comments

Comments
 (0)