Skip to main content

AsyncOperationAction

@webda/async


Class: AsyncOperationAction

Defined in: packages/async/src/asyncaction.model.ts:317

Operation called asynchronously

Webda Model​

Webda Plural​

AsyncOperationActions

Extends​

Constructors​

Constructor​

new AsyncOperationAction(operationId?, context?, logLevel?): AsyncOperationAction

Defined in: packages/async/src/asyncaction.model.ts:336

Parameters​

operationId?​

string | Partial<AsyncOperationAction>

operation to call or initial data

context?​

OperationContext

context to use

logLevel?​

WorkerLogLevel = "INFO"

log level to capture

Returns​

AsyncOperationAction

Overrides​

AsyncAction.constructor

Properties​

__secretKey​

__secretKey: string

Defined in: packages/async/src/asyncaction.model.ts:133

Secret key to post feedback

Inherited from​

AsyncAction.__secretKey


_lastJobUpdate​

_lastJobUpdate: number

Defined in: packages/async/src/asyncaction.model.ts:104

Last time the job was updated

Inherited from​

AsyncAction._lastJobUpdate


[WEBDA_EVENTS]?​

optional [WEBDA_EVENTS]?: ModelEvents<AsyncOperationAction>

Defined in: packages/models/lib/model.model.d.ts:154

Model events

Inherited from​

AsyncAction.[WEBDA_EVENTS]


[WEBDA_PRIMARY_KEY]​

[WEBDA_PRIMARY_KEY]: readonly ["uuid"]

Defined in: packages/models/lib/model.model.d.ts:296

Definition of the primary key

Inherited from​

AsyncAction.[WEBDA_PRIMARY_KEY]


[WEBDA_STORAGE]​

protected [WEBDA_STORAGE]: Record<string, any>

Defined in: packages/models/lib/model.model.d.ts:159

Internal backing store for morpher-generated accessor properties. Populated automatically when getter/setter pairs are generated at build time.

Inherited from​

AsyncAction.[WEBDA_STORAGE]


action?​

optional action?: string

Defined in: packages/async/src/asyncaction.model.ts:140

Expected action for the job

It should be a verb

Inherited from​

AsyncAction.action


arguments?​

optional arguments?: any[]

Defined in: packages/async/src/asyncaction.model.ts:123

Arguments of the action

Inherited from​

AsyncAction.arguments


constructor​

constructor: Function

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:125

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

Inherited from​

AsyncAction.constructor


context​

context: any

Defined in: packages/async/src/asyncaction.model.ts:325

Context to call the operation with


errorMessage?​

optional errorMessage?: string

Defined in: packages/async/src/asyncaction.model.ts:91

If an error occured it should contain the message

Inherited from​

AsyncAction.errorMessage


errorName?​

optional errorName?: string

Defined in: packages/async/src/asyncaction.model.ts:95

If an error occured it should contain the name

Inherited from​

AsyncAction.errorName


job​

job: any

Defined in: packages/async/src/asyncaction.model.ts:99

Job information

Inherited from​

AsyncAction.job


logLevel​

logLevel: WorkerLogLevel

Defined in: packages/async/src/asyncaction.model.ts:329

Log level to capture


logs​

logs: string[]

Defined in: packages/async/src/asyncaction.model.ts:128

Current logs

Inherited from​

AsyncAction.logs


operationId​

operationId: string

Defined in: packages/async/src/asyncaction.model.ts:321

Operation to call


results​

results: any

Defined in: packages/async/src/asyncaction.model.ts:108

Results from the job

Inherited from​

AsyncAction.results


scheduled?​

optional scheduled?: number

Defined in: packages/async/src/asyncaction.model.ts:86

Timestamp when the action was scheduled

Inherited from​

AsyncAction.scheduled


status​

status: "ERROR" | "RUNNING" | "SUCCESS" | "QUEUED" | "STARTING" | "TIMEOUT" | "SCHEDULED"

Defined in: packages/async/src/asyncaction.model.ts:81

Current status

Inherited from​

AsyncAction.status


statusDetails​

statusDetails: any

Defined in: packages/async/src/asyncaction.model.ts:113

Job current status

Inherited from​

AsyncAction.statusDetails


type​

