Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / cli / B2COperationLifecycleProvider

Interface: B2COperationLifecycleProvider

Defined in: packages/b2c-tooling-sdk/src/cli/lifecycle.ts:119

Provider interface for B2C operation lifecycle hooks.

Plugins implement this interface to observe and control B2C operation execution. The context includes the B2CInstance, giving plugins access to:

  • context.instance.ocapi - OCAPI client for API calls
  • context.instance.webdav - WebDAV client for file operations
  • context.instance.config - Resolved configuration (hostname, credentials, etc.)

Properties

name

readonly name: string

Defined in: packages/b2c-tooling-sdk/src/cli/lifecycle.ts:121

Human-readable name for the provider (used in logging/debugging)

Methods

afterOperation()?

optional afterOperation(context, result): Promise<void | AfterB2COperationResult>

Defined in: packages/b2c-tooling-sdk/src/cli/lifecycle.ts:140

Called after an operation completes (success or failure).

Parameters

context

B2COperationContext

Operation context with B2CInstance and metadata

result

B2COperationResult

Operation result with success/failure info

Returns

Promise<void | AfterB2COperationResult>

Optional result with additional metadata


beforeOperation()?

optional beforeOperation(context): Promise<void | BeforeB2COperationResult>

Defined in: packages/b2c-tooling-sdk/src/cli/lifecycle.ts:131

Called before an operation executes.

Can return { skip: true } to prevent the operation from executing.

Parameters

context

B2COperationContext

Operation context with B2CInstance and metadata

Returns

Promise<void | BeforeB2COperationResult>

Optional result to skip or modify the operation

All rights reserved.