-
Notifications
You must be signed in to change notification settings - Fork 162
Identification for partner or dev dash orgs #5622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: zl/add_cli_token_support_for_app_management_and_bp_api
Are you sure you want to change the base?
Identification for partner or dev dash orgs #5622
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
9486042
to
92f9d10
Compare
Coverage report
Test suite run success2213 tests passing in 961 suites. Report generated by 🧪jest coverage report action from 9c7aa7c |
74503b1
to
b5863b9
Compare
92f9d10
to
5b26dbb
Compare
b5863b9
to
26ee75a
Compare
23ea852
to
92b0424
Compare
06c54fd
to
7692bd1
Compare
8fb695f
to
fc65f64
Compare
7692bd1
to
a437d4f
Compare
87b2088
to
42273aa
Compare
a437d4f
to
21a2f26
Compare
42273aa
to
a3144a0
Compare
21a2f26
to
87d5eda
Compare
a3144a0
to
d138af7
Compare
87d5eda
to
1093c77
Compare
d138af7
to
2309d2c
Compare
1093c77
to
a0d5b24
Compare
2309d2c
to
2ea27c2
Compare
@@ -339,7 +339,7 @@ export class AppManagementClient implements DeveloperPlatformClient { | |||
if (!organizationsResult.currentUserAccount) return [] | |||
return organizationsResult.currentUserAccount.organizations.nodes.map((org) => ({ | |||
id: idFromEncodedGid(org.id), | |||
businessName: org.name, | |||
businessName: `${org.name} (Dev Dashboard)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably confirm with Nick about namings here before merging
a0d5b24
to
0ed3137
Compare
2ea27c2
to
2f129c9
Compare
0ed3137
to
e6b204f
Compare
2f129c9
to
9f89efd
Compare
/snapit |
🫰✨ Thanks @zzooeeyy! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g @shopify/[email protected] Tip If you get an Caution After installing, validate the version by running just |
e6b204f
to
6163dea
Compare
9f89efd
to
91cb4d9
Compare
6163dea
to
4d86540
Compare
91cb4d9
to
d1d499a
Compare
Co-authored-by: Zoey Lan <[email protected]>
d1d499a
to
9c7aa7c
Compare
4d86540
to
ad547ab
Compare
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/exchange.d.ts@@ -26,15 +26,33 @@ 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.
packages/cli-kit/dist/private/node/session/scopes.d.ts@@ -13,4 +13,10 @@ 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[];
\ No newline at end of file
+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
packages/cli-kit/dist/public/node/context/local.d.ts@@ -25,13 +25,6 @@ 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).
|
Figma
WHY are these changes introduced?
Fixes #0000
WHAT is this pull request doing?
How to test your changes?
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist