Skip to main content

AzureBlobBinary

@webda/azure


Class: AzureBlobBinary

Defined in: azure/src/services/blob.service.ts:114

Blob-backed binaries with verified direct uploads and exact ownership markers.

Webda Modda​

Extends​

Implements​

Constructors​

Constructor​

new AzureBlobBinary(name, params): AzureBlobBinary

Defined in: core/lib/services/service.d.ts:72

Create a new Service instance

Service

Parameters​

name​

string

The name of the service

params​

AzureBlobBinaryParameters

The parameters block define in the configuration file

Returns​

AzureBlobBinary

Inherited from​

CloudBinary<AzureBlobBinaryParameters>.constructor

Properties​

_compiledCapabilities​

protected _compiledCapabilities: Record<string, any>

Defined in: core/lib/services/iservice.d.ts:50

Capabilities detected at compile-time from @WebdaCapability-tagged interfaces.

Populated during Service.resolve by reading the service's entry in webda.module.json. Each key is a capability name (e.g., "request-filter"), and the value is an empty object {} by default. Override getCapabilities to provide capability-specific configuration or to conditionally disable capabilities.

See​

getCapabilities

Inherited from​

CloudBinary._compiledCapabilities


_lowercaseMaps​

_lowercaseMaps: any

Defined in: core/lib/services/binary.service.d.ts:794

Lowercase maps

Inherited from​

CloudBinary._lowercaseMaps


[WEBDA_EVENTS]​

[WEBDA_EVENTS]: BinaryEvents

Defined in: core/lib/services/service.d.ts:50

Set the Webda events here

Inherited from​

CloudBinary.[WEBDA_EVENTS]


client​

protected client: BlobServiceClient

Defined in: azure/src/services/blob.service.ts:126

Client


hookedModels​

protected hookedModels: Set<string>

Defined in: core/lib/services/binary.service.d.ts:905

Identifiers of the models whose deletion is already followed, so a second init() does not cascade twice

Inherited from​

CloudBinary.hookedModels


logger​

protected logger: Logger

Defined in: core/lib/services/service.d.ts:59

Logger with class context

Inherited from​

CloudBinary.logger


metrics​

metrics: object

Defined in: core/lib/services/binary.service.d.ts:798

Metrics

delete​

delete: Counter

download​

download: Counter

metadataUpdate​

metadataUpdate: Counter

upload​

upload: Counter

Inherited from​

CloudBinary.metrics


name​

readonly name: string

Defined in: core/lib/services/iservice.d.ts:27

Name

Inherited from​

CloudBinary.name


parameters​

readonly parameters: AzureBlobBinaryParameters

Defined in: core/lib/services/iservice.d.ts:31

Parameters

Inherited from​

CloudBinary.parameters


pendingDeletes​

protected pendingDeletes: Map<string, { infos: object[]; model: string; uuid: string; }>

Defined in: core/lib/services/binary.service.d.ts:894

Binaries of a deleted object, kept between the Delete (before) and Deleted (after) events of its repository

Inherited from​

CloudBinary.pendingDeletes


schemes​

readonly schemes: string[]

Defined in: azure/src/services/blob.service.ts:122

Schemes

Overrides​

CloudBinary.schemes


createConfiguration?​

static optional createConfiguration?: (params) => any

Defined in: core/lib/services/iservice.d.ts:35

Create configuration set by the application on load

Parameters​

params​

any

Returns​

any

Inherited from​

CloudBinary.createConfiguration


filterConfiguration?​

static optional filterConfiguration?: (params) => any

Defined in: core/lib/services/iservice.d.ts:39

Create configuration set by the application on load

Parameters​

params​

any

Returns​

any

Inherited from​

CloudBinary.filterConfiguration


Parameters​

static Parameters: typeof AzureBlobBinaryParameters = AzureBlobBinaryParameters

Defined in: azure/src/services/blob.service.ts:118

Parameters

Overrides​

CloudBinary.Parameters

Methods​

__clean()​

abstract __clean(): Promise<void>

Defined in: core/lib/services/service.d.ts:224

Clean the service data, can only be used in test mode

Returns​

Promise<void>

Inherited from​

CloudBinary.__clean


_cleanUsage()​

_cleanUsage(hash, uuid, attribute, model): Promise<void>

Defined in: azure/src/services/blob.service.ts:524

Perform _clean usage.

Parameters​

hash​

string

uuid​

string

attribute​

string

model​

string

Returns​

Promise<void>

Overrides​

CloudBinary._cleanUsage


_get()​

_get(info): Promise<Readable>

Defined in: azure/src/services/blob.service.ts:273

Perform _get.

Parameters​

info​

BinaryMap

Returns​

Promise<Readable>

Overrides​

CloudBinary._get


_getKey()​

_getKey(hash, suffix?): string

Defined in: core/lib/services/cloudbinary.d.ts:85

Return the S3 key

Parameters​

hash​

string

the hash value

suffix?​

string

the suffix to append

Returns​

string

the result string

Inherited from​

CloudBinary._getKey


addListener()​

addListener<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:87

Add listener

Type Parameters​

Key​

Key extends keyof BinaryEvents

Parameters​

eventName​

Key

the event name

listener​

(event) => void | Promise<void>

the event listener

Returns​

this

this for chaining

See​

EventEmitter.addListener

Inherited from​

CloudBinary.addListener


addRoute()​

protected addRoute(url, methods, executer, openapi?, override?): void

Defined in: core/lib/services/service.d.ts:177

Add a route dynamicaly

Parameters​

url​

string

of the route can contains dynamic part like {uuid}

methods​

HttpMethodType[]

the HTTP methods

executer​

Function

Method to execute for this route

openapi?​

OpenAPIWebdaDefinition

the OpenAPI specification

override?​

boolean

whether to override existing

Returns​

void

Inherited from​

CloudBinary.addRoute


attach()​

protected attach(object, property, info): Promise<void>

Defined in: azure/src/services/blob.service.ts:375

Persist an exact ownership marker and attach the verified file.

Parameters​

object​

CoreModelWithBinary

Model owning the binary

property​

string

Binary or model attribute

info​

BinaryFileInfo

Binary metadata or increment specification

Returns​

Promise<void>


authorizeClientEvent()​

authorizeClientEvent(_event, _context): boolean

Defined in: core/lib/services/service.d.ts:153

Authorize a public event subscription

Parameters​

_event​

string

the event name

_context​

OperationContext

the execution context

Returns​

boolean

true if the condition is met

Inherited from​

CloudBinary.authorizeClientEvent


blob()​

protected blob(url): BlockBlobClient

Defined in: azure/src/services/blob.service.ts:188

Resolve a content URL to a configured Blob SDK client.

Parameters​

url​

string

Content URL

Returns​

BlockBlobClient

The blob result


cascadeDelete()​

cascadeDelete(info, uuid, attribute, model): Promise<void>

Defined in: core/lib/services/cloudbinary.d.ts:93

Parameters​

info​

BinaryMap

uuid​

string

attribute​

string

model​

string

Returns​

Promise<void>

Inherited from​

CloudBinary.cascadeDelete


checkHash()​

protected checkHash(hash?): asserts hash is string

Defined in: azure/src/services/blob.service.ts:324

Validate a hash before using it in a storage key.

Parameters​

hash?​

string

Normalized content hash

Returns​

asserts hash is string

The check hash result


checkMap()​

protected checkMap(object, property): void

Defined in: core/lib/services/binary.service.d.ts:943

Check if a map is defined

Parameters​

object​

Model

the target object

property​

string

the property name

Returns​

void

Inherited from​

CloudBinary.checkMap


completeUpload()​

completeUpload(object, property, hash): Promise<void>

Defined in: azure/src/services/blob.service.ts:451

Verify the bytes before copying them to the content hash and attaching them to the owner.

Parameters​

object​

CoreModelWithBinary

property​

string

hash​

string

Returns​

Promise<void>

Overrides​

CloudBinary.completeUpload


computeParameters()​

computeParameters(): void

Defined in: core/lib/services/service.d.ts:77

Used to compute or derivate input parameter to attribute

Returns​

void

Deprecated​

Inherited from​

CloudBinary.computeParameters


delete()​

delete(object, property, index): Promise<void>

Defined in: core/lib/services/cloudbinary.d.ts:89

Parameters​

object​

CoreModelWithBinary

property​

string

index​

number

Returns​

Promise<void>

Inherited from​

CloudBinary.delete


deleteContent()​

deleteContent(url): Promise<void>

Defined in: azure/src/services/blob.service.ts:265

Perform delete content.

Parameters​

url​

string

Returns​

Promise<void>

Overrides​

CloudBinary.deleteContent


deleteSuccess()​

deleteSuccess(object, property, index?): Promise<void>

Defined in: core/lib/services/binary.service.d.ts:1011

Delete success

Parameters​

object​

CoreModelWithBinary

the target object

property​

string

the property name

index?​

number

the index

Returns​

Promise<void>

the result

Inherited from​

CloudBinary.deleteSuccess


downloadTo()​

downloadTo(info, filename): Promise<void>

Defined in: core/lib/services/binary.service.d.ts:876

Download a binary to a file

Parameters​

info​

BinaryMap

The reference stored in your target object

filename​

any

the filename

Returns​

Promise<void>

Inherited from​

CloudBinary.downloadTo


emit()​

emit<Key>(event, data): Promise<void>

Defined in: core/lib/services/service.d.ts:213

Emit the event with data and wait for Promise to finish if listener returned a Promise

Type Parameters​

Key​

Key extends keyof BinaryEvents

Parameters​

event​

Key

the event name

data​

BinaryEvents[Key]

the data to process

Returns​

Promise<void>

Inherited from​

CloudBinary.emit


get()​

get(info): Promise<Readable>

Defined in: core/lib/services/binary.service.d.ts:868

Get a binary

Parameters​

info​

BinaryMap

The reference stored in your target object

Returns​

Promise<Readable>

the result

Emits​

'binaryGet'

Inherited from​

CloudBinary.get


getAzureResources()​

getAzureResources(deployer): AzureResourceContribution

Defined in: azure/src/services/blob.service.ts:535

Describe the Azure resources and identity permissions required by this service.

Parameters​

deployer​

AzureDeployerInfo

Deployment scope and identity helpers

Returns​

AzureResourceContribution

The azure resources result

Implementation of​

AzureContributor.getAzureResources


getCapabilities()​

getCapabilities(): Record<string, any>

Defined in: core/lib/services/iservice.d.ts:72

Return the capabilities of this service.

By default returns capabilities detected at compile-time from

Returns​

Record<string, any>

the result

Webda Capability-tagged​

interfaces in webda.module.json.

Override to disable capabilities based on configuration:

getCapabilities() {
const caps = super.getCapabilities();
if (!this.parameters.enabled) delete caps["request-filter"];
return caps;
}

Inherited from​

CloudBinary.getCapabilities


getClientEvents()​

getClientEvents(): string[]

Defined in: core/lib/services/service.d.ts:144

Return the events that an external system can subscribe to

Returns​

string[]

the list of results

Inherited from​

CloudBinary.getClientEvents


getContent()​

getContent(url, options?): Promise<Readable>

Defined in: azure/src/services/blob.service.ts:200

Perform get content.

Parameters​

url​

string

options?​

ContentGetOptions

Returns​

Promise<Readable>

Overrides​

CloudBinary.getContent


getContentBucket()​

getContentBucket(): string

Defined in: azure/src/services/blob.service.ts:179

Perform get content bucket.

Returns​

string

Overrides​

CloudBinary.getContentBucket


getContentUrl()​

protected getContentUrl(key): string

Defined in: core/lib/services/cloudbinary.d.ts:61

Build :///

Parameters​

key​

string

object key

Returns​

string

content URL

Inherited from​

CloudBinary.getContentUrl


getFile()​

getFile(req): Promise<BinaryFile<{ }>>

Defined in: core/lib/services/binary.service.d.ts:1017

Get file either from multipart post or raw

Parameters​

req​

IOperationContext

the request

Returns​

Promise<BinaryFile<{ }>>

the result

Inherited from​

CloudBinary.getFile


getMaxListeners()​

getMaxListeners(): number

Defined in: core/lib/events/asynceventemitter.d.ts:91

Returns​

number

Inherited from​

CloudBinary.getMaxListeners


getMetric()​

getMetric<T>(type, configuration): T

Defined in: core/lib/services/service.d.ts:138

Add service name label

Type Parameters​

T​

T = Gauge<string> | Counter<string> | Histogram<string>

Parameters​

type​

CustomConstructor<T, [MetricConfiguration<T>]>

the type to look up

configuration​

MetricConfiguration<T>

the configuration

Returns​

T

the result

Inherited from​

CloudBinary.getMetric


getName()​

getName(): string

Defined in: core/lib/services/service.d.ts:218

Get service name

Returns​

string

the result string

Inherited from​

CloudBinary.getName


getOpenApiReplacements()​

getOpenApiReplacements(): any

Defined in: core/lib/services/service.d.ts:182

Return variables for replacement in openapi

Returns​

any

the result

Inherited from​

CloudBinary.getOpenApiReplacements


getOperationId()​

getOperationId(id): string | undefined

Defined in: core/lib/services/service.d.ts:167

If undefined is returned it cancel the operation registration

Parameters​

id​

string

the identifier

Returns​

string | undefined

the result

Inherited from​

CloudBinary.getOperationId


getOperationName()​

protected getOperationName(): string

Defined in: core/lib/services/binary.service.d.ts:1022

Return the name of the service for OpenAPI

Returns​

string

the result string

Inherited from​

CloudBinary.getOperationName


getParameters()​

getParameters(): AzureBlobBinaryParameters

Defined in: core/lib/services/service.d.ts:82

Get the service parameters

Returns​

AzureBlobBinaryParameters

the result

Inherited from​

CloudBinary.getParameters


getRedirectUrlFromObject()​

getRedirectUrlFromObject(binaryMap, context, expires?): Promise<string>

Defined in: core/lib/services/cloudbinary.d.ts:78

Get a UrlFromObject

Parameters​

binaryMap​

any

the binary map definition

context​

any

the execution context

expires?​

number

the expiration time

Returns​

Promise<string>

the result

Inherited from​

CloudBinary.getRedirectUrlFromObject


getRepository()​

protected getRepository(model): any

Defined in: core/lib/services/binary.service.d.ts:926

Get the event emitting repository of a model

Parameters​

model​

any

the model class

Returns​

any

the repository

Inherited from​

CloudBinary.getRepository


getService()​

getService<T>(name): ServicesMap[T]

Defined in: core/lib/services/service.d.ts:131

Get a service by name

Type Parameters​

T​

T extends keyof ServicesMap

Parameters​

name​

T

the name to use

Returns​

ServicesMap[T]

the result map

Deprecated​

Use useService, might reconsider

Inherited from​

CloudBinary.getService


getSignedUrl()​

getSignedUrl(key, permissions?, expires?): Promise<string>

Defined in: azure/src/services/blob.service.ts:294

Issue narrowly scoped SAS credentials. Direct uploads only create isolated staging blobs.

Parameters​

key​

string

Object key within the container

permissions?​

"r" | "c" = "r"

Permissions granted by the SAS

expires?​

number = ...

SAS lifetime in seconds

Returns​

Promise<string>

The signed url result


getSignedUrlFromMap()​

getSignedUrlFromMap(map, expires, _context): Promise<string>

Defined in: azure/src/services/blob.service.ts:282

Perform get signed url from map.

Parameters​

map​

BinaryMap

expires​

number

_context​

OperationContext

Returns​

Promise<string>

Overrides​

CloudBinary.getSignedUrlFromMap


getState()​

getState(): ServiceStates

Defined in: core/lib/services/service.d.ts:55

Get the current state

Returns​

ServiceStates

the result

Inherited from​

CloudBinary.getState


getStoredValue()​

protected getStoredValue(object, property): Promise<any>

Defined in: core/lib/services/binary.service.d.ts:983

The attribute value as stored: the object is re-loaded from its repository so a link made by a concurrent request (another instance of the same object) is seen. Objects without a stored copy keep their own value.

Parameters​

object​

CoreModelWithBinary

the target object

property​

string

the property name

Returns​

Promise<any>

the attribute value

Inherited from​

CloudBinary.getStoredValue


getUrl()​

getUrl(url, _methods): string

Defined in: core/lib/services/service.d.ts:161

Return the full path url based on parameters

Parameters​

url​

string

relative url to service

_methods​

HttpMethodType[]

in case we need filtering (like Store)

Returns​

string

absolute url or undefined if need to skip the Route

Inherited from​

CloudBinary.getUrl


getUsageCount()​

getUsageCount(hash): Promise<number>

Defined in: azure/src/services/blob.service.ts:510

Perform get usage count.

Parameters​

hash​

string

Returns​

Promise<number>

Overrides​

CloudBinary.getUsageCount


handleBinary()​

handleBinary(modelName, attribute): -1 | 0 | 1 | 2

Defined in: core/lib/services/binary.service.d.ts:823

Define if binary is managed by the store

Parameters​

modelName​

string

the model name

attribute​

string

the attribute name

Returns​

-1 | 0 | 1 | 2

-1 if not managed, 0 if managed but by default, 1 if managed and in the map, 2 if explicit with attribute and model

Inherited from​

CloudBinary.handleBinary


headContent()​

headContent(url): Promise<ContentInfo | undefined>

Defined in: azure/src/services/blob.service.ts:244

Perform head content.

Parameters​

url​

string

Returns​

Promise<ContentInfo | undefined>

Overrides​

CloudBinary.headContent


hookDelete()​

protected hookDelete(model, attributes): void

Defined in: core/lib/services/binary.service.d.ts:935

Cascade the deletion of a model to its binaries

Delete runs before the repository deletion: the object is loaded and its binaries are kept aside. Deleted only fires once the deletion succeeded, so a failed delete leaves the binaries untouched.

Parameters​

model​

any

the model class

attributes​

string[]

the candidate behavior attributes

Returns​

void

Inherited from​

CloudBinary.hookDelete


init()​

init(): Promise<AzureBlobBinary>

Defined in: azure/src/services/blob.service.ts:132

Perform init.

Returns​

Promise<AzureBlobBinary>

Overrides​

CloudBinary.init


initMetrics()​

initMetrics(): void

Defined in: core/lib/services/binary.service.d.ts:807

Returns​

void

Inherited from​

CloudBinary.initMetrics


initOperations()​

initOperations(): void

Defined in: core/lib/services/service.d.ts:195

Init the operations from

Returns​

void

Operation​

decorators on this service

Inherited from​

CloudBinary.initOperations


isCollection()​

protected isCollection(object, property): boolean

Defined in: core/lib/services/binary.service.d.ts:955

Whether the binary attribute is a collection (BinariesImpl or a subclass) rather than a single Binary

Models are hydrated by the compiled __hydrateBehaviors (store deserialization, load, patch), which always instantiates the behavior class, even for an unset attribute: instanceof BinariesImpl therefore covers subclasses. The relation id comparison is the fallback for objects that were never hydrated.

Parameters​

object​

CoreModelWithBinary

the target object

property​

string

the property name

Returns​

boolean

true if the attribute holds several binaries

Inherited from​

CloudBinary.isCollection


isLinked()​

protected isLinked(object, property, hash, value?): boolean

Defined in: core/lib/services/binary.service.d.ts:975

Whether the hash is already linked to the object attribute (a collection item or the single binary)

Parameters​

object​

CoreModelWithBinary

the target object

property​

string

the property name

hash​

string

the binary hash

value?​

any

the attribute value to check, default to the object's

Returns​

boolean

true if linked

Inherited from​

CloudBinary.isLinked


listeners()​

listeners(eventName): Function[]

Defined in: core/lib/events/asynceventemitter.d.ts:151

Get all listeners for an event

Parameters​

eventName​

keyof BinaryEvents

the event name

Returns​

Function[]

the list of results

Inherited from​

CloudBinary.listeners


loadCapabilities()​

protected loadCapabilities(): void

Defined in: core/lib/services/service.d.ts:120

Load capabilities from webda.module.json metadata into _compiledCapabilities.

Called during resolve after dependency injection. Reads the service's type name from parameters, looks it up in the application's module metadata (moddas or beans section), and populates _compiledCapabilities with an empty object for each declared capability name.

Fails silently if the application is not available (e.g., in unit tests where services are instantiated without a full application context).

Returns​

void

Example​

// If webda.module.json contains:
// { "moddas": { "MyApp/HawkService": { "capabilities": ["request-filter", "cors-filter"] } } }
// Then after resolve(), this.getCapabilities() returns:
// { "request-filter": {}, "cors-filter": {} }

See​

getCapabilities

Inherited from​

CloudBinary.loadCapabilities


log()​

log(level, ...args): void

Defined in: core/lib/services/service.d.ts:236

Log operation

Parameters​

level​

WorkerLogLevel

to log

args​

...any[]

additional arguments

Returns​

void

Inherited from​

CloudBinary.log


marker()​

protected marker(model, property, uuid): string

Defined in: azure/src/services/blob.service.ts:335

Build an injective ownership marker from the model, attribute and key.

Parameters​

model​

string

Model class or model identifier

property​

string

Binary or model attribute

uuid​

string

Owner primary key

Returns​

string

The marker result


newModel()​

newModel(obj): BinaryMap

Defined in: core/lib/services/binary.service.d.ts:883

Based on the raw Map init a BinaryMap

Parameters​

obj​

any

the target object

Returns​

BinaryMap

the result map

Inherited from​

CloudBinary.newModel


off()​

off<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:127

Perform off

Type Parameters​

Key​

Key extends keyof BinaryEvents

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.off

Inherited from​

CloudBinary.off


on()​

on<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:111

Perform on

Type Parameters​

Key​

Key extends keyof BinaryEvents

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.once

Inherited from​

CloudBinary.on


once()​

once<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:103

Perform once

Type Parameters​

Key​

Key extends keyof BinaryEvents

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.once

Inherited from​

CloudBinary.once


operationSchemaName()​

protected operationSchemaName(method, side): string

Defined in: core/lib/services/service.d.ts:191

Schema of an operation side: <service name>.<method>.<side> when the application knows it, else the one the build writes, <class>.<method>.<side>, for the class or its nearest ancestor that has it (a service configured under another name than its class)

Parameters​

method​

string

the method name

side​

"input" | "output"

input or output

Returns​

string

the schema name

Inherited from​

CloudBinary.operationSchemaName


ownsAttribute()​

protected ownsAttribute(model, attribute): boolean

Defined in: core/lib/services/binary.service.d.ts:920

Whether this service is the one storing the binaries of a model attribute

Parameters​

model​

any

the model class

attribute​

string

the attribute name

Returns​

boolean

true if owned

Inherited from​

CloudBinary.ownsAttribute


pendingKey()​

protected pendingKey(object, property, hash): string

Defined in: azure/src/services/blob.service.ts:360

Build the private pending-upload record key.

Parameters​

object​

CoreModelWithBinary

Model owning the binary

property​

string

Binary or model attribute

hash​

string

Normalized content hash

Returns​

string

The pending key result


putContent()​

putContent(url, body, options?): Promise<ContentInfo>

Defined in: azure/src/services/blob.service.ts:218

Perform put content.

Parameters​

url​

string

body​

ContentBody

options?​

ContentPutOptions

Returns​

Promise<ContentInfo>

Overrides​

CloudBinary.putContent


putRedirectUrl()​

putRedirectUrl(object, property, info?, context?): Promise<{ headers: { Content-MD5: string; Content-Type: string; x-ms-blob-type: string; }; method: string; url: string; } | undefined>

Defined in: azure/src/services/blob.service.ts:413

Perform put redirect url.

Parameters​

object​

CoreModelWithBinary

