@inforge/migrations-tools-cli 1.1.0 → 1.1.1

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/dist/index.js +13 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -465,12 +465,20 @@ var TriggersHandler = class {
465
465
  await this.updateStatus(connection, triggerNames, "Active");
466
466
  }
467
467
  async updateStatus(connection, triggerNames, status) {
468
- const metadata = await connection.metadata.read("ApexTrigger", triggerNames);
469
- const updates = metadata.map((trigger) => ({
470
- ...trigger,
471
- status
468
+ const query = `
469
+ SELECT Id, Name
470
+ FROM ApexTrigger
471
+ WHERE Name IN (${triggerNames.map((n) => `'${n}'`).join(", ")})
472
+ `;
473
+ const result = await connection.tooling.query(query);
474
+ if (result.records.length === 0) {
475
+ throw new Error("No triggers found with the specified names");
476
+ }
477
+ const updates = result.records.map((trigger) => ({
478
+ Id: trigger.Id,
479
+ Status: status
472
480
  }));
473
- const results = await connection.metadata.update("ApexTrigger", updates);
481
+ const results = await connection.tooling.update("ApexTrigger", updates);
474
482
  if (Array.isArray(results)) {
475
483
  const failures = results.filter((r) => !r.success);
476
484
  if (failures.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inforge/migrations-tools-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Inforge's interactive CLI for side-effect-free Salesforce data operations by managing automation",
5
5
  "main": "index.js",
6
6
  "type": "module",