motia 0.8.5-beta.142 → 0.8.5-beta.143-445618
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/constants.js +6 -1
- package/dist/esm/constants.js +3 -1
- package/dist/esm/create/templates/python/tutorial/api_step.py-features.json.txt +69 -0
- package/dist/esm/create/templates/python/tutorial/petstore/api_step.py-features.json.txt +69 -0
- package/dist/esm/create/templates/python/tutorial/petstore/process_food_order_step.py-features.json.txt +68 -0
- package/dist/esm/create/templates/python/tutorial/petstore/state_audit_cron_step.py-features.json.txt +26 -0
- package/dist/esm/create/templates/python/tutorial/process_food_order_step.py-features.json.txt +68 -0
- package/dist/esm/create/templates/python/tutorial/state_audit_cron_step.py-features.json.txt +26 -0
- package/package.json +4 -4
- /package/dist/cjs/create/templates/nodejs/{steps → tutorial}/petstore/api.step.ts-features.json.txt +0 -0
- /package/dist/cjs/create/templates/nodejs/{steps → tutorial}/petstore/process-food-order.step.ts-features.json.txt +0 -0
- /package/dist/cjs/create/templates/nodejs/{steps → tutorial}/petstore/state-audit-cron.step.ts-features.json.txt +0 -0
- /package/dist/cjs/create/templates/nodejs/{tutorial.tsx.txt → tutorial/tutorial.tsx.txt} +0 -0
- /package/dist/cjs/create/templates/python/{steps/petstore → tutorial}/api_step.py-features.json.txt +0 -0
- /package/dist/{esm/create/templates/python/steps → cjs/create/templates/python/tutorial}/petstore/api_step.py-features.json.txt +0 -0
- /package/dist/cjs/create/templates/python/{steps → tutorial}/petstore/process_food_order_step.py-features.json.txt +0 -0
- /package/dist/cjs/create/templates/python/{steps → tutorial}/petstore/state_audit_cron_step.py-features.json.txt +0 -0
- /package/dist/{esm/create/templates/python/steps/petstore → cjs/create/templates/python/tutorial}/process_food_order_step.py-features.json.txt +0 -0
- /package/dist/{esm/create/templates/python/steps/petstore → cjs/create/templates/python/tutorial}/state_audit_cron_step.py-features.json.txt +0 -0
- /package/dist/cjs/create/templates/python/{tutorial.tsx.txt → tutorial/tutorial.tsx.txt} +0 -0
- /package/dist/esm/create/templates/nodejs/{steps → tutorial}/petstore/api.step.ts-features.json.txt +0 -0
- /package/dist/esm/create/templates/nodejs/{steps → tutorial}/petstore/process-food-order.step.ts-features.json.txt +0 -0
- /package/dist/esm/create/templates/nodejs/{steps → tutorial}/petstore/state-audit-cron.step.ts-features.json.txt +0 -0
- /package/dist/esm/create/templates/nodejs/{tutorial.tsx.txt → tutorial/tutorial.tsx.txt} +0 -0
- /package/dist/esm/create/templates/python/{tutorial.tsx.txt → tutorial/tutorial.tsx.txt} +0 -0
package/dist/cjs/constants.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.isTutorialDisabled = exports.workbenchBase = void 0;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
4
9
|
function getWorkbenchBase() {
|
|
5
10
|
const basePath = process.env.MOTIA_WORKBENCH_BASE;
|
|
6
11
|
if (basePath === '/') {
|
|
@@ -9,4 +14,4 @@ function getWorkbenchBase() {
|
|
|
9
14
|
return basePath && basePath[0] !== '/' ? `/${basePath}` : basePath || '';
|
|
10
15
|
}
|
|
11
16
|
exports.workbenchBase = getWorkbenchBase();
|
|
12
|
-
exports.isTutorialDisabled = process.env.MOTIA_TUTORIAL_DISABLED === 'true';
|
|
17
|
+
exports.isTutorialDisabled = process.env.MOTIA_TUTORIAL_DISABLED === 'true' || !node_fs_1.default.existsSync(node_path_1.default.join(process.cwd(), 'tutorial/tutorial.tsx'));
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
1
3
|
function getWorkbenchBase() {
|
|
2
4
|
const basePath = process.env.MOTIA_WORKBENCH_BASE;
|
|
3
5
|
if (basePath === '/') {
|
|
@@ -6,4 +8,4 @@ function getWorkbenchBase() {
|
|
|
6
8
|
return basePath && basePath[0] !== '/' ? `/${basePath}` : basePath || '';
|
|
7
9
|
}
|
|
8
10
|
export const workbenchBase = getWorkbenchBase();
|
|
9
|
-
export const isTutorialDisabled = process.env.MOTIA_TUTORIAL_DISABLED === 'true';
|
|
11
|
+
export const isTutorialDisabled = process.env.MOTIA_TUTORIAL_DISABLED === 'true' || !fs.existsSync(path.join(process.cwd(), 'tutorial/tutorial.tsx'));
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "step-configuration",
|
|
4
|
+
"title": "Step Configuration",
|
|
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
|
+
"lines": [
|
|
7
|
+
"6-30"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "api-configuration",
|
|
12
|
+
"title": "API Step",
|
|
13
|
+
"description": "Definition of an API endpoint",
|
|
14
|
+
"lines": [
|
|
15
|
+
"23-24"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "request-body",
|
|
20
|
+
"title": "Request body",
|
|
21
|
+
"description": "Definition of the expected request body. Motia will automatically generate types based on this schema.",
|
|
22
|
+
"lines": [
|
|
23
|
+
"6-16",
|
|
24
|
+
"25"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "response-payload",
|
|
29
|
+
"title": "Response Payload",
|
|
30
|
+
"description": "Definition of the expected response payload, Motia will generate the types automatically based on this schema. This is also important to create the Open API spec later.",
|
|
31
|
+
"lines": [
|
|
32
|
+
"4",
|
|
33
|
+
"26-28"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "event-driven-architecture",
|
|
38
|
+
"title": "Emits",
|
|
39
|
+
"description": "We can define the events that this step will emit, this is how we can trigger other Motia Steps.",
|
|
40
|
+
"lines": [
|
|
41
|
+
"29",
|
|
42
|
+
"42-50"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "handler",
|
|
47
|
+
"title": "Handler",
|
|
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
|
+
"lines": [
|
|
50
|
+
"32-52"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "logger",
|
|
55
|
+
"title": "Logger",
|
|
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
|
+
"lines": [
|
|
58
|
+
"34"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "http-response",
|
|
63
|
+
"title": "HTTP Response",
|
|
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
|
+
"lines": [
|
|
66
|
+
"52"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "step-configuration",
|
|
4
|
+
"title": "Step Configuration",
|
|
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
|
+
"lines": [
|
|
7
|
+
"6-30"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "api-configuration",
|
|
12
|
+
"title": "API Step",
|
|
13
|
+
"description": "Definition of an API endpoint",
|
|
14
|
+
"lines": [
|
|
15
|
+
"23-24"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "request-body",
|
|
20
|
+
"title": "Request body",
|
|
21
|
+
"description": "Definition of the expected request body. Motia will automatically generate types based on this schema.",
|
|
22
|
+
"lines": [
|
|
23
|
+
"6-16",
|
|
24
|
+
"25"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "response-payload",
|
|
29
|
+
"title": "Response Payload",
|
|
30
|
+
"description": "Definition of the expected response payload, Motia will generate the types automatically based on this schema. This is also important to create the Open API spec later.",
|
|
31
|
+
"lines": [
|
|
32
|
+
"4",
|
|
33
|
+
"26-28"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "event-driven-architecture",
|
|
38
|
+
"title": "Emits",
|
|
39
|
+
"description": "We can define the events that this step will emit, this is how we can trigger other Motia Steps.",
|
|
40
|
+
"lines": [
|
|
41
|
+
"29",
|
|
42
|
+
"42-50"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "handler",
|
|
47
|
+
"title": "Handler",
|
|
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
|
+
"lines": [
|
|
50
|
+
"32-52"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "logger",
|
|
55
|
+
"title": "Logger",
|
|
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
|
+
"lines": [
|
|
58
|
+
"34"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "http-response",
|
|
63
|
+
"title": "HTTP Response",
|
|
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
|
+
"lines": [
|
|
66
|
+
"52"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "step-configuration",
|
|
4
|
+
"title": "Step Configuration",
|
|
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
|
+
"lines": [
|
|
7
|
+
"5-19"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "event-configuration",
|
|
12
|
+
"title": "Event Step",
|
|
13
|
+
"description": "Definition of an event step that subscribes to specific topics",
|
|
14
|
+
"lines": [
|
|
15
|
+
"12",
|
|
16
|
+
"15-16"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "input-schema",
|
|
21
|
+
"title": "Input Schema",
|
|
22
|
+
"description": "Definition of the expected input data structure from the subscribed topic. Motia will automatically generate types based on this schema.",
|
|
23
|
+
"lines": [
|
|
24
|
+
"5-9",
|
|
25
|
+
"17"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "event-emits",
|
|
30
|
+
"title": "Emits",
|
|
31
|
+
"description": "We can define the events that this step will emit, triggering other Motia Steps.",
|
|
32
|
+
"lines": [
|
|
33
|
+
"17"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "handler",
|
|
38
|
+
"title": "Handler",
|
|
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
|
+
"lines": [
|
|
41
|
+
"21-50"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "state",
|
|
46
|
+
"title": "State Management",
|
|
47
|
+
"description": "The handler demonstrates state management by storing order data that can be accessed by other steps.",
|
|
48
|
+
"lines": [
|
|
49
|
+
"35"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "event-emission",
|
|
54
|
+
"title": "Event Emission",
|
|
55
|
+
"description": "After processing the order, the handler emits a new event to notify other steps about the new order.",
|
|
56
|
+
"lines": [
|
|
57
|
+
"37-50"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "logger",
|
|
62
|
+
"title": "Logger",
|
|
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
|
+
"lines": [
|
|
65
|
+
"22"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "step-configuration",
|
|
4
|
+
"title": "Step Configuration",
|
|
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
|
+
"lines": [
|
|
7
|
+
"3-10"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "cron-configuration",
|
|
12
|
+
"title": "Cron Configuration",
|
|
13
|
+
"description": "Cron steps require a specific configuration structure with the 'type' field set to 'cron' and a valid cron expression.",
|
|
14
|
+
"lines": [
|
|
15
|
+
"4-5"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "handler",
|
|
20
|
+
"title": "Cron Step Handler",
|
|
21
|
+
"description": "The Cron step handler only receives one argument.",
|
|
22
|
+
"lines": [
|
|
23
|
+
"12-39"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
package/dist/esm/create/templates/python/tutorial/process_food_order_step.py-features.json.txt
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "step-configuration",
|
|
4
|
+
"title": "Step Configuration",
|
|
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
|
+
"lines": [
|
|
7
|
+
"5-19"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "event-configuration",
|
|
12
|
+
"title": "Event Step",
|
|
13
|
+
"description": "Definition of an event step that subscribes to specific topics",
|
|
14
|
+
"lines": [
|
|
15
|
+
"12",
|
|
16
|
+
"15-16"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "input-schema",
|
|
21
|
+
"title": "Input Schema",
|
|
22
|
+
"description": "Definition of the expected input data structure from the subscribed topic. Motia will automatically generate types based on this schema.",
|
|
23
|
+
"lines": [
|
|
24
|
+
"5-9",
|
|
25
|
+
"17"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "event-emits",
|
|
30
|
+
"title": "Emits",
|
|
31
|
+
"description": "We can define the events that this step will emit, triggering other Motia Steps.",
|
|
32
|
+
"lines": [
|
|
33
|
+
"17"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "handler",
|
|
38
|
+
"title": "Handler",
|
|
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
|
+
"lines": [
|
|
41
|
+
"21-50"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "state",
|
|
46
|
+
"title": "State Management",
|
|
47
|
+
"description": "The handler demonstrates state management by storing order data that can be accessed by other steps.",
|
|
48
|
+
"lines": [
|
|
49
|
+
"35"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "event-emission",
|
|
54
|
+
"title": "Event Emission",
|
|
55
|
+
"description": "After processing the order, the handler emits a new event to notify other steps about the new order.",
|
|
56
|
+
"lines": [
|
|
57
|
+
"37-50"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "logger",
|
|
62
|
+
"title": "Logger",
|
|
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
|
+
"lines": [
|
|
65
|
+
"22"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "step-configuration",
|
|
4
|
+
"title": "Step Configuration",
|
|
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
|
+
"lines": [
|
|
7
|
+
"3-10"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "cron-configuration",
|
|
12
|
+
"title": "Cron Configuration",
|
|
13
|
+
"description": "Cron steps require a specific configuration structure with the 'type' field set to 'cron' and a valid cron expression.",
|
|
14
|
+
"lines": [
|
|
15
|
+
"4-5"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "handler",
|
|
20
|
+
"title": "Cron Step Handler",
|
|
21
|
+
"description": "The Cron step handler only receives one argument.",
|
|
22
|
+
"lines": [
|
|
23
|
+
"12-39"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
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.8.5-beta.
|
|
4
|
+
"version": "0.8.5-beta.143-445618",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"python-ast": "^0.1.0",
|
|
47
47
|
"table": "^6.9.0",
|
|
48
48
|
"ts-node": "^10.9.2",
|
|
49
|
-
"@motiadev/core": "0.8.5-beta.
|
|
50
|
-
"@motiadev/
|
|
51
|
-
"@motiadev/
|
|
49
|
+
"@motiadev/core": "0.8.5-beta.143-445618",
|
|
50
|
+
"@motiadev/stream-client-node": "0.8.5-beta.143-445618",
|
|
51
|
+
"@motiadev/workbench": "0.8.5-beta.143-445618"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@amplitude/analytics-types": "^2.9.2",
|
/package/dist/cjs/create/templates/nodejs/{steps → tutorial}/petstore/api.step.ts-features.json.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/cjs/create/templates/python/{steps/petstore → tutorial}/api_step.py-features.json.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/esm/create/templates/nodejs/{steps → tutorial}/petstore/api.step.ts-features.json.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|