@tryvital/vital-node 3.0.4 → 3.0.6
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/api/resources/activity/client/Client.js +2 -2
- package/api/resources/body/client/Client.js +2 -2
- package/api/resources/devices/client/Client.js +1 -1
- package/api/resources/insurance/client/Client.js +2 -2
- package/api/resources/introspect/client/Client.d.ts +4 -0
- package/api/resources/introspect/client/Client.js +73 -1
- package/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +10 -0
- package/api/resources/introspect/client/requests/index.d.ts +1 -0
- package/api/resources/labTests/client/Client.d.ts +3 -2
- package/api/resources/labTests/client/Client.js +29 -57
- package/api/resources/link/client/Client.d.ts +5 -10
- package/api/resources/link/client/Client.js +57 -85
- package/api/resources/link/client/requests/EmailAuthLink.d.ts +1 -0
- package/api/resources/link/client/requests/EmailProviderAuthLink.d.ts +1 -0
- package/api/resources/link/client/requests/IndividualProviderData.d.ts +1 -0
- package/api/resources/link/client/requests/LinkGenerateOauthLinkRequest.d.ts +6 -0
- package/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +6 -0
- package/api/resources/link/client/requests/LinkGetAllProvidersRequest.js +5 -0
- package/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +6 -0
- package/api/resources/link/client/requests/LinkTokenStateRequest.js +5 -0
- package/api/resources/link/client/requests/PasswordAuthLink.d.ts +1 -0
- package/api/resources/link/client/requests/index.d.ts +3 -1
- package/api/resources/meal/client/Client.js +1 -1
- package/api/resources/profile/client/Client.js +2 -2
- package/api/resources/providers/client/Client.js +1 -1
- package/api/resources/sleep/client/Client.js +4 -4
- package/api/resources/team/client/Client.d.ts +2 -1
- package/api/resources/team/client/Client.js +26 -13
- package/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +6 -0
- package/api/resources/team/client/requests/TeamGetLinkConfigRequest.js +5 -0
- package/api/resources/team/client/requests/index.d.ts +1 -0
- package/api/resources/testkit/client/Client.js +2 -2
- package/api/resources/user/client/Client.js +11 -11
- package/api/resources/vitals/client/Client.js +23 -23
- package/api/resources/workouts/client/Client.js +3 -3
- package/api/types/HistoricalPullStatus.d.ts +12 -0
- package/api/types/HistoricalPullStatus.js +11 -0
- package/api/types/SingleHistoricalPullStatistics.d.ts +12 -0
- package/api/types/SingleHistoricalPullStatistics.js +5 -0
- package/api/types/SingleProviderHistoricalPullResponse.d.ts +8 -0
- package/api/types/SingleProviderHistoricalPullResponse.js +5 -0
- package/api/types/SingleUserHistoricalPullResponse.d.ts +8 -0
- package/api/types/SingleUserHistoricalPullResponse.js +5 -0
- package/api/types/SingleUserResourceResponse.d.ts +2 -0
- package/api/types/UserHistoricalPullsResponse.d.ts +8 -0
- package/api/types/UserHistoricalPullsResponse.js +5 -0
- package/api/types/index.d.ts +5 -0
- package/api/types/index.js +5 -0
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/streaming-fetcher/StreamingFetcher.d.ts +30 -0
- package/core/streaming-fetcher/StreamingFetcher.js +79 -0
- package/core/streaming-fetcher/getHeader.d.ts +2 -0
- package/core/streaming-fetcher/getHeader.js +12 -0
- package/core/streaming-fetcher/index.d.ts +3 -0
- package/core/streaming-fetcher/index.js +7 -0
- package/dist/api/resources/activity/client/Client.js +2 -2
- package/dist/api/resources/body/client/Client.js +2 -2
- package/dist/api/resources/devices/client/Client.js +1 -1
- package/dist/api/resources/insurance/client/Client.js +2 -2
- package/dist/api/resources/introspect/client/Client.d.ts +4 -0
- package/dist/api/resources/introspect/client/Client.js +73 -1
- package/dist/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.d.ts +10 -0
- package/dist/api/resources/introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.js +5 -0
- package/dist/api/resources/introspect/client/requests/index.d.ts +1 -0
- package/dist/api/resources/labTests/client/Client.d.ts +3 -2
- package/dist/api/resources/labTests/client/Client.js +29 -57
- package/dist/api/resources/link/client/Client.d.ts +5 -10
- package/dist/api/resources/link/client/Client.js +57 -85
- package/dist/api/resources/link/client/requests/EmailAuthLink.d.ts +1 -0
- package/dist/api/resources/link/client/requests/EmailProviderAuthLink.d.ts +1 -0
- package/dist/api/resources/link/client/requests/IndividualProviderData.d.ts +1 -0
- package/dist/api/resources/link/client/requests/LinkGenerateOauthLinkRequest.d.ts +6 -0
- package/dist/api/resources/link/client/requests/LinkGenerateOauthLinkRequest.js +5 -0
- package/dist/api/resources/link/client/requests/LinkGetAllProvidersRequest.d.ts +6 -0
- package/dist/api/resources/link/client/requests/LinkGetAllProvidersRequest.js +5 -0
- package/dist/api/resources/link/client/requests/LinkTokenStateRequest.d.ts +6 -0
- package/dist/api/resources/link/client/requests/LinkTokenStateRequest.js +5 -0
- package/dist/api/resources/link/client/requests/PasswordAuthLink.d.ts +1 -0
- package/dist/api/resources/link/client/requests/index.d.ts +3 -1
- package/dist/api/resources/meal/client/Client.js +1 -1
- package/dist/api/resources/profile/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.js +1 -1
- package/dist/api/resources/sleep/client/Client.js +4 -4
- package/dist/api/resources/team/client/Client.d.ts +2 -1
- package/dist/api/resources/team/client/Client.js +26 -13
- package/dist/api/resources/team/client/requests/TeamGetLinkConfigRequest.d.ts +6 -0
- package/dist/api/resources/team/client/requests/TeamGetLinkConfigRequest.js +5 -0
- package/dist/api/resources/team/client/requests/index.d.ts +1 -0
- package/dist/api/resources/testkit/client/Client.js +2 -2
- package/dist/api/resources/user/client/Client.js +11 -11
- package/dist/api/resources/vitals/client/Client.js +23 -23
- package/dist/api/resources/workouts/client/Client.js +3 -3
- package/dist/api/types/HistoricalPullStatus.d.ts +12 -0
- package/dist/api/types/HistoricalPullStatus.js +11 -0
- package/dist/api/types/SingleHistoricalPullStatistics.d.ts +12 -0
- package/dist/api/types/SingleHistoricalPullStatistics.js +5 -0
- package/dist/api/types/SingleProviderHistoricalPullResponse.d.ts +8 -0
- package/dist/api/types/SingleProviderHistoricalPullResponse.js +5 -0
- package/dist/api/types/SingleUserHistoricalPullResponse.d.ts +8 -0
- package/dist/api/types/SingleUserHistoricalPullResponse.js +5 -0
- package/dist/api/types/SingleUserResourceResponse.d.ts +2 -0
- package/dist/api/types/UserHistoricalPullsResponse.d.ts +8 -0
- package/dist/api/types/UserHistoricalPullsResponse.js +5 -0
- package/dist/api/types/index.d.ts +5 -0
- package/dist/api/types/index.js +5 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +30 -0
- package/dist/core/streaming-fetcher/StreamingFetcher.js +79 -0
- package/dist/core/streaming-fetcher/getHeader.d.ts +2 -0
- package/dist/core/streaming-fetcher/getHeader.js +12 -0
- package/dist/core/streaming-fetcher/index.d.ts +3 -0
- package/dist/core/streaming-fetcher/index.js +7 -0
- package/dist/serialization/resources/link/client/index.d.ts +0 -1
- package/dist/serialization/resources/link/client/index.js +1 -2
- package/dist/serialization/resources/link/client/requests/EmailAuthLink.d.ts +1 -1
- package/dist/serialization/resources/link/client/requests/EmailProviderAuthLink.d.ts +1 -1
- package/dist/serialization/resources/link/client/requests/IndividualProviderData.d.ts +1 -1
- package/dist/serialization/resources/link/client/requests/PasswordAuthLink.d.ts +1 -1
- package/dist/serialization/types/HistoricalPullStatus.d.ts +10 -0
- package/dist/serialization/{resources/link/client/connectOauthProvider.js → types/HistoricalPullStatus.js} +3 -3
- package/dist/serialization/types/SingleHistoricalPullStatistics.d.ts +17 -0
- package/dist/serialization/types/SingleHistoricalPullStatistics.js +47 -0
- package/dist/serialization/types/SingleProviderHistoricalPullResponse.d.ts +13 -0
- package/dist/serialization/types/SingleProviderHistoricalPullResponse.js +43 -0
- package/dist/serialization/types/SingleUserHistoricalPullResponse.d.ts +13 -0
- package/dist/serialization/types/SingleUserHistoricalPullResponse.js +43 -0
- package/dist/serialization/types/SingleUserResourceResponse.d.ts +1 -0
- package/dist/serialization/types/SingleUserResourceResponse.js +10 -0
- package/dist/serialization/types/UserHistoricalPullsResponse.d.ts +13 -0
- package/dist/serialization/types/UserHistoricalPullsResponse.js +43 -0
- package/dist/serialization/types/index.d.ts +5 -0
- package/dist/serialization/types/index.js +5 -0
- package/package.json +1 -1
- package/serialization/resources/link/client/index.d.ts +0 -1
- package/serialization/resources/link/client/index.js +1 -2
- package/serialization/resources/link/client/requests/EmailAuthLink.d.ts +1 -1
- package/serialization/resources/link/client/requests/EmailProviderAuthLink.d.ts +1 -1
- package/serialization/resources/link/client/requests/IndividualProviderData.d.ts +1 -1
- package/serialization/resources/link/client/requests/PasswordAuthLink.d.ts +1 -1
- package/serialization/types/HistoricalPullStatus.d.ts +10 -0
- package/serialization/{resources/link/client/connectOauthProvider.js → types/HistoricalPullStatus.js} +3 -3
- package/serialization/types/SingleHistoricalPullStatistics.d.ts +17 -0
- package/serialization/types/SingleHistoricalPullStatistics.js +47 -0
- package/serialization/types/SingleProviderHistoricalPullResponse.d.ts +13 -0
- package/serialization/types/SingleProviderHistoricalPullResponse.js +43 -0
- package/serialization/types/SingleUserHistoricalPullResponse.d.ts +13 -0
- package/serialization/types/SingleUserHistoricalPullResponse.js +43 -0
- package/serialization/types/SingleUserResourceResponse.d.ts +1 -0
- package/serialization/types/SingleUserResourceResponse.js +10 -0
- package/serialization/types/UserHistoricalPullsResponse.d.ts +13 -0
- package/serialization/types/UserHistoricalPullsResponse.js +43 -0
- package/serialization/types/index.d.ts +5 -0
- package/serialization/types/index.js +5 -0
- package/api/resources/link/client/requests/LinkConnectOauthProviderRequest.d.ts +0 -6
- package/dist/api/resources/link/client/requests/LinkConnectOauthProviderRequest.d.ts +0 -6
- package/dist/serialization/resources/link/client/connectOauthProvider.d.ts +0 -9
- package/serialization/resources/link/client/connectOauthProvider.d.ts +0 -9
- /package/api/resources/{link/client/requests/LinkConnectOauthProviderRequest.js → introspect/client/requests/IntrospectGetUserHistoricalPullsRequest.js} +0 -0
- /package/{dist/api/resources/link/client/requests/LinkConnectOauthProviderRequest.js → api/resources/link/client/requests/LinkGenerateOauthLinkRequest.js} +0 -0
@@ -80,7 +80,7 @@ class Link {
|
|
80
80
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
81
81
|
"X-Fern-Language": "JavaScript",
|
82
82
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
83
|
-
"X-Fern-SDK-Version": "3.0.
|
83
|
+
"X-Fern-SDK-Version": "3.0.6",
|
84
84
|
},
|
85
85
|
contentType: "application/json",
|
86
86
|
body: yield serializers.LinkTokenExchange.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -138,7 +138,7 @@ class Link {
|
|
138
138
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
139
139
|
"X-Fern-Language": "JavaScript",
|
140
140
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
141
|
-
"X-Fern-SDK-Version": "3.0.
|
141
|
+
"X-Fern-SDK-Version": "3.0.6",
|
142
142
|
},
|
143
143
|
contentType: "application/json",
|
144
144
|
body: yield serializers.LinkTokenBase.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -203,7 +203,7 @@ class Link {
|
|
203
203
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
204
204
|
"X-Fern-Language": "JavaScript",
|
205
205
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
206
|
-
"X-Fern-SDK-Version": "3.0.
|
206
|
+
"X-Fern-SDK-Version": "3.0.6",
|
207
207
|
},
|
208
208
|
contentType: "application/json",
|
209
209
|
queryParameters: _queryParams,
|
@@ -250,29 +250,27 @@ class Link {
|
|
250
250
|
}
|
251
251
|
/**
|
252
252
|
* REQUEST_SOURCE: VITAL-LINK
|
253
|
-
*
|
254
|
-
* Connect oauth providers
|
253
|
+
* Start link token process
|
255
254
|
* @throws {@link Vital.UnprocessableEntityError}
|
256
255
|
*/
|
257
|
-
|
256
|
+
startConnect(request, requestOptions) {
|
258
257
|
var _a;
|
259
258
|
return __awaiter(this, void 0, void 0, function* () {
|
260
|
-
const { vitalSdkNoRedirect } = request;
|
261
259
|
const _response = yield core.fetcher({
|
262
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production,
|
263
|
-
method: "
|
260
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/start"),
|
261
|
+
method: "POST",
|
264
262
|
headers: {
|
265
263
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
266
264
|
"X-Fern-Language": "JavaScript",
|
267
265
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
268
|
-
"X-Fern-SDK-Version": "3.0.
|
269
|
-
"x-vital-sdk-no-redirect": vitalSdkNoRedirect != null ? vitalSdkNoRedirect : undefined,
|
266
|
+
"X-Fern-SDK-Version": "3.0.6",
|
270
267
|
},
|
271
268
|
contentType: "application/json",
|
269
|
+
body: yield serializers.BeginLinkTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
272
270
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
273
271
|
});
|
274
272
|
if (_response.ok) {
|
275
|
-
return yield serializers.link.
|
273
|
+
return yield serializers.link.startConnect.Response.parseOrThrow(_response.body, {
|
276
274
|
unrecognizedObjectKeys: "passthrough",
|
277
275
|
allowUnrecognizedUnionMembers: true,
|
278
276
|
allowUnrecognizedEnumValues: true,
|
@@ -312,27 +310,28 @@ class Link {
|
|
312
310
|
}
|
313
311
|
/**
|
314
312
|
* REQUEST_SOURCE: VITAL-LINK
|
315
|
-
*
|
313
|
+
* Check link token state - can be hit continuously used as heartbeat
|
316
314
|
* @throws {@link Vital.UnprocessableEntityError}
|
317
315
|
*/
|
318
|
-
|
316
|
+
tokenState(request = {}, requestOptions) {
|
319
317
|
var _a;
|
320
318
|
return __awaiter(this, void 0, void 0, function* () {
|
319
|
+
const { vitalLinkToken } = request;
|
321
320
|
const _response = yield core.fetcher({
|
322
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/
|
323
|
-
method: "
|
321
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/state"),
|
322
|
+
method: "GET",
|
324
323
|
headers: {
|
325
324
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
326
325
|
"X-Fern-Language": "JavaScript",
|
327
326
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
328
|
-
"X-Fern-SDK-Version": "3.0.
|
327
|
+
"X-Fern-SDK-Version": "3.0.6",
|
328
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
329
329
|
},
|
330
330
|
contentType: "application/json",
|
331
|
-
body: yield serializers.BeginLinkTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
332
331
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
333
332
|
});
|
334
333
|
if (_response.ok) {
|
335
|
-
return yield serializers.link.
|
334
|
+
return yield serializers.link.tokenState.Response.parseOrThrow(_response.body, {
|
336
335
|
unrecognizedObjectKeys: "passthrough",
|
337
336
|
allowUnrecognizedUnionMembers: true,
|
338
337
|
allowUnrecognizedEnumValues: true,
|
@@ -370,54 +369,6 @@ class Link {
|
|
370
369
|
}
|
371
370
|
});
|
372
371
|
}
|
373
|
-
/**
|
374
|
-
* REQUEST_SOURCE: VITAL-LINK
|
375
|
-
* Check link token state - can be hit continuously used as heartbeat
|
376
|
-
*/
|
377
|
-
tokenState(requestOptions) {
|
378
|
-
var _a;
|
379
|
-
return __awaiter(this, void 0, void 0, function* () {
|
380
|
-
const _response = yield core.fetcher({
|
381
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/state"),
|
382
|
-
method: "GET",
|
383
|
-
headers: {
|
384
|
-
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
385
|
-
"X-Fern-Language": "JavaScript",
|
386
|
-
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
387
|
-
"X-Fern-SDK-Version": "3.0.4",
|
388
|
-
},
|
389
|
-
contentType: "application/json",
|
390
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
391
|
-
});
|
392
|
-
if (_response.ok) {
|
393
|
-
return yield serializers.link.tokenState.Response.parseOrThrow(_response.body, {
|
394
|
-
unrecognizedObjectKeys: "passthrough",
|
395
|
-
allowUnrecognizedUnionMembers: true,
|
396
|
-
allowUnrecognizedEnumValues: true,
|
397
|
-
breadcrumbsPrefix: ["response"],
|
398
|
-
});
|
399
|
-
}
|
400
|
-
if (_response.error.reason === "status-code") {
|
401
|
-
throw new errors.VitalError({
|
402
|
-
statusCode: _response.error.statusCode,
|
403
|
-
body: _response.error.body,
|
404
|
-
});
|
405
|
-
}
|
406
|
-
switch (_response.error.reason) {
|
407
|
-
case "non-json":
|
408
|
-
throw new errors.VitalError({
|
409
|
-
statusCode: _response.error.statusCode,
|
410
|
-
body: _response.error.rawBody,
|
411
|
-
});
|
412
|
-
case "timeout":
|
413
|
-
throw new errors.VitalTimeoutError();
|
414
|
-
case "unknown":
|
415
|
-
throw new errors.VitalError({
|
416
|
-
message: _response.error.errorMessage,
|
417
|
-
});
|
418
|
-
}
|
419
|
-
});
|
420
|
-
}
|
421
372
|
/**
|
422
373
|
* REQUEST_SOURCE: VITAL-LINK
|
423
374
|
* PROVIDER_TYPE: EMAIL-AUTH
|
@@ -427,6 +378,7 @@ class Link {
|
|
427
378
|
emailAuth(request, requestOptions) {
|
428
379
|
var _a;
|
429
380
|
return __awaiter(this, void 0, void 0, function* () {
|
381
|
+
const { vitalLinkToken } = request, _body = __rest(request, ["vitalLinkToken"]);
|
430
382
|
const _response = yield core.fetcher({
|
431
383
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/auth/email"),
|
432
384
|
method: "POST",
|
@@ -434,10 +386,11 @@ class Link {
|
|
434
386
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
435
387
|
"X-Fern-Language": "JavaScript",
|
436
388
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
437
|
-
"X-Fern-SDK-Version": "3.0.
|
389
|
+
"X-Fern-SDK-Version": "3.0.6",
|
390
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
438
391
|
},
|
439
392
|
contentType: "application/json",
|
440
|
-
body: yield serializers.EmailAuthLink.jsonOrThrow(
|
393
|
+
body: yield serializers.EmailAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
441
394
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
442
395
|
});
|
443
396
|
if (_response.ok) {
|
@@ -488,7 +441,7 @@ class Link {
|
|
488
441
|
passwordAuth(request, requestOptions) {
|
489
442
|
var _a;
|
490
443
|
return __awaiter(this, void 0, void 0, function* () {
|
491
|
-
const { vitalLinkClientRegion } = request, _body = __rest(request, ["vitalLinkClientRegion"]);
|
444
|
+
const { vitalLinkClientRegion, vitalLinkToken } = request, _body = __rest(request, ["vitalLinkClientRegion", "vitalLinkToken"]);
|
492
445
|
const _response = yield core.fetcher({
|
493
446
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/auth"),
|
494
447
|
method: "POST",
|
@@ -496,8 +449,9 @@ class Link {
|
|
496
449
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
497
450
|
"X-Fern-Language": "JavaScript",
|
498
451
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
499
|
-
"X-Fern-SDK-Version": "3.0.
|
452
|
+
"X-Fern-SDK-Version": "3.0.6",
|
500
453
|
"x-vital-link-client-region": vitalLinkClientRegion != null ? vitalLinkClientRegion : undefined,
|
454
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
501
455
|
},
|
502
456
|
contentType: "application/json",
|
503
457
|
body: yield serializers.PasswordAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
@@ -546,9 +500,10 @@ class Link {
|
|
546
500
|
* This endpoint generates an OAuth link for oauth provider
|
547
501
|
* @throws {@link Vital.UnprocessableEntityError}
|
548
502
|
*/
|
549
|
-
generateOauthLink(oauthProvider, requestOptions) {
|
503
|
+
generateOauthLink(oauthProvider, request = {}, requestOptions) {
|
550
504
|
var _a;
|
551
505
|
return __awaiter(this, void 0, void 0, function* () {
|
506
|
+
const { vitalLinkToken } = request;
|
552
507
|
const _response = yield core.fetcher({
|
553
508
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/link/provider/oauth/${yield serializers.OAuthProviders.jsonOrThrow(oauthProvider)}`),
|
554
509
|
method: "GET",
|
@@ -556,7 +511,8 @@ class Link {
|
|
556
511
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
557
512
|
"X-Fern-Language": "JavaScript",
|
558
513
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
559
|
-
"X-Fern-SDK-Version": "3.0.
|
514
|
+
"X-Fern-SDK-Version": "3.0.6",
|
515
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
560
516
|
},
|
561
517
|
contentType: "application/json",
|
562
518
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -607,7 +563,7 @@ class Link {
|
|
607
563
|
connectPasswordProvider(provider, request, requestOptions) {
|
608
564
|
var _a;
|
609
565
|
return __awaiter(this, void 0, void 0, function* () {
|
610
|
-
const { vitalLinkClientRegion } = request, _body = __rest(request, ["vitalLinkClientRegion"]);
|
566
|
+
const { vitalLinkClientRegion, vitalLinkToken } = request, _body = __rest(request, ["vitalLinkClientRegion", "vitalLinkToken"]);
|
611
567
|
const _response = yield core.fetcher({
|
612
568
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/link/provider/password/${yield serializers.PasswordProviders.jsonOrThrow(provider)}`),
|
613
569
|
method: "POST",
|
@@ -615,8 +571,9 @@ class Link {
|
|
615
571
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
616
572
|
"X-Fern-Language": "JavaScript",
|
617
573
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
618
|
-
"X-Fern-SDK-Version": "3.0.
|
574
|
+
"X-Fern-SDK-Version": "3.0.6",
|
619
575
|
"x-vital-link-client-region": vitalLinkClientRegion != null ? vitalLinkClientRegion : undefined,
|
576
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
620
577
|
},
|
621
578
|
contentType: "application/json",
|
622
579
|
body: yield serializers.IndividualProviderData.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
@@ -668,6 +625,7 @@ class Link {
|
|
668
625
|
connectEmailAuthProvider(provider, request, requestOptions) {
|
669
626
|
var _a;
|
670
627
|
return __awaiter(this, void 0, void 0, function* () {
|
628
|
+
const { vitalLinkToken } = request, _body = __rest(request, ["vitalLinkToken"]);
|
671
629
|
const _response = yield core.fetcher({
|
672
630
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, `v2/link/provider/email/${yield serializers.EmailProviders.jsonOrThrow(provider)}`),
|
673
631
|
method: "POST",
|
@@ -675,10 +633,11 @@ class Link {
|
|
675
633
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
676
634
|
"X-Fern-Language": "JavaScript",
|
677
635
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
678
|
-
"X-Fern-SDK-Version": "3.0.
|
636
|
+
"X-Fern-SDK-Version": "3.0.6",
|
637
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
679
638
|
},
|
680
639
|
contentType: "application/json",
|
681
|
-
body: yield serializers.EmailProviderAuthLink.jsonOrThrow(
|
640
|
+
body: yield serializers.EmailProviderAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
682
641
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
683
642
|
});
|
684
643
|
if (_response.ok) {
|
@@ -722,10 +681,12 @@ class Link {
|
|
722
681
|
}
|
723
682
|
/**
|
724
683
|
* GET List of all available providers given the generated link token.
|
684
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
725
685
|
*/
|
726
|
-
getAllProviders(requestOptions) {
|
686
|
+
getAllProviders(request = {}, requestOptions) {
|
727
687
|
var _a;
|
728
688
|
return __awaiter(this, void 0, void 0, function* () {
|
689
|
+
const { vitalLinkToken } = request;
|
729
690
|
const _response = yield core.fetcher({
|
730
691
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/link/providers"),
|
731
692
|
method: "GET",
|
@@ -733,7 +694,8 @@ class Link {
|
|
733
694
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
734
695
|
"X-Fern-Language": "JavaScript",
|
735
696
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
736
|
-
"X-Fern-SDK-Version": "3.0.
|
697
|
+
"X-Fern-SDK-Version": "3.0.6",
|
698
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
737
699
|
},
|
738
700
|
contentType: "application/json",
|
739
701
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -747,10 +709,20 @@ class Link {
|
|
747
709
|
});
|
748
710
|
}
|
749
711
|
if (_response.error.reason === "status-code") {
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
712
|
+
switch (_response.error.statusCode) {
|
713
|
+
case 422:
|
714
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
715
|
+
unrecognizedObjectKeys: "passthrough",
|
716
|
+
allowUnrecognizedUnionMembers: true,
|
717
|
+
allowUnrecognizedEnumValues: true,
|
718
|
+
breadcrumbsPrefix: ["response"],
|
719
|
+
}));
|
720
|
+
default:
|
721
|
+
throw new errors.VitalError({
|
722
|
+
statusCode: _response.error.statusCode,
|
723
|
+
body: _response.error.body,
|
724
|
+
});
|
725
|
+
}
|
754
726
|
}
|
755
727
|
switch (_response.error.reason) {
|
756
728
|
case "non-json":
|
@@ -783,7 +755,7 @@ class Link {
|
|
783
755
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
784
756
|
"X-Fern-Language": "JavaScript",
|
785
757
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
786
|
-
"X-Fern-SDK-Version": "3.0.
|
758
|
+
"X-Fern-SDK-Version": "3.0.6",
|
787
759
|
},
|
788
760
|
contentType: "application/json",
|
789
761
|
body: yield serializers.ManualConnectionData.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -842,7 +814,7 @@ class Link {
|
|
842
814
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
843
815
|
"X-Fern-Language": "JavaScript",
|
844
816
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
845
|
-
"X-Fern-SDK-Version": "3.0.
|
817
|
+
"X-Fern-SDK-Version": "3.0.6",
|
846
818
|
},
|
847
819
|
contentType: "application/json",
|
848
820
|
body: yield serializers.DemoConnectionCreationPayload.jsonOrThrow(request, {
|
@@ -1,11 +1,13 @@
|
|
1
1
|
export { LinkTokenExchange } from "./LinkTokenExchange";
|
2
2
|
export { LinkTokenBase } from "./LinkTokenBase";
|
3
3
|
export { LinkCodeCreateRequest } from "./LinkCodeCreateRequest";
|
4
|
-
export { LinkConnectOauthProviderRequest } from "./LinkConnectOauthProviderRequest";
|
5
4
|
export { BeginLinkTokenRequest } from "./BeginLinkTokenRequest";
|
5
|
+
export { LinkTokenStateRequest } from "./LinkTokenStateRequest";
|
6
6
|
export { EmailAuthLink } from "./EmailAuthLink";
|
7
7
|
export { PasswordAuthLink } from "./PasswordAuthLink";
|
8
|
+
export { LinkGenerateOauthLinkRequest } from "./LinkGenerateOauthLinkRequest";
|
8
9
|
export { IndividualProviderData } from "./IndividualProviderData";
|
9
10
|
export { EmailProviderAuthLink } from "./EmailProviderAuthLink";
|
11
|
+
export { LinkGetAllProvidersRequest } from "./LinkGetAllProvidersRequest";
|
10
12
|
export { ManualConnectionData } from "./ManualConnectionData";
|
11
13
|
export { DemoConnectionCreationPayload } from "./DemoConnectionCreationPayload";
|
@@ -73,7 +73,7 @@ class Meal {
|
|
73
73
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
74
74
|
"X-Fern-Language": "JavaScript",
|
75
75
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
76
|
-
"X-Fern-SDK-Version": "3.0.
|
76
|
+
"X-Fern-SDK-Version": "3.0.6",
|
77
77
|
},
|
78
78
|
contentType: "application/json",
|
79
79
|
queryParameters: _queryParams,
|
@@ -69,7 +69,7 @@ class Profile {
|
|
69
69
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
70
70
|
"X-Fern-Language": "JavaScript",
|
71
71
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
72
|
-
"X-Fern-SDK-Version": "3.0.
|
72
|
+
"X-Fern-SDK-Version": "3.0.6",
|
73
73
|
},
|
74
74
|
contentType: "application/json",
|
75
75
|
queryParameters: _queryParams,
|
@@ -133,7 +133,7 @@ class Profile {
|
|
133
133
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
134
134
|
"X-Fern-Language": "JavaScript",
|
135
135
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
136
|
-
"X-Fern-SDK-Version": "3.0.
|
136
|
+
"X-Fern-SDK-Version": "3.0.6",
|
137
137
|
},
|
138
138
|
contentType: "application/json",
|
139
139
|
queryParameters: _queryParams,
|
@@ -61,7 +61,7 @@ class Providers {
|
|
61
61
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
62
62
|
"X-Fern-Language": "JavaScript",
|
63
63
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
64
|
-
"X-Fern-SDK-Version": "3.0.
|
64
|
+
"X-Fern-SDK-Version": "3.0.6",
|
65
65
|
},
|
66
66
|
contentType: "application/json",
|
67
67
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -73,7 +73,7 @@ class Sleep {
|
|
73
73
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
74
74
|
"X-Fern-Language": "JavaScript",
|
75
75
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
76
|
-
"X-Fern-SDK-Version": "3.0.
|
76
|
+
"X-Fern-SDK-Version": "3.0.6",
|
77
77
|
},
|
78
78
|
contentType: "application/json",
|
79
79
|
queryParameters: _queryParams,
|
@@ -141,7 +141,7 @@ class Sleep {
|
|
141
141
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
142
142
|
"X-Fern-Language": "JavaScript",
|
143
143
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
144
|
-
"X-Fern-SDK-Version": "3.0.
|
144
|
+
"X-Fern-SDK-Version": "3.0.6",
|
145
145
|
},
|
146
146
|
contentType: "application/json",
|
147
147
|
queryParameters: _queryParams,
|
@@ -209,7 +209,7 @@ class Sleep {
|
|
209
209
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
210
210
|
"X-Fern-Language": "JavaScript",
|
211
211
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
212
|
-
"X-Fern-SDK-Version": "3.0.
|
212
|
+
"X-Fern-SDK-Version": "3.0.6",
|
213
213
|
},
|
214
214
|
contentType: "application/json",
|
215
215
|
queryParameters: _queryParams,
|
@@ -268,7 +268,7 @@ class Sleep {
|
|
268
268
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
269
269
|
"X-Fern-Language": "JavaScript",
|
270
270
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
271
|
-
"X-Fern-SDK-Version": "3.0.
|
271
|
+
"X-Fern-SDK-Version": "3.0.6",
|
272
272
|
},
|
273
273
|
contentType: "application/json",
|
274
274
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -18,8 +18,9 @@ export declare class Team {
|
|
18
18
|
constructor(_options: Team.Options);
|
19
19
|
/**
|
20
20
|
* Post teams.
|
21
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
21
22
|
*/
|
22
|
-
getLinkConfig(requestOptions?: Team.RequestOptions): Promise<Record<string, unknown>>;
|
23
|
+
getLinkConfig(request?: Vital.TeamGetLinkConfigRequest, requestOptions?: Team.RequestOptions): Promise<Record<string, unknown>>;
|
23
24
|
/**
|
24
25
|
* Get team.
|
25
26
|
* @throws {@link Vital.UnprocessableEntityError}
|
@@ -41,10 +41,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Team = void 0;
|
42
42
|
const environments = __importStar(require("../../../../environments"));
|
43
43
|
const core = __importStar(require("../../../../core"));
|
44
|
+
const Vital = __importStar(require("../../.."));
|
44
45
|
const url_join_1 = __importDefault(require("url-join"));
|
45
46
|
const serializers = __importStar(require("../../../../serialization"));
|
46
47
|
const errors = __importStar(require("../../../../errors"));
|
47
|
-
const Vital = __importStar(require("../../.."));
|
48
48
|
const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
|
49
49
|
class Team {
|
50
50
|
constructor(_options) {
|
@@ -52,10 +52,12 @@ class Team {
|
|
52
52
|
}
|
53
53
|
/**
|
54
54
|
* Post teams.
|
55
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
55
56
|
*/
|
56
|
-
getLinkConfig(requestOptions) {
|
57
|
+
getLinkConfig(request = {}, requestOptions) {
|
57
58
|
var _a;
|
58
59
|
return __awaiter(this, void 0, void 0, function* () {
|
60
|
+
const { vitalLinkToken } = request;
|
59
61
|
const _response = yield core.fetcher({
|
60
62
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VitalEnvironment.Production, "v2/team/link/config"),
|
61
63
|
method: "GET",
|
@@ -63,7 +65,8 @@ class Team {
|
|
63
65
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
64
66
|
"X-Fern-Language": "JavaScript",
|
65
67
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
66
|
-
"X-Fern-SDK-Version": "3.0.
|
68
|
+
"X-Fern-SDK-Version": "3.0.6",
|
69
|
+
"x-vital-link-token": vitalLinkToken != null ? vitalLinkToken : undefined,
|
67
70
|
},
|
68
71
|
contentType: "application/json",
|
69
72
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -77,10 +80,20 @@ class Team {
|
|
77
80
|
});
|
78
81
|
}
|
79
82
|
if (_response.error.reason === "status-code") {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
switch (_response.error.statusCode) {
|
84
|
+
case 422:
|
85
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
86
|
+
unrecognizedObjectKeys: "passthrough",
|
87
|
+
allowUnrecognizedUnionMembers: true,
|
88
|
+
allowUnrecognizedEnumValues: true,
|
89
|
+
breadcrumbsPrefix: ["response"],
|
90
|
+
}));
|
91
|
+
default:
|
92
|
+
throw new errors.VitalError({
|
93
|
+
statusCode: _response.error.statusCode,
|
94
|
+
body: _response.error.body,
|
95
|
+
});
|
96
|
+
}
|
84
97
|
}
|
85
98
|
switch (_response.error.reason) {
|
86
99
|
case "non-json":
|
@@ -111,7 +124,7 @@ class Team {
|
|
111
124
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
112
125
|
"X-Fern-Language": "JavaScript",
|
113
126
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
114
|
-
"X-Fern-SDK-Version": "3.0.
|
127
|
+
"X-Fern-SDK-Version": "3.0.6",
|
115
128
|
},
|
116
129
|
contentType: "application/json",
|
117
130
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -174,7 +187,7 @@ class Team {
|
|
174
187
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
175
188
|
"X-Fern-Language": "JavaScript",
|
176
189
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
177
|
-
"X-Fern-SDK-Version": "3.0.
|
190
|
+
"X-Fern-SDK-Version": "3.0.6",
|
178
191
|
},
|
179
192
|
contentType: "application/json",
|
180
193
|
queryParameters: _queryParams,
|
@@ -229,7 +242,7 @@ class Team {
|
|
229
242
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
230
243
|
"X-Fern-Language": "JavaScript",
|
231
244
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
232
|
-
"X-Fern-SDK-Version": "3.0.
|
245
|
+
"X-Fern-SDK-Version": "3.0.6",
|
233
246
|
},
|
234
247
|
contentType: "application/json",
|
235
248
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -282,7 +295,7 @@ class Team {
|
|
282
295
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
283
296
|
"X-Fern-Language": "JavaScript",
|
284
297
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
285
|
-
"X-Fern-SDK-Version": "3.0.
|
298
|
+
"X-Fern-SDK-Version": "3.0.6",
|
286
299
|
},
|
287
300
|
contentType: "application/json",
|
288
301
|
queryParameters: _queryParams,
|
@@ -344,7 +357,7 @@ class Team {
|
|
344
357
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
345
358
|
"X-Fern-Language": "JavaScript",
|
346
359
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
347
|
-
"X-Fern-SDK-Version": "3.0.
|
360
|
+
"X-Fern-SDK-Version": "3.0.6",
|
348
361
|
},
|
349
362
|
contentType: "application/json",
|
350
363
|
queryParameters: _queryParams,
|
@@ -402,7 +415,7 @@ class Team {
|
|
402
415
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
403
416
|
"X-Fern-Language": "JavaScript",
|
404
417
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
405
|
-
"X-Fern-SDK-Version": "3.0.
|
418
|
+
"X-Fern-SDK-Version": "3.0.6",
|
406
419
|
},
|
407
420
|
contentType: "application/json",
|
408
421
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|