type: string

Defined in: packages/async/src/asyncaction.model.ts:118

Type of action

Inherited from​

AsyncAction.type


uuid​

uuid: string

Defined in: packages/models/lib/model.model.d.ts:301

UUID of the model

Format​

uuid

Inherited from​

AsyncAction.uuid


DefaultDeserializer​

static DefaultDeserializer: object

Defined in: packages/models/lib/model.model.d.ts:255

Built-in deserializer helpers for common types

Date​

Date: (value) => Date

Parameters​
value​

string | number | Date

Returns​

Date

Inherited from​

AsyncAction.DefaultDeserializer

Methods​

canAct()​

canAct(context, action): Promise<string | boolean>

Defined in: packages/async/src/asyncaction.model.ts:239

Only job runners with a valid HMAC can report status or use binaries

Parameters​

context​

IOperationContext

the operation context

action​

string

the action

Returns​

Promise<string | boolean>

true or the reason of refusal

Inherited from​

AsyncAction.canAct


checkAct()​

checkAct(context, action): Promise<void>

Defined in: packages/async/src/asyncaction.model.ts:259

Throw a Forbidden error if the action is not allowed

Parameters​

context​

IOperationContext

the operation context

action​

string

the action

Returns​

Promise<void>

Inherited from​

AsyncAction.checkAct


delete()​

delete(): Promise<void>

Defined in: packages/models/lib/model.model.d.ts:281

Delete a model

Returns​

Promise<void>

a promise resolving when deleted (void)

Inherited from​

AsyncAction.delete


emit()​

protected emit<T>(event, payload): Promise<void>

Defined in: packages/models/lib/model.model.d.ts:248

Helper to emit events from the class

Type Parameters​

T​

T extends keyof ModelEvents<AsyncOperationAction>

Parameters​

event​

T

the event name to emit

payload​

ModelEvents<AsyncOperationAction>[T]

the event data

Returns​

Promise<void>

Inherited from​

AsyncAction.emit


generateUUID()​

generateUUID(data?): string

Defined in: packages/models/lib/model.model.d.ts:313

Generate a new UUID for this model. Override to provide custom ID generation logic.

Parameters​

data?​

any

Optional partial data used during construction

Returns​

string

the generated UUID string

Inherited from​

AsyncAction.generateUUID


getHmac()​

getHmac(jobTime): string

Defined in: packages/async/src/asyncaction.model.ts:229

Get the hmac for the job

Parameters​

jobTime​

string

the job time header

Returns​

string

the hex hmac

Inherited from​

AsyncAction.getHmac


getHookUrl()​

getHookUrl(): string

Defined in: packages/async/src/asyncaction.model.ts:173

Return the absolute url of this action status route ({uuid}/status)

Remote runners report to AsyncJobService.getHookUrl() instead, as this route still has to be authorized by the application request filters

Returns​

string

the absolute url of the status action

Inherited from​

AsyncAction.getHookUrl


getLogsLimit()​

getLogsLimit(): number

Defined in: packages/async/src/asyncaction.model.ts:146

Maximum number of log lines kept

Returns​

number

the limit

Inherited from​

AsyncAction.getLogsLimit


getPrimaryKey()​

getPrimaryKey<K>(this): PrimaryKeyType<AsyncOperationAction>

Defined in: packages/models/lib/model.model.d.ts:172

K is inferred as the literal tuple type of this.keyFields, so K[number] is the exact union of keys you wrote.

Type Parameters​

K​

K extends readonly keyof AsyncOperationAction[]

Parameters​

this​

AsyncOperationAction & object

Returns​

PrimaryKeyType<AsyncOperationAction>

the primary key value

Inherited from​

AsyncAction.getPrimaryKey


getRepository()​

getRepository(): Repository<ModelClass<AsyncOperationAction>>

Defined in: packages/models/lib/model.model.d.ts:199

Get the repository associated with this model class

Returns​

Repository<ModelClass<AsyncOperationAction>>

the repository

Inherited from​

AsyncAction.getRepository


getUUID()​

getUUID(): string

Defined in: packages/models/lib/model.model.d.ts:180

Return the string representation of the primary key

Returns​

string

the string UID

Inherited from​

AsyncAction.getUUID


