motia 0.5.11-beta.120-559255 → 0.5.11-beta.120-777374

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.
@@ -1,6 +1,6 @@
1
1
  [
2
2
  {
3
- "id": "python-tutorial",
3
+ "id": "basic-tutorial",
4
4
  "config": {
5
5
  "steps/state_audit_cron_step.py": {
6
6
  "x": -38,
@@ -17,16 +17,16 @@ class RequestBody(BaseModel):
17
17
 
18
18
  config = {
19
19
  "type": "api",
20
- "name": "PythonApiTrigger",
20
+ "name": "ApiTrigger",
21
21
  "description": "basic-tutorial api trigger",
22
- "flows": ["python-tutorial"],
22
+ "flows": [basic-tutorial"],
23
23
  "method": "POST",
24
- "path": "/python-basic-tutorial",
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": ["python-process-food-order"],
29
+ "emits": ["process-food-order"],
30
30
  }
31
31
 
32
32
  async def handler(req, context):
@@ -40,7 +40,7 @@ async def handler(req, context):
40
40
 
41
41
  if food_order:
42
42
  await context.emit({
43
- "topic": "python-process-food-order",
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": "PythonNotification",
12
+ "name": "Notification",
13
13
  "description": "Checks a state change",
14
- "flows": ["python-tutorial"],
15
- "subscribes": ["python-notification"],
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": "PythonProcessFoodOrder",
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": ["python-tutorial"],
16
- "subscribes": ["python-process-food-order"],
17
- "emits": ["python-notification"],
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": "python-notification",
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": "PythonStateAuditJob",
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": ["python-notification"],
9
- "flows": ["python-tutorial"],
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": "python-notification",
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('pythonapitrigger'),
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('python-tutorial') },
41
+ { type: 'click', selector: workbenchXPath.flows.dropdownFlow('basic-tutorial') },
42
42
  ],
43
43
  },
44
44
  {
45
- elementXpath: workbenchXPath.flows.previewButton('pythonapitrigger'),
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> (disregarding of
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('pythonapitrigger') },
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('pythonprocessfoodorder'),
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('pythonprocessfoodorder') },
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('pythonstateauditjob'),
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('pythonstateauditjob') },
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', '/python-basic-tutorial'),
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', '/python-basic-tutorial') }],
390
+ before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial') }],
392
391
  },
393
392
  {
394
393
  elementXpath: workbenchXPath.endpoints.callPanel,
@@ -407,7 +406,7 @@ 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/python-basic-tutorial \<br />
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({
@@ -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> (disregarding of
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
@@ -1,6 +1,6 @@
1
1
  [
2
2
  {
3
- "id": "python-tutorial",
3
+ "id": "basic-tutorial",
4
4
  "config": {
5
5
  "steps/state_audit_cron_step.py": {
6
6
  "x": -38,
@@ -17,16 +17,16 @@ class RequestBody(BaseModel):
17
17
 
18
18
  config = {
19
19
  "type": "api",
20
- "name": "PythonApiTrigger",
20
+ "name": "ApiTrigger",
21
21
  "description": "basic-tutorial api trigger",
22
- "flows": ["python-tutorial"],
22
+ "flows": [basic-tutorial"],
23
23
  "method": "POST",
24
- "path": "/python-basic-tutorial",
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": ["python-process-food-order"],
29
+ "emits": ["process-food-order"],
30
30
  }
31
31
 
32
32
  async def handler(req, context):
@@ -40,7 +40,7 @@ async def handler(req, context):
40
40
 
41
41
  if food_order:
42
42
  await context.emit({
43
- "topic": "python-process-food-order",
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": "PythonNotification",
12
+ "name": "Notification",
13
13
  "description": "Checks a state change",
14
- "flows": ["python-tutorial"],
15
- "subscribes": ["python-notification"],
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": "PythonProcessFoodOrder",
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": ["python-tutorial"],
16
- "subscribes": ["python-process-food-order"],
17
- "emits": ["python-notification"],
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": "python-notification",
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": "PythonStateAuditJob",
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": ["python-notification"],
9
- "flows": ["python-tutorial"],
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": "python-notification",
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('pythonapitrigger'),
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('python-tutorial') },
41
+ { type: 'click', selector: workbenchXPath.flows.dropdownFlow('basic-tutorial') },
42
42
  ],
43
43
  },
44
44
  {
45
- elementXpath: workbenchXPath.flows.previewButton('pythonapitrigger'),
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> (disregarding of
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('pythonapitrigger') },
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('pythonprocessfoodorder'),
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('pythonprocessfoodorder') },
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('pythonstateauditjob'),
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('pythonstateauditjob') },
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', '/python-basic-tutorial'),
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', '/python-basic-tutorial') }],
390
+ before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial') }],
392
391
  },
393
392
  {
394
393
  elementXpath: workbenchXPath.endpoints.callPanel,
@@ -407,7 +406,7 @@ 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/python-basic-tutorial \<br />
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({
@@ -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> (disregarding of
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-559255",
4
+ "version": "0.5.11-beta.120-777374",
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-559255",
47
- "@motiadev/stream-client-node": "0.5.11-beta.120-559255",
48
- "@motiadev/workbench": "0.5.11-beta.120-559255"
46
+ "@motiadev/core": "0.5.11-beta.120-777374",
47
+ "@motiadev/workbench": "0.5.11-beta.120-777374",
48
+ "@motiadev/stream-client-node": "0.5.11-beta.120-777374"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@amplitude/analytics-types": "^2.9.2",