Class: Deployment
Webda Model
Extends
CoreModel
Constructors
new Deployment()
new Deployment():
Deployment
Returns
Inherited from
CoreModel.constructor
Source
packages/core/lib/models/coremodel.d.ts:432
Properties
__class
__class:
CoreModelDefinition
<Deployment
>
Class reference to the object
Inherited from
CoreModel.__class
Source
packages/core/lib/models/coremodel.d.ts:396
__ctx
__ctx:
OperationContext
<any
,any
>
Object context
@TJS-ignore
Inherited from
CoreModel.__ctx
Source
packages/core/lib/models/coremodel.d.ts:410
__dirty
__dirty:
Set
<string
|symbol
>
Inherited from
CoreModel.__dirty
Source
packages/core/lib/models/coremodel.d.ts:417
__store
__store:
Store
<Deployment
,StoreParameters
,StoreEvents
>
If object is attached to its store
@TJS-ignore
Inherited from
CoreModel.__store
Source
packages/core/lib/models/coremodel.d.ts:416
__type
__type:
string
Type name
Inherited from
CoreModel.__type
Source
packages/core/lib/models/coremodel.d.ts:400
__types
__types:
string
[]
Types name
Inherited from
CoreModel.__types
Source
packages/core/lib/models/coremodel.d.ts:404
_creationDate
_creationDate:
Date
Creation date
Inherited from
CoreModel._creationDate
Source
packages/core/lib/models/coremodel.d.ts:421
_lastUpdate
_lastUpdate:
Date
Last update date
Inherited from
CoreModel._lastUpdate
Source
packages/core/lib/models/coremodel.d.ts:425
_type
_type:
string
="deployment"
Source
packages/shell/src/models/deployment.ts:11
callback
callback:
any
Source
packages/shell/src/models/deployment.ts:12
parameters
parameters:
any
={}
Source
packages/shell/src/models/deployment.ts:7
resources
resources:
any
={}
Source
packages/shell/src/models/deployment.ts:8
services
services:
any
={}
Source
packages/shell/src/models/deployment.ts:9
units
units:
any
[] =[]
Source
packages/shell/src/models/deployment.ts:10
Methods
_onDelete()
_onDelete():
Promise
<void
>
Called when object is about to be deleted
Returns
Promise
<void
>
Inherited from
CoreModel._onDelete
Source
packages/core/lib/models/coremodel.d.ts:807
_onDeleted()
_onDeleted():
Promise
<void
>
Called when object has been deleted
Returns
Promise
<void
>
Inherited from
CoreModel._onDeleted
Source
packages/core/lib/models/coremodel.d.ts:811
_onGet()
_onGet():
Promise
<void
>
Called when object is retrieved
Returns
Promise
<void
>
Inherited from
CoreModel._onGet
Source
packages/core/lib/models/coremodel.d.ts:815
_onSave()
_onSave():
Promise
<void
>
Called when object is about to be saved
Returns
Promise
<void
>
Inherited from
CoreModel._onSave
Source
packages/core/lib/models/coremodel.d.ts:819
_onSaved()
_onSaved():
Promise
<void
>
Called when object is saved
Returns
Promise
<void
>
Inherited from
CoreModel._onSaved
Source
packages/core/lib/models/coremodel.d.ts:823
_onUpdate()
_onUpdate(
_updates
):Promise
<void
>
Called when object is about to be updates
Parameters
• _updates: any
Returns
Promise
<void
>
Inherited from
CoreModel._onUpdate
Source
packages/core/lib/models/coremodel.d.ts:829
_onUpdated()
_onUpdated():
Promise
<void
>
Called when object is updated
Returns
Promise
<void
>
Inherited from
CoreModel._onUpdated
Source
packages/core/lib/models/coremodel.d.ts:833
_toJSON()
_toJSON(
secure
):any
Remove the specific attributes if not secure
Parameters
• secure: any
serialize server fields also
Returns
any
filtered object to be serialized
Inherited from
CoreModel._toJSON
Source
packages/core/lib/models/coremodel.d.ts:797
attributePermission()
attributePermission(
key
,value
,mode
,context
?):any
Allow to define custom permission per attribute
This method allows you to do permission based attribute But also a mask destructive attribute
Parameters
• key: string
• value: any
• mode: "READ"
| "WRITE"
• context?: OperationContext
<any
, any
>
Returns
any
updated value
Inherited from
CoreModel.attributePermission
Source
packages/core/lib/models/coremodel.d.ts:704
canAct()
canAct(
_ctx
,_action
):Promise
<string
|true
>
Parameters
• _ctx: any
• _action: string
Returns
Promise
<string
| true
>
Overrides
CoreModel.canAct
Source
packages/shell/src/models/deployment.ts:14
checkAct()
checkAct(
context
,action
):Promise
<void
>
Parameters
• context: OperationContext
<any
, any
>
• action: string
Returns
Promise
<void
>
Inherited from
CoreModel.checkAct
Source
packages/core/lib/models/coremodel.d.ts:656
delete()
delete():
Promise
<void
>
Delete this object
Returns
Promise
<void
>
Inherited from
CoreModel.delete
Throws
Error if the object is not coming from a store
Source
packages/core/lib/models/coremodel.d.ts:747
generateUid()
generateUid(
_object
?):string
Generate uuid for the object
Parameters
• _object?: any
Returns
string
Inherited from
CoreModel.generateUid
Source
packages/core/lib/models/coremodel.d.ts:774
get()
get():
Promise
<Deployment
>
Get the object
Returns
Promise
<Deployment
>
Inherited from
CoreModel.get
Source
packages/core/lib/models/coremodel.d.ts:735
getContext()
getContext<
T
>():T
Get object context
Global object does not belong to a request
Type parameters
• T extends OperationContext
<any
, any
>
Returns
T
Inherited from
CoreModel.getContext
Source
packages/core/lib/models/coremodel.d.ts:726
getFullUuid()
getFullUuid():
string
Return a unique reference within the application to the object
It contains the Store containing it
Returns
string
Inherited from
CoreModel.getFullUuid
Source
packages/core/lib/models/coremodel.d.ts:683
getProxy()
getProxy():
this
Return a proxy to the object to detect if dirty
Returns
this
Inherited from
CoreModel.getProxy
Source
packages/core/lib/models/coremodel.d.ts:623
getRef()
getRef<
T
>():ModelRef
<T
>
Return a model ref
Type parameters
• T extends Deployment
Returns
ModelRef
<T
>
Inherited from
CoreModel.getRef
Source
packages/core/lib/models/coremodel.d.ts:855
getService()
getService<
T
>(service
):T
Get a pre typed service
Type parameters
• T extends Service
<ServiceParameters
, Events
>
Parameters
• service: any
to retrieve WARNING: Only object attached to a store can retrieve service
Returns
T
Inherited from
CoreModel.getService
Source
packages/core/lib/models/coremodel.d.ts:788
getStore()
getStore():
Store
<Deployment
,StoreParameters
,StoreEvents
>
Return the object registered store
Returns
Store
<Deployment
, StoreParameters
, StoreEvents
>
Inherited from
CoreModel.getStore
Source
packages/core/lib/models/coremodel.d.ts:730
getUuid()
getUuid():
string
Returns
string
the uuid of the object
Inherited from
CoreModel.getUuid
Source
packages/core/lib/models/coremodel.d.ts:633
handleRelations()
protected
handleRelations():void
Patch every attribute that is based on a relation to add all the helpers
Returns
void
Inherited from
CoreModel.handleRelations
Source
packages/core/lib/models/coremodel.d.ts:716
incrementAttribute()
incrementAttribute(
property
,value
):Promise
<void
>
Increment an attribute both in store and object
Parameters
• property: FilterAttributes
<Deployment
, number
>
• value: number
Returns
Promise
<void
>
Inherited from
CoreModel.incrementAttribute
Source
packages/core/lib/models/coremodel.d.ts:850
incrementAttributes()
incrementAttributes(
info
):Promise
<void
>
Increment a attributes both in store and object
Parameters
• info: Object
[]
Returns
Promise
<void
>
Inherited from
CoreModel.incrementAttributes
Source
packages/core/lib/models/coremodel.d.ts:860
isDirty()
isDirty():
boolean
Return true if needs a save
Returns
boolean
Inherited from
CoreModel.isDirty
Source
packages/core/lib/models/coremodel.d.ts:628
load()
load(
raw
,secure
?,relations
?):this
Load an object from RAW
Parameters
• raw: RawModel
<Deployment
>
data
• secure?: boolean
if false will ignore any _ variable
• relations?: boolean
Returns
this
Inherited from
CoreModel.load
Source
packages/core/lib/models/coremodel.d.ts:711
patch()
patch(
obj
,conditionField
?,conditionValue
?):Promise
<void
>
Patch current object with this update
Parameters
• obj: Partial
<Deployment
>
• conditionField?: keyof Deployment
if null no condition used otherwise fallback to lastUpdate
• conditionValue?: any
Returns
Promise
<void
>
Inherited from
CoreModel.patch
Source
packages/core/lib/models/coremodel.d.ts:754
refresh()
refresh():
Promise
<Deployment
>
Get the object again
Returns
Promise
<Deployment
>
Inherited from
CoreModel.refresh
Throws
Error if the object is not coming from a store
Source
packages/core/lib/models/coremodel.d.ts:741
removeAttribute()
removeAttribute(
property
):Promise
<void
>
Remove attribute from both the object and db
Parameters
• property: keyof Deployment
Returns
Promise
<void
>
Inherited from
CoreModel.removeAttribute
Source
packages/core/lib/models/coremodel.d.ts:844
save()
save(
full
?, ...args
?):Promise
<Deployment
>
Save this object
Parameters
• full?: boolean
| keyof Deployment
• ...args?: keyof Deployment
[]
Returns
Promise
<Deployment
>
Inherited from
CoreModel.save
Throws
Error if the object is not coming from a store
Source
packages/core/lib/models/coremodel.d.ts:760
setAttribute()
setAttribute(
property
,value
):Promise
<void
>
Set attribute on the object and database
Parameters
• property: keyof Deployment
• value: any
Returns
Promise
<void
>
Inherited from
CoreModel.setAttribute
Source
packages/core/lib/models/coremodel.d.ts:839
setContext()
setContext(
ctx
):this
Context of the request
Parameters
• ctx: OperationContext
<any
, any
>
Returns
this
Inherited from
CoreModel.setContext
Source
packages/core/lib/models/coremodel.d.ts:720
setUuid()
setUuid(
uuid
,target
?):this
Parameters
• uuid: string
• target?: this
Returns
this
Inherited from
CoreModel.setUuid
Source
packages/core/lib/models/coremodel.d.ts:639
toJSON()
toJSON():
any
Return the object without sensitive attributes
Returns
any
Object to serialize
Inherited from
CoreModel.toJSON
Source
packages/core/lib/models/coremodel.d.ts:803
toStoredJSON()
toStoredJSON(
stringify
?):any
Return the object to be serialized without the __store
Parameters
• stringify?: boolean
Returns
any
Inherited from
CoreModel.toStoredJSON
Source
packages/core/lib/models/coremodel.d.ts:781
unflat()
unflat<
T
>(split
?):T
Create subobject for a model
Useful for counters
Type parameters
• T
Parameters
• split?: string
Returns
T
Inherited from
CoreModel.unflat
Source
packages/core/lib/models/coremodel.d.ts:560
validate()
validate(
ctx
,updates
,ignoreRequired
?):Promise
<boolean
>
Validate objet modification
Parameters
• ctx: OperationContext
<any
, any
>
• updates: any
• ignoreRequired?: boolean
Returns
Promise
<boolean
>
Inherited from
CoreModel.validate
Source
packages/core/lib/models/coremodel.d.ts:767
addListener()
static
addListener<Key
>(event
,listener
):any
Type parameters
• Key extends keyof StoreEvents
Parameters
• event: Key
• listener: (...args
) => void
Returns
any
Inherited from
CoreModel.addListener
Source
packages/core/lib/models/coremodel.d.ts:466
authorizeClientEvent()
static
authorizeClientEvent(_event
,_context
,_model
?):boolean
Does not allow any event by default
Parameters
• _event: string
• _context: OperationContext
<any
, any
>
• _model?: CoreModel
Returns
boolean
Inherited from
CoreModel.authorizeClientEvent
Source
packages/core/lib/models/coremodel.d.ts:496
completeQuery()
static
protected
completeQuery(query
,includeSubclass
?):string
Complete the query with __type/__types
Parameters
• query: string
• includeSubclass?: boolean
Returns
string
Inherited from
CoreModel.completeQuery
Source
packages/core/lib/models/coremodel.d.ts:590
completeUid()
static
completeUid(uid
):string
Complete the uid with prefix if any
Useful when object are stored with a prefix for full uuid
Parameters
• uid: string
Returns
string
Inherited from
CoreModel.completeUid
Source
packages/core/lib/models/coremodel.d.ts:510
create()
static
create<T
>(this
,data
):Promise
<T
>
Get a reference to a model
Type parameters
• T extends CoreModel
Parameters
• this: Constructor
<T
, []>
• data: RawModel
<T
>
Returns
Promise
<T
>
Inherited from
CoreModel.create
Source
packages/core/lib/models/coremodel.d.ts:529
emit()
static
emit<T
,Key
>(this
,event
,evt
):void
Emit an event for this class
Type parameters
• T extends CoreModel
• Key extends keyof StoreEvents
Parameters
• this: Constructor
<T
, []>
• event: Key
• evt: StoreEvents
[Key
]
Returns
void
Inherited from
CoreModel.emit
Source
packages/core/lib/models/coremodel.d.ts:446
emitSync()
static
emitSync<T
,Key
>(this
,event
,evt
):Promise
<void
>
Emit an event for this class and wait for all listeners to finish
Type parameters
• T extends CoreModel
• Key extends keyof StoreEvents
Parameters
• this: Constructor
<T
, []>
• event: Key
• evt: StoreEvents
[Key
]
Returns
Promise
<void
>
Inherited from
CoreModel.emitSync
Source
packages/core/lib/models/coremodel.d.ts:453
emitter()
static
emitter(method
, ...args
):any
Parameters
• method: any
• ...args: any
[]
Returns
any
Inherited from
CoreModel.emitter
Source
packages/core/lib/models/coremodel.d.ts:467
eventNames()
static
eventNames(...args
):any
Parameters
• ...args: any
[]
Returns
any
Inherited from
CoreModel.eventNames
Source
packages/core/lib/models/coremodel.d.ts:479
factory()
static
factory<T
>(this
,object
,context
?):T
Create an object
Type parameters
• T extends CoreModel
Parameters
• this: Constructor
<T
, []>
• object: Partial
<T
>
• context?: OperationContext
<any
, any
>
Returns
T
Inherited from
CoreModel.factory
Source
packages/core/lib/models/coremodel.d.ts:670
flat()
static
flat(target
,data
,split
?,prefix
?):any
Flat an object into another
{ a: { b: 1 }, c: 1 }
become
{ "a#b": 1 "c": 1 }
Parameters
• target: any
• data: any
• split?: string
• prefix?: string
Returns
any
Inherited from
CoreModel.flat