@aloma.io/integration-sdk 3.3.41 → 3.3.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.
@@ -45,7 +45,7 @@ export default class RuntimeContext {
45
45
  });
46
46
  configuration.types(data.types).resolvers(resolvers);
47
47
  if (data.options?.endpoint?.enabled) {
48
- configuration.endpoint((arg) => controller.__endpoint(arg));
48
+ configuration.endpoint((arg) => controller.__endpoint(arg), data.options?.endpoint?.required);
49
49
  }
50
50
  if (data.auth?.oauth) {
51
51
  configuration.oauth(data.auth?.oauth);
@@ -78,5 +78,7 @@ declare function ${member.getName()}(${params}): ${retVal};
78
78
  };
79
79
  export default async (path) => {
80
80
  const parsed = await parseFromFiles([path]);
81
+ if (parsed.errors?.length)
82
+ throw new Error(path + ' ' + JSON.stringify(parsed.errors));
81
83
  return transform(parsed.project?.getModules() || []);
82
84
  };
@@ -14,7 +14,7 @@ export class Dispatcher {
14
14
  }): this;
15
15
  resolvers(what: any): this;
16
16
  _resolvers: any;
17
- endpoint(what: any): this;
17
+ endpoint(what: any, notOptional: any): this;
18
18
  startOAuth(): void;
19
19
  finishOAuth(): void;
20
20
  build(): {
@@ -86,7 +86,7 @@ ${arg.configurableClientScope}
86
86
  this._resolvers = { ...this._resolvers, ...what };
87
87
  return this;
88
88
  }
89
- endpoint(what) {
89
+ endpoint(what, notOptional) {
90
90
  this.config({
91
91
  fields: {
92
92
  _endpointToken: {
@@ -94,7 +94,7 @@ ${arg.configurableClientScope}
94
94
  placeholder: "e.g. 1234",
95
95
  type: "line",
96
96
  plain: true,
97
- optional: true,
97
+ optional: !notOptional,
98
98
  },
99
99
  },
100
100
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.3.41",
3
+ "version": "3.3.43",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -56,7 +56,7 @@ export default class RuntimeContext {
56
56
  configuration.types(data.types).resolvers(resolvers);
57
57
 
58
58
  if (data.options?.endpoint?.enabled) {
59
- configuration.endpoint((arg) => controller.__endpoint(arg));
59
+ configuration.endpoint((arg) => controller.__endpoint(arg), data.options?.endpoint?.required);
60
60
  }
61
61
 
62
62
  if (data.auth?.oauth) {
@@ -101,5 +101,6 @@ declare function ${member.getName()}(${params}): ${retVal};
101
101
 
102
102
  export default async (path: string) => {
103
103
  const parsed = await parseFromFiles([path]);
104
+ if (parsed.errors?.length) throw new Error(path + ' ' + JSON.stringify(parsed.errors));
104
105
  return transform(parsed.project?.getModules() || []);
105
106
  };
@@ -102,7 +102,7 @@ ${arg.configurableClientScope}
102
102
  return this;
103
103
  }
104
104
 
105
- endpoint(what) {
105
+ endpoint(what, notOptional) {
106
106
  this.config({
107
107
  fields: {
108
108
  _endpointToken: {
@@ -110,7 +110,7 @@ ${arg.configurableClientScope}
110
110
  placeholder: "e.g. 1234",
111
111
  type: "line",
112
112
  plain: true,
113
- optional: true,
113
+ optional: !notOptional,
114
114
  },
115
115
  },
116
116
  });