Skip to content

API Reference & Compatibility

The complete public API symbol inventory is generated automatically from package source exports:

Functions

createCMSClient

Source
createCMSClient<TPayloadConfig extends PayloadTypesShape = UntypedPayloadTypes, const TOperations extends CMSOperationsTree = CMSOperationsTree>(options: CMSClientOptions<TOperations>) => CMSClient<TPayloadConfig, TOperations>

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public function exported by @nexload-sdk/payload-operations.

createPayloadEndpoints

Source
createPayloadEndpoints<const TOperations extends CMSOperationsTree>(options: CreatePayloadEndpointsOptions<TOperations>) => Endpoint[]

Exported from: @nexload-sdk/payload-operations/server

Public function exported by @nexload-sdk/payload-operations.

defineCMSOperations

Source
defineCMSOperations<const TOperations extends CMSOperationsTree>(operations: TOperations) => TOperations

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public function exported by @nexload-sdk/payload-operations.

defineClientPlugin

Source
defineClientPlugin<const TPlugin extends CMSClientPlugin>(plugin: TPlugin) => TPlugin

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public function exported by @nexload-sdk/payload-operations.

isCMSOperationError

Source
isCMSOperationError(error: unknown) => error is CMSOperationError

Exported from: @nexload-sdk/payload-operations/errors

Public function exported by @nexload-sdk/payload-operations.

isDefinedError

Source
isDefinedError<TError extends CMSOperationError<string, unknown, true>>(error: TError) => error is TError
isDefinedError<TError extends CMSOperationError<string, unknown, true>, TCode extends TError["code"]>(error: TError, code: TCode) => error is Extract<TError, { code: TCode; }>
isDefinedError(error: unknown, code?: string) => error is CMSOperationError<string, unknown, true>

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/errors

Public function exported by @nexload-sdk/payload-operations.

isTimeoutError

Source
isTimeoutError(error: unknown) => boolean

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/plugins/timeout

Public function exported by @nexload-sdk/payload-operations.

operation

Source
operation<const TInput extends z.ZodType, const TOutput extends z.ZodType, const TErrors extends CMSOperationErrorDefinitions = Readonly<Record<string, never>>>(definition: { errors?: TErrors; input: TInput; output: TOutput; }) => CMSOperation<TInput, TOutput, TErrors>

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public function exported by @nexload-sdk/payload-operations.

safe

Source
safe<const TPromise extends PromiseLike<unknown>>(promise: TPromise) => Promise<CMSSafeResult<AwaitedData<TPromise>, DefinedError<TPromise>>>

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/errors

Public function exported by @nexload-sdk/payload-operations.

timeoutPlugin

Source
timeoutPlugin(options: TimeoutPluginOptions) => { readonly name: "timeout"; readonly wrapTransport: (next: CMSClientTransport) => (request: CMSClientTransportRequest) => Promise<Response>; }

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/plugins/timeout

Public function exported by @nexload-sdk/payload-operations.

Classes

CMSOperationError

Source
class CMSOperationError

Exported from: @nexload-sdk/payload-operations/errors, @nexload-sdk/payload-operations/server

Public classe exported by @nexload-sdk/payload-operations.

Interfaces

CMSClient

Source
interface CMSClient<
  TPayloadConfig extends PayloadTypesShape = PayloadTypes,
  TOperations extends CMSOperationsTree = CMSOperationsTree
