@simplysf/simply-sobject 1.1.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/README.md +119 -0
  2. package/package.json +10 -8
package/README.md ADDED
@@ -0,0 +1,119 @@
1
+ # @simplysf/simply-sobject
2
+
3
+ [![NPM](https://img.shields.io/npm/v/@simplysf/simply-sobject?label=@simplysf/simply-sobject)](https://npmjs.com/@simplysf/simply-sobject) [![Downloads/week](https://img.shields.io/npm/dw/@simplysf/simply-sobject.svg)](https://npmjs.com/@simplysf/simply-sobject) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://raw.githubusercontent.com/SimplySF/simply/main/LICENSE.txt)
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ sf plugins install @simplysf/simply-sobject
9
+ ```
10
+
11
+ ## Issues
12
+
13
+ Please report any issues at https://github.com/SimplySF/simply/issues
14
+
15
+ ## Contributing
16
+
17
+ This package is part of the [`@simplysf/simply`](https://github.com/SimplySF/simply) monorepo. See the repo's [CONTRIBUTING.md](https://github.com/SimplySF/simply/blob/main/CONTRIBUTING.md) for the repo structure, how to set up and build the project, our commit conventions, and how to submit a pull request. Please also read our [Code of Conduct](https://github.com/SimplySF/simply/blob/main/CODE_OF_CONDUCT.md).
18
+
19
+ ## Commands
20
+
21
+ <!-- commands -->
22
+
23
+ - [`sf simply sobject backup`](#sf-simply-sobject-backup)
24
+ - [`sf simply sobject deduplicate`](#sf-simply-sobject-deduplicate)
25
+
26
+ ## `sf simply sobject backup`
27
+
28
+ Back up SObject data to a CSV file.
29
+
30
+ ```
31
+ USAGE
32
+ $ sf simply sobject backup -s <value> -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-d <value>]
33
+
34
+ FLAGS
35
+ -d, --output-dir=<value> Output directory
36
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
37
+ configuration variable is already set.
38
+ -s, --sobject=<value> (required) SObject API name
39
+ --api-version=<value> Override the api version used for api requests made by this command
40
+
41
+ GLOBAL FLAGS
42
+ --flags-dir=<value> Import flag values from a directory.
43
+ --json Format output as json.
44
+
45
+ DESCRIPTION
46
+ Back up SObject data to a CSV file.
47
+
48
+ Describes the given SObject, queries every field via the Bulk API, and writes the results to a timestamped CSV file.
49
+
50
+ EXAMPLES
51
+ $ sf simply sobject backup --target-org myOrg --sobject Account
52
+
53
+ $ sf simply sobject backup --target-org myOrg --sobject Custom_Object__c --output-dir backups
54
+
55
+ FLAG DESCRIPTIONS
56
+ -d, --output-dir=<value> Output directory
57
+
58
+ The directory to save the backup CSV file to. Defaults to the current directory.
59
+
60
+ -s, --sobject=<value> SObject API name
61
+
62
+ The API name of the SObject to back up.
63
+ ```
64
+
65
+ _See code: [lib/commands/simply/sobject/backup.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-sobject@1.1.1/packages/simply-sobject/lib/commands/simply/sobject/backup.js)_
66
+
67
+ ## `sf simply sobject deduplicate`
68
+
69
+ Identify and prepare deduplication of an SObject's records.
70
+
71
+ ```
72
+ USAGE
73
+ $ sf simply sobject deduplicate -c <value> -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--dry-run]
74
+ [--output-dir <value>]
75
+
76
+ FLAGS
77
+ -c, --config=<value> (required) Path to a deduplication configuration file
78
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
79
+ configuration variable is already set.
80
+ --api-version=<value> Override the api version used for api requests made by this command
81
+ --dry-run Skip calculating associated object lookup replacements
82
+ --output-dir=<value> Output directory
83
+
84
+ GLOBAL FLAGS
85
+ --flags-dir=<value> Import flag values from a directory.
86
+ --json Format output as json.
87
+
88
+ DESCRIPTION
89
+ Identify and prepare deduplication of an SObject's records.
90
+
91
+ Queries an SObject, groups records by a composite key built from configured fields, and writes CSV files listing which
92
+ records are unique and which are duplicates that should be deleted. For each associated object with lookups to the
93
+ primary object, also writes a CSV of the lookup field updates needed to re-point duplicate references at the surviving
94
+ unique record. This command does not perform any deletes or updates in the org; it only prepares the CSV files for a
95
+ subsequent data load.
96
+
97
+ EXAMPLES
98
+ $ sf simply sobject deduplicate --target-org myOrg --config config/deduplicate-account.json
99
+
100
+ $ sf simply sobject deduplicate --target-org myOrg --config config/deduplicate-account.json --dry-run
101
+
102
+ FLAG DESCRIPTIONS
103
+ -c, --config=<value> Path to a deduplication configuration file
104
+
105
+ The path to a JSON file describing the primary object, its composite key fields, and any associated objects with
106
+ lookups to it.
107
+
108
+ --dry-run Skip calculating associated object lookup replacements
109
+
110
+ When set, only the primary object's unique/duplicate CSV files are generated; associated object lookup replacement
111
+ files are not calculated.
112
+
113
+ --output-dir=<value> Output directory
114
+
115
+ The directory to write the generated CSV files to. Defaults to ./temp/<primaryObjectApiName>.
116
+ ```
117
+
118
+ _See code: [lib/commands/simply/sobject/deduplicate.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-sobject@1.1.1/packages/simply-sobject/lib/commands/simply/sobject/deduplicate.js)_
119
+ <!-- commandsstop -->
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplysf/simply-sobject",
3
3
  "description": "Utilities for working with SObjects",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "author": "@ClayChipps",
6
6
  "homepage": "https://github.com/SimplySF/simply",
7
7
  "bugs": "https://github.com/SimplySF/simply/issues",
@@ -65,7 +65,9 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@oclif/plugin-command-snapshot": "^5.3.19",
68
- "@salesforce/plugin-command-reference": "^3.1.99"
68
+ "@salesforce/plugin-command-reference": "^3.1.99",
69
+ "@vitest/coverage-v8": "^4.1.10",
70
+ "vitest": "^4.1.10"
69
71
  },
70
72
  "publishConfig": {
71
73
  "access": "public"
@@ -79,9 +81,10 @@
79
81
  "lint": "wireit",
80
82
  "readme": "oclif readme --no-aliases",
81
83
  "test": "wireit",
84
+ "test:coverage": "vitest run --coverage",
82
85
  "test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --jobs 5",
83
86
  "test:only": "wireit",
84
- "test:watch": "mocha --watch \"./test/**/*.test.ts\""
87
+ "test:watch": "vitest watch"
85
88
  },
86
89
  "wireit": {
87
90
  "build": {
@@ -176,7 +179,7 @@
176
179
  "output": []
177
180
  },
178
181
  "test:only": {
179
- "command": "nyc mocha \"test/**/*.test.ts\"",
182
+ "command": "vitest run",
180
183
  "env": {
181
184
  "FORCE_COLOR": "2"
182
185
  },
@@ -184,9 +187,8 @@
184
187
  "test/**/*.ts",
185
188
  "src/**/*.ts",
186
189
  "**/tsconfig.json",
187
- ".mocha*",
188
- "!*.nut.ts",
189
- ".nycrc"
190
+ "vitest.config.ts",
191
+ "!*.nut.ts"
190
192
  ],
191
193
  "output": []
192
194
  },
@@ -200,5 +202,5 @@
200
202
  "output": []
201
203
  }
202
204
  },
203
- "gitHead": "723fbef6eeeda978ccdacd5c3ae6cab521c83c49"
205
+ "gitHead": "ddaa65ef57d74cbff83875acaec5e10beb7f77ba"
204
206
  }