motia 0.5.11-beta.120-662415 → 0.5.11-beta.120-167191
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/steps/api_step.py-features.json.txt +4 -4
- package/dist/cjs/create/templates/python/steps/api_step.py.txt +3 -3
- package/dist/cjs/create/templates/python/steps/notification_step.py.txt +5 -1
- package/dist/cjs/create/templates/python/steps/process_food_order_step.py-features.json.txt +8 -8
- package/dist/cjs/create/templates/python/steps/process_food_order_step.py.txt +13 -7
- package/dist/cjs/create/templates/python/steps/services/pet_store.py.txt +8 -1
- package/dist/cjs/create/templates/python/steps/state_audit_cron_step.py.txt +6 -6
- package/dist/cjs/create/templates/typescript/services/pet-store.ts.txt +6 -1
- package/dist/esm/create/templates/python/steps/api_step.py-features.json.txt +4 -4
- package/dist/esm/create/templates/python/steps/api_step.py.txt +3 -3
- package/dist/esm/create/templates/python/steps/notification_step.py.txt +5 -1
- package/dist/esm/create/templates/python/steps/process_food_order_step.py-features.json.txt +8 -8
- package/dist/esm/create/templates/python/steps/process_food_order_step.py.txt +13 -7
- package/dist/esm/create/templates/python/steps/services/pet_store.py.txt +8 -1
- package/dist/esm/create/templates/python/steps/state_audit_cron_step.py.txt +6 -6
- package/dist/esm/create/templates/typescript/services/pet-store.ts.txt +6 -1
- package/package.json +4 -4
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"description": "We can define the events that this step will emit, this is how we can trigger other Motia Steps.",
|
|
40
40
|
"lines": [
|
|
41
41
|
"29",
|
|
42
|
-
"
|
|
42
|
+
"42-50"
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"title": "Handler",
|
|
48
48
|
"description": "The handler is the function that will be executed when the step is triggered. This one receives the request body and emits events.",
|
|
49
49
|
"lines": [
|
|
50
|
-
"32-
|
|
50
|
+
"32-52"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"title": "Logger",
|
|
56
56
|
"description": "The logger is a utility that allows you to log messages to the console. It is available in the handler function. We encourage you to use it instead of console.log. It will automatically be tied to the trace id of the request.",
|
|
57
57
|
"lines": [
|
|
58
|
-
"
|
|
58
|
+
"34"
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
{
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"title": "HTTP Response",
|
|
64
64
|
"description": "The handler can return a response to the client. This is how we can return a response to the client. It must comply with the responseSchema defined in the step configuration.",
|
|
65
65
|
"lines": [
|
|
66
|
-
"
|
|
66
|
+
"52"
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
]
|
|
@@ -39,13 +39,13 @@ async def handler(req, context):
|
|
|
39
39
|
new_pet_record = await pet_store_service.create_pet(pet)
|
|
40
40
|
|
|
41
41
|
if food_order:
|
|
42
|
-
food_order = FoodOrder(**food_order)
|
|
43
42
|
await context.emit({
|
|
44
43
|
"topic": "python-process-food-order",
|
|
45
44
|
"data": {
|
|
46
|
-
|
|
45
|
+
"id": food_order.get("id"),
|
|
46
|
+
"quantity": food_order.get("quantity"),
|
|
47
47
|
"email": "test@test.com", # sample email
|
|
48
|
-
"pet_id": new_pet_record.id,
|
|
48
|
+
"pet_id": new_pet_record.get("id"),
|
|
49
49
|
},
|
|
50
50
|
})
|
|
51
51
|
|
|
@@ -24,7 +24,11 @@ async def handler(input_data, context):
|
|
|
24
24
|
|
|
25
25
|
redacted_email = re.sub(r'(?<=.{2}).(?=.*@)', '*', email)
|
|
26
26
|
|
|
27
|
-
context.logger.info("Processing Notification", {
|
|
27
|
+
context.logger.info("Processing Notification", {
|
|
28
|
+
"template_id": template_id,
|
|
29
|
+
"template_data": template_data,
|
|
30
|
+
"email": redacted_email,
|
|
31
|
+
})
|
|
28
32
|
|
|
29
33
|
# This represents a call to some sort of
|
|
30
34
|
# notification service to indicate that a
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "Step Configuration",
|
|
5
5
|
"description": "All steps should have a defined configuration, this is how you define the step's behavior and how it will be triggered.",
|
|
6
6
|
"lines": [
|
|
7
|
-
"5-
|
|
7
|
+
"5-19"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
10
|
{
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"title": "Event Step",
|
|
13
13
|
"description": "Definition of an event step that subscribes to specific topics",
|
|
14
14
|
"lines": [
|
|
15
|
-
"
|
|
15
|
+
"12",
|
|
16
16
|
"15-16"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"title": "Input Schema",
|
|
22
22
|
"description": "Definition of the expected input data structure from the subscribed topic. Motia will automatically generate types based on this schema.",
|
|
23
23
|
"lines": [
|
|
24
|
-
"5-
|
|
24
|
+
"5-9",
|
|
25
25
|
"17"
|
|
26
26
|
]
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"title": "Emits",
|
|
31
31
|
"description": "We can define the events that this step will emit, triggering other Motia Steps.",
|
|
32
32
|
"lines": [
|
|
33
|
-
"
|
|
33
|
+
"17"
|
|
34
34
|
]
|
|
35
35
|
},
|
|
36
36
|
{
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"title": "Handler",
|
|
39
39
|
"description": "The handler is the function that will be executed when the step receives an event from its subscribed topic. It processes the input data and can emit new events.",
|
|
40
40
|
"lines": [
|
|
41
|
-
"
|
|
41
|
+
"21-50"
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
{
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"title": "State Management",
|
|
47
47
|
"description": "The handler demonstrates state management by storing order data that can be accessed by other steps.",
|
|
48
48
|
"lines": [
|
|
49
|
-
"
|
|
49
|
+
"35"
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"title": "Event Emission",
|
|
55
55
|
"description": "After processing the order, the handler emits a new event to notify other steps about the new order.",
|
|
56
56
|
"lines": [
|
|
57
|
-
"
|
|
57
|
+
"37-50"
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"title": "Logger",
|
|
63
63
|
"description": "The logger is a utility that allows you to log messages to the console. It is available in the handler function and automatically ties to the trace id of the request.",
|
|
64
64
|
"lines": [
|
|
65
|
-
"
|
|
65
|
+
"22"
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
]
|
|
@@ -3,6 +3,7 @@ from datetime import datetime
|
|
|
3
3
|
from .services.pet_store import pet_store_service
|
|
4
4
|
|
|
5
5
|
class InputSchema(BaseModel):
|
|
6
|
+
id: str
|
|
6
7
|
email: str
|
|
7
8
|
quantity: int
|
|
8
9
|
pet_id: int
|
|
@@ -21,12 +22,17 @@ async def handler(input_data, context):
|
|
|
21
22
|
context.logger.info("Step 02 – Process food order", {"input": input_data})
|
|
22
23
|
|
|
23
24
|
order = await pet_store_service.create_order({
|
|
24
|
-
|
|
25
|
+
"id": input_data.get("id"),
|
|
26
|
+
"quantity": input_data.get("quantity"),
|
|
27
|
+
"pet_id": input_data.get("pet_id"),
|
|
28
|
+
"email": input_data.get("email"),
|
|
25
29
|
"ship_date": datetime.now().isoformat(),
|
|
26
30
|
"status": "placed",
|
|
27
31
|
})
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
context.logger.info("Order created", {"order": order})
|
|
34
|
+
|
|
35
|
+
await context.state.set("orders_python", order.get("id"), order)
|
|
30
36
|
|
|
31
37
|
await context.emit({
|
|
32
38
|
"topic": "python-notification",
|
|
@@ -34,11 +40,11 @@ async def handler(input_data, context):
|
|
|
34
40
|
"email": input_data["email"],
|
|
35
41
|
"template_id": "new-order",
|
|
36
42
|
"template_data": {
|
|
37
|
-
"status": order.status,
|
|
38
|
-
"ship_date": order.
|
|
39
|
-
"id": order.id,
|
|
40
|
-
"pet_id": order.
|
|
41
|
-
"quantity": order.quantity,
|
|
43
|
+
"status": order.get("status"),
|
|
44
|
+
"ship_date": order.get("shipDate"),
|
|
45
|
+
"id": order.get("id"),
|
|
46
|
+
"pet_id": order.get("petId"),
|
|
47
|
+
"quantity": order.get("quantity"),
|
|
42
48
|
},
|
|
43
49
|
},
|
|
44
50
|
})
|
|
@@ -20,9 +20,16 @@ class PetStoreService:
|
|
|
20
20
|
|
|
21
21
|
async def create_order(self, order: Dict[str, Any]) -> Order:
|
|
22
22
|
async with httpx.AsyncClient() as client:
|
|
23
|
+
order_data = {
|
|
24
|
+
"quantity": order.get("quantity"),
|
|
25
|
+
"petId": 1,
|
|
26
|
+
"shipDate": order.get("ship_date"),
|
|
27
|
+
"status": order.get("status"),
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
response = await client.post(
|
|
24
31
|
'https://petstore.swagger.io/v2/store/order',
|
|
25
|
-
json=
|
|
32
|
+
json=order_data,
|
|
26
33
|
headers={'Content-Type': 'application/json'}
|
|
27
34
|
)
|
|
28
35
|
return response.json()
|
|
@@ -15,12 +15,12 @@ async def handler(context):
|
|
|
15
15
|
for item in state_value:
|
|
16
16
|
# check if current date is after item.ship_date
|
|
17
17
|
current_date = datetime.now()
|
|
18
|
-
ship_date = datetime.fromisoformat(item
|
|
18
|
+
ship_date = datetime.fromisoformat(item.get("shipDate", "").replace('Z', '+00:00'))
|
|
19
19
|
|
|
20
20
|
if not item.get("complete", False) and current_date > ship_date:
|
|
21
21
|
context.logger.warn("Order is not complete and ship date is past", {
|
|
22
|
-
"order_id": item
|
|
23
|
-
"ship_date": item
|
|
22
|
+
"order_id": item.get("id"),
|
|
23
|
+
"ship_date": item.get("shipDate"),
|
|
24
24
|
"complete": item.get("complete", False),
|
|
25
25
|
})
|
|
26
26
|
|
|
@@ -30,9 +30,9 @@ async def handler(context):
|
|
|
30
30
|
"email": "test@test.com",
|
|
31
31
|
"template_id": "order-audit-warning",
|
|
32
32
|
"template_data": {
|
|
33
|
-
"order_id": item
|
|
34
|
-
"status": item
|
|
35
|
-
"ship_date": item
|
|
33
|
+
"order_id": item.get("id"),
|
|
34
|
+
"status": item.get("status"),
|
|
35
|
+
"ship_date": item.get("shipDate"),
|
|
36
36
|
"message": "Order is not complete and ship date is past",
|
|
37
37
|
},
|
|
38
38
|
},
|
|
@@ -16,7 +16,12 @@ export const petStoreService = {
|
|
|
16
16
|
createOrder: async (order: Omit<Order, 'id'>): Promise<Order> => {
|
|
17
17
|
const response = await fetch('https://petstore.swagger.io/v2/store/order', {
|
|
18
18
|
method: 'POST',
|
|
19
|
-
body: JSON.stringify(
|
|
19
|
+
body: JSON.stringify({
|
|
20
|
+
quantity: order.quantity,
|
|
21
|
+
petId: 1,
|
|
22
|
+
shipDate: order.shipDate,
|
|
23
|
+
status: order.status,
|
|
24
|
+
}),
|
|
20
25
|
headers: { 'Content-Type': 'application/json' },
|
|
21
26
|
})
|
|
22
27
|
return response.json()
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"description": "We can define the events that this step will emit, this is how we can trigger other Motia Steps.",
|
|
40
40
|
"lines": [
|
|
41
41
|
"29",
|
|
42
|
-
"
|
|
42
|
+
"42-50"
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"title": "Handler",
|
|
48
48
|
"description": "The handler is the function that will be executed when the step is triggered. This one receives the request body and emits events.",
|
|
49
49
|
"lines": [
|
|
50
|
-
"32-
|
|
50
|
+
"32-52"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"title": "Logger",
|
|
56
56
|
"description": "The logger is a utility that allows you to log messages to the console. It is available in the handler function. We encourage you to use it instead of console.log. It will automatically be tied to the trace id of the request.",
|
|
57
57
|
"lines": [
|
|
58
|
-
"
|
|
58
|
+
"34"
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
{
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"title": "HTTP Response",
|
|
64
64
|
"description": "The handler can return a response to the client. This is how we can return a response to the client. It must comply with the responseSchema defined in the step configuration.",
|
|
65
65
|
"lines": [
|
|
66
|
-
"
|
|
66
|
+
"52"
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
]
|
|
@@ -39,13 +39,13 @@ async def handler(req, context):
|
|
|
39
39
|
new_pet_record = await pet_store_service.create_pet(pet)
|
|
40
40
|
|
|
41
41
|
if food_order:
|
|
42
|
-
food_order = FoodOrder(**food_order)
|
|
43
42
|
await context.emit({
|
|
44
43
|
"topic": "python-process-food-order",
|
|
45
44
|
"data": {
|
|
46
|
-
|
|
45
|
+
"id": food_order.get("id"),
|
|
46
|
+
"quantity": food_order.get("quantity"),
|
|
47
47
|
"email": "test@test.com", # sample email
|
|
48
|
-
"pet_id": new_pet_record.id,
|
|
48
|
+
"pet_id": new_pet_record.get("id"),
|
|
49
49
|
},
|
|
50
50
|
})
|
|
51
51
|
|
|
@@ -24,7 +24,11 @@ async def handler(input_data, context):
|
|
|
24
24
|
|
|
25
25
|
redacted_email = re.sub(r'(?<=.{2}).(?=.*@)', '*', email)
|
|
26
26
|
|
|
27
|
-
context.logger.info("Processing Notification", {
|
|
27
|
+
context.logger.info("Processing Notification", {
|
|
28
|
+
"template_id": template_id,
|
|
29
|
+
"template_data": template_data,
|
|
30
|
+
"email": redacted_email,
|
|
31
|
+
})
|
|
28
32
|
|
|
29
33
|
# This represents a call to some sort of
|
|
30
34
|
# notification service to indicate that a
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"title": "Step Configuration",
|
|
5
5
|
"description": "All steps should have a defined configuration, this is how you define the step's behavior and how it will be triggered.",
|
|
6
6
|
"lines": [
|
|
7
|
-
"5-
|
|
7
|
+
"5-19"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
10
|
{
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"title": "Event Step",
|
|
13
13
|
"description": "Definition of an event step that subscribes to specific topics",
|
|
14
14
|
"lines": [
|
|
15
|
-
"
|
|
15
|
+
"12",
|
|
16
16
|
"15-16"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"title": "Input Schema",
|
|
22
22
|
"description": "Definition of the expected input data structure from the subscribed topic. Motia will automatically generate types based on this schema.",
|
|
23
23
|
"lines": [
|
|
24
|
-
"5-
|
|
24
|
+
"5-9",
|
|
25
25
|
"17"
|
|
26
26
|
]
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"title": "Emits",
|
|
31
31
|
"description": "We can define the events that this step will emit, triggering other Motia Steps.",
|
|
32
32
|
"lines": [
|
|
33
|
-
"
|
|
33
|
+
"17"
|
|
34
34
|
]
|
|
35
35
|
},
|
|
36
36
|
{
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"title": "Handler",
|
|
39
39
|
"description": "The handler is the function that will be executed when the step receives an event from its subscribed topic. It processes the input data and can emit new events.",
|
|
40
40
|
"lines": [
|
|
41
|
-
"
|
|
41
|
+
"21-50"
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
{
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"title": "State Management",
|
|
47
47
|
"description": "The handler demonstrates state management by storing order data that can be accessed by other steps.",
|
|
48
48
|
"lines": [
|
|
49
|
-
"
|
|
49
|
+
"35"
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"title": "Event Emission",
|
|
55
55
|
"description": "After processing the order, the handler emits a new event to notify other steps about the new order.",
|
|
56
56
|
"lines": [
|
|
57
|
-
"
|
|
57
|
+
"37-50"
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"title": "Logger",
|
|
63
63
|
"description": "The logger is a utility that allows you to log messages to the console. It is available in the handler function and automatically ties to the trace id of the request.",
|
|
64
64
|
"lines": [
|
|
65
|
-
"
|
|
65
|
+
"22"
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
]
|
|
@@ -3,6 +3,7 @@ from datetime import datetime
|
|
|
3
3
|
from .services.pet_store import pet_store_service
|
|
4
4
|
|
|
5
5
|
class InputSchema(BaseModel):
|
|
6
|
+
id: str
|
|
6
7
|
email: str
|
|
7
8
|
quantity: int
|
|
8
9
|
pet_id: int
|
|
@@ -21,12 +22,17 @@ async def handler(input_data, context):
|
|
|
21
22
|
context.logger.info("Step 02 – Process food order", {"input": input_data})
|
|
22
23
|
|
|
23
24
|
order = await pet_store_service.create_order({
|
|
24
|
-
|
|
25
|
+
"id": input_data.get("id"),
|
|
26
|
+
"quantity": input_data.get("quantity"),
|
|
27
|
+
"pet_id": input_data.get("pet_id"),
|
|
28
|
+
"email": input_data.get("email"),
|
|
25
29
|
"ship_date": datetime.now().isoformat(),
|
|
26
30
|
"status": "placed",
|
|
27
31
|
})
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
context.logger.info("Order created", {"order": order})
|
|
34
|
+
|
|
35
|
+
await context.state.set("orders_python", order.get("id"), order)
|
|
30
36
|
|
|
31
37
|
await context.emit({
|
|
32
38
|
"topic": "python-notification",
|
|
@@ -34,11 +40,11 @@ async def handler(input_data, context):
|
|
|
34
40
|
"email": input_data["email"],
|
|
35
41
|
"template_id": "new-order",
|
|
36
42
|
"template_data": {
|
|
37
|
-
"status": order.status,
|
|
38
|
-
"ship_date": order.
|
|
39
|
-
"id": order.id,
|
|
40
|
-
"pet_id": order.
|
|
41
|
-
"quantity": order.quantity,
|
|
43
|
+
"status": order.get("status"),
|
|
44
|
+
"ship_date": order.get("shipDate"),
|
|
45
|
+
"id": order.get("id"),
|
|
46
|
+
"pet_id": order.get("petId"),
|
|
47
|
+
"quantity": order.get("quantity"),
|
|
42
48
|
},
|
|
43
49
|
},
|
|
44
50
|
})
|
|
@@ -20,9 +20,16 @@ class PetStoreService:
|
|
|
20
20
|
|
|
21
21
|
async def create_order(self, order: Dict[str, Any]) -> Order:
|
|
22
22
|
async with httpx.AsyncClient() as client:
|
|
23
|
+
order_data = {
|
|
24
|
+
"quantity": order.get("quantity"),
|
|
25
|
+
"petId": 1,
|
|
26
|
+
"shipDate": order.get("ship_date"),
|
|
27
|
+
"status": order.get("status"),
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
response = await client.post(
|
|
24
31
|
'https://petstore.swagger.io/v2/store/order',
|
|
25
|
-
json=
|
|
32
|
+
json=order_data,
|
|
26
33
|
headers={'Content-Type': 'application/json'}
|
|
27
34
|
)
|
|
28
35
|
return response.json()
|
|
@@ -15,12 +15,12 @@ async def handler(context):
|
|
|
15
15
|
for item in state_value:
|
|
16
16
|
# check if current date is after item.ship_date
|
|
17
17
|
current_date = datetime.now()
|
|
18
|
-
ship_date = datetime.fromisoformat(item
|
|
18
|
+
ship_date = datetime.fromisoformat(item.get("shipDate", "").replace('Z', '+00:00'))
|
|
19
19
|
|
|
20
20
|
if not item.get("complete", False) and current_date > ship_date:
|
|
21
21
|
context.logger.warn("Order is not complete and ship date is past", {
|
|
22
|
-
"order_id": item
|
|
23
|
-
"ship_date": item
|
|
22
|
+
"order_id": item.get("id"),
|
|
23
|
+
"ship_date": item.get("shipDate"),
|
|
24
24
|
"complete": item.get("complete", False),
|
|
25
25
|
})
|
|
26
26
|
|
|
@@ -30,9 +30,9 @@ async def handler(context):
|
|
|
30
30
|
"email": "test@test.com",
|
|
31
31
|
"template_id": "order-audit-warning",
|
|
32
32
|
"template_data": {
|
|
33
|
-
"order_id": item
|
|
34
|
-
"status": item
|
|
35
|
-
"ship_date": item
|
|
33
|
+
"order_id": item.get("id"),
|
|
34
|
+
"status": item.get("status"),
|
|
35
|
+
"ship_date": item.get("shipDate"),
|
|
36
36
|
"message": "Order is not complete and ship date is past",
|
|
37
37
|
},
|
|
38
38
|
},
|
|
@@ -16,7 +16,12 @@ export const petStoreService = {
|
|
|
16
16
|
createOrder: async (order: Omit<Order, 'id'>): Promise<Order> => {
|
|
17
17
|
const response = await fetch('https://petstore.swagger.io/v2/store/order', {
|
|
18
18
|
method: 'POST',
|
|
19
|
-
body: JSON.stringify(
|
|
19
|
+
body: JSON.stringify({
|
|
20
|
+
quantity: order.quantity,
|
|
21
|
+
petId: 1,
|
|
22
|
+
shipDate: order.shipDate,
|
|
23
|
+
status: order.status,
|
|
24
|
+
}),
|
|
20
25
|
headers: { 'Content-Type': 'application/json' },
|
|
21
26
|
})
|
|
22
27
|
return response.json()
|
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-167191",
|
|
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/stream-client-node": "0.5.11-beta.120-
|
|
48
|
-
"@motiadev/workbench": "0.5.11-beta.120-
|
|
46
|
+
"@motiadev/core": "0.5.11-beta.120-167191",
|
|
47
|
+
"@motiadev/stream-client-node": "0.5.11-beta.120-167191",
|
|
48
|
+
"@motiadev/workbench": "0.5.11-beta.120-167191"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@amplitude/analytics-types": "^2.9.2",
|