hasOwnProperty()​

hasOwnProperty(v): boolean

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:140

Determines whether an object has a property with the specified name.

Parameters​

v​

PropertyKey

A property name.

Returns​

boolean

Inherited from​

AsyncAction.hasOwnProperty


isDeleted()​

isDeleted(): any

Defined in: packages/models/lib/model.model.d.ts:276

Check whether this model instance has been soft-deleted

Returns​

any

true if soft-deleted

Inherited from​

AsyncAction.isDeleted


isInternal()​

isInternal(): boolean

Defined in: packages/async/src/asyncaction.model.ts:354

Execute a webda.callOperation(context ,id) so this is internal

Returns​

boolean

true

Overrides​

AsyncAction.isInternal


isPrototypeOf()​

isPrototypeOf(v): boolean

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:146

Determines whether an object exists in another object's prototype chain.

Parameters​

v​

Object

Another object whose prototype chain is to be checked.

Returns​

boolean

Inherited from​

AsyncAction.isPrototypeOf


load()​

load(params): this

Defined in: packages/models/lib/model.model.d.ts:271

Allow to load from Storage, Dto and helper formats

Parameters​

params​

LoadParameters<this>

the data to load

Returns​

this

the model instance

Inherited from​

AsyncAction.load


patch()​

patch(data): Promise<AsyncOperationAction>

Defined in: packages/models/lib/model.model.d.ts:287

Patch the object

Parameters​

data​

Partial<SelfJSONed<this>>

the partial data to patch with

Returns​

Promise<AsyncOperationAction>

the patched model instance

Inherited from​

AsyncAction.patch


propertyIsEnumerable()​

propertyIsEnumerable(v): boolean

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:152

Determines whether a specified property is enumerable.

Parameters​

v​

PropertyKey

A property name.

Returns​

boolean

Inherited from​

AsyncAction.propertyIsEnumerable


ref()​

ref(): ModelRef<AsyncOperationAction>

Defined in: packages/models/lib/model.model.d.ts:185

Get a reference to this model instance in its repository

Returns​

ModelRef<AsyncOperationAction>

a model reference

Inherited from​

AsyncAction.ref


refresh()​

refresh(): Promise<AsyncOperationAction>

Defined in: packages/models/lib/model.model.d.ts:237

Reload the model from the repository, updating all properties in-place

Returns​

Promise<AsyncOperationAction>

the refreshed model instance

Inherited from​

AsyncAction.refresh


save()​

save(): Promise<AsyncOperationAction>

Defined in: packages/models/lib/model.model.d.ts:242

Save the model to the repository

Returns​

Promise<AsyncOperationAction>

the saved model instance

Inherited from​

AsyncAction.save


setPrimaryKey()​

setPrimaryKey<K>(this, value): this

Defined in: packages/models/lib/model.model.d.ts:192

Set the primary key of the model

Type Parameters​

K​

K extends readonly keyof AsyncOperationAction[]

Parameters​

this​

AsyncOperationAction & object

the model instance

value​

PK<AsyncOperationAction, K[number]>

the primary key value to set

Returns​

this

the model instance

Inherited from​

AsyncAction.setPrimaryKey


statusAction()​

statusAction(context?): Promise<void>

Defined in: packages/async/src/asyncaction.model.ts:157

Allow to report status for a job

Only a job runner with a valid HMAC can call it

Parameters​

context?​

OperationContext = ...

the web context of the job runner

Returns​

Promise<void>

Inherited from​

AsyncAction.statusAction


toDTO()​

toDTO(): object

Defined in: packages/models/lib/model.model.d.ts:232

Public representation of the model: its JSON form without __-prefixed (server-only) keys, at any depth. Dates are serialized as strings.

Implemented as a JSON.parse(JSON.stringify(this)) round-trip, so circular references throw, BigInt throws and Buffers become { type: "Buffer", data }. A model with such fields must override toDTO.

Returns​

the DTO

canAct​

canAct: object

checkAct​

checkAct: object

constructor​

constructor: object

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

constructor.apply​

apply: object

constructor.arguments​

arguments: any

constructor.bind​

bind: object

constructor.call​

call: object

constructor.caller​