> {
  readonly operations: InferOperationsClient<TOperations>
  readonly payload: PayloadSDK<TPayloadConfig>
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public interface exported by @nexload-sdk/payload-operations.

CMSClientOptions

Source
interface CMSClientOptions<
  TOperations extends CMSOperationsTree
> {
  basePath?: string
  operations: TOperations
  payload: CMSPayloadClientOptions
  plugins?: readonly CMSClientPlugin[]
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public interface exported by @nexload-sdk/payload-operations.

CMSClientPlugin

Source
interface CMSClientPlugin {
  readonly name: string
  wrapTransport(next: CMSClientTransport): CMSClientTransport
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public interface exported by @nexload-sdk/payload-operations.

CMSClientTransportRequest

Source
interface CMSClientTransportRequest {
  readonly init: RequestInit
  readonly operation?: {
    readonly name: string
    readonly path: string
  }
  readonly source: "operation" | "payload"
  readonly url: string
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public interface exported by @nexload-sdk/payload-operations.

CMSOperation

Source
interface CMSOperation<
  TInputSchema extends z.ZodType = z.ZodType,
  TOutputSchema extends z.ZodType = z.ZodType,
  TErrors extends CMSOperationErrorDefinitions = CMSOperationErrorDefinitions
> {
  readonly [CMS_OPERATION_SYMBOL]: true
  readonly errors: TErrors
  readonly input: TInputSchema
  readonly output: TOutputSchema
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public interface exported by @nexload-sdk/payload-operations.

CMSOperationAccessContext

Source
interface CMSOperationAccessContext<
  TOperation extends CMSOperationContract = CMSOperationContract
> {
  readonly operation: CMSOperationMetadata<TOperation>
  readonly req: PayloadRequest
}

Exported from: @nexload-sdk/payload-operations/server

Public interface exported by @nexload-sdk/payload-operations.

CMSOperationErrorJSON

Source
interface CMSOperationErrorJSON {
  code: string
  data?: unknown
  defined: boolean
  message: string
  status: number
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/errors

Public interface exported by @nexload-sdk/payload-operations.

CMSOperationHandlerContext

Source
interface CMSOperationHandlerContext<
  TOperation extends CMSOperationContract
> {
  readonly errors: CMSDefinedErrorFactories<TOperation>
  readonly input: InferParsedOperationInput<TOperation>
  readonly operation: CMSOperationMetadata<TOperation>
  readonly req: PayloadRequest
}

Exported from: @nexload-sdk/payload-operations/server

Public interface exported by @nexload-sdk/payload-operations.

CMSOperationMetadata

Source
interface CMSOperationMetadata<
  TOperation extends CMSOperationContract = CMSOperationContract
> {
  readonly definition: TOperation
  readonly name: string
  readonly path: string
}

Exported from: @nexload-sdk/payload-operations/server

Public interface exported by @nexload-sdk/payload-operations.

CMSPayloadClientOptions

Source
interface CMSPayloadClientOptions {
  baseInit?: RequestInit
  baseURL: string
  fetch?: typeof fetch
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public interface exported by @nexload-sdk/payload-operations.

CMSValidationErrorData

Source
interface CMSValidationErrorData {
  issues: Array<{
    code?: string
    message: string
    path: Array<number | string>
  }>
}

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/errors

Public interface exported by @nexload-sdk/payload-operations.

CreatePayloadEndpointsOptions

Source
interface CreatePayloadEndpointsOptions<
  TOperations extends CMSOperationsTree
> {
  access?: {
    default?: CMSOperationAccess
    overrides?: CMSOperationAccessOverrides<TOperations>
  }
  basePath?: string
  handlers: CMSOperationHandlers<TOperations>
  operations: TOperations
}

Exported from: @nexload-sdk/payload-operations/server

Public interface exported by @nexload-sdk/payload-operations.

TimeoutPluginOptions

Source
interface TimeoutPluginOptions { timeout: number }

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/plugins/timeout

Public interface exported by @nexload-sdk/payload-operations.

Types

CMSClientTransport

Source
type CMSClientTransport = (
  request: CMSClientTransportRequest
) => Promise<Response>;

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public type exported by @nexload-sdk/payload-operations.

CMSDefinedErrorFactories

Source
type CMSDefinedErrorFactories<
  TOperation extends CMSOperationContract
> = {
  readonly [TCode in keyof TOperation["errors"] & string]:
  ErrorFactoryFromDefinition<TCode, TOperation["errors"][TCode]>;
};

Exported from: @nexload-sdk/payload-operations/errors

Public type exported by @nexload-sdk/payload-operations.

CMSDefinedOperationError

Source
type CMSDefinedOperationError<
  TOperation extends CMSOperationContract = CMSOperationContract
> = {
  [TCode in keyof TOperation["errors"] & string]: DefinedErrorFromDefinition<
    TCode,
    TOperation["errors"][TCode]
  >;
}[keyof TOperation["errors"] & string];

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/errors

Public type exported by @nexload-sdk/payload-operations.

CMSOperationAccess

Source
type CMSOperationAccess<
  TOperation extends CMSOperationContract = CMSOperationContract
> = (
  context: CMSOperationAccessContext<TOperation>
) => boolean | Promise<boolean>;

Exported from: @nexload-sdk/payload-operations/server

Public type exported by @nexload-sdk/payload-operations.

CMSOperationAccessOverrides

Source
type CMSOperationAccessOverrides<
  TOperations extends CMSOperationsTree
> = {
  readonly [TKey in keyof TOperations]?:
  TOperations[TKey] extends CMSOperationContract
    ? CMSOperationAccess<TOperations[TKey]>
    : TOperations[TKey] extends CMSOperationsTree
      ? CMSOperationAccessOverrides<TOperations[TKey]>
      : never;
};

Exported from: @nexload-sdk/payload-operations/server

Public type exported by @nexload-sdk/payload-operations.

CMSOperationCallOptions

Source
type CMSOperationCallOptions = Omit<RequestInit, "body" | "method">;

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

CMSOperationContract

Source
type CMSOperationContract = CMSOperation;

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

CMSOperationErrorDefinition

Source
type CMSOperationErrorDefinition<
  TDataSchema extends z.ZodType | undefined = z.ZodType | undefined
> = Readonly<{
  data?: TDataSchema
  message: string
  status: number
}>;

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

CMSOperationErrorDefinitions

Source
type CMSOperationErrorDefinitions = Readonly<
  Record<string, CMSOperationErrorDefinition<z.ZodType | undefined>>
>;

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

CMSOperationHandler

Source
type CMSOperationHandler<
  TOperation extends CMSOperationContract
> = (
  context: CMSOperationHandlerContext<TOperation>
) => Promise<InferHandlerOutput<TOperation>>;

Exported from: @nexload-sdk/payload-operations/server

Public type exported by @nexload-sdk/payload-operations.

CMSOperationHandlers

Source
type CMSOperationHandlers<TOperations extends CMSOperationsTree> = {
  readonly [TKey in keyof TOperations]:
  TOperations[TKey] extends CMSOperationContract
    ? CMSOperationHandler<TOperations[TKey]>
    : TOperations[TKey] extends CMSOperationsTree
      ? CMSOperationHandlers<TOperations[TKey]>
      : never;
};

Exported from: @nexload-sdk/payload-operations/server

Public type exported by @nexload-sdk/payload-operations.

CMSOperationsTree

Source
type CMSOperationsTree = Readonly<{ [key: string]: CMSOperationContract | CMSOperationsTree }>;

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

CMSSafeResult

Source
type CMSSafeResult<TData, TDefinedError>
  = | readonly [error: null, data: TData, isDefined: false]
    | readonly [
      error: TDefinedError,
      data: undefined,
      isDefined: true
    ]
    | readonly [error: unknown, data: undefined, isDefined: false];

Exported from: @nexload-sdk/payload-operations/errors

Public type exported by @nexload-sdk/payload-operations.

InferHandlerOutput

Source
type InferHandlerOutput<TOperation extends CMSOperationContract>
  = z.input<TOperation["output"]>;

Exported from: @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

InferOperationInput

Source
type InferOperationInput<TOperation extends CMSOperationContract>
  = z.input<TOperation["input"]>;

Exported from: @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

InferOperationOutput

Source
type InferOperationOutput<TOperation extends CMSOperationContract>
  = z.output<TOperation["output"]>;

Exported from: @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

InferOperationsClient

Source
type InferOperationsClient<TOperations extends CMSOperationsTree> = {
  readonly [TKey in keyof TOperations]:
  TOperations[TKey] extends CMSOperationContract
    ? CMSOperationMethod<TOperations[TKey]>
    : TOperations[TKey] extends CMSOperationsTree
      ? InferOperationsClient<TOperations[TKey]>
      : never;
};

Exported from: @nexload-sdk/payload-operations, @nexload-sdk/payload-operations/client

Public type exported by @nexload-sdk/payload-operations.

InferParsedOperationInput

Source
type InferParsedOperationInput<
  TOperation extends CMSOperationContract
> = z.output<TOperation["input"]>;

Exported from: @nexload-sdk/payload-operations/contract

Public type exported by @nexload-sdk/payload-operations.

PayloadOperationEndpoints

Source
type PayloadOperationEndpoints = readonly Endpoint[];

Exported from: @nexload-sdk/payload-operations/server

Public type exported by @nexload-sdk/payload-operations.


To preserve clean bundle boundaries and prevent leaking Payload server code into client applications, @nexload-sdk/payload-operations exposes explicit subpaths:

SubpathTarget EnvironmentDescription
@nexload-sdk/payload-operationsUniversal (Browser/Node)Root entrypoint exporting createCMSClient, defineCMSOperations, operation, safe, isDefinedError, timeoutPlugin.
@nexload-sdk/payload-operations/contractUniversal (Browser/Node)Pure contract modeling: defineCMSOperations, operation, and type inference helpers. Zero dependencies on Payload.
@nexload-sdk/payload-operations/clientUniversal (Browser/Node)Client factory and RPC proxy generator: createCMSClient, defineClientPlugin, InferOperationsClient.
@nexload-sdk/payload-operations/errorsUniversal (Browser/Node)Error boundaries and pattern matching: CMSOperationError, safe, isDefinedError.
@nexload-sdk/payload-operations/plugins/timeoutUniversal (Browser/Node)Timeout plugin: timeoutPlugin, isTimeoutError.
@nexload-sdk/payload-operations/serverNode.js / Payload Server OnlyServer endpoint generator: createPayloadEndpoints. Never import in client bundles!

Runtime / EngineVersion RequirementVerification Status
Node.js>=20.9.0Verified on Node 20 & 22
Payload CMS>=3.85.0 <4.0.0Verified on Payload 3.86.0
@payloadcms/sdk>=3.85.0 <4.0.0Verified on SDK 3.86.0
Zod>=4.0.0 <5.0.0Verified on Zod 4.4.3
Module FormatESM onlyNative ECMAScript Modules ("type": "module")
Side EffectsfalseTree-shaking enabled across all bundlers