Skip to content

Commit

Permalink
Every API client config field is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaro-shopify committed Apr 3, 2024
1 parent ede6544 commit 7c2e424
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions packages/app/src/cli/models/app/app.test-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ export function testOrganizationApp(app: Partial<OrganizationApp> = {}): Organiz
grantedScopes: [],
disabledFlags: ['5b25141b'],
flags: [],
applicationUrl: 'https://www.example.com',
redirectUrlWhitelist: [],
}
return {...defaultApp, ...app}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/cli/models/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export type OrganizationApp = MinimalOrganizationApp & {
newApp?: boolean
grantedScopes: string[]
developmentStorePreviewEnabled?: boolean
applicationUrl: string
redirectUrlWhitelist: string[]
applicationUrl?: string
redirectUrlWhitelist?: string[]
requestedAccessScopes?: string[]
webhookApiVersion?: string
embedded?: boolean
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/cli/services/app/config/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function buildRemoteApiClientConfiguration(

function addRemoteAppHomeConfig(remoteApp: OrganizationApp) {
const homeConfig = {
application_url: remoteApp.applicationUrl.replace(/\/$/, ''),
application_url: remoteApp.applicationUrl?.replace(/\/$/, '') || '',
embedded: remoteApp.embedded === undefined ? true : remoteApp.embedded,
}
return remoteApp.preferencesUrl
Expand Down Expand Up @@ -294,7 +294,7 @@ function addRemoteAppAccessConfig(appConfiguration: AppConfiguration, remoteApp:
}
return {
auth: {
redirect_urls: remoteApp.redirectUrlWhitelist,
redirect_urls: remoteApp.redirectUrlWhitelist ?? [],
},
access_scopes: accessScopesContent,
}
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/cli/services/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,6 @@ export async function ensureDeployContext(options: DeployContextOptions): Promis
organizationId: remoteApp.organizationId,
grantedScopes: remoteApp.grantedScopes,
flags: remoteApp.flags,
applicationUrl: remoteApp.applicationUrl,
redirectUrlWhitelist: remoteApp.redirectUrlWhitelist,
},
identifiers,
release: !noRelease,
Expand Down

0 comments on commit 7c2e424

Please sign in to comment.