caller: { arguments: any; toString: {}; apply: {}; call: {}; bind: {}; prototype: any; caller: ...; }

constructor.prototype​

prototype: any

constructor.toString​

toString: object

context​

context: any

delete​

delete: object

generateUUID​

generateUUID: object

getHmac​

getHmac: object

getHookUrl​

getHookUrl: object

getLogsLimit​

getLogsLimit: object

getPrimaryKey​

getPrimaryKey: object

getRepository​

getRepository: object

getUUID​

getUUID: object

hasOwnProperty​

hasOwnProperty: object

isDeleted​

isDeleted: object

isInternal​

isInternal: object

isPrototypeOf​

isPrototypeOf: object

job​

job: any

load​

load: object

patch​

patch: object

propertyIsEnumerable​

propertyIsEnumerable: object

ref​

ref: object

refresh​

refresh: object

results​

results: any

save​

save: object

setPrimaryKey​

setPrimaryKey: object

statusAction​

statusAction: object

statusDetails​

statusDetails: any

toDTO​

toDTO: object

toJSON​

toJSON: object

toLocaleString​

toLocaleString: object

toProxy​

toProxy: object

toString​

toString: object

update​

update: object

valueOf​

valueOf: object

Inherited from​

AsyncAction.toDTO


toJSON()​

toJSON(): this

Defined in: packages/models/lib/model.model.d.ts:222

Serialize the model to JSON.

Uses for...in to include both own enumerable properties (regular class fields) and inherited enumerable prototype getters generated by the morpher for coercible fields (e.g. Date). Symbol-keyed internals and methods are excluded automatically.

Returns​

this

the model instance

Inherited from​

AsyncAction.toJSON


toLocaleString()​

toLocaleString(): string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:131

Returns a date converted to a string using the current locale.

Returns​

string

Inherited from​

AsyncAction.toLocaleString


toProxy()​

toProxy(): any

Defined in: packages/models/lib/model.model.d.ts:115

Returns​

any

Inherited from​

AsyncAction.toProxy


toString()​

toString(): string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:128

Returns a string representation of an object.

Returns​

string

Inherited from​

AsyncAction.toString


update()​

update(body, time?): Promise<AsyncOperationAction>

Defined in: packages/async/src/asyncaction.model.ts:183

Update the action with a status report

Parameters​

body​

any

the status report

time?​

string = undefined

the job time header

Returns​

Promise<AsyncOperationAction>

this

Inherited from​

AsyncAction.update


valueOf()​

valueOf(): Object

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:134

Returns the primitive value of the specified object.

Returns​

Object

Inherited from​

AsyncAction.valueOf


verifyJobRequest()​

protected verifyJobRequest(context): Promise<void>

Defined in: packages/async/src/asyncaction.model.ts:211

Verify the job HMAC headers

Parameters​

context​

WebContext

the web context

Returns​

Promise<void>

Inherited from​

AsyncAction.verifyJobRequest


assign()​

Call Signature​

static assign<T, U>(target, source): T & U

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:286

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Type Parameters​
T​

T extends object

U​

U

Parameters​
target​

T

The target object to copy to.

source​

U

The source object from which to copy properties.

Returns​

T & U

Inherited from​

AsyncAction.assign

Call Signature​

static assign<T, U, V>(target, source1, source2): T & U & V

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:295

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Type Parameters​
T​

T extends object

U​

U

V​

V

Parameters​
target​

T

The target object to copy to.

source1​

U

The first source object from which to copy properties.

source2​

V

The second source object from which to copy properties.

Returns​

T & U & V

Inherited from​

AsyncAction.assign

Call Signature​

static assign<T, U, V, W>(target, source1, source2, source3): T & U & V & W

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:305

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Type Parameters​
T​

T extends object

U​

U

V​

V

W​

W

Parameters​
target​

T

The target object to copy to.

source1​

U

The first source object from which to copy properties.

source2​

V

The second source object from which to copy properties.

source3​

W

The third source object from which to copy properties.

Returns​

T & U & V & W

Inherited from​

AsyncAction.assign

Call Signature​

static assign(target, ...sources): any

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:313

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Parameters​
target​

object

The target object to copy to.

sources​

...any[]

One or more source objects from which to copy properties

