@salesforce/plugin-sobject 0.0.38 → 0.0.39
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/lib/commands/generate/metadata/field.d.ts +2 -2
- package/lib/commands/generate/metadata/platformevent.d.ts +1 -1
- package/lib/commands/generate/metadata/sobject.d.ts +1 -1
- package/lib/commands/generate/metadata/tab.d.ts +1 -1
- package/lib/shared/prompts/prompts.d.ts +1 -1
- package/lib/shared/prompts/relationshipField.d.ts +1 -1
- package/lib/shared/types.d.ts +4 -4
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { CustomField } from 'jsforce/api/metadata';
|
|
3
3
|
declare const supportedFieldTypesCustomObject: readonly ["AutoNumber", "Checkbox", "Currency", "DateTime", "Date", "Email", "Html", "Location", "LongTextArea", "Lookup", "MasterDetail", "Number", "Phone", "Picklist", "Text", "Time", "Url"];
|
|
4
|
-
|
|
4
|
+
type SaveableCustomField = Pick<CustomField, 'label' | 'description' | 'trackHistory' | 'inlineHelpText' | 'required' | 'fullName' | 'type' | 'scale' | 'precision' | 'visibleLines' | 'length'> & {
|
|
5
5
|
displayLocationInDecimal?: boolean;
|
|
6
6
|
type: typeof supportedFieldTypesCustomObject[number];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type FieldGenerateResult = {
|
|
9
9
|
field: SaveableCustomField;
|
|
10
10
|
path: string;
|
|
11
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { SaveablePlatformEvent } from '../../../shared/types';
|
|
3
|
-
export
|
|
3
|
+
export type PlatformEventGenerateResult = {
|
|
4
4
|
object: SaveablePlatformEvent;
|
|
5
5
|
path: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { SaveableCustomObject } from '../../../shared/types';
|
|
3
|
-
export
|
|
3
|
+
export type CustomObjectGenerateResult = {
|
|
4
4
|
object: SaveableCustomObject;
|
|
5
5
|
path: string;
|
|
6
6
|
};
|
|
@@ -2,7 +2,7 @@ import { NamedPackageDir } from '@salesforce/core';
|
|
|
2
2
|
import { Question, ListQuestion } from 'inquirer';
|
|
3
3
|
import { ValueSet } from 'jsforce/api/metadata';
|
|
4
4
|
export declare const makeNameApiCompatible: (input: string) => string;
|
|
5
|
-
|
|
5
|
+
type ObjectType = 'CustomObject' | 'PlatformEvent' | 'CustomField';
|
|
6
6
|
export declare const directoryPrompt: (packageDirs: NamedPackageDir[]) => Promise<ListQuestion>;
|
|
7
7
|
export declare const pluralPrompt: (label: string) => Question;
|
|
8
8
|
export declare const apiNamePrompt: (label: string, objectType: ObjectType) => Question;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NamedPackageDir } from '@salesforce/core';
|
|
2
2
|
import { CustomField } from 'jsforce/api/metadata';
|
|
3
|
-
|
|
3
|
+
type RelationshipFieldProperties = Pick<CustomField, 'referenceTo' | 'relationshipLabel' | 'relationshipName' | 'deleteConstraint' | 'reparentableMasterDetail' | 'writeRequiresMasterRead' | 'relationshipOrder'>;
|
|
4
4
|
export declare const relationshipFieldPrompts: ({ type, packageDirs, childObjectFolderPath, }: {
|
|
5
5
|
type: 'MasterDetail' | 'Lookup';
|
|
6
6
|
packageDirs: NamedPackageDir[];
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { CustomObject, CustomField } from 'jsforce/api/metadata';
|
|
2
2
|
/** Used to capture the types for NameField in the inquirer prompts */
|
|
3
|
-
export
|
|
3
|
+
export type NameFieldResponse = {
|
|
4
4
|
nameFieldType: 'Text' | 'AutoNumber';
|
|
5
5
|
nameFieldLabel: 'string';
|
|
6
6
|
autoNumberFormat?: string;
|
|
7
7
|
};
|
|
8
8
|
/** Used by classical CustomObject */
|
|
9
|
-
|
|
9
|
+
type NameField = Pick<CustomField, 'label' | 'type' | 'displayFormat'>;
|
|
10
10
|
/**
|
|
11
11
|
* There are a lot of properties that we don't, and some that jsforce thinks are mandatory that aren't.
|
|
12
12
|
* Many apply to the various sub-species (mdt, external, events)
|
|
13
13
|
*
|
|
14
14
|
* This type represents a PlatformEvent that can deploy.
|
|
15
|
-
*/ export
|
|
15
|
+
*/ export type SaveablePlatformEvent = Pick<CustomObject, 'fullName' | 'label' | 'deploymentStatus' | 'description' | 'pluralLabel' | 'eventType' | 'publishBehavior'>;
|
|
16
16
|
/**
|
|
17
17
|
* There are a lot of properties that we don't, and some that jsforce thinks are mandatory that aren't.
|
|
18
18
|
* Many apply to the various sub-species (mdt, external, events)
|
|
19
19
|
*
|
|
20
20
|
* This type represents a "classical" CustomObject subset that can deploy.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type SaveableCustomObject = Pick<CustomObject, 'label' | 'deploymentStatus' | 'description' | 'enableHistory' | 'enableActivities' | 'enableBulkApi' | 'enableFeeds' | 'enableReports' | 'enableSearch' | 'enableStreamingApi' | 'enableSharing' | 'pluralLabel' | 'sharingModel' | 'fullName'> & {
|
|
23
23
|
nameField: NameField;
|
|
24
24
|
};
|
|
25
25
|
export {};
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.0.
|
|
1
|
+
{"version":"0.0.39","commands":{"generate:metadata:field":{"id":"generate:metadata:field","summary":"Generate metadata source files for a new custom field on a specified object.","description":"This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the field's label with the \"--label\" flag. The command uses this label to provide intelligent suggestions for other field properties, such as its API name.\n\nYou can generate a custom field on either a standard object, such as Account, or a custom object. In both cases, the source files for the object must already exist in your local project before you run this command. If you create a relationship field, the source files for the parent object must also exist in your local directory. Use the command \"sf metadata retrieve -m CustomObject:<object>\" to retrieve source files for both standard and custom objects from your org. To create a custom object, run the \"sf generate metadata sobject\" command or use the Object Manager UI in your Salesforce org.","strict":true,"pluginName":"@salesforce/plugin-sobject","pluginAlias":"@salesforce/plugin-sobject","pluginType":"core","state":"beta","aliases":[],"examples":["Create a field with the specified label; the command prompts you for the object:\n<%= config.bin %> <%= command.id %> --label \"My Field\"","Specify the local path to the object's folder:\n<%= config.bin %> <%= command.id %> --label \"My Field\" --object force-app/main/default/objects/MyObject__c"],"flags":{"label":{"name":"label","type":"option","char":"l","summary":"The field's label.","required":true,"multiple":false},"object":{"name":"object","type":"option","char":"o","summary":"The directory that contains the object's source files.","description":"The object source files in your local project are grouped in a directoy with the same name as the object. Custom object names always end in \"__c\". An example of the object directory for the Account standard object is \"force-app/main/default/objects/Account\" An example custom object directory is \"force-app/main/default/objects/MyObject__c\"\n\nIf you don't specify this flag, the command prompts you to choose from your local objects.","multiple":false}},"args":[],"requiresProject":true},"generate:metadata:platformevent":{"id":"generate:metadata:platformevent","summary":"Generate metadata source files for a new platform event.","description":"This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the event's label with the \"--label\" flag. The command uses this label to provide intelligent suggestions for other event properties, such as its API name.","strict":true,"pluginName":"@salesforce/plugin-sobject","pluginAlias":"@salesforce/plugin-sobject","pluginType":"core","state":"beta","aliases":[],"examples":["Create a platform event with the specified label:\n<%= config.bin %> <%= command.id %> --label \"My Platform Event\""],"flags":{"label":{"name":"label","type":"option","char":"l","summary":"The platform event's label.","required":true,"multiple":false}},"args":[],"requiresProject":true},"generate:metadata:sobject":{"id":"generate:metadata:sobject","summary":"Generate metadata source files for a new custom object.","description":"This command is interactive and must be run in a Salesforce DX project directory. You're required to specify the object's label with the \"--label\" flag. The command uses this label to provide intelligent suggestions for other object properties, such as its API name and plural label.\n\nAll Salesforce objects are required to have a Name field, so this command also prompts you for the label and type of the Name field. Run the \"sf metadata generate field\" command to create additional fields for the object.\n\nTo reduce the number of prompts, use the \"--use-default-features\" flag to automatically enable some features, such as reporting and search on the object.","strict":true,"pluginName":"@salesforce/plugin-sobject","pluginAlias":"@salesforce/plugin-sobject","pluginType":"core","state":"beta","aliases":[],"examples":["Create a custom object with the specified label and be prompted for additional information:\n<%= config.bin %> <%= command.id %> --label \"My Object\"","Create a custom object and enable optional features without prompting:\n<%= config.bin %> <%= command.id %> --label \"My Object\" --use-default-features"],"flags":{"label":{"name":"label","type":"option","char":"l","summary":"The custom object's label.","required":true,"multiple":false},"use-default-features":{"name":"use-default-features","type":"boolean","char":"f","summary":"Enable all optional features without prompting.","description":"Enables these features:\n\n* Search: Allows users to find the custom object's records when they search, including SOSL.\n* Feeds: Enables feed tracking.\n* Reports: Allows reporting of the data in the custom object records.\n* History: Enables object history tracking.\n* Activities: Allows users to associate tasks and scheduled calendar events related to the custom object records.\n* Bulk API: With Sharing and Streaming API, classifies the custom object as an Enterprise Application object.\n* Sharing: With Bulk API and Streaming API, classifies the custom object as an Enterprise Application object.\n* Streaming API: With Bulk API and Sharing, classifies the custom object as an Enterprise Application object.","allowNo":false}},"args":[],"requiresProject":true},"generate:metadata:tab":{"id":"generate:metadata:tab","summary":"Generate the metadata source files for a new custom tab on a custom object.","description":"Custom tabs let you display custom object data or other web content in Salesforce. Custom tabs appear in Salesforce as an item in the app’s navigation bar and in the App Launcher.\n\nThis command must be run in a Salesforce DX project directory. You must pass all required information to it with the required flags. The source files for the custom object for which you're generating a tab don't need to exist in your local project.","strict":true,"pluginName":"@salesforce/plugin-sobject","pluginAlias":"@salesforce/plugin-sobject","pluginType":"core","state":"beta","aliases":[],"examples":["Create a tab on the MyObject__c custom object:\n<%= config.bin %> <%= command.id %> --object MyObject__c --icon 54 --directory force-app/main/default/tabs"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"object":{"name":"object","type":"option","char":"o","summary":"API name of the custom object you're generating a tab for.","description":"The API name for a custom object always ends in \"__c\", such as \"MyObject__c\".","required":true,"multiple":false},"directory":{"name":"directory","type":"option","char":"d","summary":"Path to a \"tabs\" directory that will contain the source files for your new tab.","required":true,"multiple":false},"icon":{"name":"icon","type":"option","char":"i","summary":"Number from 1 to 100 that specifies the color scheme and icon for the custom tab.","description":"See https://lightningdesignsystem.com/icons/\\#custom for the available icons.","required":true,"multiple":false,"default":1}},"args":[],"requiresProject":true}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-sobject",
|
|
3
3
|
"description": "Create objects, fields, tabs, etc",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.39",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@salesforce/sf-plugins-core": "^1.19.0",
|
|
12
12
|
"change-case": "^4.1.2",
|
|
13
13
|
"fast-glob": "^3.2.12",
|
|
14
|
-
"fast-xml-parser": "^4.0.
|
|
14
|
+
"fast-xml-parser": "^4.0.13",
|
|
15
15
|
"inquirer": "^8.2.5",
|
|
16
16
|
"js2xmlparser": "^4.0.2",
|
|
17
17
|
"tslib": "^2"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@salesforce/dev-scripts": "^3.1.0",
|
|
25
25
|
"@salesforce/plugin-command-reference": "^2.2.8",
|
|
26
26
|
"@salesforce/prettier-config": "^0.0.2",
|
|
27
|
-
"@salesforce/ts-sinon": "1.4.
|
|
27
|
+
"@salesforce/ts-sinon": "1.4.3",
|
|
28
28
|
"@swc/core": "^1.3.24",
|
|
29
29
|
"@types/inquirer": "^8.2.0",
|
|
30
30
|
"@types/shelljs": "^0.8.11",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"eslint": "^8.30.0",
|
|
35
35
|
"eslint-config-prettier": "^8.5.0",
|
|
36
36
|
"eslint-config-salesforce": "^1.1.0",
|
|
37
|
-
"eslint-config-salesforce-license": "^0.
|
|
37
|
+
"eslint-config-salesforce-license": "^0.2.0",
|
|
38
38
|
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
39
39
|
"eslint-plugin-header": "^3.0.0",
|
|
40
40
|
"eslint-plugin-import": "2.26.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"shx": "0.3.4",
|
|
51
51
|
"sinon": "10.0.0",
|
|
52
52
|
"ts-node": "^10.9.1",
|
|
53
|
-
"typescript": "^4.
|
|
53
|
+
"typescript": "^4.9.4"
|
|
54
54
|
},
|
|
55
55
|
"config": {},
|
|
56
56
|
"engines": {
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"access": "public"
|
|
121
121
|
},
|
|
122
122
|
"sfdx": {
|
|
123
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/0.0.
|
|
124
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/0.0.
|
|
123
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/0.0.39.crt",
|
|
124
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/0.0.39.sig"
|
|
125
125
|
}
|
|
126
126
|
}
|