Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sm/sf-ification #408

Merged
merged 62 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e834669
chore: updates from devScripts
Sep 29, 2022
42e039c
refactor: command flag errors
mshanemc Sep 30, 2022
922e929
Merge branch 'main' into devScripts2022-09-29
mshanemc Oct 6, 2022
1a49cdb
feat: uses sf-plugins-core
mshanemc Oct 20, 2022
dcd0bdf
chore: bump pluginCore and core
mshanemc Oct 20, 2022
3508ee3
test: all nuts as passing
mshanemc Oct 20, 2022
2212eb5
refactor: small pruning
mshanemc Oct 20, 2022
f3d067b
refactor: current tsconfig; tests build but fail
mshanemc Nov 2, 2022
020b99b
chore: bump sfCommand
mshanemc Nov 2, 2022
57b5126
chore: remove mkdir types
mshanemc Nov 8, 2022
671bdbe
test: ut all working as before
mshanemc Nov 10, 2022
a3092b2
chore: snapshot
mshanemc Nov 10, 2022
07a398b
chore: use sf commandRef
mshanemc Nov 10, 2022
c9e1d6d
test: refactor tests
mshanemc Nov 10, 2022
c311388
docs: description on bulk delete
mshanemc Nov 11, 2022
b6bd2fb
refactor: convert messages to md
mshanemc Nov 14, 2022
da9db0d
refactor: simplify examples
mshanemc Nov 14, 2022
ea19b8c
test: use static run method where not awaiting results
mshanemc Nov 14, 2022
68ef106
test: use testsession's new huborg prop
mshanemc Nov 14, 2022
5d978a1
Merge remote-tracking branch 'origin/main' into sm/sfcommand
mshanemc Nov 14, 2022
6f042c7
chore: bump core
mshanemc Nov 14, 2022
c0c336f
refactor: reorganize command tree
mshanemc Nov 15, 2022
940f28e
test: reorganize test folders to match commands
mshanemc Nov 15, 2022
9461597
refactor: message files flags start with flags
mshanemc Nov 15, 2022
7afd858
feat: apiVersion on connections
mshanemc Nov 15, 2022
377a773
chore: swc
mshanemc Nov 15, 2022
5ccce29
feat: tighter checks on salesforce IDs
mshanemc Nov 15, 2022
8a13b50
style: loadMessages for examples
mshanemc Nov 15, 2022
ec9c866
docs: sf-ify messages, dynamic bin/command
mshanemc Nov 17, 2022
fbc5bb8
refactor: use new versioned connection from core
mshanemc Nov 17, 2022
8a048f3
chore: bump core for versioned connections
mshanemc Nov 17, 2022
23c47c8
test: harden nuts for bulk checks
mshanemc Nov 17, 2022
7526813
test: remove ut for unstubbable bulk
mshanemc Nov 17, 2022
24820b0
chore: bump core, sf-plugins
mshanemc Nov 17, 2022
83b9b24
refactor: flags from sf-plugins
mshanemc Nov 17, 2022
66d0fd0
chore: snapshot
mshanemc Nov 17, 2022
eae6bce
docs: redo topic structure
mshanemc Nov 17, 2022
efa11cc
docs: subtopics
mshanemc Nov 17, 2022
7c0b3f6
chore: revert tsconfig
mshanemc Nov 17, 2022
38ae5b5
Merge remote-tracking branch 'salesforcecli/main' into sm/sf-ification
mshanemc Nov 17, 2022
ec1fcdd
refactor: import paths for link error
mshanemc Nov 17, 2022
9751dfd
docs: remove perflog references in help
mshanemc Nov 17, 2022
a3d70b2
chore: bump sf-plugins-core
mshanemc Dec 6, 2022
2e6a747
chore: lockfile dedupe
mshanemc Dec 6, 2022
928f388
refactor: use array flag from sf-plugins-core
mshanemc Dec 7, 2022
b7d09e2
chore: deprecate cmd aliases
mshanemc Dec 20, 2022
2752842
chore: dependency bumps and strict null checks
mshanemc Dec 20, 2022
f4e5572
refactor: test null exceptions
mshanemc Dec 20, 2022
7602d85
chore: bump linter
mshanemc Dec 20, 2022
b1990e7
docs: modernize messages
jshackell-sfdc Jan 2, 2023
09d1674
Merge remote-tracking branch 'salesforcecli/main' into sm/sf-ification
mshanemc Jan 2, 2023
1bc298d
chore: add schema check
mshanemc Jan 2, 2023
08912dd
fix: messages not used in help can't reference command's config/id
mshanemc Jan 9, 2023
d78ac1e
Merge remote-tracking branch 'salesforcecli/main' into sm/sf-ification
mshanemc Jan 9, 2023
29e3760
style: typo from qa
mshanemc Jan 10, 2023
d69138c
style: more message template fixes
mshanemc Jan 10, 2023
6d0b8de
style: readme and more typos from QA
mshanemc Jan 10, 2023
b72e2af
style: better message for multiple record scenario
mshanemc Jan 10, 2023
1da3147
fix: message, then error name
mshanemc Jan 10, 2023
4e98701
style: markdown formatting
mshanemc Jan 10, 2023
18c43c0
test: assert message that's really a message message
mshanemc Jan 10, 2023
23ee6aa
doc: try fixing in web UI
WillieRuemmele Jan 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license', 'plugin:sf-plugin/recommended'],
};
12 changes: 9 additions & 3 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"require": "ts-node/register,source-map-support/register",
"watch-extensions": "ts",
"watch-files": ["src", "test"],
"extensions": [".ts", "json"],
"watch-files": [
"src",
"test"
],
"extensions": [
".ts",
"json"
],
"recursive": true,
"reporter": "spec",
"timeout": 5000
"timeout": 10000
}
211 changes: 46 additions & 165 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022, Salesforce.com, Inc.
Copyright (c) 2023, Salesforce.com, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
1,267 changes: 947 additions & 320 deletions README.md

