sf-raven 1.2.0 → 1.2.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
@@ -1,28 +1,31 @@
1
- # sf-raven
2
-
3
- [![NPM](https://img.shields.io/npm/v/sf-raven.svg?label=sf-raven)](https://www.npmjs.com/package/sf-raven) [![Downloads/week](https://img.shields.io/npm/dw/sf-raven.svg)](https://npmjs.org/package/sf-raven) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/sf-raven/main/LICENSE.txt)
4
-
5
- A plugin for the Salesforce CLI built by Tom Carman.
6
-
7
- [sf-raven](https://github.com/tomcarman/sf-raven) now replaces [sfdx-raven](https://github.com/tomcarman/sfdx-raven/).
8
-
9
- ## Why a new plugin?
10
-
11
- I originally built [sfdx-raven](https://github.com/tomcarman/sfdx-raven/) in 2020, but the Salesforce CLI landscape has changed a lot since then. Rather than attempting to [migrate the original plugin from sfdx to sf](https://github.com/salesforcecli/cli/wiki/Migrate-Plugins-Built-for-sfdx), it felt cleaner to start a new project and leverage the new architecture and scaffolding tools that come with the new sf cli.
12
-
13
- ## Improvements over sfdx-raven
14
-
15
- - Built on [sf not sfdx](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_move_to_sf_v2.htm).
16
- - Uses the latest version of [oclif](https://oclif.io/blog/2022/01/12/announcing-oclif-v2/).
17
- - Commands now follow the [sf command structure](https://github.com/salesforcecli/cli/wiki/Design-Guidelines#Command-Structure) guidelines - `<topic> <action> <resource | sub-action> [flags]`. For example:
18
- - `info:fields` becomes `object display fields`
19
- - `utils:event:listen` becomes `event subscribe`
20
- - Code now meets ESlint rules for TypeScript, including the Salesforce CLI Plugin custom rules.
21
- - The [Salesforce tooling / documentation](https://github.com/salesforcecli/cli/wiki/Code-Your-Plugin) for building custom plugins has matured a lot over the past couple years, which will make it easier to update the plugin going forward.
22
-
23
- More commands will be ported/added over time - see [Todo](#Todo).
24
-
25
- ## Command Quick Reference
1
+ <div align="center">
2
+ <img src="media/logo/sf-raven-roundrect.png" width="300px" align="center" alt="sf raven logo" />
3
+ <br/><br/>
4
+ <b>Salesforce CLI plugin by @tomcarman</b>
5
+ <br/><br/>
6
+
7
+ [![NPM](https://img.shields.io/npm/v/sf-raven.svg?label=sf-raven)](https://www.npmjs.com/package/sf-raven) [![Downloads/week](https://img.shields.io/npm/dw/sf-raven.svg)](https://npmjs.org/package/sf-raven) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/sf-raven/main/LICENSE.txt)
8
+
9
+ </div>
10
+ </br>
11
+
12
+ ## Overview
13
+
14
+ * [Features](#features)
15
+ * [Install](#install)
16
+ * [Command Reference](#command-reference)
17
+ * [sf raven object display fields](#sf-raven-object-display-fields)
18
+ * [sf raven object display recordtypes](#sf-raven-object-display-recordtypes)
19
+ * [sf raven pull](#sf-raven-pull)
20
+ * [sf raven pull remote](#sf-raven-pull-remote)
21
+ * [sf raven deploy cancel](#sf-raven-deploy-cancel)
22
+ * [sf raven query ids](#sf-raven-query-ids)
23
+ * [sf raven audit display](#sf-raven-audit-display)
24
+ * [sf raven event subscribe](#sf-raven-event-subscribe)
25
+
26
+ </br>
27
+
28
+ ## Features
26
29
 
27
30
  Full details, usage, examples etc are further down, or can be accessed via `--help` on the commands.
28
31
 
@@ -41,12 +44,12 @@ Full details, usage, examples etc are further down, or can be accessed via `--he
41
44
  #### sf raven event
42
45
 
43
46
  - [sf raven event subscribe](#sf-raven-event-subscribe)
44
- - Subscribe to Platform Events.
47
+ - Subscribe to Platform Events, streamed to your terminal.
45
48
 
46
49
  #### sf raven deploy
47
50
 
48
51
  - [sf raven deploy cancel](#sf-raven-deploy-cancel)
49
- - Cancel a pending or in-progress Salesforce deploy.
52
+ - Query an org for pending or in progress Salesforce deployments, and cancel them.
50
53
 
51
54
  #### sf raven query
52
55
 
@@ -56,9 +59,9 @@ Full details, usage, examples etc are further down, or can be accessed via `--he
56
59
  #### sf raven pull
57
60
 
58
61
  - [sf raven pull](#sf-raven-pull)
59
- - Pull local Salesforce metadata paths into the project.
62
+ - Update Salesforce metadata into the local project via a fuzzy finder.
60
63
  - [sf raven pull remote](#sf-raven-pull-remote)
61
- - Pull Salesforce metadata that exists in the org but not locally.
64
+ - Retrieve Salesforce metadata that exists in the org but not locally, via a fuzzy finder.
62
65
 
63
66
  <!-- #### sfdx:raven:utils
64
67
  * [sfdx raven:utils:deploy:branch2org](#sfdx-ravenutilsdeploybranch2org)
@@ -68,7 +71,10 @@ Full details, usage, examples etc are further down, or can be accessed via `--he
68
71
  * [sfdx raven:utils:dashboarduser:update](#sfdx-ravenutilsdashboarduserupdate)
69
72
  * Change the running user of Dashboards -->
70
73
 
71
- ## Setup
74
+ ## Install
75
+
76
+ ### Dependencies
77
+ * [fzf](https://github.com/junegunn/fzf) is required for the [sf raven pull](#sf-raven-pull) commands, and should be available on your path. (IMO they are probably the most useful commands in this plugin, so its worth setting up fzf if you don't have it.)
72
78
 
73
79
  ### Quick Install
74
80
 
@@ -91,41 +97,26 @@ The plugin can be updated to the latest version using
91
97
  3. Install npm modules: `npm install`
92
98
  4. Link the plugin: `sfdx plugins:link .`
93
99
 
94
- ## Compatibility
100
+ ### Compatibility
95
101
 
96
102
  - **macOS**
97
103
  - Plugin has been built on macOS and will always run on macOS
98
104
 
99
- <!-- * **Windows**
100
- * Work on Windows 10 1803+ (this is that latest build I have access to)
101
- * Known Issues:
102
- * Emoji will not work in cmd.exe / powershell - so you may seem some funny characters when running the plugin - this can be ignored. Emoji may work in Windows Terminal, but I have not managed to test yet
103
- * I don't think 'diff' is available on windows cli, so `sfdx:raven:utils:diff` is not likely to work.
104
-
105
- * **Linux**
106
- * Only tested on an Ubuntu installation on [WSL](https://docs.microsoft.com/en-us/windows/wsl/about), but should work. -->
107
-
108
- ## Todo
109
105
 
110
- - Migrate remaining commands from [sfdx-raven](https://github.com/tomcarman/sfdx-raven/)
111
- - sfdx raven:utils:deploy:branch2org
112
- - sfdx raven:utils:diff
113
- - sfdx raven:utils:dashboarduser:update - tbc
114
- - Get the sObject Type for a given Id
115
- - Get the picklist values for a given picklist
116
- - Clone a record
106
+ ## Command Reference
117
107
 
118
- ## sf raven object display fields
108
+ ### sf raven object display fields
119
109
 
120
110
  Show field information for a given sObject.
121
111
 
122
112
  ```
123
113
  USAGE
124
- $ sf raven object display fields -o <value> -s <value> [--json]
114
+ $ sf raven object display fields -o <value> -s <value> [--json] [-c <value>]
125
115
 
126
116
  FLAGS
117
+ -c, --csv=<value> Path to write field information as CSV. When supplied, table output is suppressed.
127
118
  -o, --target-org=<value> (required) Login username or alias for the target org.
128
- -s, --sobject=<value> (required) The API name of the sObject that you want to view fields for.
119
+ -s, --sobject=<value> (required) The API name of the sObject that you want to view fields for. Use a comma-delimited list to query multiple objects.
129
120
 
130
121
  GLOBAL FLAGS
131
122
  --json Format output as json.
@@ -140,6 +131,10 @@ EXAMPLES
140
131
 
141
132
  $ sf raven object display fields --target-org dev --sobject My_Custom_Object__c
142
133
 
134
+ $ sf raven object display fields --target-org dev --sobject Account,Contact
135
+
136
+ $ sf raven object display fields --target-org dev --sobject Account --csv account-fields.csv
137
+
143
138
 
144
139
  OUTPUT
145
140
 
@@ -151,17 +146,18 @@ Annual Revenue AnnualRevenue Currency(18, 0)
151
146
  ...
152
147
  ```
153
148
 
154
- ## sf raven object display recordtypes
149
+ ### sf raven object display recordtypes
155
150
 
156
151
  Show RecordType information for a given sObject.
157
152
 
158
153
  ```
159
154
  USAGE
160
- $ sf raven object display recordtypes -o <value> -s <value> [--json]
155
+ $ sf raven object display recordtypes -o <value> -s <value> [--json] [-c <value>]
161
156
 
162
157
  FLAGS
158
+ -c, --csv=<value> Path to write Record Type information as CSV. When supplied, table output is suppressed.
163
159
  -o, --target-org=<value> (required) Login username or alias for the target org.
164
- -s, --sobject=<value> (required) The API name of the sObject that you want to view Record Types for.
160
+ -s, --sobject=<value> (required) The API name of the sObject that you want to view Record Types for. Use a comma-delimited list to query multiple objects.
165
161
 
166
162
  GLOBAL FLAGS
167
163
  --json Format output as json.
@@ -176,6 +172,10 @@ EXAMPLES
176
172
 
177
173
  $ sf raven object display recordtypes --target-org dev --sobject My_Custom_Object__c
178
174
 
175
+ $ sf raven object display recordtypes --target-org dev --sobject Account,Opportunity
176
+
177
+ $ sf raven object display recordtypes --target-org dev --sobject Account --csv account-record-types.csv
178
+
179
179
 
180
180
  OUTPUT
181
181
 
@@ -186,9 +186,9 @@ Person Account PersonAccount 0124J000000YYYYDEF
186
186
  ...
187
187
  ```
188
188
 
189
- ## sf raven pull
189
+ ### sf raven pull
190
190
 
191
- Pull Salesforce metadata into the local project.
191
+ Update Salesforce metadata into the local project via a fuzzy finder.
192
192
 
193
193
  ```
194
194
  USAGE
@@ -214,9 +214,9 @@ EXAMPLES
214
214
  $ sf raven pull --target-org dev --all
215
215
  ```
216
216
 
217
- ## sf raven pull remote
217
+ ### sf raven pull remote
218
218
 
219
- Pull Salesforce metadata that exists in the org but not locally.
219
+ Retrieve Salesforce metadata that exists in the org but not locally, via a fuzzy finder.
220
220
 
221
221
  ```
222
222
  USAGE
@@ -237,7 +237,7 @@ EXAMPLES
237
237
  $ sf raven pull remote --target-org dev
238
238
  ```
239
239
 
240
- ## sf raven deploy cancel
240
+ ### sf raven deploy cancel
241
241
 
242
242
  Cancel a pending or in-progress Salesforce deploy.
243
243
 
@@ -260,7 +260,7 @@ EXAMPLES
260
260
  $ sf raven deploy cancel --target-org dev
261
261
  ```
262
262
 
263
- ## sf raven query ids
263
+ ### sf raven query ids
264
264
 
265
265
  Run a SOQL query against a large list of Salesforce IDs.
266
266
 
@@ -292,7 +292,7 @@ EXAMPLES
292
292
  $ sf raven query ids --file account-ids.txt --query "SELECT Id, Name FROM Account WHERE Id IN {ids}" --csv results.csv
293
293
  ```
294
294
 
295
- ## sf raven audit display
295
+ ### sf raven audit display
296
296
 
297
297
  Show recent entries in the Setup Audit Trail.
298
298
 
@@ -332,9 +332,9 @@ Date Username Type Action
332
332
  ...
333
333
  ```
334
334
 
335
- ## sf raven event subscribe
335
+ ### sf raven event subscribe
336
336
 
337
- Subscribe to Platform Events.
337
+ Subscribe to Platform Events, streamed to your terminal.
338
338
 
339
339
  ```
340
340
  USAGE
@@ -381,7 +381,7 @@ OUTPUT
381
381
  }
382
382
  ```
383
383
 
384
- <!-- ## sfdx raven:utils:deploy:branch2org
384
+ <!-- ### sfdx raven:utils:deploy:branch2org
385
385
 
386
386
  Deploys a git branch to an org. Assumes you have git installed the neccessary access to the repo you are trying to clone (eg. you can run `git clone ...`), and that the branch is in a source-format sfdx project structure.
387
387
 
@@ -437,7 +437,7 @@ OUTPUT
437
437
  https://wise-hawk-22uzds-dev-ed.my.salesforce.com/lightning/setup/DeployStatus/page?address=%2Fchangemgmt%2FmonitorDeploymentsDetails.apexp%3FasyncId%3D0Af4K00000BHVuASAX
438
438
  ```
439
439
 
440
- ## sfdx raven:utils:diff
440
+ ### sfdx raven:utils:diff
441
441
 
442
442
  Allows you to quickly compare metadata of files between two orgs. Intended to be used for quick compares of single
443
443
  (or possibly a few) files of the same metadata type, rather than a full org compare (there are better tools for
@@ -501,7 +501,7 @@ OUTPUT
501
501
  <img width="795" alt="diff" src="https://user-images.githubusercontent.com/1554713/111902572-057edf80-8a36-11eb-8c45-56c09c290e89.png">
502
502
 
503
503
 
504
- ## sfdx raven:utils:dashboarduser:update
504
+ ### sfdx raven:utils:dashboarduser:update
505
505
 
506
506
  Updates the "Running User" of Dashboards from a given user, to an alternate given user. Useful for mass-updating Dashboards when a user is deactivated.
507
507
 
@@ -9,6 +9,7 @@ export default class ObjectDisplayFields extends SfCommand<ObjectDisplayFieldsRe
9
9
  static readonly flags: {
10
10
  'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
11
11
  sobject: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ csv: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  };
13
14
  run(): Promise<ObjectDisplayFieldsResult>;
14
15
  }
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { writeFileSync } from 'node:fs';
10
11
  import { SfCommand, Flags, Ux } from '@salesforce/sf-plugins-core';
11
12
  import { Messages } from '@salesforce/core';
12
13
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
@@ -14,31 +15,42 @@ const messages = Messages.loadMessages('sf-raven', 'raven.object.display.fields'
14
15
  class ObjectDisplayFields extends SfCommand {
15
16
  run() {
16
17
  return __awaiter(this, void 0, void 0, function* () {
17
- this.spinner.start('Loading...');
18
18
  const { flags } = yield this.parse(ObjectDisplayFields);
19
19
  const ux = new Ux({ jsonEnabled: this.jsonEnabled() });
20
20
  const org = flags['target-org'];
21
21
  const conn = org.getConnection();
22
- const query = `SELECT Label, QualifiedApiName, DataType FROM FieldDefinition WHERE EntityDefinition.QualifiedApiName = '${flags.sobject}' ORDER BY QualifiedApiName`;
23
- const result = (yield conn.query(query));
24
- this.spinner.stop();
25
- // Return table of fields
26
- ux.table(result.records, {
27
- label: {
28
- header: 'Name',
29
- get: (row) => row.Label,
30
- },
31
- qualifiedApiName: {
32
- header: 'Developer Name',
33
- get: (row) => row.QualifiedApiName,
34
- },
35
- dataType: {
36
- header: 'Type',
37
- get: (row) => row.DataType,
38
- },
39
- });
22
+ const sobjects = parseSobjects(flags.sobject);
23
+ const records = [];
24
+ this.spinner.start('Loading...');
25
+ try {
26
+ yield sobjects.reduce((previousQuery, sobject) => __awaiter(this, void 0, void 0, function* () {
27
+ yield previousQuery;
28
+ const query = `SELECT EntityDefinition.QualifiedApiName, Label, QualifiedApiName, DataType FROM FieldDefinition WHERE EntityDefinition.QualifiedApiName = '${sobject}' ORDER BY QualifiedApiName`;
29
+ const queryResult = (yield conn.query(query));
30
+ records.push(...queryResult.records);
31
+ }), Promise.resolve());
32
+ }
33
+ finally {
34
+ this.spinner.stop();
35
+ }
36
+ const result = {
37
+ totalSize: records.length,
38
+ done: true,
39
+ records,
40
+ };
41
+ const includeObjectColumn = sobjects.length > 1;
42
+ if (flags.csv) {
43
+ writeCsv(flags.csv, result.records, includeObjectColumn);
44
+ ux.log(messages.getMessage('info.csvWritten', [result.records.length.toString(), flags.csv]));
45
+ }
46
+ else {
47
+ // Return table of fields
48
+ ux.table(result.records, getTableColumns(includeObjectColumn));
49
+ }
40
50
  // Return url
41
- ux.log(`\n${conn.instanceUrl}/lightning/setup/ObjectManager/${flags.sobject}/FieldsAndRelationships/view`);
51
+ if (sobjects.length === 1) {
52
+ ux.log(`\n${conn.instanceUrl}/lightning/setup/ObjectManager/${sobjects[0]}/FieldsAndRelationships/view`);
53
+ }
42
54
  // Return an object to be displayed with --json
43
55
  return result;
44
56
  });
@@ -58,6 +70,56 @@ ObjectDisplayFields.flags = {
58
70
  char: 's',
59
71
  required: true,
60
72
  }),
73
+ csv: Flags.file({
74
+ summary: messages.getMessage('flags.csv.summary'),
75
+ char: 'c',
76
+ }),
61
77
  };
62
78
  export default ObjectDisplayFields;
79
+ const parseSobjects = (sobjectFlag) => {
80
+ const sobjects = sobjectFlag
81
+ .split(',')
82
+ .map((sobject) => sobject.trim())
83
+ .filter((sobject) => sobject.length > 0);
84
+ return Array.from(new Set(sobjects));
85
+ };
86
+ const getTableColumns = (includeObjectColumn) => (Object.assign(Object.assign({}, (includeObjectColumn
87
+ ? {
88
+ object: {
89
+ header: 'Object',
90
+ get: (row) => row.EntityDefinition.QualifiedApiName,
91
+ },
92
+ }
93
+ : {})), { label: {
94
+ header: 'Name',
95
+ get: (row) => row.Label,
96
+ }, qualifiedApiName: {
97
+ header: 'Developer Name',
98
+ get: (row) => row.QualifiedApiName,
99
+ }, dataType: {
100
+ header: 'Type',
101
+ get: (row) => row.DataType,
102
+ } }));
103
+ const writeCsv = (filePath, records, includeObjectColumn) => {
104
+ const columns = includeObjectColumn ? ['Object', 'Name', 'Developer Name', 'Type'] : ['Name', 'Developer Name', 'Type'];
105
+ const rows = [
106
+ columns.map(escapeCsvValue).join(','),
107
+ ...records.map((record) => (includeObjectColumn
108
+ ? [record.EntityDefinition.QualifiedApiName, record.Label, record.QualifiedApiName, record.DataType]
109
+ : [record.Label, record.QualifiedApiName, record.DataType])
110
+ .map(escapeCsvValue)
111
+ .join(',')),
112
+ ];
113
+ writeFileSync(filePath, `${rows.join('\n')}\n`, 'utf8');
114
+ };
115
+ const escapeCsvValue = (value) => {
116
+ if (value == null) {
117
+ return '';
118
+ }
119
+ const stringValue = String(value);
120
+ if (/[",\n\r]/.test(stringValue)) {
121
+ return `"${stringValue.replace(/"/g, '""')}"`;
122
+ }
123
+ return stringValue;
124
+ };
63
125
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../src/commands/raven/object/display/fields.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,6BAA6B,CAAC,CAAC;AAMlF,MAAqB,mBAAoB,SAAQ,SAAoC;IAkBtE,GAAG;;YACd,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAgBjC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACxD,MAAM,EAAE,GAAG,IAAI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CAAC,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,CAC3D;aACE,GAAG,CAAC,cAAc,CAAC;aACnB,IAAI,CAAC,GAAG,CAAC,CACb;KACF,CAAC;IAEF,aAAa,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAc,EAAU,EAAE;IAChD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAElC,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;IAChD,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC"}
@@ -9,6 +9,7 @@ export default class ObjectDisplayRecordtypes extends SfCommand<ObjectDisplayRec
9
9
  static readonly flags: {
10
10
  'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
11
11
  sobject: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ csv: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  };
13
14
  run(): Promise<ObjectDisplayRecordtypesResult>;
14
15
  }
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { writeFileSync } from 'node:fs';
10
11
  import { SfCommand, Flags, Ux } from '@salesforce/sf-plugins-core';
11
12
  import { Messages } from '@salesforce/core';
12
13
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
@@ -14,31 +15,42 @@ const messages = Messages.loadMessages('sf-raven', 'raven.object.display.recordt
14
15
  class ObjectDisplayRecordtypes extends SfCommand {
15
16
  run() {
16
17
  return __awaiter(this, void 0, void 0, function* () {
17
- this.spinner.start('Loading...');
18
18
  const { flags } = yield this.parse(ObjectDisplayRecordtypes);
19
19
  const ux = new Ux({ jsonEnabled: this.jsonEnabled() });
20
20
  const org = flags['target-org'];
21
21
  const conn = org.getConnection();
22
- const query = `SELECT Name, DeveloperName, Id FROM RecordType WHERE SObjectType = '${flags.sobject}'`;
23
- const result = (yield conn.query(query));
24
- this.spinner.stop();
25
- // Return table of fields
26
- ux.table(result.records, {
27
- label: {
28
- header: 'Name',
29
- get: (row) => row.Name,
30
- },
31
- qualifiedApiName: {
32
- header: 'Developer Name',
33
- get: (row) => row.DeveloperName,
34
- },
35
- dataType: {
36
- header: 'Id',
37
- get: (row) => row.Id,
38
- },
39
- });
22
+ const sobjects = parseSobjects(flags.sobject);
23
+ const records = [];
24
+ this.spinner.start('Loading...');
25
+ try {
26
+ yield sobjects.reduce((previousQuery, sobject) => __awaiter(this, void 0, void 0, function* () {
27
+ yield previousQuery;
28
+ const query = `SELECT SObjectType, Name, DeveloperName, Id FROM RecordType WHERE SObjectType = '${sobject}' ORDER BY DeveloperName`;
29
+ const queryResult = (yield conn.query(query));
30
+ records.push(...queryResult.records.map((record) => (Object.assign(Object.assign({}, record), { SObjectType: sobject }))));
31
+ }), Promise.resolve());
32
+ }
33
+ finally {
34
+ this.spinner.stop();
35
+ }
36
+ const result = {
37
+ totalSize: records.length,
38
+ done: true,
39
+ records,
40
+ };
41
+ const includeObjectColumn = sobjects.length > 1;
42
+ if (flags.csv) {
43
+ writeCsv(flags.csv, result.records, includeObjectColumn);
44
+ ux.log(messages.getMessage('info.csvWritten', [result.records.length.toString(), flags.csv]));
45
+ }
46
+ else {
47
+ // Return table of fields
48
+ ux.table(result.records, getTableColumns(includeObjectColumn));
49
+ }
40
50
  // Return url
41
- ux.log(`\n${conn.instanceUrl}/lightning/setup/ObjectManager/${flags.sobject}/RecordTypes/view`);
51
+ if (sobjects.length === 1) {
52
+ ux.log(`\n${conn.instanceUrl}/lightning/setup/ObjectManager/${sobjects[0]}/RecordTypes/view`);
53
+ }
42
54
  // Return an object to be displayed with --json
43
55
  return result;
44
56
  });
@@ -58,6 +70,56 @@ ObjectDisplayRecordtypes.flags = {
58
70
  char: 's',
59
71
  required: true,
60
72
  }),
73
+ csv: Flags.file({
74
+ summary: messages.getMessage('flags.csv.summary'),
75
+ char: 'c',
76
+ }),
61
77
  };
62
78
  export default ObjectDisplayRecordtypes;
79
+ const parseSobjects = (sobjectFlag) => {
80
+ const sobjects = sobjectFlag
81
+ .split(',')
82
+ .map((sobject) => sobject.trim())
83
+ .filter((sobject) => sobject.length > 0);
84
+ return Array.from(new Set(sobjects));
85
+ };
86
+ const getTableColumns = (includeObjectColumn) => (Object.assign(Object.assign({}, (includeObjectColumn
87
+ ? {
88
+ object: {
89
+ header: 'Object',
90
+ get: (row) => row.SObjectType,
91
+ },
92
+ }
93
+ : {})), { label: {
94
+ header: 'Name',
95
+ get: (row) => row.Name,
96
+ }, qualifiedApiName: {
97
+ header: 'Developer Name',
98
+ get: (row) => row.DeveloperName,
99
+ }, dataType: {
100
+ header: 'Id',
101
+ get: (row) => row.Id,
102
+ } }));
103
+ const writeCsv = (filePath, records, includeObjectColumn) => {
104
+ const columns = includeObjectColumn ? ['Object', 'Name', 'Developer Name', 'Id'] : ['Name', 'Developer Name', 'Id'];
105
+ const rows = [
106
+ columns.map(escapeCsvValue).join(','),
107
+ ...records.map((record) => (includeObjectColumn
108
+ ? [record.SObjectType, record.Name, record.DeveloperName, record.Id]
109
+ : [record.Name, record.DeveloperName, record.Id])
110
+ .map(escapeCsvValue)
111
+ .join(',')),
112
+ ];
113
+ writeFileSync(filePath, `${rows.join('\n')}\n`, 'utf8');
114
+ };
115
+ const escapeCsvValue = (value) => {
116
+ if (value == null) {
117
+ return '';
118
+ }
119
+ const stringValue = String(value);
120
+ if (/[",\n\r]/.test(stringValue)) {
121
+ return `"${stringValue.replace(/"/g, '""')}"`;
122
+ }
123
+ return stringValue;
124
+ };
63
125
  //# sourceMappingURL=recordtypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recordtypes.js","sourceRoot":"","sources":["../../../../../src/commands/raven/object/display/recordtypes.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,kCAAkC,CAAC,CAAC;AAMvF,MAAqB,wBAAyB,SAAQ,SAAyC;IAkBhF,GAAG;;YACd,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAgBjC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC7D,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YAEvD,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;YAChC,MAAM,IAAI,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC;YACjC,MAAM,KAAK,GAAG,uEAAuE,KAAK,CAAC,OAAO,GAAG,CAAC;YAEtG,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAgB,CAAC;YAExD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEpB,yBAAyB;YACzB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;gBACvB,K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G,MAAM,CAAC,KAAK,CAAC,CAAC;IAElC,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;IAChD,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC"}
@@ -12,10 +12,22 @@ Login username or alias for the target org.
12
12
 
13
13
  # flags.sobject.summary
14
14
 
15
- The API name of the sObject that you want to view fields for.
15
+ The API name of the sObject that you want to view fields for. Use a comma-delimited list to query multiple objects.
16
+
17
+ # flags.csv.summary
18
+
19
+ Path to write field information as CSV. When supplied, table output is suppressed.
20
+
21
+ # info.csvWritten
22
+
23
+ Wrote %s fields to %s.
16
24
 
17
25
  # examples
18
26
 
19
27
  - <%= config.bin %> <%= command.id %> --target-org dev --sobject Account
20
28
 
21
29
  - <%= config.bin %> <%= command.id %> --target-org dev --sobject My_Custom_Object\_\_c
30
+
31
+ - <%= config.bin %> <%= command.id %> --target-org dev --sobject Account,Contact
32
+
33
+ - <%= config.bin %> <%= command.id %> --target-org dev --sobject Account --csv account-fields.csv
@@ -12,10 +12,22 @@ Login username or alias for the target org.
12
12
 
13
13
  # flags.sobject.summary
14
14
 
15
- The API name of the sObject that you want to view Record Types for.
15
+ The API name of the sObject that you want to view Record Types for. Use a comma-delimited list to query multiple objects.
16
+
17
+ # flags.csv.summary
18
+
19
+ Path to write Record Type information as CSV. When supplied, table output is suppressed.
20
+
21
+ # info.csvWritten
22
+
23
+ Wrote %s Record Types to %s.
16
24
 
17
25
  # examples
18
26
 
19
27
  - <%= config.bin %> <%= command.id %> --target-org dev --sobject Account
20
28
 
21
29
  - <%= config.bin %> <%= command.id %> --target-org dev --sobject My_Custom_Object\_\_c
30
+
31
+ - <%= config.bin %> <%= command.id %> --target-org dev --sobject Account,Opportunity
32
+
33
+ - <%= config.bin %> <%= command.id %> --target-org dev --sobject Account --csv account-record-types.csv