-
Notifications
You must be signed in to change notification settings - Fork 125
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
[prototype] Import declarative webhooks #4466
base: main
Are you sure you want to change the base?
Conversation
For calling the admin API on behalf of the current application
Thanks for your contribution! Depending on what you are working on, you may want to request a review from a Shopify team:
|
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 declarationspackages/cli-kit/dist/public/node/api/admin-as-app.d.tsimport { AdminSession } from '../session.js';
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
import { Variables } from 'graphql-request';
/**
* Executes a GraphQL query against the Admin API on behalf of the app. Uses typed documents.
*
* @param query - GraphQL query to execute.
* @param session - Admin session.
* @param apiVersion - API version, e.g. '2024-07'.
* @param variables - GraphQL variables to pass to the query.
* @returns The response of the query of generic type <TResult>.
*/
export declare function adminAsAppRequest<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables>, session: AdminSession, apiVersion: string, variables?: TVariables): Promise<TResult>;
Existing type declarationspackages/cli-kit/dist/public/node/session.d.ts@@ -54,6 +54,17 @@ export declare function ensureAuthenticatedStorefront(scopes?: string[], passwor
* @returns The access token for the Admin API.
*/
export declare function ensureAuthenticatedAdmin(store: string, scopes?: string[], forceRefresh?: boolean, options?: EnsureAuthenticatedAdditionalOptions): Promise<AdminSession>;
+/**
+ * Ensure that we have a valid Admin session for the given store, acting on behalf of the app.
+ *
+ * This will fail if the app has not already been installed.
+ *
+ * @param storeFqdn - Store fqdn to request auth for.
+ * @param apiKey - API key for the app.
+ * @param apiSecret - API secret for the app.
+ * @returns The access token for the Admin API.
+ */
+export declare function ensureAuthenticatedAdminAsApp(storeFqdn: string, apiKey: string, apiSecret: string): Promise<AdminSession>;
/**
* Ensure that we have a valid session to access the Theme API.
* If a password is provided, that token will be used against Theme Access API.
|
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1891 tests passing in 860 suites. Report generated by 🧪jest coverage report action from d51b164 |
WHY are these changes introduced?
Make it easier to start using declarative webhooks by helping you write the TOML your app might need.
WHAT is this pull request doing?
How to test your changes?
app import-extensions
and choose webhooks. You should get the TOML equivalent of what you set up.Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist