Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import {
} from '../api/graphql/app-management/generated/app-logs-subscribe.js'
import {Session} from '@shopify/cli-kit/node/session'
import {TokenItem} from '@shopify/cli-kit/node/ui'
import {blockPartnersAccess} from '@shopify/cli-kit/node/environment'
import {UnauthorizedHandler} from '@shopify/cli-kit/node/api/graphql'
import {JsonMapType} from '@shopify/cli-kit/node/toml'

Expand All @@ -85,9 +84,7 @@ export function allDeveloperPlatformClients(): DeveloperPlatformClient[] {

clients.push(AppManagementClient.getInstance())

if (!blockPartnersAccess()) {
clients.push(PartnersClient.getInstance())
}
clients.push(PartnersClient.getInstance())

return clients
}
Expand All @@ -105,8 +102,6 @@ function selectDeveloperPlatformClientByOrg(organization: Organization): Develop
}

function defaultDeveloperPlatformClient(): DeveloperPlatformClient {
if (blockPartnersAccess()) return AppManagementClient.getInstance()

return PartnersClient.getInstance()
}

Expand Down
2 changes: 0 additions & 2 deletions packages/cli-kit/src/private/node/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export const environmentVariables = {
otelURL: 'SHOPIFY_CLI_OTEL_EXPORTER_OTLP_ENDPOINT',
themeKitAccessDomain: 'SHOPIFY_CLI_THEME_KIT_ACCESS_DOMAIN',
json: 'SHOPIFY_FLAG_JSON',
neverUsePartnersApi: 'SHOPIFY_CLI_NEVER_USE_PARTNERS_API',
usePartnersApi: 'SHOPIFY_CLI_USE_PARTNERS_API',
skipNetworkLevelRetry: 'SHOPIFY_CLI_SKIP_NETWORK_LEVEL_RETRY',
maxRequestTimeForNetworkCalls: 'SHOPIFY_CLI_MAX_REQUEST_TIME_FOR_NETWORK_CALLS',
}
Expand Down
4 changes: 0 additions & 4 deletions packages/cli-kit/src/public/node/context/fqdn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import {
adminFqdn,
} from './fqdn.js'
import {Environment, serviceEnvironment} from '../../../private/node/context/service.js'
import {blockPartnersAccess} from '../environment.js'
import {expect, describe, test, vi} from 'vitest'

vi.mock('../../../private/node/context/service.js')
vi.mock('../environment.js')

vi.mock('../vendor/dev_server/index.js', () => {
return {
Expand All @@ -34,7 +32,6 @@ describe('partners', () => {
test('returns the local fqdn when the environment is local', async () => {
// Given
vi.mocked(serviceEnvironment).mockReturnValue(Environment.Local)
vi.mocked(blockPartnersAccess).mockReturnValue(false)

// When
const got = await partnersFqdn()
Expand All @@ -46,7 +43,6 @@ describe('partners', () => {
test('returns the production fqdn when the environment is production', async () => {
// Given
vi.mocked(serviceEnvironment).mockReturnValue(Environment.Production)
vi.mocked(blockPartnersAccess).mockReturnValue(false)

// When
const got = await partnersFqdn()
Expand Down
6 changes: 1 addition & 5 deletions packages/cli-kit/src/public/node/context/fqdn.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {AbortError, BugError} from '../error.js'
import {AbortError} from '../error.js'
import {serviceEnvironment} from '../../../private/node/context/service.js'
import {DevServer, DevServerCore} from '../vendor/dev_server/index.js'
import {blockPartnersAccess} from '../environment.js'

export const NotProvidedStoreFQDNError = new AbortError(
"Couldn't obtain the Shopify FQDN because the store FQDN was not provided.",
Expand All @@ -13,9 +12,6 @@ export const NotProvidedStoreFQDNError = new AbortError(
* @returns Fully-qualified domain of the partners service we should interact with.
*/
export async function partnersFqdn(): Promise<string> {
if (blockPartnersAccess()) {
throw new BugError('Partners API is is no longer available.')
}
const environment = serviceEnvironment()
const productionFqdn = 'partners.shopify.com'
switch (environment) {
Expand Down
20 changes: 0 additions & 20 deletions packages/cli-kit/src/public/node/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,6 @@ export function jsonOutputEnabled(environment = getEnvironmentVariables()): bool
return sniffForJson() || isTruthy(environment[environmentVariables.json])
}

/**
* If true, the CLI should not use the Partners API.
*
* @returns True when the CLI should not use the Partners API.
*/
export function blockPartnersAccess(): boolean {
// Block if explicitly set to never use Partners API
if (isTruthy(getEnvironmentVariables()[environmentVariables.neverUsePartnersApi])) {
return true
}

// If explicitly forcing to use Partners API, do not block
if (isTruthy(getEnvironmentVariables()[environmentVariables.usePartnersApi])) {
return false
}

// Block for 3P devs
return !isTruthy(getEnvironmentVariables()[environmentVariables.firstPartyDev])
}

/**
* If true, the CLI should not use the network level retry.
*
Expand Down
Loading