@aloma.io/integration-sdk 3.7.46 → 3.7.48
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 -1
- 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 -3
- 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
@@ -360,7 +360,9 @@ ${text}
|
|
360
360
|
packet.args(result);
|
361
361
|
transport.send(packet);
|
362
362
|
},
|
363
|
-
getClient: (arg) => theOAuth
|
363
|
+
getClient: (arg) => theOAuth
|
364
|
+
? (oauthClient = theOAuth.getClient(arg))
|
365
|
+
: new Fetcher(arg),
|
364
366
|
newTask: (name, data) => {
|
365
367
|
return new Promise((resolve, reject) => {
|
366
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,7 +351,7 @@ ${text}
|
|
351
351
|
);
|
352
352
|
}
|
353
353
|
};
|
354
|
-
|
354
|
+
|
355
355
|
const theOAuth = that._oauth
|
356
356
|
? new OAuth(decrypted.oauthResult, saveOAuthResult, getRefreshToken)
|
357
357
|
: null;
|
@@ -441,7 +441,7 @@ ${text}
|
|
441
441
|
if (oauthClient) {
|
442
442
|
await oauthClient.__healthCheck();
|
443
443
|
}
|
444
|
-
|
444
|
+
|
445
445
|
await controller.__healthCheck();
|
446
446
|
} catch (e: any) {
|
447
447
|
result.ok = false;
|
@@ -456,7 +456,9 @@ ${text}
|
|
456
456
|
transport.send(packet);
|
457
457
|
},
|
458
458
|
getClient: (arg) =>
|
459
|
-
theOAuth
|
459
|
+
theOAuth
|
460
|
+
? (oauthClient = theOAuth.getClient(arg))
|
461
|
+
: new Fetcher(arg),
|
460
462
|
newTask: (name, data) => {
|
461
463
|
return new Promise((resolve, reject) => {
|
462
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};
|