@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.
@@ -1,57 +1,18 @@
1
- name: CI
1
+ name: Publish Package to npmjs
2
2
  on:
3
- push:
4
- branches:
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
- - name: Checkout repo
38
- uses: actions/checkout@v2
39
- - name: Use Node 10
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: 10
43
- - name: Install deps and build (with cache)
44
- uses: bahmutov/npm-install@v1
45
- - name: Build
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
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 }}
@@ -13,7 +13,7 @@ export class ActivityApi {
13
13
  public async get(
14
14
  userId: string,
15
15
  startDate: Date,
16
- endDate: Date,
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: Date,
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: Date,
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: Date,
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: Date,
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: Date,
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: Date,
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: Date,
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: Date,
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: Date,
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: Date,
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: Date,
80
+ endDate?: Date,
81
81
  provider?: string
82
82
  ): Promise<TimeseriesPoint[]> {
83
83
  return this.timeseriesData(
@@ -16,7 +16,7 @@ export class WorkoutsApi {
16
16
  public async get(
17
17
  userId: string,
18
18
  startDate: Date,
19
- endDate: Date,
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: Date,
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: Date, provider?: string): Promise<ClientActivityResponse>;
9
- get_raw(userId: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientActivityRawResponse>;
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
  }
@@ -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: Date, provider?: string): Promise<ClientBodyResponse>;
9
- get_raw(userId: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientBodyRawResponse>;
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
  }
@@ -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: Date, provider?: string): Promise<ClientSleepResponse>;
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: Date, provider?: string): Promise<ClientSleepRawResponse>;
10
+ get_raw(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientSleepRawResponse>;
11
11
  }
@@ -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();
@@ -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: 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[]>;
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: Date, provider?: string): Promise<ClientWorkoutResponse>;
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: Date, provider?: string): Promise<ClientWorkoutsRawResponse>;
10
+ get_raw(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<ClientWorkoutsRawResponse>;
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [