@salesforce/plugin-schema 2.1.19 → 2.2.1

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/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2022, Salesforce.com, Inc.
1
+ Copyright (c) 2023, Salesforce.com, Inc.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -0,0 +1,16 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { DescribeSObjectResult } from 'jsforce';
3
+ export declare class SObjectDescribe extends SfCommand<DescribeSObjectResult> {
4
+ static readonly summary: string;
5
+ static readonly description: string;
6
+ static readonly examples: string[];
7
+ static readonly aliases: string[];
8
+ static flags: {
9
+ 'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org>;
10
+ 'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string>;
11
+ loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string>;
12
+ sobject: import("@oclif/core/lib/interfaces").OptionFlag<string>;
13
+ 'use-tooling-api': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<DescribeSObjectResult>;
16
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2020, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.SObjectDescribe = void 0;
10
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
11
+ const core_1 = require("@salesforce/core");
12
+ core_1.Messages.importMessagesDirectory(__dirname);
13
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-schema', 'describe');
14
+ class SObjectDescribe extends sf_plugins_core_1.SfCommand {
15
+ async run() {
16
+ const { flags } = await this.parse(SObjectDescribe);
17
+ const conn = flags['target-org'].getConnection(flags['api-version']);
18
+ const description = flags['use-tooling-api']
19
+ ? await conn.tooling.describe(flags.sobject)
20
+ : await conn.describe(flags.sobject);
21
+ this.styledJSON(description);
22
+ return description;
23
+ }
24
+ }
25
+ exports.SObjectDescribe = SObjectDescribe;
26
+ SObjectDescribe.summary = messages.getMessage('summary');
27
+ SObjectDescribe.description = messages.getMessage('description');
28
+ SObjectDescribe.examples = messages.getMessages('examples');
29
+ SObjectDescribe.aliases = ['force:schema:sobject:describe'];
30
+ SObjectDescribe.flags = {
31
+ 'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
32
+ 'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
33
+ loglevel: sf_plugins_core_1.loglevel,
34
+ sobject: sf_plugins_core_1.Flags.string({
35
+ char: 's',
36
+ required: true,
37
+ summary: messages.getMessage('flags.sobject.summary'),
38
+ aliases: ['sobjecttype'],
39
+ }),
40
+ 'use-tooling-api': sf_plugins_core_1.Flags.boolean({
41
+ char: 't',
42
+ summary: messages.getMessage('flags.tooling-api.summary'),
43
+ aliases: ['usetoolingapi'],
44
+ }),
45
+ };
46
+ //# sourceMappingURL=describe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/commands/sobject/describe.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iEAMqC;AAErC,2CAA4C;AAG5C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;AAEhF,MAAa,eAAgB,SAAQ,2BAAgC;IAsB5D,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,KAAK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TOM = 2
6
+ }
7
+ export type SObjectListResult = string[];
8
+ export declare class SObjectList extends SfCommand<SObjectListResult> {
9
+ static readonly summary: string;
10
+ static readonly description: string;
11
+ static readonly examples: string[];
12
+ static readonly aliases: string[];
13
+ static flags: {
14
+ 'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org>;
15
+ 'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string>;
16
+ loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string>;
17
+ sobject: import("@oclif/core/lib/interfaces").OptionFlag<string>;
18
+ };
19
+ run(): Promise<SObjectListResult>;
20
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SObjectList = exports.SObjectType = void 0;
4
+ /*
5
+ * Copyright (c) 2020, salesforce.com, inc.
6
+ * All rights reserved.
7
+ * Licensed under the BSD 3-Clause license.
8
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
+ */
10
+ const os = require("node:os");
11
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
12
+ const core_1 = require("@salesforce/core");
13
+ core_1.Messages.importMessagesDirectory(__dirname);
14
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-schema', 'list');
15
+ var SObjectType;
16
+ (function (SObjectType) {
17
+ SObjectType[SObjectType["ALL"] = 0] = "ALL";
18
+ SObjectType[SObjectType["STANDARD"] = 1] = "STANDARD";
19
+ SObjectType[SObjectType["CUSTOM"] = 2] = "CUSTOM";
20
+ })(SObjectType = exports.SObjectType || (exports.SObjectType = {}));
21
+ class SObjectList extends sf_plugins_core_1.SfCommand {
22
+ async run() {
23
+ const { flags } = await this.parse(SObjectList);
24
+ const category = flags.sobject.toUpperCase();
25
+ const type = SObjectType[category];
26
+ const allDescriptions = await flags['target-org'].getConnection(flags['api-version']).describeGlobal();
27
+ const sobjects = allDescriptions.sobjects
28
+ .filter((sobject) => {
29
+ const isCustom = sobject.custom;
30
+ return (type === SObjectType.ALL ||
31
+ (type === SObjectType.CUSTOM && isCustom) ||
32
+ (type === SObjectType.STANDARD && !isCustom));
33
+ })
34
+ .map((sobject) => sobject.name);
35
+ if (sobjects.length) {
36
+ this.log(sobjects.join(os.EOL));
37
+ }
38
+ else {
39
+ this.log(messages.getMessage('noTypeFound', [SObjectType[type]]));
40
+ }
41
+ return sobjects;
42
+ }
43
+ }
44
+ exports.SObjectList = SObjectList;
45
+ SObjectList.summary = messages.getMessage('summary');
46
+ SObjectList.description = messages.getMessage('description');
47
+ SObjectList.examples = messages.getMessages('examples');
48
+ SObjectList.aliases = ['force:schema:sobject:list'];
49
+ SObjectList.flags = {
50
+ 'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
51
+ 'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
52
+ loglevel: sf_plugins_core_1.loglevel,
53
+ sobject: sf_plugins_core_1.Flags.string({
54
+ char: 's',
55
+ default: 'ALL',
56
+ summary: messages.getMessage('flags.sobject.summary'),
57
+ aliases: ['sobjecttypecategory', 'c'],
58
+ parse: (val) => {
59
+ const lowercasedType = val.toLowerCase();
60
+ if (!['all', 'standard', 'custom'].includes(lowercasedType)) {
61
+ throw messages.createError('invalid-sobject-type');
62
+ }
63
+ return Promise.resolve(lowercasedType);
64
+ },
65
+ }),
66
+ };
67
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/sobject/list.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,8BAA8B;AAC9B,iEAMqC;AACrC,2CAA4C;AAE5C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;AAE5E,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,2CAAG,CAAA;IACH,qDAAQ,CAA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AAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,uBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,oBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,mBAAO,GAAG,CAAC,2BAA2B,CAAC,CAAC;AACjD,iBAAK,GAAG;IACpB,YAAY,EAAE,iDAA+B;IAC7C,aAAa,EAAE,mDAAiC;IAChD,QAAQ,EAAR,0BAAQ;IACR,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QACrD,OAAO,EAAE,CAAC,qBAAqB,EAAE,GAAG,CAAC;QACrC,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;YACb,MAAM,cAAc,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YACzC,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;gBAC3D,MAAM,QAAQ,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;aACpD;YACD,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;CACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ # summary
2
+
3
+ Display the metadata for a standard or custom object or a Tooling API object.
4
+
5
+ # description
6
+
7
+ The metadata is displayed in JSON format. See this topic for a description of each property: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_describesobjects_describesobjectresult.htm.
8
+
9
+ This command displays metadata for Salesforce objects by default. Use the --use-tooling-api flag to view metadata for a Tooling API object.
10
+
11
+ # examples
12
+
13
+ - Display the metadata of the "Account" standard object in your default org:
14
+
15
+ <%= config.bin %> <%= command.id %> --sobject Account
16
+
17
+ - Display the metadata of the "MyObject__c" custom object in the org with alias "my-scratch-org":
18
+
19
+ <%= config.bin %> <%= command.id %> --sobject MyObject__c --target-org my-scratch-org
20
+
21
+ - Display the metadata of the ApexCodeCoverage Tooling API object in your default org:
22
+
23
+ <%= config.bin %> <%= command.id %> --sobject ApexCodeCoverage --use-tooling-api
24
+
25
+ # flags.sobject.summary
26
+
27
+ API name of the object to describe.
28
+
29
+ # flags.tooling-api.summary
30
+
31
+ Use Tooling API to display metadata for Tooling API objects.
@@ -0,0 +1,29 @@
1
+ # summary
2
+
3
+ List all Salesforce objects of a specified category.
4
+
5
+ # description
6
+
7
+ You can list the standard objects, custom objects, or all. The lists include only Salesforce objects, not Tooling API objects.
8
+
9
+ # examples
10
+
11
+ - List all objects in your default org:
12
+
13
+ <%= config.bin %> <%= command.id %> --sobject all
14
+
15
+ - List only custom objects in the org with alias "my-scratch-org":
16
+
17
+ <%= config.bin %> <%= command.id %> --sobject custom --target-org my-scratch-org
18
+
19
+ # flags.sobject.summary
20
+
21
+ Category of objects to list.
22
+
23
+ # invalid-sobject-type
24
+
25
+ "--sobject" flag can be set only to <all|custom|standard>."
26
+
27
+ # noTypeFound
28
+
29
+ No %s objects found.
@@ -1 +1 @@
1
- {"version":"2.1.19","commands":{"force:schema:sobject:describe":{"id":"force:schema:sobject:describe","description":"displays the metadata for a standard or custom object","strict":true,"usage":"<%= command.id %> -s <string> [-t] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-schema","pluginAlias":"@salesforce/plugin-schema","pluginType":"core","aliases":[],"examples":["$ sfdx force:schema:sobject:describe -s Account","$ sfdx force:schema:sobject:describe -s MyObject__c","$ sfdx force:schema:sobject:describe -s ApexClass -t"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","multiple":false,"options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org","multiple":false},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command","multiple":false},"sobjecttype":{"name":"sobjecttype","type":"option","char":"s","description":"the API name of the object to describe","required":true,"multiple":false},"usetoolingapi":{"name":"usetoolingapi","type":"boolean","char":"t","description":"execute with Tooling API","allowNo":false}},"args":[],"flagsConfig":{"sobjecttype":{"kind":"string","char":"s","required":true,"description":"the API name of the object to describe","input":[],"multiple":false,"type":"option"},"usetoolingapi":{"kind":"boolean","char":"t","description":"execute with Tooling API","allowNo":false,"type":"boolean"}},"requiresUsername":true},"force:schema:sobject:list":{"id":"force:schema:sobject:list","description":"list all objects of a specified category","strict":true,"usage":"<%= command.id %> [-c <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-schema","pluginAlias":"@salesforce/plugin-schema","pluginType":"core","aliases":[],"examples":["$ sfdx force:schema:sobject:list -c all","$ sfdx force:schema:sobject:list -c custom","$ sfdx force:schema:sobject:list -c standard"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","multiple":false,"options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org","multiple":false},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command","multiple":false},"sobjecttypecategory":{"name":"sobjecttypecategory","type":"option","char":"c","description":"the type of objects to list (all|custom|standard)","multiple":false,"default":"ALL"}},"args":[],"flagsConfig":{"sobjecttypecategory":{"kind":"string","char":"c","default":"ALL","description":"the type of objects to list (all|custom|standard)","input":[],"multiple":false,"type":"option"}},"requiresUsername":true}}}
1
+ {"version":"2.2.1","commands":{"sobject:describe":{"id":"sobject:describe","summary":"Display the metadata for a standard or custom object or a Tooling API object.","description":"The metadata is displayed in JSON format. See this topic for a description of each property: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_describesobjects_describesobjectresult.htm.\n\nThis command displays metadata for Salesforce objects by default. Use the --use-tooling-api flag to view metadata for a Tooling API object.","strict":true,"pluginName":"@salesforce/plugin-schema","pluginAlias":"@salesforce/plugin-schema","pluginType":"core","aliases":["force:schema:sobject:describe"],"examples":["Display the metadata of the \"Account\" standard object in your default org:\n<%= config.bin %> <%= command.id %> --sobject Account","Display the metadata of the \"MyObject__c\" custom object in the org with alias \"my-scratch-org\":\n<%= config.bin %> <%= command.id %> --sobject MyObject__c --target-org my-scratch-org","Display the metadata of the ApexCodeCoverage Tooling API object in your default org:\n<%= config.bin %> <%= command.id %> --sobject ApexCodeCoverage --use-tooling-api"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"target-org":{"name":"target-org","type":"option","char":"o","summary":"Username or alias of the target org.","multiple":false,"aliases":["targetusername","u"]},"api-version":{"name":"api-version","type":"option","description":"Override the api version used for api requests made by this command","multiple":false,"aliases":["apiversion"]},"loglevel":{"name":"loglevel","type":"option","hidden":true,"multiple":false,"deprecated":{"message":"The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored."}},"sobject":{"name":"sobject","type":"option","char":"s","summary":"API name of the object to describe.","required":true,"multiple":false,"aliases":["sobjecttype"]},"use-tooling-api":{"name":"use-tooling-api","type":"boolean","char":"t","summary":"Use Tooling API to display metadata for Tooling API objects.","allowNo":false,"aliases":["usetoolingapi"]}},"args":[],"hasDynamicHelp":true},"sobject:list":{"id":"sobject:list","summary":"List all Salesforce objects of a specified category.","description":"You can list the standard objects, custom objects, or all. The lists include only Salesforce objects, not Tooling API objects.","strict":true,"pluginName":"@salesforce/plugin-schema","pluginAlias":"@salesforce/plugin-schema","pluginType":"core","aliases":["force:schema:sobject:list"],"examples":["List all objects in your default org:\n<%= config.bin %> <%= command.id %> --sobject all","List only custom objects in the org with alias \"my-scratch-org\":\n<%= config.bin %> <%= command.id %> --sobject custom --target-org my-scratch-org"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"target-org":{"name":"target-org","type":"option","char":"o","summary":"Username or alias of the target org.","multiple":false,"aliases":["targetusername","u"]},"api-version":{"name":"api-version","type":"option","description":"Override the api version used for api requests made by this command","multiple":false,"aliases":["apiversion"]},"loglevel":{"name":"loglevel","type":"option","hidden":true,"multiple":false,"deprecated":{"message":"The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored."}},"sobject":{"name":"sobject","type":"option","char":"s","summary":"Category of objects to list.","multiple":false,"default":"ALL","aliases":["sobjecttypecategory","c"]}},"args":[],"hasDynamicHelp":true}}}
package/package.json CHANGED
@@ -1,29 +1,30 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-schema",
3
3
  "description": "Commands to interact with salesforce sobject schemas",
