@aloma.io/integration-sdk 3.0.7 → 3.0.9

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.
@@ -9,7 +9,7 @@ export class AbstractController {
9
9
  fallback(arg) {
10
10
  throw new Error("method not found");
11
11
  }
12
- endpoint(arg) {
12
+ async endpoint(arg) {
13
13
  throw new Error("method not found");
14
14
  }
15
15
  async newTask(name, data) {
@@ -9,10 +9,10 @@ import { Dispatcher } from "./dispatcher/index.mjs";
9
9
  import { WebsocketConnector } from "./websocket/index.mjs";
10
10
  import JWE from "./util/jwe/index.mjs";
11
11
  import fetch from "node-fetch";
12
- import cuid from "@paralleldrive/cuid2";
12
+ import { init } from "@paralleldrive/cuid2";
13
+ const cuid = init({ length: 32 });
13
14
  import express from 'express';
14
15
  import PromClient from 'prom-client';
15
- cuid.init({ length: 32 });
16
16
  // TODO fetch with retry
17
17
  const handlePacketError = (packet, e, transport) => {
18
18
  if (!packet.cb()) {
@@ -120,6 +120,7 @@ class OAuthFetcher extends Fetcher {
120
120
  });
121
121
  }
122
122
  async customize(options, args = {}) {
123
+ const local = this;
123
124
  const token = await local.getToken(args.forceTokenRefresh);
124
125
  options = { ...options };
125
126
  options.headers = {
@@ -1,6 +1,6 @@
1
1
  import C from "../connection/constants.mjs";
2
- import cuid from "@paralleldrive/cuid2";
3
- cuid.init({ length: 32 });
2
+ import { init } from "@paralleldrive/cuid2";
3
+ const cuid = init({ length: 32 });
4
4
  import { DurableWebsocket } from "./durable.mjs";
5
5
  import WebSocket from "ws";
6
6
  import { Packet, Callback } from "./packet.mjs";
@@ -1,5 +1,5 @@
1
- import cuid from "@paralleldrive/cuid2";
2
- cuid.init({ length: 32 });
1
+ import { init } from "@paralleldrive/cuid2";
2
+ const cuid = init({ length: 32 });
3
3
  class Packet {
4
4
  constructor(data = {}) {
5
5
  this.data = data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@ export abstract class AbstractController {
14
14
  throw new Error("method not found");
15
15
  }
16
16
 
17
- protected endpoint(arg: any): Promise<any> {
17
+ protected async endpoint(arg: any): Promise<any> {
18
18
  throw new Error("method not found");
19
19
  }
20
20
 
@@ -9,12 +9,11 @@ import { Dispatcher } from "./dispatcher/index.mjs";
9
9
  import { WebsocketConnector } from "./websocket/index.mjs";
10
10
  import JWE from "./util/jwe/index.mjs";
11
11
  import fetch from "node-fetch";
12
- import cuid from "@paralleldrive/cuid2"
12
+ import { init } from "@paralleldrive/cuid2";
13
+ const cuid = init({ length: 32 });
13
14
  import express from 'express';
14
15
  import PromClient from 'prom-client'
15
16
 
16
- cuid.init({ length: 32 });
17
-
18
17
  // TODO fetch with retry
19
18
 
20
19
  const handlePacketError = (packet, e, transport) => {
@@ -154,6 +153,7 @@ class OAuthFetcher extends Fetcher {
154
153
  }
155
154
 
156
155
  async customize(options, args = {}) {
156
+ const local = this;
157
157
  const token = await local.getToken(args.forceTokenRefresh);
158
158
 
159
159
  options = { ...options };
@@ -1,6 +1,6 @@
1
1
  import C from "../connection/constants.mjs";
2
- import cuid from "@paralleldrive/cuid2"
3
- cuid.init({ length: 32 });
2
+ import { init } from "@paralleldrive/cuid2";
3
+ const cuid = init({ length: 32 });
4
4
 
5
5
  import { DurableWebsocket } from "./durable.mjs";
6
6
  import WebSocket from "ws";
@@ -1,5 +1,5 @@
1
- import cuid from "@paralleldrive/cuid2";
2
- cuid.init({ length: 32 });
1
+ import { init } from "@paralleldrive/cuid2";
2
+ const cuid = init({ length: 32 });
3
3
 
4
4
  class Packet {
5
5
  constructor(data = {}) {