AbstractProtected_Protected_Static ReadonlyAuthorizesTrue when the action authorizes its caller itself, so a public entry point such as the
RunAction mutation may run it for an authenticated user without an MJ: Action Authorizations link. Set it only on an action that either checks an authorization the caller
must hold, or reads and writes only with the caller's own permissions. Leave it false for an
action that acts with more authority than its caller, or that reaches data or sends messages
the caller chooses but could not otherwise reach.
The engine reads the marker only from the class that runs, never from its parent classes. A subclass that overrides a marked action must declare the marker again.
ProtectedoauthOAuth-specific parameters that all OAuth actions should include
ProtectedgetGet the current access token
ProtectedgetGet custom attributes from company integration
ProtectedgetGet the refresh token
ProtectedhandleProtectedinitializeInitialize OAuth connection by loading integration details.
the MJ Company Integration ID to load
Optionalparams: RunActionParamsthe running action's params; params.Provider is captured so all
subsequent entity loads/saves bind to the per-request provider (multi-tenant
correctness). When omitted, falls back to the global default Metadata provider.
Protected AbstractInternalInternal method that must be implemented by derived action classes. This is where the actual action logic should be implemented.
The action execution parameters including typed context
Promise resolving to the action result
ProtectedisDetermine if an error is an authentication error. Can be overridden by subclasses for platform-specific error detection.
ProtectedisCheck if the current token is expired
ProtectedmakeProtected AbstractrefreshRefresh the access token using the refresh token. Must be implemented by platform-specific subclasses.
Executes the action with the provided parameters.
The action execution parameters including context
Promise resolving to the action result
ProtectedsetSet custom attributes in company integration
ProtectedupdateUpdate stored tokens after refresh
OptionalrefreshToken: stringOptionalexpiresIn: number
Base class for actions that require OAuth authentication. Provides common OAuth token management functionality including retrieval, refresh, and error handling.
Multi-provider note: OAuth actions run server-side and must respect the per-request provider passed in
RunActionParams.Provider. Subclasses pass theirparamsto initializeOAuth; the base class stores the resolved provider onthisso all subsequent entity loads (_companyIntegration.Save(), etc.) bind to the same connection.