@simplysf/simply-sobject 1.3.4 → 1.3.6
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/README.md +64 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -229,3 +229,67 @@ FLAG DESCRIPTIONS
|
|
|
229
229
|
|
|
230
230
|
_See code: [lib/commands/simply/sobject/history/query.js](https://github.com/SimplySF/simply/blob/@simplysf/simply-sobject@1.2.1/packages/simply-sobject/lib/commands/simply/sobject/history/query.js)_
|
|
231
231
|
<!-- commandsstop -->
|
|
232
|
+
|
|
233
|
+
## Configuration Files
|
|
234
|
+
|
|
235
|
+
### `sf simply sobject deduplicate --config`
|
|
236
|
+
|
|
237
|
+
The `--config` flag on `sf simply sobject deduplicate` takes the path to a JSON file describing the primary object, its composite key, and any associated objects with lookups to it:
|
|
238
|
+
|
|
239
|
+
```json
|
|
240
|
+
{
|
|
241
|
+
"primaryObjectApiName": "Account",
|
|
242
|
+
"primaryObjectFilter": "CreatedDate = LAST_N_DAYS:365",
|
|
243
|
+
"primaryObjectCompositeKeyField": "Duplicate_Key__c",
|
|
244
|
+
"primaryObjectFields": ["Id", "Name", "BillingPostalCode"],
|
|
245
|
+
"primaryObjectCompositeKeyFields": ["Name", "BillingPostalCode"],
|
|
246
|
+
"associatedObjects": {
|
|
247
|
+
"Contact": ["AccountId"],
|
|
248
|
+
"Opportunity": ["AccountId"]
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
| Field | Type | Required | Description |
|
|
254
|
+
| --------------------------------- | -------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
255
|
+
| `primaryObjectApiName` | `string` | Yes | The API name of the object to deduplicate. |
|
|
256
|
+
| `primaryObjectFilter` | `string` | No | A SOQL WHERE clause used to scope which records of the primary object are considered. |
|
|
257
|
+
| `primaryObjectCompositeKeyField` | `string` | Yes | The column name written to the output CSVs for the computed composite key. |
|
|
258
|
+
| `primaryObjectFields` | `string[]` | Yes | Fields to query from the primary object (should include any fields referenced elsewhere in the config). |
|
|
259
|
+
| `primaryObjectCompositeKeyFields` | `string[]` | Yes | Fields whose combined values form each record's composite key. Records sharing a key are treated as duplicates. Must have at least one entry. |
|
|
260
|
+
| `associatedObjects` | `Record<string, string[]>` | Yes | Other objects with lookups to the primary object. Keyed by the associated object's API name; each value is the list of that object's lookup field API names to the primary object. |
|
|
261
|
+
|
|
262
|
+
### `sf simply sobject history query --filters`
|
|
263
|
+
|
|
264
|
+
The `--filters` flag on `sf simply sobject history query` takes either the path to a JSON file or a raw JSON string describing a tree of filter conditions:
|
|
265
|
+
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"logic": "AND",
|
|
269
|
+
"filters": [
|
|
270
|
+
{ "field": "Field", "operator": "=", "value": "Status__c" },
|
|
271
|
+
{
|
|
272
|
+
"logic": "OR",
|
|
273
|
+
"filters": [
|
|
274
|
+
{ "field": "OldValue", "operator": "=", "value": "Open" },
|
|
275
|
+
{ "field": "NewValue", "operator": "=", "value": "Closed" }
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
A filter tree is either a **condition** or a **group**:
|
|
283
|
+
|
|
284
|
+
| Condition field | Type | Description |
|
|
285
|
+
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
286
|
+
| `field` | `string` | The field to filter on (e.g. `Field`, `OldValue`, `NewValue`, `CreatedById`, `CreatedDate`, or the parent lookup field). |
|
|
287
|
+
| `operator` | `string` | One of `=`, `!=`, `>`, `<`, `>=`, `<=`, `IN`, `NOT IN`, `LIKE` (`%` is the wildcard for `LIKE`). |
|
|
288
|
+
| `value` | any | The value to compare against. An array when `operator` is `IN`/`NOT IN`. |
|
|
289
|
+
|
|
290
|
+
| Group field | Type | Description |
|
|
291
|
+
| ----------- | --------------------------- | -------------------------------------------------------------- |
|
|
292
|
+
| `logic` | `"AND"` \| `"OR"` | How `filters` are combined. |
|
|
293
|
+
| `filters` | `Array<Condition \| Group>` | One or more conditions or nested groups, combined per `logic`. |
|
|
294
|
+
|
|
295
|
+
Conditions on `Field`, `CreatedById`, `CreatedDate`, or the parent lookup field are pushed into the underlying SOQL query; conditions on any other field (e.g. `OldValue`/`NewValue`) are applied client-side after the query runs.
|
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.3.
|
|
4
|
+
"version": "1.3.6",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply/issues",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@salesforce/core": "^8.30.0",
|
|
66
66
|
"@salesforce/kit": "^3.2.6",
|
|
67
67
|
"@salesforce/sf-plugins-core": "^12.2.16",
|
|
68
|
-
"@simplysf/simply-core": "^1.1.
|
|
68
|
+
"@simplysf/simply-core": "^1.1.6",
|
|
69
69
|
"zod": "^4.1.12"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
@@ -212,5 +212,5 @@
|
|
|
212
212
|
"output": []
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
"gitHead": "
|
|
215
|
+
"gitHead": "8f0eb881b851e061bf7b007dbb5f851b81310376"
|
|
216
216
|
}
|