@aloma.io/integration-sdk 3.3.34 → 3.3.35
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,5 +1,6 @@
|
|
1
1
|
import { AbstractController } from "../controller/index.mjs";
|
2
2
|
import { Connector } from "../internal/index.mjs";
|
3
|
+
import fs from "node:fs";
|
3
4
|
export default class RuntimeContext {
|
4
5
|
controller;
|
5
6
|
data;
|
@@ -13,11 +14,20 @@ export default class RuntimeContext {
|
|
13
14
|
throw new Error("the controller needs to extend AbstractController");
|
14
15
|
const data = this.data;
|
15
16
|
console.log(data, data.icon);
|
17
|
+
let icon;
|
18
|
+
try {
|
19
|
+
if (data.icon) {
|
20
|
+
icon = fs.readFileSync(data.icon).toString('base64');
|
21
|
+
}
|
22
|
+
}
|
23
|
+
catch (e) {
|
24
|
+
// blank
|
25
|
+
}
|
16
26
|
const connector = new Connector({
|
17
27
|
id: data.id,
|
18
28
|
version: data.version,
|
19
29
|
name: `${data.id}/${data.version}`,
|
20
|
-
icon
|
30
|
+
icon
|
21
31
|
});
|
22
32
|
const configuration = connector.configure().config(data.config || {});
|
23
33
|
const resolvers = {};
|
package/package.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { AbstractController } from "../controller/index.mjs";
|
2
2
|
import { Connector } from "../internal/index.mjs";
|
3
|
-
|
3
|
+
import fs from "node:fs";
|
4
|
+
|
4
5
|
export default class RuntimeContext {
|
5
6
|
constructor(
|
6
7
|
private controller: AbstractController,
|
@@ -15,12 +16,25 @@ export default class RuntimeContext {
|
|
15
16
|
const data: any = this.data;
|
16
17
|
|
17
18
|
console.log(data, data.icon)
|
19
|
+
|
20
|
+
let icon;
|
21
|
+
|
22
|
+
try
|
23
|
+
{
|
24
|
+
if (data.icon)
|
25
|
+
{
|
26
|
+
icon = fs.readFileSync(data.icon).toString('base64');
|
27
|
+
}
|
28
|
+
} catch(e) {
|
29
|
+
// blank
|
30
|
+
}
|
31
|
+
|
18
32
|
|
19
33
|
const connector = new Connector({
|
20
34
|
id: data.id,
|
21
35
|
version: data.version,
|
22
36
|
name: `${data.id}/${data.version}`,
|
23
|
-
icon
|
37
|
+
icon
|
24
38
|
});
|
25
39
|
|
26
40
|
const configuration = connector.configure().config(data.config || {});
|