Skip to content

Commit ec8e27f

Browse files
authored
Merge pull request #217 from salesforcecli/wr/parkingOrbit
fix: parking orbit plugin-schema
2 parents 3459119 + 9d43b92 commit ec8e27f

6 files changed

Lines changed: 3732 additions & 1711 deletions

File tree

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021, Salesforce.com, Inc.
1+
Copyright (c) 2022, Salesforce.com, Inc.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

command-snapshot.json

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
[
2-
{
3-
"command": "force:schema:sobject:describe",
4-
"plugin": "@salesforce/plugin-schema",
5-
"flags": [
6-
"apiversion",
7-
"json",
8-
"loglevel",
9-
"sobjecttype",
10-
"targetusername",
11-
"usetoolingapi"
12-
]
13-
},
14-
{
15-
"command": "force:schema:sobject:list",
16-
"plugin": "@salesforce/plugin-schema",
17-
"flags": [
18-
"apiversion",
19-
"json",
20-
"loglevel",
21-
"sobjecttypecategory",
22-
"targetusername"
23-
]
24-
}
25-
]
2+
{
3+
"command": "force:schema:sobject:describe",
4+
"plugin": "@salesforce/plugin-schema",
5+
"flags": ["apiversion", "json", "loglevel", "sobjecttype", "targetusername", "usetoolingapi"],
6+
"alias": []
7+
},
8+
{
9+
"command": "force:schema:sobject:list",
10+
"plugin": "@salesforce/plugin-schema",
11+
"flags": ["apiversion", "json", "loglevel", "sobjecttypecategory", "targetusername"],
12+
"alias": []
13+
}
14+
]

package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"name": "@salesforce/plugin-schema",
33
"description": "Commands to interact with salesforce sobject schemas",
4-
"version": "1.1.0",
4+
"version": "2.0.0",
55
"author": "Salesforce",
6+
"main": "lib/index.js",
67
"bugs": "https://github.com/forcedotcom/cli/issues",
78
"dependencies": {
8-
"@oclif/config": "^1",
9-
"@salesforce/command": "^4.2.0",
10-
"@salesforce/core": "^2.31.0",
9+
"@oclif/core": "^1.6.3",
10+
"@salesforce/command": "^5.0.4",
11+
"@salesforce/core": "^3.12.1",
1112
"tslib": "^2"
1213
},
1314
"devDependencies": {
14-
"@oclif/dev-cli": "^1",
15-
"@oclif/plugin-command-snapshot": "^2.2.2",
15+
"oclif": "^2.6.3",
16+
"@oclif/plugin-command-snapshot": "^3",
1617
"@salesforce/cli-plugins-testkit": "^1.4.11",
17-
"@salesforce/dev-config": "^2.1.2",
18-
"@salesforce/dev-scripts": "^1.0.2",
18+
"@salesforce/dev-config": "^3.0.1",
19+
"@salesforce/dev-scripts": "^2.0.1",
1920
"@salesforce/plugin-command-reference": "^1.3.0",
2021
"@salesforce/prettier-config": "^0.0.2",
2122
"@salesforce/ts-sinon": "1.3.21",
@@ -34,7 +35,7 @@
3435
"eslint-plugin-prettier": "^3.1.3",
3536
"husky": "^7.0.4",
3637
"lint-staged": "^11.0.0",
37-
"mocha": "^8.4.0",
38+
"mocha": "^9.1.3",
3839
"nyc": "^15.1.0",
3940
"prettier": "^2.0.5",
4041
"pretty-quick": "^3.1.0",
@@ -109,7 +110,7 @@
109110
"test:command-reference": "./bin/run commandreference:generate --erroronwarnings",
110111
"test:deprecation-policy": "./bin/run snapshot:compare",
111112
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
112-
"version": "oclif-dev readme"
113+
"version": "oclif readme"
113114
},
114115
"publishConfig": {
115116
"access": "public"

src/commands/force/schema/sobject/list.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*/
77
import { EOL } from 'os';
88
import { flags, FlagsConfig, SfdxCommand } from '@salesforce/command';
9-
import { Connection, Messages, SfdxError } from '@salesforce/core';
10-
import { DescribeGlobalSObjectResult, DescribeGlobalResult } from 'jsforce';
9+
import { Connection, Messages } from '@salesforce/core';
10+
import { DescribeSObjectResult, DescribeGlobalResult } from 'jsforce';
1111

1212
Messages.importMessagesDirectory(__dirname);
1313
const messages = Messages.loadMessages('@salesforce/plugin-schema', 'list');
@@ -30,7 +30,7 @@ export class SchemaSobjectList extends SfdxCommand {
3030
const capitalized = val.toUpperCase();
3131
const result = capitalized === 'ALL' || capitalized === 'STANDARD' || capitalized === 'CUSTOM';
3232
if (!result) {
33-
throw SfdxError.create('@salesforce/plugin-schema', 'list', 'flags.invalidTypeError');
33+
throw messages.createError('flags.invalidTypeError');
3434
}
3535
return result;
3636
},
@@ -50,7 +50,7 @@ export class SchemaSobjectList extends SfdxCommand {
5050

5151
let havePrinted = false;
5252

53-
allDescriptions.sobjects.forEach((sobject: DescribeGlobalSObjectResult) => {
53+
allDescriptions.sobjects.forEach((sobject: DescribeSObjectResult) => {
5454
const isCustom = sobject.custom === true;
5555
const doPrint =
5656
type === SObjectType.ALL ||

test/commands/schema/describe.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('force:schema:sobject:list', function (): void {
1414
const errorMessage = 'describeGlobal query failed';
1515
const expected = { actionOverrides: [], activateable: false, associateEntityType: null, associateParentEntity: null };
1616
async function prepareStubs(queryThrows = false, useTooling = false) {
17-
$$.SANDBOX.stub(Org.prototype, 'getConnection').callsFake(() => Connection.prototype);
17+
$$.SANDBOX.stub(Org.prototype, 'getConnection').returns(Connection.prototype);
1818

1919
if (useTooling) {
2020
const testConnectionOptions = { loginUrl: 'connectionTest/loginUrl' };

0 commit comments

Comments
 (0)