cap-nodejs

CAP Node.js API


CAP Node.js API / cap-testing/src / InMemoryPublishStorage

Class: InMemoryPublishStorage

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:6

Implements

Constructors

Constructor

new InMemoryPublishStorage(): InMemoryPublishStorage

Returns

InMemoryPublishStorage

Properties

store

readonly store: Map<string, CapPublishEvent<JsonValue>>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:7

Methods

claimUnpublished()

claimUnpublished(options): Promise<CapPublishEvent<JsonValue>[]>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:10

Parameters

options

ClaimUnpublishedOptions

Returns

Promise<CapPublishEvent<JsonValue>[]>

Implementation of

PublishStoragePort.claimUnpublished


findPublishById()

findPublishById(id): Promise<CapPublishEvent<JsonValue> | undefined>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:15

Parameters

id

string

Returns

Promise<CapPublishEvent<JsonValue> | undefined>

Implementation of

PublishStoragePort.findPublishById


getCapabilities()

getCapabilities(): CapStorageCapabilities

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:9

Returns

CapStorageCapabilities

Implementation of

CapabilityAwareStoragePort.getCapabilities


listPublish()

listPublish(options?): Promise<{ items: CapPublishEvent<JsonValue>[]; total: number; }>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:16

Parameters

options?
limit?

number

offset?

number

onlyUnpublished?

boolean

topic?

string

Returns

Promise<{ items: CapPublishEvent<JsonValue>[]; total: number; }>

Implementation of

PublishStoragePort.listPublish


markPublished()

markPublished(id, publishedAt?, ownership?): Promise<boolean>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:11

Parameters

id

string

publishedAt?

Date

ownership?

PublishClaimOwnership

Returns

Promise<boolean>

Implementation of

PublishStoragePort.markPublished


markPublishFailed()

markPublishFailed(id, error, options): Promise<boolean>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:12

Parameters

id

string

error

unknown

options

MarkPublishFailedOptions

Returns

Promise<boolean>

Implementation of

PublishStoragePort.markPublishFailed


releaseExpiredClaims()

releaseExpiredClaims(now): Promise<void>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:14

Parameters

now

Date

Returns

Promise<void>

Implementation of

PublishStoragePort.releaseExpiredClaims


renewPublishClaim()

renewPublishClaim(options): Promise<boolean>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:13

Parameters

options

RenewPublishClaimOptions

Returns

Promise<boolean>

Implementation of

PublishStoragePort.renewPublishClaim


savePublish()

savePublish<T>(event, _ctx?): Promise<string>

Defined in: cap-core/dist/testing/in-memory-publish-storage.d.ts:8

Type Parameters

T

T extends JsonValue = JsonValue

Parameters

event

CapPublishEvent<T>

_ctx?

CapOperationContext<unknown>

Returns

Promise<string>

Implementation of

PublishStoragePort.savePublish