@wraps.dev/cli 2.17.4 → 2.17.5

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/dist/cli.js CHANGED
@@ -4447,6 +4447,26 @@ function applyConfigUpdates(existingConfig, updates) {
4447
4447
  ...result.smtpCredentials,
4448
4448
  ...value
4449
4449
  };
4450
+ } else if (key === "inbound" && typeof value === "object") {
4451
+ result.inbound = {
4452
+ ...result.inbound,
4453
+ ...value
4454
+ };
4455
+ } else if (key === "alerts" && typeof value === "object") {
4456
+ const alertUpdate = value;
4457
+ result.alerts = {
4458
+ ...result.alerts,
4459
+ ...alertUpdate,
4460
+ thresholds: {
4461
+ ...result.alerts?.thresholds,
4462
+ ...alertUpdate.thresholds
4463
+ }
4464
+ };
4465
+ } else if (key === "userWebhook" && typeof value === "object") {
4466
+ result.userWebhook = {
4467
+ ...result.userWebhook,
4468
+ ...value
4469
+ };
4450
4470
  } else {
4451
4471
  result[key] = value;
4452
4472
  }
@@ -4517,22 +4537,39 @@ function addServiceToConnection(accountId, region, provider, service, config2, p
4517
4537
  }
4518
4538
  return metadata;
4519
4539
  }
4540
+ function shallowMergeWithNestedObjects(existing, updates) {
4541
+ const result = { ...existing };
4542
+ for (const [key, value] of Object.entries(updates)) {
4543
+ if (value === void 0) {
4544
+ continue;
4545
+ }
4546
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
4547
+ result[key] = {
4548
+ ...existing[key],
4549
+ ...value
4550
+ };
4551
+ } else {
4552
+ result[key] = value;
4553
+ }
4554
+ }
4555
+ return result;
4556
+ }
4520
4557
  function updateServiceConfig(metadata, service, config2) {
4521
4558
  if (service === "email" && metadata.services.email) {
4522
- metadata.services.email.config = {
4523
- ...metadata.services.email.config,
4524
- ...config2
4525
- };
4559
+ metadata.services.email.config = applyConfigUpdates(
4560
+ metadata.services.email.config,
4561
+ config2
4562
+ );
4526
4563
  } else if (service === "sms" && metadata.services.sms) {
4527
- metadata.services.sms.config = {
4528
- ...metadata.services.sms.config,
4529
- ...config2
4530
- };
4564
+ metadata.services.sms.config = shallowMergeWithNestedObjects(
4565
+ metadata.services.sms.config,
4566
+ config2
4567
+ );
4531
4568
  } else if (service === "cdn" && metadata.services.cdn) {
4532
- metadata.services.cdn.config = {
4533
- ...metadata.services.cdn.config,
4534
- ...config2
4535
- };
4569
+ metadata.services.cdn.config = shallowMergeWithNestedObjects(
4570
+ metadata.services.cdn.config,
4571
+ config2
4572
+ );
4536
4573
  } else {
4537
4574
  throw new Error(`${service} service not configured in metadata`);
4538
4575
  }