Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify CreateAppOptions and DefaultAppOptions into a single object #5215

Open
wants to merge 2 commits into
base: 01-16-fix_dev_when_resetting_and_creating_a_new_app
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/app/src/cli/models/app/app.test-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1330,8 +1330,7 @@ export function testDeveloperPlatformClient(stubs: Partial<DeveloperPlatformClie
templateSpecifications: (_app: MinimalAppIdentifiers) => Promise.resolve(testRemoteExtensionTemplates),
orgAndApps: (_orgId: string) =>
Promise.resolve({organization: testOrganization(), apps: [testOrganizationApp()], hasMorePages: false}),
createApp: (_organization: Organization, _name: string, _options?: CreateAppOptions) =>
Promise.resolve(testOrganizationApp()),
createApp: (_organization: Organization, _options: CreateAppOptions) => Promise.resolve(testOrganizationApp()),
devStoresForOrg: (_organizationId: string) => Promise.resolve({stores: [], hasMorePages: false}),
storeByDomain: (_orgId: string, _shopDomain: string) => Promise.resolve({organizations: {nodes: []}}),
appExtensionRegistrations: (_app: MinimalAppIdentifiers) => Promise.resolve(emptyAppExtensionRegistrations),
Expand Down
15 changes: 5 additions & 10 deletions packages/app/src/cli/models/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {ExtensionSpecification, RemoteAwareExtensionSpecification} from '../exte
import {AppConfigurationUsedByCli} from '../extensions/specifications/types/app_config.js'
import {EditorExtensionCollectionType} from '../extensions/specifications/editor_extension_collection.js'
import {UIExtensionSchema} from '../extensions/specifications/ui_extension.js'
import {Flag} from '../../utilities/developer-platform-client.js'
import {CreateAppOptions, Flag} from '../../utilities/developer-platform-client.js'
import {AppAccessSpecIdentifier} from '../extensions/specifications/app_config_app_access.js'
import {WebhookSubscriptionSchema} from '../extensions/specifications/app_config_webhook_schemas/webhook_subscription_schema.js'
import {ZodObjectOf, zod} from '@shopify/cli-kit/node/schema'
Expand Down Expand Up @@ -271,7 +271,7 @@ export interface AppInterface<
/**
* If creating an app on the platform based on this app and its configuration, what default options should the app take?
*/
creationDefaultOptions(): AppCreationDefaultOptions
creationDefaultOptions(): CreateAppOptions
manifest: () => Promise<JsonMapType>
removeExtension: (extensionUid: string) => void
}
Expand Down Expand Up @@ -430,14 +430,15 @@ export class App<
const frontendConfig = this.webs.find((web) => isWebType(web, WebType.Frontend))
const backendConfig = this.webs.find((web) => isWebType(web, WebType.Backend))

return Boolean(frontendConfig || backendConfig)
return Boolean(frontendConfig ?? backendConfig)
}