4
- "version": "2.1.19",
4
+ "version": "2.2.1",
5
5
  "author": "Salesforce",
6
6
  "main": "lib/index.js",
7
7
  "bugs": "https://github.com/forcedotcom/cli/issues",
8
8
  "dependencies": {
9
- "@oclif/core": "^1.21.0",
10
- "@salesforce/command": "^5.2.25",
11
- "@salesforce/core": "^3.32.6",
9
+ "@oclif/core": "^1.20.4",
10
+ "@salesforce/core": "^3.32.8",
11
+ "@salesforce/sf-plugins-core": "^1.19.2",
12
12
  "tslib": "^2"
13
13
  },
14
14
  "devDependencies": {
15
- "@oclif/plugin-command-snapshot": "^3.2.11",
16
- "@salesforce/cli-plugins-testkit": "^3.2.9",
15
+ "@oclif/plugin-command-snapshot": "^3.2.16",
16
+ "@oclif/plugin-help": "^5.1.22",
17
+ "@salesforce/cli-plugins-testkit": "^3.2.15",
17
18
  "@salesforce/dev-config": "^3.0.1",
18
19
  "@salesforce/dev-scripts": "^3.1.0",
19
- "@salesforce/plugin-command-reference": "^1.5.3",
20
+ "@salesforce/plugin-command-reference": "^2.2.8",
20
21
  "@salesforce/prettier-config": "^0.0.2",
21
22
  "@salesforce/ts-sinon": "1.4.2",
22
- "@swc/core": "^1.3.20",
23
+ "@swc/core": "^1.3.24",
23
24
  "@typescript-eslint/eslint-plugin": "^5.42.1",
24
- "@typescript-eslint/parser": "^5.45.0",
25
+ "@typescript-eslint/parser": "^5.47.0",
25
26
  "chai": "^4.3.7",
26
- "eslint": "^8.29.0",
27
+ "eslint": "^8.30.0",
27
28
  "eslint-config-prettier": "^8.5.0",
28
29
  "eslint-config-salesforce": "^1.1.0",
29
30
  "eslint-config-salesforce-license": "^0.1.6",
@@ -31,10 +32,11 @@
31
32
  "eslint-plugin-header": "^3.0.0",
32
33
  "eslint-plugin-import": "2.26.0",
33
34
  "eslint-plugin-jsdoc": "^39.6.4",
35
+ "eslint-plugin-sf-plugin": "^1.1.5",
34
36
  "husky": "^7.0.4",
35
37
  "mocha": "^9.1.3",
36
38
  "nyc": "^15.1.0",
37
- "oclif": "^3.3.0",
39
+ "oclif": "^3.4.3",
38
40
  "prettier": "^2.8.1",
39
41
  "pretty-quick": "^3.1.0",
40
42
  "shx": "0.3.4",
@@ -49,7 +51,8 @@
49
51
  "files": [
50
52
  "/lib",
51
53
  "/messages",
52
- "/oclif.manifest.json"
54
+ "/oclif.manifest.json",
55
+ "/schemas"
53
56
  ],
54
57
  "homepage": "https://github.com/salesforcecli/plugin-schema",
55
58
  "keywords": [
@@ -69,17 +72,14 @@
69
72
  "@salesforce/plugin-command-reference"
70
73
  ],
71
74
  "topics": {
72
- "force": {
73
- "external": true,
75
+ "sobject": {
76
+ "description": "Commands to interact with Salesforce objects.",
74
77
  "subtopics": {
75
- "schema": {
76
- "description": "List metadata types in your Salesforce org using the CLI",
77
- "longDescription": "Use the schema commands to to list metadata types within your Salesforce org using the Salesforce CLI.",
78
- "subtopics": {
79
- "sobject": {
80
- "description": "list standard object metadata types"
81
- }
82
- }
78
+ "list": {
79
+ "description": "List all Salesforce objects of a specified category."
80
+ },
81
+ "describe": {
82
+ "description": "Displays the metadata for a standard or custom object."
83
83
  }
84
84
  }
85
85
  }
@@ -96,13 +96,14 @@
96
96
  "format": "sf-format",
97
97
  "lint": "sf-lint",
98
98
  "postpack": "shx rm -f oclif.manifest.json",
99
- "posttest": "yarn lint && yarn test:deprecation-policy && yarn test:command-reference",
99
+ "posttest": "yarn lint && yarn test:deprecation-policy && yarn test:json-schema && yarn test:command-reference",
100
100
  "prepack": "sf-prepack",
101
101
  "prepare": "sf-install",
102
102
  "pretest": "sf-compile-test",
103
103
  "test": "sf-test",
104
104
  "test:command-reference": "./bin/dev commandreference:generate --erroronwarnings",
105
105
  "test:deprecation-policy": "./bin/dev snapshot:compare",
106
+ "test:json-schema": "./bin/dev schema:compare",
106
107
  "test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
107
108
  "version": "oclif readme"
108
109
  },
@@ -110,7 +111,7 @@
110
111
  "access": "public"
111
112
  },
112
113
  "sfdx": {
113
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-schema/2.1.19.crt",
114
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-schema/2.1.19.sig"
114
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-schema/2.2.1.crt",
115
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-schema/2.2.1.sig"
115
116
  }
116
117
  }
@@ -0,0 +1,616 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/DescribeSObjectResult",
4
+ "definitions": {
5
+ "DescribeSObjectResult": {
6
+ "type": "object",
7
+ "properties": {
8
+ "actionOverrides": {
9
+ "anyOf": [
10
+ {
11
+ "type": "array",
12
+ "items": {
13
+ "$ref": "#/definitions/ActionOverride"
14
+ }
15
+ },
16
+ {
17
+ "type": "null"
18
+ }
19
+ ]
20
+ },
21
+ "activateable": {
22
+ "type": "boolean"
23
+ },
24
+ "childRelationships": {
25
+ "type": "array",
26
+ "items": {
27
+ "$ref": "#/definitions/ChildRelationship"
28
+ }
29
+ },
30
+ "compactLayoutable": {
31
+ "type": "boolean"
32
+ },
33
+ "createable": {
34
+ "type": "boolean"
35
+ },
36
+ "custom": {
37
+ "type": "boolean"
38
+ },
39
+ "customSetting": {
40
+ "type": "boolean"
41
+ },
42
+ "dataTranslationEnabled": {
43
+ "type": ["boolean", "null"]
44
+ },
45
+ "deepCloneable": {
46
+ "type": "boolean"
47
+ },
48
+ "defaultImplementation": {
49
+ "type": ["string", "null"]
50
+ },
51
+ "deletable": {
52
+ "type": "boolean"
53
+ },
54
+ "deprecatedAndHidden": {
55
+ "type": "boolean"
56
+ },
57
+ "feedEnabled": {
58
+ "type": "boolean"
59
+ },
60
+ "fields": {
61
+ "anyOf": [
62
+ {
63
+ "type": "array",
64
+ "items": {
65
+ "$ref": "#/definitions/Field"
66
+ }
67
+ },
68
+ {
69
+ "type": "null"
70
+ }
71
+ ]
72
+ },
73
+ "hasSubtypes": {
74
+ "type": "boolean"
75
+ },
76
+ "idEnabled": {
77
+ "type": "boolean"
78
+ },
79
+ "implementedBy": {
80
+ "type": ["string", "null"]
81
+ },
82
+ "implementsInterfaces": {
83
+ "type": ["string", "null"]
84
+ },
85
+ "isInterface": {
86
+ "type": "boolean"
87
+ },
88
+ "isSubtype": {
89
+ "type": "boolean"
90
+ },
91
+ "keyPrefix": {
92
+ "type": ["string", "null"]
93
+ },
94
+ "label": {
95
+ "type": "string"
96
+ },
97
+ "labelPlural": {
98
+ "type": "string"
99
+ },
100
+ "layoutable": {
101
+ "type": "boolean"
102
+ },
103
+ "mergeable": {
104
+ "type": "boolean"
105
+ },
106
+ "mruEnabled": {
107
+ "type": "boolean"
108
+ },
109
+ "name": {
110
+ "type": "string"
111
+ },
112
+ "namedLayoutInfos": {
113
+ "type": "array",
114
+ "items": {
115
+ "$ref": "#/definitions/NamedLayoutInfo"
116
+ }
117
+ },
118
+ "networkScopeFieldName": {
119
+ "type": ["string", "null"]
120
+ },
121
+ "queryable": {
122
+ "type": "boolean"
123
+ },
124
+ "recordTypeInfos": {
125
+ "type": "array",
126
+ "items": {
127
+ "$ref": "#/definitions/RecordTypeInfo"
128
+ }
129
+ },
130
+ "replicateable": {
131
+ "type": "boolean"
132
+ },
133
+ "retrieveable": {
134
+ "type": "boolean"
135
+ },
136
+ "searchLayoutable": {
137
+ "type": ["boolean", "null"]
138
+ },
139
+ "searchable": {
140
+ "type": "boolean"
141
+ },
142
+ "supportedScopes": {
143
+ "anyOf": [
144
+ {
145
+ "type": "array",
146
+ "items": {
147
+ "$ref": "#/definitions/ScopeInfo"
148
+ }
149
+ },
150
+ {
151
+ "type": "null"
152
+ }
153
+ ]
154
+ },
155
+ "triggerable": {
156
+ "type": ["boolean", "null"]
157
+ },
158
+ "undeletable": {
159
+ "type": "boolean"
160
+ },
161
+ "updateable": {
162
+ "type": "boolean"
163
+ },
164
+ "urlDetail": {
165
+ "type": ["string", "null"]
166
+ },
167
+ "urlEdit": {
168
+ "type": ["string", "null"]
169
+ },
170
+ "urlNew": {
171
+ "type": ["string", "null"]
172
+ }
173
+ },
174
+ "required": [
175
+ "activateable",
176
+ "childRelationships",
177
+ "compactLayoutable",
178
+ "createable",
179
+ "custom",
180
+ "customSetting",
181
+ "deepCloneable",
182
+ "deletable",
183
+ "deprecatedAndHidden",
184
+ "feedEnabled",
185
+ "hasSubtypes",
186
+ "idEnabled",
187
+ "isInterface",
188
+ "isSubtype",
189
+ "label",
190
+ "labelPlural",
191
+ "layoutable",
192
+ "mergeable",
193
+ "mruEnabled",
194
+ "name",
195
+ "namedLayoutInfos",
196
+ "queryable",
197
+ "recordTypeInfos",
198
+ "replicateable",
199
+ "retrieveable",
200
+ "searchable",
201
+ "undeletable",
202
+ "updateable"
203
+ ],
204
+ "additionalProperties": false
205
+ },
206
+ "ActionOverride": {
207
+ "type": "object",
208
+ "properties": {
209
+ "formFactor": {
210
+ "type": "string"
211
+ },
212
+ "isAvailableInTouch": {
213
+ "type": "boolean"
214
+ },
215
+ "name": {
216
+ "type": "string"
217
+ },
218
+ "pageId": {
219
+ "type": "string"
220
+ },
221
+ "url": {
222
+ "type": ["string", "null"]
223
+ }
224
+ },
225
+ "required": ["formFactor", "isAvailableInTouch", "name", "pageId"],
226
+ "additionalProperties": false
227
+ },
228
+ "ChildRelationship": {
229
+ "type": "object",
230
+ "properties": {
231
+ "cascadeDelete": {
232
+ "type": "boolean"
233
+ },
234
+ "childSObject": {
235
+ "type": "string"
236
+ },
237
+ "deprecatedAndHidden": {
238
+ "type": "boolean"
239
+ },
240
+ "field": {
241
+ "type": "string"
242
+ },
243
+ "junctionIdListNames": {
244
+ "anyOf": [
245
+ {
246
+ "type": "array",
247
+ "items": {
248
+ "type": "string"
249
+ }
250
+ },
251
+ {
252
+ "type": "null"
253
+ }
254
+ ]
255
+ },
256
+ "junctionReferenceTo": {
257
+ "anyOf": [
258
+ {
259
+ "type": "array",
260
+ "items": {
261
+ "type": "string"
262
+ }
263
+ },
264
+ {
265
+ "type": "null"
266
+ }
267
+ ]
268
+ },
269
+ "relationshipName": {
270
+ "type": ["string", "null"]
271
+ },
272
+ "restrictedDelete": {
273
+ "type": ["boolean", "null"]
274
+ }
275
+ },
276
+ "required": ["cascadeDelete", "childSObject", "deprecatedAndHidden", "field"],
277
+ "additionalProperties": false
278
+ },
279
+ "Field": {
280
+ "type": "object",
281
+ "properties": {
282
+ "aggregatable": {
283
+ "type": "boolean"
284
+ },
285
+ "aiPredictionField": {
286
+ "type": "boolean"
287
+ },
288
+ "autoNumber": {
289
+ "type": "boolean"
290
+ },
291
+ "byteLength": {
292
+ "type": "number"
293
+ },
294
+ "calculated": {
295
+ "type": "boolean"
296
+ },
297
+ "calculatedFormula": {
298
+ "type": ["string", "null"]
299
+ },
300
+ "cascadeDelete": {
301
+ "type": ["boolean", "null"]
302
+ },
303
+ "caseSensitive": {
304
+ "type": "boolean"
305
+ },
306
+ "compoundFieldName": {
307
+ "type": ["string", "null"]
308
+ },
309
+ "controllerName": {
310
+ "type": ["string", "null"]
311
+ },
312
+ "createable": {
313
+ "type": "boolean"
314
+ },
315
+ "custom": {
316
+ "type": "boolean"
317
+ },
318
+ "dataTranslationEnabled": {
319
+ "type": ["boolean", "null"]
320
+ },
321
+ "defaultValue": {
322
+ "anyOf": [
323
+ {},
324
+ {
325
+ "type": "null"
326
+ }
327
+ ]
328
+ },
329
+ "defaultValueFormula": {
330
+ "type": ["string", "null"]
331
+ },
332
+ "defaultedOnCreate": {
333
+ "type": "boolean"
334
+ },
335
+ "dependentPicklist": {
336
+ "type": ["boolean", "null"]
337
+ },
338
+ "deprecatedAndHidden": {
339
+ "type": "boolean"
340
+ },
341
+ "digits": {
342
+ "type": "number"
343
+ },
344
+ "displayLocationInDecimal": {
345
+ "type": ["boolean", "null"]
346
+ },
347
+ "encrypted": {
348
+ "type": ["boolean", "null"]
349
+ },
350
+ "externalId": {
351
+ "type": ["boolean", "null"]
352
+ },
353
+ "extraTypeInfo": {
354
+ "type": ["string", "null"]
355
+ },
356
+ "filterable": {
357
+ "type": "boolean"
358
+ },
359
+ "filteredLookupInfo": {
360
+ "anyOf": [
361
+ {
362
+ "$ref": "#/definitions/FilteredLookupInfo"
363
+ },
364
+ {
365
+ "type": "null"
366
+ }
367
+ ]
368
+ },
369
+ "formulaTreatNullNumberAsZero": {
370
+ "type": ["boolean", "null"]
371
+ },
372
+ "groupable": {
373
+ "type": "boolean"
374
+ },
375
+ "highScaleNumber": {
376
+ "type": ["boolean", "null"]
377
+ },
378
+ "htmlFormatted": {
379
+ "type": ["boolean", "null"]
380
+ },
381
+ "idLookup": {
382
+ "type": "boolean"
383
+ },
384
+ "inlineHelpText": {
385
+ "type": ["string", "null"]
386
+ },
387
+ "label": {
388
+ "type": "string"
389
+ },
390
+ "length": {
391
+ "type": "number"
392
+ },
393
+ "mask": {
394
+ "type": ["string", "null"]
395
+ },
396
+ "maskType": {
397
+ "type": ["string", "null"]
398
+ },
399
+ "name": {
400
+ "type": "string"
401
+ },
402
+ "nameField": {
403
+ "type": "boolean"
404
+ },
405
+ "namePointing": {
406
+ "type": ["boolean", "null"]
407
+ },
408
+ "nillable": {
409
+ "type": "boolean"
410
+ },
411
+ "permissionable": {
412
+ "type": "boolean"
413
+ },
414
+ "picklistValues": {
415
+ "anyOf": [
416
+ {
417
+ "type": "array",
418
+ "items": {
419
+ "$ref": "#/definitions/PicklistEntry"
420
+ }
421
+ },
422
+ {
423
+ "type": "null"
424
+ }
425
+ ]
426
+ },
427
+ "polymorphicForeignKey": {
428
+ "type": "boolean"
429
+ },
430
+ "precision": {
431
+ "type": "number"
432
+ },
433
+ "queryByDistance": {
434
+ "type": "boolean"
435
+ },
436
+ "referenceTargetField": {
437
+ "type": ["string", "null"]
438
+ },
439
+ "referenceTo": {
440
+ "anyOf": [
441
+ {
442
+ "type": "array",
443
+ "items": {
444
+ "type": "string"
445
+ }
446
+ },
447
+ {
448
+ "type": "null"
449
+ }
450
+ ]
451
+ },
452
+ "relationshipName": {
453
+ "type": ["string", "null"]
454
+ },
455
+ "relationshipOrder": {
456
+ "type": ["number", "null"]
457
+ },
458
+ "restrictedDelete": {
459
+ "type": ["boolean", "null"]
460
+ },
461
+ "restrictedPicklist": {
462
+ "type": "boolean"
463
+ },
464
+ "scale": {
465
+ "type": "number"
466
+ },
467
+ "searchPrefilterable": {
468
+ "type": "boolean"
469
+ },
470
+ "soapType": {
471
+ "type": "string"
472
+ },
473
+ "sortable": {
474
+ "type": ["boolean", "null"]
475
+ },
476
+ "type": {
477
+ "type": "string"
478
+ },
479
+ "unique": {
480
+ "type": "boolean"
481
+ },
482
+ "updateable": {
483
+ "type": "boolean"
484
+ },
485
+ "writeRequiresMasterRead": {
486
+ "type": ["boolean", "null"]
487
+ }
488
+ },
489
+ "required": [
490
+ "aggregatable",
491
+ "aiPredictionField",
492
+ "autoNumber",
493
+ "byteLength",
494
+ "calculated",
495
+ "caseSensitive",
496
+ "createable",
497
+ "custom",
498
+ "defaultedOnCreate",
499
+ "deprecatedAndHidden",
500
+ "digits",
501
+ "filterable",
502
+ "groupable",
503
+ "idLookup",
504
+ "label",
505
+ "length",
506
+ "name",
507
+ "nameField",
508
+ "nillable",
509
+ "permissionable",
510
+ "polymorphicForeignKey",
511
+ "precision",
512
+ "queryByDistance",
513
+ "restrictedPicklist",
514
+ "scale",
515
+ "searchPrefilterable",
516
+ "soapType",
517
+ "type",
518
+ "unique",
519
+ "updateable"
520
+ ],
521
+ "additionalProperties": false
522
+ },
523
+ "FilteredLookupInfo": {
524
+ "type": "object",
525
+ "properties": {
526
+ "controllingFields": {
527
+ "type": "array",
528
+ "items": {
529
+ "type": "string"
530
+ }
531
+ },
532
+ "dependent": {
533
+ "type": "boolean"
534
+ },
535
+ "optionalFilter": {
536
+ "type": "boolean"
537
+ }
538
+ },
539
+ "required": ["controllingFields", "dependent", "optionalFilter"],
540
+ "additionalProperties": false
541
+ },
542
+ "PicklistEntry": {
543
+ "type": "object",
544
+ "properties": {
545
+ "active": {
546
+ "type": "boolean"
547
+ },
548
+ "defaultValue": {
549
+ "type": "boolean"
550
+ },
551
+ "label": {
552
+ "type": ["string", "null"]
553
+ },
554
+ "validFor": {
555
+ "type": ["string", "null"]
556
+ },
557
+ "value": {
558
+ "type": "string"
559
+ }
560
+ },
561
+ "required": ["active", "defaultValue", "value"],
562
+ "additionalProperties": false
563
+ },
564
+ "NamedLayoutInfo": {
565
+ "type": "object",
566
+ "properties": {
567
+ "name": {
568
+ "type": "string"
569
+ }
570
+ },
571
+ "required": ["name"],
572
+ "additionalProperties": false
573
+ },
574
+ "RecordTypeInfo": {
575
+ "type": "object",
576
+ "properties": {
577
+ "active": {
578
+ "type": "boolean"
579
+ },
580
+ "available": {
581
+ "type": "boolean"
582
+ },
583
+ "defaultRecordTypeMapping": {
584
+ "type": "boolean"
585
+ },
586
+ "developerName": {
587
+ "type": "string"
588
+ },
589
+ "master": {
590
+ "type": "boolean"
591
+ },
592
+ "name": {
593
+ "type": "string"
594
+ },
595
+ "recordTypeId": {
596
+ "type": ["string", "null"]
597
+ }
598
+ },
599
+ "required": ["active", "available", "defaultRecordTypeMapping", "developerName", "master", "name"],
600
+ "additionalProperties": false
601
+ },
602
+ "ScopeInfo": {
603
+ "type": "object",
604
+ "properties": {
605
+ "label": {
606
+ "type": "string"
607
+ },
608
+ "name": {
609
+ "type": "string"
610
+ }
611
+ },
612
+ "required": ["label", "name"],
613
+ "additionalProperties": false
614
+ }
615
+ }
616
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/SObjectListResult",
4
+ "definitions": {
5
+ "SObjectListResult": {
6
+ "type": "array",
7
+ "items": {
8
+ "type": "string"
9
+ }
10
+ }
11
+ }
12
+ }
@@ -1,9 +0,0 @@
1
- import { FlagsConfig, SfdxCommand } from '@salesforce/command';
2
- import { DescribeSObjectResult } from 'jsforce';
3
- export declare class SchemaSObjectDescribe extends SfdxCommand {
4
- static readonly description: string;
5
- static readonly examples: string[];
6
- static readonly flagsConfig: FlagsConfig;
7
- static readonly requiresUsername = true;
8
- run(): Promise<DescribeSObjectResult>;
9
- }
@@ -1,42 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2020, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.SchemaSObjectDescribe = void 0;
10
- const os = require("os");
11
- const command_1 = require("@salesforce/command");
12
- const core_1 = require("@salesforce/core");
13
- core_1.Messages.importMessagesDirectory(__dirname);
14
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-schema', 'describe');
15
- class SchemaSObjectDescribe extends command_1.SfdxCommand {
16
- async run() {
17
- const conn = this.org.getConnection();
18
- const description = this.flags.usetoolingapi
19
- ? await conn.tooling.describe(this.flags.sobjecttype)
20
- : await conn.describe(this.flags.sobjecttype);
21
- if (!this.flags.json) {
22
- this.ux.logJson(description);
23
- }
24
- return description;
25
- }
26
- }
27
- exports.SchemaSObjectDescribe = SchemaSObjectDescribe;
28
- SchemaSObjectDescribe.description = messages.getMessage('description');
29
- SchemaSObjectDescribe.examples = messages.getMessage('examples').split(os.EOL);
30
- SchemaSObjectDescribe.flagsConfig = {
31
- sobjecttype: command_1.flags.string({
32
- char: 's',
33
- required: true,
34
- description: messages.getMessage('flags.objectType'),
35
- }),
36
- usetoolingapi: command_1.flags.boolean({
37
- char: 't',
38
- description: messages.getMessage('flags.useTooling'),
39
- }),
40
- };
41
- SchemaSObjectDescribe.requiresUsername = true;
42
- //# sourceMappingURL=describe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../../../src/commands/force/schema/sobject/describe.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AACzB,iDAAsE;AACtE,2CAAwD;AAGxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;AAEhF,MAAa,qBAAsB,SAAQ,qBAAW;IAgB7C,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,GAAe,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAClD,MAAM,WAAW,GAA0B,IAAI,CAAC,KAAK,CAAC,aAAa;YACjE,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAqB,CAAC;YAC/D,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAqB,CAAC,CAAC;QAE1D,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACpB,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SAC9B;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;;AA3BH,sDA4BC;AA3BwB,iCAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,8BAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AACzD,iCAAW,GAAgB;IAChD,WAAW,EAAE,eAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC;KACrD,CAAC;IACF,aAAa,EAAE,eAAK,CAAC,OAAO,CAAC;QAC3B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC;KACrD,CAAC;CACH,CAAC;AAEqB,sCAAgB,GAAG,IAAI,CAAC"}
@@ -1,13 +0,0 @@
1
- import { FlagsConfig, SfdxCommand } from '@salesforce/command';
2
- export declare enum SObjectType {
3
- ALL = 0,
4
- STANDARD = 1,
5
- CUSTOM = 2
6
- }
7
- export declare class SchemaSobjectList extends SfdxCommand {
8
- static readonly description: string;
9
- static readonly examples: string[];
10
- static readonly flagsConfig: FlagsConfig;
11
- static readonly requiresUsername = true;
12
- run(): Promise<string[]>;
13
- }
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaSobjectList = exports.SObjectType = void 0;
4
- /*
5
- * Copyright (c) 2020, salesforce.com, inc.
6
- * All rights reserved.
7
- * Licensed under the BSD 3-Clause license.
8
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
- */
10
- const os_1 = require("os");
11
- const command_1 = require("@salesforce/command");
12
- const core_1 = require("@salesforce/core");
13
- core_1.Messages.importMessagesDirectory(__dirname);
14
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-schema', 'list');
15
- // eslint-disable-next-line no-shadow
16
- var SObjectType;
17
- (function (SObjectType) {
18
- SObjectType[SObjectType["ALL"] = 0] = "ALL";
19
- SObjectType[SObjectType["STANDARD"] = 1] = "STANDARD";
20
- SObjectType[SObjectType["CUSTOM"] = 2] = "CUSTOM";
21
- })(SObjectType = exports.SObjectType || (exports.SObjectType = {}));
22
- class SchemaSobjectList extends command_1.SfdxCommand {
23
- async run() {
24
- const category = this.flags.sobjecttypecategory.toUpperCase();
25
- const type = SObjectType[category];
26
- const typeDescriptions = [];
27
- const conn = this.org.getConnection();
28
- const allDescriptions = await conn.describeGlobal();
29
- let havePrinted = false;
30
- allDescriptions.sobjects.forEach((sobject) => {
31
- const isCustom = sobject.custom === true;
32
- const doPrint = type === SObjectType.ALL ||
33
- (type === SObjectType.CUSTOM && isCustom) ||
34
- (type === SObjectType.STANDARD && !isCustom);
35
- if (doPrint) {
36
- havePrinted = true;
37
- this.ux.log(sobject.name);
38
- typeDescriptions.push(sobject.name);
39
- }
40
- });
41
- if (!havePrinted) {
42
- this.ux.log(messages.getMessage('noTypeFound', [SObjectType[type]]));
43
- }
44
- return typeDescriptions;
45
- }
46
- }
47
- exports.SchemaSobjectList = SchemaSobjectList;
48
- SchemaSobjectList.description = messages.getMessage('description');
49
- SchemaSobjectList.examples = messages.getMessage('examples').split(os_1.EOL);
50
- SchemaSobjectList.flagsConfig = {
51
- sobjecttypecategory: command_1.flags.string({
52
- char: 'c',
53
- default: 'ALL',
54
- validate: (val) => {
55
- const capitalized = val.toUpperCase();
56
- const result = capitalized === 'ALL' || capitalized === 'STANDARD' || capitalized === 'CUSTOM';
57
- if (!result) {
58
- throw messages.createError('flags.invalidTypeError');
59
- }
60
- return result;
61
- },
62
- description: messages.getMessage('flags.typeDescription'),
63
- }),
64
- };
65
- SchemaSobjectList.requiresUsername = true;
66
- //# sourceMappingURL=list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/force/schema/sobject/list.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2BAAyB;AACzB,iDAAsE;AACtE,2CAAwD;AAGxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;AAE5E,qCAAqC;AACrC,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,2CAAG,CAAA;IACH,qDAAQ,CAAA;IACR,iDAAM,CAAA;AACR,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAED,MAAa,iBAAkB,SAAQ,qBAAW;IAoBzC,KAAK,CAAC,GAAG;QACd,MAAM,QAAQ,GAAI,IAAI,CAAC,KAAK,CAAC,mBAA8B,CAAC,WAAW,EAA8B,CAAC;QACtG,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QAEnC,MAAM,gBAAgB,GAAa,EAAE,CAAC;QAEtC,MAAM,IAAI,GAAe,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAClD,MAAM,eAAe,GAAyB,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE1E,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAA8B,EAAE,EAAE;YAClE,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC;YACzC,MAAM,OAAO,GACX,IAAI,KAAK,WAAW,CAA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BAAuB,CAAC;KAC1D,CAAC;CACH,CAAC;AACqB,kCAAgB,GAAG,IAAI,CAAC"}
@@ -1,12 +0,0 @@
1
- {
2
- "description": "displays the metadata for a standard or custom object",
3
- "examples": [
4
- "$ sfdx force:schema:sobject:describe -s Account",
5
- "$ sfdx force:schema:sobject:describe -s MyObject__c",
6
- "$ sfdx force:schema:sobject:describe -s ApexClass -t"
7
- ],
8
- "flags": {
9
- "objectType": "the API name of the object to describe",
10
- "useTooling": "execute with Tooling API"
11
- }
12
- }
@@ -1,13 +0,0 @@
1
- {
2
- "description": "list all objects of a specified category",
3
- "flags": {
4
- "typeDescription": "the type of objects to list (all|custom|standard)",
5
- "invalidTypeError": "\"Type\" flag can be set only to <all|custom|standard>."
6
- },
7
- "examples": [
8
- "$ sfdx force:schema:sobject:list -c all",
9
- "$ sfdx force:schema:sobject:list -c custom",
10
- "$ sfdx force:schema:sobject:list -c standard"
11
- ],
12
- "noTypeFound": "No %s objects found."
13
- }