@aloma.io/integration-sdk 3.0.6 → 3.0.7-rc2

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.
Files changed (44) hide show
  1. package/build/builder/runtime-context.mjs +1 -1
  2. package/build/cli.mjs +1 -1
  3. package/build/internal/dispatcher/{index.cjs → index.mjs} +1 -3
  4. package/build/internal/{index.d.cts → index.d.mts} +1 -1
  5. package/build/internal/{index.cjs → index.mjs} +7 -9
  6. package/build/internal/util/jwe/{cli.cjs → cli.mjs} +2 -3
  7. package/build/internal/util/jwe/{index.d.cts → index.d.mts} +1 -1
  8. package/build/internal/util/jwe/{index.cjs → index.mjs} +1 -3
  9. package/build/internal/websocket/{config.d.cts → config.d.mts} +2 -3
  10. package/build/internal/websocket/{config.cjs → config.mjs} +3 -5
  11. package/build/internal/websocket/connection/{constants.cjs → constants.mjs} +1 -2
  12. package/build/internal/websocket/connection/{index.cjs → index.mjs} +1 -2
  13. package/build/internal/websocket/connection/{registration.cjs → registration.mjs} +1 -2
  14. package/build/internal/websocket/{index.d.cts → index.d.mts} +2 -2
  15. package/build/internal/websocket/{index.cjs → index.mjs} +3 -5
  16. package/build/internal/websocket/transport/{durable.cjs → durable.mjs} +1 -3
  17. package/build/internal/websocket/transport/{index.d.cts → index.d.mts} +2 -2
  18. package/build/internal/websocket/transport/{index.cjs → index.mjs} +4 -6
  19. package/build/internal/websocket/transport/{packet.cjs → packet.mjs} +1 -3
  20. package/build/internal/websocket/transport/{processor.cjs → processor.mjs} +2 -4
  21. package/package.json +2 -2
  22. package/src/builder/runtime-context.mts +1 -1
  23. package/src/cli.mts +1 -1
  24. package/src/internal/dispatcher/{index.cjs → index.mjs} +1 -1
  25. package/src/internal/{index.cjs → index.mjs} +7 -7
  26. package/src/internal/util/jwe/{cli.cjs → cli.mjs} +1 -1
  27. package/src/internal/util/jwe/{index.cjs → index.mjs} +1 -1
  28. package/src/internal/websocket/{config.cjs → config.mjs} +3 -3
  29. package/src/internal/websocket/{index.cjs → index.mjs} +3 -3
  30. package/src/internal/websocket/transport/{durable.cjs → durable.mjs} +1 -1
  31. package/src/internal/websocket/transport/{index.cjs → index.mjs} +4 -4
  32. package/src/internal/websocket/transport/{packet.cjs → packet.mjs} +1 -1
  33. package/src/internal/websocket/transport/{processor.cjs → processor.mjs} +2 -2
  34. /package/build/internal/dispatcher/{index.d.cts → index.d.mts} +0 -0
  35. /package/build/internal/util/jwe/{cli.d.cts → cli.d.mts} +0 -0
  36. /package/build/internal/websocket/connection/{constants.d.cts → constants.d.mts} +0 -0
  37. /package/build/internal/websocket/connection/{index.d.cts → index.d.mts} +0 -0
  38. /package/build/internal/websocket/connection/{registration.d.cts → registration.d.mts} +0 -0
  39. /package/build/internal/websocket/transport/{durable.d.cts → durable.d.mts} +0 -0
  40. /package/build/internal/websocket/transport/{packet.d.cts → packet.d.mts} +0 -0
  41. /package/build/internal/websocket/transport/{processor.d.cts → processor.d.mts} +0 -0
  42. /package/src/internal/websocket/connection/{constants.cjs → constants.mjs} +0 -0
  43. /package/src/internal/websocket/connection/{index.cjs → index.mjs} +0 -0
  44. /package/src/internal/websocket/connection/{registration.cjs → registration.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { AbstractController } from "../controller/index.mjs";
2
- import { Connector } from "../internal/index.cjs";
2
+ import { Connector } from "../internal/index.mjs";
3
3
  export default class RuntimeContext {
4
4
  controller;
5
5
  data;
package/build/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import { Command } from "commander";
3
3
  import fs from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import path from "node:path";
6
- import JWE from './internal/util/jwe/index.cjs';
6
+ import JWE from './internal/util/jwe/index.mjs';
7
7
  import util from 'node:util';
8
8
  import ChildProcess from 'node:child_process';
9
9
  const exec = util.promisify(ChildProcess.exec);
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  class Dispatcher {
4
2
  constructor() {
5
3
  this._config = { fields: {} };
@@ -158,4 +156,4 @@ class Dispatcher {
158
156
  };
159
157
  }
160
158
  }
161
- module.exports = { Dispatcher };
159
+ export { Dispatcher };
@@ -11,4 +11,4 @@ export class Connector {
11
11
  dispatcher: Dispatcher | undefined;
12
12
  run(): Promise<void>;
13
13
  }
14
- import { Dispatcher } from "./dispatcher/index.cjs";
14
+ import { Dispatcher } from "./dispatcher/index.mjs";
@@ -1,14 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  // @ts-nocheck
4
2
  require("dotenv").config();
5
3
  const fs = require("fs");
6
- const { Config } = require("./websocket/config.cjs");
7
- const { Connection } = require("./websocket/connection/index.cjs");
8
- const { Transport } = require("./websocket/transport/index.cjs");
9
- const { Dispatcher } = require("./dispatcher/index.cjs");
10
- const { WebsocketConnector } = require("./websocket/index.cjs");
11
- const JWE = require("./util/jwe/index.cjs");
4
+ const { Config } = require("./websocket/config.mjs");
5
+ const { Connection } = require("./websocket/connection/index.mjs");
6
+ const { Transport } = require("./websocket/transport/index.mjs");
7
+ const { Dispatcher } = require("./dispatcher/index.mjs");
8
+ const { WebsocketConnector } = require("./websocket/index.mjs");
9
+ const JWE = require("./util/jwe/index.mjs");
12
10
  const fetch = require("node-fetch");
13
11
  const cuid = require("@paralleldrive/cuid2").init({ length: 32 });
14
12
  // TODO fetch with retry
@@ -473,4 +471,4 @@ ${text}
473
471
  await server.start();
474
472
  }
475
473
  }