Large diffs are not rendered by default.

136 changes: 59 additions & 77 deletions command-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,130 +1,112 @@
[
{
"command": "force:data:bulk:delete",
"command": "data:create:record",
"plugin": "@salesforce/plugin-data",
"flags": ["apiversion", "csvfile", "json", "loglevel", "sobjecttype", "targetusername", "wait"],
"alias": []
"flags": ["api-version", "json", "loglevel", "perflog", "sobject", "target-org", "use-tooling-api", "values"],
"alias": ["force:data:record:create"]
},
{
"command": "force:data:bulk:status",
"command": "data:delete:bulk",
"plugin": "@salesforce/plugin-data",
"flags": ["apiversion", "batchid", "jobid", "json", "loglevel", "targetusername"],
"alias": []
"flags": ["api-version", "file", "json", "loglevel", "sobject", "target-org", "wait"],
"alias": ["force:data:bulk:delete"]
},
{
"command": "force:data:bulk:upsert",
"command": "data:delete:record",
"plugin": "@salesforce/plugin-data",
"flags": [
"apiversion",
"csvfile",
"externalid",
"json",
"loglevel",
"serial",
"sobjecttype",
"targetusername",
"wait"
],
"alias": []
},
{
"command": "force:data:record:create",
"plugin": "@salesforce/plugin-data",
"flags": ["apiversion", "json", "loglevel", "perflog", "sobjecttype", "targetusername", "usetoolingapi", "values"],
"alias": []
},
{
"command": "force:data:record:delete",
"plugin": "@salesforce/plugin-data",
"flags": [
"apiversion",
"api-version",
"json",
"loglevel",
"perflog",
"sobjectid",
"sobjecttype",
"targetusername",
"usetoolingapi",
"record-id",
"sobject",
"target-org",
"use-tooling-api",
"where"
],
"alias": []
"alias": ["force:data:record:delete"]
},
{
"command": "force:data:record:get",
"command": "data:export:tree",
"plugin": "@salesforce/plugin-data",
"flags": [
"apiversion",
"json",
"loglevel",
"perflog",
"sobjectid",
"sobjecttype",
"targetusername",
"usetoolingapi",
"where"
],
"alias": []
"flags": ["api-version", "json", "loglevel", "output-dir", "plan", "prefix", "query", "target-org"],
"alias": ["force:data:tree:export"]
},
{
"command": "force:data:record:update",
"command": "data:get:record",
"plugin": "@salesforce/plugin-data",
"flags": [
"apiversion",
"api-version",
"json",
"loglevel",
"perflog",
"sobjectid",
"sobjecttype",
"targetusername",
"usetoolingapi",
"values",
"record-id",
"sobject",
"target-org",
"use-tooling-api",
"where"
],
"alias": []
"alias": ["force:data:record:get"]
},
{
"command": "force:data:soql:bulk:report",
"command": "data:import:tree",
"plugin": "@salesforce/plugin-data",
"flags": ["apiversion", "bulkqueryid", "json", "loglevel", "resultformat", "targetusername"],
"alias": []
"flags": ["api-version", "config-help", "content-type", "files", "json", "loglevel", "plan", "target-org"],
"alias": ["force:data:tree:import"]
},
{
"command": "force:data:soql:query",
"command": "data:query",
"plugin": "@salesforce/plugin-data",
"flags": [
"apiversion",
"api-version",
"async",
"bulk",
"file",
"json",
"loglevel",
"perflog",
"query",
"resultformat",
"soqlqueryfile",
"targetusername",
"usetoolingapi",
"result-format",
"target-org",
"use-tooling-api",
"wait"
],
"alias": []
"alias": ["force:data:soql:query"]
},
{
"command": "data:query:resume",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "bulk-query-id", "json", "loglevel", "result-format", "target-org"],
"alias": ["force:data:soql:bulk:report"]
},
{
"command": "force:data:tree:export",
"command": "data:resume",
"plugin": "@salesforce/plugin-data",
"flags": ["apiversion", "json", "loglevel", "outputdir", "plan", "prefix", "query", "targetusername"],
"alias": []
"flags": ["api-version", "batch-id", "job-id", "json", "loglevel", "target-org"],
"alias": ["force:data:bulk:status"]
},
{
"command": "force:data:tree:import",
"command": "data:update:record",
"plugin": "@salesforce/plugin-data",
"flags": [
"apiversion",
"confighelp",
"contenttype",
"api-version",
"json",
"loglevel",
"plan",
"sobjecttreefiles",
"targetusername"
"perflog",
"record-id",
"sobject",
"target-org",
"use-tooling-api",
"values",
"where"
],
"alias": []
"alias": ["force:data:record:update"]
},
{
"command": "data:upsert:bulk",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "external-id", "file", "json", "loglevel", "serial", "sobject", "target-org", "wait"],
"alias": ["force:data:bulk:upsert"]
}
]
12 changes: 0 additions & 12 deletions messages/batcher.json

