@aloma.io/integration-sdk 3.1.1 → 3.1.3

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.
@@ -43,7 +43,7 @@ export class Builder {
43
43
  async discoverTypes() {
44
44
  notEmpty(this.data.controller, "controller");
45
45
  const content = fs.readFileSync(this.data.controller);
46
- const { text, methods } = parseTypes(this.data.controller);
46
+ const { text, methods } = await parseTypes(this.data.controller);
47
47
  this.data.types = text;
48
48
  this.data.methods = methods;
49
49
  }
@@ -1,5 +1,5 @@
1
- declare const _default: (path: string) => {
1
+ declare const _default: (path: string) => Promise<{
2
2
  text: any;
3
3
  methods: string[];
4
- };
4
+ }>;
5
5
  export default _default;
@@ -49,8 +49,8 @@ const transform = (meta) => {
49
49
  })
50
50
  .join(", ");
51
51
  const retVal = sig
52
- .getReturnType()
53
- .type.text.replace(/^Promise</, "")
52
+ .serialize()
53
+ .return.type.text.replace(/^Promise</, "")
54
54
  .replace(/>$/, "");
55
55
  return `
56
56
  /**
@@ -66,6 +66,7 @@ declare function ${member.getName()}(${params}): ${retVal};
66
66
  .join("");
67
67
  return { text, methods: Object.keys(methods) };
68
68
  };
69
- export default (path) => {
70
- return transform(parseFromFiles([path]));
69
+ export default async (path) => {
70
+ const parsed = await parseFromFiles([path]);
71
+ return transform(parsed?.result || []);
71
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -27,6 +27,7 @@
27
27
  "dependencies": {
28
28
  "@paralleldrive/cuid2": "^2",
29
29
  "@ts-ast-parser/core": "^0",
30
+ "@types/node": "^18",
30
31
  "commander": "^11",
31
32
  "dotenv": "*",
32
33
  "express": "^4",
@@ -40,7 +41,6 @@
40
41
  "utf-8-validate": "^6"
41
42
  },
42
43
  "devDependencies": {
43
- "@types/node": "^18",
44
44
  "mocha": "^10",
45
45
  "prettier": "^3",
46
46
  "typescript": "^5"
@@ -63,7 +63,7 @@ export class Builder {
63
63
  notEmpty(this.data.controller, "controller");
64
64
 
65
65
  const content = fs.readFileSync(this.data.controller);
66
- const { text, methods } = parseTypes(this.data.controller);
66
+ const { text, methods } = await parseTypes(this.data.controller);
67
67
 
68
68
  this.data.types = text;
69
69
  this.data.methods = methods;
@@ -67,8 +67,8 @@ const transform = (meta: any) => {
67
67
  .join(", ");
68
68
 
69
69
  const retVal = sig
70
- .getReturnType()
71
- .type.text.replace(/^Promise</, "")
70
+ .serialize()
71
+ .return.type.text.replace(/^Promise</, "")
72
72
  .replace(/>$/, "");
73
73
 
74
74
  return `
@@ -87,6 +87,7 @@ declare function ${member.getName()}(${params}): ${retVal};
87
87
  return { text, methods: Object.keys(methods) };
88
88
  };
89
89
 
90
- export default (path: string) => {
91
- return transform(parseFromFiles([path]));
90
+ export default async (path: string) => {
91
+ const parsed = await parseFromFiles([path]);
92
+ return transform(parsed?.result || []);
92
93
  };