@aloma.io/integration-sdk 3.7.42 → 3.7.44

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.
@@ -33,6 +33,7 @@ export default class RuntimeContext {
33
33
  const resolvers = {};
34
34
  const methods = [
35
35
  ...data.methods,
36
+ "__autocomplete",
36
37
  "__endpoint",
37
38
  "__configQuery",
38
39
  "__default",
package/build/cli.mjs CHANGED
File without changes
@@ -4,6 +4,7 @@ export declare abstract class AbstractController {
4
4
  protected start(): Promise<void>;
5
5
  protected stop(isShutdown?: boolean): Promise<void>;
6
6
  protected configQuery(arg: any): Promise<any>;
7
+ protected autocomplete(arg: any): Promise<any>;
7
8
  protected fallback(arg: any): Promise<any>;
8
9
  protected endpoint(arg: any): Promise<any>;
9
10
  protected newTask(name: string, data: any): Promise<string>;
@@ -32,6 +33,7 @@ export declare abstract class AbstractController {
32
33
  protected healthCheck(): Promise<any>;
33
34
  __endpoint(arg: any): Promise<any | null>;
34
35
  __configQuery(arg: any): Promise<any | null>;
36
+ __autocomplete(arg: any): Promise<any | null>;
35
37
  __default(arg: any): Promise<any | null>;
36
38
  __healthCheck(): Promise<any>;
37
39
  _doStart(config: any, client: any, newTask: any, updateTask: any, getClient: any, getBlob: any, getBlobContent: any, createBlob: any): Promise<void>;
@@ -6,6 +6,9 @@ export class AbstractController {
6
6
  configQuery(arg) {
7
7
  return Promise.resolve({});
8
8
  }
9
+ autocomplete(arg) {
10
+ return Promise.resolve({});
11
+ }
9
12
  fallback(arg) {
10
13
  throw new Error("method not found");
11
14
  }
@@ -39,6 +42,9 @@ export class AbstractController {
39
42
  async __configQuery(arg) {
40
43
  return this.configQuery(arg);
41
44
  }
45
+ async __autocomplete(arg) {
46
+ return this.autocomplete(arg);
47
+ }
42
48
  async __default(arg) {
43
49
  return this.fallback(arg);
44
50
  }
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.44",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -39,6 +39,7 @@ export default class RuntimeContext {
39
39
  const resolvers: any = {};
40
40
  const methods: string[] = [
41
41
  ...data.methods,
42
+ "__autocomplete",
42
43
  "__endpoint",
43
44
  "__configQuery",
44
45
  "__default",
@@ -9,6 +9,10 @@ export abstract class AbstractController {
9
9
  protected configQuery(arg: any): Promise<any> {
10
10
  return Promise.resolve({});
11
11
  }
12
+
13
+ protected autocomplete(arg: any): Promise<any> {
14
+ return Promise.resolve({});
15
+ }
12
16
 
13
17
  protected fallback(arg: any): Promise<any> {
14
18
  throw new Error("method not found");
@@ -81,6 +85,10 @@ export abstract class AbstractController {
81
85
  async __configQuery(arg: any): Promise<any | null> {
82
86
  return this.configQuery(arg);
83
87
  }
88
+
89
+ async __autocomplete(arg: any): Promise<any | null> {
90
+ return this.autocomplete(arg);
91
+ }
84
92
 
85
93
  async __default(arg: any): Promise<any | null> {
86
94
  return this.fallback(arg);
@@ -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 {};