@tryvital/vital-node 2.1.20 → 2.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/Link.ts CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  OAuthProviders,
8
8
  EmailProviders,
9
9
  DemoProviders,
10
+ VitalCodeCreatedResponse,
10
11
  } from './models/link_models';
11
12
  import { SourceWithLinkInfo } from './models/user_models';
12
13
 
@@ -90,4 +91,16 @@ export class LinkApi {
90
91
  );
91
92
  return resp.data;
92
93
  }
94
+
95
+ public async codeCreate(userId: string, expiresAt: string = ""): Promise<VitalCodeCreatedResponse> {
96
+ const paramsObject = expiresAt ? {user_id: userId, expires_at: expiresAt} : {user_id: userId};
97
+ const resp = await this.client.post(
98
+ this.baseURL.concat(`/link/code/create`),
99
+ null,
100
+ {
101
+ params: paramsObject
102
+ }
103
+ );
104
+ return resp.data;
105
+ }
93
106
  }
@@ -1,6 +1,12 @@
1
- import {USAddress} from "./athome_phlebotomy_models";
1
+ import { USAddress } from './athome_phlebotomy_models';
2
2
 
3
- export type ConsentType = "terms-of-use" | "telehealth-informed-consent" | "mobile-terms-and-conditions" | "notice-of-privacy-practices" | "privacy-policy" | "hipaa-authorization";
3
+ export type ConsentType =
4
+ | 'terms-of-use'
5
+ | 'telehealth-informed-consent'
6
+ | 'mobile-terms-and-conditions'
7
+ | 'notice-of-privacy-practices'
8
+ | 'privacy-policy'
9
+ | 'hipaa-authorization';
4
10
 
