@aloma.io/integration-sdk 3.7.47 → 3.7.49
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/fetcher/oauth-fetcher.mjs +1 -1
- package/build/internal/index.mjs +3 -3
- package/build/transform/index.mjs +3 -3
- package/package.json +1 -1
- package/src/controller/index.mts +2 -2
- package/src/internal/fetcher/fetcher.mts +3 -4
- package/src/internal/fetcher/oauth-fetcher.mts +5 -4
- package/src/internal/index.mts +5 -6
- package/src/transform/index.mts +4 -4
@@ -10,7 +10,7 @@ class OAuthFetcher extends Fetcher {
|
|
10
10
|
}
|
11
11
|
async __healthCheck() {
|
12
12
|
if (this.used && !this.oauth.accessToken())
|
13
|
-
throw new Error(
|
13
|
+
throw new Error("no access token");
|
14
14
|
}
|
15
15
|
async getToken(force) {
|
16
16
|
var local = this, oauth = local.oauth;
|
package/build/internal/index.mjs
CHANGED
@@ -289,8 +289,6 @@ ${text}
|
|
289
289
|
throw new Error("could not get refresh token " + status + " " + text);
|
290
290
|
}
|
291
291
|
};
|
292
|
-
console.log(that._oauth);
|
293
|
-
console.log(config);
|
294
292
|
const theOAuth = that._oauth
|
295
293
|
? new OAuth(decrypted.oauthResult, saveOAuthResult, getRefreshToken)
|
296
294
|
: null;
|
@@ -362,7 +360,9 @@ ${text}
|
|
362
360
|
packet.args(result);
|
363
361
|
transport.send(packet);
|
364
362
|
},
|
365
|
-
getClient: (arg) => theOAuth
|
363
|
+
getClient: (arg) => theOAuth
|
364
|
+
? (oauthClient = theOAuth.getClient(arg))
|
365
|
+
: new Fetcher(arg),
|
366
366
|
newTask: (name, data) => {
|
367
367
|
return new Promise((resolve, reject) => {
|
368
368
|
const packet = transport.newPacket({}, (ret) => (ret?.error ? reject(ret.error) : resolve(ret)), `_req-${cuid()}`);
|
@@ -24,8 +24,8 @@ const transform = (meta) => {
|
|
24
24
|
const docs = sig.getJSDoc().serialize() || [];
|
25
25
|
const desc = docs.find((what) => what.kind === "description")?.value;
|
26
26
|
const example = docs.find((what) => what.kind === "example")?.value;
|
27
|
-
const ns = docs.find((what) => what.kind ===
|
28
|
-
let space = ns ? `@namespace ${ns}` :
|
27
|
+
const ns = docs.find((what) => what.kind === "namespace")?.value;
|
28
|
+
let space = ns ? `@namespace ${ns}` : "";
|
29
29
|
let eg;
|
30
30
|
if (example) {
|
31
31
|
const parts = example.split(/```/);
|
@@ -63,7 +63,7 @@ const transform = (meta) => {
|
|
63
63
|
/**
|
64
64
|
* ${desc || ""}
|
65
65
|
*
|
66
|
-
* ${space ||
|
66
|
+
* ${space || ""}
|
67
67
|
* ${eg || ""}
|
68
68
|
**/
|
69
69
|
declare function ${member.getName()}(${params}): ${retVal};
|
package/package.json
CHANGED
package/src/controller/index.mts
CHANGED
@@ -9,7 +9,7 @@ export abstract class AbstractController {
|
|
9
9
|
protected configQuery(arg: any): Promise<any> {
|
10
10
|
return Promise.resolve({});
|
11
11
|
}
|
12
|
-
|
12
|
+
|
13
13
|
protected autocomplete(arg: any): Promise<any> {
|
14
14
|
return Promise.resolve({});
|
15
15
|
}
|
@@ -85,7 +85,7 @@ export abstract class AbstractController {
|
|
85
85
|
async __configQuery(arg: any): Promise<any | null> {
|
86
86
|
return this.configQuery(arg);
|
87
87
|
}
|
88
|
-
|
88
|
+
|
89
89
|
async __autocomplete(arg: any): Promise<any | null> {
|
90
90
|
return this.autocomplete(arg);
|
91
91
|
}
|
@@ -111,10 +111,9 @@ export default class Fetcher {
|
|
111
111
|
if (local.onResponse) {
|
112
112
|
await local.onResponse(ret);
|
113
113
|
}
|
114
|
-
|
115
|
-
if (status === 204)
|
116
|
-
|
117
|
-
return {ok: true};
|
114
|
+
|
115
|
+
if (status === 204) {
|
116
|
+
return { ok: true };
|
118
117
|
}
|
119
118
|
|
120
119
|
return unwrap(ret, options);
|
@@ -10,17 +10,18 @@ class OAuthFetcher extends Fetcher {
|
|
10
10
|
this.oauth = oauth;
|
11
11
|
this._getToken = getToken;
|
12
12
|
}
|
13
|
-
|
13
|
+
|
14
14
|
async __healthCheck() {
|
15
|
-
if (this.used && !this.oauth.accessToken())
|
15
|
+
if (this.used && !this.oauth.accessToken())
|
16
|
+
throw new Error("no access token");
|
16
17
|
}
|
17
18
|
|
18
19
|
async getToken(force) {
|
19
20
|
var local = this,
|
20
21
|
oauth = local.oauth;
|
21
|
-
|
22
|
+
|
22
23
|
this.used = true;
|
23
|
-
|
24
|
+
|
24
25
|
if (local._getToken) return local._getToken(force);
|
25
26
|
|
26
27
|
if (!force && oauth.accessToken()) return oauth.accessToken();
|
package/src/internal/index.mts
CHANGED
@@ -351,10 +351,7 @@ ${text}
|
|
351
351
|
);
|
352
352
|
}
|
353
353
|
};
|
354
|
-
|
355
|
-
console.log(that._oauth)
|
356
|
-
console.log(config)
|
357
|
-
|
354
|
+
|
358
355
|
const theOAuth = that._oauth
|
359
356
|
? new OAuth(decrypted.oauthResult, saveOAuthResult, getRefreshToken)
|
360
357
|
: null;
|
@@ -444,7 +441,7 @@ ${text}
|
|
444
441
|
if (oauthClient) {
|
445
442
|
await oauthClient.__healthCheck();
|
446
443
|
}
|
447
|
-
|
444
|
+
|
448
445
|
await controller.__healthCheck();
|
449
446
|
} catch (e: any) {
|
450
447
|
result.ok = false;
|
@@ -459,7 +456,9 @@ ${text}
|
|
459
456
|
transport.send(packet);
|
460
457
|
},
|
461
458
|
getClient: (arg) =>
|
462
|
-
theOAuth
|
459
|
+
theOAuth
|
460
|
+
? (oauthClient = theOAuth.getClient(arg))
|
461
|
+
: new Fetcher(arg),
|
463
462
|
newTask: (name, data) => {
|
464
463
|
return new Promise((resolve, reject) => {
|
465
464
|
const packet = transport.newPacket(
|
package/src/transform/index.mts
CHANGED
@@ -36,9 +36,9 @@ const transform = (meta: any) => {
|
|
36
36
|
const example = docs.find(
|
37
37
|
(what: any) => what.kind === "example",
|
38
38
|
)?.value;
|
39
|
-
|
40
|
-
const ns = docs.find((what: any) => what.kind ===
|
41
|
-
let space = ns
|
39
|
+
|
40
|
+
const ns = docs.find((what: any) => what.kind === "namespace")?.value;
|
41
|
+
let space = ns ? `@namespace ${ns}` : "";
|
42
42
|
|
43
43
|
let eg;
|
44
44
|
if (example) {
|
@@ -94,7 +94,7 @@ const transform = (meta: any) => {
|
|
94
94
|
/**
|
95
95
|
* ${desc || ""}
|
96
96
|
*
|
97
|
-
* ${space ||
|
97
|
+
* ${space || ""}
|
98
98
|
* ${eg || ""}
|
99
99
|
**/
|
100
100
|
declare function ${member.getName()}(${params}): ${retVal};
|