@aloma.io/integration-sdk 3.7.42 → 3.7.43

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/build/cli.mjs CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.7.42",
3
+ "version": "3.7.43",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -1,4 +1,4 @@
1
- FROM node:20-alpine3.19
1
+ FROM node:20-alpine3.20
2
2
 
3
3
  ENV NODE_ENV production
4
4
 
@@ -1,5 +0,0 @@
1
- declare const _default: (path: string) => Promise<{
2
- text: any;
3
- methods: string[];
4
- }>;
5
- export default _default;
@@ -1,79 +0,0 @@
1
- import { parseFromFiles } from "@ts-ast-parser/core";
2
- const transform = (meta) => {
3
- if (!meta?.length)
4
- throw new Error("metadata is empty");
5
- meta = meta[0];
6
- if (meta.getDeclarations()?.length !== 1) {
7
- throw new Error("connector file needs to export default class");
8
- }
9
- const methods = {};
10
- const decl = meta.getDeclarations()[0];
11
- const members = decl.getMethods().filter((member) => {
12
- return !(member.isStatic() ||
13
- member.isInherited() ||
14
- member.getKind() !== "Method" ||
15
- member.getModifier() !== "public" ||
16
- member.getName().startsWith("_"));
17
- });
18
- const text = members
19
- .map((member) => {
20
- methods[member.getName()] = true;
21
- return member
22
- .getSignatures()
23
- .map((sig) => {
24
- const docs = sig.getJSDoc().serialize() || [];
25
- const desc = docs.find((what) => what.kind === "description")?.value;
26
- const example = docs.find((what) => what.kind === "example")?.value;
27
- let eg;
28
- if (example) {
29
- const parts = example.split(/```/);
30
- const backticks = "```";
31
- eg = `@example ${parts[0] || "usage"}\n${backticks}${parts[1]}${backticks}`;
32
- }
33
- const paramDocs = docs.filter((what) => what.kind === "param");
34
- const params = sig
35
- .getParameters()
36
- .filter((param) => param.isNamed())
37
- .map((param) => {
38
- const serialized = param.serialize();
39
- const prefix = param
40
- .getNamedElements()
41
- .map((p) => {
42
- const defaultVal = p.getDefault() != null ? " = " + p.getDefault() : "";
43
- return `${p.getName()}${defaultVal}`;
44
- })
45
- .join("; ");
46
- const suffix = serialized.type.properties
47
- .map((p) => {
48
- const comment = paramDocs.find((what) => what.value.name === p.name);
49
- const desc = (comment?.value.description || "").replace(/\\@/gi, "@");
50
- return `\n/**\n${desc}\n */\n ${p.name}: ${p.type.text}`;
51
- })
52
- .join("; ");
53
- return `{${prefix}}: {${suffix}}`;
54
- })
55
- .join(", ");
56
- const retVal = sig
57
- .serialize()
58
- .return.type.text.replace(/^Promise</, "")
59
- .replace(/>$/, "");
60
- return `
61
- /**
62
- * ${desc || ""}
63
- *
64
- * ${eg || ""}
65
- **/
66
- declare function ${member.getName()}(${params}): ${retVal};
67
- `;
68
- })
69
- .join("\n");
70
- })
71
- .join("");
72
- return { text, methods: Object.keys(methods) };
73
- };
74
- export default async (path) => {
75
- const parsed = await parseFromFiles([path]);
76
- if (parsed.errors?.length)
77
- throw new Error(path + " " + JSON.stringify(parsed.errors));
78
- return transform(parsed.project?.getModules() || []);
79
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};