@aloma.io/integration-sdk 3.0.7-rc2 → 3.0.7-rc3
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/internal/index.mjs +16 -12
- package/build/internal/util/jwe/cli.mjs +1 -2
- package/build/internal/util/jwe/index.d.mts +1 -1
- package/build/internal/util/jwe/index.mjs +1 -1
- package/build/internal/websocket/config.d.mts +3 -2
- package/build/internal/websocket/config.mjs +2 -2
- package/build/internal/websocket/connection/constants.d.mts +5 -2
- package/build/internal/websocket/connection/constants.mjs +1 -2
- package/build/internal/websocket/connection/index.mjs +4 -5
- package/build/internal/websocket/connection/registration.mjs +3 -4
- package/build/internal/websocket/index.mjs +3 -3
- package/build/internal/websocket/transport/durable.mjs +1 -1
- package/build/internal/websocket/transport/index.mjs +6 -6
- package/build/internal/websocket/transport/packet.mjs +2 -2
- package/build/internal/websocket/transport/processor.mjs +1 -1
- package/package.json +1 -1
- package/src/internal/index.mjs +17 -12
- package/src/internal/util/jwe/cli.mjs +1 -1
- package/src/internal/util/jwe/index.mjs +1 -1
- package/src/internal/websocket/config.mjs +2 -2
- package/src/internal/websocket/connection/constants.mjs +1 -1
- package/src/internal/websocket/connection/index.mjs +4 -4
- package/src/internal/websocket/connection/registration.mjs +3 -3
- package/src/internal/websocket/index.mjs +3 -3
- package/src/internal/websocket/transport/durable.mjs +1 -1
- package/src/internal/websocket/transport/index.mjs +7 -6
- package/src/internal/websocket/transport/packet.mjs +2 -2
- package/src/internal/websocket/transport/processor.mjs +1 -1
package/build/internal/index.mjs
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
// @ts-nocheck
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
import dotenv from 'dotenv';
|
3
|
+
dotenv.config();
|
4
|
+
import fs from "node:fs";
|
5
|
+
import { Config } from "./websocket/config.mjs";
|
6
|
+
import { Connection } from "./websocket/connection/index.mjs";
|
7
|
+
import { Transport } from "./websocket/transport/index.mjs";
|
8
|
+
import { Dispatcher } from "./dispatcher/index.mjs";
|
9
|
+
import { WebsocketConnector } from "./websocket/index.mjs";
|
10
|
+
import JWE from "./util/jwe/index.mjs";
|
11
|
+
import fetch from "node-fetch";
|
12
|
+
import cuid from "@paralleldrive/cuid2";
|
13
|
+
import express from 'express';
|
14
|
+
import PromClient from 'prom-client';
|
15
|
+
cuid.init({ length: 32 });
|
12
16
|
// TODO fetch with retry
|
13
17
|
const handlePacketError = (packet, e, transport) => {
|
14
18
|
if (!packet.cb()) {
|
@@ -163,7 +167,7 @@ class Connector {
|
|
163
167
|
async run() {
|
164
168
|
var local = this;
|
165
169
|
const makeMetrics = () => {
|
166
|
-
const metrics =
|
170
|
+
const metrics = PromClient;
|
167
171
|
const defaultLabels = {
|
168
172
|
service: local.name,
|
169
173
|
connectorId: local.id,
|
@@ -175,7 +179,7 @@ class Connector {
|
|
175
179
|
return metrics;
|
176
180
|
};
|
177
181
|
const makeMetricsServer = (metrics) => {
|
178
|
-
const app =
|
182
|
+
const app = express();
|
179
183
|
app.get("/metrics", async (request, response, next) => {
|
180
184
|
response.status(200);
|
181
185
|
response.set("Content-type", metrics.contentType);
|
@@ -21,10 +21,10 @@ export class Config {
|
|
21
21
|
_data: {};
|
22
22
|
_privateKey: any;
|
23
23
|
_publicKey: any;
|
24
|
-
_jwe:
|
24
|
+
_jwe: JWE;
|
25
25
|
_introspect: any;
|
26
26
|
_configSchema: any;
|
27
|
-
validateKeys(algorithm: any): Promise<
|
27
|
+
validateKeys(algorithm: any): Promise<JWE>;
|
28
28
|
data(what: any): {};
|
29
29
|
introspect(): any;
|
30
30
|
configSchema(): any;
|
@@ -38,3 +38,4 @@ export class Config {
|
|
38
38
|
token(): any;
|
39
39
|
setToken(what: any): void;
|
40
40
|
}
|
41
|
+
import JWE from "../util/jwe/index.mjs";
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import C from "./connection/constants.mjs";
|
2
|
+
import JWE from "../util/jwe/index.mjs";
|
3
3
|
class Config {
|
4
4
|
constructor({ registrationToken, version, name, id, endpoint, wsEndpoint, privateKey, publicKey, introspect, configSchema, }) {
|
5
5
|
this._token = null;
|
@@ -1,2 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
declare namespace _default {
|
2
|
+
function augmentRequest(what: any, config: any): any;
|
3
|
+
function augmentRegistration(what: any, config: any): any;
|
4
|
+
}
|
5
|
+
export default _default;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import fetch from "node-fetch";
|
2
|
+
import { Registration } from "./registration.mjs";
|
3
|
+
import C from "./constants.mjs";
|
4
4
|
class Connection {
|
5
5
|
constructor({ config, onStart }) {
|
6
6
|
this.config = config;
|
@@ -48,5 +48,4 @@ class Connection {
|
|
48
48
|
}
|
49
49
|
}
|
50
50
|
}
|
51
|
-
|
52
|
-
export {};
|
51
|
+
export { Connection };
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import fetch from "node-fetch";
|
2
|
+
import C from "./constants.mjs";
|
3
3
|
class Registration {
|
4
4
|
constructor(config) {
|
5
5
|
this.config = config;
|
@@ -26,5 +26,4 @@ class Registration {
|
|
26
26
|
throw new Error("authentication failed");
|
27
27
|
}
|
28
28
|
}
|
29
|
-
|
30
|
-
export {};
|
29
|
+
export { Registration };
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import WebSocket from "ws";
|
2
|
+
import { Connection } from "./connection/index.mjs";
|
3
|
+
import { Transport } from "./transport/index.mjs";
|
4
4
|
class WebsocketConnector {
|
5
5
|
constructor({ config, onMessage, onConnect }) {
|
6
6
|
var local = this;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import C from "../connection/constants.mjs";
|
2
|
+
import cuid from "@paralleldrive/cuid2";
|
3
|
+
cuid.init({ length: 32 });
|
4
|
+
import { DurableWebsocket } from "./durable.mjs";
|
5
|
+
import WebSocket from "ws";
|
6
|
+
import { Packet, Callback } from "./packet.mjs";
|
7
7
|
const cleanInterval = 45 * 1000;
|
8
8
|
const pingInterval = 30 * 1000;
|
9
9
|
class Transport {
|
package/package.json
CHANGED
package/src/internal/index.mjs
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
// @ts-nocheck
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
import dotenv from 'dotenv';
|
3
|
+
dotenv.config();
|
4
|
+
import fs from "node:fs";
|
5
|
+
import { Config } from "./websocket/config.mjs";
|
6
|
+
import { Connection } from "./websocket/connection/index.mjs";
|
7
|
+
import { Transport } from "./websocket/transport/index.mjs";
|
8
|
+
import { Dispatcher } from "./dispatcher/index.mjs";
|
9
|
+
import { WebsocketConnector } from "./websocket/index.mjs";
|
10
|
+
import JWE from "./util/jwe/index.mjs";
|
11
|
+
import fetch from "node-fetch";
|
12
|
+
import cuid from "@paralleldrive/cuid2"
|
13
|
+
import express from 'express';
|
14
|
+
import PromClient from 'prom-client'
|
15
|
+
|
16
|
+
cuid.init({ length: 32 });
|
12
17
|
|
13
18
|
// TODO fetch with retry
|
14
19
|
|
@@ -209,7 +214,7 @@ class Connector {
|
|
209
214
|
var local = this;
|
210
215
|
|
211
216
|
const makeMetrics = () => {
|
212
|
-
const metrics =
|
217
|
+
const metrics = PromClient;
|
213
218
|
|
214
219
|
const defaultLabels = {
|
215
220
|
service: local.name,
|
@@ -224,7 +229,7 @@ class Connector {
|
|
224
229
|
};
|
225
230
|
|
226
231
|
const makeMetricsServer = (metrics) => {
|
227
|
-
const app =
|
232
|
+
const app = express();
|
228
233
|
|
229
234
|
app.get("/metrics", async (request, response, next) => {
|
230
235
|
response.status(200);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import fetch from "node-fetch";
|
2
|
+
import { Registration } from "./registration.mjs";
|
3
|
+
import C from "./constants.mjs";
|
4
4
|
|
5
5
|
class Connection {
|
6
6
|
constructor({ config, onStart }) {
|
@@ -67,4 +67,4 @@ class Connection {
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
|
70
|
-
|
70
|
+
export { Connection };
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import fetch from "node-fetch";
|
2
|
+
import C from "./constants.mjs";
|
3
3
|
|
4
4
|
class Registration {
|
5
5
|
constructor(config) {
|
@@ -37,4 +37,4 @@ class Registration {
|
|
37
37
|
}
|
38
38
|
}
|
39
39
|
|
40
|
-
|
40
|
+
export { Registration };
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import WebSocket from "ws";
|
2
|
+
import { Connection } from "./connection/index.mjs";
|
3
|
+
import { Transport } from "./transport/index.mjs";
|
4
4
|
|
5
5
|
class WebsocketConnector {
|
6
6
|
constructor({ config, onMessage, onConnect }) {
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import C from "../connection/constants.mjs";
|
2
|
+
import cuid from "@paralleldrive/cuid2"
|
3
|
+
cuid.init({ length: 32 });
|
4
|
+
|
5
|
+
import { DurableWebsocket } from "./durable.mjs";
|
6
|
+
import WebSocket from "ws";
|
7
|
+
import { Packet, Callback } from "./packet.mjs";
|
7
8
|
|
8
9
|
const cleanInterval = 45 * 1000;
|
9
10
|
const pingInterval = 30 * 1000;
|