docs: added workflow hooks docs + changed workflow response (#8364)

* docs: added workflow hooks docs + changed workflow response

* Update page.mdx
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-07-31 17:01:33 +03:00
1 parent 27837b8833
commit 6f973d9f2b
29 files changed
+321 -167

No files matched your search

@@ -17,8 +17,8 @@ const post = await postModuleService.createPosts({
name: "My Post",
published_at: new Date(),
metadata: {
external_id: "1234"
}
external_id: "1234",
},
})
```
@@ -32,12 +32,12 @@ If an object is passed of the method, an object of the created record is also re
const posts = await postModuleService.createPosts([
{
name: "My Post",
published_at: new Date()
published_at: new Date(),
},
{
name: "My Other Post",
published_at: new Date()
}
published_at: new Date(),
},
])
```
@@ -25,7 +25,7 @@ To delete one record, pass its ID as a parameter of the method.
```ts
await postModuleService.deletePosts([
"123",
"321"
"321",
])
```
@@ -37,7 +37,7 @@ To delete multiple records, pass an array of IDs as a parameter of the method.
```ts
await postModuleService.deletePosts({
name: "My Post"
name: "My Post",
})
```
@@ -24,7 +24,7 @@ If no parameters are passed, the method returns an array of the first `15` recor
```ts
const posts = await postModuleService.listPosts({
id: ["123", "321"]
id: ["123", "321"],
})
```
@@ -54,7 +54,7 @@ This applies to relations between data models of the same module. To retrieve li
```ts
const posts = await postModuleService.listPosts({}, {
relations: ["author"]
relations: ["author"],
})
```
@@ -72,7 +72,7 @@ The method returns an array of the first `15` records matching the filters.
```ts
const posts = await postModuleService.listPosts({}, {
select: ["id", "name"]
select: ["id", "name"],
})
```
@@ -93,7 +93,7 @@ The method returns an array of the first `15` records matching the filters.
```ts
const posts = await postModuleService.listPosts({}, {
take: 20,
skip: 10
skip: 10,
})
```
@@ -115,8 +115,8 @@ The method returns an array of records. The number of records is less than or eq
```ts
const posts = await postModuleService.listPosts({}, {
order: {
name: "ASC"
}
name: "ASC",
},
})
```
@@ -27,7 +27,7 @@ If no parameters are passed, the method returns an array with two items:
```ts
const [posts, count] = await postModuleService.listAndCountPosts({
id: ["123", "321"]
id: ["123", "321"],
})
```
@@ -60,7 +60,7 @@ This applies to relations between data models of the same module. To retrieve li
```ts
const [posts, count] = await postModuleService.listAndCountPosts({}, {
relations: ["author"]
relations: ["author"],
})
```
@@ -81,7 +81,7 @@ The method returns an array with two items:
```ts
const [posts, count] = await postModuleService.listAndCountPosts({}, {
select: ["id", "name"]
select: ["id", "name"],
})
```
@@ -105,7 +105,7 @@ The method returns an array with two items:
```ts
const [posts, count] = await postModuleService.listAndCountPosts({}, {
take: 20,
skip: 10
skip: 10,
})
```
@@ -130,8 +130,8 @@ The method returns an array with two items:
```ts
const [posts, count] = await postModuleService.listAndCountPosts({}, {
order: {
name: "ASC"
}
name: "ASC",
},
})
```
@@ -28,7 +28,7 @@ For example, the returned object of the above example is:
```ts
restoredPosts = {
post_id: ["123"]
post_id: ["123"],
}
```
@@ -39,7 +39,7 @@ restoredPosts = {
```ts
const restoredPosts = await postModuleService.restorePosts([
"123",
"321"
"321",
])
```
@@ -57,8 +57,8 @@ For example, the returned object of the above example is:
restoredPosts = {
post_id: [
"123",
"321"
]
"321",
],
}
```
@@ -68,7 +68,7 @@ restoredPosts = {
```ts
const restoredPosts = await postModuleService.restorePosts({
name: "My Post"
name: "My Post",
})
```
@@ -91,7 +91,7 @@ For example, the returned object of the above example is:
```ts
restoredPosts = {
post_id: [
"123"
]
"123",
],
}
```
@@ -36,7 +36,7 @@ This applies to relations between data models of the same module. To retrieve li
```ts
const post = await postModuleService.retrievePost("123", {
relations: ["author"]
relations: ["author"],
})
```
@@ -54,7 +54,7 @@ The method returns the record as an object.
```ts
const post = await postModuleService.retrievePost("123", {
select: ["id", "name"]
select: ["id", "name"],
})
```
@@ -30,7 +30,7 @@ For example, the returned object of the above example is:
```ts
deletedPosts = {
post_id: ["123"]
post_id: ["123"],
}
```
@@ -41,7 +41,7 @@ deletedPosts = {
```ts
const deletedPosts = await postModuleService.softDeletePosts([
"123",
"321"
"321",
])
```
@@ -59,8 +59,8 @@ For example, the returned object of the above example is:
deletedPosts = {
post_id: [
"123",
"321"
]
"321",
],
}
```
@@ -70,7 +70,7 @@ deletedPosts = {
```ts
const deletedPosts = await postModuleService.softDeletePosts({
name: "My Post"
name: "My Post",
})
```
@@ -92,6 +92,6 @@ For example, the returned object of the above example is:
```ts
deletedPosts = {
post_id: ["123"]
post_id: ["123"],
}
```
@@ -15,7 +15,7 @@ This method updates one or more records of the data model.
```ts
const post = await postModuleService.updatePosts({
id: "123",
name: "My Post"
name: "My Post",
})
```
@@ -37,12 +37,12 @@ The method returns the updated record as an object.
const posts = await postModuleService.updatePosts([
{
id: "123",
name: "My Post"
name: "My Post",
},
{
id: "321",
published_at: new Date()
}
published_at: new Date(),
},
])
```
@@ -63,11 +63,11 @@ The method returns an array of objects of updated records.
```ts
const posts = await postModuleService.updatePosts({
selector: {
name: "My Post"
name: "My Post",
},
data: {
published_at: new Date()
}
published_at: new Date(),
},
})
```
@@ -98,22 +98,22 @@ The method returns an array of objects of updated records.
const posts = await postModuleService.updatePosts([
{
selector: {
name: "My Post"
name: "My Post",
},
data: {
published_at: new Date()
}
published_at: new Date(),
},
},
{
selector: {
name: "Another Post"
name: "Another Post",
},
data: {
metadata: {
external_id: "123"
}
}
}
external_id: "123",
},
},
},
])
```