feat: flow ai cli commands#7501
Draft
Gasser-Aly wants to merge 1 commit intomainfrom
Draft
Conversation
Contributor
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/private/node/session.d.ts@@ -41,6 +41,11 @@ interface BusinessPlatformAPIOAuthOptions {
/** List of scopes to request permissions for. */
scopes: BusinessPlatformScope[];
}
+export type IdentityScope = string;
+interface IdentityOAuthOptions {
+ /** List of Identity scopes to request permissions for. */
+ scopes: IdentityScope[];
+}
/**
* It represents the authentication requirements and
* is the input necessary to trigger the authentication
@@ -52,6 +57,7 @@ export interface OAuthApplications {
partnersApi?: PartnersAPIOAuthOptions;
businessPlatformApi?: BusinessPlatformAPIOAuthOptions;
appManagementApi?: AppManagementAPIOauthOptions;
+ identityApi?: IdentityOAuthOptions;
}
export interface OAuthSession {
admin?: AdminSession;
@@ -59,6 +65,7 @@ export interface OAuthSession {
storefront?: string;
businessPlatform?: string;
appManagement?: string;
+ identity?: string;
userId: string;
}
type AuthMethod = 'partners_token' | 'device_auth' | 'theme_access_token' | 'custom_app_token' | 'none';
packages/cli-kit/dist/public/node/session.d.ts@@ -1,4 +1,4 @@
-import { AdminAPIScope, AppManagementAPIScope, BusinessPlatformScope, EnsureAuthenticatedAdditionalOptions, PartnersAPIScope, StorefrontRendererScope } from '../../private/node/session.js';
+import { AdminAPIScope, AppManagementAPIScope, BusinessPlatformScope, EnsureAuthenticatedAdditionalOptions, IdentityScope, PartnersAPIScope, StorefrontRendererScope } from '../../private/node/session.js';
/**
* Session Object to access the Admin API, includes the token and the store FQDN.
*/
@@ -57,6 +57,21 @@ export declare function isServiceAccount(account: AccountInfo): account is Servi
export declare function ensureAuthenticatedUser(env?: NodeJS.ProcessEnv, options?: EnsureAuthenticatedAdditionalOptions): Promise<{
userId: string;
}>;
+/**
+ * Ensure that we have a valid Identity access token with the requested scopes.
+ *
+ * Use this when a first-party Shopify service validates the CLI caller directly
+ * with Identity rather than with an exchanged application token.
+ *
+ * @param scopes - Identity scopes to authenticate with.
+ * @param env - Optional environment variables to use.
+ * @param options - Optional extra options to use.
+ * @returns The Identity access token and user ID.
+ */
+export declare function ensureAuthenticatedIdentity(scopes?: IdentityScope[], env?: NodeJS.ProcessEnv, options?: EnsureAuthenticatedAdditionalOptions): Promise<{
+ token: string;
+ userId: string;
+}>;
/**
* Ensure that we have a valid session to access the Partners API.
* If SHOPIFY_CLI_PARTNERS_TOKEN exists, that token will be used to obtain a valid Partners Token
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
Fixes #0000
WHAT is this pull request doing?
How to test your changes?
Post-release steps
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add