5
11
  export type Consent = {
6
12
  consentType: ConsentType;
@@ -73,7 +79,7 @@ export interface TestkitEvent {
73
79
  status: string;
74
80
  }
75
81
 
76
- export interface PayorAddress{
82
+ export interface PayorAddress {
77
83
  city: string;
78
84
  state: string;
79
85
  zip: string;
@@ -170,7 +176,35 @@ export interface LabResultsMetadata {
170
176
 
171
177
  export interface LabResultsResponse {
172
178
  metadata: LabResultsMetadata;
173
- results: Object;
179
+ results: Result[];
180
+ }
181
+
182
+ export enum Interpretation {
183
+ NORMAL = 'normal',
184
+ ABNORMAL = 'abnormal',
185
+ CRITICAL = 'critical',
186
+ }
187
+
188
+ export enum ResultType {
189
+ NUMERIC = 'numeric',
190
+ RANGE = 'range',
191
+ COMMENT = 'comment',
192
+ }
193
+
194
+ export interface Result {
195
+ name: string;
196
+ slug: string; // Optional and has a default value of an empty string
197
+ value: number; // Deprecated
198
+ result: string;
199
+ type: ResultType;
200
+ unit?: string; // Optional
201
+ timestamp?: Date; // Optional
202
+ notes?: string; // Optional
203
+ min_range_value?: number; // Optional
204
+ max_range_value?: number; // Optional
205
+ is_above_max_range?: boolean; // Optional
206
+ is_below_min_range?: boolean; // Optional
207
+ interpretation: Interpretation; // default value of Interpretation.NORMAL
174
208
  }
175
209
 
176
210
  export interface AreaInfo {
@@ -39,3 +39,8 @@ export interface DemoConnectionResponse {
39
39
  success: boolean;
40
40
  redirect_url?: string;
41
41
  }
42
+
43
+ export interface VitalCodeCreatedResponse {
44
+ code: string;
45
+ exchange_url: string;
46
+ }
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { ProviderLinkResponse, LinkTokenExchangeResponse, DemoConnectionResponse, PasswordProviders, OAuthProviders, EmailProviders, DemoProviders } from './models/link_models';
2
+ import { ProviderLinkResponse, LinkTokenExchangeResponse, DemoConnectionResponse, PasswordProviders, OAuthProviders, EmailProviders, DemoProviders, VitalCodeCreatedResponse } from './models/link_models';
3
3
  import { SourceWithLinkInfo } from './models/user_models';
4
4
  export declare class LinkApi {
5
5
  baseURL: string;
@@ -10,4 +10,5 @@ export declare class LinkApi {
10
10
  connectEmailProvider(linkToken: string, provider: EmailProviders, email: string, region?: string): Promise<ProviderLinkResponse>;
11
11
  getOAuthLink(linkToken: string, provider: OAuthProviders): Promise<SourceWithLinkInfo>;
12
12
  connectDemoProvider(userId: string, provider: DemoProviders): Promise<DemoConnectionResponse>;
13
+ codeCreate(userId: string, expiresAt?: string): Promise<VitalCodeCreatedResponse>;
13
14
  }
@@ -125,6 +125,24 @@ var LinkApi = /** @class */ (function () {
125
125
  });
126
126
  });
127
127
  };
128
+ LinkApi.prototype.codeCreate = function (userId, expiresAt) {
129
+ if (expiresAt === void 0) { expiresAt = ""; }
130
+ return __awaiter(this, void 0, void 0, function () {
131
+ var paramsObject, resp;
132
+ return __generator(this, function (_a) {
133
+ switch (_a.label) {
134
+ case 0:
135
+ paramsObject = expiresAt ? { user_id: userId, expires_at: expiresAt } : { user_id: userId };
136
+ return [4 /*yield*/, this.client.post(this.baseURL.concat("/link/code/create"), null, {
137
+ params: paramsObject
138
+ })];
139
+ case 1:
140
+ resp = _a.sent();
141
+ return [2 /*return*/, resp.data];
142
+ }
143
+ });
144
+ });
145
+ };
128
146
  return LinkApi;
129
147
  }());
130
148
  exports.LinkApi = LinkApi;
@@ -1,4 +1,4 @@
1
- export declare type ConsentType = "terms-of-use" | "telehealth-informed-consent" | "mobile-terms-and-conditions" | "notice-of-privacy-practices" | "privacy-policy" | "hipaa-authorization";
1
+ export declare type ConsentType = 'terms-of-use' | 'telehealth-informed-consent' | 'mobile-terms-and-conditions' | 'notice-of-privacy-practices' | 'privacy-policy' | 'hipaa-authorization';
2
2
  export declare type Consent = {
3
3
  consentType: ConsentType;
4
4
  };
@@ -134,7 +134,32 @@ export interface LabResultsMetadata {
134
134
  }
135
135
  export interface LabResultsResponse {
136
136
  metadata: LabResultsMetadata;
137
- results: Object;
137
+ results: Result[];
138
+ }
139
+ export declare enum Interpretation {
140
+ NORMAL = "normal",
141
+ ABNORMAL = "abnormal",
142
+ CRITICAL = "critical"
143
+ }
144
+ export declare enum ResultType {
145
+ NUMERIC = "numeric",
146
+ RANGE = "range",
147
+ COMMENT = "comment"
148
+ }
149
+ export interface Result {
150
+ name: string;
151
+ slug: string;
152
+ value: number;
153
+ result: string;
154
+ type: ResultType;
155
+ unit?: string;
156
+ timestamp?: Date;
157
+ notes?: string;
158
+ min_range_value?: number;
159
+ max_range_value?: number;
160
+ is_above_max_range?: boolean;
161
+ is_below_min_range?: boolean;
162
+ interpretation: Interpretation;
138
163
  }
139
164
  export interface AreaInfo {
140
165
  zip_code: string;
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResultType = exports.Interpretation = void 0;
4
+ var Interpretation;
5
+ (function (Interpretation) {
6
+ Interpretation["NORMAL"] = "normal";
7
+ Interpretation["ABNORMAL"] = "abnormal";
8
+ Interpretation["CRITICAL"] = "critical";
9
+ })(Interpretation = exports.Interpretation || (exports.Interpretation = {}));
10
+ var ResultType;
11
+ (function (ResultType) {
12
+ ResultType["NUMERIC"] = "numeric";
13
+ ResultType["RANGE"] = "range";
14
+ ResultType["COMMENT"] = "comment";
15
+ })(ResultType = exports.ResultType || (exports.ResultType = {}));
@@ -14,3 +14,7 @@ export interface DemoConnectionResponse {
14
14
  success: boolean;
15
15
  redirect_url?: string;
16
16
  }
17
+ export interface VitalCodeCreatedResponse {
18
+ code: string;
19
+ exchange_url: string;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "2.1.20",
3
+ "version": "2.1.22",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [