@tryvital/vital-node 1.3.0 → 1.3.1
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/.github/workflows/deploy.yaml +11 -50
- package/client/Activity.ts +2 -2
- package/client/Body.ts +2 -2
- package/client/Sleep.ts +5 -4
- package/client/Vitals.ts +6 -6
- package/client/Workouts.ts +2 -2
- package/dist/client/Activity.d.ts +2 -2
- package/dist/client/Body.d.ts +2 -2
- package/dist/client/Sleep.d.ts +2 -2
- package/dist/client/Sleep.js +3 -2
- package/dist/client/Vitals.d.ts +5 -5
- package/dist/client/Workouts.d.ts +2 -2
- package/package.json +1 -1
@@ -1,57 +1,18 @@
|
|
1
|
-
name:
|
1
|
+
name: Publish Package to npmjs
|
2
2
|
on:
|
3
|
-
|
4
|
-
|
5
|
-
- "main"
|
3
|
+
release:
|
4
|
+
types: [published]
|
6
5
|
jobs:
|
7
6
|
build:
|
8
|
-
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
|
9
|
-
runs-on: ${{ matrix.os }}
|
10
|
-
strategy:
|
11
|
-
matrix:
|
12
|
-
node: ['10.x', '12.x', '14.x']
|
13
|
-
os: [ubuntu-latest, windows-latest, macOS-latest]
|
14
|
-
|
15
|
-
steps:
|
16
|
-
- name: Checkout repo
|
17
|
-
uses: actions/checkout@v2
|
18
|
-
|
19
|
-
- name: Use Node ${{ matrix.node }}
|
20
|
-
uses: actions/setup-node@v1
|
21
|
-
with:
|
22
|
-
node-version: ${{ matrix.node }}
|
23
|
-
|
24
|
-
- name: Install deps and build (with cache)
|
25
|
-
uses: bahmutov/npm-install@v1
|
26
|
-
|
27
|
-
- name: Lint
|
28
|
-
run: yarn lint
|
29
|
-
|
30
|
-
- name: Build
|
31
|
-
run: yarn build
|
32
|
-
publish:
|
33
|
-
needs: build
|
34
|
-
name: Build, lint, and test on Node 10
|
35
7
|
runs-on: ubuntu-latest
|
36
8
|
steps:
|
37
|
-
-
|
38
|
-
|
39
|
-
-
|
40
|
-
uses: actions/setup-node@v1
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
# Setup .npmrc file to publish to npm
|
11
|
+
- uses: actions/setup-node@v2
|
41
12
|
with:
|
42
|
-
node-version:
|
43
|
-
|
44
|
-
|
45
|
-
-
|
46
|
-
run: yarn build
|
47
|
-
- name: 'Automated Version Bump'
|
48
|
-
uses: 'phips28/gh-action-bump-version@master'
|
13
|
+
node-version: '16.x'
|
14
|
+
registry-url: 'https://registry.npmjs.org'
|
15
|
+
- run: npm ci
|
16
|
+
- run: npm publish
|
49
17
|
env:
|
50
|
-
|
51
|
-
with:
|
52
|
-
target-branch: 'main'
|
53
|
-
- uses: JS-DevTools/npm-publish@v1
|
54
|
-
with:
|
55
|
-
token: ${{ secrets.NPM_TOKEN }}
|
56
|
-
access: public
|
57
|
-
|
18
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
package/client/Activity.ts
CHANGED
@@ -13,7 +13,7 @@ export class ActivityApi {
|
|
13
13
|
public async get(
|
14
14
|
userId: string,
|
15
15
|
startDate: Date,
|
16
|
-
endDate
|
16
|
+
endDate?: Date,
|
17
17
|
provider?: string
|
18
18
|
): Promise<ClientActivityResponse> {
|
19
19
|
const resp = await this.client.get(
|
@@ -28,7 +28,7 @@ export class ActivityApi {
|
|
28
28
|
public async get_raw(
|
29
29
|
userId: string,
|
30
30
|
startDate: Date,
|
31
|
-
endDate
|
31
|
+
endDate?: Date,
|
32
32
|
provider?: string
|
33
33
|
): Promise<ClientActivityRawResponse> {
|
34
34
|
const resp = await this.client.get(
|
package/client/Body.ts
CHANGED
@@ -14,7 +14,7 @@ export class BodyApi {
|
|
14
14
|
public async get(
|
15
15
|
userId: string,
|
16
16
|
startDate: Date,
|
17
|
-
endDate
|
17
|
+
endDate?: Date,
|
18
18
|
provider?: string
|
19
19
|
): Promise<ClientBodyResponse> {
|
20
20
|
const resp = await this.client.get(
|
@@ -29,7 +29,7 @@ export class BodyApi {
|
|
29
29
|
public async get_raw(
|
30
30
|
userId: string,
|
31
31
|
startDate: Date,
|
32
|
-
endDate
|
32
|
+
endDate?: Date,
|
33
33
|
provider?: string
|
34
34
|
): Promise<ClientBodyRawResponse> {
|
35
35
|
const resp = await this.client.get(
|
package/client/Sleep.ts
CHANGED
@@ -16,13 +16,14 @@ export class SleepApi {
|
|
16
16
|
public async get(
|
17
17
|
userId: string,
|
18
18
|
startDate: Date,
|
19
|
-
endDate
|
20
|
-
provider?: string
|
19
|
+
endDate?: Date,
|
20
|
+
provider?: string,
|
21
|
+
with_stream: boolean = false
|
21
22
|
): Promise<ClientSleepResponse> {
|
22
23
|
const resp = await this.client.get(
|
23
24
|
this.baseURL.concat(`/summary/sleep/${userId}`),
|
24
25
|
{
|
25
|
-
params: { start_date: startDate, end_date: endDate, provider },
|
26
|
+
params: { start_date: startDate, end_date: endDate, provider, with_stream },
|
26
27
|
}
|
27
28
|
);
|
28
29
|
return resp.data;
|
@@ -38,7 +39,7 @@ export class SleepApi {
|
|
38
39
|
public async get_raw(
|
39
40
|
userId: string,
|
40
41
|
startDate: Date,
|
41
|
-
endDate
|
42
|
+
endDate?: Date,
|
42
43
|
provider?: string
|
43
44
|
): Promise<ClientSleepRawResponse> {
|
44
45
|
const resp = await this.client.get(
|
package/client/Vitals.ts
CHANGED
@@ -13,7 +13,7 @@ export class VitalsApi {
|
|
13
13
|
user_key: string,
|
14
14
|
resource: string,
|
15
15
|
startDate: Date,
|
16
|
-
endDate
|
16
|
+
endDate?: Date,
|
17
17
|
provider?: string
|
18
18
|
): Promise<TimeseriesPoint[]> {
|
19
19
|
const resp = await this.client.get(
|
@@ -29,7 +29,7 @@ export class VitalsApi {
|
|
29
29
|
type: 'ldl' | 'total' | 'triglycerides' | 'hdl',
|
30
30
|
userId: string,
|
31
31
|
startDate: Date,
|
32
|
-
endDate
|
32
|
+
endDate?: Date,
|
33
33
|
provider?: string
|
34
34
|
): Promise<TimeseriesPoint[]> {
|
35
35
|
return this.timeseriesData(
|
@@ -44,7 +44,7 @@ export class VitalsApi {
|
|
44
44
|
public async glucose(
|
45
45
|
userId: string,
|
46
46
|
startDate: Date,
|
47
|
-
endDate
|
47
|
+
endDate?: Date,
|
48
48
|
provider?: string
|
49
49
|
): Promise<TimeseriesPoint[]> {
|
50
50
|
return this.timeseriesData(
|
@@ -59,7 +59,7 @@ export class VitalsApi {
|
|
59
59
|
public async ige(
|
60
60
|
userId: string,
|
61
61
|
startDate: Date,
|
62
|
-
endDate
|
62
|
+
endDate?: Date,
|
63
63
|
provider?: string
|
64
64
|
): Promise<TimeseriesPoint[]> {
|
65
65
|
return this.timeseriesData(userId, 'ige', startDate, endDate, provider);
|
@@ -68,7 +68,7 @@ export class VitalsApi {
|
|
68
68
|
public async igg(
|
69
69
|
userId: string,
|
70
70
|
startDate: Date,
|
71
|
-
endDate
|
71
|
+
endDate?: Date,
|
72
72
|
provider?: string
|
73
73
|
): Promise<TimeseriesPoint[]> {
|
74
74
|
return this.timeseriesData(userId, 'igg', startDate, endDate, provider);
|
@@ -77,7 +77,7 @@ export class VitalsApi {
|
|
77
77
|
public async heartrate(
|
78
78
|
userId: string,
|
79
79
|
startDate: Date,
|
80
|
-
endDate
|
80
|
+
endDate?: Date,
|
81
81
|
provider?: string
|
82
82
|
): Promise<TimeseriesPoint[]> {
|
83
83
|
return this.timeseriesData(
|
package/client/Workouts.ts
CHANGED
@@ -16,7 +16,7 @@ export class WorkoutsApi {
|
|
16
16
|
public async get(
|
17
17
|
userId: string,
|
18
18
|
startDate: Date,
|
19
|
-
endDate
|
19
|
+
endDate?: Date,
|
20
20
|
provider?: string
|
21
21
|
): Promise<ClientWorkoutResponse> {
|
22
22
|
const resp = await this.client.get(
|
@@ -40,7 +40,7 @@ export class WorkoutsApi {
|
|
40
40
|
public async get_raw(
|
41
41
|
userId: string,
|
42
42
|
startDate: Date,
|
43
|
-
endDate
|
43
|
+
endDate?: Date,
|
44
44
|
provider?: string
|
45
45
|
): Promise<ClientWorkoutsRawResponse> {
|
46
46
|
const resp = await this.client.get(
|
@@ -5,6 +5,6 @@ export declare class ActivityApi {
|
|
5
5
|
baseURL: string;
|
6
6
|
client: AxiosInstance;
|
7
7
|
constructor(baseURL: string, axios: AxiosInstance);
|
8
|
-
get(userId: string, startDate: Date, endDate
|
9
|
-
get_raw(userId: string, startDate: Date, endDate
|
8
|
+
get(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientActivityResponse>;
|
9
|
+
get_raw(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientActivityRawResponse>;
|
10
10
|
}
|
package/dist/client/Body.d.ts
CHANGED
@@ -5,6 +5,6 @@ export declare class BodyApi {
|
|
5
5
|
baseURL: string;
|
6
6
|
client: AxiosInstance;
|
7
7
|
constructor(baseURL: string, axios: AxiosInstance);
|
8
|
-
get(userId: string, startDate: Date, endDate
|
9
|
-
get_raw(userId: string, startDate: Date, endDate
|
8
|
+
get(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientBodyResponse>;
|
9
|
+
get_raw(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientBodyRawResponse>;
|
10
10
|
}
|
package/dist/client/Sleep.d.ts
CHANGED
@@ -5,7 +5,7 @@ export declare class SleepApi {
|
|
5
5
|
baseURL: string;
|
6
6
|
client: AxiosInstance;
|
7
7
|
constructor(baseURL: string, axios: AxiosInstance);
|
8
|
-
get(userId: string, startDate: Date, endDate
|
8
|
+
get(userId: string, startDate: Date, endDate?: Date, provider?: string, with_stream?: boolean): Promise<ClientSleepResponse>;
|
9
9
|
getStream(sleepId: string): Promise<ClientSleepStreamResponse>;
|
10
|
-
get_raw(userId: string, startDate: Date, endDate
|
10
|
+
get_raw(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientSleepRawResponse>;
|
11
11
|
}
|
package/dist/client/Sleep.js
CHANGED
@@ -42,13 +42,14 @@ var SleepApi = /** @class */ (function () {
|
|
42
42
|
this.baseURL = baseURL;
|
43
43
|
this.client = axios;
|
44
44
|
}
|
45
|
-
SleepApi.prototype.get = function (userId, startDate, endDate, provider) {
|
45
|
+
SleepApi.prototype.get = function (userId, startDate, endDate, provider, with_stream) {
|
46
|
+
if (with_stream === void 0) { with_stream = false; }
|
46
47
|
return __awaiter(this, void 0, void 0, function () {
|
47
48
|
var resp;
|
48
49
|
return __generator(this, function (_a) {
|
49
50
|
switch (_a.label) {
|
50
51
|
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/sleep/" + userId), {
|
51
|
-
params: { start_date: startDate, end_date: endDate, provider: provider },
|
52
|
+
params: { start_date: startDate, end_date: endDate, provider: provider, with_stream: with_stream },
|
52
53
|
})];
|
53
54
|
case 1:
|
54
55
|
resp = _a.sent();
|
package/dist/client/Vitals.d.ts
CHANGED
@@ -5,9 +5,9 @@ export declare class VitalsApi {
|
|
5
5
|
client: AxiosInstance;
|
6
6
|
constructor(baseURL: string, axios: AxiosInstance);
|
7
7
|
private timeseriesData;
|
8
|
-
cholesterol(type: 'ldl' | 'total' | 'triglycerides' | 'hdl', userId: string, startDate: Date, endDate
|
9
|
-
glucose(userId: string, startDate: Date, endDate
|
10
|
-
ige(userId: string, startDate: Date, endDate
|
11
|
-
igg(userId: string, startDate: Date, endDate
|
12
|
-
heartrate(userId: string, startDate: Date, endDate
|
8
|
+
cholesterol(type: 'ldl' | 'total' | 'triglycerides' | 'hdl', userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
|
9
|
+
glucose(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
|
10
|
+
ige(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
|
11
|
+
igg(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
|
12
|
+
heartrate(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
|
13
13
|
}
|
@@ -5,7 +5,7 @@ export declare class WorkoutsApi {
|
|
5
5
|
baseURL: string;
|
6
6
|
client: AxiosInstance;
|
7
7
|
constructor(baseURL: string, axios: AxiosInstance);
|
8
|
-
get(userId: string, startDate: Date, endDate
|
8
|
+
get(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientWorkoutResponse>;
|
9
9
|
getStream(workoutId: string): Promise<ClientWorkoutStreamResponse>;
|
10
|
-
get_raw(userId: string, startDate: Date, endDate
|
10
|
+
get_raw(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientWorkoutsRawResponse>;
|
11
11
|
}
|