diff --git a/packages/app/src/cli/api/graphql/app_versions_diff.ts b/packages/app/src/cli/api/graphql/app_versions_diff.ts index fc284b41f9b..66768c8d421 100644 --- a/packages/app/src/cli/api/graphql/app_versions_diff.ts +++ b/packages/app/src/cli/api/graphql/app_versions_diff.ts @@ -1,6 +1,6 @@ export interface AppVersionsDiffExtensionSchema { uuid: string - registrationTitle: string + handle: string specification: { identifier: string experience: string diff --git a/packages/app/src/cli/services/app/select-app.test.ts b/packages/app/src/cli/services/app/select-app.test.ts index 5657c0d128d..fa5c7a983bb 100644 --- a/packages/app/src/cli/services/app/select-app.test.ts +++ b/packages/app/src/cli/services/app/select-app.test.ts @@ -9,7 +9,7 @@ vi.mock('../dev/fetch.js') const webhooksActiveAppModule: AppModuleVersion = { registrationId: 'C_A', registrationUuid: 'UUID_C_A', - registrationTitle: 'Registration title', + handle: 'Registration title', type: 'Module:Webhooks', config: {api_version: '2023-04'}, specification: { @@ -24,7 +24,7 @@ const webhooksActiveAppModule: AppModuleVersion = { const homeActiveAppModule: AppModuleVersion = { registrationId: 'C_B', registrationUuid: 'UUID_C_B', - registrationTitle: 'Registration title', + handle: 'Registration title', type: 'Module:AppHome', config: {app_url: 'https://myapp.com', embedded: true}, specification: { @@ -39,7 +39,7 @@ const homeActiveAppModule: AppModuleVersion = { const brandingActiveAppModule: AppModuleVersion = { registrationId: 'C_C', registrationUuid: 'UUID_C_C', - registrationTitle: 'Registration title', + handle: 'Registration title', type: 'Module:Branding', config: {name: 'name'}, specification: { @@ -91,7 +91,7 @@ describe('fetchAppRemoteConfiguration', () => { const complianceActiveAppModule: AppModuleVersion = { registrationId: 'C_B', registrationUuid: 'UUID_C_B', - registrationTitle: 'Registration title', + handle: 'Registration title', type: 'Module:Privacy', config: { customers_redact_url: 'https://myapp.com/redact', @@ -171,7 +171,7 @@ describe('remoteAppConfigurationExtensionContent', () => { const eventsModule = (handle: string, topic: string): AppModuleVersion => ({ registrationId: handle, registrationUuid: `UUID_${handle}`, - registrationTitle: handle, + handle, type: 'events', config: {events: {api_version: '2024-01', subscription: {topic, actions: ['create'], uri: 'https://myapp.com'}}}, specification: { diff --git a/packages/app/src/cli/services/app/select-app.ts b/packages/app/src/cli/services/app/select-app.ts index d3918664892..ef6c18f986e 100644 --- a/packages/app/src/cli/services/app/select-app.ts +++ b/packages/app/src/cli/services/app/select-app.ts @@ -68,7 +68,7 @@ export function remoteAppConfigurationExtensionContent( const config = module.config if (!config) return - const localConfig = configSpec.transformRemoteToLocal?.(config, {flags, handle: module.registrationTitle}) ?? config + const localConfig = configSpec.transformRemoteToLocal?.(config, {flags, handle: module.handle}) ?? config remoteAppConfig = deepMergeObjects(remoteAppConfig, localConfig) }) diff --git a/packages/app/src/cli/services/context.test.ts b/packages/app/src/cli/services/context.test.ts index 4d0dc3c66f1..82324f77106 100644 --- a/packages/app/src/cli/services/context.test.ts +++ b/packages/app/src/cli/services/context.test.ts @@ -273,13 +273,13 @@ describe('ensureDeployContext', () => { const activeAppVersion = { appModuleVersions: [ - {registrationId: 'id-1', registrationUuid: 'uuid-1', type: 'app_access', registrationTitle: 'module-1'}, - {registrationId: '', registrationUuid: 'uuid-2', type: 'pos_ui_extension', registrationTitle: 'module-2'}, + {registrationId: 'id-1', registrationUuid: 'uuid-1', type: 'app_access', handle: 'module-1'}, + {registrationId: '', registrationUuid: 'uuid-2', type: 'pos_ui_extension', handle: 'module-2'}, { registrationId: 'id-3', registrationUuid: 'uuid-3', type: 'checkout_ui_extension', - registrationTitle: 'module-3', + handle: 'module-3', }, ], } @@ -312,13 +312,13 @@ describe('ensureDeployContext', () => { const activeAppVersion = { appModuleVersions: [ - {registrationId: 'id-1', registrationUuid: 'uuid-1', type: 'app_access', registrationTitle: 'module-1'}, - {registrationId: 'id-2', registrationUuid: 'uuid-2', type: 'pos_ui_extension', registrationTitle: 'module-2'}, + {registrationId: 'id-1', registrationUuid: 'uuid-1', type: 'app_access', handle: 'module-1'}, + {registrationId: 'id-2', registrationUuid: 'uuid-2', type: 'pos_ui_extension', handle: 'module-2'}, { registrationId: 'id-3', registrationUuid: 'uuid-3', type: 'checkout_ui_extension', - registrationTitle: 'module-3', + handle: 'module-3', }, ], } diff --git a/packages/app/src/cli/services/context/breakdown-extensions.test.ts b/packages/app/src/cli/services/context/breakdown-extensions.test.ts index 1d8d8c81d3e..589eec060df 100644 --- a/packages/app/src/cli/services/context/breakdown-extensions.test.ts +++ b/packages/app/src/cli/services/context/breakdown-extensions.test.ts @@ -21,7 +21,7 @@ vi.mock('../release/version-diff') const VERSION_DIFF_CONFIG_A: AppVersionsDiffExtensionSchema = { uuid: 'UUID_C_A', - registrationTitle: 'Registration title', + handle: 'Registration title', specification: { identifier: 'app_access', experience: 'configuration', @@ -33,7 +33,7 @@ const VERSION_DIFF_CONFIG_A: AppVersionsDiffExtensionSchema = { const VERSION_DIFF_DASH_A: AppVersionsDiffExtensionSchema = { uuid: 'UUID_D_A', - registrationTitle: 'Dashboard A', + handle: 'Dashboard A', specification: { identifier: 'flow_action_definition', experience: 'legacy', @@ -45,7 +45,7 @@ const VERSION_DIFF_DASH_A: AppVersionsDiffExtensionSchema = { const VERSION_DIFF_CLI_A: AppVersionsDiffExtensionSchema = { uuid: 'UUID_B', - registrationTitle: 'Checkout post purchase', + handle: 'Checkout post purchase', specification: { identifier: 'checkout_post_purchase', experience: 'extension', @@ -57,7 +57,7 @@ const VERSION_DIFF_CLI_A: AppVersionsDiffExtensionSchema = { const VERSION_DIFF_DELETED_CLI_B: AppVersionsDiffExtensionSchema = { uuid: 'UUID_A', - registrationTitle: 'Checkout post purchase Deleted B', + handle: 'Checkout post purchase Deleted B', specification: { identifier: 'checkout_post_purchase', experience: 'extension', @@ -69,7 +69,7 @@ const VERSION_DIFF_DELETED_CLI_B: AppVersionsDiffExtensionSchema = { const VERSION_DIFF_DELETED_CLI_WEBHOOK: AppVersionsDiffExtensionSchema = { uuid: 'UUID_WEBOOK', - registrationTitle: 'Webhook Subscription Deleted', + handle: 'Webhook Subscription Deleted', specification: { identifier: 'webhook_subscription', experience: 'extension', @@ -268,7 +268,7 @@ function configModule(identifier: string, config: {[key: string]: unknown}): App return { registrationId: `${identifier}-id`, registrationUuid: `${identifier}-uuid`, - registrationTitle: identifier, + handle: identifier, type: identifier, config, specification: { diff --git a/packages/app/src/cli/services/context/breakdown-extensions.ts b/packages/app/src/cli/services/context/breakdown-extensions.ts index 07dff7d2437..dc96c47b875 100644 --- a/packages/app/src/cli/services/context/breakdown-extensions.ts +++ b/packages/app/src/cli/services/context/breakdown-extensions.ts @@ -48,11 +48,11 @@ export async function extensionsIdentifiersReleaseBreakdown( extension.specification.experience === 'extension' && extension.specification.identifier !== 'webhook_subscription', ) - .map((extension) => buildExtensionBreakdownInfo(extension.registrationTitle, undefined)) + .map((extension) => buildExtensionBreakdownInfo(extension.handle, undefined)) const mapIsDashboard = (extensions: AppVersionsDiffExtensionSchema[]) => extensions .filter((extension) => extension.specification.options.managementExperience === 'dashboard') - .map((extension) => buildDashboardBreakdownInfo(extension.registrationTitle)) + .map((extension) => buildDashboardBreakdownInfo(extension.handle)) const extensionIdentifiersBreakdown = { onlyRemote: [...mapIsExtension(versionsDiff.removed), ...mapIsDashboard(versionsDiff.removed)], diff --git a/packages/app/src/cli/services/context/deploy-identifier-matching.test.ts b/packages/app/src/cli/services/context/deploy-identifier-matching.test.ts index 72550143aea..a7dfa4935df 100644 --- a/packages/app/src/cli/services/context/deploy-identifier-matching.test.ts +++ b/packages/app/src/cli/services/context/deploy-identifier-matching.test.ts @@ -81,7 +81,7 @@ function remoteWebhookModule( return { registrationId: title, registrationUuid: uuid, - registrationTitle: title, + handle: title, type: 'webhook_subscription', config, specification: { @@ -150,7 +150,7 @@ beforeAll(async () => { REMOTE_EXTENSION_A = { registrationId: EXTENSION_A.uid, registrationUuid: 'remote-uuid-a', - registrationTitle: 'Remote Extension A', + handle: 'Remote Extension A', type: 'checkout_post_purchase', config: await EXTENSION_A.deployConfig({apiKey: REMOTE_APP.apiKey, appConfiguration: APP.configuration}), specification: { @@ -164,7 +164,7 @@ beforeAll(async () => { REMOTE_EXTENSION_DELETED = { registrationId: 'deleted-uid', registrationUuid: 'deleted-uuid', - registrationTitle: 'Deleted Extension', + handle: 'Deleted Extension', type: 'checkout_post_purchase', config: {}, specification: { @@ -178,7 +178,7 @@ beforeAll(async () => { REMOTE_CONFIG_EXTENSION = { registrationId: CONFIG_EXTENSION.uid, registrationUuid: 'remote-config-uuid', - registrationTitle: 'Point of Sale', + handle: 'Point of Sale', type: 'point_of_sale', config: {}, specification: { @@ -207,7 +207,7 @@ describe('classifyDeployExtensionChanges', () => { changes.map((change) => ({ status: change.status, local: change.local?.localIdentifier, - remote: change.remote?.registrationTitle, + remote: change.remote?.handle, })), ).toEqual([ {status: 'unchanged', local: EXTENSION_A.localIdentifier, remote: 'Remote Extension A'}, @@ -300,7 +300,7 @@ describe('classifyDeployExtensionChanges', () => { const remoteConfigLikeExtension = { registrationId: 'remote-config-id', registrationUuid: 'remote-config-uuid', - registrationTitle: 'Remote Config-Like Extension', + handle: 'Remote Config-Like Extension', type: 'unknown_remote_type', config: {}, specification: { @@ -379,7 +379,7 @@ describe('classifyDeployExtensionChanges', () => { const remoteDataModule = { registrationId: dataExtension.uid, registrationUuid: 'data-uuid', - registrationTitle: 'Data', + handle: 'Data', type: 'data', config: { product: {enabled: false}, @@ -524,7 +524,7 @@ describe('classifyDeployExtensionChanges', () => { async (extension): Promise => ({ registrationId: extension.uid, registrationUuid: `${extension.uid}-uuid`, - registrationTitle: extension.handle, + handle: extension.handle, type: 'events', config: await extension.deployConfig({apiKey: REMOTE_APP.apiKey, appConfiguration: APP.configuration}), specification: { @@ -560,7 +560,7 @@ describe('classifyDeployExtensionChanges', () => { const pendingRemote = { registrationId: '', registrationUuid: 'pending-uuid', - registrationTitle: EXTENSION_A.handle, + handle: EXTENSION_A.handle, type: 'checkout_post_purchase', config: {}, specification: { @@ -595,7 +595,7 @@ describe('classifyDeployExtensionChanges', () => { const pendingRemote = { registrationId: '', registrationUuid: 'pending-uuid', - registrationTitle: 'extension-with-spaces', + handle: 'extension-with-spaces', type: 'checkout_post_purchase', config: {}, specification: { @@ -624,7 +624,7 @@ describe('classifyDeployExtensionChanges', () => { const remoteWithUid = { registrationId: 'some-other-uid', registrationUuid: 'remote-uuid', - registrationTitle: EXTENSION_A.handle, + handle: EXTENSION_A.handle, type: 'checkout_post_purchase', config: {}, specification: { @@ -641,7 +641,7 @@ describe('classifyDeployExtensionChanges', () => { }) expect(changes).toMatchObject([ - {status: 'deleted', remote: {registrationTitle: EXTENSION_A.handle}}, + {status: 'deleted', remote: {handle: EXTENSION_A.handle}}, {status: 'created', local: {localIdentifier: EXTENSION_A.localIdentifier}}, ]) }) @@ -651,7 +651,7 @@ describe('classifyDeployExtensionChanges', () => { ({ registrationId: '', registrationUuid, - registrationTitle: EXTENSION_A.handle, + handle: EXTENSION_A.handle, type: 'checkout_post_purchase', config: {}, specification: { @@ -727,7 +727,7 @@ describe('ensureDeployIdentifiersFromAppVersion', () => { const migratedModule = { registrationId: EXTENSION_TO_MIGRATE.uid, registrationUuid: legacyRemoteExtension.uuid, - registrationTitle: 'Legacy UI', + handle: 'Legacy UI', type: 'ui_extension', config: await EXTENSION_TO_MIGRATE.deployConfig({apiKey: REMOTE_APP.apiKey, appConfiguration: APP.configuration}), specification: { diff --git a/packages/app/src/cli/services/context/deploy-identifier-matching.ts b/packages/app/src/cli/services/context/deploy-identifier-matching.ts index f0323a68f35..e771d95f908 100644 --- a/packages/app/src/cli/services/context/deploy-identifier-matching.ts +++ b/packages/app/src/cli/services/context/deploy-identifier-matching.ts @@ -113,7 +113,7 @@ function uniqueHandleAndTypeMatch( remote: AppModuleVersion, ): ExtensionInstance | undefined { const sameHandleAndType = (local: ExtensionInstance, candidate: AppModuleVersion) => - slugify(local.handle) === slugify(candidate.registrationTitle) && + slugify(local.handle) === slugify(candidate.handle) && (local.specification.identifier === candidate.specification?.identifier || local.specification.externalIdentifier === candidate.specification?.identifier) @@ -202,9 +202,9 @@ async function localAppConfigurationExtensionContent(app: AppInterface, apiKey: /** Builds prompt metadata for a remote-only module. */ function buildRemoteBreakdownInfo(remote: AppModuleVersion) { if (remote.specification?.options.managementExperience === 'dashboard') { - return buildDashboardBreakdownInfo(remote.registrationTitle) + return buildDashboardBreakdownInfo(remote.handle) } - return buildExtensionBreakdownInfo(remote.registrationTitle, remote.registrationId) + return buildExtensionBreakdownInfo(remote.handle, remote.registrationId) } /** Fetches install count for delete warnings. */ diff --git a/packages/app/src/cli/services/release/version-diff.test.ts b/packages/app/src/cli/services/release/version-diff.test.ts index 76608aa6354..a1615310085 100644 --- a/packages/app/src/cli/services/release/version-diff.test.ts +++ b/packages/app/src/cli/services/release/version-diff.test.ts @@ -47,7 +47,7 @@ describe('versionDiffByVersion', () => { versionsDiff: { added: [ { - registrationTitle: 'Extension 1', + handle: 'Extension 1', uuid: 'uuid1', specification: { identifier: 'app_access', @@ -60,7 +60,7 @@ describe('versionDiffByVersion', () => { ], updated: [ { - registrationTitle: 'Extension 2', + handle: 'Extension 2', uuid: 'uuid2', specification: { identifier: 'flow_action_definition', @@ -73,7 +73,7 @@ describe('versionDiffByVersion', () => { ], removed: [ { - registrationTitle: 'Extension 3', + handle: 'Extension 3', uuid: 'uuid3', specification: { identifier: 'post_purchase_ui_extension', diff --git a/packages/app/src/cli/utilities/developer-platform-client.ts b/packages/app/src/cli/utilities/developer-platform-client.ts index ac99c854eff..0843befae6a 100644 --- a/packages/app/src/cli/utilities/developer-platform-client.ts +++ b/packages/app/src/cli/utilities/developer-platform-client.ts @@ -87,7 +87,7 @@ interface AppModuleVersionSpecification { export interface AppModuleVersion { registrationId: string registrationUuid?: string - registrationTitle: string + handle: string config?: object target?: string type: string diff --git a/packages/app/src/cli/utilities/developer-platform-client/app-management-client.test.ts b/packages/app/src/cli/utilities/developer-platform-client/app-management-client.test.ts index 94b6321ed02..ea7df7fd8d7 100644 --- a/packages/app/src/cli/utilities/developer-platform-client/app-management-client.test.ts +++ b/packages/app/src/cli/utilities/developer-platform-client/app-management-client.test.ts @@ -1948,7 +1948,7 @@ describe('appExtensionRegistrations', () => { const createMockAppModuleVersion = (overrides: Partial = {}) => ({ registrationId: 'mock-registration-id', registrationUuid: 'mock-uuid', - registrationTitle: 'Mock Extension', + handle: 'Mock Extension', type: 'ui_extension', specification: { identifier: 'ui_extension', @@ -1965,7 +1965,7 @@ describe('appExtensionRegistrations', () => { // Given const configModule = createMockAppModuleVersion({ registrationId: BrandingSpecIdentifier, - registrationTitle: 'Config Extension', + handle: 'Config Extension', type: 'config_extension', specification: { identifier: BrandingSpecIdentifier, @@ -1979,12 +1979,12 @@ describe('appExtensionRegistrations', () => { const extensionModule = createMockAppModuleVersion({ registrationId: 'extension-1', - registrationTitle: 'Regular Extension', + handle: 'Regular Extension', }) const dashboardManagedModule = createMockAppModuleVersion({ registrationId: 'dashboard-1', - registrationTitle: 'Dashboard Extension', + handle: 'Dashboard Extension', specification: { identifier: 'dashboard_extension', name: 'Dashboard Extension', @@ -2037,7 +2037,7 @@ describe('appExtensionRegistrations', () => { // Given const extensionModule = createMockAppModuleVersion({ registrationId: 'extension-1', - registrationTitle: 'Extension from API', + handle: 'Extension from API', }) // Mock the activeAppVersion method @@ -2072,7 +2072,7 @@ describe('appExtensionRegistrations', () => { const configModules = configExtensionIds.map((id: string, index: number) => createMockAppModuleVersion({ registrationId: id, - registrationTitle: `Config Extension ${index}`, + handle: `Config Extension ${index}`, type: 'config_extension', specification: { identifier: id, @@ -2121,7 +2121,7 @@ describe('appExtensionRegistrations', () => { // Given const moduleWithoutSpec = createMockAppModuleVersion({ registrationId: 'no-spec-1', - registrationTitle: 'No Spec Extension', + handle: 'No Spec Extension', specification: undefined, }) @@ -2144,7 +2144,7 @@ describe('appExtensionRegistrations', () => { ...[BrandingSpecIdentifier, AppHomeSpecIdentifier].map((id: string) => createMockAppModuleVersion({ registrationId: id, - registrationTitle: `Config ${id}`, + handle: `Config ${id}`, type: 'config', specification: { identifier: id, @@ -2159,16 +2159,16 @@ describe('appExtensionRegistrations', () => { // Regular CLI-managed extensions createMockAppModuleVersion({ registrationId: 'cli-1', - registrationTitle: 'CLI Extension 1', + handle: 'CLI Extension 1', }), createMockAppModuleVersion({ registrationId: 'cli-2', - registrationTitle: 'CLI Extension 2', + handle: 'CLI Extension 2', }), // Dashboard-managed extensions createMockAppModuleVersion({ registrationId: 'dashboard-1', - registrationTitle: 'Dashboard Extension 1', + handle: 'Dashboard Extension 1', specification: { identifier: 'dashboard_ext', name: 'Dashboard Extension', @@ -2180,7 +2180,7 @@ describe('appExtensionRegistrations', () => { }), createMockAppModuleVersion({ registrationId: 'dashboard-2', - registrationTitle: 'Dashboard Extension 2', + handle: 'Dashboard Extension 2', specification: { identifier: 'dashboard_ext', name: 'Dashboard Extension', @@ -2209,7 +2209,7 @@ describe('appExtensionRegistrations', () => { const configData = {name: 'Test Extension', enabled: true} const extensionModule = createMockAppModuleVersion({ registrationId: 'extension-with-config', - registrationTitle: 'Extension With Config', + handle: 'Extension With Config', config: configData, }) @@ -2236,7 +2236,7 @@ describe('appExtensionRegistrations', () => { const contextData = 'some-context-value' const extensionModule = createMockAppModuleVersion({ registrationId: 'extension-with-config-and-context', - registrationTitle: 'Extension With Config And Context', + handle: 'Extension With Config And Context', config: configData, target: contextData, }) @@ -2263,7 +2263,7 @@ describe('appExtensionRegistrations', () => { test('excludes activeVersion when config is not present', async () => { const extensionModule = createMockAppModuleVersion({ registrationId: 'extension-without-config', - registrationTitle: 'Extension Without Config', + handle: 'Extension Without Config', config: undefined, target: 'some-context', }) @@ -2288,7 +2288,7 @@ describe('appExtensionRegistrations', () => { const configData = {name: 'Test Extension', enabled: false} const extensionModule = createMockAppModuleVersion({ registrationId: 'extension-with-config-only', - registrationTitle: 'Extension With Config Only', + handle: 'Extension With Config Only', config: configData, target: undefined, }) @@ -2315,7 +2315,7 @@ describe('appExtensionRegistrations', () => { const configData = {} const extensionModule = createMockAppModuleVersion({ registrationId: 'extension-with-empty-config', - registrationTitle: 'Extension With Empty Config', + handle: 'Extension With Empty Config', config: configData, }) diff --git a/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts b/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts index d549f31f269..97d8e49a68e 100644 --- a/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts +++ b/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts @@ -604,7 +604,7 @@ export class AppManagementClient implements DeveloperPlatformClient { const registration = { id: mod.registrationId, uuid: mod.registrationUuid!, - title: mod.registrationTitle, + title: mod.handle, type: mod.type, activeVersion: mod.config ? { @@ -710,7 +710,7 @@ export class AppManagementClient implements DeveloperPlatformClient { function formattedModule(mod: ReleasedAppModuleFragment) { return { uuid: mod.uuid, - registrationTitle: mod.handle, + handle: mod.handle, specification: { identifier: mod.specification.identifier, experience: normalizeExperience(mod.specification.experience, mod.specification.identifier), @@ -1452,7 +1452,7 @@ function appModuleVersion(mod: ReleasedAppModuleFragment): Required