Skip to content

Commit 33cc6fa

Browse files
committed
Remove blocks on calls to partners api
1 parent e794f12 commit 33cc6fa

5 files changed

Lines changed: 2 additions & 37 deletions

File tree

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import {
5858
} from '../api/graphql/app-management/generated/app-logs-subscribe.js'
5959
import {Session} from '@shopify/cli-kit/node/session'
6060
import {TokenItem} from '@shopify/cli-kit/node/ui'
61-
import {blockPartnersAccess} from '@shopify/cli-kit/node/environment'
6261
import {UnauthorizedHandler} from '@shopify/cli-kit/node/api/graphql'
6362
import {JsonMapType} from '@shopify/cli-kit/node/toml'
6463

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

8685
clients.push(AppManagementClient.getInstance())
8786

88-
if (!blockPartnersAccess()) {
89-
clients.push(PartnersClient.getInstance())
90-
}
87+
clients.push(PartnersClient.getInstance())
9188

9289
return clients
9390
}
@@ -105,8 +102,6 @@ function selectDeveloperPlatformClientByOrg(organization: Organization): Develop
105102
}
106103

107104
function defaultDeveloperPlatformClient(): DeveloperPlatformClient {
108-
if (blockPartnersAccess()) return AppManagementClient.getInstance()
109-
110105
return PartnersClient.getInstance()
111106
}
112107

packages/cli-kit/src/private/node/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export const environmentVariables = {
4242
otelURL: 'SHOPIFY_CLI_OTEL_EXPORTER_OTLP_ENDPOINT',
4343
themeKitAccessDomain: 'SHOPIFY_CLI_THEME_KIT_ACCESS_DOMAIN',
4444
json: 'SHOPIFY_FLAG_JSON',
45-
neverUsePartnersApi: 'SHOPIFY_CLI_NEVER_USE_PARTNERS_API',
46-
usePartnersApi: 'SHOPIFY_CLI_USE_PARTNERS_API',
4745
skipNetworkLevelRetry: 'SHOPIFY_CLI_SKIP_NETWORK_LEVEL_RETRY',
4846
maxRequestTimeForNetworkCalls: 'SHOPIFY_CLI_MAX_REQUEST_TIME_FOR_NETWORK_CALLS',
4947
}

packages/cli-kit/src/public/node/context/fqdn.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ import {
88
adminFqdn,
99
} from './fqdn.js'
1010
import {Environment, serviceEnvironment} from '../../../private/node/context/service.js'
11-
import {blockPartnersAccess} from '../environment.js'
1211
import {expect, describe, test, vi} from 'vitest'
1312

1413
vi.mock('../../../private/node/context/service.js')
15-
vi.mock('../environment.js')
1614

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

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

5147
// When
5248
const got = await partnersFqdn()

packages/cli-kit/src/public/node/context/fqdn.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import {AbortError, BugError} from '../error.js'
1+
import {AbortError} from '../error.js'
22
import {serviceEnvironment} from '../../../private/node/context/service.js'
33
import {DevServer, DevServerCore} from '../vendor/dev_server/index.js'
4-
import {blockPartnersAccess} from '../environment.js'
54

65
export const NotProvidedStoreFQDNError = new AbortError(
76
"Couldn't obtain the Shopify FQDN because the store FQDN was not provided.",
@@ -13,9 +12,6 @@ export const NotProvidedStoreFQDNError = new AbortError(
1312
* @returns Fully-qualified domain of the partners service we should interact with.
1413
*/
1514
export async function partnersFqdn(): Promise<string> {
16-
if (blockPartnersAccess()) {
17-
throw new BugError('Partners API is is no longer available.')
18-
}
1915
const environment = serviceEnvironment()
2016
const productionFqdn = 'partners.shopify.com'
2117
switch (environment) {

packages/cli-kit/src/public/node/environment.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,6 @@ export function jsonOutputEnabled(environment = getEnvironmentVariables()): bool
8383
return sniffForJson() || isTruthy(environment[environmentVariables.json])
8484
}
8585

86-
/**
87-
* If true, the CLI should not use the Partners API.
88-
*
89-
* @returns True when the CLI should not use the Partners API.
90-
*/
91-
export function blockPartnersAccess(): boolean {
92-
// Block if explicitly set to never use Partners API
93-
if (isTruthy(getEnvironmentVariables()[environmentVariables.neverUsePartnersApi])) {
94-
return true
95-
}
96-
97-
// If explicitly forcing to use Partners API, do not block
98-
if (isTruthy(getEnvironmentVariables()[environmentVariables.usePartnersApi])) {
99-
return false
100-
}
101-
102-
// Block for 3P devs
103-
return !isTruthy(getEnvironmentVariables()[environmentVariables.firstPartyDev])
104-
}
105-
10686
/**
10787
* If true, the CLI should not use the network level retry.
10888
*

0 commit comments

Comments
 (0)