property​

string

info?​

BinaryFileInfo<{ }>

context?​

OperationContext<BinaryFileInfo<{ }>, any, any>

Returns​

Promise<{ headers: { Content-MD5: string; Content-Type: string; x-ms-blob-type: string; }; method: string; url: string; } | undefined>

Overrides​

CloudBinary.putRedirectUrl


removeAllListeners()​

removeAllListeners<Key>(eventName?): this

Defined in: core/lib/events/asynceventemitter.d.ts:134

Remove all listeners

Type Parameters​

Key​

Key extends keyof BinaryEvents

Parameters​

eventName?​

Key

the event name

Returns​

this

this for chaining

See​

EventEmitter.removeAllListeners

Inherited from​

CloudBinary.removeAllListeners


removeListener()​

removeListener<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:119

Remove listener

Type Parameters​

Key​

Key extends keyof BinaryEvents

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.removeListener

Inherited from​

CloudBinary.removeListener


resolve()​

resolve(): this

Defined in: core/lib/services/service.d.ts:98

Resolve parameters and load metadata. @Route-declared routes are scanned and registered by Router.discoverRoutes(services) from Core.init() once every service has resolved — nothing to do per-service here.

Returns​

this

the result

Inherited from​

CloudBinary.resolve


setMaxListeners()​

setMaxListeners(n): this

Defined in: core/lib/events/asynceventemitter.d.ts:95

Parameters​

n​

number

Returns​

this

Inherited from​

CloudBinary.setMaxListeners


stop()​

stop(): Promise<void>

Defined in: core/lib/services/cloudbinary.d.ts:69

Returns​

Promise<void>

Inherited from​

CloudBinary.stop


store()​

store(object, property, file): Promise<void>

Defined in: azure/src/services/blob.service.ts:389

Perform store.

Parameters​

object​

CoreModelWithBinary

property​

string

file​

BinaryFile

Returns​

Promise<void>

Overrides​

CloudBinary.store


toJSON()​

toJSON(): string

Defined in: core/lib/services/service.d.ts:200

Prevent service to be serialized

Returns​

string

the result

Inherited from​

CloudBinary.toJSON


toString()​

toString(): string

Defined in: core/lib/services/service.d.ts:91

Return service representation

Returns​

string

the result

Inherited from​

CloudBinary.toString


uploadSuccess()​

uploadSuccess(object, property, fileInfo): Promise<void>

Defined in: core/lib/services/binary.service.d.ts:990

Ensure events are sent correctly after an upload and update the BinaryFileInfo in targetted object

Parameters​

object​

CoreModelWithBinary

the target object

property​

string

the property name

fileInfo​

BinaryFileInfo<{ }> | { toBinaryFileInfo: () => BinaryFileInfo; }

the file information

Returns​

Promise<void>

Inherited from​

CloudBinary.uploadSuccess


verifiedHashes()​

protected verifiedHashes(file): Promise<{ challenge: string; hash: string; }>

Defined in: core/lib/services/binary.service.d.ts:963

Hashes of a file to store, computed from its bytes: a hash or challenge set on the file is never trusted

A preset hash that differs from the content is rejected; the file then carries the computed values

Parameters​

file​

BinaryFile

the file to store

Returns​

Promise<{ challenge: string; hash: string; }>

the computed hash and challenge

Inherited from​

CloudBinary.verifiedHashes


verifyMapAndStore()​

protected verifyMapAndStore(ctx): IStore

Defined in: core/lib/services/binary.service.d.ts:1028

Based on the request parameter verify it match a known mapping

Parameters​

ctx​

IOperationContext

the operation context

Returns​

IStore

the result

Inherited from​

CloudBinary.verifyMapAndStore


streamToBuffer()​

static streamToBuffer(stream): Promise<Buffer<ArrayBufferLike>>

Defined in: core/lib/services/binary.service.d.ts:890

Read a stream to a buffer

Parameters​

stream​

Readable

the stream

Returns​

Promise<Buffer<ArrayBufferLike>>

the result

Inherited from​

CloudBinary.streamToBuffer