cli icon indicating copy to clipboard operation
cli copied to clipboard

Provision user access to stores only when permitted

Open gordonhirsch opened this issue 9 months ago β€’ 4 comments

WHY are these changes introduced?

Modifies the fix for https://github.com/Shopify/core-issues/issues/88829 to limit calls the BP provisioning mutation to organization owners and administrators.

WHAT is this pull request doing?

The mutation is available only to holders of the ondemand_access_to_stores permission. Other users should always be provisioned for access to a store and do not need the mutation called.

To avoid a separate GraphQL query to fetch user permissions, they are instead added to existing to store fetch calls by including

currentUser {
  organizationPermissions
}

in the existing query.

The additional information is added to OrganizationStore class so that is available when needed.

Ideally we would not be storing user-level information in a store object, but to avoid that, we'd need to

  • Add yet another GraphQL call to the app dev flow, or
  • Gather permission info more centrally for an authenticated user. This would require some refactoring and probably moving from destinations API to organizations API to gather some user info (beyond the scope of this PR)

How to test your changes?

Tophatting requires local dev and the following painful steps (sorry)

Add the user management scope to the CLI application.

  • Visit https://identity.shop.dev/services/applications
  • Search for shopify-cli
  • Click Edit
  • Under "scopes that may be requested", select the checkbox for the BP user-management checkbox (https://api.shopify.com/auth/organization.user-management)
  • Save the changes. Ignore the error message.

Run BP using the rz-accessible-shops branch, rebasing from main as necessary.

Update shop/world

  • Ensure that your local repo is recent enough to include this PR
  • Add potentiaal dev shops to extra_server_names (details)

Ensure that [email protected] has created a development store as described in the local dev doc

Log in to the dev store and add an admin user for the store.

  • Navigate to Settings -> Users and click add user.
  • Enter an email for one of the existing test users (e.g. [email protected]).
  • Assign the user to an organization administrator role
  • At this point the user has been invited. To accept the invitation, follow the instructions here (run the commands via bin/rails c from the BP repo)

Create a store as the admin user

  • Log in to dev dash as the admin user invited above (incognito)
  • Create a store

Exercise the alternative methods of listing/selecting stores from the CLI. Both stores should be visible and selectable, and app dev should start up and auto-install the app on the selected store if necessary.

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • [ ] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • [x] Existing analytics will cater for this addition
  • [ ] PR includes analytics changes to measure impact

Checklist

  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • [x] I've considered possible documentation changes

gordonhirsch avatar Apr 01 '25 17:04 gordonhirsch

This stack of pull requests is managed by Graphite. Learn more about stacking.

gordonhirsch avatar Apr 01 '25 17:04 gordonhirsch

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
77.98% (-0.02% πŸ”»)
12467/15987
🟑 Branches
72.14% (-0.02% πŸ”»)
6041/8374
🟑 Functions
78.23% (-0.02% πŸ”»)
3274/4185
🟑 Lines
78.41% (-0.02% πŸ”»)
11794/15041
Show files with reduced coverage πŸ”»
St.:grey_question:
File Statements Branches Functions Lines
πŸ”΄
... / app-management-client.ts
46.2% (-0.1% πŸ”»)
41.43% (-0.36% πŸ”»)
43.69% (-0.43% πŸ”»)
45.05% (-0.09% πŸ”»)
πŸ”΄
... / partners-client.ts
25.48% (-0.5% πŸ”»)
30% (-1.58% πŸ”»)
16.67%
25.17% (-0.51% πŸ”»)
🟒
... / ConcurrentOutput.tsx
98.36% (-1.64% πŸ”»)
92% (-4% πŸ”»)
100%
98.33% (-1.67% πŸ”»)

Test suite run success

2869 tests passing in 1253 suites.

Report generated by πŸ§ͺjest coverage report action from 51b07874c27962e964b0638511888aab15c8e21b

github-actions[bot] avatar Apr 01 '25 17:04 github-actions[bot]

We detected some changes at packages/*/src and there are no updates in the .changeset. If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

github-actions[bot] avatar Apr 01 '25 22:04 github-actions[bot]

This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. β†’ If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

github-actions[bot] avatar May 23 '25 03:05 github-actions[bot]

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/common/array.d.ts
@@ -45,17 +45,4 @@ export declare function uniqBy<T>(array: List<T> | null | undefined, iteratee: V
  * @param values - The arrays of values to exclude.
  * @returns Returns the new array of filtered values.
  */
-export declare function difference<T>(array: List<T> | null | undefined, ...values: List<T>[]): T[];
-/**
- * Converts an array of anything into a human friendly list.
- *
- * Returns a new array that contains the items separated by commas,
- * except for the last item, which is separated by "and".
- * This is useful for creating human-friendly sentences.
- *
- * @param items - Token[].
- * @returns Token[].
- * @example
- * 
- */
-export declare function asHumanFriendlyArray<T>(items: T[]): (T | string)[];
\ No newline at end of file
+export declare function difference<T>(array: List<T> | null | undefined, ...values: List<T>[]): T[];
\ No newline at end of file

packages/cli-kit/dist/public/common/version.d.ts
@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "3.80.0";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "3.78.0";
\ No newline at end of file

packages/cli-kit/dist/public/node/archiver.d.ts
@@ -20,43 +20,4 @@ interface ZipOptions {
  * @param options - ZipOptions.
  */
 export declare function zip(options: ZipOptions): Promise<void>;
-export interface BrotliOptions {
-    /**
-     * The directory to compress.
-     */
-    inputDirectory: string;
-    /**
-     * The path where the compressed file will be saved.
-     */
-    outputPath: string;
-    /**
-     * An optional glob pattern to match files.
-     */
-    matchFilePattern?: string | string[];
-    /**
-     * Brotli compression level (0-11, default: 11).
-     */
-    level?: number;
-}
-/**
- * Options for decompressing a Brotli compressed tar archive.
- */
-export interface DecompressionOptions {
-    /**
-     * Path to the compressed file.
-     */
-    inputFile: string;
-    /**
-     * Directory where files should be extracted.
-     */
-    outputDirectory: string;
-}
-/**
- * It compresses a directory with Brotli.
- * First creates a tar archive to preserve directory structure,
- * then compresses it with Brotli.
- *
- * @param options - BrotliOptions.
- */
-export declare function brotliCompress(options: BrotliOptions): Promise<void>;
 export {};
\ No newline at end of file

packages/cli-kit/dist/public/node/fs.d.ts
@@ -323,10 +323,4 @@ export interface MatchGlobOptions {
  * @returns true if the key matches the pattern, false otherwise.
  */
 export declare function matchGlob(key: string, pattern: string, options?: MatchGlobOptions): boolean;
-/**
- * Read a directory.
- * @param path - The path to read.
- * @returns A promise that resolves to an array of file names.
- */
-export declare function readdir(path: string): Promise<string[]>;
 export {};
\ No newline at end of file

packages/cli-kit/dist/public/node/git.d.ts
@@ -129,11 +129,4 @@ export declare function ensureIsClean(directory?: string): Promise<void>;
  * @param directory - The directory to check.
  * @returns True is the .git directory is clean.
  */
-export declare function isClean(directory?: string): Promise<boolean>;
-/**
- * Returns the latest tag of a git repository.
- *
- * @param directory - The directory to check.
- * @returns String with the latest tag or undefined if no tags are found.
- */
-export declare function getLatestTag(directory?: string): Promise<string | undefined>;
\ No newline at end of file
+export declare function isClean(directory?: string): Promise<boolean>;
\ No newline at end of file

packages/cli-kit/dist/public/node/http.d.ts
@@ -19,7 +19,7 @@ type AutomaticCancellationBehaviour = {
     useAbortSignal: AbortSignal | (() => AbortSignal);
 };
 type RequestBehaviour = NetworkRetryBehaviour & AutomaticCancellationBehaviour;
-export type RequestModeInput = PresetFetchBehaviour | RequestBehaviour;
+type RequestModeInput = PresetFetchBehaviour | RequestBehaviour;
 /**
  * Specify the behaviour of a network request.
  *

packages/cli-kit/dist/public/node/is-global.d.ts
@@ -6,6 +6,12 @@ import { PackageManager } from './node-package-manager.js';
  * @returns  if the current process is running in a global context.
  */
 export declare function currentProcessIsGlobal(argv?: string[]): boolean;
+/**
+ * Returns true if the global CLI is installed.
+ *
+ * @returns  if the global CLI is installed.
+ */
+export declare function isGlobalCLIInstalled(): Promise<boolean>;
 /**
  * Installs the global Shopify CLI, using the provided package manager.
  *

packages/cli-kit/dist/public/node/monorail.d.ts
@@ -2,7 +2,7 @@ import { JsonMap } from '../../private/common/json.js';
 import { DeepRequired } from '../common/ts/deep-required.js';
 export { DeepRequired };
 type Optional<T> = T | null;
-export declare const MONORAIL_COMMAND_TOPIC = "app_cli3_command/1.17";
+export declare const MONORAIL_COMMAND_TOPIC = "app_cli3_command/1.16";
 export interface Schemas {
     [MONORAIL_COMMAND_TOPIC]: {
         sensitive: {

packages/cli-kit/dist/public/node/output.d.ts
@@ -63,17 +63,9 @@ export declare let collectedLogs: {
 export declare function collectLog(key: string, content: OutputMessage): void;
 export declare const clearCollectedLogs: () => void;
 /**
- * Outputs command result information to the user.
- * Result messages don't get additional formatting.
- * The messages are logged at info level to stdout.
- *
- * @param content - The content to be output to the user.
- */
-export declare function outputResult(content: OutputMessage): void;
-/**
- * Logs information at the info level.
+ * Ouputs information to the user.
  * Info messages don't get additional formatting.
- * Note: By default, info messages are sent through the standard error.
+ * Note: Info messages are sent through the standard output.
  *
  * @param content - The content to be output to the user.
  * @param logger - The logging function to use to output to the user.
@@ -82,7 +74,7 @@ export declare function outputInfo(content: OutputMessage, logger?: Logger): voi
 /**
  * Outputs a success message to the user.
  * Success messages receive a special formatting to make them stand out in the console.
- * Note: Success messages are sent through the standard error.
+ * Note: Success messages are sent through the standard output.
  *
  * @param content - The content to be output to the user.
  * @param logger - The logging function to use to output to the user.
@@ -91,25 +83,25 @@ export declare function outputSuccess(content: OutputMessage, logger?: Logger):
 /**
  * Outputs a completed message to the user.
  * Completed message receive a special formatting to make them stand out in the console.
- * Note: Completed messages are sent through the standard error.
+ * Note: Completed messages are sent through the standard output.
  *
  * @param content - The content to be output to the user.
  * @param logger - The logging function to use to output to the user.
  */
 export declare function outputCompleted(content: OutputMessage, logger?: Logger): void;
 /**
- * Logs a message at the debug level. By default these output is hidden unless the user calls the CLI with --verbose.
+ * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.
  * Debug messages don't get additional formatting.
- * Note: By default, debug messages are sent through the standard error.
+ * Note: Debug messages are sent through the standard output.
  *
  * @param content - The content to be output to the user.
  * @param logger - The logging function to use to output to the user.
  */
 export declare function outputDebug(content: OutputMessage, logger?: Logger): void;
 /**
- * Logs a message at the warning level.
+ * Outputs a warning message to the user.
  * Warning messages receive a special formatting to make them stand out in the console.
- * Note: By default, warning messages are sent through the standard error.
+ * Note: Warning messages are sent through the standard output.
  *
  * @param content - The content to be output to the user.
  * @param logger - The logging function to use to output to the user.
@@ -146,6 +138,24 @@ export interface OutputProcess {
      */
     action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>;
 }
+/**
+ * Prints a log message in the console.
+ *
+ * @param message - The message to print.
+ */
+export declare function consoleLog(message: string): void;
+/**
+ * Prints an error message in the console.
+ *
+ * @param message - The message to print.
+ */
+export declare function consoleError(message: string): void;
+/**
+ * Prints a warning message in the console.
+ *
+ * @param message - The message to print.
+ */
+export declare function consoleWarn(message: string): void;
 /**
  * Writes a message to the appropiated logger.
  *

packages/cli-kit/dist/public/node/session.d.ts
@@ -8,7 +8,6 @@ export interface AdminSession {
 }
 interface EnsureAuthenticatedAdditionalOptions {
     noPrompt?: boolean;
-    forceRefresh?: boolean;
 }
 /**
  * Ensure that we have a valid session to access the Partners API.

packages/cli-kit/dist/public/node/system.d.ts
@@ -56,10 +56,4 @@ export declare function terminalSupportsPrompting(): boolean;
  *
  * @returns True if the current environment is a CI environment.
  */
-export declare function isCI(): boolean;
-/**
- * Check if the current environment is a WSL environment.
- *
- * @returns True if the current environment is a WSL environment.
- */
-export declare function isWsl(): Promise<boolean>;
\ No newline at end of file
+export declare function isCI(): boolean;
\ No newline at end of file

packages/cli-kit/dist/public/node/ui.d.ts
@@ -1,4 +1,5 @@
 import { FatalError as Fatal } from './error.js';
+import { Logger, LogLevel } from './output.js';
 import { ConcurrentOutputProps } from '../../private/node/ui/components/ConcurrentOutput.js';
 import { handleCtrlC, render } from '../../private/node/ui.js';
 import { AlertOptions } from '../../private/node/ui/alert.js';
@@ -369,6 +370,18 @@ export interface RenderDangerousConfirmationPromptOptions extends Omit<Dangerous
  *
  */
 export declare function renderDangerousConfirmationPrompt({ renderOptions, ...props }: RenderDangerousConfirmationPromptOptions, uiDebugOptions?: UIDebugOptions): Promise<boolean>;
+interface RenderTextOptions {
+    text: string;
+    logLevel?: LogLevel;
+    logger?: Logger;
+}
+/** Renders a text string to the console.
+ * Using this function makes sure that correct spacing is applied among the various components.
+ * @example
+ * Hello world!
+ *
+ */
+export declare function renderText({ text, logLevel, logger }: RenderTextOptions): string;
 /** Waits for any key to be pressed except Ctrl+C which will terminate the process. */
 export declare const keypress: (stdin?: NodeJS.ReadStream & {
     fd: 0;

packages/cli-kit/dist/public/node/version.d.ts
@@ -10,12 +10,4 @@ export declare function localCLIVersion(directory: string): Promise<string | und
  *
  * @returns The version of the CLI if it is globally installed or undefined.
  */
-export declare function globalCLIVersion(): Promise<string | undefined>;
-/**
- * Returns true if the given version is a pre-release version.
- * Meaning is a , , or  version.
- *
- * @param version - The version to check.
- * @returns True if the version is a pre-release version.
- */
-export declare function isPreReleaseVersion(version: string): boolean;
\ No newline at end of file
+export declare function globalCLIVersion(): Promise<string | undefined>;
\ No newline at end of file

packages/cli-kit/dist/private/node/analytics.d.ts
@@ -21,7 +21,6 @@ interface EnvironmentData {
     env_package_manager: string;
     env_is_global: boolean;
     env_auth_method: string;
-    env_is_wsl: boolean;
 }
 export declare function getEnvironmentData(config: Interfaces.Config): Promise<EnvironmentData>;
 export declare function getSensitiveEnvironmentData(config: Interfaces.Config): Promise<{

packages/cli-kit/dist/private/node/ui.d.ts
@@ -6,7 +6,7 @@ interface RenderOnceOptions {
     logger?: Logger;
     renderOptions?: RenderOptions;
 }
-export declare function renderOnce(element: JSX.Element, { logLevel, renderOptions }: RenderOnceOptions): string | undefined;
+export declare function renderOnce(element: JSX.Element, { logLevel, logger, renderOptions }: RenderOnceOptions): string | undefined;
 export declare function render(element: JSX.Element, options?: RenderOptions): Promise<unknown>;
 export declare class Stdout extends EventEmitter {
     columns: number;

packages/cli-kit/dist/public/node/api/admin.d.ts
@@ -1,6 +1,5 @@
 import { GraphQLResponseOptions, GraphQLVariables } from './graphql.js';
 import { AdminSession } from '../session.js';
-import { RequestModeInput } from '../http.js';
 import { Variables } from 'graphql-request';
 import { TypedDocumentNode } from '@graphql-typed-document-node/core';
 /**
@@ -12,27 +11,17 @@ import { TypedDocumentNode } from '@graphql-typed-document-node/core';
  * @returns The response of the query of generic type <T>.
  */
 export declare function adminRequest<T>(query: string, session: AdminSession, variables?: GraphQLVariables): Promise<T>;
-export interface AdminRequestOptions<TResult, TVariables extends Variables> {
-    /** GraphQL query to execute. */
-    query: TypedDocumentNode<TResult, TVariables>;
-    /** Shopify admin session including token and Store FQDN. */
-    session: AdminSession;
-    /** GraphQL variables to pass to the query. */
-    variables?: TVariables;
-    /** API version. */
-    version?: string;
-    /** Control how API responses will be handled. */
-    responseOptions?: GraphQLResponseOptions<TResult>;
-    /** Custom request behaviour for retries and timeouts. */
-    requestBehaviour?: RequestModeInput;
-}
 /**
  * Executes a GraphQL query against the Admin API. Uses typed documents.
  *
- * @param options - Admin request options.
+ * @param query - GraphQL query to execute.
+ * @param session - Shopify admin session including token and Store FQDN.
+ * @param variables - GraphQL variables to pass to the query.
+ * @param version - API version.
+ * @param responseOptions - Control how API responses will be handled.
  * @returns The response of the query of generic type <TResult>.
  */
-export declare function adminRequestDoc<TResult, TVariables extends Variables>(options: AdminRequestOptions<TResult, TVariables>): Promise<TResult>;
+export declare function adminRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables>, session: AdminSession, variables?: TVariables, version?: string, responseOptions?: GraphQLResponseOptions<TResult>): Promise<TResult>;
 /**
  * GraphQL query to retrieve all supported API versions.
  *

packages/cli-kit/dist/public/node/api/app-management.d.ts
@@ -1,5 +1,4 @@
 import { CacheOptions, GraphQLResponse } from './graphql.js';
-import { RequestModeInput } from '../http.js';
 import { TypedDocumentNode } from '@graphql-typed-document-node/core';
 import { Variables } from 'graphql-request';
 export declare const appManagementHeaders: (token: string) => {
@@ -9,9 +8,6 @@ export declare const appManagementAppLogsUrl: (organizationId: string, cursor?:
     status?: string;
     source?: string;
 }) => Promise<string>;
-export interface RequestOptions {
-    requestMode: RequestModeInput;
-}
 /**
  * Executes an org-scoped GraphQL query against the App Management API. Uses typed documents.
  *
@@ -20,10 +16,9 @@ export interface RequestOptions {
  * @param token - Partners token.
  * @param variables - GraphQL variables to pass to the query.
  * @param cacheOptions - Cache options for the request. If not present, the request will not be cached.
- * @param requestOptions - Preferred behaviour for the request.
  * @returns The response of the query of generic type <T>.
  */
-export declare function appManagementRequestDoc<TResult, TVariables extends Variables>(orgId: string, query: TypedDocumentNode<TResult, TVariables>, token: string, variables?: TVariables, cacheOptions?: CacheOptions, requestOptions?: RequestOptions): Promise<TResult>;
+export declare function appManagementRequestDoc<TResult, TVariables extends Variables>(orgId: string, query: TypedDocumentNode<TResult, TVariables>, token: string, variables?: TVariables, cacheOptions?: CacheOptions): Promise<TResult>;
 /**
  * Sets the next deprecation date from [GraphQL response extensions](https://www.apollographql.com/docs/resources/graphql-glossary/#extensions)
  * if  objects contain a  (ISO 8601-formatted string).

packages/cli-kit/dist/public/node/api/graphql.d.ts
@@ -1,6 +1,5 @@
 import { ConfSchema, TimeInterval } from '../../../private/node/conf-store.js';
 import { LocalStorage } from '../local-storage.js';
-import { RequestModeInput } from '../http.js';
 import { rawRequest, RequestDocument, Variables } from 'graphql-request';
 import { TypedDocumentNode } from '@graphql-typed-document-node/core';
 export type Exact<T extends {
@@ -26,13 +25,11 @@ interface GraphQLRequestBaseOptions<TResult> {
     };
     responseOptions?: GraphQLResponseOptions<TResult>;
     cacheOptions?: CacheOptions;
-    preferredBehaviour?: RequestModeInput;
 }
 export type GraphQLRequestOptions<T> = GraphQLRequestBaseOptions<T> & {
     query: RequestDocument;
     variables?: Variables;
     unauthorizedHandler?: () => Promise<void>;
-    requestBehaviour?: RequestModeInput;
 };
 export type GraphQLRequestDocOptions<TResult, TVariables> = GraphQLRequestBaseOptions<TResult> & {
     query: TypedDocumentNode<TResult, TVariables> | TypedDocumentNode<TResult, Exact<{
@@ -40,7 +37,6 @@ export type GraphQLRequestDocOptions<TResult, TVariables> = GraphQLRequestBaseOp
     }>>;
     variables?: TVariables;
     unauthorizedHandler?: () => Promise<void>;
-    requestBehaviour?: RequestModeInput;
 };
 export interface GraphQLResponseOptions<T> {
     handleErrors?: boolean;

packages/cli-kit/dist/public/node/api/partners.d.ts
@@ -1,5 +1,4 @@
 import { GraphQLVariables, GraphQLResponse, CacheOptions } from './graphql.js';
-import { RequestModeInput } from '../http.js';
 import { Variables } from 'graphql-request';
 import { TypedDocumentNode } from '@graphql-typed-document-node/core';
 /**
@@ -9,10 +8,9 @@ import { TypedDocumentNode } from '@graphql-typed-document-node/core';
  * @param token - Partners token.
  * @param variables - GraphQL variables to pass to the query.
  * @param cacheOptions - Cache options.
- * @param preferredBehaviour - Preferred behaviour for the request.
  * @returns The response of the query of generic type <T>.
  */
-export declare function partnersRequest<T>(query: string, token: string, variables?: GraphQLVariables, cacheOptions?: CacheOptions, preferredBehaviour?: RequestModeInput): Promise<T>;
+export declare function partnersRequest<T>(query: string, token: string, variables?: GraphQLVariables, cacheOptions?: CacheOptions): Promise<T>;
 export declare const generateFetchAppLogUrl: (cursor?: string, filters?: {
     status?: string;
     source?: string;
@@ -23,10 +21,9 @@ export declare const generateFetchAppLogUrl: (cursor?: string, filters?: {
  * @param query - GraphQL query to execute.
  * @param token - Partners token.
  * @param variables - GraphQL variables to pass to the query.
- * @param preferredBehaviour - Preferred behaviour for the request.
  * @returns The response of the query of generic type <TResult>.
  */
-export declare function partnersRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables>, token: string, variables?: TVariables, preferredBehaviour?: RequestModeInput): Promise<TResult>;
+export declare function partnersRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables>, token: string, variables?: TVariables): Promise<TResult>;
 /**
  * Sets the next deprecation date from [GraphQL response extensions](https://www.apollographql.com/docs/resources/graphql-glossary/#extensions)
  * if  objects contain a  (ISO 8601-formatted string).

packages/cli-kit/dist/public/node/context/fqdn.d.ts
@@ -9,12 +9,6 @@ export declare const NotProvidedStoreFQDNError: AbortError;
  * @returns Fully-qualified domain of the partners service we should interact with.
  */
 export declare function partnersFqdn(): Promise<string>;
-/**
- * It returns the Admin service we should interact with.
- *
- * @returns Fully-qualified domain of the Admin service we should interact with.
- */
-export declare function adminFqdn(): Promise<string>;
 /**
  * It returns the App Management API service we should interact with.
  *

packages/cli-kit/dist/public/node/context/local.d.ts
@@ -25,6 +25,13 @@ export declare function isDevelopment(env?: NodeJS.ProcessEnv): boolean;
  * @returns True if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed.
  */
 export declare function isVerbose(env?: NodeJS.ProcessEnv): boolean;
+/**
+ * It returns true if the App Management API is disabled.
+ * This should only be relevant when using a Partners token.
+ *
+ * @returns True if the App Management API is disabled.
+ */
+export declare function isAppManagementDisabled(): boolean;
 /**
  * Returns true if the environment in which the CLI is running is either
  * a local environment (where dev is present) or a cloud environment (spin).

packages/cli-kit/dist/public/node/ui/components.d.ts
@@ -1,3 +1 @@
-export { ConcurrentOutput, ConcurrentOutputContext, useConcurrentOutputContext, } from '../../../private/node/ui/components/ConcurrentOutput.js';
-export { Alert } from '../../../private/node/ui/components/Alert.js';
-export { Link } from '../../../private/node/ui/components/Link.js';
\ No newline at end of file
+export { ConcurrentOutput, ConcurrentOutputContext, useConcurrentOutputContext, } from '../../../private/node/ui/components/ConcurrentOutput.js';
\ No newline at end of file

packages/cli-kit/dist/private/node/session/exchange.d.ts
@@ -1,5 +1,4 @@
 import { ApplicationToken, IdentityToken } from './schema.js';
-import { API } from '../api.js';
 import { Result } from '../../../public/node/result.js';
 import { ExtendableError } from '../../../public/node/error.js';
 export declare class InvalidGrantError extends ExtendableError {
@@ -27,33 +26,15 @@ export declare function exchangeAccessForApplicationTokens(identityToken: Identi
  */
 export declare function refreshAccessToken(currentToken: IdentityToken): Promise<IdentityToken>;
 /**
- * Given a custom CLI token passed as ENV variable, request a valid Partners API token
+ * Given a custom CLI token passed as ENV variable, request a valid partners API token
  * This token does not accept extra scopes, just the cli one.
- * @param token - The CLI token passed as ENV variable 
+ * @param token - The CLI token passed as ENV variable
  * @returns An instance with the application access tokens.
  */
 export declare function exchangeCustomPartnerToken(token: string): Promise<{
     accessToken: string;
     userId: string;
 }>;
-/**
- * Given a custom CLI token passed as ENV variable, request a valid App Management API token
- * @param token - The CLI token passed as ENV variable 
- * @returns An instance with the application access tokens.
- */
-export declare function exchangeCliTokenForAppManagementAccessToken(token: string): Promise<{
-    accessToken: string;
-    userId: string;
-}>;
-/**
- * Given a custom CLI token passed as ENV variable, request a valid Business Platform API token
- * @param token - The CLI token passed as ENV variable 
- * @returns An instance with the application access tokens.
- */
-export declare function exchangeCliTokenForBusinessPlatformAccessToken(token: string): Promise<{
-    accessToken: string;
-    userId: string;
-}>;
 type IdentityDeviceError = 'authorization_pending' | 'access_denied' | 'expired_token' | 'slow_down' | 'unknown_failure';
 /**
  * Given a deviceCode obtained after starting a device identity flow, request an identity token.
@@ -62,7 +43,4 @@ type IdentityDeviceError = 'authorization_pending' | 'access_denied' | 'expired_
  * @returns An instance with the identity access tokens.
  */
 export declare function exchangeDeviceCodeForAccessToken(deviceCode: string): Promise<Result<IdentityToken, IdentityDeviceError>>;
-export declare function requestAppToken(api: API, token: string, scopes?: string[], store?: string): Promise<{
-    [x: string]: ApplicationToken;
-}>;
 export {};
\ No newline at end of file

packages/cli-kit/dist/private/node/session/scopes.d.ts
@@ -13,10 +13,4 @@ export declare function allDefaultScopes(extraScopes?: string[]): string[];
  * @param extraScopes - custom user-defined scopes
  * @returns Array of scopes
  */
-export declare function apiScopes(api: API, extraScopes?: string[]): string[];
-/**
- * Returns specific scopes required for token exchange with the given API.
- * @param api - API to get the scopes for
- * @returns Array of transformed scopes
- */
-export declare function tokenExchangeScopes(api: API): string[];
\ No newline at end of file
+export declare function apiScopes(api: API, extraScopes?: string[]): string[];
\ No newline at end of file

github-actions[bot] avatar Jun 03 '25 16:06 github-actions[bot]

Top hatting steps

pnpm shopify auth logout

pnpm shopify app init --path="$HOME/src/tmp"

# choose  Build an extension-only app

# Select a dev dashboard org

pnpm shopify app dev --path="$HOME/src/tmp/niche-supply-app" --verbose --reset

rmcnews avatar Jun 03 '25 16:06 rmcnews

We detected some changes at packages/*/src and there are no updates in the .changeset. If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

[!CAUTION] DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

github-actions[bot] avatar Jun 03 '25 19:06 github-actions[bot]

Saw this working while top hatting:

2025-06-03T19:21:28.692Z: Sending "BusinessPlatform" GraphQL request:
  mutation ProvisionShopAccess($input: OrganizationUserProvisionShopAccessInput!) {
  organizationUserProvisionShopAccess(
    organizationUserProvisionShopAccessInput: $input
  ) {
    success
    userErrors {
      message
      __typename
    }
    __typename
  }
}

With variables:
{
  "input": {
    "shopifyShopId": "Z2lkOi8vb3JnYW5pemF0aW9uL1Nob3BpZnlTaG9wLzYxMTY4NDE4ODY0"
  }
}

With request headers:
 - User-Agent: Shopify CLI; v=3.80.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

to https://destinations.shopifysvc.com/organizations/api/unstable/organization/147488134/graphql

rmcnews avatar Jun 03 '25 19:06 rmcnews