From 1e28d1edcec89ffe6e9401c8cfe2fe310950105e Mon Sep 17 00:00:00 2001 From: Ryan Bahan Date: Fri, 27 Feb 2026 17:52:27 -0700 Subject: [PATCH] Migrate privacy_compliance_webhooks to deployConfig + direct transforms Set deployConfig, transformLocalToRemote (updated to send TOML field names: customer_deletion_url, shop_deletion_url instead of Layer 2 names), and transformRemoteToLocal directly. Routing/precedence logic preserved. Co-Authored-By: Claude Opus 4.6 (1M context) --- ..._config_privacy_compliance_webhooks.test.ts | 18 +++++++++--------- .../app_config_privacy_compliance_webhooks.ts | 16 ++++++---------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.test.ts b/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.test.ts index c7d99cb753c..99c34fe58a1 100644 --- a/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.test.ts +++ b/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.test.ts @@ -23,9 +23,9 @@ describe('privacy_compliance_webhooks', () => { // Then expect(result).toMatchObject({ - customers_redact_url: 'https://customer-deletion-url.dev', - customers_data_request_url: 'https://customer-data-request-url.dev', - shop_redact_url: 'https://shop-deletion-url.dev', + customer_deletion_url: 'https://customer-deletion-url.dev', + customer_data_request_url: 'https://customer-data-request-url.dev', + shop_deletion_url: 'https://shop-deletion-url.dev', }) }) @@ -54,9 +54,9 @@ describe('privacy_compliance_webhooks', () => { // Then expect(result).toMatchObject({ api_version: '2024-07', - customers_redact_url: 'https://example.com/customers_webhooks', - customers_data_request_url: 'https://example.com/customers_webhooks', - shop_redact_url: 'https://example.com/shop_webhooks', + customer_deletion_url: 'https://example.com/customers_webhooks', + customer_data_request_url: 'https://example.com/customers_webhooks', + shop_deletion_url: 'https://example.com/shop_webhooks', }) }) @@ -107,9 +107,9 @@ describe('privacy_compliance_webhooks', () => { // Then expect(result).toMatchObject({ api_version: '2024-07', - customers_redact_url: 'https://example.com/customers_webhooks', - customers_data_request_url: 'https://example.com/customers_webhooks', - shop_redact_url: 'https://example.com/shop_webhooks', + customer_deletion_url: 'https://example.com/customers_webhooks', + customer_data_request_url: 'https://example.com/customers_webhooks', + shop_deletion_url: 'https://example.com/shop_webhooks', }) }) }) diff --git a/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts b/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts index 0599e0ed0bd..b8cb565951a 100644 --- a/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts +++ b/packages/app/src/cli/models/extensions/specifications/app_config_privacy_compliance_webhooks.ts @@ -3,22 +3,18 @@ import {WebhooksSchema} from './app_config_webhook_schemas/webhooks_schema.js' import {ComplianceTopic} from './app_config_webhook_schemas/webhook_subscription_schema.js' import {mergeAllWebhooks} from './transform/app_config_webhook.js' import {removeTrailingSlash} from './validation/common.js' -import {CustomTransformationConfig, createConfigExtensionSpecification} from '../specification.js' +import {createConfigExtensionSpecification} from '../specification.js' import {AppConfigurationWithoutPath, CurrentAppConfiguration} from '../../app/app.js' import {compact, getPathValue} from '@shopify/cli-kit/common/object' -const PrivacyComplianceWebhooksTransformConfig: CustomTransformationConfig = { - forward: transformToPrivacyComplianceWebhooksModule, - reverse: (content: object) => transformFromPrivacyComplianceWebhooksModule(content), -} - export const PrivacyComplianceWebhooksSpecIdentifier = 'privacy_compliance_webhooks' // Uses the same schema as the webhooks specs because its content is nested under the same webhooks section const appPrivacyComplienceSpec = createConfigExtensionSpecification({ identifier: PrivacyComplianceWebhooksSpecIdentifier, schema: WebhooksSchema, - transformConfig: PrivacyComplianceWebhooksTransformConfig, + transformLocalToRemote: transformToPrivacyComplianceWebhooksModule, + transformRemoteToLocal: (content: object) => transformFromPrivacyComplianceWebhooksModule(content), }) export default appPrivacyComplienceSpec @@ -31,9 +27,9 @@ function transformToPrivacyComplianceWebhooksModule(content: object, appConfigur } const urls = compact({ - customers_redact_url: relativeUri(getCustomersDeletionUri(webhooks), appUrl), - customers_data_request_url: relativeUri(getCustomersDataRequestUri(webhooks), appUrl), - shop_redact_url: relativeUri(getShopDeletionUri(webhooks), appUrl), + customer_deletion_url: relativeUri(getCustomersDeletionUri(webhooks), appUrl), + customer_data_request_url: relativeUri(getCustomersDataRequestUri(webhooks), appUrl), + shop_deletion_url: relativeUri(getShopDeletionUri(webhooks), appUrl), }) if (Object.keys(urls).length === 0) {