Skip to content

Commit

Permalink
Release 3.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 7, 2023
1 parent 49b81d9 commit ce73150
Show file tree
Hide file tree
Showing 45 changed files with 537 additions and 198 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tryvital/vital-node",
"version": "3.0.5",
"version": "3.0.6",
"private": false,
"repository": "https://github.com/tryVital/vital-node",
"main": "./index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/activity/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Activity {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -133,7 +133,7 @@ export class Activity {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/body/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Body {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -133,7 +133,7 @@ export class Body {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/devices/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Devices {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/insurance/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Insurance {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
body: await serializers.PayorSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -110,7 +110,7 @@ export class Insurance {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
86 changes: 85 additions & 1 deletion src/api/resources/introspect/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Introspect {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.5",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -107,4 +107,88 @@ export class Introspect {
});
}
}

/**
* @throws {@link Vital.UnprocessableEntityError}
*/
public async getUserHistoricalPulls(
request: Vital.IntrospectGetUserHistoricalPullsRequest = {},
requestOptions?: Introspect.RequestOptions
): Promise<Vital.UserHistoricalPullsResponse> {
const { userId, provider, userLimit, cursor } = request;
const _queryParams = new URLSearchParams();
if (userId != null) {
_queryParams.append("user_id", userId);
}

if (provider != null) {
_queryParams.append("provider", provider);
}

if (userLimit != null) {
_queryParams.append("user_limit", userLimit.toString());
}

if (cursor != null) {
_queryParams.append("cursor", cursor);
}

const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.VitalEnvironment.Production,
"v2/introspect/historical_pull"
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.0.6",
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
});
if (_response.ok) {
return await serializers.UserHistoricalPullsResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
});
}

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 422:
throw new Vital.UnprocessableEntityError(
await serializers.HttpValidationError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
})
);
default:
throw new errors.VitalError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
}
}

switch (_response.error.reason) {
case "non-json":
throw new errors.VitalError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
});
case "timeout":
throw new errors.VitalTimeoutError();
case "unknown":
throw new errors.VitalError({
message: _response.error.errorMessage,
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vital from "../../../..";

export interface IntrospectGetUserHistoricalPullsRequest {
userId?: string;
provider?: Vital.Providers;
userLimit?: number;
cursor?: string;
}
1 change: 1 addition & 0 deletions src/api/resources/introspect/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { IntrospectGetUserResourcesRequest } from "./IntrospectGetUserResourcesRequest";
export { IntrospectGetUserHistoricalPullsRequest } from "./IntrospectGetUserHistoricalPullsRequest";
Loading

0 comments on commit ce73150

Please sign in to comment.