@doolehealth/service-lib 0.0.11 → 1.0.0
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/fesm2022/doolehealth-service-lib.mjs +132 -488
- package/fesm2022/doolehealth-service-lib.mjs.map +1 -1
- package/lib/service-lib.component.d.ts +1 -1
- package/lib/service-lib.module.d.ts +3 -3
- package/lib/services/date.service.d.ts +1 -1
- package/lib/services/doole.service.d.ts +2 -4
- package/lib/services/highcharts.service.d.ts +1 -0
- package/lib/services/network.service.d.ts +2 -4
- package/package.json +7 -7
- package/public-api.d.ts +0 -1
- package/esm2022/doolehealth-service-lib.mjs +0 -5
- package/esm2022/lib/configuration.mjs +0 -5
- package/esm2022/lib/models/notifications/notification-options.mjs +0 -192
- package/esm2022/lib/models/shared-care-plan.mjs +0 -223
- package/esm2022/lib/models/user.mjs +0 -2
- package/esm2022/lib/service-lib.component.mjs +0 -19
- package/esm2022/lib/service-lib.module.mjs +0 -33
- package/esm2022/lib/services/analytics.service.mjs +0 -82
- package/esm2022/lib/services/api-endpoints.service.mjs +0 -67
- package/esm2022/lib/services/authentication.service.mjs +0 -424
- package/esm2022/lib/services/change-endpoints.service.mjs +0 -72
- package/esm2022/lib/services/date.service.mjs +0 -536
- package/esm2022/lib/services/doole.service.mjs +0 -1762
- package/esm2022/lib/services/encryption.service.mjs +0 -31
- package/esm2022/lib/services/error.service.mjs +0 -49
- package/esm2022/lib/services/events.service.mjs +0 -63
- package/esm2022/lib/services/firebase/auth/firebase-auth.service.mjs +0 -154
- package/esm2022/lib/services/firebase/auth/firebase-profile.model.mjs +0 -7
- package/esm2022/lib/services/health.service.mjs +0 -303
- package/esm2022/lib/services/highcharts.service.mjs +0 -594
- package/esm2022/lib/services/http.service.mjs +0 -124
- package/esm2022/lib/services/language.model.mjs +0 -3
- package/esm2022/lib/services/language.service.mjs +0 -48
- package/esm2022/lib/services/loading.service.mjs +0 -45
- package/esm2022/lib/services/logging.service.mjs +0 -28
- package/esm2022/lib/services/navigation.service.mjs +0 -142
- package/esm2022/lib/services/network.service.mjs +0 -42
- package/esm2022/lib/services/notification.service.mjs +0 -116
- package/esm2022/lib/services/opentok.service.mjs +0 -28
- package/esm2022/lib/services/permission.service.mjs +0 -94
- package/esm2022/lib/services/roles.service.mjs +0 -45
- package/esm2022/lib/services/shared-care-plan/shared-care-plan.service.mjs +0 -103
- package/esm2022/lib/services/storage.service.mjs +0 -37
- package/esm2022/lib/services/token.service.mjs +0 -59
- package/esm2022/lib/utils/chatParameters.mjs +0 -17
- package/esm2022/lib/utils/data-store.mjs +0 -62
- package/esm2022/lib/utils/query-string-parameters.mjs +0 -11
- package/esm2022/lib/utils/url-builder.mjs +0 -15
- package/esm2022/public-api.mjs +0 -37
- package/lib/services/health.service.d.ts +0 -49
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, InjectionToken, NgModule, Inject, Injectable, PLATFORM_ID, ViewChild } from '@angular/core';
|
|
3
|
-
import * as i2$
|
|
3
|
+
import * as i2$2 from '@angular/common';
|
|
4
4
|
import { CommonModule, DatePipe, isPlatformBrowser } from '@angular/common';
|
|
5
|
-
import { BehaviorSubject, Subject,
|
|
5
|
+
import { BehaviorSubject, Subject, throwError, of, TimeoutError, Observable, merge, fromEvent, map as map$1, ReplaySubject, combineLatest, from } from 'rxjs';
|
|
6
6
|
import { Preferences } from '@capacitor/preferences';
|
|
7
7
|
import { map, tap, catchError, mergeMap, mapTo, filter, delay, startWith } from 'rxjs/operators';
|
|
8
8
|
import * as i1 from '@angular/common/http';
|
|
9
9
|
import { HttpErrorResponse, HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
10
10
|
import * as i6 from '@angular/router';
|
|
11
11
|
import { RouterOutlet, NavigationEnd } from '@angular/router';
|
|
12
|
-
import * as i2$
|
|
12
|
+
import * as i2$1 from '@ngx-translate/core';
|
|
13
13
|
import { TranslateService } from '@ngx-translate/core';
|
|
14
14
|
import { Capacitor } from '@capacitor/core';
|
|
15
15
|
import * as CryptoJS from 'crypto-js';
|
|
16
|
-
import * as
|
|
16
|
+
import * as i1$1 from '@ionic/angular';
|
|
17
17
|
import * as i5 from '@angular/fire/compat/auth';
|
|
18
|
-
import * as i2
|
|
18
|
+
import * as i2 from '@awesome-cordova-plugins/file-transfer/ngx';
|
|
19
19
|
import * as i3 from '@awesome-cordova-plugins/file/ngx';
|
|
20
20
|
import moment from 'moment';
|
|
21
21
|
import * as HighCharts from 'highcharts';
|
|
22
|
-
import
|
|
23
|
-
import * as i1$
|
|
22
|
+
import 'highcharts/highcharts-more';
|
|
23
|
+
import * as i1$2 from '@angular/material/snack-bar';
|
|
24
24
|
import { MatSnackBarConfig } from '@angular/material/snack-bar';
|
|
25
|
-
import
|
|
25
|
+
import { Network } from '@capacitor/network';
|
|
26
26
|
import { CallCapacitor } from '@doole/videocall-notications-plugins';
|
|
27
27
|
import { FirebaseAnalytics } from '@capacitor-community/firebase-analytics';
|
|
28
|
-
import { NativeMarket } from '@capacitor-community/native-market';
|
|
29
|
-
import * as i1$3 from '@awesome-cordova-plugins/device/ngx';
|
|
30
28
|
import { __decorate, __param } from 'tslib';
|
|
31
29
|
import firebase from 'firebase/compat/app';
|
|
32
30
|
|
|
33
31
|
class ServiceLibComponent {
|
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
35
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ServiceLibComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", type: ServiceLibComponent, isStandalone: true, selector: "lib-service-lib", ngImport: i0, template: `
|
|
36
34
|
<p>
|
|
37
35
|
service-lib works!
|
|
38
36
|
</p>
|
|
39
37
|
`, isInline: true, styles: [""] }); }
|
|
40
38
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ServiceLibComponent, decorators: [{
|
|
42
40
|
type: Component,
|
|
43
|
-
args: [{ selector: 'lib-service-lib', template: `
|
|
41
|
+
args: [{ standalone: true, selector: 'lib-service-lib', template: `
|
|
44
42
|
<p>
|
|
45
43
|
service-lib works!
|
|
46
44
|
</p>
|
|
@@ -62,16 +60,17 @@ class ServiceLibModule {
|
|
|
62
60
|
]
|
|
63
61
|
};
|
|
64
62
|
}
|
|
65
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
66
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
67
|
-
|
|
63
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ServiceLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
64
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.9", ngImport: i0, type: ServiceLibModule, imports: [CommonModule,
|
|
65
|
+
ServiceLibComponent], exports: [ServiceLibComponent] }); }
|
|
66
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ServiceLibModule, imports: [CommonModule] }); }
|
|
68
67
|
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ServiceLibModule, decorators: [{
|
|
70
69
|
type: NgModule,
|
|
71
70
|
args: [{
|
|
72
|
-
declarations: [ServiceLibComponent],
|
|
73
71
|
imports: [
|
|
74
72
|
CommonModule,
|
|
73
|
+
ServiceLibComponent
|
|
75
74
|
],
|
|
76
75
|
exports: [
|
|
77
76
|
ServiceLibComponent
|
|
@@ -159,10 +158,10 @@ class ChangeEndpointsService {
|
|
|
159
158
|
this.setEndPoint(index);
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
163
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ChangeEndpointsService, deps: [{ token: CONFIGURACION_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
162
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ChangeEndpointsService, providedIn: 'root' }); }
|
|
164
163
|
}
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ChangeEndpointsService, decorators: [{
|
|
166
165
|
type: Injectable,
|
|
167
166
|
args: [{
|
|
168
167
|
providedIn: 'root'
|
|
@@ -224,10 +223,10 @@ class ApiEndpointsService {
|
|
|
224
223
|
return Number(JSON.parse(endpoint));
|
|
225
224
|
return undefined;
|
|
226
225
|
}
|
|
227
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
228
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
226
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ApiEndpointsService, deps: [{ token: ChangeEndpointsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
227
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ApiEndpointsService, providedIn: 'root' }); }
|
|
229
228
|
}
|
|
230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ApiEndpointsService, decorators: [{
|
|
231
230
|
type: Injectable,
|
|
232
231
|
args: [{
|
|
233
232
|
providedIn: 'root'
|
|
@@ -252,10 +251,10 @@ class EncryptionService {
|
|
|
252
251
|
return encryptedData;
|
|
253
252
|
}
|
|
254
253
|
}
|
|
255
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
256
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
254
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: EncryptionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
255
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: EncryptionService, providedIn: 'root' }); }
|
|
257
256
|
}
|
|
258
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: EncryptionService, decorators: [{
|
|
259
258
|
type: Injectable,
|
|
260
259
|
args: [{
|
|
261
260
|
providedIn: 'root'
|
|
@@ -308,10 +307,10 @@ class TokenService {
|
|
|
308
307
|
this.deviceTokens = decryptedData ? decryptedData : [];
|
|
309
308
|
return this.deviceTokens;
|
|
310
309
|
}
|
|
311
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
312
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
310
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TokenService, deps: [{ token: EncryptionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
311
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TokenService, providedIn: 'root' }); }
|
|
313
312
|
}
|
|
314
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: TokenService, decorators: [{
|
|
315
314
|
type: Injectable,
|
|
316
315
|
args: [{
|
|
317
316
|
providedIn: 'root'
|
|
@@ -710,10 +709,10 @@ class AuthenticationService {
|
|
|
710
709
|
const value = localStorage.getItem('cancelGoogleFit');
|
|
711
710
|
return value !== null ? JSON.parse(value) : false;
|
|
712
711
|
}
|
|
713
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
714
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
712
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AuthenticationService, deps: [{ token: PLATFORM_ID }, { token: i1.HttpClient }, { token: TokenService }, { token: ApiEndpointsService }, { token: i1$1.Platform }, { token: i5.AngularFireAuth }, { token: i6.Router }, { token: i1$1.AlertController }, { token: i0.Injector }, { token: ChangeEndpointsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
713
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AuthenticationService, providedIn: 'root' }); }
|
|
715
714
|
}
|
|
716
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
715
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AuthenticationService, decorators: [{
|
|
717
716
|
type: Injectable,
|
|
718
717
|
args: [{
|
|
719
718
|
providedIn: 'root'
|
|
@@ -721,7 +720,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
721
720
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
722
721
|
type: Inject,
|
|
723
722
|
args: [PLATFORM_ID]
|
|
724
|
-
}] }, { type: i1.HttpClient }, { type: TokenService }, { type: ApiEndpointsService }, { type:
|
|
723
|
+
}] }, { type: i1.HttpClient }, { type: TokenService }, { type: ApiEndpointsService }, { type: i1$1.Platform }, { type: i5.AngularFireAuth }, { type: i6.Router }, { type: i1$1.AlertController }, { type: i0.Injector }, { type: ChangeEndpointsService }], propDecorators: { outlet: [{
|
|
725
724
|
type: ViewChild,
|
|
726
725
|
args: [RouterOutlet]
|
|
727
726
|
}] } });
|
|
@@ -834,10 +833,10 @@ class HttpService {
|
|
|
834
833
|
return httpOptions;
|
|
835
834
|
}
|
|
836
835
|
}
|
|
837
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
838
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
836
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: HttpService, deps: [{ token: i1.HttpClient }, { token: i1.HttpBackend }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
837
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: HttpService, providedIn: 'root' }); }
|
|
839
838
|
}
|
|
840
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: HttpService, decorators: [{
|
|
841
840
|
type: Injectable,
|
|
842
841
|
args: [{
|
|
843
842
|
providedIn: 'root'
|
|
@@ -894,10 +893,10 @@ class Events {
|
|
|
894
893
|
subject.complete();
|
|
895
894
|
delete this.channels[topic];
|
|
896
895
|
}
|
|
897
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
898
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
896
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: Events, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
897
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: Events, providedIn: 'root' }); }
|
|
899
898
|
}
|
|
900
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: Events, decorators: [{
|
|
901
900
|
type: Injectable,
|
|
902
901
|
args: [{
|
|
903
902
|
providedIn: 'root'
|
|
@@ -936,13 +935,13 @@ class DooleService {
|
|
|
936
935
|
// uses diagnostic/media when diagnostic is new
|
|
937
936
|
//const endpoint = id ? this.api.getEndpoint('diagnostic/media'):this.api.getEndpoint('media/upload/temp') ;
|
|
938
937
|
const endpoint = this.api.getEndpoint('media/upload/temp');
|
|
939
|
-
|
|
938
|
+
//console.log("* uploadFile endpoint", endpoint);
|
|
940
939
|
return new Promise(function (resolve, reject) {
|
|
941
940
|
fileTransfer.upload(image, endpoint, options).then(data => {
|
|
942
|
-
|
|
941
|
+
//console.log(data);
|
|
943
942
|
resolve(JSON.parse(data.response));
|
|
944
943
|
}, (err) => {
|
|
945
|
-
|
|
944
|
+
//console.log(err);
|
|
946
945
|
reject(err);
|
|
947
946
|
});
|
|
948
947
|
});
|
|
@@ -950,12 +949,12 @@ class DooleService {
|
|
|
950
949
|
postAPIAddMedia(params) {
|
|
951
950
|
const endpoint = this.api.getEndpoint('media/add');
|
|
952
951
|
return this.http.postForm(endpoint, params).pipe(map((res) => {
|
|
953
|
-
|
|
952
|
+
//console.log(`[DooleService] postAPIAddMedia(${endpoint}) res: `, res);
|
|
954
953
|
return res;
|
|
955
954
|
}));
|
|
956
955
|
}
|
|
957
956
|
uploadFileToModel(image, name, params) {
|
|
958
|
-
|
|
957
|
+
//console.log("uploading ", image);
|
|
959
958
|
const token = localStorage.getItem('token');
|
|
960
959
|
let options = {
|
|
961
960
|
fileKey: 'file',
|
|
@@ -970,10 +969,9 @@ class DooleService {
|
|
|
970
969
|
const endpoint = this.api.getEndpoint('media/add');
|
|
971
970
|
return new Promise(function (resolve, reject) {
|
|
972
971
|
fileTransfer.upload(image, endpoint, options).then(data => {
|
|
973
|
-
|
|
972
|
+
//console.log(JSON.parse(data.response));
|
|
974
973
|
resolve(JSON.parse(data.response));
|
|
975
974
|
}, (err) => {
|
|
976
|
-
////console.log(err);
|
|
977
975
|
reject(err);
|
|
978
976
|
});
|
|
979
977
|
});
|
|
@@ -994,7 +992,7 @@ class DooleService {
|
|
|
994
992
|
id: idMessageHeader
|
|
995
993
|
}
|
|
996
994
|
};
|
|
997
|
-
|
|
995
|
+
//console.log("options: ", options);
|
|
998
996
|
const fileTransfer = this.transfer.create();
|
|
999
997
|
fileTransfer.onProgress((progressEvent) => {
|
|
1000
998
|
if (progressEvent.lengthComputable) {
|
|
@@ -1002,17 +1000,17 @@ class DooleService {
|
|
|
1002
1000
|
this.events.publish("uploadMessageImage", { fileUrl, perc });
|
|
1003
1001
|
}
|
|
1004
1002
|
else {
|
|
1005
|
-
|
|
1003
|
+
//console.log("progressEvent - ", progressEvent);
|
|
1006
1004
|
}
|
|
1007
1005
|
});
|
|
1008
1006
|
const endpoint = this.api.getEndpoint('message');
|
|
1009
1007
|
return new Promise(function (resolve, reject) {
|
|
1010
1008
|
fileTransfer.upload(fileUrl, endpoint, options)
|
|
1011
1009
|
.then(data => {
|
|
1012
|
-
|
|
1010
|
+
//console.log("success fileTransfer.upload", JSON.parse(data.response));
|
|
1013
1011
|
resolve(JSON.parse(data.response));
|
|
1014
1012
|
}, (err) => {
|
|
1015
|
-
|
|
1013
|
+
//console.log("** error ** fileTransfer.upload: ", err);
|
|
1016
1014
|
reject(fileTransfer.upload);
|
|
1017
1015
|
});
|
|
1018
1016
|
});
|
|
@@ -1032,73 +1030,6 @@ class DooleService {
|
|
|
1032
1030
|
const blob = new Blob(byteArrays, { type: contentType });
|
|
1033
1031
|
return blob;
|
|
1034
1032
|
}
|
|
1035
|
-
download(url) {
|
|
1036
|
-
const fileTransfer = this.transfer.create();
|
|
1037
|
-
var path = null;
|
|
1038
|
-
if (this.platform.is('ios')) {
|
|
1039
|
-
path = this.file.documentsDirectory;
|
|
1040
|
-
}
|
|
1041
|
-
else {
|
|
1042
|
-
path = this.file.dataDirectory;
|
|
1043
|
-
}
|
|
1044
|
-
fileTransfer.download(url, path + 'file.pdf').then((entry) => {
|
|
1045
|
-
////console.log('download complete: ' + entry.toURL());
|
|
1046
|
-
}, (error) => {
|
|
1047
|
-
// handle error
|
|
1048
|
-
});
|
|
1049
|
-
}
|
|
1050
|
-
downloadFile(url, destination) {
|
|
1051
|
-
var result = [];
|
|
1052
|
-
const fileTransfer = this.transfer.create();
|
|
1053
|
-
var path = null;
|
|
1054
|
-
if (this.platform.is('ios')) {
|
|
1055
|
-
path = this.file.documentsDirectory;
|
|
1056
|
-
}
|
|
1057
|
-
else {
|
|
1058
|
-
path = this.file.dataDirectory;
|
|
1059
|
-
}
|
|
1060
|
-
//////console.log("downloadFile", url, destination, 'path,destination', path, destination);
|
|
1061
|
-
return new Observable((observer) => {
|
|
1062
|
-
//////console.log("before CheckFile", this.file);
|
|
1063
|
-
this.file.checkFile(path, destination).then(res => {
|
|
1064
|
-
//////console.log("*res*", res);
|
|
1065
|
-
if (res) {
|
|
1066
|
-
//////console.log("exists", res);
|
|
1067
|
-
result["success"] = true;
|
|
1068
|
-
result["downloaded"] = true;
|
|
1069
|
-
result["file"] = path + destination; //normalizeURL(this.file.cacheDirectory + destination);
|
|
1070
|
-
result["fileNormalized"] = Capacitor.convertFileSrc(path + destination);
|
|
1071
|
-
return observer.next(result);
|
|
1072
|
-
}
|
|
1073
|
-
}, error => {
|
|
1074
|
-
//////console.log("not exists");
|
|
1075
|
-
fileTransfer.onProgress(event => {
|
|
1076
|
-
if (event.lengthComputable) {
|
|
1077
|
-
//////console.log(event.loaded / event.total);
|
|
1078
|
-
result["status"] = "downloading";
|
|
1079
|
-
result["downloaded"] = false;
|
|
1080
|
-
result["percent"] = Math.round((event.loaded / event.total) * 100);
|
|
1081
|
-
return observer.next(result);
|
|
1082
|
-
}
|
|
1083
|
-
});
|
|
1084
|
-
return fileTransfer.download(url, path + destination).then((entry) => {
|
|
1085
|
-
//////console.log('*download:* ' + url + " " + entry.toURL());
|
|
1086
|
-
result["success"] = true;
|
|
1087
|
-
result["downloaded"] = true;
|
|
1088
|
-
result["file"] = entry.toURL(); //normalizeURL(this.file.cacheDirectory + destination);
|
|
1089
|
-
result["fileNormalized"] = Capacitor.convertFileSrc(path + destination);
|
|
1090
|
-
return observer.next(result);
|
|
1091
|
-
}, (error) => {
|
|
1092
|
-
//////console.log(error);
|
|
1093
|
-
result["success"] = false;
|
|
1094
|
-
result["downloaded"] = false;
|
|
1095
|
-
//////console.log("error download " + url);
|
|
1096
|
-
//////console.log(result);
|
|
1097
|
-
return observer.next(result);
|
|
1098
|
-
});
|
|
1099
|
-
});
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
1033
|
deleteFile(id) {
|
|
1103
1034
|
let path = `media/${id}`;
|
|
1104
1035
|
const endpoint = this.api.getEndpoint(path);
|
|
@@ -2506,6 +2437,7 @@ class DooleService {
|
|
|
2506
2437
|
let httpParams = new HttpParams();
|
|
2507
2438
|
httpParams = (params?.programable_play) ? httpParams.append('programable_play', params?.programable_play) : httpParams;
|
|
2508
2439
|
httpParams = (params?.challenge_id) ? httpParams.append('challenge_id', params?.challenge_id) : httpParams;
|
|
2440
|
+
httpParams = (params?.programable_id) ? httpParams.append('programable_id', params?.programable_id) : httpParams;
|
|
2509
2441
|
// Agregar el parámetro 'interactions'
|
|
2510
2442
|
httpParams = httpParams.set('interactions', '1');
|
|
2511
2443
|
const endpoint = this.api.getEndpoint(path);
|
|
@@ -2641,15 +2573,15 @@ class DooleService {
|
|
|
2641
2573
|
return res;
|
|
2642
2574
|
}));
|
|
2643
2575
|
}
|
|
2644
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2645
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2576
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DooleService, deps: [{ token: AuthenticationService }, { token: i2.FileTransfer }, { token: i3.File }, { token: HttpService }, { token: ApiEndpointsService }, { token: Events }, { token: i1$1.Platform }, { token: i6.Router }, { token: i1$1.AlertController }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2577
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DooleService, providedIn: 'root' }); }
|
|
2646
2578
|
}
|
|
2647
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DooleService, decorators: [{
|
|
2648
2580
|
type: Injectable,
|
|
2649
2581
|
args: [{
|
|
2650
2582
|
providedIn: 'root'
|
|
2651
2583
|
}]
|
|
2652
|
-
}], ctorParameters: () => [{ type: AuthenticationService }, { type: i2
|
|
2584
|
+
}], ctorParameters: () => [{ type: AuthenticationService }, { type: i2.FileTransfer }, { type: i3.File }, { type: HttpService }, { type: ApiEndpointsService }, { type: Events }, { type: i1$1.Platform }, { type: i6.Router }, { type: i1$1.AlertController }, { type: i2$1.TranslateService }] });
|
|
2653
2585
|
|
|
2654
2586
|
var NotificationsType;
|
|
2655
2587
|
(function (NotificationsType) {
|
|
@@ -3190,15 +3122,15 @@ class NavigationService {
|
|
|
3190
3122
|
break;
|
|
3191
3123
|
}
|
|
3192
3124
|
}
|
|
3193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3194
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3125
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NavigationService, deps: [{ token: i6.Router }, { token: i2$2.Location }, { token: i0.NgZone }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3126
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NavigationService, providedIn: 'root' }); }
|
|
3195
3127
|
}
|
|
3196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NavigationService, decorators: [{
|
|
3197
3129
|
type: Injectable,
|
|
3198
3130
|
args: [{
|
|
3199
3131
|
providedIn: 'root'
|
|
3200
3132
|
}]
|
|
3201
|
-
}], ctorParameters: () => [{ type: i6.Router }, { type: i2$
|
|
3133
|
+
}], ctorParameters: () => [{ type: i6.Router }, { type: i2$2.Location }, { type: i0.NgZone }, { type: i1$1.Platform }] });
|
|
3202
3134
|
|
|
3203
3135
|
class LanguageService {
|
|
3204
3136
|
constructor(translate, languagesApp) {
|
|
@@ -3231,15 +3163,15 @@ class LanguageService {
|
|
|
3231
3163
|
removeLenguageLocalstorage() {
|
|
3232
3164
|
localStorage.removeItem('language');
|
|
3233
3165
|
}
|
|
3234
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3235
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3166
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LanguageService, deps: [{ token: i2$1.TranslateService }, { token: LANGUAGES_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3167
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LanguageService, providedIn: 'root' }); }
|
|
3236
3168
|
}
|
|
3237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LanguageService, decorators: [{
|
|
3238
3170
|
type: Injectable,
|
|
3239
3171
|
args: [{
|
|
3240
3172
|
providedIn: 'root'
|
|
3241
3173
|
}]
|
|
3242
|
-
}], ctorParameters: () => [{ type: i2$
|
|
3174
|
+
}], ctorParameters: () => [{ type: i2$1.TranslateService }, { type: undefined, decorators: [{
|
|
3243
3175
|
type: Inject,
|
|
3244
3176
|
args: [LANGUAGES_CONFIG_TOKEN]
|
|
3245
3177
|
}] }] });
|
|
@@ -3331,6 +3263,9 @@ class DateService {
|
|
|
3331
3263
|
else if (lang === 'no') {
|
|
3332
3264
|
return 'no-NO';
|
|
3333
3265
|
}
|
|
3266
|
+
else if (lang === 'ka') {
|
|
3267
|
+
return 'ka-GE';
|
|
3268
|
+
}
|
|
3334
3269
|
else {
|
|
3335
3270
|
return 'es-ES';
|
|
3336
3271
|
}
|
|
@@ -3764,17 +3699,16 @@ class DateService {
|
|
|
3764
3699
|
date.setMinutes(59);
|
|
3765
3700
|
return date;
|
|
3766
3701
|
}
|
|
3767
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3768
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3702
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DateService, deps: [{ token: i2$2.DatePipe }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3703
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DateService, providedIn: 'root' }); }
|
|
3769
3704
|
}
|
|
3770
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: DateService, decorators: [{
|
|
3771
3706
|
type: Injectable,
|
|
3772
3707
|
args: [{
|
|
3773
3708
|
providedIn: 'root',
|
|
3774
3709
|
}]
|
|
3775
|
-
}], ctorParameters: () => [{ type: i2$
|
|
3710
|
+
}], ctorParameters: () => [{ type: i2$2.DatePipe }, { type: i2$1.TranslateService }] });
|
|
3776
3711
|
|
|
3777
|
-
highchartsMore(HighCharts);
|
|
3778
3712
|
class HighchartsService {
|
|
3779
3713
|
constructor(languageService, translate) {
|
|
3780
3714
|
this.languageService = languageService;
|
|
@@ -4350,15 +4284,15 @@ class HighchartsService {
|
|
|
4350
4284
|
this.setYAxis(minY, maxY, ranges, units);
|
|
4351
4285
|
this.setSeries(name, graphData, pointWidth);
|
|
4352
4286
|
}
|
|
4353
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4354
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4287
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: HighchartsService, deps: [{ token: LanguageService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4288
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: HighchartsService, providedIn: 'root' }); }
|
|
4355
4289
|
}
|
|
4356
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: HighchartsService, decorators: [{
|
|
4357
4291
|
type: Injectable,
|
|
4358
4292
|
args: [{
|
|
4359
4293
|
providedIn: 'root'
|
|
4360
4294
|
}]
|
|
4361
|
-
}], ctorParameters: () => [{ type: LanguageService }, { type: i2$
|
|
4295
|
+
}], ctorParameters: () => [{ type: LanguageService }, { type: i2$1.TranslateService }] });
|
|
4362
4296
|
|
|
4363
4297
|
class ComponentsApp {
|
|
4364
4298
|
constructor(goal, advices, news, agenda, reminder, diet, drug, game, element, form, chat, doc_diagnostic, contacta, medication) {
|
|
@@ -4393,10 +4327,10 @@ class RolesService {
|
|
|
4393
4327
|
setProfessional(professional) {
|
|
4394
4328
|
this.isProfessional = professional ? true : false;
|
|
4395
4329
|
}
|
|
4396
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4397
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4330
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: RolesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4331
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: RolesService, providedIn: 'root' }); }
|
|
4398
4332
|
}
|
|
4399
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: RolesService, decorators: [{
|
|
4400
4334
|
type: Injectable,
|
|
4401
4335
|
args: [{
|
|
4402
4336
|
providedIn: 'root'
|
|
@@ -4427,10 +4361,10 @@ class StorageService {
|
|
|
4427
4361
|
}
|
|
4428
4362
|
return JSON.parse(result.value);
|
|
4429
4363
|
}
|
|
4430
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4431
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4364
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: StorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4365
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: StorageService, providedIn: 'root' }); }
|
|
4432
4366
|
}
|
|
4433
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: StorageService, decorators: [{
|
|
4434
4368
|
type: Injectable,
|
|
4435
4369
|
args: [{
|
|
4436
4370
|
providedIn: 'root'
|
|
@@ -4537,50 +4471,52 @@ class NotificationService {
|
|
|
4537
4471
|
});
|
|
4538
4472
|
await alert.present();
|
|
4539
4473
|
}
|
|
4540
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4541
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4474
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NotificationService, deps: [{ token: i1$2.MatSnackBar }, { token: i0.NgZone }, { token: i1$1.AlertController }, { token: i2$1.TranslateService }, { token: i1$1.ToastController }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4475
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NotificationService, providedIn: 'root' }); }
|
|
4542
4476
|
}
|
|
4543
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4477
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NotificationService, decorators: [{
|
|
4544
4478
|
type: Injectable,
|
|
4545
4479
|
args: [{
|
|
4546
4480
|
providedIn: 'root'
|
|
4547
4481
|
}]
|
|
4548
|
-
}], ctorParameters: () => [{ type: i1$
|
|
4482
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: i0.NgZone }, { type: i1$1.AlertController }, { type: i2$1.TranslateService }, { type: i1$1.ToastController }] });
|
|
4549
4483
|
|
|
4550
4484
|
class NetworkService {
|
|
4551
|
-
constructor(
|
|
4552
|
-
this.network = network;
|
|
4485
|
+
constructor(platform) {
|
|
4553
4486
|
this.platform = platform;
|
|
4554
|
-
this.online$ = undefined;
|
|
4555
|
-
this.online$ = new Observable(observer => {
|
|
4556
|
-
observer.next(true);
|
|
4557
|
-
}).pipe(mapTo(true));
|
|
4558
4487
|
if (Capacitor.isNativePlatform()) {
|
|
4559
|
-
//
|
|
4560
|
-
|
|
4561
|
-
|
|
4488
|
+
// Native device: use Capacitor Network listener
|
|
4489
|
+
this.online$ = new Observable(observer => {
|
|
4490
|
+
// Emit current status
|
|
4491
|
+
Network.getStatus().then(status => observer.next(status.connected));
|
|
4492
|
+
// Listen for changes
|
|
4493
|
+
Network.addListener('networkStatusChange', (status) => {
|
|
4494
|
+
observer.next(status.connected);
|
|
4495
|
+
});
|
|
4496
|
+
});
|
|
4562
4497
|
}
|
|
4563
4498
|
else {
|
|
4564
|
-
//
|
|
4565
|
-
//console.log('on Browser');
|
|
4499
|
+
// Browser: fallback to window events
|
|
4566
4500
|
this.online$ = merge(of(navigator.onLine), fromEvent(window, 'online').pipe(mapTo(true)), fromEvent(window, 'offline').pipe(mapTo(false)));
|
|
4567
4501
|
}
|
|
4568
4502
|
}
|
|
4569
|
-
getNetworkType() {
|
|
4570
|
-
return this.network.type;
|
|
4571
|
-
}
|
|
4572
4503
|
getNetworkStatus() {
|
|
4573
4504
|
return this.online$;
|
|
4574
4505
|
}
|
|
4575
|
-
|
|
4576
|
-
|
|
4506
|
+
// Optional helper: get full network info once
|
|
4507
|
+
async getNetworkType() {
|
|
4508
|
+
const status = await Network.getStatus();
|
|
4509
|
+
return status.connectionType; // e.g., 'wifi', 'cellular', 'none'
|
|
4510
|
+
}
|
|
4511
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NetworkService, deps: [{ token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4512
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NetworkService, providedIn: 'root' }); }
|
|
4577
4513
|
}
|
|
4578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4514
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: NetworkService, decorators: [{
|
|
4579
4515
|
type: Injectable,
|
|
4580
4516
|
args: [{
|
|
4581
4517
|
providedIn: 'root'
|
|
4582
4518
|
}]
|
|
4583
|
-
}], ctorParameters: () => [{ type: i1$
|
|
4519
|
+
}], ctorParameters: () => [{ type: i1$1.Platform }] });
|
|
4584
4520
|
|
|
4585
4521
|
class LoadingService {
|
|
4586
4522
|
constructor() {
|
|
@@ -4614,10 +4550,10 @@ class LoadingService {
|
|
|
4614
4550
|
this.loadingSub.next(false);
|
|
4615
4551
|
}
|
|
4616
4552
|
}
|
|
4617
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4618
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4553
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4554
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LoadingService, providedIn: 'root' }); }
|
|
4619
4555
|
}
|
|
4620
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4556
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LoadingService, decorators: [{
|
|
4621
4557
|
type: Injectable,
|
|
4622
4558
|
args: [{
|
|
4623
4559
|
providedIn: 'root'
|
|
@@ -4638,15 +4574,15 @@ class LoggingService {
|
|
|
4638
4574
|
}
|
|
4639
4575
|
return;
|
|
4640
4576
|
}
|
|
4641
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4642
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4577
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LoggingService, deps: [{ token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4578
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LoggingService, providedIn: 'root' }); }
|
|
4643
4579
|
}
|
|
4644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: LoggingService, decorators: [{
|
|
4645
4581
|
type: Injectable,
|
|
4646
4582
|
args: [{
|
|
4647
4583
|
providedIn: 'root'
|
|
4648
4584
|
}]
|
|
4649
|
-
}], ctorParameters: () => [{ type:
|
|
4585
|
+
}], ctorParameters: () => [{ type: i1$1.Platform }] });
|
|
4650
4586
|
|
|
4651
4587
|
class ErrorService {
|
|
4652
4588
|
constructor() { }
|
|
@@ -4685,10 +4621,10 @@ class ErrorService {
|
|
|
4685
4621
|
// handle stack trace
|
|
4686
4622
|
return 'stack';
|
|
4687
4623
|
}
|
|
4688
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4689
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4624
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4625
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ErrorService, providedIn: 'root' }); }
|
|
4690
4626
|
}
|
|
4691
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4627
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: ErrorService, decorators: [{
|
|
4692
4628
|
type: Injectable,
|
|
4693
4629
|
args: [{
|
|
4694
4630
|
providedIn: 'root'
|
|
@@ -4708,10 +4644,10 @@ class OpentokService {
|
|
|
4708
4644
|
emitCallEvent(data) {
|
|
4709
4645
|
this.callEventSubject.next(data);
|
|
4710
4646
|
}
|
|
4711
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4712
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4647
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: OpentokService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4648
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: OpentokService, providedIn: 'root' }); }
|
|
4713
4649
|
}
|
|
4714
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: OpentokService, decorators: [{
|
|
4715
4651
|
type: Injectable,
|
|
4716
4652
|
args: [{
|
|
4717
4653
|
providedIn: 'root'
|
|
@@ -4777,10 +4713,10 @@ class AnalyticsService {
|
|
|
4777
4713
|
};
|
|
4778
4714
|
return setCollectionEnabled;
|
|
4779
4715
|
}
|
|
4780
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4781
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4716
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AnalyticsService, deps: [{ token: FIREBASE_CONFIG_TOKEN }, { token: i1$1.Platform }, { token: i6.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4717
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AnalyticsService, providedIn: 'root' }); }
|
|
4782
4718
|
}
|
|
4783
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AnalyticsService, decorators: [{
|
|
4784
4720
|
type: Injectable,
|
|
4785
4721
|
args: [{
|
|
4786
4722
|
providedIn: 'root'
|
|
@@ -4788,7 +4724,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
4788
4724
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4789
4725
|
type: Inject,
|
|
4790
4726
|
args: [FIREBASE_CONFIG_TOKEN]
|
|
4791
|
-
}] }, { type:
|
|
4727
|
+
}] }, { type: i1$1.Platform }, { type: i6.Router }] });
|
|
4792
4728
|
|
|
4793
4729
|
class SharedCarePlanService {
|
|
4794
4730
|
constructor(http, api) {
|
|
@@ -4877,308 +4813,16 @@ class SharedCarePlanService {
|
|
|
4877
4813
|
return res;
|
|
4878
4814
|
}));
|
|
4879
4815
|
}
|
|
4880
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4881
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4816
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: SharedCarePlanService, deps: [{ token: HttpService }, { token: ApiEndpointsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4817
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: SharedCarePlanService, providedIn: 'root' }); }
|
|
4882
4818
|
}
|
|
4883
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4819
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: SharedCarePlanService, decorators: [{
|
|
4884
4820
|
type: Injectable,
|
|
4885
4821
|
args: [{
|
|
4886
4822
|
providedIn: 'root'
|
|
4887
4823
|
}]
|
|
4888
4824
|
}], ctorParameters: () => [{ type: HttpService }, { type: ApiEndpointsService }] });
|
|
4889
4825
|
|
|
4890
|
-
class HealthService {
|
|
4891
|
-
constructor(device, platform, dooleService, router, translate, languageService, constants, authService, alertController) {
|
|
4892
|
-
this.device = device;
|
|
4893
|
-
this.platform = platform;
|
|
4894
|
-
this.dooleService = dooleService;
|
|
4895
|
-
this.router = router;
|
|
4896
|
-
this.translate = translate;
|
|
4897
|
-
this.languageService = languageService;
|
|
4898
|
-
this.constants = constants;
|
|
4899
|
-
this.authService = authService;
|
|
4900
|
-
this.alertController = alertController;
|
|
4901
|
-
//private dataTypes = ['distance', 'steps', 'weight', 'blood_glucose', 'heart_rate' ];
|
|
4902
|
-
this.dataTypes = ['distance', 'steps', 'weight', 'heart_rate'];
|
|
4903
|
-
this.enableHealthConnectSettings = false;
|
|
4904
|
-
this.isHealthConnect = true;
|
|
4905
|
-
this.hideButtonHealthConnect = false;
|
|
4906
|
-
if (this.platform.is('android') && !this.platform.is('mobileweb')) {
|
|
4907
|
-
//this.setPrivacyPolicy();
|
|
4908
|
-
this.btnDowloadHealthConnect();
|
|
4909
|
-
// if(this.device.sdkVersion == '34'){
|
|
4910
|
-
// this.isHealthConnect = false;
|
|
4911
|
-
// }else{
|
|
4912
|
-
// this.isHealthConnect = true;
|
|
4913
|
-
// }
|
|
4914
|
-
}
|
|
4915
|
-
}
|
|
4916
|
-
btnDowloadHealthConnect() {
|
|
4917
|
-
if (this.platform.is("cordova")) {
|
|
4918
|
-
cordova.plugins.health.isAvailable((available) => {
|
|
4919
|
-
if (available) {
|
|
4920
|
-
this.hideButtonHealthConnect = true;
|
|
4921
|
-
}
|
|
4922
|
-
}, (e) => {
|
|
4923
|
-
//this.presentAlertConfirm(e);
|
|
4924
|
-
console.error('[HealthService] connect(): error', e);
|
|
4925
|
-
});
|
|
4926
|
-
}
|
|
4927
|
-
}
|
|
4928
|
-
setHealthConnect() {
|
|
4929
|
-
}
|
|
4930
|
-
downloadHealthConnect() {
|
|
4931
|
-
NativeMarket.openStoreListing({
|
|
4932
|
-
appId: /* this.constants.healthconnectPackageID */ 'com.google.android.apps.healthdata'
|
|
4933
|
-
});
|
|
4934
|
-
/* cordova.plugins.health.getHealthConnectFromStore(
|
|
4935
|
-
(success)=>{console.log("All good: ", success)},
|
|
4936
|
-
(error)=>{console.log("Wrong error", error)} ); */
|
|
4937
|
-
}
|
|
4938
|
-
downloadGoogleFit() {
|
|
4939
|
-
NativeMarket.openStoreListing({
|
|
4940
|
-
appId: this.constants.googleFitPackageID
|
|
4941
|
-
});
|
|
4942
|
-
}
|
|
4943
|
-
setPrivacyPolicy() {
|
|
4944
|
-
cordova.plugins.health.setPrivacyPolicyURL(/* this.constants.privacyPolicies */ 'https://doolehealth.com/en/privacy-policy/', () => { }, () => { });
|
|
4945
|
-
}
|
|
4946
|
-
openHealthServices() {
|
|
4947
|
-
cordova.plugins.health.openHealthSettings((success) => { }, (error) => { });
|
|
4948
|
-
}
|
|
4949
|
-
connect(comesFromSettings) {
|
|
4950
|
-
//console.log('HealthService requestAuthorization() connect:', comesFromSettings)
|
|
4951
|
-
if (this.platform.is("cordova")) {
|
|
4952
|
-
cordova.plugins.health.isAvailable((available) => {
|
|
4953
|
-
//console.log('HealthService requestAuthorization() available:', available)
|
|
4954
|
-
if (available) {
|
|
4955
|
-
cordova.plugins.health.isAuthorized({ read: this.dataTypes }, (authorized) => {
|
|
4956
|
-
if (!authorized) {
|
|
4957
|
-
cordova.plugins.health.requestAuthorization({ read: this.dataTypes }, (success) => {
|
|
4958
|
-
//console.log('HealthService requestAuthorization() success:', success)
|
|
4959
|
-
this.loadingData = true;
|
|
4960
|
-
this.authService.setShowHealthConnectLocalstorage();
|
|
4961
|
-
this.authService.setCanceledHealthConnectLocalstorage("true");
|
|
4962
|
-
this.readDataFromApp(30);
|
|
4963
|
-
if (comesFromSettings) {
|
|
4964
|
-
this.router.navigate(['settings'], { replaceUrl: true });
|
|
4965
|
-
}
|
|
4966
|
-
else {
|
|
4967
|
-
this.router.navigate(['home'], { replaceUrl: true });
|
|
4968
|
-
}
|
|
4969
|
-
this.enableHealthConnectSettings = true;
|
|
4970
|
-
}, (error) => {
|
|
4971
|
-
//console.log('HealthService requestAuthorization() error:', error)
|
|
4972
|
-
this.enableHealthConnectSettings = false;
|
|
4973
|
-
});
|
|
4974
|
-
}
|
|
4975
|
-
else {
|
|
4976
|
-
this.loadingData = true;
|
|
4977
|
-
this.authService.setShowHealthConnectLocalstorage();
|
|
4978
|
-
this.authService.setCanceledHealthConnectLocalstorage("true");
|
|
4979
|
-
this.readDataFromApp(30);
|
|
4980
|
-
this.router.navigate(['home']);
|
|
4981
|
-
this.enableHealthConnectSettings = true;
|
|
4982
|
-
}
|
|
4983
|
-
}, (error) => {
|
|
4984
|
-
this.presentAlertConfirm();
|
|
4985
|
-
//console.log(error);
|
|
4986
|
-
});
|
|
4987
|
-
}
|
|
4988
|
-
else {
|
|
4989
|
-
this.enableHealthConnectSettings = false;
|
|
4990
|
-
this.presentAlertConfirm();
|
|
4991
|
-
//console.log("Health plugin not available");
|
|
4992
|
-
}
|
|
4993
|
-
}, (e) => {
|
|
4994
|
-
//this.presentAlertConfirm(e);
|
|
4995
|
-
console.error('[HealthService] connect(): error', e);
|
|
4996
|
-
this.downloadHealthConnect();
|
|
4997
|
-
});
|
|
4998
|
-
}
|
|
4999
|
-
}
|
|
5000
|
-
retrieveData() {
|
|
5001
|
-
if (this.platform.is("cordova")) {
|
|
5002
|
-
cordova.plugins.health.isAvailable((available) => {
|
|
5003
|
-
if (available) {
|
|
5004
|
-
cordova.plugins.health.isAuthorized({ read: this.dataTypes }, (authorized) => {
|
|
5005
|
-
if (authorized) {
|
|
5006
|
-
this.loadingData = true;
|
|
5007
|
-
this.authService.setShowHealthConnectLocalstorage();
|
|
5008
|
-
this.authService.setCanceledHealthConnectLocalstorage("true");
|
|
5009
|
-
this.readDataFromApp(30);
|
|
5010
|
-
this.enableHealthConnectSettings = true;
|
|
5011
|
-
}
|
|
5012
|
-
else {
|
|
5013
|
-
this.enableHealthConnectSettings = false;
|
|
5014
|
-
}
|
|
5015
|
-
}, (error) => {
|
|
5016
|
-
this.presentAlertConfirm();
|
|
5017
|
-
//console.log(error);
|
|
5018
|
-
});
|
|
5019
|
-
}
|
|
5020
|
-
}, (e) => {
|
|
5021
|
-
//this.presentAlertConfirm(e);
|
|
5022
|
-
console.error('[HealthService] connect(): error', e);
|
|
5023
|
-
});
|
|
5024
|
-
}
|
|
5025
|
-
}
|
|
5026
|
-
readDataFromApp(days) {
|
|
5027
|
-
let startDate = new Date(new Date().getTime() - days * 24 * 60 * 60 * 1000);
|
|
5028
|
-
let endDate = new Date(); // now
|
|
5029
|
-
//console.log("Entering for reading data")
|
|
5030
|
-
this.readData(startDate, endDate);
|
|
5031
|
-
// this.readBloodGlucose(startDate, endDate);
|
|
5032
|
-
// this.readSteps(startDate, endDate);
|
|
5033
|
-
// this.readDistance(startDate, endDate);
|
|
5034
|
-
//this.readHeartRate(startDate, endDate);
|
|
5035
|
-
// this.readWeightData(startDate, endDate);
|
|
5036
|
-
// setTimeout(()=> this.readBloodGlucose(startDate, endDate), 500);
|
|
5037
|
-
// setTimeout(()=> this.readSteps(startDate, endDate), 1500);
|
|
5038
|
-
// setTimeout(()=> this.readDistance(startDate, endDate), 1500);
|
|
5039
|
-
// setTimeout(()=> this.readWeightData(startDate, endDate), 1500);
|
|
5040
|
-
// setTimeout(()=> this.readHeartRate(startDate, endDate), 500);
|
|
5041
|
-
}
|
|
5042
|
-
async readData(startDate, endDate) {
|
|
5043
|
-
await this.platform.ready();
|
|
5044
|
-
//console.log("[HealthService] Entering for reading health data");
|
|
5045
|
-
for (const element of this.dataTypes) {
|
|
5046
|
-
const config = { startDate: startDate, endDate: endDate, dataType: element };
|
|
5047
|
-
if (element === 'distance' || element === 'steps') {
|
|
5048
|
-
config['bucket'] = 'hour';
|
|
5049
|
-
try {
|
|
5050
|
-
const data = await this.queryAggregatedHealthData(config);
|
|
5051
|
-
//console.log(`DATA HEALTH CONNECT (${element}): `, JSON.stringify(data));
|
|
5052
|
-
await this.postHealth(element, data);
|
|
5053
|
-
}
|
|
5054
|
-
catch (error) {
|
|
5055
|
-
console.error(`Error for posting ${element} data: `, error);
|
|
5056
|
-
}
|
|
5057
|
-
}
|
|
5058
|
-
else {
|
|
5059
|
-
try {
|
|
5060
|
-
const data = await this.queryHealthData(config);
|
|
5061
|
-
//console.log(`DATA HEALTH CONNECT (${element}): `, JSON.stringify(data));
|
|
5062
|
-
await this.postHealth(element, data);
|
|
5063
|
-
}
|
|
5064
|
-
catch (error) {
|
|
5065
|
-
console.error(`Error for posting ${element} data: `, error);
|
|
5066
|
-
}
|
|
5067
|
-
}
|
|
5068
|
-
}
|
|
5069
|
-
}
|
|
5070
|
-
queryAggregatedHealthData(config) {
|
|
5071
|
-
return new Promise((resolve, reject) => {
|
|
5072
|
-
cordova.plugins.health.queryAggregated(config, (data) => resolve(data), (error) => reject(error));
|
|
5073
|
-
});
|
|
5074
|
-
}
|
|
5075
|
-
queryHealthData(config) {
|
|
5076
|
-
return new Promise((resolve, reject) => {
|
|
5077
|
-
cordova.plugins.health.query(config, (data) => resolve(data), (error) => reject(error));
|
|
5078
|
-
});
|
|
5079
|
-
}
|
|
5080
|
-
readWeightData(startDate, endDate) {
|
|
5081
|
-
//console.log("[HealthService] Entering for reading weight data")
|
|
5082
|
-
//cordova.plugins.health.query({startDate: startDate, endDate: endDate , dataType: 'weight'}, (data)=> {this.postHealth('weight', data);}, ()=> {console.error()})
|
|
5083
|
-
cordova.plugins.health.query({
|
|
5084
|
-
startDate: startDate, endDate: endDate,
|
|
5085
|
-
dataType: 'weight'
|
|
5086
|
-
}, (data) => { this.postHealth('weight', data); }, (error) => { console.error("Error for posting weight data: ", error); });
|
|
5087
|
-
}
|
|
5088
|
-
readBloodGlucose(startDate, endDate) {
|
|
5089
|
-
//console.log("[HealthService] Entering for reading blood_glucose data")
|
|
5090
|
-
cordova.plugins.health.query({
|
|
5091
|
-
startDate: startDate, endDate: endDate,
|
|
5092
|
-
dataType: 'blood_glucose'
|
|
5093
|
-
}, (data) => { this.postHealth('blood_glucose', data); }, (error) => { console.error("Error for posting blood_glucose data ", error); });
|
|
5094
|
-
}
|
|
5095
|
-
readSteps(startDate, endDate) {
|
|
5096
|
-
//console.log("[HealthService] Entering for reading steps data")
|
|
5097
|
-
cordova.plugins.health.queryAggregated({ startDate: startDate, endDate: endDate, dataType: 'steps', bucket: 'day' }, (data) => { this.postHealth('steps', data); }, (error) => { console.error("Error for posting steps data ", error); });
|
|
5098
|
-
}
|
|
5099
|
-
readDistance(startDate, endDate) {
|
|
5100
|
-
//console.log("[HealthService] Entering for reading distance data")
|
|
5101
|
-
cordova.plugins.health.queryAggregated({ startDate: startDate, endDate: endDate, dataType: 'distance', bucket: 'day' }, (data) => { this.postHealth('distance', data); }, (error) => { console.error("Error for posting distance data ", error); })
|
|
5102
|
-
.then(data => {
|
|
5103
|
-
//console.log("[HealthService] Entering for reading distance data1", data)
|
|
5104
|
-
});
|
|
5105
|
-
}
|
|
5106
|
-
readHeartRate(startDate, endDate) {
|
|
5107
|
-
//console.log("[HealthService] Entering for reading heart_rate data")
|
|
5108
|
-
cordova.plugins.health.query({
|
|
5109
|
-
startDate: startDate, endDate: endDate,
|
|
5110
|
-
dataType: 'heart_rate'
|
|
5111
|
-
}, (data) => { this.postHealth('heart_rate', data); }, () => { console.error(); });
|
|
5112
|
-
}
|
|
5113
|
-
//To send POST with health data to api
|
|
5114
|
-
async postHealth(type, data) {
|
|
5115
|
-
//console.log("[HealthService] postHealth()", type, data);
|
|
5116
|
-
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
5117
|
-
//console.log('[HealthService] syncData', timezone);
|
|
5118
|
-
const postData = {
|
|
5119
|
-
timezone: timezone,
|
|
5120
|
-
type: type,
|
|
5121
|
-
vals: JSON.stringify(data),
|
|
5122
|
-
};
|
|
5123
|
-
//console.log('[HealthService] postObject', postData);
|
|
5124
|
-
if (this.authService?.deviceToken) {
|
|
5125
|
-
postData['device_token'] = this.authService.deviceToken;
|
|
5126
|
-
}
|
|
5127
|
-
try {
|
|
5128
|
-
const response = await this.dooleService.post('user/element/sync', postData).toPromise();
|
|
5129
|
-
//console.log('[HealthService] apiRes', JSON.stringify(response));
|
|
5130
|
-
}
|
|
5131
|
-
catch (error) {
|
|
5132
|
-
//console.log('[HealthService] apiErr', JSON.stringify(error));
|
|
5133
|
-
throw error;
|
|
5134
|
-
}
|
|
5135
|
-
}
|
|
5136
|
-
async presentAlertConfirm(error) {
|
|
5137
|
-
const alert = await this.alertController.create({
|
|
5138
|
-
cssClass: 'my-alert-class',
|
|
5139
|
-
header: this.getErrorMessage(error),
|
|
5140
|
-
buttons: [
|
|
5141
|
-
{
|
|
5142
|
-
text: this.translate.instant("alert.button_cancel"),
|
|
5143
|
-
role: 'cancel',
|
|
5144
|
-
cssClass: 'secondary',
|
|
5145
|
-
handler: async (blah) => {
|
|
5146
|
-
//console.log('Confirm Cancel: blah');
|
|
5147
|
-
}
|
|
5148
|
-
}, {
|
|
5149
|
-
text: this.translate.instant("health-connect.return_home"),
|
|
5150
|
-
handler: () => {
|
|
5151
|
-
this.authService.setShowHealthConnectLocalstorage();
|
|
5152
|
-
if (this.router.url.includes('landing'))
|
|
5153
|
-
this.router.navigate(['landing']);
|
|
5154
|
-
else
|
|
5155
|
-
this.router.navigate(['home']);
|
|
5156
|
-
}
|
|
5157
|
-
}
|
|
5158
|
-
]
|
|
5159
|
-
});
|
|
5160
|
-
await alert.present();
|
|
5161
|
-
}
|
|
5162
|
-
getErrorMessage(e) {
|
|
5163
|
-
if (e && e === 'Health Connect is not installed') {
|
|
5164
|
-
return this.translate.instant("health-connect.error_msg_not_install");
|
|
5165
|
-
}
|
|
5166
|
-
else
|
|
5167
|
-
return this.translate.instant("health-connect.error_msg");
|
|
5168
|
-
}
|
|
5169
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HealthService, deps: [{ token: i1$3.Device }, { token: i2.Platform }, { token: DooleService }, { token: i6.Router }, { token: i2$2.TranslateService }, { token: LanguageService }, { token: CONFIGURACION_TOKEN }, { token: AuthenticationService }, { token: i2.AlertController }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5170
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HealthService, providedIn: 'root' }); }
|
|
5171
|
-
}
|
|
5172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HealthService, decorators: [{
|
|
5173
|
-
type: Injectable,
|
|
5174
|
-
args: [{
|
|
5175
|
-
providedIn: 'root'
|
|
5176
|
-
}]
|
|
5177
|
-
}], ctorParameters: () => [{ type: i1$3.Device }, { type: i2.Platform }, { type: DooleService }, { type: i6.Router }, { type: i2$2.TranslateService }, { type: LanguageService }, { type: undefined, decorators: [{
|
|
5178
|
-
type: Inject,
|
|
5179
|
-
args: [CONFIGURACION_TOKEN]
|
|
5180
|
-
}] }, { type: AuthenticationService }, { type: i2.AlertController }] });
|
|
5181
|
-
|
|
5182
4826
|
class PermissionService {
|
|
5183
4827
|
constructor() {
|
|
5184
4828
|
this.canViewGoals = true;
|
|
@@ -5261,10 +4905,10 @@ class PermissionService {
|
|
|
5261
4905
|
this.canAccessVideocall = true;
|
|
5262
4906
|
this.colorCargiver = false;
|
|
5263
4907
|
}
|
|
5264
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
5265
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4908
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: PermissionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4909
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: PermissionService, providedIn: 'root' }); }
|
|
5266
4910
|
}
|
|
5267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4911
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: PermissionService, decorators: [{
|
|
5268
4912
|
type: Injectable,
|
|
5269
4913
|
args: [{
|
|
5270
4914
|
providedIn: 'root'
|
|
@@ -5464,15 +5108,15 @@ class FirebaseAuthService {
|
|
|
5464
5108
|
this.profileDataStore.load(dataSource);
|
|
5465
5109
|
return this.profileDataStore;
|
|
5466
5110
|
}
|
|
5467
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
5468
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
5111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: FirebaseAuthService, deps: [{ token: i5.AngularFireAuth }, { token: i1$1.Platform }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5112
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: FirebaseAuthService, providedIn: 'root' }); }
|
|
5469
5113
|
}
|
|
5470
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: FirebaseAuthService, decorators: [{
|
|
5471
5115
|
type: Injectable,
|
|
5472
5116
|
args: [{
|
|
5473
5117
|
providedIn: 'root'
|
|
5474
5118
|
}]
|
|
5475
|
-
}], ctorParameters: () => [{ type: i5.AngularFireAuth }, { type:
|
|
5119
|
+
}], ctorParameters: () => [{ type: i5.AngularFireAuth }, { type: i1$1.Platform }, { type: undefined, decorators: [{
|
|
5476
5120
|
type: Inject,
|
|
5477
5121
|
args: [PLATFORM_ID]
|
|
5478
5122
|
}] }] });
|
|
@@ -5485,5 +5129,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
5485
5129
|
* Generated bundle index. Do not edit.
|
|
5486
5130
|
*/
|
|
5487
5131
|
|
|
5488
|
-
export { AnalyticsService, ApiEndpointsService, AuthenticationService, ChangeEndpointsService, ComponentsApp, DataStore, DateService, DooleService, EncryptionService, ErrorService, Events, FirebaseAuthService,
|
|
5132
|
+
export { AnalyticsService, ApiEndpointsService, AuthenticationService, ChangeEndpointsService, ComponentsApp, DataStore, DateService, DooleService, EncryptionService, ErrorService, Events, FirebaseAuthService, HighchartsService, HttpService, LanguageService, LoadingService, LoggingService, NavigationService, NetworkService, NotificationService, OpentokService, PermissionService, RolesService, ServiceLibComponent, ServiceLibModule, SharedCarePlanService, ShellModel, StorageService, TokenService, User, _INDEX_ENPOINT };
|
|
5489
5133
|
//# sourceMappingURL=doolehealth-service-lib.mjs.map
|