docs: generate references for v2.3.0 (#11035)
This commit is contained in:
1 parent
2f7ec55f2e
commit
45847fef19
538 files changed
+304288
-199194
No files matched your search
+8
-23
@@ -16,29 +16,14 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/f
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
createRemoteLinkStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
import {
|
||||
Modules
|
||||
} from "@medusajs/framework/utils"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
createRemoteLinkStep([{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_123",
|
||||
},
|
||||
"helloModuleService": {
|
||||
my_custom_id: "mc_123",
|
||||
},
|
||||
}])
|
||||
}
|
||||
)
|
||||
createRemoteLinkStep([{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_123",
|
||||
},
|
||||
"helloModuleService": {
|
||||
my_custom_id: "mc_123",
|
||||
},
|
||||
}])
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
+8
-23
@@ -16,29 +16,14 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/f
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
dismissRemoteLinkStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
import {
|
||||
Modules
|
||||
} from "@medusajs/framework/utils"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
dismissRemoteLinkStep([{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_123",
|
||||
},
|
||||
"helloModuleService": {
|
||||
my_custom_id: "mc_123",
|
||||
},
|
||||
}])
|
||||
}
|
||||
)
|
||||
dismissRemoteLinkStep([{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_123",
|
||||
},
|
||||
"helloModuleService": {
|
||||
my_custom_id: "mc_123",
|
||||
},
|
||||
}])
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
+5
-17
@@ -14,24 +14,12 @@ Emit an event.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
emitEventStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
emitEventStep({
|
||||
eventName: "custom.created",
|
||||
data: {
|
||||
id: "123"
|
||||
}
|
||||
})
|
||||
emitEventStep({
|
||||
eventName: "custom.created",
|
||||
data: {
|
||||
id: "123"
|
||||
}
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
+5
-20
@@ -16,26 +16,11 @@ Learn more in the [Remote Link documentation](https://docs.medusajs.com/learn/fu
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
removeRemoteLinkStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
import {
|
||||
Modules
|
||||
} from "@medusajs/framework/utils"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
removeRemoteLinkStep([{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_123",
|
||||
},
|
||||
}])
|
||||
}
|
||||
)
|
||||
removeRemoteLinkStep([{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_123",
|
||||
},
|
||||
}])
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
+20
-11
@@ -9,20 +9,29 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `updateRemoteLinksStep` step. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
```ts title="src/workflows/my-workflow.ts"
|
||||
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||
import { updateRemoteLinksStep } from "@medusajs/medusa/core-flows"
|
||||
This step updates remote links between two records of linked data models.
|
||||
|
||||
const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = updateRemoteLinksStep([
|
||||
{}
|
||||
])
|
||||
Learn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/fundamentals/module-links/remote-link#create-link).
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const data = updateRemoteLinksStep([
|
||||
{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_321",
|
||||
},
|
||||
"helloModuleService": {
|
||||
my_custom_id: "mc_321",
|
||||
},
|
||||
data: {
|
||||
metadata: {
|
||||
test: false
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
])
|
||||
```
|
||||
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+7
-19
@@ -18,25 +18,13 @@ Learn more in the [Query documentation](https://docs.medusajs.com/learn/fundamen
|
||||
To retrieve a list of records of a data model:
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
useQueryGraphStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
const { data: products } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
]
|
||||
})
|
||||
}
|
||||
)
|
||||
const { data: products } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
To retrieve a single item instead of a an array:
|
||||
|
||||
+34
-70
@@ -24,86 +24,50 @@ This step is deprecated. Use [useQueryGraphStep](../helper_steps.useQueryGraphSt
|
||||
To retrieve a list of records of a data model:
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
useRemoteQueryStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
const products = useRemoteQueryStep({
|
||||
entry_point: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
]
|
||||
})
|
||||
}
|
||||
)
|
||||
const products = useRemoteQueryStep({
|
||||
entry_point: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
To retrieve a single item instead of a an array:
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
useRemoteQueryStep
|
||||
} from "@medusajs/core-flows"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
const product = useRemoteQueryStep({
|
||||
entry_point: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
],
|
||||
variables: {
|
||||
filters: {
|
||||
id: "123"
|
||||
}
|
||||
},
|
||||
list: false
|
||||
})
|
||||
}
|
||||
)
|
||||
const product = useRemoteQueryStep({
|
||||
entry_point: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
],
|
||||
variables: {
|
||||
filters: {
|
||||
id: "123"
|
||||
}
|
||||
},
|
||||
list: false
|
||||
})
|
||||
```
|
||||
|
||||
To throw an error if a record isn't found matching the specified ID:
|
||||
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
useRemoteQueryStep
|
||||
} from "@medusajs/core-flows"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
const product = useRemoteQueryStep({
|
||||
entry_point: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
],
|
||||
variables: {
|
||||
filters: {
|
||||
id: "123"
|
||||
}
|
||||
},
|
||||
list: false,
|
||||
throw_if_key_not_found: true
|
||||
})
|
||||
}
|
||||
)
|
||||
const product = useRemoteQueryStep({
|
||||
entry_point: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
],
|
||||
variables: {
|
||||
filters: {
|
||||
id: "123"
|
||||
}
|
||||
},
|
||||
list: false,
|
||||
throw_if_key_not_found: true
|
||||
})
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
Reference in new issue
Block a user