motia 0.5.11-beta.120-559255 → 0.5.11-beta.120-568724
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/create/templates/python/motia-workbench.json +1 -1
- package/dist/cjs/create/templates/python/steps/api_step.py.txt +8 -8
- package/dist/cjs/create/templates/python/steps/notification_step.py.txt +3 -3
- package/dist/cjs/create/templates/python/steps/process_food_order_step.py.txt +5 -5
- package/dist/cjs/create/templates/python/steps/services/pet_store.py.txt +1 -1
- package/dist/cjs/create/templates/python/steps/state_audit_cron_step.py.txt +4 -4
- package/dist/cjs/create/templates/python/tutorial.tsx.txt +16 -17
- package/dist/cjs/create/templates/typescript/tutorial.tsx.txt +1 -2
- package/dist/esm/create/templates/python/motia-workbench.json +1 -1
- package/dist/esm/create/templates/python/steps/api_step.py.txt +8 -8
- package/dist/esm/create/templates/python/steps/notification_step.py.txt +3 -3
- package/dist/esm/create/templates/python/steps/process_food_order_step.py.txt +5 -5
- package/dist/esm/create/templates/python/steps/services/pet_store.py.txt +1 -1
- package/dist/esm/create/templates/python/steps/state_audit_cron_step.py.txt +4 -4
- package/dist/esm/create/templates/python/tutorial.tsx.txt +16 -17
- package/dist/esm/create/templates/typescript/tutorial.tsx.txt +1 -2
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ from .services.types import Pet
|
|
|
5
5
|
|
|
6
6
|
class PetRequest(BaseModel):
|
|
7
7
|
name: str
|
|
8
|
-
|
|
8
|
+
photoUrl: str
|
|
9
9
|
|
|
10
10
|
class FoodOrder(BaseModel):
|
|
11
11
|
id: str
|
|
@@ -13,20 +13,20 @@ class FoodOrder(BaseModel):
|
|
|
13
13
|
|
|
14
14
|
class RequestBody(BaseModel):
|
|
15
15
|
pet: PetRequest
|
|
16
|
-
|
|
16
|
+
foodOrder: Optional[FoodOrder] = None
|
|
17
17
|
|
|
18
18
|
config = {
|
|
19
19
|
"type": "api",
|
|
20
|
-
"name": "
|
|
20
|
+
"name": "ApiTrigger",
|
|
21
21
|
"description": "basic-tutorial api trigger",
|
|
22
|
-
"flows": ["
|
|
22
|
+
"flows": ["basic-tutorial"],
|
|
23
23
|
"method": "POST",
|
|
24
|
-
"path": "/
|
|
24
|
+
"path": "/basic-tutorial",
|
|
25
25
|
"bodySchema": RequestBody.model_json_schema(),
|
|
26
26
|
"responseSchema": {
|
|
27
27
|
200: Pet.model_json_schema(),
|
|
28
28
|
},
|
|
29
|
-
"emits": ["
|
|
29
|
+
"emits": ["process-food-order"],
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
async def handler(req, context):
|
|
@@ -34,13 +34,13 @@ async def handler(req, context):
|
|
|
34
34
|
context.logger.info("Step 01 – Processing API Step", {"body": body})
|
|
35
35
|
|
|
36
36
|
pet = body.get("pet", {})
|
|
37
|
-
food_order = body.get("
|
|
37
|
+
food_order = body.get("foodOrder", {})
|
|
38
38
|
|
|
39
39
|
new_pet_record = await pet_store_service.create_pet(pet)
|
|
40
40
|
|
|
41
41
|
if food_order:
|
|
42
42
|
await context.emit({
|
|
43
|
-
"topic": "
|
|
43
|
+
"topic": "process-food-order",
|
|
44
44
|
"data": {
|
|
45
45
|
"id": food_order.get("id"),
|
|
46
46
|
"quantity": food_order.get("quantity"),
|
|
@@ -9,10 +9,10 @@ class InputSchema(BaseModel):
|
|
|
9
9
|
|
|
10
10
|
config = {
|
|
11
11
|
"type": "event",
|
|
12
|
-
"name": "
|
|
12
|
+
"name": "Notification",
|
|
13
13
|
"description": "Checks a state change",
|
|
14
|
-
"flows": ["
|
|
15
|
-
"subscribes": ["
|
|
14
|
+
"flows": ["basic-tutorial"],
|
|
15
|
+
"subscribes": ["notification"],
|
|
16
16
|
"emits": [],
|
|
17
17
|
"input": InputSchema.model_json_schema(),
|
|
18
18
|
}
|
|
@@ -10,11 +10,11 @@ class InputSchema(BaseModel):
|
|
|
10
10
|
|
|
11
11
|
config = {
|
|
12
12
|
"type": "event",
|
|
13
|
-
"name": "
|
|
13
|
+
"name": "ProcessFoodOrder",
|
|
14
14
|
"description": "basic-tutorial event step, demonstrates how to consume an event from a topic and persist data in state",
|
|
15
|
-
"flows": ["
|
|
16
|
-
"subscribes": ["
|
|
17
|
-
"emits": ["
|
|
15
|
+
"flows": ["basic-tutorial"],
|
|
16
|
+
"subscribes": ["process-food-order"],
|
|
17
|
+
"emits": ["notification"],
|
|
18
18
|
"input": InputSchema.model_json_schema(),
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ async def handler(input_data, context):
|
|
|
35
35
|
await context.state.set("orders_python", order.get("id"), order)
|
|
36
36
|
|
|
37
37
|
await context.emit({
|
|
38
|
-
"topic": "
|
|
38
|
+
"topic": "notification",
|
|
39
39
|
"data": {
|
|
40
40
|
"email": input_data["email"],
|
|
41
41
|
"template_id": "new-order",
|
|
@@ -3,10 +3,10 @@ from datetime import datetime, timezone
|
|
|
3
3
|
config = {
|
|
4
4
|
"type": "cron",
|
|
5
5
|
"cron": "*/5 * * * *", # run every 5 minutes
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "StateAuditJob",
|
|
7
7
|
"description": "Checks the state for orders that are not complete and have a ship date in the past",
|
|
8
|
-
"emits": ["
|
|
9
|
-
"flows": ["
|
|
8
|
+
"emits": ["notification"],
|
|
9
|
+
"flows": ["basic-tutorial"],
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
async def handler(context):
|
|
@@ -25,7 +25,7 @@ async def handler(context):
|
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
await context.emit({
|
|
28
|
-
"topic": "
|
|
28
|
+
"topic": "notification",
|
|
29
29
|
"data": {
|
|
30
30
|
"email": "test@test.com",
|
|
31
31
|
"template_id": "order-audit-warning",
|
|
@@ -27,7 +27,7 @@ export const steps: TutorialStep[] = [
|
|
|
27
27
|
// Flows
|
|
28
28
|
|
|
29
29
|
{
|
|
30
|
-
elementXpath: workbenchXPath.flows.node('
|
|
30
|
+
elementXpath: workbenchXPath.flows.node('apitrigger'),
|
|
31
31
|
title: 'API Step',
|
|
32
32
|
link: 'https://www.motia.dev/docs/concepts/steps/api',
|
|
33
33
|
description: () => (
|
|
@@ -38,11 +38,11 @@ export const steps: TutorialStep[] = [
|
|
|
38
38
|
),
|
|
39
39
|
before: [
|
|
40
40
|
{ type: 'click', selector: workbenchXPath.links.flows },
|
|
41
|
-
{ type: 'click', selector: workbenchXPath.flows.dropdownFlow('
|
|
41
|
+
{ type: 'click', selector: workbenchXPath.flows.dropdownFlow('basic-tutorial') },
|
|
42
42
|
],
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
elementXpath: workbenchXPath.flows.previewButton('
|
|
45
|
+
elementXpath: workbenchXPath.flows.previewButton('apitrigger'),
|
|
46
46
|
title: 'Code Preview',
|
|
47
47
|
description: () => <p>Clicking on this icon will allow you to visualize the source code for a given Step.</p>,
|
|
48
48
|
before: [
|
|
@@ -59,8 +59,7 @@ export const steps: TutorialStep[] = [
|
|
|
59
59
|
description: () => (
|
|
60
60
|
<div>
|
|
61
61
|
<p>
|
|
62
|
-
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b
|
|
63
|
-
the programming language).
|
|
62
|
+
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b>.
|
|
64
63
|
<br />
|
|
65
64
|
<br />
|
|
66
65
|
Let's start with the configuration, the common config attributes are
|
|
@@ -82,7 +81,7 @@ export const steps: TutorialStep[] = [
|
|
|
82
81
|
</div>
|
|
83
82
|
),
|
|
84
83
|
before: [
|
|
85
|
-
{ type: 'click', selector: workbenchXPath.flows.previewButton('
|
|
84
|
+
{ type: 'click', selector: workbenchXPath.flows.previewButton('apitrigger') },
|
|
86
85
|
{ type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
|
|
87
86
|
],
|
|
88
87
|
},
|
|
@@ -196,7 +195,7 @@ export const steps: TutorialStep[] = [
|
|
|
196
195
|
// Event Steps
|
|
197
196
|
|
|
198
197
|
{
|
|
199
|
-
elementXpath: workbenchXPath.flows.node('
|
|
198
|
+
elementXpath: workbenchXPath.flows.node('processfoodorder'),
|
|
200
199
|
title: 'Event Step',
|
|
201
200
|
link: 'https://www.motia.dev/docs/concepts/steps/event',
|
|
202
201
|
description: () => (
|
|
@@ -230,7 +229,7 @@ export const steps: TutorialStep[] = [
|
|
|
230
229
|
</p>
|
|
231
230
|
),
|
|
232
231
|
before: [
|
|
233
|
-
{ type: 'click', selector: workbenchXPath.flows.previewButton('
|
|
232
|
+
{ type: 'click', selector: workbenchXPath.flows.previewButton('processfoodorder') },
|
|
234
233
|
{ type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
|
|
235
234
|
],
|
|
236
235
|
},
|
|
@@ -290,7 +289,7 @@ export const steps: TutorialStep[] = [
|
|
|
290
289
|
// Cron Steps
|
|
291
290
|
|
|
292
291
|
{
|
|
293
|
-
elementXpath: workbenchXPath.flows.node('
|
|
292
|
+
elementXpath: workbenchXPath.flows.node('stateauditjob'),
|
|
294
293
|
title: 'Cron Step',
|
|
295
294
|
link: 'https://www.motia.dev/docs/concepts/steps/cron',
|
|
296
295
|
description: () => (
|
|
@@ -323,7 +322,7 @@ export const steps: TutorialStep[] = [
|
|
|
323
322
|
</p>
|
|
324
323
|
),
|
|
325
324
|
before: [
|
|
326
|
-
{ type: 'click', selector: workbenchXPath.flows.previewButton('
|
|
325
|
+
{ type: 'click', selector: workbenchXPath.flows.previewButton('stateauditjob') },
|
|
327
326
|
{ type: 'click', selector: workbenchXPath.flows.feature('cron-configuration') },
|
|
328
327
|
],
|
|
329
328
|
},
|
|
@@ -362,7 +361,7 @@ export const steps: TutorialStep[] = [
|
|
|
362
361
|
before: [{ type: 'click', selector: workbenchXPath.closePanelButton }],
|
|
363
362
|
},
|
|
364
363
|
{
|
|
365
|
-
elementXpath: workbenchXPath.endpoints.endpoint('POST', '/
|
|
364
|
+
elementXpath: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial'),
|
|
366
365
|
title: 'Endpoints Tool',
|
|
367
366
|
description: () => (
|
|
368
367
|
<p>
|
|
@@ -388,7 +387,7 @@ export const steps: TutorialStep[] = [
|
|
|
388
387
|
endpoint in the <b>Call</b> Tab.
|
|
389
388
|
</p>
|
|
390
389
|
),
|
|
391
|
-
before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/
|
|
390
|
+
before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial') }],
|
|
392
391
|
},
|
|
393
392
|
{
|
|
394
393
|
elementXpath: workbenchXPath.endpoints.callPanel,
|
|
@@ -407,12 +406,12 @@ export const steps: TutorialStep[] = [
|
|
|
407
406
|
<br />
|
|
408
407
|
<pre className="code-preview">
|
|
409
408
|
<code className="language-bash">
|
|
410
|
-
curl -X POST http://localhost:3000/
|
|
409
|
+
curl -X POST http://localhost:3000/basic-tutorial \<br />
|
|
411
410
|
{' '}-H "Content-Type: application/json" \<br />
|
|
412
411
|
{' '}-d '
|
|
413
412
|
{JSON.stringify({
|
|
414
|
-
pet: { name: 'Jack',
|
|
415
|
-
|
|
413
|
+
pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
|
|
414
|
+
foodOrder: { id: 'food-order-1', quantity: 0 },
|
|
416
415
|
})}
|
|
417
416
|
'
|
|
418
417
|
</code>
|
|
@@ -434,8 +433,8 @@ export const steps: TutorialStep[] = [
|
|
|
434
433
|
{
|
|
435
434
|
type: 'fill-editor',
|
|
436
435
|
content: {
|
|
437
|
-
pet: { name: 'Jack',
|
|
438
|
-
|
|
436
|
+
pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
|
|
437
|
+
foodOrder: { id: 'food-order-1', quantity: 0 },
|
|
439
438
|
},
|
|
440
439
|
},
|
|
441
440
|
],
|
|
@@ -59,8 +59,7 @@ export const steps: TutorialStep[] = [
|
|
|
59
59
|
description: () => (
|
|
60
60
|
<div>
|
|
61
61
|
<p>
|
|
62
|
-
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b
|
|
63
|
-
the programming language).
|
|
62
|
+
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b>.
|
|
64
63
|
<br />
|
|
65
64
|
<br />
|
|
66
65
|
Let's start with the configuration, the common config attributes are
|
|
@@ -5,7 +5,7 @@ from .services.types import Pet
|
|
|
5
5
|
|
|
6
6
|
class PetRequest(BaseModel):
|
|
7
7
|
name: str
|
|
8
|
-
|
|
8
|
+
photoUrl: str
|
|
9
9
|
|
|
10
10
|
class FoodOrder(BaseModel):
|
|
11
11
|
id: str
|
|
@@ -13,20 +13,20 @@ class FoodOrder(BaseModel):
|
|
|
13
13
|
|
|
14
14
|
class RequestBody(BaseModel):
|
|
15
15
|
pet: PetRequest
|
|
16
|
-
|
|
16
|
+
foodOrder: Optional[FoodOrder] = None
|
|
17
17
|
|
|
18
18
|
config = {
|
|
19
19
|
"type": "api",
|
|
20
|
-
"name": "
|
|
20
|
+
"name": "ApiTrigger",
|
|
21
21
|
"description": "basic-tutorial api trigger",
|
|
22
|
-
"flows": ["
|
|
22
|
+
"flows": ["basic-tutorial"],
|
|
23
23
|
"method": "POST",
|
|
24
|
-
"path": "/
|
|
24
|
+
"path": "/basic-tutorial",
|
|
25
25
|
"bodySchema": RequestBody.model_json_schema(),
|
|
26
26
|
"responseSchema": {
|
|
27
27
|
200: Pet.model_json_schema(),
|
|
28
28
|
},
|
|
29
|
-
"emits": ["
|
|
29
|
+
"emits": ["process-food-order"],
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
async def handler(req, context):
|
|
@@ -34,13 +34,13 @@ async def handler(req, context):
|
|
|
34
34
|
context.logger.info("Step 01 – Processing API Step", {"body": body})
|
|
35
35
|
|
|
36
36
|
pet = body.get("pet", {})
|
|
37
|
-
food_order = body.get("
|
|
37
|
+
food_order = body.get("foodOrder", {})
|
|
38
38
|
|
|
39
39
|
new_pet_record = await pet_store_service.create_pet(pet)
|
|
40
40
|
|
|
41
41
|
if food_order:
|
|
42
42
|
await context.emit({
|
|
43
|
-
"topic": "
|
|
43
|
+
"topic": "process-food-order",
|
|
44
44
|
"data": {
|
|
45
45
|
"id": food_order.get("id"),
|
|
46
46
|
"quantity": food_order.get("quantity"),
|
|
@@ -9,10 +9,10 @@ class InputSchema(BaseModel):
|
|
|
9
9
|
|
|
10
10
|
config = {
|
|
11
11
|
"type": "event",
|
|
12
|
-
"name": "
|
|
12
|
+
"name": "Notification",
|
|
13
13
|
"description": "Checks a state change",
|
|
14
|
-
"flows": ["
|
|
15
|
-
"subscribes": ["
|
|
14
|
+
"flows": ["basic-tutorial"],
|
|
15
|
+
"subscribes": ["notification"],
|
|
16
16
|
"emits": [],
|
|
17
17
|
"input": InputSchema.model_json_schema(),
|
|
18
18
|
}
|
|
@@ -10,11 +10,11 @@ class InputSchema(BaseModel):
|
|
|
10
10
|
|
|
11
11
|
config = {
|
|
12
12
|
"type": "event",
|
|
13
|
-
"name": "
|
|
13
|
+
"name": "ProcessFoodOrder",
|
|
14
14
|
"description": "basic-tutorial event step, demonstrates how to consume an event from a topic and persist data in state",
|
|
15
|
-
"flows": ["
|
|
16
|
-
"subscribes": ["
|
|
17
|
-
"emits": ["
|
|
15
|
+
"flows": ["basic-tutorial"],
|
|
16
|
+
"subscribes": ["process-food-order"],
|
|
17
|
+
"emits": ["notification"],
|
|
18
18
|
"input": InputSchema.model_json_schema(),
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ async def handler(input_data, context):
|
|
|
35
35
|
await context.state.set("orders_python", order.get("id"), order)
|
|
36
36
|
|
|
37
37
|
await context.emit({
|
|
38
|
-
"topic": "
|
|
38
|
+
"topic": "notification",
|
|
39
39
|
"data": {
|
|
40
40
|
"email": input_data["email"],
|
|
41
41
|
"template_id": "new-order",
|
|
@@ -3,10 +3,10 @@ from datetime import datetime, timezone
|
|
|
3
3
|
config = {
|
|
4
4
|
"type": "cron",
|
|
5
5
|
"cron": "*/5 * * * *", # run every 5 minutes
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "StateAuditJob",
|
|
7
7
|
"description": "Checks the state for orders that are not complete and have a ship date in the past",
|
|
8
|
-
"emits": ["
|
|
9
|
-
"flows": ["
|
|
8
|
+
"emits": ["notification"],
|
|
9
|
+
"flows": ["basic-tutorial"],
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
async def handler(context):
|
|
@@ -25,7 +25,7 @@ async def handler(context):
|
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
await context.emit({
|
|
28
|
-
"topic": "
|
|
28
|
+
"topic": "notification",
|
|
29
29
|
"data": {
|
|
30
30
|
"email": "test@test.com",
|
|
31
31
|
"template_id": "order-audit-warning",
|
|
@@ -27,7 +27,7 @@ export const steps: TutorialStep[] = [
|
|
|
27
27
|
// Flows
|
|
28
28
|
|
|
29
29
|
{
|
|
30
|
-
elementXpath: workbenchXPath.flows.node('
|
|
30
|
+
elementXpath: workbenchXPath.flows.node('apitrigger'),
|
|
31
31
|
title: 'API Step',
|
|
32
32
|
link: 'https://www.motia.dev/docs/concepts/steps/api',
|
|
33
33
|
description: () => (
|
|
@@ -38,11 +38,11 @@ export const steps: TutorialStep[] = [
|
|
|
38
38
|
),
|
|
39
39
|
before: [
|
|
40
40
|
{ type: 'click', selector: workbenchXPath.links.flows },
|
|
41
|
-
{ type: 'click', selector: workbenchXPath.flows.dropdownFlow('
|
|
41
|
+
{ type: 'click', selector: workbenchXPath.flows.dropdownFlow('basic-tutorial') },
|
|
42
42
|
],
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
elementXpath: workbenchXPath.flows.previewButton('
|
|
45
|
+
elementXpath: workbenchXPath.flows.previewButton('apitrigger'),
|
|
46
46
|
title: 'Code Preview',
|
|
47
47
|
description: () => <p>Clicking on this icon will allow you to visualize the source code for a given Step.</p>,
|
|
48
48
|
before: [
|
|
@@ -59,8 +59,7 @@ export const steps: TutorialStep[] = [
|
|
|
59
59
|
description: () => (
|
|
60
60
|
<div>
|
|
61
61
|
<p>
|
|
62
|
-
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b
|
|
63
|
-
the programming language).
|
|
62
|
+
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b>.
|
|
64
63
|
<br />
|
|
65
64
|
<br />
|
|
66
65
|
Let's start with the configuration, the common config attributes are
|
|
@@ -82,7 +81,7 @@ export const steps: TutorialStep[] = [
|
|
|
82
81
|
</div>
|
|
83
82
|
),
|
|
84
83
|
before: [
|
|
85
|
-
{ type: 'click', selector: workbenchXPath.flows.previewButton('
|
|
84
|
+
{ type: 'click', selector: workbenchXPath.flows.previewButton('apitrigger') },
|
|
86
85
|
{ type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
|
|
87
86
|
],
|
|
88
87
|
},
|
|
@@ -196,7 +195,7 @@ export const steps: TutorialStep[] = [
|
|
|
196
195
|
// Event Steps
|
|
197
196
|
|
|
198
197
|
{
|
|
199
|
-
elementXpath: workbenchXPath.flows.node('
|
|
198
|
+
elementXpath: workbenchXPath.flows.node('processfoodorder'),
|
|
200
199
|
title: 'Event Step',
|
|
201
200
|
link: 'https://www.motia.dev/docs/concepts/steps/event',
|
|
202
201
|
description: () => (
|
|
@@ -230,7 +229,7 @@ export const steps: TutorialStep[] = [
|
|
|
230
229
|
</p>
|
|
231
230
|
),
|
|
232
231
|
before: [
|
|
233
|
-
{ type: 'click', selector: workbenchXPath.flows.previewButton('
|
|
232
|
+
{ type: 'click', selector: workbenchXPath.flows.previewButton('processfoodorder') },
|
|
234
233
|
{ type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
|
|
235
234
|
],
|
|
236
235
|
},
|
|
@@ -290,7 +289,7 @@ export const steps: TutorialStep[] = [
|
|
|
290
289
|
// Cron Steps
|
|
291
290
|
|
|
292
291
|
{
|
|
293
|
-
elementXpath: workbenchXPath.flows.node('
|
|
292
|
+
elementXpath: workbenchXPath.flows.node('stateauditjob'),
|
|
294
293
|
title: 'Cron Step',
|
|
295
294
|
link: 'https://www.motia.dev/docs/concepts/steps/cron',
|
|
296
295
|
description: () => (
|
|
@@ -323,7 +322,7 @@ export const steps: TutorialStep[] = [
|
|
|
323
322
|
</p>
|
|
324
323
|
),
|
|
325
324
|
before: [
|
|
326
|
-
{ type: 'click', selector: workbenchXPath.flows.previewButton('
|
|
325
|
+
{ type: 'click', selector: workbenchXPath.flows.previewButton('stateauditjob') },
|
|
327
326
|
{ type: 'click', selector: workbenchXPath.flows.feature('cron-configuration') },
|
|
328
327
|
],
|
|
329
328
|
},
|
|
@@ -362,7 +361,7 @@ export const steps: TutorialStep[] = [
|
|
|
362
361
|
before: [{ type: 'click', selector: workbenchXPath.closePanelButton }],
|
|
363
362
|
},
|
|
364
363
|
{
|
|
365
|
-
elementXpath: workbenchXPath.endpoints.endpoint('POST', '/
|
|
364
|
+
elementXpath: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial'),
|
|
366
365
|
title: 'Endpoints Tool',
|
|
367
366
|
description: () => (
|
|
368
367
|
<p>
|
|
@@ -388,7 +387,7 @@ export const steps: TutorialStep[] = [
|
|
|
388
387
|
endpoint in the <b>Call</b> Tab.
|
|
389
388
|
</p>
|
|
390
389
|
),
|
|
391
|
-
before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/
|
|
390
|
+
before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial') }],
|
|
392
391
|
},
|
|
393
392
|
{
|
|
394
393
|
elementXpath: workbenchXPath.endpoints.callPanel,
|
|
@@ -407,12 +406,12 @@ export const steps: TutorialStep[] = [
|
|
|
407
406
|
<br />
|
|
408
407
|
<pre className="code-preview">
|
|
409
408
|
<code className="language-bash">
|
|
410
|
-
curl -X POST http://localhost:3000/
|
|
409
|
+
curl -X POST http://localhost:3000/basic-tutorial \<br />
|
|
411
410
|
{' '}-H "Content-Type: application/json" \<br />
|
|
412
411
|
{' '}-d '
|
|
413
412
|
{JSON.stringify({
|
|
414
|
-
pet: { name: 'Jack',
|
|
415
|
-
|
|
413
|
+
pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
|
|
414
|
+
foodOrder: { id: 'food-order-1', quantity: 0 },
|
|
416
415
|
})}
|
|
417
416
|
'
|
|
418
417
|
</code>
|
|
@@ -434,8 +433,8 @@ export const steps: TutorialStep[] = [
|
|
|
434
433
|
{
|
|
435
434
|
type: 'fill-editor',
|
|
436
435
|
content: {
|
|
437
|
-
pet: { name: 'Jack',
|
|
438
|
-
|
|
436
|
+
pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
|
|
437
|
+
foodOrder: { id: 'food-order-1', quantity: 0 },
|
|
439
438
|
},
|
|
440
439
|
},
|
|
441
440
|
],
|
|
@@ -59,8 +59,7 @@ export const steps: TutorialStep[] = [
|
|
|
59
59
|
description: () => (
|
|
60
60
|
<div>
|
|
61
61
|
<p>
|
|
62
|
-
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b
|
|
63
|
-
the programming language).
|
|
62
|
+
All Steps are defined by two main components, the <b>configuration</b> and the <b>handler</b>.
|
|
64
63
|
<br />
|
|
65
64
|
<br />
|
|
66
65
|
Let's start with the configuration, the common config attributes are
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motia",
|
|
3
3
|
"description": "A Modern Unified Backend Framework for APIs, Events and Agents",
|
|
4
|
-
"version": "0.5.11-beta.120-
|
|
4
|
+
"version": "0.5.11-beta.120-568724",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"inquirer": "^8.2.5",
|
|
44
44
|
"table": "^6.9.0",
|
|
45
45
|
"ts-node": "^10.9.2",
|
|
46
|
-
"@motiadev/core": "0.5.11-beta.120-
|
|
47
|
-
"@motiadev/
|
|
48
|
-
"@motiadev/
|
|
46
|
+
"@motiadev/core": "0.5.11-beta.120-568724",
|
|
47
|
+
"@motiadev/workbench": "0.5.11-beta.120-568724",
|
|
48
|
+
"@motiadev/stream-client-node": "0.5.11-beta.120-568724"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@amplitude/analytics-types": "^2.9.2",
|