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.
ProtectedapiGet the API base URL for the platform
ProtectedbufferCommon params shared by all Buffer actions.
ProtectedcommonCommon parameters for all social media actions
ProtectedoauthOAuth-specific parameters that all OAuth actions should include
ProtectedplatformGet the platform name (e.g., 'Twitter', 'LinkedIn')
Whether this action can bound what it returns to an audience (RunActionParams.Audience): everyone
besides the caller who will see its output, such as the other participants of a shared conversation.
false by default, and the engine enforces it: when a run's audience adds a reader beyond the caller,
ActionEngineServer.RunAction refuses the action with result code AUDIENCE_UNSUPPORTED, without running
it. Override to return true only when the action honours the audience in full — every record, snippet
and count it returns is something every reader may see (pass the audience to the search engine, check each
reader's entitlement to anything it scopes by, and leave out aggregates computed before that filtering).
ProtectedbuildBuild a standardized error result from a caught exception.
ProtectedbuildBuild common API headers including authentication
OptionaladditionalHeaders: Record<string, string>ProtectedcreateCreate a post via the createPost mutation.
metadata is Buffer's per-service extras channel, keyed by service name — e.g.
{ linkedin: { annotations: [...] } } for
ProtecteddeleteDelete a post via the deletePost mutation.
ProtectedensureValidate CompanyIntegrationID and initialize OAuth.
Pass the full RunActionParams so the per-request provider on params.Provider is
threaded into initializeOAuth (multi-tenant correctness — every entity load/save
inside the OAuth flow binds to the request's connection, not the global default).
CompanyIntegrationID stays required even when CredentialID is given: it is what
identifies which Buffer integration this is, and the org/channel context still
comes from it. CredentialID only changes whose token the calls are made with.
Returns null on success, or an error result.
ProtectedexecuteExecute a GraphQL query or mutation against the Buffer API.
Optionalvariables: Record<string, unknown>ProtectedextractProtectedfetchFetch all channels for an organization.
ProtectedfetchFetch posts with optional filters and cursor-based pagination.
Optionalfilters: {Optionalfirst: numberOptionalafter: stringProtectedformatFormat date for API requests (ISO 8601)
ProtectedgetThe token every Buffer call is made with: the CredentialID token when one was
supplied, otherwise the CompanyIntegration's own.
ProtectedgetGet custom attributes from company integration
ProtectedgetHelper to get parameter value from params array
ProtectedgetGet profile ID from parameters or default from integration
ProtectedgetGet the refresh token
ProtectedgroupGroup posts by day using a date accessor.
ProtectedhandleProtectedhandleHandle rate limiting with exponential backoff
OptionalretryAfter: numberProtectedinitializeInitialize 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
ProtectedlogLog API request for debugging
Optionaldata: anyProtectedlogLog API response for debugging
ProtectedmakeProtectedmapProtectednormalizeNormalize platform-specific analytics to common format
ProtectednormalizeConvert platform-specific post data to common format
ProtectedparseParse date from API response
ProtectedparseParse rate limit headers from API response
ProtectedrefreshRefresh the access token using the refresh token. Must be implemented by platform-specific subclasses.
ProtectedresolveLoad an access token out of an MJ: Credentials row.
This is the seam for acting as an identity other than the tenant's own Buffer connection — publishing to an employee's personal channel, reading the queue of the person who owns it. The token stays in the credential store; only its ID travels through action params.
A CredentialID that was supplied but cannot be read is fatal, never a
silent fallback to the CompanyIntegration token: falling back would publish
under the wrong identity, and the caller would have no way to notice.
Returns the token, or an error result to hand straight back to the caller.
ProtectedresolveResolve org ID from params or by fetching the account's first org.
Executes the action with the provided parameters.
The action execution parameters including context
Promise resolving to the action result
ProtectedsearchSearch for posts on the platform
ProtectedsetSet custom attributes in company integration
ProtectedsetSet an output parameter value by name.
ProtectedupdateUpdate stored tokens after refresh
OptionalrefreshToken: stringOptionalexpiresIn: numberProtecteduploadProtecteduploadProtectedvalidate
Base class for all Buffer social media actions. Uses Buffer's GraphQL API at https://api.buffer.com.
Migration note: replaces the deprecated v1 REST API at api.bufferapp.com/1. Key concept renames: profiles → channels, updates → posts.