File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export const environmentVariables = {
4343 themeKitAccessDomain : 'SHOPIFY_CLI_THEME_KIT_ACCESS_DOMAIN' ,
4444 json : 'SHOPIFY_FLAG_JSON' ,
4545 neverUsePartnersApi : 'SHOPIFY_CLI_NEVER_USE_PARTNERS_API' ,
46+ usePartnersApi : 'SHOPIFY_CLI_USE_PARTNERS_API' ,
4647 skipNetworkLevelRetry : 'SHOPIFY_CLI_SKIP_NETWORK_LEVEL_RETRY' ,
4748 maxRequestTimeForNetworkCalls : 'SHOPIFY_CLI_MAX_REQUEST_TIME_FOR_NETWORK_CALLS' ,
4849}
Original file line number Diff line number Diff line change @@ -86,13 +86,21 @@ export function jsonOutputEnabled(environment = getEnvironmentVariables()): bool
8686/**
8787 * If true, the CLI should not use the Partners API.
8888 *
89- * @returns True when SHOPIFY_CLI_NEVER_USE_PARTNERS_API is set or SHOPIFY_CLI_1P_DEV is not set .
89+ * @returns True when the CLI should not use the Partners API .
9090 */
9191export function blockPartnersAccess ( ) : boolean {
92- return (
93- isTruthy ( getEnvironmentVariables ( ) [ environmentVariables . neverUsePartnersApi ] ) ||
94- ! isTruthy ( getEnvironmentVariables ( ) [ environmentVariables . firstPartyDev ] )
95- )
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 ] )
96104}
97105
98106/**
You can’t perform that action at this time.
0 commit comments