Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cd/remove-legacy-comm…
Browse files Browse the repository at this point in the history
…ands
  • Loading branch information
cristiand391 committed Dec 18, 2024
2 parents b5ef71a + fd5ff39 commit a1afaa8
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 64 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [3.13.5](https://github.com/salesforcecli/plugin-data/compare/3.13.4...3.13.5) (2024-12-16)

### Bug Fixes

- **bulk:** fallback `columnDelimtier` to `COMMA` ([#1151](https://github.com/salesforcecli/plugin-data/issues/1151)) ([82d1e5e](https://github.com/salesforcecli/plugin-data/commit/82d1e5ed6a077082c84e87d45df0be2ff8de19b4))

## [3.13.4](https://github.com/salesforcecli/plugin-data/compare/3.13.3...3.13.4) (2024-12-15)

### Bug Fixes

- **deps:** bump ansis from 3.3.2 to 3.4.0 ([960eb94](https://github.com/salesforcecli/plugin-data/commit/960eb94eb6da63457abdee664c880dd515ddbf81))

## [3.13.3](https://github.com/salesforcecli/plugin-data/compare/3.13.2...3.13.3) (2024-12-13)

### Bug Fixes

- **data:query:** deprecate bulk mode ([cbfa64b](https://github.com/salesforcecli/plugin-data/commit/cbfa64ba07fc096d72c7c131339aa4427b11c38e))

## [3.13.2](https://github.com/salesforcecli/plugin-data/compare/3.13.1...3.13.2) (2024-12-11)

### Bug Fixes
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ EXAMPLES
$ sf data bulk results --job-id 7507i000fake341G --target-org my-scratch
```

_See code: [src/commands/data/bulk/results.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/bulk/results.ts)_
_See code: [src/commands/data/bulk/results.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/bulk/results.ts)_

## `sf data create file`

Expand Down Expand Up @@ -194,7 +194,7 @@ EXAMPLES
$ sf data create file --file path/to/astro.png --parent-id a03fakeLoJWPIA3
```

_See code: [src/commands/data/create/file.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/create/file.ts)_
_See code: [src/commands/data/create/file.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/create/file.ts)_

## `sf data create record`

Expand Down Expand Up @@ -250,7 +250,7 @@ EXAMPLES
TracedEntityId=01p17000000R6bLAAS"
```

_See code: [src/commands/data/create/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/create/record.ts)_
_See code: [src/commands/data/create/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/create/record.ts)_

## `sf data delete bulk`

Expand Down Expand Up @@ -311,7 +311,7 @@ FLAG DESCRIPTIONS
and can be enabled only by a system administrator.
```

_See code: [src/commands/data/delete/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/delete/bulk.ts)_
_See code: [src/commands/data/delete/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/delete/bulk.ts)_

## `sf data delete record`

Expand Down Expand Up @@ -372,7 +372,7 @@ EXAMPLES
$ sf data delete record --use-tooling-api --sobject TraceFlag --record-id 7tf8c
```

_See code: [src/commands/data/delete/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/delete/record.ts)_
_See code: [src/commands/data/delete/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/delete/record.ts)_

## `sf data delete resume`

Expand Down Expand Up @@ -411,7 +411,7 @@ EXAMPLES
$ sf data delete resume --use-most-recent --target-org my-scratch
```

_See code: [src/commands/data/delete/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/delete/resume.ts)_
_See code: [src/commands/data/delete/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/delete/resume.ts)_

## `sf data export bulk`

Expand Down Expand Up @@ -485,7 +485,7 @@ EXAMPLES
--result-format json --async
```

_See code: [src/commands/data/export/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/export/bulk.ts)_
_See code: [src/commands/data/export/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/export/bulk.ts)_

## `sf data export resume`

Expand Down Expand Up @@ -521,7 +521,7 @@ EXAMPLES
$ sf data export resume --use-most-recent --target-org my-scratch
```

_See code: [src/commands/data/export/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/export/resume.ts)_
_See code: [src/commands/data/export/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/export/resume.ts)_

## `sf data export tree`

Expand Down Expand Up @@ -582,7 +582,7 @@ EXAMPLES
my-scratch
```

_See code: [src/commands/data/export/tree.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/export/tree.ts)_
_See code: [src/commands/data/export/tree.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/export/tree.ts)_

## `sf data get record`

Expand Down Expand Up @@ -646,7 +646,7 @@ EXAMPLES
$ sf data get record --use-tooling-api --sobject TraceFlag --record-id 7tf8c
```

_See code: [src/commands/data/get/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/get/record.ts)_
_See code: [src/commands/data/get/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/get/record.ts)_

## `sf data import bulk`

Expand Down Expand Up @@ -704,7 +704,7 @@ EXAMPLES
$ sf data import bulk --file accounts.csv --sobject Account --async
```

_See code: [src/commands/data/import/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/import/bulk.ts)_
_See code: [src/commands/data/import/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/import/bulk.ts)_

## `sf data import resume`

Expand Down Expand Up @@ -740,7 +740,7 @@ EXAMPLES
$ sf data import resume --use-most-recent --target-org my-scratch
```

_See code: [src/commands/data/import/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/import/resume.ts)_
_See code: [src/commands/data/import/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/import/resume.ts)_

## `sf data import tree`

Expand Down Expand Up @@ -805,7 +805,7 @@ FLAG DESCRIPTIONS
- files(array) - Files: An array of files paths to load
```

_See code: [src/commands/data/import/tree.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/import/tree.ts)_
_See code: [src/commands/data/import/tree.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/import/tree.ts)_

## `sf data query`

Expand Down Expand Up @@ -871,7 +871,7 @@ EXAMPLES
$ sf data query --query "SELECT Id FROM Contact" --bulk --wait 0
```

_See code: [src/commands/data/query.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/query.ts)_
_See code: [src/commands/data/query.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/query.ts)_

## `sf data query resume`

Expand Down Expand Up @@ -908,7 +908,7 @@ EXAMPLES
$ sf data query resume --bulk-query-id 7500x000005BdFzXXX
```

_See code: [src/commands/data/query/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/query/resume.ts)_
_See code: [src/commands/data/query/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/query/resume.ts)_

## `sf data resume`

Expand Down Expand Up @@ -945,7 +945,7 @@ EXAMPLES
$ sf data resume --job-id 750xx000000005sAAA --batch-id 751xx000000005nAAA
```

_See code: [src/commands/data/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/resume.ts)_
_See code: [src/commands/data/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/resume.ts)_

## `sf data search`

Expand Down Expand Up @@ -995,7 +995,7 @@ EXAMPLES
$ sf data search --file query.txt --target-org my-scratch --result-format csv
```

_See code: [src/commands/data/search.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/search.ts)_
_See code: [src/commands/data/search.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/search.ts)_

## `sf data update bulk`

Expand Down Expand Up @@ -1056,7 +1056,7 @@ EXAMPLES
$ sf data update bulk --file accounts.csv --sobject Account --async
```

_See code: [src/commands/data/update/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/update/bulk.ts)_
_See code: [src/commands/data/update/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/update/bulk.ts)_

## `sf data update record`

Expand Down Expand Up @@ -1118,7 +1118,7 @@ EXAMPLES
"ExpirationDate=2017-12-01T00:58:04.000+0000"
```

_See code: [src/commands/data/update/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/update/record.ts)_
_See code: [src/commands/data/update/record.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/update/record.ts)_

## `sf data update resume`

Expand Down Expand Up @@ -1154,7 +1154,7 @@ EXAMPLES
$ sf data update resume --use-most-recent --target-org my-scratch
```

_See code: [src/commands/data/update/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/update/resume.ts)_
_See code: [src/commands/data/update/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/update/resume.ts)_

## `sf data upsert bulk`

Expand Down Expand Up @@ -1213,7 +1213,7 @@ EXAMPLES
my-scratch
```

_See code: [src/commands/data/upsert/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/upsert/bulk.ts)_
_See code: [src/commands/data/upsert/bulk.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/upsert/bulk.ts)_

## `sf data upsert resume`

Expand Down Expand Up @@ -1252,7 +1252,7 @@ EXAMPLES
$ sf data upsert resume --use-most-recent --target-org my-scratch
```

_See code: [src/commands/data/upsert/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/data/upsert/resume.ts)_
_See code: [src/commands/data/upsert/resume.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/data/upsert/resume.ts)_

## `sf force data bulk delete`

Expand Down Expand Up @@ -1299,7 +1299,7 @@ EXAMPLES
$ sf force data bulk delete --sobject MyObject__c --file files/delete.csv --wait 5 --target-org my-scratch
```

_See code: [src/commands/force/data/bulk/delete.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/force/data/bulk/delete.ts)_
_See code: [src/commands/force/data/bulk/delete.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/force/data/bulk/delete.ts)_

## `sf force data bulk status`

Expand Down Expand Up @@ -1336,7 +1336,7 @@ EXAMPLES
$ sf force data bulk status --job-id 750xx000000005sAAA --batch-id 751xx000000005nAAA --target-org my-scratch
```

_See code: [src/commands/force/data/bulk/status.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/force/data/bulk/status.ts)_
_See code: [src/commands/force/data/bulk/status.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/force/data/bulk/status.ts)_

## `sf force data bulk upsert`

Expand Down Expand Up @@ -1394,6 +1394,6 @@ EXAMPLES
--target-org my-scratch
```

_See code: [src/commands/force/data/bulk/upsert.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.2/src/commands/force/data/bulk/upsert.ts)_
_See code: [src/commands/force/data/bulk/upsert.ts](https://github.com/salesforcecli/plugin-data/blob/3.13.5/src/commands/force/data/bulk/upsert.ts)_

<!-- commandsstop -->
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/plugin-data",
"version": "3.13.2",
"version": "3.13.5",
"description": "Plugin for salesforce data commands",
"author": "Salesforce",
"homepage": "https://github.com/salesforcecli/plugin-data",
Expand Down Expand Up @@ -124,20 +124,20 @@
"@salesforce/kit": "^3.2.2",
"@salesforce/sf-plugins-core": "^12.1.0",
"@salesforce/ts-types": "^2.0.11",
"ansis": "^3.2.0",
"ansis": "^3.4.0",
"change-case": "^5.4.4",
"csv-parse": "^5.6.0",
"csv-stringify": "^6.5.2",
"form-data": "^4.0.0",
"terminal-link": "^3.0.0"
},
"devDependencies": {
"@oclif/core": "^4.0.34",
"@oclif/core": "^4.0.37",
"@oclif/plugin-command-snapshot": "^5.2.23",
"@oclif/test": "^4.1.0",
"@oclif/test": "^4.1.3",
"@salesforce/cli-plugins-testkit": "^5.3.39",
"@salesforce/dev-scripts": "^10.2.11",
"@salesforce/plugin-command-reference": "^3.1.35",
"@salesforce/plugin-command-reference": "^3.1.37",
"@salesforce/types": "^1.3.0",
"eslint-plugin-sf-plugin": "^1.20.13",
"oclif": "^4.16.0",
Expand Down
3 changes: 2 additions & 1 deletion src/bulkUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ export async function detectDelimiter(filePath: string): Promise<ColumnDelimiter
}
}

const columDelimiter = delimiterMap.get(detectedDelimiter ?? '');
// default to `COMMA` if no delimiter was found in the CSV file (1 column)
const columDelimiter = delimiterMap.get(detectedDelimiter ?? ',');

if (columDelimiter === undefined) {
throw new SfError(`Failed to detect column delimiter used in ${filePath}.`);
Expand Down
12 changes: 4 additions & 8 deletions src/commands/data/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,10 @@ export class DataSoqlQueryCommand extends SfCommand<DataQueryResult> {
this.logger = await Logger.child('data:soql:query');
const flags = (await this.parse(DataSoqlQueryCommand)).flags;

if (flags.bulk === false && flags.wait) {
this.warn(`Using \`--wait\` without \`--bulk\` is deprecated and will be removed after January 1, 2025.
You can safely remove \`--wait\` (it never had any effect on the command without \`--bulk\`).
`);
}
if (flags.bulk === false && flags.async) {
this.warn(`Using \`--async\` without \`--bulk\` is deprecated and will be removed after January 1, 2025.
You can safely remove \`--async\` (it never had any effect on the command without \`--bulk\`).
if (flags.bulk || flags.wait || flags.async) {
this
.warn(`Bulk mode for "data query" is deprecated, the following flags will be removed after April 2025: --bulk | --wait | --async.
Use "data export bulk" for bulk queries instead.
`);
}

Expand Down
6 changes: 6 additions & 0 deletions src/commands/data/query/resume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export class BulkQueryReport extends SfCommand<unknown> {
public static readonly examples = reportMessages.getMessages('examples');
public static readonly aliases = ['force:data:soql:bulk:report'];
public static readonly deprecateAliases = true;
public static state = 'deprecated';
public static readonly deprecationOptions = {
message: `Bulk mode for "data query" is deprecated, this command will be removed after April 2025.
Use "data export bulk | data export resume" for bulk queries instead.
`,
};

public static readonly flags = {
'target-org': { ...optionalOrgFlagWithDeprecations },
Expand Down
1 change: 1 addition & 0 deletions test/bulkUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('bulkUtils', () => {
expect(await detectDelimiter('./test/test-files/csv/backquote.csv')).to.equal('BACKQUOTE');
expect(await detectDelimiter('./test/test-files/csv/caret.csv')).to.equal('CARET');
expect(await detectDelimiter('./test/test-files/csv/comma.csv')).to.equal('COMMA');
expect(await detectDelimiter('./test/test-files/csv/single-column.csv')).to.equal('COMMA');
expect(await detectDelimiter('./test/test-files/csv/comma_wrapped_values.csv')).to.equal('COMMA');
expect(await detectDelimiter('./test/test-files/csv/pipe.csv')).to.equal('PIPE');
expect(await detectDelimiter('./test/test-files/csv/semicolon.csv')).to.equal('SEMICOLON');
Expand Down
11 changes: 11 additions & 0 deletions test/test-files/csv/single-column.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
NAME
account Upsert #0
account Upsert #1
account Upsert #2
account Upsert #3
account Upsert #4
account Upsert #5
account Upsert #6
account Upsert #7
account Upsert #8
account Upsert #9
Loading

0 comments on commit a1afaa8

Please sign in to comment.