Repository navigation
Update from World - #9199
Merged
Merged
Update from World#9199
Conversation
Published by the World mirror. World-Commit: e3efdb79ade74e25a53d2b5539f062af9b2ebbf7
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 declarationspackages/cli-kit/dist/private/node/session/constants.d.tsexport declare const NEW_LOGIN_LABEL = "Log in with a different account";
Existing type declarationspackages/cli-kit/dist/public/node/session-prompt.d.ts@@ -1,3 +1,5 @@
+import { NEW_LOGIN_LABEL } from '../../private/node/session/constants.js';
+export { NEW_LOGIN_LABEL };
/**
* Prompts the user to select from existing sessions or log in with a different account.
*
packages/cli-kit/dist/private/node/api/graphql.d.ts@@ -11,6 +11,16 @@ export declare function sanitizeVariables(variables: Variables): string;
* the full JSON representation if no messages can be extracted.
*/
export declare function extractGraphQLErrorMessages(errors: any[] | undefined): string | undefined;
+/**
+ * Whether a request was refused because the session didn't use multi-factor authentication.
+ *
+ * Business Platform and the Admin API answer such a request with HTTP 401 and a `[TFA]` marker in the body.
+ * A refreshed token keeps the session's authentication methods, so refreshing it can't satisfy the requirement.
+ *
+ * @param error - The error thrown by graphql-request.
+ * @returns True when the response is a 401 that carries the `[TFA]` marker.
+ */
+export declare function isMfaRequiredError(error: unknown): boolean;
export declare function errorHandler(api: string): (error: unknown, requestId?: string) => unknown;
/**
* Reads the `x-request-id` header of a failed GraphQL response.
packages/cli-kit/dist/public/node/error/index.d.ts@@ -43,6 +43,10 @@ export declare abstract class FatalError extends Error {
export declare class AbortError extends FatalError {
constructor(message: TokenItem | OutputMessage, tryMessage?: TokenItem | OutputMessage | null, nextSteps?: TokenItem<InlineToken>[], customSections?: AlertCustomSection[]);
}
+/** An API refused a session that didn't use multi-factor authentication. */
+export declare class MfaRequiredError extends AbortError {
+ constructor(requestId?: string);
+}
/**
* An external error is similar to Abort but has extra command and args attributes.
* This is useful to represent errors coming from external commands, usually executed by execa.
|
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.
This pull request brings the latest changes from World, the monorepo where Shopify develops this project.
Don't push to this branch: the next update replaces it.