creationDefaultOptions(): AppCreationDefaultOptions {
creationDefaultOptions(): CreateAppOptions {
return {
isLaunchable: this.appIsLaunchable(),
scopesArray: getAppScopesArray(this.configuration),
name: this.name,
directory: this.directory,
}
}

Expand Down Expand Up @@ -548,9 +549,3 @@ export async function getDependencyVersion(dependency: string, directory: string
if (!packageContent.version) return 'not_found'
return {name: dependency, version: packageContent.version}
}

export interface AppCreationDefaultOptions {
isLaunchable: boolean
scopesArray: string[]
name: string
}
5 changes: 5 additions & 0 deletions packages/app/src/cli/models/app/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3204,6 +3204,7 @@ describe('loadConfigForAppCreation', () => {
isLaunchable: false,
scopesArray: ['read_orders', 'write_products'],
name: 'my-app',
directory: tmpDir,
})
})
})
Expand Down Expand Up @@ -3236,6 +3237,7 @@ dev = "echo 'Hello, world!'"
isLaunchable: true,
scopesArray: ['write_products'],
name: 'my-app',
directory: tmpDir,
})
})
})
Expand Down Expand Up @@ -3271,6 +3273,7 @@ dev = "echo 'Hello, world!'"
isLaunchable: true,
scopesArray: ['write_products'],
name: 'my-app',
directory: tmpDir,
})
})
})
Expand All @@ -3295,6 +3298,7 @@ dev = "echo 'Hello, world!'"
isLaunchable: false,
scopesArray: ['read_orders', 'write_products'],
name: 'my-app',
directory: tmpDir,
})
})
})
Expand All @@ -3317,6 +3321,7 @@ dev = "echo 'Hello, world!'"
isLaunchable: false,
scopesArray: [],
name: 'my-app',
directory: tmpDir,
})
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/cli/models/app/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
LegacyAppConfiguration,
BasicAppConfigurationWithoutModules,
SchemaForConfig,
AppCreationDefaultOptions,
AppLinkedInterface,
} from './app.js'
import {showMultipleCLIWarningIfNeeded} from './validation/multi-cli-warning.js'
Expand All @@ -26,7 +25,7 @@ import {ExtensionsArraySchema, UnifiedSchema} from '../extensions/schemas.js'
import {ExtensionSpecification, RemoteAwareExtensionSpecification} from '../extensions/specification.js'
import {getCachedAppInfo} from '../../services/local-storage.js'
import use from '../../services/app/config/use.js'
import {Flag} from '../../utilities/developer-platform-client.js'
import {CreateAppOptions, Flag} from '../../utilities/developer-platform-client.js'
import {findConfigFiles} from '../../prompts/config.js'
import {WebhookSubscriptionSpecIdentifier} from '../extensions/specifications/app_config_webhook_subscription.js'
import {WebhooksSchema} from '../extensions/specifications/app_config_webhook_schemas/webhooks_schema.js'
Expand Down Expand Up @@ -213,7 +212,7 @@ export async function checkFolderIsValidApp(directory: string) {
)
}

export async function loadConfigForAppCreation(directory: string, name: string): Promise<AppCreationDefaultOptions> {
export async function loadConfigForAppCreation(directory: string, name: string): Promise<CreateAppOptions> {
const state = await getAppConfigurationState(directory)
const config: AppConfiguration = state.state === 'connected-app' ? state.basicConfiguration : state.startingOptions
const loadedConfiguration = await loadAppConfigurationFromState(state, [], [])
Expand All @@ -225,6 +224,7 @@ export async function loadConfigForAppCreation(directory: string, name: string):
isLaunchable: webs.webs.some((web) => isWebType(web, WebType.Frontend) || isWebType(web, WebType.Backend)),
scopesArray: getAppScopesArray(config),
name,
directory,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function buildDeveloperPlatformClient(): DeveloperPlatformClient {
hasMorePages: false,
}
},
async createApp(org, name, options) {
async createApp(org, options) {
return testOrganizationApp({
requestedAccessScopes: options?.scopesArray,
developerPlatformClient: this as DeveloperPlatformClient,
Expand Down
7 changes: 4 additions & 3 deletions packages/app/src/cli/services/app/config/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
CliBuildPreferences,
getAppScopes,
LegacyAppConfiguration,
AppCreationDefaultOptions,
} from '../../../models/app/app.js'
import {OrganizationApp} from '../../../models/organization.js'
import {selectConfigName} from '../../../prompts/config.js'
Expand All @@ -27,6 +26,7 @@
Flag,
DeveloperPlatformClient,
sniffServiceOptionsAndAppConfigToSelectPlatformClient,
CreateAppOptions,
} from '../../../utilities/developer-platform-client.js'
import {configurationFileNames} from '../../../constants.js'
import {writeAppConfigurationFile} from '../write-app-configuration-file.js'
Expand Down Expand Up @@ -152,7 +152,7 @@
}
}

const remoteApp = await fetchOrCreateOrganizationApp(creationOptions, appDirectory)
const remoteApp = await fetchOrCreateOrganizationApp({...creationOptions, directory: appDirectory})

developerPlatformClient = remoteApp.developerPlatformClient ?? developerPlatformClient

Expand All @@ -173,13 +173,14 @@
* @returns Default options for creating a new app; the app's actual directory if loaded.
*/
async function getAppCreationDefaultsFromLocalApp(options: LinkOptions): Promise<{
creationOptions: AppCreationDefaultOptions
creationOptions: CreateAppOptions
appDirectory?: string
}> {
const appCreationDefaults = {
isLaunchable: false,
scopesArray: [] as string[],
name: '',
directory: options.directory,
}
try {
const app = await loadApp({
Expand Down Expand Up @@ -345,7 +346,7 @@
const currentToml = existingTomls[remoteApp.apiKey]
if (currentToml) return currentToml

return selectConfigName(localAppInfo.appDirectory || options.directory, remoteApp.title)

Check warning on line 349 in packages/app/src/cli/services/app/config/link.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/app/config/link.ts#L349

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
}

/**
Expand Down Expand Up @@ -481,8 +482,8 @@

function addRemoteAppHomeConfig(remoteApp: OrganizationApp) {
const homeConfig = {
application_url: remoteApp.applicationUrl?.replace(/\/$/, '') || '',

Check warning on line 485 in packages/app/src/cli/services/app/config/link.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/app/config/link.ts#L485

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
embedded: remoteApp.embedded === undefined ? true : remoteApp.embedded,

Check warning on line 486 in packages/app/src/cli/services/app/config/link.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/app/config/link.ts#L486

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a ternary expression, as it is simpler to read.
}
return remoteApp.preferencesUrl
? {
Expand All @@ -508,8 +509,8 @@

function addRemoteAppWebhooksConfig(remoteApp: OrganizationApp) {
const hasAnyPrivacyWebhook =
remoteApp.gdprWebhooks?.customerDataRequestUrl ||

Check warning on line 512 in packages/app/src/cli/services/app/config/link.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/app/config/link.ts#L512

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
remoteApp.gdprWebhooks?.customerDeletionUrl ||

Check warning on line 513 in packages/app/src/cli/services/app/config/link.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/app/config/link.ts#L513

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
remoteApp.gdprWebhooks?.shopDeletionUrl

const privacyComplianceContent = {
Expand All @@ -522,7 +523,7 @@

return {
webhooks: {
api_version: remoteApp.webhookApiVersion || '2023-07',

Check warning on line 526 in packages/app/src/cli/services/app/config/link.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/app/config/link.ts#L526

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
...(hasAnyPrivacyWebhook ? privacyComplianceContent : {}),
},
}
Expand Down Expand Up @@ -558,7 +559,7 @@
function addPosConfig(remoteApp: OrganizationApp) {
return {
pos: {
embedded: remoteApp.posEmbedded || false,

Check warning on line 562 in packages/app/src/cli/services/app/config/link.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/app/config/link.ts#L562

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
},
}
}
Expand Down
26 changes: 8 additions & 18 deletions packages/app/src/cli/services/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
import {DeployOptions} from './deploy.js'
import {isServiceAccount, isUserAccount} from './context/partner-account-info.js'
import {selectOrganizationPrompt} from '../prompts/dev.js'
import {
AppInterface,
isCurrentAppSchema,
CurrentAppConfiguration,
AppCreationDefaultOptions,
AppLinkedInterface,
} from '../models/app/app.js'
import {AppInterface, isCurrentAppSchema, CurrentAppConfiguration, AppLinkedInterface} from '../models/app/app.js'
import {Identifiers, updateAppIdentifiers, getAppIdentifiers} from '../models/app/identifiers.js'
import {Organization, OrganizationApp, OrganizationSource, OrganizationStore} from '../models/organization.js'
import metadata from '../metadata.js'
Expand All @@ -25,7 +19,11 @@
DevelopmentStorePreviewUpdateInput,
DevelopmentStorePreviewUpdateSchema,
} from '../api/graphql/development_preview.js'
import {DeveloperPlatformClient, selectDeveloperPlatformClient} from '../utilities/developer-platform-client.js'
import {
CreateAppOptions,
DeveloperPlatformClient,
selectDeveloperPlatformClient,
} from '../utilities/developer-platform-client.js'
import {tryParseInt} from '@shopify/cli-kit/common/string'
import {Token, TokenItem, renderConfirmationPrompt, renderInfo, renderWarning} from '@shopify/cli-kit/node/ui'
import {AbortError} from '@shopify/cli-kit/node/error'
Expand Down Expand Up @@ -268,19 +266,11 @@
})
}

export async function fetchOrCreateOrganizationApp(
options: AppCreationDefaultOptions,
directory?: string,
): Promise<OrganizationApp> {
const {isLaunchable, scopesArray, name} = options
export async function fetchOrCreateOrganizationApp(options: CreateAppOptions): Promise<OrganizationApp> {
const org = await selectOrg()
const developerPlatformClient = selectDeveloperPlatformClient({organization: org})
const {organization, apps, hasMorePages} = await developerPlatformClient.orgAndApps(org.id)
const remoteApp = await selectOrCreateApp(name, apps, hasMorePages, organization, developerPlatformClient, {
isLaunchable,
scopesArray,
directory,
})
const remoteApp = await selectOrCreateApp(apps, hasMorePages, organization, developerPlatformClient, options)
remoteApp.developerPlatformClient = developerPlatformClient

await logMetadataForLoadedContext(remoteApp, developerPlatformClient.organizationSource)
Expand Down Expand Up @@ -375,7 +365,7 @@
if (devStore) devStores.push(devStore)

const body = formInfoBoxBody(appName, org, devStores, resetMessage, updateURLs, includeConfigOnDeploy)
const fileName = (appDotEnv && basename(appDotEnv)) || (configFile && getAppConfigurationFileName(configFile))

Check warning on line 368 in packages/app/src/cli/services/context.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/services/context.ts#L368

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.
renderInfo({
headline: configFile ? `Using ${fileName} for default values:` : 'Using these settings:',
body,
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/cli/services/dev/select-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('selectOrCreateApp', () => {

// When
const {developerPlatformClient} = mockDeveloperPlatformClient()
const got = await selectOrCreateApp(LOCAL_APP.name, APPS, false, ORG1, developerPlatformClient, {})
const got = await selectOrCreateApp(APPS, false, ORG1, developerPlatformClient, {name: LOCAL_APP.name})

// Then
expect(got).toEqual(APP1)
Expand All @@ -75,11 +75,11 @@ describe('selectOrCreateApp', () => {

// When
const {developerPlatformClient} = mockDeveloperPlatformClient()
const got = await selectOrCreateApp(LOCAL_APP.name, APPS, false, ORG1, developerPlatformClient, {})
const got = await selectOrCreateApp(APPS, false, ORG1, developerPlatformClient, {name: LOCAL_APP.name})

// Then
expect(got).toEqual({...APP1, newApp: true})
expect(appNamePrompt).toHaveBeenCalledWith(LOCAL_APP.name)
expect(developerPlatformClient.createApp).toHaveBeenCalledWith(ORG1, 'app-name', {})
expect(developerPlatformClient.createApp).toHaveBeenCalledWith(ORG1, {name: 'app-name'})
})
})
15 changes: 5 additions & 10 deletions packages/app/src/cli/services/dev/select-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {searchForAppsByNameFactory} from './prompt-helpers.js'
import {appNamePrompt, createAsNewAppPrompt, selectAppPrompt} from '../../prompts/dev.js'
import {Organization, MinimalOrganizationApp, OrganizationApp} from '../../models/organization.js'
import {getCachedCommandInfo, setCachedCommandTomlPreference} from '../local-storage.js'
import {DeveloperPlatformClient} from '../../utilities/developer-platform-client.js'
import {CreateAppOptions, DeveloperPlatformClient} from '../../utilities/developer-platform-client.js'
import {AppConfigurationFileName} from '../../models/app/loader.js'
import {BugError} from '@shopify/cli-kit/node/error'

Expand All @@ -16,27 +16,22 @@ import {BugError} from '@shopify/cli-kit/node/error'
* @returns The selected (or created) app
*/
export async function selectOrCreateApp(
localAppName: string,
apps: MinimalOrganizationApp[],
hasMorePages: boolean,
org: Organization,
developerPlatformClient: DeveloperPlatformClient,
options?: {
isLaunchable?: boolean
scopesArray?: string[]
directory?: string
},
options: CreateAppOptions,
): Promise<OrganizationApp> {
let createNewApp = apps.length === 0
if (!createNewApp) {
createNewApp = await createAsNewAppPrompt()
}
if (createNewApp) {
const name = await appNamePrompt(localAppName)
return developerPlatformClient.createApp(org, name, options)
const name = await appNamePrompt(options.name)
return developerPlatformClient.createApp(org, {...options, name})
} else {
const app = await selectAppPrompt(searchForAppsByNameFactory(developerPlatformClient, org.id), apps, hasMorePages, {
directory: options?.directory,
directory: options.directory,
})

const data = getCachedCommandInfo()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/cli/services/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async function init(options: InitOptions) {
if (options.selectedAppOrNameResult.result === 'new') {
const creationOptions = await loadConfigForAppCreation(outputDirectory, options.name)
const org = options.selectedAppOrNameResult.org
app = await options.developerPlatformClient.createApp(org, options.name, creationOptions)
app = await options.developerPlatformClient.createApp(org, creationOptions)
} else {
app = options.selectedAppOrNameResult.app
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function selectDeveloperPlatformClientByConfig(configuration: AppConfiguration |
}

export interface CreateAppOptions {
name: string
isLaunchable?: boolean
scopesArray?: string[]
directory?: string
Expand Down Expand Up @@ -222,7 +223,7 @@ export interface DeveloperPlatformClient {
appsForOrg: (orgId: string, term?: string) => Promise<Paginateable<{apps: MinimalOrganizationApp[]}>>
specifications: (app: MinimalAppIdentifiers) => Promise<RemoteSpecification[]>
templateSpecifications: (app: MinimalAppIdentifiers) => Promise<ExtensionTemplate[]>
createApp: (org: Organization, name: string, options?: CreateAppOptions) => Promise<OrganizationApp>
createApp: (org: Organization, options: CreateAppOptions) => Promise<OrganizationApp>
devStoresForOrg: (orgId: string, searchTerm?: string) => Promise<Paginateable<{stores: OrganizationStore[]}>>
storeByDomain: (orgId: string, shopDomain: string) => Promise<FindStoreByDomainSchema>
appExtensionRegistrations: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ describe('createApp', () => {

// When
client.token = () => Promise.resolve('token')
await client.createApp(org, 'app-name')
await client.createApp(org, {name: 'app-name'})

// Then
expect(webhooksRequest).toHaveBeenCalledWith(org.id, expect.anything(), 'token', expect.any(Object))
Expand Down Expand Up @@ -381,7 +381,7 @@ describe('createApp', () => {

// When
client.token = () => Promise.resolve('token')
const result = await client.createApp(org, appName)
const result = await client.createApp(org, {name: 'app-name'})

// Then
expect(result).toMatchObject(expectedApp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
filterDisabledFlags,
ClientName,
AppModuleVersion,
CreateAppOptions,
} from '../developer-platform-client.js'
import {PartnersSession} from '../../services/context/partner-account-info.js'
import {
Expand Down Expand Up @@ -361,15 +362,7 @@
).map((template) => ({...template, sortPriority: counter++}))
}

async createApp(
org: Organization,
name: string,
options?: {
isLaunchable?: boolean
scopesArray?: string[]
directory?: string
},
): Promise<OrganizationApp> {
async createApp(org: Organization, options: CreateAppOptions): Promise<OrganizationApp> {
// Query for latest api version
const apiVersions = await this.apiVersions(org.id)
const apiVersion =
Expand All @@ -378,7 +371,7 @@
.sort()
.at(-1) ?? 'unstable'

const variables = createAppVars(name, options?.isLaunchable, options?.scopesArray, apiVersion)
const variables = createAppVars(options, apiVersion)

const mutation = CreateApp
const result = await appManagementRequestDoc(org.id, mutation, await this.token(), variables)
Expand All @@ -393,7 +386,7 @@
const apiSecretKeys = createdApp.activeRoot.clientCredentials.secrets.map((secret) => ({secret: secret.key}))
return {
...createdApp,
title: name,
title: options.name,
apiKey: createdApp.key,
apiSecretKeys,
grantedScopes: options?.scopesArray ?? [],
Expand Down Expand Up @@ -431,7 +424,7 @@
appIdentifiers: MinimalAppIdentifiers,
activeAppVersion?: AppVersion,
): Promise<AllAppExtensionRegistrationsQuerySchema> {
const app = activeAppVersion || (await this.activeAppVersion(appIdentifiers))

Check warning on line 427 in packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts#L427

[@typescript-eslint/prefer-nullish-coalescing] Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator.

const configurationRegistrations: ExtensionRegistration[] = []
const extensionRegistrations: ExtensionRegistration[] = []
Expand Down Expand Up @@ -919,12 +912,8 @@
const MAGIC_URL = 'https://shopify.dev/apps/default-app-home'
const MAGIC_REDIRECT_URL = 'https://shopify.dev/apps/default-app-home/api/auth'

function createAppVars(
name: string,
isLaunchable = true,
scopesArray?: string[],
apiVersion?: string,
): CreateAppMutationVariables {
function createAppVars(options: CreateAppOptions, apiVersion?: string): CreateAppMutationVariables {
const {isLaunchable, scopesArray, name} = options
return {
appSource: {
appModules: [
Expand Down
Loading
Loading