Returns​

any

Inherited from​

AsyncAction.assign


canAct()​

static canAct(context, action, object?): CanActResult

Defined in: packages/models/lib/model.model.d.ts:150

The one permission entry point the framework asks before running an operation a client sent

object is the loaded object for an operation on an object (get, update, patch, delete, actions, behavior actions, each query row), the new unsaved object for a create, and undefined for a static (class-level) action.

This base implementation delegates to the instance method canAct(context, action) when object defines one (a subclass overrode it), and denies in every other case: no instance method, or no object. A model is therefore refused on every transport until it defines one of the two forms. Override the static method to control static actions, creation rules or class-level policy; it may call super.canAct(context, action, object) to keep the instance check for objects. Opt into open access with static canAct() { return true; }.

Parameters​

context​

CanActContext

the caller context

action​

string

the action name ("get", "create", "update", "delete", an action name, "attribute.action")

object?​

any

the object the action targets, if any

Returns​

CanActResult

true when allowed, otherwise a refusal (a reason string or false)

Inherited from​

AsyncAction.canAct


create()​

Call Signature​

static create<T>(this, data, save?): Promise<InstanceType<T>>

Defined in: packages/models/lib/model.model.d.ts:118

Type Parameters​
T​

T extends ModelClass<Storable<any, any>>

Parameters​
this​

T

data​

InstanceType<T> extends T_1 ? { [K in string | number | symbol as K extends symbol ? never : InstanceType[K] extends (args: any[]) => any ? never : K]: T_1[K] } : never

save?​

boolean

Returns​

Promise<InstanceType<T>>

Inherited from​

AsyncAction.create

Call Signature​

static create(o): any

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:188

Creates an object that has the specified prototype or that has null prototype.

Parameters​
o​

object

Object to use as a prototype. May be null.

Returns​

any

Inherited from​

AsyncAction.create

Call Signature​

static create(o, properties): any

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:195

Creates an object that has the specified prototype, and that optionally contains specified properties.

Parameters​
o​

object

Object to use as a prototype. May be null

properties​

PropertyDescriptorMap & ThisType<any>

JavaScript object that contains one or more property descriptors.

Returns​

any

Inherited from​

AsyncAction.create


defineProperties()​

static defineProperties<T>(o, properties): T

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:210

Adds one or more properties to an object, and/or modifies attributes of existing properties.

Type Parameters​

T​

T

Parameters​

o​

T

Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.

properties​

PropertyDescriptorMap & ThisType<any>

JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.

Returns​

T

Inherited from​

AsyncAction.defineProperties


defineProperty()​

static defineProperty<T>(o, p, attributes): T

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:203

Adds a property to an object, or modifies attributes of an existing property.

Type Parameters​

T​

T

Parameters​

o​

T

Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.

p​

PropertyKey

The property name.

attributes​

PropertyDescriptor & ThisType<any>

Descriptor for the property. It can be for a data property or an accessor property.

Returns​

T

Inherited from​

AsyncAction.defineProperty


deserialize()​

static deserialize<T, K>(this, data, instance?): K

Defined in: packages/models/lib/model.model.d.ts:265

Deserialize the model

Type Parameters​

T​

T extends ModelClass<Storable<any, any>>

K​

K extends object = InstanceType<T>

Parameters​

this​

T

the model class constructor

data​

any

the raw data to deserialize

instance?​

K

optional existing instance to populate

Returns​

K

the deserialized model instance

Inherited from​

AsyncAction.deserialize


entries()​

Call Signature​

static entries<T>(o): [string, T][]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts:36

Returns an array of key/values of the enumerable own properties of an object

Type Parameters​
T​

T

Parameters​
o​

{[s: string]: T; } | ArrayLike<T>

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns​

[string, T][]

Inherited from​

AsyncAction.entries

Call Signature​

static entries(o): [string, any][]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts:42

Returns an array of key/values of the enumerable own properties of an object

Parameters​
o​

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns​

[string, any][]

Inherited from​

AsyncAction.entries


freeze()​

Call Signature​

static freeze<T>(f): T

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:222

Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

Type Parameters​
T​

T extends Function

Parameters​
f​

T

Object on which to lock the attributes.

Returns​

T

