AbstractProtectedoauthOAuth-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.