directus-monorepo ( Readme | API )
directus-monorepo > VersionsService
new VersionsService(
options
):VersionsService
Parameter | Type |
---|---|
options |
AbstractServiceOptions |
api/src/services/versions.ts:21
accountability:
any
authorizationService:
AuthorizationService
api/src/services/versions.ts:19
cache:
null
|Keyv
<any
,Record
<string
,unknown
> >
collection:
string
eventScope:
string
knex:
Knex
<any
,any
[] >
schema:
SchemaOverview
createMany(
data
,opts
?):Promise
<PrimaryKey
[] >
Create multiple new items at once. Inserts all provided records sequentially wrapped in a transaction.
Parameter | Type |
---|---|
data |
Item [] |
opts ? |
MutationOptions |
Promise
< PrimaryKey
[] >
api/src/services/versions.ts:141
createMutationTracker(
initialCount
=0
):MutationTracker
Parameter | Type | Default value |
---|---|---|
initialCount |
number |
0 |
ItemsService
.createMutationTracker
createOne(
data
,opts
?):Promise
<PrimaryKey
>
Create a single new item.
Parameter | Type |
---|---|
data |
Item |
opts ? |
MutationOptions |
Promise
< PrimaryKey
>
api/src/services/versions.ts:131
deleteByQuery(
query
,opts
?):Promise
<PrimaryKey
[] >
Delete multiple items by query
Parameter | Type |
---|---|
query |
Query |
opts ? |
MutationOptions |
Promise
< PrimaryKey
[] >
deleteMany(
keys
,opts
={}
):Promise
<PrimaryKey
[] >
Delete multiple items by primary key
Parameter | Type |
---|---|
keys |
PrimaryKey [] |
opts |
MutationOptions |
Promise
< PrimaryKey
[] >
deleteOne(
key
,opts
?):Promise
<PrimaryKey
>
Delete a single item by primary key
Parameter | Type |
---|---|
key |
PrimaryKey |
opts ? |
MutationOptions |
Promise
< PrimaryKey
>
getKeysByQuery(
query
):Promise
<PrimaryKey
[] >
Parameter | Type |
---|---|
query |
Query |
Promise
< PrimaryKey
[] >
getMainItem(
collection
,item
,query
?):Promise
<Item
>
Parameter | Type |
---|---|
collection |
string |
item |
PrimaryKey |
query ? |
any |
Promise
< Item
>
api/src/services/versions.ts:74
getVersionSaves(
key
,collection
,item
):Promise
<null
|Item
[] >
Parameter | Type |
---|---|
key |
string |
collection |
string |
item |
undefined | string |
Promise
< null
| Item
[] >
api/src/services/versions.ts:112
getVersionSavesById(
id
):Promise
<Item
[] >
Parameter | Type |
---|---|
id |
PrimaryKey |
Promise
< Item
[] >
api/src/services/versions.ts:99
promote(
version
,mainHash
,fields
?):Promise
<PrimaryKey
>
Parameter | Type |
---|---|
version |
PrimaryKey |
mainHash |
string |
fields ? |
string [] |
Promise
< PrimaryKey
>
api/src/services/versions.ts:263
readByQuery(
query
,opts
?):Promise
<Item
[] >
Get items by query
Parameter | Type |
---|---|
query |
Query |
opts ? |
QueryOptions |
Promise
< Item
[] >
readMany(
keys
,query
={}
,opts
?):Promise
<Item
[] >
Get multiple items by primary keys
Parameter | Type |
---|---|
keys |
PrimaryKey [] |
query |
Query |
opts ? |
QueryOptions |
Promise
< Item
[] >
readOne(
key
,query
={}
,opts
?):Promise
<Item
>
Get single item by primary key
Parameter | Type |
---|---|
key |
PrimaryKey |
query |
Query |
opts ? |
QueryOptions |
Promise
< Item
>
readSingleton(
query
,opts
?):Promise
<Partial
<Item
> >
Read/treat collection as singleton
Parameter | Type |
---|---|
query |
Query |
opts ? |
QueryOptions |
Promise
< Partial
< Item
> >
save(
key
,data
):Promise
<Item
>
Parameter | Type |
---|---|
key |
PrimaryKey |
data |
Item |
Promise
< Item
>
api/src/services/versions.ts:214
updateBatch(
data
,opts
={}
):Promise
<PrimaryKey
[] >
Update multiple items in a single transaction
Parameter | Type |
---|---|
data |
Partial < Item >[] |
opts |
MutationOptions |
Promise
< PrimaryKey
[] >
updateByQuery(
query
,data
,opts
?):Promise
<PrimaryKey
[] >
Update multiple items by query
Parameter | Type |
---|---|
query |
Query |
data |
Partial < Item > |
opts ? |
MutationOptions |
Promise
< PrimaryKey
[] >
updateMany(
keys
,data
,opts
?):Promise
<PrimaryKey
[] >
Update many items by primary key, setting all items to the same change
Parameter | Type |
---|---|
keys |
PrimaryKey [] |
data |
Item |
opts ? |
MutationOptions |
Promise
< PrimaryKey
[] >
api/src/services/versions.ts:169
updateOne(
key
,data
,opts
?):Promise
<PrimaryKey
>
Update a single item by primary key
Parameter | Type |
---|---|
key |
PrimaryKey |
data |
Partial < Item > |
opts ? |
MutationOptions |
Promise
< PrimaryKey
>
upsertMany(
payloads
,opts
={}
):Promise
<PrimaryKey
[] >
Upsert many items
Parameter | Type |
---|---|
payloads |
Partial < Item >[] |
opts |
MutationOptions |
Promise
< PrimaryKey
[] >
upsertOne(
payload
,opts
?):Promise
<PrimaryKey
>
Upsert a single item
Parameter | Type |
---|---|
payload |
Partial < Item > |
opts ? |
MutationOptions |
Promise
< PrimaryKey
>
upsertSingleton(
data
,opts
?):Promise
<PrimaryKey
>
Upsert/treat collection as singleton
Parameter | Type |
---|---|
data |
Partial < Item > |
opts ? |
MutationOptions |
Promise
< PrimaryKey
>
api/src/services/items.ts:1018
private
validateCreateData(data
):Promise
<void
>
Parameter | Type |
---|---|
data |
Item |
Promise
< void
>
api/src/services/versions.ts:31
verifyHash(
collection
,item
,hash
):Promise
< {mainHash
:string
;outdated
:boolean
;} >
Parameter | Type |
---|---|
collection |
string |
item |
PrimaryKey |
hash |
string |
Promise
< {mainHash
: string
; outdated
: boolean
;} >
api/src/services/versions.ts:87
Generated using TypeDoc and typedoc-plugin-markdown