Inherited from​

AsyncAction.freeze

Call Signature​

static freeze<T, U>(o): Readonly<T>

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:228

Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

Type Parameters​
T​

T extends object

U​

U extends string | number | bigint | boolean | symbol

Parameters​
o​

T

Object on which to lock the attributes.

Returns​

Readonly<T>

Inherited from​

AsyncAction.freeze

Call Signature​

static freeze<T>(o): Readonly<T>

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:234

Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

Type Parameters​
T​

T

Parameters​
o​

T

Object on which to lock the attributes.

Returns​

Readonly<T>

Inherited from​

AsyncAction.freeze


fromEntries()​

Call Signature​

static fromEntries<T>(entries): object

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts:26

Returns an object created by key-value entries for properties and methods

Type Parameters​
T​

T = any

Parameters​
entries​

Iterable<readonly [PropertyKey, T]>

An iterable object that contains key-value entries for properties and methods.

Returns​

object

Inherited from​

AsyncAction.fromEntries

Call Signature​

static fromEntries(entries): any

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts:32

Returns an object created by key-value entries for properties and methods

Parameters​
entries​

Iterable<readonly any[]>

An iterable object that contains key-value entries for properties and methods.

Returns​

any

Inherited from​

AsyncAction.fromEntries


getDeserializers()​

static getDeserializers<T>(this): Partial<Record<keyof InstanceType<T>, (value) => any>>

Defined in: packages/models/lib/model.model.d.ts:253

Custom deserializers for the model

Type Parameters​

T​

T extends ModelClass<Storable<any, any>>

Parameters​

this​

T

Returns​

Partial<Record<keyof InstanceType<T>, (value) => any>>

a map of field deserializers, or undefined

Inherited from​

AsyncAction.getDeserializers


getOwnPropertyDescriptor()​

static getOwnPropertyDescriptor(o, p): PropertyDescriptor

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:175

Gets the own property descriptor of the specified object. An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.

Parameters​

o​

any

Object that contains the property.

p​

PropertyKey

Name of the property.

Returns​

PropertyDescriptor

Inherited from​

AsyncAction.getOwnPropertyDescriptor


getOwnPropertyDescriptors()​

static getOwnPropertyDescriptors<T>(o): { [P in string | number | symbol]: TypedPropertyDescriptor<T[P]> } & object

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts:48

Returns an object containing all own property descriptors of an object

Type Parameters​

T​

T

Parameters​

o​

T

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns​

{ [P in string | number | symbol]: TypedPropertyDescriptor<T[P]> } & object

Inherited from​

AsyncAction.getOwnPropertyDescriptors


getOwnPropertyNames()​

static getOwnPropertyNames(o): string[]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:182

Returns the names of the own properties of an object. The own properties of an object are those that are defined directly on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.

Parameters​

o​

any

Object that contains the own properties.

Returns​

string[]

Inherited from​

AsyncAction.getOwnPropertyNames


getOwnPropertySymbols()​

static getOwnPropertySymbols(o): symbol[]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:319

Returns an array of all symbol properties found directly on object o.

Parameters​

o​

any

Object to retrieve the symbols from.

Returns​

symbol[]

Inherited from​

AsyncAction.getOwnPropertySymbols


getPrototypeOf()​

static getPrototypeOf(o): any

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:167

Returns the prototype of an object.

Parameters​

o​

any

The object that references the prototype.

Returns​

any

Inherited from​

AsyncAction.getPrototypeOf


getRepository()​

static getRepository<T>(this): Repository<T>

Defined in: packages/models/lib/model.model.d.ts:117

Type Parameters​

T​

T extends ModelClass<Storable<any, any>>

Parameters​

this​

T

Returns​

Repository<T>

Inherited from​

AsyncAction.getRepository


is()​

static is(value1, value2): boolean

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:332

Returns true if the values are the same value, false otherwise.

Parameters​

value1​

any

The first value.

value2​

any

The second value.

Returns​

boolean

Inherited from​

AsyncAction.is


isExtensible()​

static isExtensible(o): boolean

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:258

Returns a value that indicates whether new properties can be added to an object.

Parameters​

o​

any

Object to test.

Returns​

boolean

Inherited from​