476
- module.exports = { Connector };
474
+ export { Connector };
@@ -1,6 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const JWE = require("./index");
1
+ const JWE = require("./index.mjs");
4
2
  const main = async () => {
5
3
  const jwe = new JWE({});
6
4
  await jwe.newPair();
@@ -11,3 +9,4 @@ const main = async () => {
11
9
  };
12
10
  setTimeout(() => null, 100);
13
11
  main();
12
+ export {};
@@ -1,4 +1,4 @@
1
- export = JWE;
1
+ export default JWE;
2
2
  declare class JWE {
3
3
  constructor({ algorithm }: {
4
4
  algorithm?: string | undefined;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const jose = require("jose");
4
2
  class JWE {
5
3
  constructor({ algorithm = "PS256" }) {
@@ -54,4 +52,4 @@ class JWE {
54
52
  return payload._data;
55
53
  }
56
54
  }
57
- module.exports = JWE;
55
+ export default JWE;
@@ -21,10 +21,10 @@ export class Config {
21
21
  _data: {};
22
22
  _privateKey: any;
23
23
  _publicKey: any;
24
- _jwe: JWE;
24
+ _jwe: any;
25
25
  _introspect: any;
26
26
  _configSchema: any;
27
- validateKeys(algorithm: any): Promise<JWE>;
27
+ validateKeys(algorithm: any): Promise<any>;
28
28
  data(what: any): {};
29
29
  introspect(): any;
30
30
  configSchema(): any;
@@ -38,4 +38,3 @@ export class Config {
38
38
  token(): any;
39
39
  setToken(what: any): void;
40
40
  }
41
- import JWE = require("../util/jwe/index.cjs");
@@ -1,7 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const C = require("./connection/constants.cjs");
4
- const JWE = require("../util/jwe/index.cjs");
1
+ const C = require("./connection/constants.mjs");
2
+ const JWE = require("../util/jwe/index.mjs");
5
3
  class Config {
6
4
  constructor({ registrationToken, version, name, id, endpoint, wsEndpoint, privateKey, publicKey, introspect, configSchema, }) {
7
5
  this._token = null;
@@ -76,4 +74,4 @@ class Config {
76
74
  this._token = what;
77
75
  }
78
76
  }
79
- module.exports = { Config };
77
+ export { Config };
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const AUTHORIZATION = "Authorization";
4
2
  module.exports = {
5
3
  augmentRequest: (what, config) => {
@@ -19,3 +17,4 @@ module.exports = {
19
17
  return what;
20
18
  },
21
19
  };
20
+ export {};
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const fetch = require("node-fetch");
4
2
  const { Registration } = require("./registration.cjs");
5
3
  const C = require("./constants.cjs");
@@ -51,3 +49,4 @@ class Connection {
51
49
  }
52
50
  }
53
51
  module.exports = { Connection };
52
+ export {};
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const fetch = require("node-fetch");
4
2
  const C = require("./constants.cjs");
5
3
  class Registration {
@@ -29,3 +27,4 @@ class Registration {
29
27
  }
30
28
  }
31
29
  module.exports = { Registration };
30
+ export {};
@@ -12,5 +12,5 @@ export class WebsocketConnector {
12
12
  close(): Promise<void>;
13
13
  leaving(): Promise<void>;
14
14
  }
15
- import { Transport } from "./transport/index.cjs";
16
- import { Connection } from "./connection/index.cjs";
15
+ import { Transport } from "./transport/index.mjs";
16
+ import { Connection } from "./connection/index.mjs";
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const WebSocket = require("ws");
4
- const { Connection } = require("./connection/index.cjs");
5
- const { Transport } = require("./transport/index.cjs");
2
+ const { Connection } = require("./connection/index.mjs");
3
+ const { Transport } = require("./transport/index.mjs");
6
4
  class WebsocketConnector {
7
5
  constructor({ config, onMessage, onConnect }) {
8
6
  var local = this;
@@ -38,4 +36,4 @@ class WebsocketConnector {
38
36
  await local.connection.close();
39
37
  }
40
38
  }
41
- module.exports = { WebsocketConnector };
39
+ export { WebsocketConnector };
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const WebSocket = require("ws");
4
2
  class DurableWebsocket {
5
3
  constructor({ endpoint, secret, onConnect, onMessage }) {
@@ -58,4 +56,4 @@ class DurableWebsocket {
58
56
  await this.ws?.close();
59
57
  }
60
58
  }
61
- module.exports = { DurableWebsocket };
59
+ export { DurableWebsocket };
@@ -33,5 +33,5 @@ export class Transport {
33
33
  close(): void;
34
34
  connected: boolean | undefined;
35
35
  }
36
- import { DurableWebsocket } from "./durable.cjs";
37
- import { Packet } from "./packet.cjs";
36
+ import { DurableWebsocket } from "./durable.mjs";
37
+ import { Packet } from "./packet.mjs";
@@ -1,11 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const fetch = require("node-fetch");
4
- const C = require("../connection/constants.cjs");
2
+ const C = require("../connection/constants.mjs");
5
3
  const cuid = require("@paralleldrive/cuid2").init({ length: 32 });
6
- const { DurableWebsocket } = require("./durable.cjs");
4
+ const { DurableWebsocket } = require("./durable.mjs");
7
5
  const WebSocket = require("ws");
8
- const { Packet, Callback } = require("./packet.cjs");
6
+ const { Packet, Callback } = require("./packet.mjs");
9
7
  const cleanInterval = 45 * 1000;
10
8
  const pingInterval = 30 * 1000;
11
9
  class Transport {
@@ -145,4 +143,4 @@ class Transport {
145
143
  }
146
144
  }
147
145
  }
148
- module.exports = { Transport };
146
+ export { Transport };
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const fetch = require("node-fetch");
4
2
  const cuid = require("@paralleldrive/cuid2").init({ length: 32 });
5
3
  class Packet {
@@ -41,4 +39,4 @@ class Callback {
41
39
  this.created = Date.now();
42
40
  }
43
41
  }
44
- module.exports = { Callback, Packet };
42
+ export { Callback, Packet };
@@ -1,6 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const { Packet, Callback } = require("./packet.cjs");
1
+ const { Packet, Callback } = require("./packet.mjs");
4
2
  class Processor {
5
3
  constructor({ transport, processPacket }) {
6
4
  var local = this;
@@ -55,4 +53,4 @@ class Processor {
55
53
  }
56
54
  }
57
55
  }
58
- module.exports = { Processor };
56
+ export { Processor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.0.6",
3
+ "version": "3.0.7-rc2",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "dotenv": "*",
32
32
  "express": "^4",
33
33
  "jose": "^4",
34
- "node-fetch": "^2",
34
+ "node-fetch": "^3",
35
35
  "prom-client": "^14",
36
36
  "ws": "^8"
37
37
  },
@@ -1,5 +1,5 @@
1
1
  import { AbstractController } from "../controller/index.mjs";
2
- import { Connector } from "../internal/index.cjs";
2
+ import { Connector } from "../internal/index.mjs";
3
3
 
4
4
  export default class RuntimeContext {
5
5
  constructor(private controller: AbstractController, private data: any) {}
package/src/cli.mts CHANGED
@@ -4,7 +4,7 @@ import { Command } from "commander";
4
4
  import fs from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import path from "node:path";
7
- import JWE from './internal/util/jwe/index.cjs'
7
+ import JWE from './internal/util/jwe/index.mjs'
8
8
  import util from 'node:util';
9
9
  import ChildProcess from 'node:child_process';
10
10
 
@@ -202,4 +202,4 @@ class Dispatcher {
202
202
  }
203
203
  }
204
204
 
205
- module.exports = { Dispatcher };
205
+ export {Dispatcher};
@@ -1,12 +1,12 @@
1
1
  // @ts-nocheck
2
2
  require("dotenv").config();
3
3
  const fs = require("fs");
4
- const { Config } = require("./websocket/config.cjs");
5
- const { Connection } = require("./websocket/connection/index.cjs");
6
- const { Transport } = require("./websocket/transport/index.cjs");
7
- const { Dispatcher } = require("./dispatcher/index.cjs");
8
- const { WebsocketConnector } = require("./websocket/index.cjs");
9
- const JWE = require("./util/jwe/index.cjs");
4
+ const { Config } = require("./websocket/config.mjs");
5
+ const { Connection } = require("./websocket/connection/index.mjs");
6
+ const { Transport } = require("./websocket/transport/index.mjs");
7
+ const { Dispatcher } = require("./dispatcher/index.mjs");
8
+ const { WebsocketConnector } = require("./websocket/index.mjs");
9
+ const JWE = require("./util/jwe/index.mjs");
10
10
  const fetch = require("node-fetch");
11
11
  const cuid = require("@paralleldrive/cuid2").init({ length: 32 });
12
12
 
@@ -585,4 +585,4 @@ ${text}
585
585
  }
586
586
  }
587
587
 
588
- module.exports = { Connector };
588
+ export {Connector};
@@ -1,4 +1,4 @@
1
- const JWE = require("./index");
1
+ const JWE = require("./index.mjs");
2
2
 
3
3
  const main = async () => {
4
4
  const jwe = new JWE({});
@@ -70,4 +70,4 @@ class JWE {
70
70
  }
71
71
  }
72
72
 
73
- module.exports = JWE;
73
+ export default JWE;
@@ -1,5 +1,5 @@
1
- const C = require("./connection/constants.cjs");
2
- const JWE = require("../util/jwe/index.cjs");
1
+ const C = require("./connection/constants.mjs");
2
+ const JWE = require("../util/jwe/index.mjs");
3
3
 
4
4
  class Config {
5
5
  constructor({
@@ -104,4 +104,4 @@ class Config {
104
104
  }
105
105
  }
106
106
 
107
- module.exports = { Config };
107
+ export { Config };
@@ -1,6 +1,6 @@
1
1
  const WebSocket = require("ws");
2
- const { Connection } = require("./connection/index.cjs");
3
- const { Transport } = require("./transport/index.cjs");
2
+ const { Connection } = require("./connection/index.mjs");
3
+ const { Transport } = require("./transport/index.mjs");
4
4
 
5
5
  class WebsocketConnector {
6
6
  constructor({ config, onMessage, onConnect }) {
@@ -43,4 +43,4 @@ class WebsocketConnector {
43
43
  }
44
44
  }
45
45
 
46
- module.exports = { WebsocketConnector };
46
+ export { WebsocketConnector };
@@ -68,4 +68,4 @@ class DurableWebsocket {
68
68
  }
69
69
  }
70
70
 
71
- module.exports = { DurableWebsocket };
71
+ export { DurableWebsocket };
@@ -1,9 +1,9 @@
1
1
  const fetch = require("node-fetch");
2
- const C = require("../connection/constants.cjs");
2
+ const C = require("../connection/constants.mjs");
3
3
  const cuid = require("@paralleldrive/cuid2").init({ length: 32 });
4
- const { DurableWebsocket } = require("./durable.cjs");
4
+ const { DurableWebsocket } = require("./durable.mjs");
5
5
  const WebSocket = require("ws");
6
- const { Packet, Callback } = require("./packet.cjs");
6
+ const { Packet, Callback } = require("./packet.mjs");
7
7
 
8
8
  const cleanInterval = 45 * 1000;
9
9
  const pingInterval = 30 * 1000;
@@ -184,4 +184,4 @@ class Transport {
184
184
  }
185
185
  }
186
186
 
187
- module.exports = { Transport };
187
+ export { Transport };
@@ -51,4 +51,4 @@ class Callback {
51
51
  }
52
52
  }
53
53
 
54
- module.exports = { Callback, Packet };
54
+ export { Callback, Packet };
@@ -1,4 +1,4 @@
1
- const { Packet, Callback } = require("./packet.cjs");
1
+ const { Packet, Callback } = require("./packet.mjs");
2
2
 
3
3
  class Processor {
4
4
  constructor({ transport, processPacket }) {
@@ -66,4 +66,4 @@ class Processor {
66
66
  }
67
67
  }
68
68
 
69
- module.exports = { Processor };
69
+ export { Processor };