@tryvital/vital-node 3.0.3 → 3.0.5
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.js +1 -1
- package/api/resources/labTests/client/Client.js +31 -24
- package/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +1 -1
- package/api/resources/link/client/Client.d.ts +5 -10
- package/api/resources/link/client/Client.js +85 -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/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 +30 -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/EventDestinationPreferences.d.ts +8 -0
- package/api/types/EventDestinationPreferences.js +5 -0
- package/api/types/EventDestinationPreferencesEnabledItem.d.ts +9 -0
- package/api/types/EventDestinationPreferencesEnabledItem.js +11 -0
- package/api/types/EventDestinationPreferencesPreferred.d.ts +9 -0
- package/api/types/EventDestinationPreferencesPreferred.js +11 -0
- package/api/types/PatientAddressCompatible.d.ts +2 -2
- package/api/types/TeamConfig.d.ts +3 -0
- package/api/types/index.d.ts +3 -0
- package/api/types/index.js +3 -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.js +1 -1
- package/dist/api/resources/labTests/client/Client.js +31 -24
- package/dist/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.d.ts +1 -1
- package/dist/api/resources/link/client/Client.d.ts +5 -10
- package/dist/api/resources/link/client/Client.js +85 -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 +30 -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/EventDestinationPreferences.d.ts +8 -0
- package/dist/api/types/EventDestinationPreferences.js +5 -0
- package/dist/api/types/EventDestinationPreferencesEnabledItem.d.ts +9 -0
- package/dist/api/types/EventDestinationPreferencesEnabledItem.js +11 -0
- package/dist/api/types/EventDestinationPreferencesPreferred.d.ts +9 -0
- package/dist/api/types/EventDestinationPreferencesPreferred.js +11 -0
- package/dist/api/types/PatientAddressCompatible.d.ts +2 -2
- package/dist/api/types/TeamConfig.d.ts +3 -0
- package/dist/api/types/index.d.ts +3 -0
- package/dist/api/types/index.js +3 -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/EventDestinationPreferences.d.ts +13 -0
- package/dist/serialization/types/EventDestinationPreferences.js +43 -0
- package/dist/serialization/types/EventDestinationPreferencesEnabledItem.d.ts +10 -0
- package/dist/serialization/types/EventDestinationPreferencesEnabledItem.js +31 -0
- package/dist/serialization/types/EventDestinationPreferencesPreferred.d.ts +10 -0
- package/dist/serialization/{resources/link/client/connectOauthProvider.js → types/EventDestinationPreferencesPreferred.js} +3 -3
- package/dist/serialization/types/PatientAddressCompatible.d.ts +2 -2
- package/dist/serialization/types/PatientAddressCompatible.js +2 -2
- package/dist/serialization/types/TeamConfig.d.ts +3 -0
- package/dist/serialization/types/TeamConfig.js +3 -0
- package/dist/serialization/types/index.d.ts +3 -0
- package/dist/serialization/types/index.js +3 -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/EventDestinationPreferences.d.ts +13 -0
- package/serialization/types/EventDestinationPreferences.js +43 -0
- package/serialization/types/EventDestinationPreferencesEnabledItem.d.ts +10 -0
- package/serialization/types/EventDestinationPreferencesEnabledItem.js +31 -0
- package/serialization/types/EventDestinationPreferencesPreferred.d.ts +10 -0
- package/serialization/{resources/link/client/connectOauthProvider.js → types/EventDestinationPreferencesPreferred.js} +3 -3
- package/serialization/types/PatientAddressCompatible.d.ts +2 -2
- package/serialization/types/PatientAddressCompatible.js +2 -2
- package/serialization/types/TeamConfig.d.ts +3 -0
- package/serialization/types/TeamConfig.js +3 -0
- package/serialization/types/index.d.ts +3 -0
- package/serialization/types/index.js +3 -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 → LinkGenerateOauthLinkRequest.js} +0 -0
- /package/{dist/api/resources/link/client/requests/LinkConnectOauthProviderRequest.js → api/resources/link/client/requests/LinkGetAllProvidersRequest.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.5",
|
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.5",
|
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.5",
|
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.5",
|
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,32 @@ 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.5",
|
328
|
+
"x-vital-link-token": vitalLinkToken != null
|
329
|
+
? typeof vitalLinkToken === "string"
|
330
|
+
? vitalLinkToken
|
331
|
+
: JSON.stringify(vitalLinkToken)
|
332
|
+
: undefined,
|
329
333
|
},
|
330
334
|
contentType: "application/json",
|
331
|
-
body: yield serializers.BeginLinkTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
332
335
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
333
336
|
});
|
334
337
|
if (_response.ok) {
|
335
|
-
return yield serializers.link.
|
338
|
+
return yield serializers.link.tokenState.Response.parseOrThrow(_response.body, {
|
336
339
|
unrecognizedObjectKeys: "passthrough",
|
337
340
|
allowUnrecognizedUnionMembers: true,
|
338
341
|
allowUnrecognizedEnumValues: true,
|
@@ -370,54 +373,6 @@ class Link {
|
|
370
373
|
}
|
371
374
|
});
|
372
375
|
}
|
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.3",
|
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
376
|
/**
|
422
377
|
* REQUEST_SOURCE: VITAL-LINK
|
423
378
|
* PROVIDER_TYPE: EMAIL-AUTH
|
@@ -427,6 +382,7 @@ class Link {
|
|
427
382
|
emailAuth(request, requestOptions) {
|
428
383
|
var _a;
|
429
384
|
return __awaiter(this, void 0, void 0, function* () {
|
385
|
+
const { vitalLinkToken } = request, _body = __rest(request, ["vitalLinkToken"]);
|
430
386
|
const _response = yield core.fetcher({
|
431
387
|
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
388
|
method: "POST",
|
@@ -434,10 +390,15 @@ class Link {
|
|
434
390
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
435
391
|
"X-Fern-Language": "JavaScript",
|
436
392
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
437
|
-
"X-Fern-SDK-Version": "3.0.
|
393
|
+
"X-Fern-SDK-Version": "3.0.5",
|
394
|
+
"x-vital-link-token": vitalLinkToken != null
|
395
|
+
? typeof vitalLinkToken === "string"
|
396
|
+
? vitalLinkToken
|
397
|
+
: JSON.stringify(vitalLinkToken)
|
398
|
+
: undefined,
|
438
399
|
},
|
439
400
|
contentType: "application/json",
|
440
|
-
body: yield serializers.EmailAuthLink.jsonOrThrow(
|
401
|
+
body: yield serializers.EmailAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
441
402
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
442
403
|
});
|
443
404
|
if (_response.ok) {
|
@@ -488,7 +449,7 @@ class Link {
|
|
488
449
|
passwordAuth(request, requestOptions) {
|
489
450
|
var _a;
|
490
451
|
return __awaiter(this, void 0, void 0, function* () {
|
491
|
-
const { vitalLinkClientRegion } = request, _body = __rest(request, ["vitalLinkClientRegion"]);
|
452
|
+
const { vitalLinkClientRegion, vitalLinkToken } = request, _body = __rest(request, ["vitalLinkClientRegion", "vitalLinkToken"]);
|
492
453
|
const _response = yield core.fetcher({
|
493
454
|
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
455
|
method: "POST",
|
@@ -496,8 +457,13 @@ class Link {
|
|
496
457
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
497
458
|
"X-Fern-Language": "JavaScript",
|
498
459
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
499
|
-
"X-Fern-SDK-Version": "3.0.
|
460
|
+
"X-Fern-SDK-Version": "3.0.5",
|
500
461
|
"x-vital-link-client-region": vitalLinkClientRegion != null ? vitalLinkClientRegion : undefined,
|
462
|
+
"x-vital-link-token": vitalLinkToken != null
|
463
|
+
? typeof vitalLinkToken === "string"
|
464
|
+
? vitalLinkToken
|
465
|
+
: JSON.stringify(vitalLinkToken)
|
466
|
+
: undefined,
|
501
467
|
},
|
502
468
|
contentType: "application/json",
|
503
469
|
body: yield serializers.PasswordAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
@@ -546,9 +512,10 @@ class Link {
|
|
546
512
|
* This endpoint generates an OAuth link for oauth provider
|
547
513
|
* @throws {@link Vital.UnprocessableEntityError}
|
548
514
|
*/
|
549
|
-
generateOauthLink(oauthProvider, requestOptions) {
|
515
|
+
generateOauthLink(oauthProvider, request, requestOptions) {
|
550
516
|
var _a;
|
551
517
|
return __awaiter(this, void 0, void 0, function* () {
|
518
|
+
const { vitalLinkToken } = request;
|
552
519
|
const _response = yield core.fetcher({
|
553
520
|
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
521
|
method: "GET",
|
@@ -556,7 +523,12 @@ class Link {
|
|
556
523
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
557
524
|
"X-Fern-Language": "JavaScript",
|
558
525
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
559
|
-
"X-Fern-SDK-Version": "3.0.
|
526
|
+
"X-Fern-SDK-Version": "3.0.5",
|
527
|
+
"x-vital-link-token": vitalLinkToken != null
|
528
|
+
? typeof vitalLinkToken === "string"
|
529
|
+
? vitalLinkToken
|
530
|
+
: JSON.stringify(vitalLinkToken)
|
531
|
+
: undefined,
|
560
532
|
},
|
561
533
|
contentType: "application/json",
|
562
534
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -607,7 +579,7 @@ class Link {
|
|
607
579
|
connectPasswordProvider(provider, request, requestOptions) {
|
608
580
|
var _a;
|
609
581
|
return __awaiter(this, void 0, void 0, function* () {
|
610
|
-
const { vitalLinkClientRegion } = request, _body = __rest(request, ["vitalLinkClientRegion"]);
|
582
|
+
const { vitalLinkClientRegion, vitalLinkToken } = request, _body = __rest(request, ["vitalLinkClientRegion", "vitalLinkToken"]);
|
611
583
|
const _response = yield core.fetcher({
|
612
584
|
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
585
|
method: "POST",
|
@@ -615,8 +587,13 @@ class Link {
|
|
615
587
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
616
588
|
"X-Fern-Language": "JavaScript",
|
617
589
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
618
|
-
"X-Fern-SDK-Version": "3.0.
|
590
|
+
"X-Fern-SDK-Version": "3.0.5",
|
619
591
|
"x-vital-link-client-region": vitalLinkClientRegion != null ? vitalLinkClientRegion : undefined,
|
592
|
+
"x-vital-link-token": vitalLinkToken != null
|
593
|
+
? typeof vitalLinkToken === "string"
|
594
|
+
? vitalLinkToken
|
595
|
+
: JSON.stringify(vitalLinkToken)
|
596
|
+
: undefined,
|
620
597
|
},
|
621
598
|
contentType: "application/json",
|
622
599
|
body: yield serializers.IndividualProviderData.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
@@ -668,6 +645,7 @@ class Link {
|
|
668
645
|
connectEmailAuthProvider(provider, request, requestOptions) {
|
669
646
|
var _a;
|
670
647
|
return __awaiter(this, void 0, void 0, function* () {
|
648
|
+
const { vitalLinkToken } = request, _body = __rest(request, ["vitalLinkToken"]);
|
671
649
|
const _response = yield core.fetcher({
|
672
650
|
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
651
|
method: "POST",
|
@@ -675,10 +653,15 @@ class Link {
|
|
675
653
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
676
654
|
"X-Fern-Language": "JavaScript",
|
677
655
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
678
|
-
"X-Fern-SDK-Version": "3.0.
|
656
|
+
"X-Fern-SDK-Version": "3.0.5",
|
657
|
+
"x-vital-link-token": vitalLinkToken != null
|
658
|
+
? typeof vitalLinkToken === "string"
|
659
|
+
? vitalLinkToken
|
660
|
+
: JSON.stringify(vitalLinkToken)
|
661
|
+
: undefined,
|
679
662
|
},
|
680
663
|
contentType: "application/json",
|
681
|
-
body: yield serializers.EmailProviderAuthLink.jsonOrThrow(
|
664
|
+
body: yield serializers.EmailProviderAuthLink.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
682
665
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
683
666
|
});
|
684
667
|
if (_response.ok) {
|
@@ -722,10 +705,12 @@ class Link {
|
|
722
705
|
}
|
723
706
|
/**
|
724
707
|
* GET List of all available providers given the generated link token.
|
708
|
+
* @throws {@link Vital.UnprocessableEntityError}
|
725
709
|
*/
|
726
|
-
getAllProviders(requestOptions) {
|
710
|
+
getAllProviders(request, requestOptions) {
|
727
711
|
var _a;
|
728
712
|
return __awaiter(this, void 0, void 0, function* () {
|
713
|
+
const { vitalLinkToken } = request;
|
729
714
|
const _response = yield core.fetcher({
|
730
715
|
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
716
|
method: "GET",
|
@@ -733,7 +718,12 @@ class Link {
|
|
733
718
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
734
719
|
"X-Fern-Language": "JavaScript",
|
735
720
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
736
|
-
"X-Fern-SDK-Version": "3.0.
|
721
|
+
"X-Fern-SDK-Version": "3.0.5",
|
722
|
+
"x-vital-link-token": vitalLinkToken != null
|
723
|
+
? typeof vitalLinkToken === "string"
|
724
|
+
? vitalLinkToken
|
725
|
+
: JSON.stringify(vitalLinkToken)
|
726
|
+
: undefined,
|
737
727
|
},
|
738
728
|
contentType: "application/json",
|
739
729
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -747,10 +737,20 @@ class Link {
|
|
747
737
|
});
|
748
738
|
}
|
749
739
|
if (_response.error.reason === "status-code") {
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
740
|
+
switch (_response.error.statusCode) {
|
741
|
+
case 422:
|
742
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
743
|
+
unrecognizedObjectKeys: "passthrough",
|
744
|
+
allowUnrecognizedUnionMembers: true,
|
745
|
+
allowUnrecognizedEnumValues: true,
|
746
|
+
breadcrumbsPrefix: ["response"],
|
747
|
+
}));
|
748
|
+
default:
|
749
|
+
throw new errors.VitalError({
|
750
|
+
statusCode: _response.error.statusCode,
|
751
|
+
body: _response.error.body,
|
752
|
+
});
|
753
|
+
}
|
754
754
|
}
|
755
755
|
switch (_response.error.reason) {
|
756
756
|
case "non-json":
|
@@ -783,7 +783,7 @@ class Link {
|
|
783
783
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
784
784
|
"X-Fern-Language": "JavaScript",
|
785
785
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
786
|
-
"X-Fern-SDK-Version": "3.0.
|
786
|
+
"X-Fern-SDK-Version": "3.0.5",
|
787
787
|
},
|
788
788
|
contentType: "application/json",
|
789
789
|
body: yield serializers.ManualConnectionData.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -842,7 +842,7 @@ class Link {
|
|
842
842
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
843
843
|
"X-Fern-Language": "JavaScript",
|
844
844
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
845
|
-
"X-Fern-SDK-Version": "3.0.
|
845
|
+
"X-Fern-SDK-Version": "3.0.5",
|
846
846
|
},
|
847
847
|
contentType: "application/json",
|
848
848
|
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.5",
|
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.5",
|
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.5",
|
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.5",
|
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.5",
|
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.5",
|
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.5",
|
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.5",
|
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,12 @@ 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.5",
|
69
|
+
"x-vital-link-token": vitalLinkToken != null
|
70
|
+
? typeof vitalLinkToken === "string"
|
71
|
+
? vitalLinkToken
|
72
|
+
: JSON.stringify(vitalLinkToken)
|
73
|
+
: undefined,
|
67
74
|
},
|
68
75
|
contentType: "application/json",
|
69
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -77,10 +84,20 @@ class Team {
|
|
77
84
|
});
|
78
85
|
}
|
79
86
|
if (_response.error.reason === "status-code") {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
87
|
+
switch (_response.error.statusCode) {
|
88
|
+
case 422:
|
89
|
+
throw new Vital.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
90
|
+
unrecognizedObjectKeys: "passthrough",
|
91
|
+
allowUnrecognizedUnionMembers: true,
|
92
|
+
allowUnrecognizedEnumValues: true,
|
93
|
+
breadcrumbsPrefix: ["response"],
|
94
|
+
}));
|
95
|
+
default:
|
96
|
+
throw new errors.VitalError({
|
97
|
+
statusCode: _response.error.statusCode,
|
98
|
+
body: _response.error.body,
|
99
|
+
});
|
100
|
+
}
|
84
101
|
}
|
85
102
|
switch (_response.error.reason) {
|
86
103
|
case "non-json":
|
@@ -111,7 +128,7 @@ class Team {
|
|
111
128
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
112
129
|
"X-Fern-Language": "JavaScript",
|
113
130
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
114
|
-
"X-Fern-SDK-Version": "3.0.
|
131
|
+
"X-Fern-SDK-Version": "3.0.5",
|
115
132
|
},
|
116
133
|
contentType: "application/json",
|
117
134
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -174,7 +191,7 @@ class Team {
|
|
174
191
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
175
192
|
"X-Fern-Language": "JavaScript",
|
176
193
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
177
|
-
"X-Fern-SDK-Version": "3.0.
|
194
|
+
"X-Fern-SDK-Version": "3.0.5",
|
178
195
|
},
|
179
196
|
contentType: "application/json",
|
180
197
|
queryParameters: _queryParams,
|
@@ -229,7 +246,7 @@ class Team {
|
|
229
246
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
230
247
|
"X-Fern-Language": "JavaScript",
|
231
248
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
232
|
-
"X-Fern-SDK-Version": "3.0.
|
249
|
+
"X-Fern-SDK-Version": "3.0.5",
|
233
250
|
},
|
234
251
|
contentType: "application/json",
|
235
252
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -282,7 +299,7 @@ class Team {
|
|
282
299
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
283
300
|
"X-Fern-Language": "JavaScript",
|
284
301
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
285
|
-
"X-Fern-SDK-Version": "3.0.
|
302
|
+
"X-Fern-SDK-Version": "3.0.5",
|
286
303
|
},
|
287
304
|
contentType: "application/json",
|
288
305
|
queryParameters: _queryParams,
|
@@ -344,7 +361,7 @@ class Team {
|
|
344
361
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
345
362
|
"X-Fern-Language": "JavaScript",
|
346
363
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
347
|
-
"X-Fern-SDK-Version": "3.0.
|
364
|
+
"X-Fern-SDK-Version": "3.0.5",
|
348
365
|
},
|
349
366
|
contentType: "application/json",
|
350
367
|
queryParameters: _queryParams,
|
@@ -402,7 +419,7 @@ class Team {
|
|
402
419
|
"x-vital-api-key": yield core.Supplier.get(this._options.apiKey),
|
403
420
|
"X-Fern-Language": "JavaScript",
|
404
421
|
"X-Fern-SDK-Name": "@tryvital/vital-node",
|
405
|
-
"X-Fern-SDK-Version": "3.0.
|
422
|
+
"X-Fern-SDK-Version": "3.0.5",
|
406
423
|
},
|
407
424
|
contentType: "application/json",
|
408
425
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|