Files
medusa-store/www/apps/docs/content/references/js-client/classes/internal-8.internal.AbstractBatchJobStrategy.md
github-actions[bot] daea35fe73 chore(docs): Generated JS Client Reference (#5334)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-10-10 17:47:07 +00:00

9.9 KiB

displayed_sidebar
displayed_sidebar
jsClientSidebar

Class: AbstractBatchJobStrategy

internal.internal.AbstractBatchJobStrategy

Hierarchy

Implements

Properties

__configModule__

Protected Optional Readonly __configModule__: Record<string, unknown>

Implementation of

IBatchJobStrategy.configModule

Inherited from

TransactionBaseService.configModule

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:5


__container__

Protected Readonly __container__: any

Implementation of

IBatchJobStrategy.container

Inherited from

TransactionBaseService.container

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:4


__moduleDeclaration__

Protected Optional Readonly __moduleDeclaration__: Record<string, unknown>

Implementation of

IBatchJobStrategy.moduleDeclaration

Inherited from

TransactionBaseService.moduleDeclaration

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:6


batchJobService_

Protected Abstract batchJobService_: BatchJobService

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:26


manager_

Protected manager_: EntityManager

Implementation of

IBatchJobStrategy.manager_

Inherited from

TransactionBaseService.manager_

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:7


transactionManager_

Protected transactionManager_: undefined | EntityManager

Implementation of

IBatchJobStrategy.transactionManager_

Inherited from

TransactionBaseService.transactionManager_

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:8


batchType

Static batchType: string

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:25


identifier

Static identifier: string

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:24

Accessors

activeManager_

Protected get activeManager_(): EntityManager

Returns

EntityManager

Implementation of

IBatchJobStrategy.activeManager_

Inherited from

TransactionBaseService.activeManager_

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:9

Methods

atomicPhase_

Protected atomicPhase_<TResult, TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>

Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.

Type parameters

Name
TResult
TError

Parameters

Name Type Description
work (transactionManager: EntityManager) => Promise<TResult> the transactional work to be done
isolationOrErrorHandler? IsolationLevel | (error: TError) => Promise<void | TResult> the isolation level to be used for the work.
maybeErrorHandlerOrDontFail? (error: TError) => Promise<void | TResult> Potential error handler

Returns

Promise<TResult>

the result of the transactional work

Implementation of

IBatchJobStrategy.atomicPhase_

Inherited from

TransactionBaseService.atomicPhase_

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:24


buildTemplate

Abstract buildTemplate(): Promise<string>

Builds and returns a template file that can be downloaded and filled in

Returns

Promise<string>

Implementation of

IBatchJobStrategy.buildTemplate

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:30


handleProcessingError

Protected handleProcessingError<T>(batchJobId, err, result): Promise<void>

Type parameters

Name
T

Parameters

Name Type
batchJobId string
err unknown
result T

Returns

Promise<void>

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:32


preProcessBatchJob

preProcessBatchJob(batchJobId): Promise<void>

Method for pre-processing a batch job

Parameters

Name Type
batchJobId string

Returns

Promise<void>

Implementation of

IBatchJobStrategy.preProcessBatchJob

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:28


prepareBatchJobForProcessing

prepareBatchJobForProcessing(batchJob, req): Promise<CreateBatchJobInput>

Method for preparing a batch job for processing

Parameters

Name Type
batchJob CreateBatchJobInput
req Request

Returns

Promise<CreateBatchJobInput>

Implementation of

IBatchJobStrategy.prepareBatchJobForProcessing

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:27


processJob

Abstract processJob(batchJobId): Promise<void>

Method does the actual processing of the job. Should report back on the progress of the operation.

Parameters

Name Type
batchJobId string

Returns

Promise<void>

Implementation of

IBatchJobStrategy.processJob

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:29


shouldRetryOnProcessingError

Protected shouldRetryOnProcessingError(batchJob, err): Promise<boolean>

Parameters

Name Type
batchJob BatchJob
err unknown

Returns

Promise<boolean>

Defined in

packages/medusa/dist/interfaces/batch-job-strategy.d.ts:31


shouldRetryTransaction_

Protected shouldRetryTransaction_(err): boolean

Parameters

Name Type
err Record<string, unknown> | { code: string }

Returns

boolean

Implementation of

IBatchJobStrategy.shouldRetryTransaction_

Inherited from

TransactionBaseService.shouldRetryTransaction_

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:12


withTransaction

withTransaction(transactionManager?): AbstractBatchJobStrategy

Parameters

Name Type
transactionManager? EntityManager

Returns

AbstractBatchJobStrategy

Implementation of

IBatchJobStrategy.withTransaction

Inherited from

TransactionBaseService.withTransaction

Defined in

packages/medusa/dist/interfaces/transaction-base-service.d.ts:11