@tryvital/vital-node 1.3.9 → 1.4.3
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/client/Link.ts +11 -4
- package/dist/client/Link.d.ts +1 -1
- package/dist/client/Link.js +11 -6
- package/package.json +2 -2
package/client/Link.ts
CHANGED
@@ -20,14 +20,21 @@ export class LinkApi {
|
|
20
20
|
userId: string,
|
21
21
|
provider: string = null,
|
22
22
|
redirect_url: string = null,
|
23
|
-
|
23
|
+
filter_on_providers: string[] = null
|
24
24
|
): Promise<LinkTokenExchangeResponse> {
|
25
|
-
const
|
25
|
+
const default_params = {
|
26
26
|
user_key: userId,
|
27
27
|
provider,
|
28
28
|
redirect_url,
|
29
|
-
|
30
|
-
|
29
|
+
};
|
30
|
+
if (filter_on_providers) {
|
31
|
+
// @ts-ignore
|
32
|
+
default_params['filter_on_providers'] = filter_on_providers;
|
33
|
+
}
|
34
|
+
const resp = await this.client.post(
|
35
|
+
this.baseURL.concat('/link/token/'),
|
36
|
+
default_params
|
37
|
+
);
|
31
38
|
return resp.data;
|
32
39
|
}
|
33
40
|
|
package/dist/client/Link.d.ts
CHANGED
@@ -5,7 +5,7 @@ export declare class LinkApi {
|
|
5
5
|
baseURL: string;
|
6
6
|
client: AxiosInstance;
|
7
7
|
constructor(baseURL: string, axios: AxiosInstance);
|
8
|
-
create(userId: string, provider?: string, redirect_url?: string,
|
8
|
+
create(userId: string, provider?: string, redirect_url?: string, filter_on_providers?: string[]): Promise<LinkTokenExchangeResponse>;
|
9
9
|
connectProvider(linkToken: string, provider: PasswordProviders, username: string, password: string): Promise<ProviderLinkResponse>;
|
10
10
|
connectEmailProvider(linkToken: string, provider: EmailProviders, email: string, region?: string): Promise<ProviderLinkResponse>;
|
11
11
|
getOAuthLink(linkToken: string, provider: OAuthProviders): Promise<SourceWithLinkInfo>;
|
package/dist/client/Link.js
CHANGED
@@ -42,20 +42,25 @@ var LinkApi = /** @class */ (function () {
|
|
42
42
|
this.baseURL = baseURL;
|
43
43
|
this.client = axios;
|
44
44
|
}
|
45
|
-
LinkApi.prototype.create = function (userId, provider, redirect_url,
|
45
|
+
LinkApi.prototype.create = function (userId, provider, redirect_url, filter_on_providers) {
|
46
46
|
if (provider === void 0) { provider = null; }
|
47
47
|
if (redirect_url === void 0) { redirect_url = null; }
|
48
|
-
if (
|
48
|
+
if (filter_on_providers === void 0) { filter_on_providers = null; }
|
49
49
|
return __awaiter(this, void 0, void 0, function () {
|
50
|
-
var resp;
|
50
|
+
var default_params, resp;
|
51
51
|
return __generator(this, function (_a) {
|
52
52
|
switch (_a.label) {
|
53
|
-
case 0:
|
53
|
+
case 0:
|
54
|
+
default_params = {
|
54
55
|
user_key: userId,
|
55
56
|
provider: provider,
|
56
57
|
redirect_url: redirect_url,
|
57
|
-
|
58
|
-
|
58
|
+
};
|
59
|
+
if (filter_on_providers) {
|
60
|
+
// @ts-ignore
|
61
|
+
default_params['filter_on_providers'] = filter_on_providers;
|
62
|
+
}
|
63
|
+
return [4 /*yield*/, this.client.post(this.baseURL.concat('/link/token/'), default_params)];
|
59
64
|
case 1:
|
60
65
|
resp = _a.sent();
|
61
66
|
return [2 /*return*/, resp.data];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tryvital/vital-node",
|
3
|
-
"version": "1.3
|
3
|
+
"version": "1.4.3",
|
4
4
|
"description": "Node client for Vital",
|
5
5
|
"author": "maitham",
|
6
6
|
"keywords": [
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"axios": ">=0.21.2",
|
27
27
|
"axios-retry": "^3.2.4",
|
28
28
|
"crypto": "^1.0.1",
|
29
|
-
"svix": "0.
|
29
|
+
"svix": "0.64.2"
|
30
30
|
},
|
31
31
|
"devDependencies": {
|
32
32
|
"@testdeck/mocha": "^0.1.2",
|