AsyncAction.isExtensible


isFrozen()​

static isFrozen(o): boolean

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:252

Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.

Parameters​

o​

any

Object to test.

Returns​

boolean

Inherited from​

AsyncAction.isFrozen


isSealed()​

static isSealed(o): boolean

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:246

Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.

Parameters​

o​

any

Object to test.

Returns​

boolean

Inherited from​

AsyncAction.isSealed


iterate()​

static iterate<T>(this, query, params?): AsyncGenerator<InstanceType<T>, any, any>

Defined in: packages/models/lib/model.model.d.ts:123

Type Parameters​

T​

T extends ModelClass<Storable<any, any>>

Parameters​

this​

T

query​

WebdaQLString<InstanceType<T>>

params?​

QueryParameters

Returns​

AsyncGenerator<InstanceType<T>, any, any>

Inherited from​

AsyncAction.iterate


keys()​

Call Signature​

static keys(o): string[]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:264

Returns the names of the enumerable string properties and methods of an object.

Parameters​
o​

object

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns​

string[]

Inherited from​

AsyncAction.keys

Call Signature​

static keys(o): string[]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:325

Returns the names of the enumerable string properties and methods of an object.

Parameters​
o​

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns​

string[]

Inherited from​

AsyncAction.keys


preventExtensions()​

static preventExtensions<T>(o): T

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:240

Prevents the addition of new properties to an object.

Type Parameters​

T​

T

Parameters​

o​

T

Object to make non-extensible.

Returns​

T

Inherited from​

AsyncAction.preventExtensions


query()​

static query<T>(this, query, params?): Promise<{ continuationToken?: string; results: InstanceType<T>[]; }>

Defined in: packages/models/lib/model.model.d.ts:119

Type Parameters​

T​

T extends ModelClass<Storable<any, any>>

Parameters​

this​

T

query​

WebdaQLString<InstanceType<T>>

params?​

QueryParameters

Returns​

Promise<{ continuationToken?: string; results: InstanceType<T>[]; }>

Inherited from​

AsyncAction.query


ref()​

static ref<T>(this, key): ModelRefWithCreate<InstanceType<T>>

Defined in: packages/models/lib/model.model.d.ts:124

Type Parameters​

T​

T extends ModelClass<Storable<any, any>>

Parameters​

this​

T

key​

SettablePrimaryKey<InstanceType<T>>

Returns​

ModelRefWithCreate<InstanceType<T>>

Inherited from​

AsyncAction.ref


registerSerializer()​

static registerSerializer<T>(this, overwrite?, identifier?): void

Defined in: packages/models/lib/model.model.d.ts:210

Register Model custom serializer

Type Parameters​

T​

T extends ModelClass<Storable<any, any>>

Parameters​

this​

T & object

the model class constructor

overwrite?​

boolean

whether to overwrite an existing serializer

identifier?​

string

fully-qualified model identifier (e.g. WebdaSample/User) used to namespace the serializer key when multiple classes share the same JS constructor name. Defaults to the constructor's own name.

TODO Might want to move to deserialize static function

Returns​

void

Inherited from​

AsyncAction.registerSerializer


seal()​

static seal<T>(o): T

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:216

Prevents the modification of attributes of existing properties, and prevents the addition of new properties.

Type Parameters​

T​

T

Parameters​

o​

T

Object on which to lock the attributes.

Returns​

T

Inherited from​

AsyncAction.seal


setPrototypeOf()​

static setPrototypeOf(o, proto): any

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts:339

Sets the prototype of a specified object o to object proto or null. Returns the object o.

Parameters​

o​

any

The object to change its prototype.

proto​

object

The value of the new prototype or null.

Returns​

any

Inherited from​

AsyncAction.setPrototypeOf


values()​

Call Signature​

static values<T>(o): T[]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts:24

Returns an array of values of the enumerable own properties of an object

Type Parameters​
T​

T

Parameters​
o​

{[s: string]: T; } | ArrayLike<T>

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns​

T[]

Inherited from​

AsyncAction.values

Call Signature​

static values(o): any[]

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts:30

Returns an array of values of the enumerable own properties of an object

Parameters​
o​

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns​

any[]

Inherited from​

AsyncAction.values