Skip to content

Commit

Permalink
Release 3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed May 3, 2024
1 parent 40e74a8 commit ae5a687
Show file tree
Hide file tree
Showing 236 changed files with 4,229 additions and 1,385 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ jobs:
- name: Compile
run: yarn && yarn build

test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test

publish:
needs: [ compile ]
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@tryvital/vital-node",
"version": "3.1.3",
"version": "3.1.4",
"private": false,
"repository": "https://github.com/tryVital/vital-node",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"build": "tsc",
"prepack": "cp -rv dist/. ."
"prepack": "cp -rv dist/. .",
"test": "jest"
},
"dependencies": {
"url-join": "4.0.1",
Expand All @@ -20,6 +21,9 @@
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"jest": "^29.7.0",
"@types/jest": "^29.5.5",
"ts-jest": "^29.1.1",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
Expand Down
1 change: 1 addition & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export declare namespace VitalClient {
interface Options {
environment?: core.Supplier<environments.VitalEnvironment | string>;
apiKey: core.Supplier<string>;
vitalLinkToken: core.Supplier<string>;
}

interface RequestOptions {
Expand Down
24 changes: 18 additions & 6 deletions src/api/resources/activity/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export declare namespace Activity {
interface Options {
environment?: core.Supplier<environments.VitalEnvironment | string>;
apiKey: core.Supplier<string>;
vitalLinkToken: core.Supplier<string>;
}

interface RequestOptions {
Expand All @@ -39,7 +40,7 @@ export class Activity {
requestOptions?: Activity.RequestOptions
): Promise<Vital.ClientActivityResponse> {
const { provider, startDate, endDate } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (provider != null) {
_queryParams["provider"] = provider;
}
Expand All @@ -56,10 +57,13 @@ export class Activity {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -124,7 +128,7 @@ export class Activity {
requestOptions?: Activity.RequestOptions
): Promise<Vital.RawActivity> {
const { provider, startDate, endDate } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (provider != null) {
_queryParams["provider"] = provider;
}
Expand All @@ -141,10 +145,13 @@ export class Activity {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -193,4 +200,9 @@ export class Activity {
});
}
}

protected async _getCustomAuthorizationHeaders() {
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
return { "x-vital-api-key": apiKeyValue };
}
}
24 changes: 18 additions & 6 deletions src/api/resources/body/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export declare namespace Body {
interface Options {
environment?: core.Supplier<environments.VitalEnvironment | string>;
apiKey: core.Supplier<string>;
vitalLinkToken: core.Supplier<string>;
}

interface RequestOptions {
Expand All @@ -39,7 +40,7 @@ export class Body {
requestOptions?: Body.RequestOptions
): Promise<Vital.ClientBodyResponse> {
const { provider, startDate, endDate } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (provider != null) {
_queryParams["provider"] = provider;
}
Expand All @@ -56,10 +57,13 @@ export class Body {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -124,7 +128,7 @@ export class Body {
requestOptions?: Body.RequestOptions
): Promise<Vital.RawBody> {
const { provider, startDate, endDate } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (provider != null) {
_queryParams["provider"] = provider;
}
Expand All @@ -141,10 +145,13 @@ export class Body {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -193,4 +200,9 @@ export class Body {
});
}
}

protected async _getCustomAuthorizationHeaders() {
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
return { "x-vital-api-key": apiKeyValue };
}
}
17 changes: 13 additions & 4 deletions src/api/resources/devices/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export declare namespace Devices {
interface Options {
environment?: core.Supplier<environments.VitalEnvironment | string>;
apiKey: core.Supplier<string>;
vitalLinkToken: core.Supplier<string>;
}

interface RequestOptions {
Expand All @@ -29,15 +30,15 @@ export class Devices {
* @throws {@link Vital.UnprocessableEntityError}
*
* @example
* await vital.devices.getRaw("user-id", {})
* await vital.devices.getRaw("user-id")
*/
public async getRaw(
userId: string,
request: Vital.DevicesGetRawRequest = {},
requestOptions?: Devices.RequestOptions
): Promise<Vital.RawDevices> {
const { provider } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (provider != null) {
_queryParams["provider"] = provider;
}
Expand All @@ -49,10 +50,13 @@ export class Devices {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -101,4 +105,9 @@ export class Devices {
});
}
}

protected async _getCustomAuthorizationHeaders() {
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
return { "x-vital-api-key": apiKeyValue };
}
}
22 changes: 17 additions & 5 deletions src/api/resources/insurance/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export declare namespace Insurance {
interface Options {
environment?: core.Supplier<environments.VitalEnvironment | string>;
apiKey: core.Supplier<string>;
vitalLinkToken: core.Supplier<string>;
}

interface RequestOptions {
Expand All @@ -38,10 +39,13 @@ export class Insurance {
),
method: "POST",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
body: await serializers.PayorSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -104,7 +108,7 @@ export class Insurance {
requestOptions?: Insurance.RequestOptions
): Promise<Vital.ClientFacingDiagnosisInformation[]> {
const { diagnosisQuery } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
_queryParams["diagnosis_query"] = diagnosisQuery;
const _response = await core.fetcher({
url: urlJoin(
Expand All @@ -113,10 +117,13 @@ export class Insurance {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -165,4 +172,9 @@ export class Insurance {
});
}
}

protected async _getCustomAuthorizationHeaders() {
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
return { "x-vital-api-key": apiKeyValue };
}
}
24 changes: 18 additions & 6 deletions src/api/resources/introspect/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export declare namespace Introspect {
interface Options {
environment?: core.Supplier<environments.VitalEnvironment | string>;
apiKey: core.Supplier<string>;
vitalLinkToken: core.Supplier<string>;
}

interface RequestOptions {
Expand All @@ -37,7 +38,7 @@ export class Introspect {
requestOptions?: Introspect.RequestOptions
): Promise<Vital.UserResourcesResponse> {
const { userId, provider, userLimit, cursor } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (userId != null) {
_queryParams["user_id"] = userId;
}
Expand All @@ -61,10 +62,13 @@ export class Introspect {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -127,7 +131,7 @@ export class Introspect {
requestOptions?: Introspect.RequestOptions
): Promise<Vital.UserHistoricalPullsResponse> {
const { userId, provider, userLimit, cursor } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (userId != null) {
_queryParams["user_id"] = userId;
}
Expand All @@ -151,10 +155,13 @@ export class Introspect {
),
method: "GET",
headers: {
"x-vital-api-key": await core.Supplier.get(this._options.apiKey),
"x-vital-link-token": await core.Supplier.get(this._options.vitalLinkToken),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@tryvital/vital-node",
"X-Fern-SDK-Version": "3.1.3",
"X-Fern-SDK-Version": "3.1.4",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -203,4 +210,9 @@ export class Introspect {
});
}
}

protected async _getCustomAuthorizationHeaders() {
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
return { "x-vital-api-key": apiKeyValue };
}
}
Loading

0 comments on commit ae5a687

Please sign in to comment.