@salesforce/plugin-limits 2.3.41 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -70,20 +70,20 @@ sfdx plugins
70
70
 
71
71
  <!-- commands -->
72
72
 
73
- - [`sfdx limits:api:display`](#sfdx-limitsapidisplay)
74
- - [`sfdx limits:recordcounts:display`](#sfdx-limitsrecordcountsdisplay)
73
+ - [`sf org list limits`](#sf-org-list-limits)
74
+ - [`sf org list sobject record-counts`](#sf-org-list-sobject-record-counts)
75
75
 
76
- ## `sfdx limits:api:display`
76
+ ## `sf org list limits`
77
77
 
78
78
  Display information about limits in your org.
79
79
 
80
80
  ```
81
81
  USAGE
82
- $ sfdx limits:api:display -o <value> [--json] [--api-version <value>]
82
+ $ sf org list limits -o <value> [--json] [--api-version <value>]
83
83
 
84
84
  FLAGS
85
- -o, --target-org=<value> (required) Username or alias of the target org.
86
- --api-version=<value> Override the api version used for api requests made by this command
85
+ -o, --target-org=<value> (required) Username or alias of the target org.
86
+ --api-version=<value> Override the api version used for api requests made by this command
87
87
 
88
88
  GLOBAL FLAGS
89
89
  --json Format output as json.
@@ -96,33 +96,33 @@ DESCRIPTION
96
96
  https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm.
97
97
 
98
98
  ALIASES
99
- $ sfdx force:limits:api:display
100
- $ sfdx org:list:limits
99
+ $ sf force limits api display
100
+ $ sf limits api display
101
101
 
102
102
  EXAMPLES
103
103
  Display limits in your default org:
104
104
 
105
- $ sfdx limits:api:display
105
+ $ sf org list limits
106
106
 
107
107
  Display limits in the org with alias "my-scratch-org":
108
108
 
109
- $ sfdx limits:api:display --target-org my-scratch-org
109
+ $ sf org list limits --target-org my-scratch-org
110
110
  ```
111
111
 
112
- _See code: [src/commands/limits/api/display.ts](https://github.com/salesforcecli/plugin-limits/blob/2.3.41/src/commands/limits/api/display.ts)_
112
+ _See code: [src/commands/org/list/limits.ts](https://github.com/salesforcecli/plugin-limits/blob/3.0.2/src/commands/org/list/limits.ts)_
113
113
 
114
- ## `sfdx limits:recordcounts:display`
114
+ ## `sf org list sobject record-counts`
115
115
 
116
116
  Display record counts for the specified standard or custom objects.
117
117
 
118
118
  ```
119
119
  USAGE
120
- $ sfdx limits:recordcounts:display -o <value> [--json] [-s <value>] [--api-version <value>]
120
+ $ sf org list sobject record-counts -o <value> [--json] [-s <value>] [--api-version <value>]
121
121
 
122
122
  FLAGS
123
- -o, --target-org=<value> (required) Username or alias of the target org.
124
- -s, --sobject=<value>... [default: ] API name of the standard or custom object for which to display record counts.
125
- --api-version=<value> Override the api version used for api requests made by this command
123
+ -o, --target-org=<value> (required) Username or alias of the target org.
124
+ -s, --sobject=<value>... [default: ] API name of the standard or custom object for which to display record counts.
125
+ --api-version=<value> Override the api version used for api requests made by this command
126
126
 
127
127
  GLOBAL FLAGS
128
128
  --json Format output as json.
@@ -136,23 +136,23 @@ DESCRIPTION
136
136
  available record counts, run the command without the --sobject flag.
137
137
 
138
138
  ALIASES
139
- $ sfdx force:limits:recordcounts:display
140
- $ sfdx org:list:sobject:record-counts
139
+ $ sf force limits recordcounts display
140
+ $ sf limits recordcounts display
141
141
 
142
142
  EXAMPLES
143
143
  Display all available record counts in your default org:
144
144
 
145
- $ sfdx limits:recordcounts:display
145
+ $ sf org list sobject record-counts
146
146
 
147
147
  Display record counts for the Account, Contact, Lead, and Opportunity objects in your default org:
148
148
 
149
- $ sfdx limits:recordcounts:display --sobject Account --sobject Contact --sobject Lead --sobject Opportunity
149
+ $ sf org list sobject record-counts --sobject Account --sobject Contact --sobject Lead --sobject Opportunity
150
150
 
151
151
  Display record counts for the Account and Lead objects for the org with alias "my-scratch-org":
152
152
 
153
- $ sfdx limits:recordcounts:display --sobject Account --sobject Lead --target-org my-scratch-org
153
+ $ sf org list sobject record-counts --sobject Account --sobject Lead --target-org my-scratch-org
154
154
  ```
155
155
 
156
- _See code: [src/commands/limits/recordcounts/display.ts](https://github.com/salesforcecli/plugin-limits/blob/2.3.41/src/commands/limits/recordcounts/display.ts)_
156
+ _See code: [src/commands/org/list/sobject/record-counts.ts](https://github.com/salesforcecli/plugin-limits/blob/3.0.2/src/commands/org/list/sobject/record-counts.ts)_
157
157
 
158
158
  <!-- commandsstop -->
@@ -0,0 +1,20 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ type ApiLimit = {
3
+ name: string;
4
+ max: number;
5
+ remaining: number;
6
+ };
7
+ export type ApiLimits = ApiLimit[];
8
+ export declare class LimitsApiDisplayCommand extends SfCommand<ApiLimits> {
9
+ static readonly aliases: string[];
10
+ static readonly summary: string;
11
+ static readonly description: string;
12
+ static readonly examples: string[];
13
+ static readonly flags: {
14
+ 'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
+ 'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
16
+ loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
17
+ };
18
+ run(): Promise<ApiLimits>;
19
+ }
20
+ export {};
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Copyright (c) 2020, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { dirname } from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+ import { Messages, SfError } from '@salesforce/core';
10
+ import { SfCommand, orgApiVersionFlagWithDeprecations, loglevel, requiredOrgFlagWithDeprecations, } from '@salesforce/sf-plugins-core';
11
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12
+ const messages = Messages.loadMessages('@salesforce/plugin-limits', 'display');
13
+ export class LimitsApiDisplayCommand extends SfCommand {
14
+ static aliases = ['force:limits:api:display', 'limits:api:display'];
15
+ static summary = messages.getMessage('summary');
16
+ static description = messages.getMessage('description');
17
+ static examples = messages.getMessages('examples');
18
+ static flags = {
19
+ 'target-org': requiredOrgFlagWithDeprecations,
20
+ 'api-version': orgApiVersionFlagWithDeprecations,
21
+ loglevel,
22
+ };
23
+ async run() {
24
+ try {
25
+ const { flags } = await this.parse(LimitsApiDisplayCommand);
26
+ const conn = flags['target-org'].getConnection(flags['api-version']);
27
+ const result = await conn.request('/limits');
28
+ const limits = Object.entries(result).map(([name, { Max, Remaining }]) => ({
29
+ name,
30
+ max: Max,
31
+ remaining: Remaining,
32
+ }));
33
+ this.table(limits, { name: { header: 'Name' }, remaining: { header: 'Remaining' }, max: { header: 'Max' } });
34
+ return limits;
35
+ }
36
+ catch (err) {
37
+ if (err instanceof Error || typeof err === 'string') {
38
+ throw SfError.wrap(err);
39
+ }
40
+ throw err;
41
+ }
42
+ }
43
+ }
44
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../../src/commands/org/list/limits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,SAAS,EACT,iCAAiC,EACjC,QAAQ,EACR,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAAC;AAiB/E,MAAM,OAAO,uBAAwB,SAAQ,S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,YAAY,KAAK,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBACnD,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACzB;YACD,MAAM,GAAG,CAAC;SACX;IACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type RecordCount = {
3
+ name: string;
4
+ count: number;
5
+ };
6
+ export type RecordCounts = RecordCount[];
7
+ export declare class LimitsRecordCountsDisplayCommand extends SfCommand<RecordCounts> {
8
+ static readonly aliases: string[];
9
+ static readonly summary: string;
10
+ static readonly description: string;
11
+ static readonly examples: string[];
12
+ static readonly flags: {
13
+ sobject: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
+ 'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
+ 'api-version': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
16
+ loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
17
+ };
18
+ run(): Promise<RecordCounts>;
19
+ }
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Copyright (c) 2020, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { dirname } from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+ import { Messages, SfError } from '@salesforce/core';
10
+ import { arrayWithDeprecation, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core';
11
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12
+ const messages = Messages.loadMessages('@salesforce/plugin-limits', 'recordcounts');
13
+ export class LimitsRecordCountsDisplayCommand extends SfCommand {
14
+ static aliases = ['force:limits:recordcounts:display', 'limits:recordcounts:display'];
15
+ static summary = messages.getMessage('summary');
16
+ static description = messages.getMessage('description');
17
+ static examples = messages.getMessages('examples');
18
+ static flags = {
19
+ sobject: arrayWithDeprecation({
20
+ char: 's',
21
+ summary: messages.getMessage('flags.sobject.summary'),
22
+ aliases: ['sobjecttype'],
23
+ default: [],
24
+ }),
25
+ 'target-org': requiredOrgFlagWithDeprecations,
26
+ 'api-version': orgApiVersionFlagWithDeprecations,
27
+ loglevel,
28
+ };
29
+ async run() {
30
+ try {
31
+ const { flags } = await this.parse(LimitsRecordCountsDisplayCommand);
32
+ const conn = flags['target-org'].getConnection(flags['api-version']);
33
+ const sobjectsQuery = flags.sobject.length > 0 ? `=${flags.sobject.join()}` : '';
34
+ const geturl = `/limits/recordCount?sObjects${sobjectsQuery}`;
35
+ const result = await conn.request(geturl);
36
+ const recordCounts = result.sObjects
37
+ .filter((record) => (flags.sobject.length > 0 ? flags.sobject.includes(record.name) : result.sObjects))
38
+ .sort((a, b) => a.name.localeCompare(b.name));
39
+ this.table(recordCounts, {
40
+ name: { header: 'sObject' },
41
+ count: { header: 'Record Count' },
42
+ });
43
+ return recordCounts;
44
+ }
45
+ catch (err) {
46
+ if (err instanceof Error || typeof err === 'string') {
47
+ throw SfError.wrap(err);
48
+ }
49
+ throw err;
50
+ }
51
+ }
52
+ }
53
+ //# sourceMappingURL=record-counts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-counts.js","sourceRoot":"","sources":["../../../../../src/commands/org/list/sobject/record-counts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACr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C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjF,MAAM,MAAM,GAAG,+BAA+B,aAAa,EAAE,CAAC;YAC9D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAS,MAAM,CAAC,CAAC;YAElD,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ;iBACjC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;iBACtG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAEhD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;gBACvB,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;gBAC3B,KAAK,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE;aAClC,CAAC,CAAC;YACH,OAAO,YAAY,CAAC;SACrB;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,KAAK,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBACnD,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACzB;YACD,MAAM,GAAG,CAAC;SACX;IACH,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  declare const _default: {};
2
- export = _default;
2
+ export default _default;
package/lib/index.js CHANGED
@@ -1,9 +1,8 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2020, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- module.exports = {};
7
+ export default {};
9
8
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,iBAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,EAAE,CAAC"}
@@ -15,7 +15,3 @@ For each limit, this command returns the maximum allocation and the remaining al
15
15
  - Display limits in the org with alias "my-scratch-org":
16
16
 
17
17
  <%= config.bin %> <%= command.id %> --target-org my-scratch-org
18
-
19
- # targetOrg
20
-
21
- Login username or alias for the target org.
@@ -20,10 +20,6 @@ Use this command to get an approximate count of the records in standard or custo
20
20
 
21
21
  <%= config.bin %> <%= command.id %> --sobject Account --sobject Lead --target-org my-scratch-org
22
22
 
23
- # sobjectFlagDescription
23
+ # flags.sobject.summary
24
24
 
25
25
  API name of the standard or custom object for which to display record counts.
26
-
27
- # targetOrg
28
-
29
- Login username or alias for the target org.