This file was deleted.

39 changes: 39 additions & 0 deletions messages/batcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# BulkBatch

Batch #%s

# BulkError

Upsert errors

# BulkJobStatus

Job Status

# BatchStatus

Batch Status

# PollingInfo

Will poll the batch statuses every %s seconds.
To fetch the status on your own, press CTRL+C and use the command:
sfdx data resume -i %s -b [<batchId>]

# ExternalIdRequired

An External ID is required on %s to perform an upsert.

# TimeOut

The operation timed out. Check the status with command:
sfdx data resume -i %s -b %s

# CheckStatusCommand

Check batch #%s’s status with the command:
sfdx data resume -i %s -b %s

# BatchQueued

Batch #%s queued (Batch ID: %s).
12 changes: 0 additions & 12 deletions messages/bulk.delete.json

This file was deleted.

31 changes: 31 additions & 0 deletions messages/bulk.delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# summary

Bulk delete records from an org using a CSV file.

# description

The CSV file must have only one column ("Id") and then the list of record IDs you want to delete, one ID per line.

When you execute this command, it starts a job and one or more batches, displays their IDs, and then immediately returns control of the terminal to you by default. If you prefer to wait, set the --wait flag to the number of minutes; if it times out, the command outputs the IDs. Use the job and batch IDs to check the status of the job with the "<%= config.bin %> data resume" command. A single job can contain many batches, depending on the length of the CSV file.

# examples

- Bulk delete Account records using the list of IDs in the "files/delete.csv" file:

<%= config.bin %> <%= command.id %> --sobject Account --file files/delete.csv

- Bulk delete records from a custom object and wait 5 minutes for the command to complete:

<%= config.bin %> <%= command.id %> --sobject MyObject__c --file files/delete.csv --wait 5

# flags.sobjecttype

API name of the Salesforce object, either standard or custom, that you want to delete records from.

# flags.csvfile

CSV file that contains the IDs of the records to delete.

# flags.wait

Number of minutes to wait for the command to complete before displaying the results.
7 changes: 0 additions & 7 deletions messages/bulk.report.json

This file was deleted.

17 changes: 17 additions & 0 deletions messages/bulk.report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# summary

View the status of a bulk query.

# description

Run this command using the job ID returned from the "<%= config.bin %> data query --bulk" command.

# examples

- View the status of a bulk query with the specified ID:

<%= config.bin %> <%= command.id %> --bulk-query-id 7500x000005BdFzXXX

# flags.bulkQueryId

Job ID of the bulk query.
12 changes: 0 additions & 12 deletions messages/bulk.status.json

This file was deleted.

29 changes: 29 additions & 0 deletions messages/bulk.status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# summary

View the status of a bulk data load job or batch.

# description

Run this command using the job ID or batch ID returned from the "<%= config.bin %> data delete bulk" or "<%= config.bin %> data upsert bulk" commands.

# examples

- View the status of a bulk load job:

<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA

- View the status of a bulk load job and a specific batches:

<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA --batch-id 751xx000000005nAAA

# flags.jobid

ID of the job whose status you want to view.

# flags.batchid

ID of the batch whose status you want to view; you must also specify the job ID.

# NoBatchFound

Unable to find batch %s for job %s.
Loading