sf-raven 1.0.6 → 1.1.0
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 +59 -1
- package/bin/dev.js +8 -0
- package/lib/commands/raven/audit/display.d.ts +3 -3
- package/lib/commands/raven/audit/display.js +62 -53
- package/lib/commands/raven/audit/display.js.map +1 -1
- package/lib/commands/raven/event/subscribe.d.ts +4 -4
- package/lib/commands/raven/event/subscribe.js +52 -43
- package/lib/commands/raven/event/subscribe.js.map +1 -1
- package/lib/commands/raven/object/display/fields.d.ts +2 -2
- package/lib/commands/raven/object/display/fields.js +46 -37
- package/lib/commands/raven/object/display/fields.js.map +1 -1
- package/lib/commands/raven/object/display/recordtypes.d.ts +2 -2
- package/lib/commands/raven/object/display/recordtypes.js +46 -37
- package/lib/commands/raven/object/display/recordtypes.js.map +1 -1
- package/lib/commands/raven/pull/remote.d.ts +14 -0
- package/lib/commands/raven/pull/remote.js +64 -0
- package/lib/commands/raven/pull/remote.js.map +1 -0
- package/lib/commands/raven/pull.d.ts +15 -0
- package/lib/commands/raven/pull.js +64 -0
- package/lib/commands/raven/pull.js.map +1 -0
- package/lib/commands/raven/query.d.ts +22 -0
- package/lib/commands/raven/query.js +115 -0
- package/lib/commands/raven/query.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/shared/pull.d.ts +10 -0
- package/lib/shared/pull.js +242 -0
- package/lib/shared/pull.js.map +1 -0
- package/messages/raven.pull.md +57 -0
- package/messages/raven.pull.remote.md +45 -0
- package/messages/raven.query.md +59 -0
- package/oclif.lock +7713 -0
- package/oclif.manifest.json +412 -87
- package/package.json +29 -39
package/README.md
CHANGED
|
@@ -43,6 +43,13 @@ Full details, usage, examples etc are further down, or can be accessed via `--he
|
|
|
43
43
|
- [sf raven event subscribe](#sf-raven-event-subscribe)
|
|
44
44
|
- Subscribe to Platform Events.
|
|
45
45
|
|
|
46
|
+
#### sf raven pull
|
|
47
|
+
|
|
48
|
+
- [sf raven pull](#sf-raven-pull)
|
|
49
|
+
- Pull local Salesforce metadata paths into the project.
|
|
50
|
+
- [sf raven pull remote](#sf-raven-pull-remote)
|
|
51
|
+
- Pull Salesforce metadata that exists in the org but not locally.
|
|
52
|
+
|
|
46
53
|
<!-- #### sfdx:raven:utils
|
|
47
54
|
* [sfdx raven:utils:deploy:branch2org](#sfdx-ravenutilsdeploybranch2org)
|
|
48
55
|
* Deploy a git branch to an org
|
|
@@ -55,7 +62,7 @@ Full details, usage, examples etc are further down, or can be accessed via `--he
|
|
|
55
62
|
|
|
56
63
|
### Quick Install
|
|
57
64
|
|
|
58
|
-
Assuming you already have the [
|
|
65
|
+
Assuming you already have the [sf cli](https://developer.salesforce.com/tools/salesforcecli) installed, the plugin can be installed by running:
|
|
59
66
|
|
|
60
67
|
`sf plugins install sf-raven`
|
|
61
68
|
|
|
@@ -169,6 +176,57 @@ Person Account PersonAccount 0124J000000YYYYDEF
|
|
|
169
176
|
...
|
|
170
177
|
```
|
|
171
178
|
|
|
179
|
+
## sf raven pull
|
|
180
|
+
|
|
181
|
+
Pull Salesforce metadata into the local project.
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
USAGE
|
|
185
|
+
$ sf raven pull [--json] [-o <value>] [-a]
|
|
186
|
+
|
|
187
|
+
FLAGS
|
|
188
|
+
-a, --all Retrieve all local package directories instead of selecting a path with fzf.
|
|
189
|
+
-o, --target-org=<value> Login username or alias for the target org. Uses the default org when omitted.
|
|
190
|
+
|
|
191
|
+
GLOBAL FLAGS
|
|
192
|
+
--json Format output as json.
|
|
193
|
+
|
|
194
|
+
DESCRIPTION
|
|
195
|
+
Refresh local Salesforce metadata from an authenticated org. Without --all, local metadata paths are loaded into fzf so you can choose one or more files or directories to retrieve. Press Tab to select multiple paths, then Enter to retrieve them together. With --all, each package directory from sfdx-project.json is retrieved.
|
|
196
|
+
|
|
197
|
+
EXAMPLES
|
|
198
|
+
$ sf raven pull
|
|
199
|
+
|
|
200
|
+
$ sf raven pull --target-org dev
|
|
201
|
+
|
|
202
|
+
$ sf raven pull --all
|
|
203
|
+
|
|
204
|
+
$ sf raven pull --target-org dev --all
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## sf raven pull remote
|
|
208
|
+
|
|
209
|
+
Pull Salesforce metadata that exists in the org but not locally.
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
USAGE
|
|
213
|
+
$ sf raven pull remote [--json] [-o <value>]
|
|
214
|
+
|
|
215
|
+
FLAGS
|
|
216
|
+
-o, --target-org=<value> Login username or alias for the target org. Uses the default org when omitted.
|
|
217
|
+
|
|
218
|
+
GLOBAL FLAGS
|
|
219
|
+
--json Format output as json.
|
|
220
|
+
|
|
221
|
+
DESCRIPTION
|
|
222
|
+
List supported metadata components that exist in the target org but are not present in the local project. Org-only components are prefixed with a cloud marker in fzf. Press Tab to select multiple components, then Enter to retrieve them.
|
|
223
|
+
|
|
224
|
+
EXAMPLES
|
|
225
|
+
$ sf raven pull remote
|
|
226
|
+
|
|
227
|
+
$ sf raven pull remote --target-org dev
|
|
228
|
+
```
|
|
229
|
+
|
|
172
230
|
## sf raven audit display
|
|
173
231
|
|
|
174
232
|
Show recent entries in the Setup Audit Trail.
|
package/bin/dev.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
|
|
2
|
+
// eslint-disable-next-line node/shebang
|
|
3
|
+
async function main() {
|
|
4
|
+
const { execute } = await import('@oclif/core');
|
|
5
|
+
await execute({ development: true, dir: import.meta.url });
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
await main();
|
|
@@ -7,9 +7,9 @@ export default class AuditDisplay extends SfCommand<AuditDisplayResult> {
|
|
|
7
7
|
static readonly description: string;
|
|
8
8
|
static readonly examples: string[];
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
'target-org': import("@oclif/core/
|
|
11
|
-
username: import("@oclif/core/
|
|
12
|
-
limit: import("@oclif/core/
|
|
10
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
username: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<AuditDisplayResult>;
|
|
15
15
|
}
|
|
@@ -1,78 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { SfCommand, Flags, Ux } from '@salesforce/sf-plugins-core';
|
|
11
|
+
import { Messages } from '@salesforce/core';
|
|
12
|
+
import dayjs from 'dayjs';
|
|
13
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
14
|
+
const messages = Messages.loadMessages('sf-raven', 'raven.audit.display');
|
|
15
|
+
class AuditDisplay extends SfCommand {
|
|
16
|
+
run() {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
this.spinner.start('Loading...');
|
|
19
|
+
const { flags } = yield this.parse(AuditDisplay);
|
|
20
|
+
const ux = new Ux({ jsonEnabled: this.jsonEnabled() });
|
|
21
|
+
const org = flags['target-org'];
|
|
22
|
+
const conn = org.getConnection();
|
|
23
|
+
let query = '';
|
|
24
|
+
if (flags.username) {
|
|
25
|
+
query = `SELECT CreatedDate, CreatedBy.Username,
|
|
18
26
|
Section, Display, DelegateUser
|
|
19
27
|
FROM SetupAuditTrail
|
|
20
28
|
WHERE CreatedBy.Username = '${flags.username}'
|
|
21
29
|
ORDER BY CreatedDate DESC
|
|
22
30
|
LIMIT ${flags.limit}`;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
query = `SELECT CreatedDate, CreatedBy.Username,
|
|
26
34
|
Section, Display, DelegateUser
|
|
27
35
|
FROM SetupAuditTrail
|
|
28
36
|
ORDER BY CreatedDate DESC
|
|
29
37
|
LIMIT ${flags.limit}`;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
}
|
|
39
|
+
const result = (yield conn.query(query));
|
|
40
|
+
result.records.forEach((record) => {
|
|
41
|
+
record.CreatedDate = dayjs(record.CreatedDate).format('YYYY-MM-DD HH:mm:ss');
|
|
42
|
+
});
|
|
43
|
+
this.spinner.stop();
|
|
44
|
+
// Return table of fields
|
|
45
|
+
ux.table(result.records, {
|
|
46
|
+
createdDate: {
|
|
47
|
+
header: 'Date',
|
|
48
|
+
get: (row) => row.CreatedDate,
|
|
49
|
+
},
|
|
50
|
+
createdBy: {
|
|
51
|
+
header: 'Username',
|
|
52
|
+
get: (row) => { var _a; return (_a = row.CreatedBy) === null || _a === void 0 ? void 0 : _a.Username; },
|
|
53
|
+
},
|
|
54
|
+
section: {
|
|
55
|
+
header: 'Type',
|
|
56
|
+
get: (row) => row.Section,
|
|
57
|
+
},
|
|
58
|
+
display: {
|
|
59
|
+
header: 'Action',
|
|
60
|
+
get: (row) => row.Display,
|
|
61
|
+
},
|
|
62
|
+
delegateUser: {
|
|
63
|
+
header: 'Delegate User',
|
|
64
|
+
get: (row) => row.DelegateUser,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
return result;
|
|
58
68
|
});
|
|
59
|
-
return result;
|
|
60
69
|
}
|
|
61
70
|
}
|
|
62
71
|
AuditDisplay.summary = messages.getMessage('summary');
|
|
63
72
|
AuditDisplay.description = messages.getMessage('description');
|
|
64
73
|
AuditDisplay.examples = messages.getMessages('examples');
|
|
65
74
|
AuditDisplay.flags = {
|
|
66
|
-
'target-org':
|
|
75
|
+
'target-org': Flags.requiredOrg({
|
|
67
76
|
summary: messages.getMessage('flags.target-org.summary'),
|
|
68
77
|
char: 'o',
|
|
69
78
|
required: true,
|
|
70
79
|
}),
|
|
71
|
-
username:
|
|
80
|
+
username: Flags.string({
|
|
72
81
|
summary: messages.getMessage('flags.username.summary'),
|
|
73
82
|
char: 'u',
|
|
74
83
|
}),
|
|
75
|
-
limit:
|
|
84
|
+
limit: Flags.integer({
|
|
76
85
|
summary: messages.getMessage('flags.limit.summary'),
|
|
77
86
|
char: 'l',
|
|
78
87
|
min: 1,
|
|
@@ -80,5 +89,5 @@ AuditDisplay.flags = {
|
|
|
80
89
|
default: 20,
|
|
81
90
|
}),
|
|
82
91
|
};
|
|
83
|
-
|
|
92
|
+
export default AuditDisplay;
|
|
84
93
|
//# sourceMappingURL=display.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/commands/raven/audit/display.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/commands/raven/audit/display.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC;AAM1E,MAAqB,YAAa,SAAQ,SAA6B;IAwBxD,GAAG;;YACd,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAoBjC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YACjD,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,IAAI,KAAK,GAAG,EAAE,CAAC;YAEf,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACnB,KAAK,GAAG;;;8CAGgC,KAAK,CAAC,QAAQ;;wBAEpC,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG;;;;wBAIU,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,CAAC;YAED,MAAM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AAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,kBAAK,GAAG;IAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC;QAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACtD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;QACnB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC;QACnD,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,IAAI;QACT,OAAO,EAAE,EAAE;KACZ,CAAC;CACH,CAAC;eAtBiB,YAAY"}
|
|
@@ -7,10 +7,10 @@ export default class EventSubscribe extends SfCommand<EventSubscribeResult> {
|
|
|
7
7
|
static readonly description: string;
|
|
8
8
|
static readonly examples: string[];
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
'target-org': import("@oclif/core/
|
|
11
|
-
event: import("@oclif/core/
|
|
12
|
-
replayid: import("@oclif/core/
|
|
13
|
-
timeout: import("@oclif/core/
|
|
10
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
event: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
replayid: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
};
|
|
15
15
|
run(): Promise<EventSubscribeResult>;
|
|
16
16
|
}
|
|
@@ -1,65 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { SfCommand, Flags, Ux } from '@salesforce/sf-plugins-core';
|
|
11
|
+
import { Messages, StreamingClient } from '@salesforce/core';
|
|
12
|
+
import { Duration } from '@salesforce/kit';
|
|
13
|
+
import * as emoji from 'node-emoji';
|
|
14
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
|
+
const messages = Messages.loadMessages('sf-raven', 'raven.event.subscribe');
|
|
16
|
+
class EventSubscribe extends SfCommand {
|
|
17
|
+
run() {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { flags } = yield this.parse(EventSubscribe);
|
|
20
|
+
const ux = new Ux({ jsonEnabled: this.jsonEnabled() });
|
|
21
|
+
// Set up stream client and stream processor
|
|
22
|
+
ux.spinner.start(`${emoji.get('electric_plug')} Connecting to org`);
|
|
23
|
+
const streamProcessor = (message) => {
|
|
24
|
+
ux.log(JSON.stringify(message, null, 2) + '\n');
|
|
25
|
+
return {
|
|
26
|
+
completed: false,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const options = new StreamingClient.DefaultOptions(flags['target-org'], flags.event, streamProcessor);
|
|
30
|
+
if (flags.timeout != null) {
|
|
31
|
+
options.setSubscribeTimeout(Duration.minutes(flags.timeout));
|
|
32
|
+
}
|
|
33
|
+
// Connect to the org
|
|
34
|
+
const asyncStatusClient = yield StreamingClient.create(options);
|
|
35
|
+
yield asyncStatusClient.handshake();
|
|
36
|
+
ux.spinner.stop();
|
|
37
|
+
// Set the relay id if one has been supplied
|
|
38
|
+
if (flags.replayid != null) {
|
|
39
|
+
ux.log(`${emoji.get('leftwards_arrow_with_hook')} Replaying from ${flags.replayid}`);
|
|
40
|
+
asyncStatusClient.replay(flags.replayid);
|
|
41
|
+
}
|
|
42
|
+
// Start listening for events
|
|
43
|
+
ux.log(`${emoji.get('ear')} Listening for events...\n`);
|
|
44
|
+
yield asyncStatusClient.subscribe(() => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
// Nothing to do
|
|
46
|
+
}));
|
|
17
47
|
return {
|
|
18
|
-
|
|
48
|
+
status: 'Exiting',
|
|
19
49
|
};
|
|
20
|
-
};
|
|
21
|
-
const options = new core_1.StreamingClient.DefaultOptions(flags['target-org'], flags.event, streamProcessor);
|
|
22
|
-
if (flags.timeout != null) {
|
|
23
|
-
options.setSubscribeTimeout(lib_1.Duration.minutes(flags.timeout));
|
|
24
|
-
}
|
|
25
|
-
// Connect to the org
|
|
26
|
-
const asyncStatusClient = await core_1.StreamingClient.create(options);
|
|
27
|
-
await asyncStatusClient.handshake();
|
|
28
|
-
ux.spinner.stop();
|
|
29
|
-
// Set the relay id if one has been supplied
|
|
30
|
-
if (flags.replayid != null) {
|
|
31
|
-
ux.log(`${emoji.get('leftwards_arrow_with_hook')} Replaying from ${flags.replayid}`);
|
|
32
|
-
asyncStatusClient.replay(flags.replayid);
|
|
33
|
-
}
|
|
34
|
-
// Start listening for events
|
|
35
|
-
ux.log(`${emoji.get('ear')} Listening for events...\n`);
|
|
36
|
-
await asyncStatusClient.subscribe(async () => {
|
|
37
|
-
// Nothing to do
|
|
38
50
|
});
|
|
39
|
-
return {
|
|
40
|
-
status: 'Exiting',
|
|
41
|
-
};
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
EventSubscribe.summary = messages.getMessage('summary');
|
|
45
54
|
EventSubscribe.description = messages.getMessage('description');
|
|
46
55
|
EventSubscribe.examples = messages.getMessages('examples');
|
|
47
56
|
EventSubscribe.flags = {
|
|
48
|
-
'target-org':
|
|
57
|
+
'target-org': Flags.requiredOrg({
|
|
49
58
|
summary: messages.getMessage('flags.target-org.summary'),
|
|
50
59
|
char: 'o',
|
|
51
60
|
required: true,
|
|
52
61
|
}),
|
|
53
|
-
event:
|
|
62
|
+
event: Flags.string({
|
|
54
63
|
summary: messages.getMessage('flags.event.summary'),
|
|
55
64
|
char: 'e',
|
|
56
65
|
required: true,
|
|
57
66
|
}),
|
|
58
|
-
replayid:
|
|
67
|
+
replayid: Flags.integer({
|
|
59
68
|
summary: messages.getMessage('flags.replayid.summary'),
|
|
60
69
|
char: 'r',
|
|
61
70
|
}),
|
|
62
|
-
timeout:
|
|
71
|
+
timeout: Flags.integer({
|
|
63
72
|
summary: messages.getMessage('flags.timeout.summary'),
|
|
64
73
|
char: 't',
|
|
65
74
|
min: 1,
|
|
@@ -67,5 +76,5 @@ EventSubscribe.flags = {
|
|
|
67
76
|
default: 3,
|
|
68
77
|
}),
|
|
69
78
|
};
|
|
70
|
-
|
|
79
|
+
export default EventSubscribe;
|
|
71
80
|
//# sourceMappingURL=subscribe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe.js","sourceRoot":"","sources":["../../../../src/commands/raven/event/subscribe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subscribe.js","sourceRoot":"","sources":["../../../../src/commands/raven/event/subscribe.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,E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,EAAE,IAAI;KACf,CAAC;IACF,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC;QACtB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACtD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QACrD,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,CAAC;KACX,CAAC;CACH,CAAC;eA3BiB,cAAc"}
|
|
@@ -7,8 +7,8 @@ export default class ObjectDisplayFields extends SfCommand<ObjectDisplayFieldsRe
|
|
|
7
7
|
static readonly description: string;
|
|
8
8
|
static readonly examples: string[];
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
'target-org': import("@oclif/core/
|
|
11
|
-
sobject: import("@oclif/core/
|
|
10
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
sobject: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<ObjectDisplayFieldsResult>;
|
|
14
14
|
}
|
|
@@ -1,54 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { SfCommand, Flags, Ux } from '@salesforce/sf-plugins-core';
|
|
11
|
+
import { Messages } from '@salesforce/core';
|
|
12
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
13
|
+
const messages = Messages.loadMessages('sf-raven', 'raven.object.display.fields');
|
|
14
|
+
class ObjectDisplayFields extends SfCommand {
|
|
15
|
+
run() {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
this.spinner.start('Loading...');
|
|
18
|
+
const { flags } = yield this.parse(ObjectDisplayFields);
|
|
19
|
+
const ux = new Ux({ jsonEnabled: this.jsonEnabled() });
|
|
20
|
+
const org = flags['target-org'];
|
|
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
|
+
});
|
|
40
|
+
// Return url
|
|
41
|
+
ux.log(`\n${conn.instanceUrl}/lightning/setup/ObjectManager/${flags.sobject}/FieldsAndRelationships/view`);
|
|
42
|
+
// Return an object to be displayed with --json
|
|
43
|
+
return result;
|
|
31
44
|
});
|
|
32
|
-
// Return url
|
|
33
|
-
ux.log(`\n${conn.instanceUrl}/lightning/setup/ObjectManager/${flags.sobject}/FieldsAndRelationships/view`);
|
|
34
|
-
// Return an object to be displayed with --json
|
|
35
|
-
return result;
|
|
36
45
|
}
|
|
37
46
|
}
|
|
38
47
|
ObjectDisplayFields.summary = messages.getMessage('summary');
|
|
39
48
|
ObjectDisplayFields.description = messages.getMessage('description');
|
|
40
49
|
ObjectDisplayFields.examples = messages.getMessages('examples');
|
|
41
50
|
ObjectDisplayFields.flags = {
|
|
42
|
-
'target-org':
|
|
51
|
+
'target-org': Flags.requiredOrg({
|
|
43
52
|
summary: messages.getMessage('flags.target-org.summary'),
|
|
44
53
|
char: 'o',
|
|
45
54
|
required: true,
|
|
46
55
|
}),
|
|
47
|
-
sobject:
|
|
56
|
+
sobject: Flags.string({
|
|
48
57
|
summary: messages.getMessage('flags.sobject.summary'),
|
|
49
58
|
char: 's',
|
|
50
59
|
required: true,
|
|
51
60
|
}),
|
|
52
61
|
};
|
|
53
|
-
|
|
62
|
+
export default ObjectDisplayFields;
|
|
54
63
|
//# sourceMappingURL=fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../src/commands/raven/object/display/fields.ts"],"names":[],"mappings":"
|
|
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,CAA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AAG,CAAC,QAAQ;iBACnC;aACF,CAAC,CAAC;YAEH,aAAa;YACb,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,WAAW,kCAAkC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;YAE3G,+CAA+C;YAC/C,OAAO,MAA8C,CAAC;QACxD,CAAC;KAAA;;AAjEsB,2BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,+BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,4BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,yBAAK,GAAG;IAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC;QAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QACrD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;eAhBiB,mBAAmB"}
|
|
@@ -7,8 +7,8 @@ export default class ObjectDisplayRecordtypes extends SfCommand<ObjectDisplayRec
|
|
|
7
7
|
static readonly description: string;
|
|
8
8
|
static readonly examples: string[];
|
|
9
9
|
static readonly flags: {
|
|
10
|
-
'target-org': import("@oclif/core/
|
|
11
|
-
sobject: import("@oclif/core/
|
|
10
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
sobject: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<ObjectDisplayRecordtypesResult>;
|
|
14
14
|
}
|