@motiadev/core 0.8.5-beta.142 → 0.8.5-beta.143-790863

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 +1 @@
1
- {"version":3,"file":"step-endpoint.d.ts","sourceRoot":"","sources":["../../../src/endpoints/step-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAiBhD,eAAO,MAAM,YAAY,GAAI,KAAK,OAAO,EAAE,YAAY,UAAU,SAwBhE,CAAA"}
1
+ {"version":3,"file":"step-endpoint.d.ts","sourceRoot":"","sources":["../../../src/endpoints/step-endpoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAiBhD,eAAO,MAAM,YAAY,GAAI,KAAK,OAAO,EAAE,YAAY,UAAU,SA0BhE,CAAA"}
@@ -4,18 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.stepEndpoint = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
7
8
  const promises_1 = __importDefault(require("fs/promises"));
8
9
  const flows_helper_1 = require("../helper/flows-helper");
9
10
  const getFeatures = async (filePath) => {
10
- const stat = await promises_1.default.stat(filePath + '-features.json').catch(() => null);
11
+ const stat = await promises_1.default.stat(`${filePath}-features.json`).catch(() => null);
11
12
  if (!stat || stat.isDirectory()) {
12
13
  return [];
13
14
  }
14
15
  try {
15
- const content = await promises_1.default.readFile(filePath + '-features.json', 'utf8');
16
+ const content = await promises_1.default.readFile(`${filePath}-features.json`, 'utf8');
16
17
  return JSON.parse(content);
17
18
  }
18
- catch (error) {
19
+ catch {
19
20
  return [];
20
21
  }
21
22
  };
@@ -30,7 +31,7 @@ const stepEndpoint = (app, lockedData) => {
30
31
  }
31
32
  try {
32
33
  const content = await promises_1.default.readFile(step.filePath, 'utf8');
33
- const features = await getFeatures(step.filePath);
34
+ const features = await getFeatures(step.filePath.replace(`${node_path_1.default.sep}steps${node_path_1.default.sep}`, `${node_path_1.default.sep}tutorial${node_path_1.default.sep}`));
34
35
  res.status(200).send({ id, content, features });
35
36
  }
36
37
  catch (error) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@motiadev/core",
3
3
  "description": "Core functionality for the Motia framework, providing the foundation for building event-driven workflows.",
4
4
  "main": "dist/index.js",
5
- "version": "0.8.5-beta.142",
5
+ "version": "0.8.5-beta.143-790863",
6
6
  "dependencies": {
7
7
  "@amplitude/analytics-node": "^1.3.8",
8
8
  "ajv": "^8.17.1",