Optional
defaultOptional
defaultOptional
defaultOptional
defaultOptional
deleteOptional
filesOptional
handleOptional
insertOptional
linkOptional
linksOptional
localOptional
namespaceOptional
remoteOptional
returningOptional
selectOptional
selectorsOptional
tableOptional
tokenOptional
unsafeOptional
updateOptional
valuesStatic
Optional
resolveId of a link which is processed by a handler
An object with options for the await operation
A promise that resolves to the result of the awaited promise
Checks whether subjectUds can perform actionIds on objectIds
A link id or an array of link ids to check whether the subjectUds can perform the actionIds on
A link id or an array of link ids to check whether they can perform the actionIds on the objectIds
A link id or an array of link ids to check whether the subjectUds can perform on the objectIds
A link id or an array of link ids from which perspective the check is performed
A promise that resolves to a boolean value indicating whether the subjectUds can perform the actionIds on the objectIds
Deletes a value in the database. By default deletes a link in the links table
An expression to filter the objects to delete
Optional
options: WriteOptions<TTable>An object with options for the delete operation
A promise that resolves to the deleted object or an array of deleted objects with the fields configured by options.returning which is by default 'id'
await deep.delete({
id: 888
})
In this case the link with id 888 will be deleted
await deep.delete({
type_id: 888
})
In this case all the links with type_id 888 will be deleted
await deep.delete({
from_id: 888
})
In this case all the links with from_id 888 will be deleted
await deep.delete({
to_id: 888
})
In this case all the links with to_id 888 will be deleted
await deep.delete({
string: {
value: {
_eq: 'MyString'
}
}
})
In this case all the links with string value 'MyString' will be deleted
await deep.delete({
number: {
value: {
_eq: 888
}
}
})
In this case all the links with number value 888 will be deleted
await deep.delete({
object: {
value: {
_eq: {
myFieldKey: "myFieldValue"
}
}
}
})
In this case all the links with object value { myFieldName: "myFieldValue" } will be deleted
await deep.delete({
link_id: 888
}, {
table: 'strings'
})
In this case string value of a link with id 888 will be deleted
await deep.delete({
link_id: 888
}, {
table: 'numbers'
})
In this case number value of a link with id 888 will be deleted
await deep.delete({
link_id: 888
}, {
table: 'objects'
})
In this case object value of a link with id 888 will be deleted
Logs in as a guest
An object with options for the guest login operation
A promise that resolves to the result of the guest login operation
Find id of a link by link name or id and contain values (names) as path items
A name or id of a link
Rest
...path: DeepClientPathItem[]Contain values (names) as path items
A promise that resolves to the id of the link
const corePackageLinkId = await deep.id("@deep-foundation/core")
const userTypeLinkId = await deep.id("@deep-foundation/core", "User")
const myLinkId = await deep.id(deep.linkId, 'My Link Name', 'My Nested Link Name')
const adminLinkId = await deep.id("deep", "admin")
Find id of a link from minilinks by link name or id and contain values (names) as path items
A name or id of a link
Rest
...path: DeepClientPathItem[]Contain values (names) as path items
A promise that resolves to the id of the link
const corePackageLinkId = deep.idLocal("@deep-foundation/core")
const userTypeLinkId = deep.idLocal("@deep-foundation/core", "User")
const myLinkId = deep.idLocal(deep.linkId, 'My Link Name', 'My Nested Link Name')
const adminLinkId = deep.idLocal("deep", "admin")
This function fetches the corresponding IDs from the Deep for each specified path.
Rest
...paths: [DeepClientStartItem, ...DeepClientPathItem[]][]An array of [start, ...path] tuples. Each tuple specifies a path to a link, where 'start' is the package name or id and ...path further specifies the path to the id using Contain link values (names).
ids
Will throw an error if the id retrieval fails in this.id()
function.
const ids = await deep.ids([
['@deep-foundation/core', 'Package'],
['@deep-foundation/core', 'PackageVersion']
]);
// Outputs
// {
// "@deep-foundation/core": {
// "Package": 2,
// "PackageVersion": 46
// }
// }
deep.subscribe
Optional
options: WriteOptions<TTable>Performs a login operation
An object with options for the login operation
A promsie that resolves to the result of the login operation
const apolloClient = generateApolloClient({
path: NEXT_PUBLIC_GQL_PATH,
ssl: true,
});
const unloginedDeep = new DeepClient({ apolloClient });
const guestLoginResult = await unloginedDeep.guest();
const guestDeep = new DeepClient({ deep: unloginedDeep, ...guestLoginResult });
const adminLoginResult = await guestDeep.login({
linkId: await guestDeep.id('deep', 'admin'),
});
const deep = new DeepClient({ deep: guestDeep, ...adminLoginResult });
Performs a logout operation
A promsie that resolves to the result of the logout operation
Gets a value from the database. By default gets a link from the links table
A filter expression to filter the objects to get
Optional
options: ReadOptions<TTable>An object with options for the select operation
A promise that resolves to the selected object or an array of selected objects with the fields configured by options.returning which is by default 'id'
await deep.select({
id: deep.linkId
})
await deep.select({
type_id: {
_id: ["@deep-foundation/core", "User"]
}
})
await deep.select({
from_id: deep.linkId
})
await deep.select({
to_id: deep.linkId
})
await deep.select({
string: {
value: {
_eq: "MyString"
}
}
})
await deep.select({
number: {
value: {
_eq: 888
}
}
})
await deep.select({
object: {
value: {
_eq: {
myFieldKey: "myFieldValue"
}
}
}
})
Performs write operations to the database in a serial manner
An object with data for the serial operation
A promise that resolves to the deleted object or an array of deleted objects with the fields configured by options.returning which is by default 'id'
Subscribes to data in the database
Optional
options: ReadOptions<TTable>Updates a value in the database. By default updates a link in the links table
An expression to filter the objects to update
A value to update the objects with
Optional
options: WriteOptions<TTable>An object with options for the update operation
A promise that resolves to the updated object or an array of updated objects with the fields configured by options.returning which is by default 'id'
await deep.update({
id: 888
}, {
from_id: 1
})
In this case from_id will be updated to 1 for link with id 888
await deep.update({
id: 888
}, {
to_id: 1
})
In this case to_id will be updated to 1 for link with id 888
await deep.update(
{
link_id: 888
},
{
value: "MyStringValue"
},
{
table: 'strings'
}
)
In this case string value will be updated to "MyStringValue" for link with id 888
await deep.update(
{
link_id: 888
},
{
value: 888
},
{
table: 'numbers'
}
)
In this case number value will be updated to 888 for link with id 888
await deep.update(
{
link_id: 888
},
{
value: {
myFieldName: "myFieldValue"
}
},
{
table: 'numbers'
}
)
In this case number value will be updated to { myFieldName: "myFieldValue" } for link with id 888
Await for a promise