From fe1813a4e250efd11a251b094b2e7ae5461739d4 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 12:01:44 +0800 Subject: [PATCH 01/81] remove unused GoPro UI components --- ...media-item-detail-on-device.component.html | 32 ----- ...media-item-detail-on-device.component.scss | 13 -- ...ia-item-detail-on-device.component.spec.ts | 25 ---- ...o-media-item-detail-on-device.component.ts | 120 ------------------ ...o-media-list-item-on-device.component.html | 15 --- ...o-media-list-item-on-device.component.scss | 34 ----- ...edia-list-item-on-device.component.spec.ts | 25 ---- ...pro-media-list-item-on-device.component.ts | 37 ------ ...go-pro-media-list-on-device.component.html | 18 --- ...go-pro-media-list-on-device.component.scss | 13 -- ...pro-media-list-on-device.component.spec.ts | 25 ---- .../go-pro-media-list-on-device.component.ts | 19 --- .../settings/go-pro/go-pro-routing.module.ts | 11 -- .../features/settings/go-pro/go-pro.module.ts | 7 - 14 files changed, 394 deletions(-) delete mode 100644 src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.html delete mode 100644 src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.scss delete mode 100644 src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.spec.ts delete mode 100644 src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.ts delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.html delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.scss delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.spec.ts delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.ts delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.html delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.scss delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.spec.ts delete mode 100644 src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.ts diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.html b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.html deleted file mode 100644 index ebab1e732..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - Detail On Device - - - - - - - -
- - - Upload to capture - -
diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.scss b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.scss deleted file mode 100644 index bf53a3806..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -:host { - display: block; - object-fit: contain; - animation: loading 2.5s ease-in-out alternate infinite; -} - -img, -video { - display: block; - width: 100%; - height: 50%; - background-color: black; -} diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.spec.ts b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.spec.ts deleted file mode 100644 index a4617a428..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { SharedTestingModule } from '../../../../shared/shared-testing.module'; -import { GoProMediaItemDetailOnDeviceComponent } from './go-pro-media-item-detail-on-device.component'; - -describe('GoProMediaItemDetailOnDeviceComponent', () => { - let component: GoProMediaItemDetailOnDeviceComponent; - let fixture: ComponentFixture; - - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [GoProMediaItemDetailOnDeviceComponent], - imports: [SharedTestingModule], - }).compileComponents(); - - fixture = TestBed.createComponent(GoProMediaItemDetailOnDeviceComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }) - ); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.ts b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.ts deleted file mode 100644 index 44f672256..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { Location } from '@angular/common'; -import { Component, Inject, OnInit } from '@angular/core'; -import { SafeUrl } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; -import { NetworkPlugin } from '@capacitor/core'; -import { AlertController, ToastController } from '@ionic/angular'; -import { NETOWRK_PLUGIN } from '../../../../shared/capacitor-plugins/capacitor-plugins.module'; -import { GoProFileOnDevice } from '../go-pro-media-file'; -import { GoProMediaService } from '../services/go-pro-media.service'; -import { GoProWifiService } from '../services/go-pro-wifi.service'; - -@Component({ - selector: 'app-go-pro-media-item-detail-on-device', - templateUrl: './go-pro-media-item-detail-on-device.component.html', - styleUrls: ['./go-pro-media-item-detail-on-device.component.scss'], -}) -export class GoProMediaItemDetailOnDeviceComponent implements OnInit { - goProFileOnDevice?: GoProFileOnDevice; - - url?: string | SafeUrl; - - constructor( - private readonly router: Router, - private readonly location: Location, - private readonly route: ActivatedRoute, - public goProMediaService: GoProMediaService, - public goProWiFiService: GoProWifiService, - @Inject(NETOWRK_PLUGIN) - private readonly networkPlugin: NetworkPlugin, - public alertController: AlertController, - public toastController: ToastController - ) { - this.route.queryParams.subscribe(() => { - const state = this.router.getCurrentNavigation()?.extras.state; - if (state) { - this.goProFileOnDevice = state.goProFileOnDevice; - } - }); - } - - async ngOnInit() { - if (this.goProFileOnDevice) { - this.url = await this.goProMediaService.getFileSrcFromDevice( - this.goProFileOnDevice.url - ); - } - } - - goBack() { - this.location.back(); - } - - async uploadToCapture() { - const newtorkStatus = await this.networkPlugin.getStatus(); - - if (newtorkStatus.connectionType == 'wifi') { - const connectedToGoProWiFi = - await GoProWifiService.isConnectedToGoProWifi(); - - if (!connectedToGoProWiFi) { - this.startUploadToCapture(); - return; - } - } - - if (newtorkStatus.connectionType == 'cellular') { - const allowed = await this.allowUploadWithMobileInternet(); - if (allowed) { - this.startUploadToCapture(); - } - } - } - - private async startUploadToCapture() { - try { - await this.presentToast(`✅ Upload added to the queue, see Home Page`); - await this.goProMediaService.uploadToCaptureFromDevice( - this.goProFileOnDevice - ); - } catch (error) { - await this.presentToast(`❌ Failed to upload`); - } - } - - async presentToast(message: string) { - const toast = await this.toastController.create({ - message, - duration: 1700, - }); - toast.present(); - } - - async allowUploadWithMobileInternet() { - // eslint-disable-next-line no-async-promise-executor - return new Promise(async resolve => { - const alert = await this.alertController.create({ - header: 'Warning!', - message: - 'You are using mobile data to upload file!' + - 'Do you want to continue?', - buttons: [ - { - text: 'Cancel', - role: 'cancel', - handler: () => { - resolve(false); - }, - }, - { - text: 'Okay', - handler: () => { - resolve(true); - }, - }, - ], - }); - await alert.present(); - }); - } -} diff --git a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.html b/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.html deleted file mode 100644 index dc11d8fb2..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - broken_image - diff --git a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.scss b/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.scss deleted file mode 100644 index 981f308c1..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.scss +++ /dev/null @@ -1,34 +0,0 @@ -:host { - background-color: lightgray; -} - -ion-icon { - color: white; - z-index: 10; - position: absolute; - opacity: 0.3; -} - -ion-icon.is-video { - top: 8px; - right: 8px; - font-size: 16px; -} - -.is-thumbnail-missing { - color: white; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 48px; - height: 48px; - font-size: 48px; -} - -img { - width: 100%; - height: 100%; - object-fit: cover; - object-position: center; -} diff --git a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.spec.ts b/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.spec.ts deleted file mode 100644 index decc8f9c2..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { SharedTestingModule } from '../../../../shared/shared-testing.module'; -import { GoProMediaListItemOnDeviceComponent } from './go-pro-media-list-item-on-device.component'; - -describe('GoProMediaListItemOnDeviceComponent', () => { - let component: GoProMediaListItemOnDeviceComponent; - let fixture: ComponentFixture; - - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [GoProMediaListItemOnDeviceComponent], - imports: [SharedTestingModule], - }).compileComponents(); - - fixture = TestBed.createComponent(GoProMediaListItemOnDeviceComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }) - ); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.ts b/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.ts deleted file mode 100644 index b3d52235c..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { SafeUrl } from '@angular/platform-browser'; -import { Router } from '@angular/router'; -import { GoProFileOnDevice } from '../go-pro-media-file'; -import { GoProMediaService } from '../services/go-pro-media.service'; - -@Component({ - selector: 'app-go-pro-media-list-item-on-device', - templateUrl: './go-pro-media-list-item-on-device.component.html', - styleUrls: ['./go-pro-media-list-item-on-device.component.scss'], -}) -export class GoProMediaListItemOnDeviceComponent implements OnInit { - thumbnailSrc?: string | SafeUrl; - @Input() goProFileOnDevice!: GoProFileOnDevice | undefined; - - constructor( - private readonly router: Router, - private readonly goProMediaService: GoProMediaService - ) {} - - async ngOnInit() { - if (this.goProFileOnDevice !== undefined) { - this.thumbnailSrc = await this.goProMediaService.getFileSrcFromDevice( - this.goProFileOnDevice.thumbnailUrl - ); - } - } - - showDetails() { - this.router.navigate( - ['/settings', 'go-pro', 'media-item-detail-on-device'], - { - state: { goProFileOnDevice: this.goProFileOnDevice }, - } - ); - } -} diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.html b/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.html deleted file mode 100644 index c9b5a1b2d..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Media List On Device - - - -
- - - - - - -
-
diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.scss b/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.scss deleted file mode 100644 index b50c1ce70..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -.grid-container { - padding-left: 16px; - padding-right: 16px; - margin-top: 24px; - margin-bottom: 48px; -} - -app-go-pro-media-list-item-on-device { - width: 100%; - height: 100%; - overflow: hidden; - border-radius: 4px; -} diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.spec.ts b/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.spec.ts deleted file mode 100644 index 291e42c7d..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { SharedTestingModule } from '../../../../shared/shared-testing.module'; -import { GoProMediaListOnDeviceComponent } from './go-pro-media-list-on-device.component'; - -describe('GoProMediaListOnDeviceComponent', () => { - let component: GoProMediaListOnDeviceComponent; - let fixture: ComponentFixture; - - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [GoProMediaListOnDeviceComponent], - imports: [SharedTestingModule], - }).compileComponents(); - - fixture = TestBed.createComponent(GoProMediaListOnDeviceComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }) - ); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.ts b/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.ts deleted file mode 100644 index 736e4c5ab..000000000 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-device/go-pro-media-list-on-device.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { GoProFileOnDevice } from '../go-pro-media-file'; -import { GoProMediaService } from '../services/go-pro-media.service'; - -@Component({ - selector: 'app-go-pro-media-list-on-device', - templateUrl: './go-pro-media-list-on-device.component.html', - styleUrls: ['./go-pro-media-list-on-device.component.scss'], -}) -export class GoProMediaListOnDeviceComponent implements OnInit { - goProFilesOnDevice: GoProFileOnDevice[] = []; - - constructor(public goProMediaService: GoProMediaService) {} - - async ngOnInit() { - this.goProFilesOnDevice = - await this.goProMediaService.loadFilesFromStorage(); - } -} diff --git a/src/app/features/settings/go-pro/go-pro-routing.module.ts b/src/app/features/settings/go-pro/go-pro-routing.module.ts index 7eaa8d2bf..04bc09385 100644 --- a/src/app/features/settings/go-pro/go-pro-routing.module.ts +++ b/src/app/features/settings/go-pro/go-pro-routing.module.ts @@ -1,9 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { GoProMediaItemDetailOnCameraComponent } from './go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component'; -import { GoProMediaItemDetailOnDeviceComponent } from './go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component'; import { GoProMediaListOnCameraComponent } from './go-pro-media-list-on-camera/go-pro-media-list-on-camera.component'; -import { GoProMediaListOnDeviceComponent } from './go-pro-media-list-on-device/go-pro-media-list-on-device.component'; import { GoProPage } from './go-pro.page'; const routes: Routes = [ @@ -19,15 +17,6 @@ const routes: Routes = [ path: 'media-item-detail-on-camera', component: GoProMediaItemDetailOnCameraComponent, }, - - { - path: 'media-list-on-device', - component: GoProMediaListOnDeviceComponent, - }, - { - path: 'media-item-detail-on-device', - component: GoProMediaItemDetailOnDeviceComponent, - }, ]; @NgModule({ diff --git a/src/app/features/settings/go-pro/go-pro.module.ts b/src/app/features/settings/go-pro/go-pro.module.ts index 1c55fa79f..43b3832ee 100644 --- a/src/app/features/settings/go-pro/go-pro.module.ts +++ b/src/app/features/settings/go-pro/go-pro.module.ts @@ -1,11 +1,8 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../../shared/shared.module'; import { GoProMediaItemDetailOnCameraComponent } from './go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component'; -import { GoProMediaItemDetailOnDeviceComponent } from './go-pro-media-item-detail-on-device/go-pro-media-item-detail-on-device.component'; import { GoProMediaListItemOnCameraComponent } from './go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component'; -import { GoProMediaListItemOnDeviceComponent } from './go-pro-media-list-item-on-device/go-pro-media-list-item-on-device.component'; import { GoProMediaListOnCameraComponent } from './go-pro-media-list-on-camera/go-pro-media-list-on-camera.component'; -import { GoProMediaListOnDeviceComponent } from './go-pro-media-list-on-device/go-pro-media-list-on-device.component'; import { GoProPageRoutingModule } from './go-pro-routing.module'; import { GoProPage } from './go-pro.page'; @@ -17,10 +14,6 @@ import { GoProPage } from './go-pro.page'; GoProMediaListOnCameraComponent, GoProMediaListItemOnCameraComponent, GoProMediaItemDetailOnCameraComponent, - - GoProMediaListOnDeviceComponent, - GoProMediaListItemOnDeviceComponent, - GoProMediaItemDetailOnDeviceComponent, ], }) export class GoProPageModule {} From d99420974bc8936f4dad5341cb00d98ca91435f0 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 12:07:24 +0800 Subject: [PATCH 02/81] style(go-pro-media-item-detail-on-camera.component.html) change button color to match design --- .../go-pro-media-item-detail-on-camera.component.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html index 4409d7245..e4e535a7b 100644 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html +++ b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html @@ -26,7 +26,11 @@
- + Upload to capture directly from camera From 06808ddae0bd6d35c575a32759a2e7fadadea159 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 12:08:26 +0800 Subject: [PATCH 03/81] fix(go-pro-media-item-detail-on-camera.component.ts) remove unused imports, init logic. --- ...o-media-item-detail-on-camera.component.ts | 36 +++---------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts index 4e418a6d7..698708a85 100644 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts @@ -1,13 +1,11 @@ import { Location } from '@angular/common'; -import { Component, Inject, OnInit } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { NetworkPlugin } from '@capacitor/core'; import { AlertController, LoadingController, ToastController, } from '@ionic/angular'; -import { NETOWRK_PLUGIN } from '../../../../shared/capacitor-plugins/capacitor-plugins.module'; import { GoProFile } from '../go-pro-media-file'; import { GoProMediaService } from '../services/go-pro-media.service'; import { GoProWifiService } from '../services/go-pro-wifi.service'; @@ -33,11 +31,9 @@ export class GoProMediaItemDetailOnCameraComponent implements OnInit { public alertController: AlertController, public loadingController: LoadingController, public goProMediaService: GoProMediaService, - public goProWiFiService: GoProWifiService, - @Inject(NETOWRK_PLUGIN) - private readonly networkPlugin: NetworkPlugin + public goProWiFiService: GoProWifiService ) { - this.route.queryParams.subscribe(() => { + this.route.queryParams.subscribe(_ => { const state = this.router.getCurrentNavigation()?.extras.state; if (state) { this.mediaFile = state.goProMediaFile; @@ -46,31 +42,7 @@ export class GoProMediaItemDetailOnCameraComponent implements OnInit { } ngOnInit() { - this.mediaType = GoProMediaService.getFileType(this.mediaFile?.url); - } - - async downloadFileFromGoProCamera() { - if (!this.mediaFile) { - return; - } - - const fileName = GoProMediaService.extractFileNameFromUrl( - this.mediaFile.url - ); - - const loading = await this.loadingController.create({ - message: 'Please wait... Download in progress', - }); - await loading.present(); - - try { - await this.goProMediaService.downloadFromGoProCamera(this.mediaFile); - this.presentToast(`${fileName} downloaded ✅`); - } catch (error) { - this.presentToast(`Failed to download ${fileName} ❌`); - } - - await loading.dismiss(); + this.mediaType = this.goProMediaService.getFileType(this.mediaFile?.url); } async uploadToCapture() { From 6b9a1d6299d6c1f602f718263b3d2b5d43d056dc Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 12:24:33 +0800 Subject: [PATCH 04/81] refactor(go-pro-bluetooth.service.ts) --- .../services/go-pro-bluetooth.service.ts | 71 +++++++------------ 1 file changed, 27 insertions(+), 44 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts index 77f5d4d2f..7fe83183f 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts @@ -56,14 +56,7 @@ export class GoProBluetoothService { private readonly enableGoProWiFiCommand = [0x03, 0x17, 0x01, 0x01]; constructor() { - BleClient.initialize().catch(err => { - if ( - err instanceof Error && - err.message === 'Web Bluetooth API not available in this browser.' - ) - return; - throw new Error(err.message); - }); + BleClient.initialize(); } async scanForBluetoothDevices(): Promise { @@ -74,29 +67,25 @@ export class GoProBluetoothService { const bluetoothScanResults: ScanResult[] = []; - // eslint-disable-next-line no-async-promise-executor - return new Promise(async (resolve, reject) => { - try { - await BleClient.initialize(); - - await BleClient.requestLEScan( - { services: [this.goProControlAndQueryServiceUUID] }, - foundDevice => bluetoothScanResults.push(foundDevice) - ); - - const stopScanAfterMilliSeconds = 2000; - setTimeout(async () => { - await BleClient.stopLEScan(); - resolve(bluetoothScanResults); - }, stopScanAfterMilliSeconds); - } catch (error) { - reject(error); - } + await BleClient.initialize(); + + BleClient.requestLEScan( + { services: [this.goProControlAndQueryServiceUUID] }, + (foundDevice: any) => bluetoothScanResults.push(foundDevice) + ); + + await new Promise(resolve => { + const stopScanAfterMilliSeconds = 2000; + setTimeout(resolve, stopScanAfterMilliSeconds); }); + + await BleClient.stopLEScan(); + + return bluetoothScanResults; } async connectToBluetoothDevice(scanResult: ScanResult) { - await BleClient.connect(scanResult.device.deviceId, () => { + await BleClient.connect(scanResult.device.deviceId, _ => { this.onDisconnectedFromBluetoothDevice(scanResult); }); this.saveConnectedDeviceToStorage(scanResult); @@ -127,7 +116,8 @@ export class GoProBluetoothService { }); } - async removeConnectedDeviceFromStorage(_: ScanResult) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + async removeConnectedDeviceFromStorage(scanResult: ScanResult) { await Storage.remove({ key: this.GO_PRO_BLUETOOTH_STORAGE_KEY }); } @@ -159,8 +149,11 @@ export class GoProBluetoothService { async sendBluetoothWriteCommand(command: number[]) { await this.checkBluetoothDeviceConnection(); const connectedDevice = await this.getConnectedDeviceFromStorage(); + + if (!connectedDevice) return; + await BleClient.write( - connectedDevice!.device.deviceId, + connectedDevice.device.deviceId, this.goProControlAndQueryServiceUUID, this.goProCommandReqCharacteristicsUUID, numbersToDataView(command) @@ -206,22 +199,12 @@ export class GoProBluetoothService { } async connectToGoProWiFi() { - // eslint-disable-next-line no-async-promise-executor - return new Promise(async (resolve, reject) => { - await this.sendBluetoothWriteCommand(this.enableGoProWiFiCommand); - - const wifiCreds = await this.getGoProWiFiCreds(); - - try { - const result = await Wifi.connect({ - ssid: wifiCreds.wifiSSID, - password: wifiCreds.wifiPASS, - }); + await this.sendBluetoothWriteCommand(this.enableGoProWiFiCommand); - resolve(result); - } catch (error) { - reject(error); - } + const wifiCreds = await this.getGoProWiFiCreds(); + await Wifi.connect({ + ssid: wifiCreds.wifiSSID, + password: wifiCreds.wifiPASS, }); } } From 7b8786e39724144ff61a7ff5c0312c811dac5539 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 12:25:46 +0800 Subject: [PATCH 05/81] style(go-pro.page.html) --- src/app/features/settings/go-pro/go-pro.page.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro.page.html b/src/app/features/settings/go-pro/go-pro.page.html index 2368cf754..6a0767517 100644 --- a/src/app/features/settings/go-pro/go-pro.page.html +++ b/src/app/features/settings/go-pro/go-pro.page.html @@ -11,6 +11,7 @@ expand="block" [disabled]="bluetoothIsScanning" (click)="scanForBluetoothDevices()" + style="color: white; --box-shadow: 0; margin: 0 16px 0 16px" > {{ bluetoothIsScanning ? 'Scaning' : 'Scan for bluetooth devices' }} @@ -41,6 +42,7 @@

{{ scanResult.device.name }}

" (click)="connectToBluetoothDevice(scanResult)" slot="end" + style="color: white; --box-shadow: 0" > Connect @@ -62,9 +64,8 @@

- + Show files on go pro - send From 4a53b02ac2c3ba733120146fb96700c01fdbfcc5 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 12:30:54 +0800 Subject: [PATCH 06/81] feat: trigger bluetooth pairing at first connection --- src/app/features/settings/go-pro/go-pro.page.ts | 14 +++++++++++--- .../go-pro/services/go-pro-bluetooth.service.ts | 10 ++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro.page.ts b/src/app/features/settings/go-pro/go-pro.page.ts index 535e8a821..319b8f5f6 100644 --- a/src/app/features/settings/go-pro/go-pro.page.ts +++ b/src/app/features/settings/go-pro/go-pro.page.ts @@ -3,9 +3,8 @@ import { Router } from '@angular/router'; import { ScanResult } from '@capacitor-community/bluetooth-le'; import { WifiPlugin } from '@capacitor-community/wifi'; import { Plugins } from '@capacitor/core'; -import { ToastController } from '@ionic/angular'; +import { LoadingController, ToastController } from '@ionic/angular'; import { GoProBluetoothService } from './services/go-pro-bluetooth.service'; -import { GoProMediaService } from './services/go-pro-media.service'; const Wifi: WifiPlugin = Plugins.Wifi as WifiPlugin; @@ -30,7 +29,7 @@ export class GoProPage implements OnInit { constructor( public toastController: ToastController, - private readonly goProMediaService: GoProMediaService, + private readonly loadingController: LoadingController, private readonly router: Router, private readonly goProBluetoothService: GoProBluetoothService ) {} @@ -80,11 +79,20 @@ export class GoProPage implements OnInit { } async connectToBluetoothDevice(scanResult: ScanResult) { + const loading = await this.loadingController.create({ + message: `Connecting to ${scanResult.device.name}`, + }); + try { + await loading.present(); await this.goProBluetoothService.connectToBluetoothDevice(scanResult); + await this.goProBluetoothService.pairDevice(); + this.bluetoothConnectedDevice = scanResult; + await loading.dismiss(); this.presentToast(`🅱 Connected to ${scanResult.device.name}`); } catch (error) { + await loading.dismiss(); this.presentToast(JSON.stringify(error)); } } diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts index 7fe83183f..ccc57c853 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts @@ -207,4 +207,14 @@ export class GoProBluetoothService { password: wifiCreds.wifiPASS, }); } + + /** Trigger pairing between device and GoPro. + * + * Because '@capacitor-community/bluetooth-le' have no such command pair device. However we can + * send any bluetooth read command to trigger pairing if connected for the first time. + * For example: it can be get wifi credentials command + */ + async pairDevice(): Promise { + await this.getGoProWiFiCreds(); + } } From ffaee21e314f72dbd76b2bf1335bc98a9cafbe1c Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 12:53:04 +0800 Subject: [PATCH 07/81] change(go-pro-media.servie.ts): refactor, remove unused methods --- .../go-pro/services/go-pro-media.service.ts | 304 ++++++------------ 1 file changed, 91 insertions(+), 213 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-media.service.ts b/src/app/features/settings/go-pro/services/go-pro-media.service.ts index 76048b21f..507b3f3cb 100644 --- a/src/app/features/settings/go-pro/services/go-pro-media.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-media.service.ts @@ -1,8 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Inject, Injectable } from '@angular/core'; -import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; +import { DomSanitizer } from '@angular/platform-browser'; import '@capacitor-community/http'; -import { HttpDownloadFileResult } from '@capacitor-community/http'; import { Capacitor, FilesystemDirectory, @@ -13,8 +12,8 @@ import { isPlatform } from '@ionic/core'; import { FILESYSTEM_PLUGIN } from '../../../../shared/capacitor-plugins/capacitor-plugins.module'; import { CaptureService } from '../../../../shared/capture/capture.service'; import { blobToBase64 } from '../../../../utils/encoding/encoding'; -import { GoProFile, GoProFileOnDevice } from '../go-pro-media-file'; -const { Http, Storage } = Plugins; +import { GoProFile } from '../go-pro-media-file'; +const { Http } = Plugins; @Injectable({ providedIn: 'root', @@ -38,7 +37,8 @@ export class GoProMediaService { private readonly httpClient: HttpClient ) {} - static getFileType(url?: string): 'unknown' | 'video' | 'image' { + // eslint-disable-next-line class-methods-use-this + getFileType(url?: string): 'unknown' | 'video' | 'image' { if (url === undefined) { return 'unknown'; } @@ -54,185 +54,121 @@ export class GoProMediaService { return 'unknown'; } - static extractFileNameFromUrl(url: string): string { + // eslint-disable-next-line class-methods-use-this + extractFileNameFromUrl(url: string): string { // return extract filename with extension from url // example 001.jpg, 002.mp4 - return url.split('?')[0].split('/').pop()!; + return url.split('?')[0].split('/').pop() ?? ''; } - static extractFileExtensionFormUrl(filaName: string): string { - return filaName.split('?')[0].split('.').pop()!; + // eslint-disable-next-line class-methods-use-this + extractFileExtensionFormUrl(filaName: string): string { + return filaName.split('?')[0].split('.').pop() ?? ''; } - static extractFileNameFromGoProUrl(url: string): string { + // eslint-disable-next-line class-methods-use-this + extractFileNameFromGoProUrl(url: string): string { // example of GoPro urls // _________url: http://10.5.5.9:8080/videos/DCIM/100GOPRO/GH010168.MP4 // thumbnailUrl: http://10.5.5.9:8080/gopro/media/thumbnail?path=100GOPRO/GH010168.MP4 - return url.split('/').pop()!; + return url.split('/').pop() ?? ''; } - static extractFileExtensionFromGoProUrl(url: string): string { - return url.split('.').pop()!; - } - - static urlIsImage(url: string): boolean { - const url_lowercase = url.toLocaleLowerCase(); - return url_lowercase.includes('.jpeg') || url_lowercase.includes('.jpg'); - } - - static urlIsVideo(url: string): boolean { - const url_lowercase = url.toLowerCase(); - return url_lowercase.includes('.mp4'); - } - - static detectFileTypeFromUrl(url: string): 'image' | 'video' | 'unknown' { - if (GoProMediaService.urlIsImage(url)) { - return 'image'; - } - if (GoProMediaService.urlIsVideo(url)) { - return 'video'; - } - return 'unknown'; - } - - private async saveFilesToStorage(files: GoProFileOnDevice[]) { - await Storage.set({ - key: this.GO_PRO_FILES_ON_DEVICE_STORAGE_KEY, - value: JSON.stringify(files), - }); - } - - async clearStorage() { - await this.saveFilesToStorage([]); + // eslint-disable-next-line class-methods-use-this + extractFileExtensionFromGoProUrl(url: string): string { + return url.split('.').pop() ?? ''; } + // eslint-disable-next-line class-methods-use-this getThumbnailUrlFrom(url: string): string { const fileName = url.split('/').pop(); const thumbnailUrl = `${this.goproBaseUrl}/gopro/media/thumbnail?path=100GOPRO/${fileName}`; return thumbnailUrl; } - async uploadToCaptureFromGoProCamera(mediaFile: GoProFile | undefined) { - if (!mediaFile) return; - - const fileName = GoProMediaService.extractFileNameFromGoProUrl( - mediaFile.url - ); - - // const option = 'oldWay'; - // if (option === 'oldWay') { - await Http.downloadFile({ - url: mediaFile.url!, - filePath: fileName, - fileDirectory: this.directory, - method: 'GET', - }); - - const readResult = await this.filesystemPlugin.getUri({ - directory: this.directory, - // path: `${this.rootDir}/${goProFileOnDevice.name}`, - path: `${fileName}`, // Because when saving we forget to add rootDir - }); - - const url = Capacitor.convertFileSrc(readResult.uri); - - const blob = await this.httpClient - .get(url, { responseType: 'blob' }) - .toPromise(); - - const base64 = await blobToBase64(blob); - - const mimeType = GoProMediaService.urlIsImage(mediaFile.url) - ? 'image/jpeg' - : 'video/mp4'; - - await this.captureService.capture({ base64, mimeType }); - - // delete temp downloaded file - await this.filesystemPlugin.deleteFile({ - directory: this.directory, - // path: `${this.rootDir}/${goProFileOnDevice.name}`, - path: `${fileName}`, // Because when saving we forget to add rootDir - }); - // } else { - // const url = mediaFile.url; - - // const blob = await Http.request({ - // method: 'GET', - // url: url, - // headers: { responseType: 'blob' }, - // }); - - // const base64 = await blobToBase64(blob); - - // const mimeType = this.urlIsImage(url) ? 'image/jpeg' : 'video/mp4'; + async uploadToCaptureFromGoProCamera( + mediaFile: GoProFile | undefined + ): Promise<{ + isDownloaded: boolean; + isCaptured: boolean; + }> { + if (!mediaFile) return { isDownloaded: false, isCaptured: false }; + + const fileName = this.extractFileNameFromGoProUrl(mediaFile.url); + + let isDownloaded = false; + let isCaptured = false; + + try { + await Http.downloadFile({ + url: mediaFile.url, + filePath: fileName, + fileDirectory: this.directory, + method: 'GET', + }); + + const readResult = await this.filesystemPlugin.getUri({ + directory: this.directory, + path: fileName, + }); + + const url = Capacitor.convertFileSrc(readResult.uri); + + const blob = await this.httpClient + .get(url, { responseType: 'blob' }) + .toPromise(); + + const base64 = await blobToBase64(blob); + + const mimeType = this.urlIsImage(mediaFile.url) + ? 'image/jpeg' + : 'video/mp4'; + isDownloaded = true; + + await this.captureService.capture({ base64, mimeType }); + isCaptured = true; + + // delete temp downloaded file + await this.filesystemPlugin.deleteFile({ + directory: this.directory, + path: fileName, + }); + } catch (error: any) { + const printIndentation = 2; + // eslint-disable-next-line no-console + console.warn(`'😭 ${JSON.stringify(error, null, printIndentation)}`); + } - // await this.captureService.capture({ base64, mimeType }); - // } + return { isDownloaded, isCaptured }; } - async getFileSrcFromDevice(filePath: string): Promise { - const fileName = filePath.split('/').pop(); - - const result = await this.filesystemPlugin.getUri({ - directory: this.directory, - // path: `${this.rootDir}/${fileName}`, - path: `${fileName}`, // Because when saving we forget to add rootDir - }); - - const uri = result.uri; - - const url = Capacitor.convertFileSrc(uri); - - return this.sanitizer.bypassSecurityTrustUrl(url); + // eslint-disable-next-line class-methods-use-this + urlIsImage(url: string): boolean { + return ( + url.toLocaleLowerCase().includes('.jpeg') || + url.toLocaleLowerCase().includes('.jpg') + ); } - async uploadToCaptureFromDevice(goProFileOnDevice?: GoProFileOnDevice) { - if (!goProFileOnDevice) return; - - // const option = 'oldWay'; - // if (option !== 'oldWay') { - // const readResult = await this.filesystemPlugin.readFile({ - // directory: this.directory, - // // path: `${this.rootDir}/${goProFileOnDevice.name}`, - // path: `${goProFileOnDevice.name}`, // Because when saving we forget to add rootDir - // }); - - // const base64 = readResult.data; - - // const mimeType = this.urlIsImage(goProFileOnDevice.url) - // ? 'image/jpeg' - // : 'video/mp4'; - - // await this.captureService.capture({ base64, mimeType }); - // } else { - const result = await this.filesystemPlugin.getUri({ - directory: this.directory, - // path: `${this.rootDir}/${goProFileOnDevice.name}`, - path: `${goProFileOnDevice.name}`, // Because when saving we forget to add rootDir - }); - - const url = Capacitor.convertFileSrc(result.uri); - - const blob = await this.httpClient - .get(url, { responseType: 'blob' }) - .toPromise(); - - const base64 = await blobToBase64(blob); - - const mimeType = GoProMediaService.urlIsImage(goProFileOnDevice.url) - ? 'image/jpeg' - : 'video/mp4'; + // eslint-disable-next-line class-methods-use-this + urlIsVideo(url: string): boolean { + return url.toLowerCase().includes('.mp4'); + } - await this.captureService.capture({ base64, mimeType }); - // } + detectFileTypeFromUrl(url: string): 'image' | 'video' | 'unknown' { + if (this.urlIsImage(url)) { + return 'image'; + } + if (this.urlIsVideo(url)) { + return 'video'; + } + return 'unknown'; } async getFilesFromGoPro(): Promise { const url = this.goproBaseUrl + '/gopro/media/list'; const params = {}; const headers = {}; - const response = await Http.request({ method: 'GET', url, @@ -241,9 +177,7 @@ export class GoProMediaService { }); const data = response.data; - const files = (data.media[0].fs as any[]).reverse(); - const fileNames: string[] = files.map(e => e.n); return fileNames @@ -256,64 +190,8 @@ export class GoProMediaService { url, storageKey: undefined, thumbnailUrl: this.getThumbnailUrlFrom(url), - name: GoProMediaService.extractFileNameFromGoProUrl(url), - type: GoProMediaService.detectFileTypeFromUrl(url), + name: this.extractFileNameFromGoProUrl(url), + type: this.detectFileTypeFromUrl(url), }; } - - async loadFilesFromStorage() { - const result = await Storage.get({ - key: this.GO_PRO_FILES_ON_DEVICE_STORAGE_KEY, - }); - const filesOnDevice: GoProFileOnDevice[] = JSON.parse(result.value ?? '[]'); - return filesOnDevice; - } - - async addFileToStorage(fileToAdd: GoProFileOnDevice) { - const filesOnDevice = await this.loadFilesFromStorage(); - filesOnDevice.unshift(fileToAdd); - await this.saveFilesToStorage(filesOnDevice); - } - - async downloadFromGoProCamera(mediaFile?: GoProFile) { - if (!mediaFile) { - return; - } - const fileName = GoProMediaService.extractFileNameFromGoProUrl( - mediaFile.url - ); - // const fileExtension = GoProMediaService.extractFileExtensionFromGoProUrl( - // mediaFile.url - // ); - const fileType = GoProMediaService.detectFileTypeFromUrl(mediaFile.url); - - const thumbName = GoProMediaService.extractFileNameFromGoProUrl( - mediaFile.thumbnailUrl! - ); - const thumbNameFull = 'thumbnail_' + thumbName + '.jpeg'; - - const fileResponse: HttpDownloadFileResult = await Http.downloadFile({ - url: mediaFile.url!, - filePath: fileName, - fileDirectory: this.directory, - method: 'GET', - }); - - const thumbResponse: HttpDownloadFileResult = await Http.downloadFile({ - url: mediaFile.thumbnailUrl!, - filePath: thumbNameFull, - fileDirectory: this.directory, - method: 'GET', - }); - - const goProFileOnDevice: GoProFileOnDevice = { - name: fileName, - url: fileResponse.path!, - thumbnailUrl: thumbResponse.path!, - size: 1, // TODO: find out size of file - type: fileType, - }; - - await this.addFileToStorage(goProFileOnDevice); - } } From bee915cb3bd20b017ba8c6651b73e98f59a77ba0 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 15:18:50 +0800 Subject: [PATCH 08/81] feat(go-pro-media-list-on-camera): multi-select upload --- package.json | 1 + ...o-media-list-item-on-camera.component.html | 4 +- ...o-media-list-item-on-camera.component.scss | 10 ++ ...pro-media-list-item-on-camera.component.ts | 1 + ...go-pro-media-list-on-camera.component.html | 61 +++++++- ...go-pro-media-list-on-camera.component.scss | 6 + .../go-pro-media-list-on-camera.component.ts | 135 +++++++++++++++++- .../go-pro-media-loading-bar.component.html | 9 ++ .../go-pro-media-loading-bar.component.scss | 30 ++++ ...go-pro-media-loading-bar.component.spec.ts | 26 ++++ .../go-pro-media-loading-bar.component.ts | 15 ++ .../features/settings/go-pro/go-pro.module.ts | 6 +- .../features/settings/go-pro/go-pro.page.html | 4 - .../go-pro/services/go-pro-wifi.service.ts | 8 +- src/global.scss | 9 ++ 15 files changed, 305 insertions(+), 20 deletions(-) create mode 100644 src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.html create mode 100644 src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.scss create mode 100644 src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.spec.ts create mode 100644 src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.ts diff --git a/package.json b/package.json index c2be805d6..0493a4887 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "immutable": "^4.0.0-rc.14", "lodash-es": "^4.17.21", "material-design-icons-iconfont": "^6.1.0", + "ngx-long-press2": "^2.0.0", "ngx-pinch-zoom": "^2.6.0", "process": "^0.11.10", "rxjs": "^6.6.7", diff --git a/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.html b/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.html index bb1d52a9c..3ebbb473d 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.html +++ b/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.html @@ -6,10 +6,12 @@ broken_image + +
diff --git a/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.scss b/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.scss index 981f308c1..2c3502542 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.scss +++ b/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.scss @@ -32,3 +32,13 @@ img { object-fit: cover; object-position: center; } + +.selected { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + border: 3px solid #564dfc; + border-radius: 4px; +} diff --git a/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.ts index 49a1ee18f..fb5fd7a70 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component.ts @@ -11,6 +11,7 @@ import { GoProMediaService } from '../services/go-pro-media.service'; export class GoProMediaListItemOnCameraComponent { mediaType: 'unknown' | 'video' | 'image' = 'unknown'; @Input() mediaFile: GoProFile | undefined; + @Input() selected = false; constructor( private readonly router: Router, diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html index fdb5e8e02..a68fd9523 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html @@ -1,24 +1,45 @@ - - GoPro Media on Camera + + + GoPro Media on Camera + + + + + + {{ selectedGoProFiles.length }} file(s) selected + + - +

Connected WiFi: {{ connectedWifiSSID }}

+ Connect to go pro WiFi (enable first) + + Upload to capture + +

Make sure you connected to GoPro WiFi first @@ -26,10 +47,31 @@

{{ fetchingFilesError }} +
+ Hint: click refresh button at top right.

Fetching files...

+ + + Stay on this screen with the app open to ensure your downloads complete! + +
+ + + +
Fetching files... class="go-pro-item" > + [selected]="isItemInSelectedList(mediaFile)" + > +
diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss index fb813eda1..e20791867 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss @@ -11,3 +11,9 @@ app-go-pro-media-list-item-on-camera { overflow: hidden; border-radius: 4px; } + +.wifi-state-container { + padding: 0px 16px 8px 16px; + display: flex; + flex-direction: column; +} diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts index 59f6d641b..943706ad8 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts @@ -1,6 +1,11 @@ import { Location } from '@angular/common'; import { Component, OnInit } from '@angular/core'; -import { ToastController } from '@ionic/angular'; +import { Router } from '@angular/router'; +import { + AlertController, + NavController, + ToastController, +} from '@ionic/angular'; import { GoProFile } from '../go-pro-media-file'; import { GoProBluetoothService } from '../services/go-pro-bluetooth.service'; import { GoProMediaService } from '../services/go-pro-media.service'; @@ -21,9 +26,20 @@ export class GoProMediaListOnCameraComponent implements OnInit { connectedWifiSSID: string | null = null; isConnectedToGoProWifi: boolean | undefined; + isScrollingContent = false; + + multiSelectMode = false; + selectedGoProFiles: GoProFile[] = []; + + filesToUpload: GoProFile[] = []; + uploadInProgress = false; + constructor( private readonly location: Location, private readonly goProMediaService: GoProMediaService, + private readonly router: Router, + private readonly navCtrl: NavController, + private readonly alertCtrl: AlertController, private readonly goProBluetoothService: GoProBluetoothService, private readonly goProWifiService: GoProWifiService, public toastController: ToastController @@ -34,9 +50,9 @@ export class GoProMediaListOnCameraComponent implements OnInit { } async checkWiFiConnection() { - this.connectedWifiSSID = await GoProWifiService.getConnectedWifiSSID(); + this.connectedWifiSSID = await this.goProWifiService.getConnectedWifiSSID(); this.isConnectedToGoProWifi = - await GoProWifiService.isConnectedToGoProWifi(); + await this.goProWifiService.isConnectedToGoProWifi(); if (this.isConnectedToGoProWifi) { this.fetchFilesFromGoProWiFi(); @@ -76,4 +92,117 @@ export class GoProMediaListOnCameraComponent implements OnInit { goBack() { this.location.back(); } + + onItemClick(item: GoProFile) { + if (!this.multiSelectMode) { + this.router.navigate( + ['/settings', 'go-pro', 'media-item-detail-on-camera'], + { state: { goProMediaFile: item } } + ); + } else if (!this.isItemInSelectedList(item)) { + this.selectedGoProFiles.push(item); + } else { + this.selectedGoProFiles = this.selectedGoProFiles.filter( + i => i.url !== item.url + ); + } + } + + async uploadSelectedFiles() { + for (const selectedFile of this.selectedGoProFiles) { + if (this.isItemInUploadList(selectedFile) === false) { + this.filesToUpload.push(selectedFile); + } + } + + this.exitMultiSelectMode(); + + if (!this.uploadInProgress) { + this.uploadInProgress = true; + + while (this.filesToUpload.length > 0) { + const fileToUpload = this.filesToUpload.shift(); + + // // eslint-disable-next-line no-console + // console.log(fileToUpload); + + // await new Promise(resolve => { + // setTimeout(() => { + // resolve(fileToUpload); + // // eslint-disable-next-line @typescript-eslint/no-magic-numbers + // }, 4000); + // }); + + const uploadResult = + await this.goProMediaService.uploadToCaptureFromGoProCamera( + fileToUpload + ); + + if (uploadResult.isDownloaded && uploadResult.isCaptured === false) { + this.fileWasUploadedBefore(fileToUpload); + } + } + + this.uploadInProgress = false; + this.navigateToHomeScreen(); + } + } + + async fileWasUploadedBefore(fileToUpload: GoProFile | undefined) { + if (!fileToUpload) return; + + const alert = await this.alertCtrl.create({ + cssClass: 'go-pro-alert-message-with', + header: 'File Upload Error!', + subHeader: 'File Previously Uploaded.', + message: ``, + buttons: ['OK'], + }); + + await alert.present(); + + const { role } = await alert.onDidDismiss(); + // eslint-disable-next-line no-console + console.log('onDidDismiss resolved with role', role); + } + + private async navigateToHomeScreen() { + // this.navCtrl.navigateRoot('/'); + await this.navCtrl.pop(); + await this.navCtrl.pop(); + await this.navCtrl.pop(); + } + + ionScrollStart() { + this.isScrollingContent = true; + } + + ionScrollEnd() { + this.isScrollingContent = false; + } + + enterMultiSelectMode(firstSelectedItem?: GoProFile) { + if (this.multiSelectMode) return; + if (this.isScrollingContent) return; + if (firstSelectedItem) this.selectedGoProFiles.push(firstSelectedItem); + this.multiSelectMode = true; + } + + exitMultiSelectMode() { + this.multiSelectMode = false; + this.selectedGoProFiles = []; + } + + isItemInSelectedList(item: GoProFile) { + return this.selectedGoProFiles.find(i => i.url === item.url) !== undefined; + } + + isItemInUploadList(item: GoProFile) { + return this.filesToUpload.find(i => i.url === item.url) !== undefined; + } + + onUploadCancel() { + this.uploadInProgress = false; + this.filesToUpload = []; + } } diff --git a/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.html b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.html new file mode 100644 index 000000000..e81cbef0d --- /dev/null +++ b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.html @@ -0,0 +1,9 @@ + + {{ loadingText }} + + + + + + cancel + diff --git a/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.scss b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.scss new file mode 100644 index 000000000..f3f87e5ce --- /dev/null +++ b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.scss @@ -0,0 +1,30 @@ +.thin-upload-bar { + min-height: 32px; + height: 32px; + justify-content: stretch; + transition: all 1s; + + .text { + flex-grow: 1; + font-size: 0.7em; + margin-left: 10px; + margin-right: 10px; + } + + .spacer-text { + flex-grow: 0; + } + + mat-icon { + margin-left: 10px; + margin-right: 10px; + } +} + +#thin-upload-bar { + height: 32px; +} + +.spacer { + flex: 1 1 auto; +} diff --git a/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.spec.ts b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.spec.ts new file mode 100644 index 000000000..c40393dac --- /dev/null +++ b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.spec.ts @@ -0,0 +1,26 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { GoProMediaLoadingBarComponent } from './go-pro-media-loading-bar.component'; + +describe('GoProMediaLoadingBarComponent', () => { + let component: GoProMediaLoadingBarComponent; + let fixture: ComponentFixture; + + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [GoProMediaLoadingBarComponent], + imports: [IonicModule.forRoot()], + }).compileComponents(); + + fixture = TestBed.createComponent(GoProMediaLoadingBarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }) + ); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.ts b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.ts new file mode 100644 index 000000000..a975cefad --- /dev/null +++ b/src/app/features/settings/go-pro/go-pro-media-loading-bar/go-pro-media-loading-bar.component.ts @@ -0,0 +1,15 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; + +@Component({ + selector: 'app-go-pro-media-loading-bar', + templateUrl: './go-pro-media-loading-bar.component.html', + styleUrls: ['./go-pro-media-loading-bar.component.scss'], +}) +export class GoProMediaLoadingBarComponent { + @Input() loadingText = ''; + @Output() uploadCancel = new EventEmitter(); + + cancel() { + this.uploadCancel.emit(); + } +} diff --git a/src/app/features/settings/go-pro/go-pro.module.ts b/src/app/features/settings/go-pro/go-pro.module.ts index 43b3832ee..8b8e739e6 100644 --- a/src/app/features/settings/go-pro/go-pro.module.ts +++ b/src/app/features/settings/go-pro/go-pro.module.ts @@ -1,19 +1,21 @@ import { NgModule } from '@angular/core'; +import { NgxLongPress2Module } from 'ngx-long-press2'; import { SharedModule } from '../../../shared/shared.module'; import { GoProMediaItemDetailOnCameraComponent } from './go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component'; import { GoProMediaListItemOnCameraComponent } from './go-pro-media-list-item-on-camera/go-pro-media-list-item-on-camera.component'; import { GoProMediaListOnCameraComponent } from './go-pro-media-list-on-camera/go-pro-media-list-on-camera.component'; +import { GoProMediaLoadingBarComponent } from './go-pro-media-loading-bar/go-pro-media-loading-bar.component'; import { GoProPageRoutingModule } from './go-pro-routing.module'; import { GoProPage } from './go-pro.page'; @NgModule({ - imports: [SharedModule, GoProPageRoutingModule], + imports: [SharedModule, GoProPageRoutingModule, NgxLongPress2Module], declarations: [ GoProPage, - GoProMediaListOnCameraComponent, GoProMediaListItemOnCameraComponent, GoProMediaItemDetailOnCameraComponent, + GoProMediaLoadingBarComponent, ], }) export class GoProPageModule {} diff --git a/src/app/features/settings/go-pro/go-pro.page.html b/src/app/features/settings/go-pro/go-pro.page.html index 6a0767517..41682db29 100644 --- a/src/app/features/settings/go-pro/go-pro.page.html +++ b/src/app/features/settings/go-pro/go-pro.page.html @@ -51,10 +51,6 @@

{{ scanResult.device.name }}

- -

NOT CONNECTED TO ANY GO PRO CAMERA ⚠️

-
-

diff --git a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts index d3f094133..808756684 100644 --- a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts @@ -19,12 +19,14 @@ export class GoProWifiService { public platform: Platform ) {} - static async isConnectedToGoProWifi() { + // eslint-disable-next-line class-methods-use-this + async isConnectedToGoProWifi(): Promise { const result = await Wifi.getSSID(); return result.ssid?.startsWith('GP') ?? false; } - static async getConnectedWifiSSID() { + // eslint-disable-next-line class-methods-use-this + async getConnectedWifiSSID() { const result = await Wifi.getSSID(); return result.ssid; } @@ -37,7 +39,7 @@ export class GoProWifiService { password: creds.wifiPASS, }); - return result.ssid!; + return result.ssid ?? ''; } async showTutorialForMobileDataOnlyApps() { diff --git a/src/global.scss b/src/global.scss index fbfacc324..5c3127c22 100644 --- a/src/global.scss +++ b/src/global.scss @@ -127,3 +127,12 @@ body.dark .mat-card { body.dark .mat-tab-group { background-color: var(--ion-background-color); } + +.go-pro-alert-message-with img { + width: 100%; + height: 150px; + border-radius: 4px; + overflow: hidden; + object-fit: cover; + align-self: center; +} From e0458371d01773d63051181e8541305a13171ca7 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 16:29:36 +0800 Subject: [PATCH 09/81] add missing "node_modules/ngx-long-press2" --- package-lock.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/package-lock.json b/package-lock.json index 3ba15042c..ec9e787be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "capture-lite", "version": "0.47.0", "dependencies": { "@angular/animations": "^12.2.4", @@ -39,6 +40,7 @@ "immutable": "^4.0.0-rc.14", "lodash-es": "^4.17.21", "material-design-icons-iconfont": "^6.1.0", + "ngx-long-press2": "^2.0.0", "ngx-pinch-zoom": "^2.6.0", "process": "^0.11.10", "rxjs": "^6.6.7", @@ -14522,6 +14524,21 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, + "node_modules/ngx-long-press2": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ngx-long-press2/-/ngx-long-press2-2.0.0.tgz", + "integrity": "sha512-vXYaoy4izaCWpgD1Z1t+rHnp+XW3MvLRr2raagtQcQW9m+2OWeS3+jTa13jnr6nqq6mSEHy1MtY+mRuZS7pXww==", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10.13" + }, + "peerDependencies": { + "@angular/common": "^10.0.14", + "@angular/core": "^10.0.14" + } + }, "node_modules/ngx-pinch-zoom": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/ngx-pinch-zoom/-/ngx-pinch-zoom-2.6.0.tgz", @@ -36108,6 +36125,14 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, + "ngx-long-press2": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ngx-long-press2/-/ngx-long-press2-2.0.0.tgz", + "integrity": "sha512-vXYaoy4izaCWpgD1Z1t+rHnp+XW3MvLRr2raagtQcQW9m+2OWeS3+jTa13jnr6nqq6mSEHy1MtY+mRuZS7pXww==", + "requires": { + "tslib": "^2.0.0" + } + }, "ngx-pinch-zoom": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/ngx-pinch-zoom/-/ngx-pinch-zoom-2.6.0.tgz", From df372365e0494c90c128c8a342accd5747e40849 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 28 Jan 2022 16:49:38 +0800 Subject: [PATCH 10/81] fix(go-pro-media-list-on-camera.component.scss): scss-linting --- .../go-pro-media-list-on-camera.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss index e20791867..cf8cba33b 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss @@ -13,7 +13,7 @@ app-go-pro-media-list-item-on-camera { } .wifi-state-container { - padding: 0px 16px 8px 16px; + padding: 0 16px 8px; display: flex; flex-direction: column; } From c98c7a0fdf69576ff55c42d2325a3baaa21ed263 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Tue, 8 Feb 2022 16:42:18 +0800 Subject: [PATCH 11/81] move html styles to scss classes --- ...media-item-detail-on-camera.component.html | 6 ++-- ...media-item-detail-on-camera.component.scss | 15 ++++++++++ ...go-pro-media-list-on-camera.component.html | 8 +++--- ...go-pro-media-list-on-camera.component.scss | 21 ++++++++++++++ .../features/settings/go-pro/go-pro.page.html | 15 ++++++---- .../features/settings/go-pro/go-pro.page.scss | 28 +++++++++++++++++++ 6 files changed, 80 insertions(+), 13 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html index e4e535a7b..307d5dd93 100644 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html +++ b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html @@ -25,11 +25,11 @@ Your browser does not support the video tag. -
+
Upload to capture directly from camera @@ -188,7 +188,7 @@ - + Connected WiFi: {{ connectedWifiSSID }}

Connect to go pro WiFi (enable first) @@ -35,13 +35,13 @@

Connected WiFi: {{ connectedWifiSSID }}

*ngIf="multiSelectMode" [disabled]="selectedGoProFiles.length === 0" (click)="uploadSelectedFiles()" - style="align-self: flex-end; color: white; --box-shadow: 0" + class="multi-select-mode-btn" > Upload to capture -

+

Make sure you connected to GoPro WiFi first

@@ -53,7 +53,7 @@

Fetching files...

- + Stay on this screen with the app open to ensure your downloads complete! diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss index cf8cba33b..3adae70f7 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.scss @@ -17,3 +17,24 @@ app-go-pro-media-list-item-on-camera { display: flex; flex-direction: column; } + +.connect-to-go-pro-wifi-btn { + color: white; + + --box-shadow: 0; +} + +.multi-select-mode-btn { + color: white; + align-self: flex-end; + + --box-shadow: 0; +} + +.upload-in-progress-info { + padding-top: 8px; +} + +.should-connect-to-wifi-text { + padding: 16px; +} diff --git a/src/app/features/settings/go-pro/go-pro.page.html b/src/app/features/settings/go-pro/go-pro.page.html index 41682db29..b7e7b92b0 100644 --- a/src/app/features/settings/go-pro/go-pro.page.html +++ b/src/app/features/settings/go-pro/go-pro.page.html @@ -11,7 +11,7 @@ expand="block" [disabled]="bluetoothIsScanning" (click)="scanForBluetoothDevices()" - style="color: white; --box-shadow: 0; margin: 0 16px 0 16px" + class="scan-for-bluetooth-devices-btn" > {{ bluetoothIsScanning ? 'Scaning' : 'Scan for bluetooth devices' }} @@ -20,7 +20,7 @@

{{ scanResult.device.name }}

-

{{ scanResult.device.deviceId }}

+

{{ scanResult.device.deviceId }}

{{ scanResult.device.name }} " (click)="connectToBluetoothDevice(scanResult)" slot="end" - style="color: white; --box-shadow: 0" + class="connect-to-bluetooth-device-btn" > Connect
-
+
- +

CONNECTED TO: @@ -65,6 +68,6 @@

-
+
diff --git a/src/app/features/settings/go-pro/go-pro.page.scss b/src/app/features/settings/go-pro/go-pro.page.scss index e69de29bb..704fc4680 100644 --- a/src/app/features/settings/go-pro/go-pro.page.scss +++ b/src/app/features/settings/go-pro/go-pro.page.scss @@ -0,0 +1,28 @@ +.connected-bluetooth-device-container { + margin-top: 40px; +} + +.scan-for-bluetooth-devices-btn { + color: white; + margin: 0 16px; + + --box-shadow: 0; +} + +.connect-to-bluetooth-device-btn { + color: white; + + --box-shadow: 0; +} + +.device-id-text { + font-size: 8px; +} + +.spacer { + height: 24px; +} + +.spacer-bottom { + height: 300px; +} From 66191dbc3eddd56193556816545207b2b4b2b198 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Tue, 8 Feb 2022 16:51:35 +0800 Subject: [PATCH 12/81] fix(go-pro.page): typo --- src/app/features/settings/go-pro/go-pro.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/features/settings/go-pro/go-pro.page.html b/src/app/features/settings/go-pro/go-pro.page.html index b7e7b92b0..f31910d0c 100644 --- a/src/app/features/settings/go-pro/go-pro.page.html +++ b/src/app/features/settings/go-pro/go-pro.page.html @@ -13,7 +13,7 @@ (click)="scanForBluetoothDevices()" class="scan-for-bluetooth-devices-btn" > - {{ bluetoothIsScanning ? 'Scaning' : 'Scan for bluetooth devices' }} + {{ bluetoothIsScanning ? 'Scanning' : 'Scan for bluetooth devices' }} From d03c833b9ca9d1c91f7b8c3ec062d773c9b45022 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Tue, 8 Feb 2022 16:59:41 +0800 Subject: [PATCH 13/81] refactor(go-pro-bluetooth.service.ts): use isEqual method from lodash to compare objects --- .../settings/go-pro/services/go-pro-bluetooth.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts index ccc57c853..5c9acafe6 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts @@ -8,6 +8,7 @@ import { import { Wifi } from '@capacitor-community/wifi'; import { Plugins } from '@capacitor/core'; import { isPlatform } from '@ionic/core'; +import { isEqual } from 'lodash-es'; const { Storage } = Plugins; @@ -163,8 +164,7 @@ export class GoProBluetoothService { async sendBluetoothReadCommand(command: number[]) { await this.checkBluetoothDeviceConnection(); - // TODO: find better solution for comparing 2 arrays with numbers - if (JSON.stringify(command) === JSON.stringify(this.shutdownCommand)) { + if (isEqual(command, this.shutdownCommand)) { this.getGoProWiFiCreds(); } From ccb1320a86b954b18b970e19dcfd7fb39d5ff358 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 11 Feb 2022 02:05:39 +0800 Subject: [PATCH 14/81] refactor(go-pro-bluetooth.service.ts): lazy init bluetooth plugin --- .../services/go-pro-bluetooth.service.ts | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts index 5c9acafe6..f688844d2 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts @@ -56,8 +56,25 @@ export class GoProBluetoothService { // eslint-disable-next-line @typescript-eslint/no-magic-numbers private readonly enableGoProWiFiCommand = [0x03, 0x17, 0x01, 0x01]; - constructor() { - BleClient.initialize(); + private hasInitialized = false; + + private async initialize() { + if (this.hasInitialized) { + return; + } + + try { + await BleClient.initialize(); + this.hasInitialized = true; + } catch (err: any) { + if ( + err instanceof Error && + err.message === 'Web Bluetooth API not available in this browser.' + ) { + return; + } + throw new Error(err.message); + } } async scanForBluetoothDevices(): Promise { @@ -68,7 +85,7 @@ export class GoProBluetoothService { const bluetoothScanResults: ScanResult[] = []; - await BleClient.initialize(); + await this.initialize(); BleClient.requestLEScan( { services: [this.goProControlAndQueryServiceUUID] }, @@ -86,6 +103,7 @@ export class GoProBluetoothService { } async connectToBluetoothDevice(scanResult: ScanResult) { + await this.initialize(); await BleClient.connect(scanResult.device.deviceId, _ => { this.onDisconnectedFromBluetoothDevice(scanResult); }); @@ -101,7 +119,9 @@ export class GoProBluetoothService { this.removeConnectedDeviceFromStorage(scanResult); } - async getConnectedDeviceFromStorage(): Promise { + private async getConnectedDeviceFromStorage(): Promise< + ScanResult | undefined + > { const result = await Storage.get({ key: this.GO_PRO_BLUETOOTH_STORAGE_KEY, }); @@ -148,6 +168,7 @@ export class GoProBluetoothService { } async sendBluetoothWriteCommand(command: number[]) { + await this.initialize(); await this.checkBluetoothDeviceConnection(); const connectedDevice = await this.getConnectedDeviceFromStorage(); @@ -162,6 +183,7 @@ export class GoProBluetoothService { } async sendBluetoothReadCommand(command: number[]) { + await this.initialize(); await this.checkBluetoothDeviceConnection(); if (isEqual(command, this.shutdownCommand)) { @@ -215,6 +237,7 @@ export class GoProBluetoothService { * For example: it can be get wifi credentials command */ async pairDevice(): Promise { + await this.initialize(); await this.getGoProWiFiCreds(); } } From 73668e0b5dd58dc20db4dbcf1674ee333a10d564 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 11 Feb 2022 02:14:05 +0800 Subject: [PATCH 15/81] refactor(go-pro-page.ts): use try-catch-finally block to wrap scanForBluetooth call --- src/app/features/settings/go-pro/go-pro.page.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/features/settings/go-pro/go-pro.page.ts b/src/app/features/settings/go-pro/go-pro.page.ts index 319b8f5f6..99d676bf6 100644 --- a/src/app/features/settings/go-pro/go-pro.page.ts +++ b/src/app/features/settings/go-pro/go-pro.page.ts @@ -74,6 +74,7 @@ export class GoProPage implements OnInit { this.bluetoothIsScanning = false; } catch (error) { this.bluetoothScanResults = []; + } finally { this.bluetoothIsScanning = false; } } From 03dd1d6db009a4e9d127ed4d95d22ef6cc06e855 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 11 Feb 2022 02:18:15 +0800 Subject: [PATCH 16/81] refactor(go-pro-media-list-on-camera.component.ts) remove unused comments --- .../go-pro-media-list-on-camera.component.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts index 943706ad8..bcfa32db5 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts @@ -123,16 +123,6 @@ export class GoProMediaListOnCameraComponent implements OnInit { while (this.filesToUpload.length > 0) { const fileToUpload = this.filesToUpload.shift(); - // // eslint-disable-next-line no-console - // console.log(fileToUpload); - - // await new Promise(resolve => { - // setTimeout(() => { - // resolve(fileToUpload); - // // eslint-disable-next-line @typescript-eslint/no-magic-numbers - // }, 4000); - // }); - const uploadResult = await this.goProMediaService.uploadToCaptureFromGoProCamera( fileToUpload From a8e8dac79a78e973b07299c11640bb19a92b54ef Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 11 Feb 2022 02:20:43 +0800 Subject: [PATCH 17/81] refactor(go-pro-media-list-on-camera.component.ts): remove unused variable --- .../go-pro-media-list-on-camera.component.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts index bcfa32db5..13eacd525 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts @@ -151,9 +151,7 @@ export class GoProMediaListOnCameraComponent implements OnInit { await alert.present(); - const { role } = await alert.onDidDismiss(); - // eslint-disable-next-line no-console - console.log('onDidDismiss resolved with role', role); + await alert.onDidDismiss(); } private async navigateToHomeScreen() { From 5c984616e9075f709dc80b0c7dba04e315d4486a Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 11 Feb 2022 02:22:50 +0800 Subject: [PATCH 18/81] refactor(go-pro.page.ts): remove unused comments --- src/app/features/settings/go-pro/go-pro.page.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro.page.ts b/src/app/features/settings/go-pro/go-pro.page.ts index 99d676bf6..7706e8dd4 100644 --- a/src/app/features/settings/go-pro/go-pro.page.ts +++ b/src/app/features/settings/go-pro/go-pro.page.ts @@ -36,23 +36,6 @@ export class GoProPage implements OnInit { ngOnInit() { this.restoreBluetoothConnection(); - - // this.router.navigate( - // ['/settings', 'go-pro', 'media-item-detail-on-camera'], - // { - // state: { - // goProMediaFile: { - // name: 'string;', - // url: 'https://images.pexels.com/photos/9683060/pexels-photo-9683060.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260', - // thumbnailUrl: - // 'https://images.pexels.com/photos/9683060/pexels-photo-9683060.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260', - // type: 'image', - // size: 1024, - // storageKey: 'string; // TODO: remove this field', - // }, - // }, - // } - // ); } async restoreBluetoothConnection() { From 8c26a5382de4a867406d60d1e7b71c73fbea465e Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 11 Feb 2022 02:36:30 +0800 Subject: [PATCH 19/81] refactor(go-pro-media.service.ts): remove unused methods --- .../go-pro/services/go-pro-media.service.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-media.service.ts b/src/app/features/settings/go-pro/services/go-pro-media.service.ts index 507b3f3cb..a7170b776 100644 --- a/src/app/features/settings/go-pro/services/go-pro-media.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-media.service.ts @@ -54,18 +54,6 @@ export class GoProMediaService { return 'unknown'; } - // eslint-disable-next-line class-methods-use-this - extractFileNameFromUrl(url: string): string { - // return extract filename with extension from url - // example 001.jpg, 002.mp4 - return url.split('?')[0].split('/').pop() ?? ''; - } - - // eslint-disable-next-line class-methods-use-this - extractFileExtensionFormUrl(filaName: string): string { - return filaName.split('?')[0].split('.').pop() ?? ''; - } - // eslint-disable-next-line class-methods-use-this extractFileNameFromGoProUrl(url: string): string { // example of GoPro urls @@ -74,11 +62,6 @@ export class GoProMediaService { return url.split('/').pop() ?? ''; } - // eslint-disable-next-line class-methods-use-this - extractFileExtensionFromGoProUrl(url: string): string { - return url.split('.').pop() ?? ''; - } - // eslint-disable-next-line class-methods-use-this getThumbnailUrlFrom(url: string): string { const fileName = url.split('/').pop(); From 2f0ce31a555beee9e9188080997e18003593f517 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 11 Feb 2022 02:56:28 +0800 Subject: [PATCH 20/81] refactor(go-pro-media.service.ts): move url utility methods to src/utils/url.ts --- ...o-media-item-detail-on-camera.component.ts | 3 +- .../go-pro/services/go-pro-media.service.ts | 64 +++---------------- src/utils/url.ts | 49 ++++++++++++++ 3 files changed, 60 insertions(+), 56 deletions(-) create mode 100644 src/utils/url.ts diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts index 698708a85..19d5bce9a 100644 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts @@ -6,6 +6,7 @@ import { LoadingController, ToastController, } from '@ionic/angular'; +import { getFileType } from '../../../../../utils/url'; import { GoProFile } from '../go-pro-media-file'; import { GoProMediaService } from '../services/go-pro-media.service'; import { GoProWifiService } from '../services/go-pro-wifi.service'; @@ -42,7 +43,7 @@ export class GoProMediaItemDetailOnCameraComponent implements OnInit { } ngOnInit() { - this.mediaType = this.goProMediaService.getFileType(this.mediaFile?.url); + this.mediaType = getFileType(this.mediaFile?.url); } async uploadToCapture() { diff --git a/src/app/features/settings/go-pro/services/go-pro-media.service.ts b/src/app/features/settings/go-pro/services/go-pro-media.service.ts index a7170b776..72226eb99 100644 --- a/src/app/features/settings/go-pro/services/go-pro-media.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-media.service.ts @@ -9,6 +9,11 @@ import { Plugins, } from '@capacitor/core'; import { isPlatform } from '@ionic/core'; +import { + detectFileTypeFromUrl, + extractFileNameFromGoProUrl, + urlIsImage, +} from '../../../../../utils/url'; import { FILESYSTEM_PLUGIN } from '../../../../shared/capacitor-plugins/capacitor-plugins.module'; import { CaptureService } from '../../../../shared/capture/capture.service'; import { blobToBase64 } from '../../../../utils/encoding/encoding'; @@ -37,32 +42,6 @@ export class GoProMediaService { private readonly httpClient: HttpClient ) {} - // eslint-disable-next-line class-methods-use-this - getFileType(url?: string): 'unknown' | 'video' | 'image' { - if (url === undefined) { - return 'unknown'; - } - if (url.toLowerCase().includes('.mp4')) { - return 'video'; - } - if ( - url.toLowerCase().includes('.jpg') || - url.toLowerCase().includes('.jpeg') - ) { - return 'image'; - } - return 'unknown'; - } - - // eslint-disable-next-line class-methods-use-this - extractFileNameFromGoProUrl(url: string): string { - // example of GoPro urls - // _________url: http://10.5.5.9:8080/videos/DCIM/100GOPRO/GH010168.MP4 - // thumbnailUrl: http://10.5.5.9:8080/gopro/media/thumbnail?path=100GOPRO/GH010168.MP4 - return url.split('/').pop() ?? ''; - } - - // eslint-disable-next-line class-methods-use-this getThumbnailUrlFrom(url: string): string { const fileName = url.split('/').pop(); const thumbnailUrl = `${this.goproBaseUrl}/gopro/media/thumbnail?path=100GOPRO/${fileName}`; @@ -77,7 +56,7 @@ export class GoProMediaService { }> { if (!mediaFile) return { isDownloaded: false, isCaptured: false }; - const fileName = this.extractFileNameFromGoProUrl(mediaFile.url); + const fileName = extractFileNameFromGoProUrl(mediaFile.url); let isDownloaded = false; let isCaptured = false; @@ -103,9 +82,7 @@ export class GoProMediaService { const base64 = await blobToBase64(blob); - const mimeType = this.urlIsImage(mediaFile.url) - ? 'image/jpeg' - : 'video/mp4'; + const mimeType = urlIsImage(mediaFile.url) ? 'image/jpeg' : 'video/mp4'; isDownloaded = true; await this.captureService.capture({ base64, mimeType }); @@ -125,29 +102,6 @@ export class GoProMediaService { return { isDownloaded, isCaptured }; } - // eslint-disable-next-line class-methods-use-this - urlIsImage(url: string): boolean { - return ( - url.toLocaleLowerCase().includes('.jpeg') || - url.toLocaleLowerCase().includes('.jpg') - ); - } - - // eslint-disable-next-line class-methods-use-this - urlIsVideo(url: string): boolean { - return url.toLowerCase().includes('.mp4'); - } - - detectFileTypeFromUrl(url: string): 'image' | 'video' | 'unknown' { - if (this.urlIsImage(url)) { - return 'image'; - } - if (this.urlIsVideo(url)) { - return 'video'; - } - return 'unknown'; - } - async getFilesFromGoPro(): Promise { const url = this.goproBaseUrl + '/gopro/media/list'; const params = {}; @@ -173,8 +127,8 @@ export class GoProMediaService { url, storageKey: undefined, thumbnailUrl: this.getThumbnailUrlFrom(url), - name: this.extractFileNameFromGoProUrl(url), - type: this.detectFileTypeFromUrl(url), + name: extractFileNameFromGoProUrl(url), + type: detectFileTypeFromUrl(url), }; } } diff --git a/src/utils/url.ts b/src/utils/url.ts new file mode 100644 index 000000000..861b3f36d --- /dev/null +++ b/src/utils/url.ts @@ -0,0 +1,49 @@ +export function getFileType(url?: string): 'unknown' | 'video' | 'image' { + if (url === undefined) { + return 'unknown'; + } + if (url.toLowerCase().includes('.mp4')) { + return 'video'; + } + if ( + url.toLowerCase().includes('.jpg') || + url.toLowerCase().includes('.jpeg') + ) { + return 'image'; + } + return 'unknown'; +} + +/** + * @param url - Exmaple urls from GoPro + * * http://10.5.5.9:8080/videos/DCIM/100GOPRO/GH010168.MP4 + * * http://10.5.5.9:8080/gopro/media/thumbnail?path=100GOPRO/GH010168.MP4 + * + * @returns fileName from url - For example: GH010168.MP4 + */ +export function extractFileNameFromGoProUrl(url: string): string { + return url.split('/').pop() ?? ''; +} + +export function urlIsImage(url: string): boolean { + return ( + url.toLocaleLowerCase().includes('.jpeg') || + url.toLocaleLowerCase().includes('.jpg') + ); +} + +export function urlIsVideo(url: string): boolean { + return url.toLowerCase().includes('.mp4'); +} + +export function detectFileTypeFromUrl( + url: string +): 'image' | 'video' | 'unknown' { + if (urlIsImage(url)) { + return 'image'; + } + if (urlIsVideo(url)) { + return 'video'; + } + return 'unknown'; +} From 1688367f403514d557a618b10b7597981729bde0 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 12:48:18 +0800 Subject: [PATCH 21/81] refactor(go-pro-wifi.service.ts): use preferenceManager instead of Plugins.Storage --- .../go-pro/services/go-pro-wifi.service.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts index 808756684..1c240d334 100644 --- a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts @@ -2,19 +2,20 @@ import { Injectable } from '@angular/core'; import { WifiPlugin } from '@capacitor-community/wifi'; import { Plugins } from '@capacitor/core'; import { Platform } from '@ionic/angular'; +import { PreferenceManager } from '../../../../shared/preference-manager/preference-manager.service'; import { GoProBluetoothService } from './go-pro-bluetooth.service'; const Wifi: WifiPlugin = Plugins.Wifi as WifiPlugin; -const { Storage } = Plugins; - @Injectable({ providedIn: 'root', }) export class GoProWifiService { - private readonly GO_PRO_TUTORIAL_MOBILE_DATA_ONLY_APPS_STORAGE_KEY = - 'GO_PRO_TUTORIAL_MOBILE_DATA_ONLY_APPS_STORAGE_KEY'; + readonly id = 'GoProWifiService'; + + private readonly preferences = this.preferenceManager.getPreferences(this.id); constructor( + private readonly preferenceManager: PreferenceManager, private readonly goProBluetoothService: GoProBluetoothService, public platform: Platform ) {} @@ -45,21 +46,22 @@ export class GoProWifiService { async showTutorialForMobileDataOnlyApps() { if (this.platform.is('android') === false) return false; - const result = await Storage.get({ - key: this.GO_PRO_TUTORIAL_MOBILE_DATA_ONLY_APPS_STORAGE_KEY, - }); - - if (result.value) { - return JSON.parse(result.value) as boolean; - } + const result = await this.preferences.getBoolean( + PrefKeys.SHOW_MOBILE_DATA_TUTORIAL_ON_IOS, + true + ); - return false; + return result; } async dontShowAgainTutorialForMobileDataOnlyApps() { - await Storage.set({ - key: this.GO_PRO_TUTORIAL_MOBILE_DATA_ONLY_APPS_STORAGE_KEY, - value: JSON.stringify(true), - }); + await this.preferences.setBoolean( + PrefKeys.SHOW_MOBILE_DATA_TUTORIAL_ON_IOS, + false + ); } } + +const enum PrefKeys { + SHOW_MOBILE_DATA_TUTORIAL_ON_IOS = 'GO_PRO_SHOW_MOBILE_DATA_TUTORIAL_ON_IOS', +} From 4e5d9a3a4cf4621f6e6308064b590160c33c69f5 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 13:09:37 +0800 Subject: [PATCH 22/81] refactor(go-pro-bluetooth.service.ts): use preferenceManager instead of Plugins.Storage --- .../services/go-pro-bluetooth.service.ts | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts index f688844d2..ca5adbdba 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts @@ -6,11 +6,9 @@ import { ScanResult, } from '@capacitor-community/bluetooth-le'; import { Wifi } from '@capacitor-community/wifi'; -import { Plugins } from '@capacitor/core'; import { isPlatform } from '@ionic/core'; import { isEqual } from 'lodash-es'; - -const { Storage } = Plugins; +import { PreferenceManager } from '../../../../shared/preference-manager/preference-manager.service'; interface GoProWiFiCreds { wifiPASS: string; @@ -58,6 +56,12 @@ export class GoProBluetoothService { private hasInitialized = false; + readonly id = 'GoProBluetoothService'; + + private readonly preferences = this.preferenceManager.getPreferences(this.id); + + constructor(private readonly preferenceManager: PreferenceManager) {} + private async initialize() { if (this.hasInitialized) { return; @@ -122,24 +126,27 @@ export class GoProBluetoothService { private async getConnectedDeviceFromStorage(): Promise< ScanResult | undefined > { - const result = await Storage.get({ - key: this.GO_PRO_BLUETOOTH_STORAGE_KEY, - }); - if (result.value) { - return JSON.parse(result.value) as ScanResult; + const res = await this.preferences.getString( + PrefKeys.LAST_CONNECTED_BLUETOOTH_DEVICE + ); + if (res !== '') { + return JSON.parse(res) as ScanResult; } } async saveConnectedDeviceToStorage(scanResult: ScanResult) { - await Storage.set({ - key: this.GO_PRO_BLUETOOTH_STORAGE_KEY, - value: JSON.stringify(scanResult), - }); + await this.preferences.setString( + PrefKeys.LAST_CONNECTED_BLUETOOTH_DEVICE, + JSON.stringify(scanResult) + ); } // eslint-disable-next-line @typescript-eslint/no-unused-vars async removeConnectedDeviceFromStorage(scanResult: ScanResult) { - await Storage.remove({ key: this.GO_PRO_BLUETOOTH_STORAGE_KEY }); + await this.preferences.setString( + PrefKeys.LAST_CONNECTED_BLUETOOTH_DEVICE, + '' + ); } async getConnectedDevice(): Promise { @@ -241,3 +248,7 @@ export class GoProBluetoothService { await this.getGoProWiFiCreds(); } } + +const enum PrefKeys { + LAST_CONNECTED_BLUETOOTH_DEVICE = 'GO_PRO_LAST_CONNECTED_BLUETOOTH_DEVICE', +} From f071852936abd7376fc8f43006a0e402ed1552ef Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 14:03:02 +0800 Subject: [PATCH 23/81] refactor(home.page.ts): fix no-async-promise-executor --- src/app/features/home/home.page.ts | 66 ++++++++++--------- .../services/go-pro-bluetooth.service.ts | 7 ++ 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/src/app/features/home/home.page.ts b/src/app/features/home/home.page.ts index 2659d6577..3ca44418c 100644 --- a/src/app/features/home/home.page.ts +++ b/src/app/features/home/home.page.ts @@ -5,7 +5,7 @@ import { Plugins } from '@capacitor/core'; import { ActionSheetController, AlertController } from '@ionic/angular'; import { TranslocoService } from '@ngneat/transloco'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { defer, EMPTY, iif, of } from 'rxjs'; +import { combineLatest, defer, EMPTY, iif, of } from 'rxjs'; import { catchError, concatMap, @@ -154,40 +154,42 @@ export class HomePage { } private presentCaptureActions$() { - return this.translocoService - .selectTranslateObject({ + return combineLatest([ + this.translocoService.selectTranslateObject({ takePicture: null, recordVideo: null, + }), + this.goProBluetoothService.connectedDevice$, + ]).pipe( + first(), + concatMap(([translations, connectedDevice]) => { + const [takePicture, recordVideo] = translations; + + return new Promise(resolve => { + const buttons = [ + { + text: takePicture, + handler: () => resolve(this.cameraService.takePhoto()), + }, + { + text: recordVideo, + handler: () => resolve(this.recordVideo()), + }, + ]; + + if (connectedDevice) { + buttons.push({ + text: 'Capture from GoPro', + handler: () => resolve(this.caputureFromGoPro()), + }); + } + + return this.actionSheetController + .create({ buttons }) + .then(sheet => sheet.present()); + }); }) - .pipe( - first(), - concatMap(async ([takePicture, recordVideo]) => { - // eslint-disable-next-line no-async-promise-executor - return new Promise(async resolve => { - const buttons = [ - { - text: takePicture, - handler: () => resolve(this.cameraService.takePhoto()), - }, - { - text: recordVideo, - handler: () => resolve(this.recordVideo()), - }, - ]; - - if (await this.goProBluetoothService.getConnectedDevice()) { - buttons.push({ - text: 'Capture from GoPro', - handler: () => resolve(this.caputureFromGoPro()), - }); - } - - return this.actionSheetController - .create({ buttons }) - .then(sheet => sheet.present()); - }); - }) - ); + ); } private async recordVideo() { diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts index ca5adbdba..f931ebd89 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts @@ -8,6 +8,7 @@ import { import { Wifi } from '@capacitor-community/wifi'; import { isPlatform } from '@ionic/core'; import { isEqual } from 'lodash-es'; +import { BehaviorSubject } from 'rxjs'; import { PreferenceManager } from '../../../../shared/preference-manager/preference-manager.service'; interface GoProWiFiCreds { @@ -60,6 +61,10 @@ export class GoProBluetoothService { private readonly preferences = this.preferenceManager.getPreferences(this.id); + readonly connectedDevice$ = new BehaviorSubject( + undefined + ); + constructor(private readonly preferenceManager: PreferenceManager) {} private async initialize() { @@ -139,6 +144,7 @@ export class GoProBluetoothService { PrefKeys.LAST_CONNECTED_BLUETOOTH_DEVICE, JSON.stringify(scanResult) ); + this.connectedDevice$.next(scanResult); } // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -147,6 +153,7 @@ export class GoProBluetoothService { PrefKeys.LAST_CONNECTED_BLUETOOTH_DEVICE, '' ); + this.connectedDevice$.next(undefined); } async getConnectedDevice(): Promise { From cd713b0e44f39aca0983c028d53aac2632791d5f Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 19:42:53 +0800 Subject: [PATCH 24/81] fix(go-pro-bluetooth.service.ts): disconnect before connection to new device --- .../settings/go-pro/services/go-pro-bluetooth.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts index f931ebd89..8294fe2bc 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.ts @@ -113,10 +113,11 @@ export class GoProBluetoothService { async connectToBluetoothDevice(scanResult: ScanResult) { await this.initialize(); + await BleClient.disconnect(scanResult.device.deviceId); await BleClient.connect(scanResult.device.deviceId, _ => { this.onDisconnectedFromBluetoothDevice(scanResult); }); - this.saveConnectedDeviceToStorage(scanResult); + await this.saveConnectedDeviceToStorage(scanResult); } onDisconnectedFromBluetoothDevice(scanResult: ScanResult) { From 7d3908c21b75dfe133142ecc67ba2ece4daa9893 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 14:44:54 +0800 Subject: [PATCH 25/81] update @capacitor/cli & @capacitor/core packages --- package-lock.json | 1196 +++++++++++++++++++++++++++------------------ package.json | 4 +- 2 files changed, 731 insertions(+), 469 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec9e787be..b0ae92cd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@capacitor-community/http": "^0.3.2", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", - "@capacitor/core": "~2.4.7", + "@capacitor/core": "^3.4.1", "@capacitor/ios": "~2.4.7", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", @@ -61,7 +61,7 @@ "@angular/compiler": "^12.2.4", "@angular/compiler-cli": "^12.2.4", "@angular/language-service": "^12.2.4", - "@capacitor/cli": "~2.4.7", + "@capacitor/cli": "^3.4.1", "@ionic/angular-toolkit": "^4.0.0", "@types/jasmine": "^3.8.2", "@types/jasminewd2": "^2.0.10", @@ -2554,6 +2554,19 @@ "@capacitor/core": "2.4.7" } }, + "node_modules/@capacitor-community/http/node_modules/@capacitor/core": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.4.7.tgz", + "integrity": "sha512-ZPzXXQ4EPwR/ZhNDkmlxyzw4FvquIl/ROj8HMMM0MEd4xZfM8ulNGPIL6br9TWdlFLGBKq40eymPZjKaivGnig==", + "dependencies": { + "tslib": "^1.9.0" + } + }, + "node_modules/@capacitor-community/http/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/@capacitor-community/wifi": { "version": "0.0.1", "resolved": "git+ssh://git@github.com/digaus/community-capacitor-wifi.git#5052c6fb4ed5d6329215976dab2a735a852d52c9", @@ -2575,277 +2588,69 @@ } }, "node_modules/@capacitor/cli": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-2.4.7.tgz", - "integrity": "sha512-RC5EO3oA2gWniZK0JWRlZa+7MFIoHYiAtt+W4Hqq74nyv1C0z/MvRY3pX2DX7kKy6Uc1Z/25D0uSXRk+erv3RQ==", - "dev": true, - "dependencies": { - "chalk": "^2.3.0", - "commander": "^4.1.1", - "compare-versions": "^3.1.0", - "fs-extra": "^4.0.3", - "inquirer": "6.3.1", - "open": "^6.1.0", - "ora": "^1.3.0", - "plist": "^3.0.1", - "semver": "^5.4.1", - "which": "^1.3.0", - "xml2js": "^0.4.19" + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.4.1.tgz", + "integrity": "sha512-48MA50ExfMJgndunsoh9kI3ItNJDwJrl6+DNocdEZfnIw45IUtmmeu+V3JsoDM2LfwxG9tamJV4zXWM0o4MSOw==", + "dev": true, + "dependencies": { + "@ionic/cli-framework-output": "^2.2.1", + "@ionic/utils-fs": "^3.1.5", + "@ionic/utils-subprocess": "^2.1.6", + "@ionic/utils-terminal": "^2.3.0", + "commander": "^6.0.0", + "debug": "^4.2.0", + "env-paths": "^2.2.0", + "kleur": "^4.1.1", + "native-run": "^1.5.0", + "open": "^7.4.2", + "plist": "^3.0.2", + "prompts": "^2.3.2", + "semver": "^7.3.2", + "tar": "^6.1.11", + "tslib": "^2.1.0", + "xml2js": "^0.4.23" }, "bin": { "cap": "bin/capacitor", "capacitor": "bin/capacitor" }, "engines": { - "node": ">=8.3.0" + "node": ">=12.4.0" } }, - "node_modules/@capacitor/cli/node_modules/ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "node_modules/@capacitor/cli/node_modules/kleur": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", + "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", "dev": true, "engines": { "node": ">=6" } }, - "node_modules/@capacitor/cli/node_modules/cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "dependencies": { - "restore-cursor": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/cli-spinners": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", - "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, - "node_modules/@capacitor/cli/node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/inquirer": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", - "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", - "dev": true, - "dependencies": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.11", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@capacitor/cli/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "dependencies": { - "chalk": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "node_modules/@capacitor/cli/node_modules/onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "dependencies": { - "mimic-fn": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@capacitor/cli/node_modules/open": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz", - "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", "dev": true, "dependencies": { - "is-wsl": "^1.1.0" + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" }, "engines": { "node": ">=8" - } - }, - "node_modules/@capacitor/cli/node_modules/ora": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-1.4.0.tgz", - "integrity": "sha512-iMK1DOQxzzh2MBlVsU42G80mnrvUhqsMh74phHtDlrcTZPK0pH6o7l7DRshK+0YsxDyEuaOkziVdvM3T0QTzpw==", - "dev": true, - "dependencies": { - "chalk": "^2.1.0", - "cli-cursor": "^2.1.0", - "cli-spinners": "^1.0.1", - "log-symbols": "^2.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "dependencies": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/@capacitor/cli/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/string-width/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@capacitor/cli/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@capacitor/core": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.4.7.tgz", - "integrity": "sha512-ZPzXXQ4EPwR/ZhNDkmlxyzw4FvquIl/ROj8HMMM0MEd4xZfM8ulNGPIL6br9TWdlFLGBKq40eymPZjKaivGnig==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.4.1.tgz", + "integrity": "sha512-BwN925gwXGEVAhnnVAXH57cp+/YW5PhFZloGYaN3Sm8eKcYDNeti38lV9DQ8A/T5PYkJw/+TSu8SsuoEQD0vwQ==", "dependencies": { - "tslib": "^1.9.0" + "tslib": "^2.1.0" } }, - "node_modules/@capacitor/core/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "node_modules/@capacitor/ios": { "version": "2.4.7", "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-2.4.7.tgz", @@ -3400,6 +3205,20 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, + "node_modules/@ionic/cli-framework-output": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@ionic/cli-framework-output/-/cli-framework-output-2.2.2.tgz", + "integrity": "sha512-eQYkqIW1/tCwSC6Bd0gjse96U11lDX/ikf3jvsjX7a8z/zwSmGzCHRizb7xogV65Ey+1/zyAZR71cpDRQuFLBQ==", + "dev": true, + "dependencies": { + "@ionic/utils-terminal": "2.3.1", + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, "node_modules/@ionic/core": { "version": "5.6.11", "resolved": "https://registry.npmjs.org/@ionic/core/-/core-5.6.11.tgz", @@ -3415,6 +3234,200 @@ "resolved": "https://registry.npmjs.org/@ionic/pwa-elements/-/pwa-elements-3.0.2.tgz", "integrity": "sha512-Wwb8/NgzeX1GA8MDPvcis7nx1vqtWdEaDz3t0tTbtUduR/oCNkWZkY2PFL49ET0+/lRhcqE2jZwXvTVn0R1UGw==" }, + "node_modules/@ionic/utils-array": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-array/-/utils-array-2.1.5.tgz", + "integrity": "sha512-HD72a71IQVBmQckDwmA8RxNVMTbxnaLbgFOl+dO5tbvW9CkkSFCv41h6fUuNsSEVgngfkn0i98HDuZC8mk+lTA==", + "dev": true, + "dependencies": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-fs": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-fs/-/utils-fs-3.1.5.tgz", + "integrity": "sha512-a41bY2dHqWSEQQ/80CpbXSs8McyiCFf2DnIWWLukrhYWf46h4qi6M/8dxcMKrofRiqI/3F+cL3S2mOm9Zz/o2Q==", + "dev": true, + "dependencies": { + "debug": "^4.0.0", + "fs-extra": "^9.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-fs/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@ionic/utils-fs/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@ionic/utils-fs/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@ionic/utils-object": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-object/-/utils-object-2.1.5.tgz", + "integrity": "sha512-XnYNSwfewUqxq+yjER1hxTKggftpNjFLJH0s37jcrNDwbzmbpFTQTVAp4ikNK4rd9DOebX/jbeZb8jfD86IYxw==", + "dev": true, + "dependencies": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-process": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@ionic/utils-process/-/utils-process-2.1.8.tgz", + "integrity": "sha512-VBBoyTzi+m6tgKAItl+jiTQneGwTOsctcrTG4CsEgmVOVOEhUYkPhddXqzD+oC54hPDU9ROsd3I014P5CWEuhQ==", + "dev": true, + "dependencies": { + "@ionic/utils-object": "2.1.5", + "@ionic/utils-terminal": "2.3.1", + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "tree-kill": "^1.2.2", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-stream": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-stream/-/utils-stream-3.1.5.tgz", + "integrity": "sha512-hkm46uHvEC05X/8PHgdJi4l4zv9VQDELZTM+Kz69odtO9zZYfnt8DkfXHJqJ+PxmtiE5mk/ehJWLnn/XAczTUw==", + "dev": true, + "dependencies": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-subprocess": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@ionic/utils-subprocess/-/utils-subprocess-2.1.8.tgz", + "integrity": "sha512-pkmtf1LtXcEMPn6/cctREL2aZtZoy0+0Sl+nT0NIkOHIoBUcqrcfMWdctCSM4Mp6+2/hLWtgpHE3TOIibkWfIg==", + "dev": true, + "dependencies": { + "@ionic/utils-array": "2.1.5", + "@ionic/utils-fs": "3.1.5", + "@ionic/utils-process": "2.1.8", + "@ionic/utils-stream": "3.1.5", + "@ionic/utils-terminal": "2.3.1", + "cross-spawn": "^7.0.0", + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-terminal": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.1.tgz", + "integrity": "sha512-cglsSd2AckI3Ldtdfczeq64vIIDjtPspV5QJtky8f8uIdxkeOIGeRV7bCj1+BEf1hyo+ZuggQxLviHnbMZhiRw==", + "dev": true, + "dependencies": { + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/@ionic/utils-terminal/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@ionic/utils-terminal/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@ionic/utils-terminal/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@ionic/utils-terminal/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -5717,6 +5730,15 @@ "is-stream": "^2.0.0" } }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -5859,6 +5881,18 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", "dev": true }, + "node_modules/bplist-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", + "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", + "dev": true, + "dependencies": { + "big-integer": "1.6.x" + }, + "engines": { + "node": ">= 5.10.0" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -6076,6 +6110,15 @@ "ieee754": "^1.1.13" } }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -6800,9 +6843,9 @@ } }, "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, "engines": { "node": ">= 6" @@ -6823,12 +6866,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "node_modules/compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "node_modules/component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -7888,9 +7925,9 @@ } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -8438,6 +8475,24 @@ "integrity": "sha512-ye+4uQOY/jbjRutMcE/EmOcNwUeo1qo9aKL2tPyb09cU3lmxNeyDF4RWiemmkknW+p29h7dyDqy02higTxc9/A==", "dev": true }, + "node_modules/elementtree": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz", + "integrity": "sha1-mskb5uUvtuYkTE5UpKw+2K6OKcA=", + "dev": true, + "dependencies": { + "sax": "1.1.4" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/elementtree/node_modules/sax": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", + "integrity": "sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=", + "dev": true + }, "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -9857,6 +9912,15 @@ "node": ">=0.8.0" } }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -14471,6 +14535,37 @@ "node": ">=0.10.0" } }, + "node_modules/native-run": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/native-run/-/native-run-1.5.0.tgz", + "integrity": "sha512-YYsYYAljk70N+FJLeY5KuafsBit7agOBR3ch1KTXOaKkREkM49yCwJIwVz2faoWpJ2MeyLdXltk5PskUuPQqZA==", + "dev": true, + "dependencies": { + "@ionic/utils-fs": "^3.1.5", + "@ionic/utils-terminal": "^2.3.1", + "bplist-parser": "^0.3.0", + "debug": "^4.3.2", + "elementtree": "^0.1.7", + "ini": "^1.3.5", + "plist": "^3.0.4", + "split2": "^3.2.2", + "through2": "^4.0.2", + "tslib": "^2.3.1", + "yauzl": "^2.10.0" + }, + "bin": { + "native-run": "bin/native-run" + }, + "engines": { + "node": ">=10.3.0" + } + }, + "node_modules/native-run/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -15666,6 +15761,12 @@ "node": ">=0.12" } }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -20896,6 +20997,15 @@ "node": ">=0.10.0" } }, + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dev": true, + "dependencies": { + "readable-stream": "^3.0.0" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -22347,6 +22457,15 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "dependencies": { + "readable-stream": "3" + } + }, "node_modules/thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", @@ -22957,6 +23076,15 @@ "node": ">=0.10.0" } }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/upath": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", @@ -25099,6 +25227,16 @@ "node": ">=10" } }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -26841,6 +26979,21 @@ "integrity": "sha512-yBHwQof07KRQqZpQHwymKByJfcZmjRAaFwXXd9w0w52GIjr9AlZ0Qg1R60Czbi4mgQdiqk90nsZIXrRpxpsAZA==", "requires": { "@capacitor/core": "2.4.7" + }, + "dependencies": { + "@capacitor/core": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.4.7.tgz", + "integrity": "sha512-ZPzXXQ4EPwR/ZhNDkmlxyzw4FvquIl/ROj8HMMM0MEd4xZfM8ulNGPIL6br9TWdlFLGBKq40eymPZjKaivGnig==", + "requires": { + "tslib": "^1.9.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } } }, "@capacitor-community/wifi": { @@ -26856,217 +27009,53 @@ "requires": {} }, "@capacitor/cli": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-2.4.7.tgz", - "integrity": "sha512-RC5EO3oA2gWniZK0JWRlZa+7MFIoHYiAtt+W4Hqq74nyv1C0z/MvRY3pX2DX7kKy6Uc1Z/25D0uSXRk+erv3RQ==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.4.1.tgz", + "integrity": "sha512-48MA50ExfMJgndunsoh9kI3ItNJDwJrl6+DNocdEZfnIw45IUtmmeu+V3JsoDM2LfwxG9tamJV4zXWM0o4MSOw==", "dev": true, "requires": { - "chalk": "^2.3.0", - "commander": "^4.1.1", - "compare-versions": "^3.1.0", - "fs-extra": "^4.0.3", - "inquirer": "6.3.1", - "open": "^6.1.0", - "ora": "^1.3.0", - "plist": "^3.0.1", - "semver": "^5.4.1", - "which": "^1.3.0", - "xml2js": "^0.4.19" + "@ionic/cli-framework-output": "^2.2.1", + "@ionic/utils-fs": "^3.1.5", + "@ionic/utils-subprocess": "^2.1.6", + "@ionic/utils-terminal": "^2.3.0", + "commander": "^6.0.0", + "debug": "^4.2.0", + "env-paths": "^2.2.0", + "kleur": "^4.1.1", + "native-run": "^1.5.0", + "open": "^7.4.2", + "plist": "^3.0.2", + "prompts": "^2.3.2", + "semver": "^7.3.2", + "tar": "^6.1.11", + "tslib": "^2.1.0", + "xml2js": "^0.4.23" }, "dependencies": { - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-spinners": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", - "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", + "kleur": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", + "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", "dev": true }, - "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "inquirer": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", - "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", - "dev": true, - "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.11", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, "open": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz", - "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", - "dev": true, - "requires": { - "is-wsl": "^1.1.0" - } - }, - "ora": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-1.4.0.tgz", - "integrity": "sha512-iMK1DOQxzzh2MBlVsU42G80mnrvUhqsMh74phHtDlrcTZPK0pH6o7l7DRshK+0YsxDyEuaOkziVdvM3T0QTzpw==", - "dev": true, - "requires": { - "chalk": "^2.1.0", - "cli-cursor": "^2.1.0", - "cli-spinners": "^1.0.1", - "log-symbols": "^2.1.0" - } - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" } } } }, "@capacitor/core": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.4.7.tgz", - "integrity": "sha512-ZPzXXQ4EPwR/ZhNDkmlxyzw4FvquIl/ROj8HMMM0MEd4xZfM8ulNGPIL6br9TWdlFLGBKq40eymPZjKaivGnig==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.4.1.tgz", + "integrity": "sha512-BwN925gwXGEVAhnnVAXH57cp+/YW5PhFZloGYaN3Sm8eKcYDNeti38lV9DQ8A/T5PYkJw/+TSu8SsuoEQD0vwQ==", "requires": { - "tslib": "^1.9.0" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - } + "tslib": "^2.1.0" } }, "@capacitor/ios": { @@ -27415,6 +27404,17 @@ "ws": "^7.0.1" } }, + "@ionic/cli-framework-output": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@ionic/cli-framework-output/-/cli-framework-output-2.2.2.tgz", + "integrity": "sha512-eQYkqIW1/tCwSC6Bd0gjse96U11lDX/ikf3jvsjX7a8z/zwSmGzCHRizb7xogV65Ey+1/zyAZR71cpDRQuFLBQ==", + "dev": true, + "requires": { + "@ionic/utils-terminal": "2.3.1", + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, "@ionic/core": { "version": "5.6.11", "resolved": "https://registry.npmjs.org/@ionic/core/-/core-5.6.11.tgz", @@ -27430,6 +27430,160 @@ "resolved": "https://registry.npmjs.org/@ionic/pwa-elements/-/pwa-elements-3.0.2.tgz", "integrity": "sha512-Wwb8/NgzeX1GA8MDPvcis7nx1vqtWdEaDz3t0tTbtUduR/oCNkWZkY2PFL49ET0+/lRhcqE2jZwXvTVn0R1UGw==" }, + "@ionic/utils-array": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-array/-/utils-array-2.1.5.tgz", + "integrity": "sha512-HD72a71IQVBmQckDwmA8RxNVMTbxnaLbgFOl+dO5tbvW9CkkSFCv41h6fUuNsSEVgngfkn0i98HDuZC8mk+lTA==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-fs": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-fs/-/utils-fs-3.1.5.tgz", + "integrity": "sha512-a41bY2dHqWSEQQ/80CpbXSs8McyiCFf2DnIWWLukrhYWf46h4qi6M/8dxcMKrofRiqI/3F+cL3S2mOm9Zz/o2Q==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "fs-extra": "^9.0.0", + "tslib": "^2.0.1" + }, + "dependencies": { + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } + } + }, + "@ionic/utils-object": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-object/-/utils-object-2.1.5.tgz", + "integrity": "sha512-XnYNSwfewUqxq+yjER1hxTKggftpNjFLJH0s37jcrNDwbzmbpFTQTVAp4ikNK4rd9DOebX/jbeZb8jfD86IYxw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-process": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@ionic/utils-process/-/utils-process-2.1.8.tgz", + "integrity": "sha512-VBBoyTzi+m6tgKAItl+jiTQneGwTOsctcrTG4CsEgmVOVOEhUYkPhddXqzD+oC54hPDU9ROsd3I014P5CWEuhQ==", + "dev": true, + "requires": { + "@ionic/utils-object": "2.1.5", + "@ionic/utils-terminal": "2.3.1", + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "tree-kill": "^1.2.2", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-stream": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-stream/-/utils-stream-3.1.5.tgz", + "integrity": "sha512-hkm46uHvEC05X/8PHgdJi4l4zv9VQDELZTM+Kz69odtO9zZYfnt8DkfXHJqJ+PxmtiE5mk/ehJWLnn/XAczTUw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-subprocess": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@ionic/utils-subprocess/-/utils-subprocess-2.1.8.tgz", + "integrity": "sha512-pkmtf1LtXcEMPn6/cctREL2aZtZoy0+0Sl+nT0NIkOHIoBUcqrcfMWdctCSM4Mp6+2/hLWtgpHE3TOIibkWfIg==", + "dev": true, + "requires": { + "@ionic/utils-array": "2.1.5", + "@ionic/utils-fs": "3.1.5", + "@ionic/utils-process": "2.1.8", + "@ionic/utils-stream": "3.1.5", + "@ionic/utils-terminal": "2.3.1", + "cross-spawn": "^7.0.0", + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-terminal": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.1.tgz", + "integrity": "sha512-cglsSd2AckI3Ldtdfczeq64vIIDjtPspV5QJtky8f8uIdxkeOIGeRV7bCj1+BEf1hyo+ZuggQxLviHnbMZhiRw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, "@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -29203,6 +29357,12 @@ "is-stream": "^2.0.0" } }, + "big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "dev": true + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -29326,6 +29486,15 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", "dev": true }, + "bplist-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", + "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", + "dev": true, + "requires": { + "big-integer": "1.6.x" + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -29502,6 +29671,12 @@ "ieee754": "^1.1.13" } }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -30083,9 +30258,9 @@ } }, "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true }, "common-tags": { @@ -30100,12 +30275,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -30926,9 +31095,9 @@ "dev": true }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -31380,6 +31549,23 @@ "integrity": "sha512-ye+4uQOY/jbjRutMcE/EmOcNwUeo1qo9aKL2tPyb09cU3lmxNeyDF4RWiemmkknW+p29h7dyDqy02higTxc9/A==", "dev": true }, + "elementtree": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.7.tgz", + "integrity": "sha1-mskb5uUvtuYkTE5UpKw+2K6OKcA=", + "dev": true, + "requires": { + "sax": "1.1.4" + }, + "dependencies": { + "sax": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", + "integrity": "sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=", + "dev": true + } + } + }, "elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", @@ -32558,6 +32744,15 @@ "websocket-driver": ">=0.5.1" } }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -36079,6 +36274,33 @@ "to-regex": "^3.0.1" } }, + "native-run": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/native-run/-/native-run-1.5.0.tgz", + "integrity": "sha512-YYsYYAljk70N+FJLeY5KuafsBit7agOBR3ch1KTXOaKkREkM49yCwJIwVz2faoWpJ2MeyLdXltk5PskUuPQqZA==", + "dev": true, + "requires": { + "@ionic/utils-fs": "^3.1.5", + "@ionic/utils-terminal": "^2.3.1", + "bplist-parser": "^0.3.0", + "debug": "^4.3.2", + "elementtree": "^0.1.7", + "ini": "^1.3.5", + "plist": "^3.0.4", + "split2": "^3.2.2", + "through2": "^4.0.2", + "tslib": "^2.3.1", + "yauzl": "^2.10.0" + }, + "dependencies": { + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + } + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -37002,6 +37224,12 @@ "sha.js": "^2.4.8" } }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -40938,6 +41166,15 @@ "extend-shallow": "^3.0.0" } }, + "split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dev": true, + "requires": { + "readable-stream": "^3.0.0" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -42043,6 +42280,15 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "requires": { + "readable-stream": "3" + } + }, "thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", @@ -42491,6 +42737,12 @@ } } }, + "untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true + }, "upath": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", @@ -44219,6 +44471,16 @@ "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", "dev": true }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/package.json b/package.json index 0493a4887..90c2a0dd8 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@capacitor-community/http": "^0.3.2", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", - "@capacitor/core": "~2.4.7", + "@capacitor/core": "^3.4.1", "@capacitor/ios": "~2.4.7", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", @@ -72,7 +72,7 @@ "@angular/compiler": "^12.2.4", "@angular/compiler-cli": "^12.2.4", "@angular/language-service": "^12.2.4", - "@capacitor/cli": "~2.4.7", + "@capacitor/cli": "^3.4.1", "@ionic/angular-toolkit": "^4.0.0", "@types/jasmine": "^3.8.2", "@types/jasminewd2": "^2.0.10", From 1c8d44d27049712e1706149af8b9014ea21ef372 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 14:47:49 +0800 Subject: [PATCH 26/81] Set iOS deployment target to 12.0 --- ios/App/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/App/Podfile b/ios/App/Podfile index 2d5f9b642..2b6ad39f4 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -1,4 +1,4 @@ -platform :ios, '11.0' +platform :ios, '12.0' use_frameworks! # workaround to avoid Xcode caching of Pods that requires From 9dc08a0cbc9349fec16ebdb4d2a4700d8776ab5b Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 14:53:48 +0800 Subject: [PATCH 27/81] Move public into the iOS target directory --- ios/.gitignore | 2 +- ios/App/App.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/.gitignore b/ios/.gitignore index 0f2977116..782a0ed2e 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -4,7 +4,7 @@ App/build App/Pods -App/public +App/App/public App/Podfile.lock xcuserdata diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index ecf3b1983..3a94ce244 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -13,9 +13,9 @@ 504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; }; 504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; }; 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; - 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; }; DE095D00277AF00900242276 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DE095CFF277AF00900242276 /* GoogleService-Info.plist */; }; + DE28999027B790A900F6581C /* public in Resources */ = {isa = PBXBuildFile; fileRef = DE28998F27B790A900F6581C /* public */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -28,10 +28,10 @@ 504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = SOURCE_ROOT; }; AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = ""; }; DE095CFF277AF00900242276 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + DE28998F27B790A900F6581C /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = ""; }; FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -76,6 +76,7 @@ 504EC3061FED79650016851F /* App */ = { isa = PBXGroup; children = ( + DE28998F27B790A900F6581C /* public */, 3A9F028D2565C4AD00C28730 /* App.entitlements */, 50379B222058CBB4000EE86E /* capacitor.config.json */, 504EC3071FED79650016851F /* AppDelegate.swift */, @@ -85,7 +86,6 @@ 504EC3101FED79650016851F /* LaunchScreen.storyboard */, 504EC3131FED79650016851F /* Info.plist */, 2FAD9762203C412B000D30F8 /* config.xml */, - 50B271D01FEDC1A000F3C39B /* public */, ); path = App; sourceTree = ""; @@ -161,12 +161,12 @@ buildActionMask = 2147483647; files = ( 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */, - 50B271D11FEDC1A000F3C39B /* public in Resources */, 504EC30F1FED79650016851F /* Assets.xcassets in Resources */, 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, 504EC30D1FED79650016851F /* Main.storyboard in Resources */, 2FAD9763203C412B000D30F8 /* config.xml in Resources */, DE095D00277AF00900242276 /* GoogleService-Info.plist in Resources */, + DE28999027B790A900F6581C /* public in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; From a9c95ae702c8800d6ddee73a1364404d77f2c2d8 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 14:55:11 +0800 Subject: [PATCH 28/81] install @capacitor/ios@latest --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0ae92cd9..30bd75284 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", "@capacitor/core": "^3.4.1", - "@capacitor/ios": "~2.4.7", + "@capacitor/ios": "^3.4.1", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", "@ionic/pwa-elements": "^3.0.2", @@ -2652,11 +2652,11 @@ } }, "node_modules/@capacitor/ios": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-2.4.7.tgz", - "integrity": "sha512-XKYU67ZM+yY4/vDJ3ZVfs+phjtWK8TcKwq75fGoxB9PKXuCmMi5bihPuA3Xs/sIFXuozpnaYnspp0eTRJ7bG0w==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.4.1.tgz", + "integrity": "sha512-ycFCyKI8DsgedVg7PW5MpCVgqFuD0PMHQGVfC5ichXc2C/jAATX32EVdEMCB0N3guKoH2k6T3Efwg59+Fcdx2w==", "peerDependencies": { - "@capacitor/core": "~2.4.0" + "@capacitor/core": "^3.4.0" } }, "node_modules/@cspotcode/source-map-consumer": { @@ -27059,9 +27059,9 @@ } }, "@capacitor/ios": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-2.4.7.tgz", - "integrity": "sha512-XKYU67ZM+yY4/vDJ3ZVfs+phjtWK8TcKwq75fGoxB9PKXuCmMi5bihPuA3Xs/sIFXuozpnaYnspp0eTRJ7bG0w==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.4.1.tgz", + "integrity": "sha512-ycFCyKI8DsgedVg7PW5MpCVgqFuD0PMHQGVfC5ichXc2C/jAATX32EVdEMCB0N3guKoH2k6T3Efwg59+Fcdx2w==", "requires": {} }, "@cspotcode/source-map-consumer": { diff --git a/package.json b/package.json index 90c2a0dd8..cae43cc8f 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", "@capacitor/core": "^3.4.1", - "@capacitor/ios": "~2.4.7", + "@capacitor/ios": "^3.4.1", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", "@ionic/pwa-elements": "^3.0.2", From 2854ca4e920bfe84af50ec634cb260ad192acfda Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 14:56:47 +0800 Subject: [PATCH 29/81] npx cap sync ios --- ios/App/Podfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/ios/App/Podfile b/ios/App/Podfile index 2b6ad39f4..b30077299 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -7,14 +7,12 @@ use_frameworks! install! 'cocoapods', :disable_input_output_paths => true def capacitor_pods - # Automatic Capacitor Pod dependencies, do not delete pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCommunityBluetoothLe', :path => '../../node_modules/@capacitor-community/bluetooth-le' pod 'CapacitorCommunityHttp', :path => '../../node_modules/@capacitor-community/http' pod 'CapacitorCommunityWifi', :path => '../../node_modules/@capacitor-community/wifi' pod 'CapacitorBlobWriter', :path => '../../node_modules/capacitor-blob-writer' - # Do not delete end target 'App' do From 63621e42506a2b6a8e421ed1f765cd8b82e19175 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 14:58:43 +0800 Subject: [PATCH 30/81] Switch from CAPBridge to ApplicationDelegateProxy in application events --- ios/App/App/AppDelegate.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index 8c2cc3fab..380064a35 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -40,14 +40,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { // Called when the app was launched with a url. Feel free to add additional processing here, // but if you want the App API to support tracking app url opens, make sure to keep this call - return CAPBridge.handleOpenUrl(url, options) + return ApplicationDelegateProxy.shared.application(app, open: url, options: options) } func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { // Called when the app was launched with an activity, including Universal Links. // Feel free to add additional processing here, but if you want the App API to support // tracking app url opens, make sure to keep this call - return CAPBridge.handleContinueActivity(userActivity, restorationHandler) + return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler) } override func touchesBegan(_ touches: Set, with event: UIEvent?) { From 5c587b008a83281edf9a291cd68086c1bc736f04 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 15:02:17 +0800 Subject: [PATCH 31/81] Remove USE_PUSH compilation condition --- ios/App/App/AppDelegate.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index 380064a35..ed12ad9f9 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -61,7 +61,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } } - #if USE_PUSH func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { Messaging.messaging().apnsToken = deviceToken @@ -78,7 +77,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidFailToRegisterForRemoteNotificationsWithError.name()), object: error) } -#endif } From da5e7588f037835f02427a29bebf587fe04db8ef Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 15:10:36 +0800 Subject: [PATCH 32/81] increment IPHONEOS_DEPLOYMENT_TARGET to 12 --- ios/App/App.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 3a94ce244..063bf1ee4 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -361,7 +361,7 @@ CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = G7NB5YCKAP; INFOPLIST_FILE = App/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 0.17.0; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; @@ -386,7 +386,7 @@ CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = G7NB5YCKAP; INFOPLIST_FILE = App/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 0.17.0; PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite; From f73a1b33e2aec6ea4587a612e5627bbcc8bea25b Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 15:10:53 +0800 Subject: [PATCH 33/81] Switch from hard-coded CAPNotifications to NSNotification extensions --- ios/App/App/AppDelegate.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index ed12ad9f9..5bd271f70 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -57,7 +57,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return } if statusBarRect.contains(touchPoint) { - NotificationCenter.default.post(CAPBridge.statusBarTappedNotification) + NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil) } } @@ -66,15 +66,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate { Messaging.messaging().apnsToken = deviceToken Messaging.messaging().token { (token, error) in if let error = error { - NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidFailToRegisterForRemoteNotificationsWithError.name()), object: error) + NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error) } else if let token = token { - NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidRegisterForRemoteNotificationsWithDeviceToken.name()), object: token) + NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: token) } } } func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { - NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidFailToRegisterForRemoteNotificationsWithError.name()), object: error) + NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error) } From d152a449edc1ef991c145ca22e4866a6a968db65 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 15:11:22 +0800 Subject: [PATCH 34/81] Ignore DerivedData --- ios/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/.gitignore b/ios/.gitignore index 782a0ed2e..e982d6c69 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -6,6 +6,7 @@ App/build App/Pods App/App/public App/Podfile.lock +DerivedData xcuserdata # Cordova plugins for Capacitor From 0ee6e6758c7dd3ed6a43d103baa0157f299114d4 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 17:03:44 +0800 Subject: [PATCH 35/81] Update the Capacitor Android platform --- .../app/src/main/assets/capacitor.plugins.json | 18 ++++++++++++++++++ package-lock.json | 16 ++++++++-------- package.json | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 android/app/src/main/assets/capacitor.plugins.json diff --git a/android/app/src/main/assets/capacitor.plugins.json b/android/app/src/main/assets/capacitor.plugins.json new file mode 100644 index 000000000..cbf8656a3 --- /dev/null +++ b/android/app/src/main/assets/capacitor.plugins.json @@ -0,0 +1,18 @@ +[ + { + "pkg": "@capacitor-community/bluetooth-le", + "classpath": "com.capacitorjs.community.plugins.bluetoothle.BluetoothLe" + }, + { + "pkg": "@capacitor-community/http", + "classpath": "com.getcapacitor.plugin.http.Http" + }, + { + "pkg": "@capacitor-community/wifi", + "classpath": "com.digaus.capacitor.wifi.Wifi" + }, + { + "pkg": "capacitor-blob-writer", + "classpath": "com.equimaps.capacitorblobwriter.BlobWriter" + } +] diff --git a/package-lock.json b/package-lock.json index 30bd75284..adaafbe25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", "@capacitor-community/http": "^0.3.2", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", - "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", + "@capacitor/android": "^3.4.1", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", "@ionic/angular": "^5.6.11", @@ -2579,12 +2579,11 @@ } }, "node_modules/@capacitor/android": { - "version": "2.4.7", - "resolved": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", - "integrity": "sha512-dJplXIWGBiew3ZILyCoPT/EA1+kTsKvQyYHW5ECboLKgt4AGQC1V3jZUrHMO2UfeGuAZJcI4qDpS7hLVD27mWw==", - "license": "MIT", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.4.1.tgz", + "integrity": "sha512-4qQGEdZTW8W01PTOzSScmx9NBDcsi1GRl32tyYnpQrjdH2f7hI9OX2MLbNkirtOwKNCDeinQfEqqn0hVCkgHag==", "peerDependencies": { - "@capacitor/core": "~2.4.0" + "@capacitor/core": "^3.4.0" } }, "node_modules/@capacitor/cli": { @@ -27004,8 +27003,9 @@ } }, "@capacitor/android": { - "version": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", - "integrity": "sha512-dJplXIWGBiew3ZILyCoPT/EA1+kTsKvQyYHW5ECboLKgt4AGQC1V3jZUrHMO2UfeGuAZJcI4qDpS7hLVD27mWw==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.4.1.tgz", + "integrity": "sha512-4qQGEdZTW8W01PTOzSScmx9NBDcsi1GRl32tyYnpQrjdH2f7hI9OX2MLbNkirtOwKNCDeinQfEqqn0hVCkgHag==", "requires": {} }, "@capacitor/cli": { diff --git a/package.json b/package.json index cae43cc8f..c9140b802 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", "@capacitor-community/http": "^0.3.2", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", - "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-2.4.7-range-request-fix", + "@capacitor/android": "^3.4.1", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", "@ionic/angular": "^5.6.11", From aaa7b9b4a15fdfed42006e3719b7db80c07d2d60 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 12 Feb 2022 17:05:12 +0800 Subject: [PATCH 36/81] Switch to automatic Android plugin loading --- .../capturelite/MainActivity.java | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/android/app/src/main/java/io/numbersprotocol/capturelite/MainActivity.java b/android/app/src/main/java/io/numbersprotocol/capturelite/MainActivity.java index 7570a23b3..c18215d33 100644 --- a/android/app/src/main/java/io/numbersprotocol/capturelite/MainActivity.java +++ b/android/app/src/main/java/io/numbersprotocol/capturelite/MainActivity.java @@ -5,11 +5,6 @@ import com.getcapacitor.BridgeActivity; import com.getcapacitor.Plugin; -import com.equimaps.capacitorblobwriter.BlobWriter; -import com.capacitorjs.community.plugins.bluetoothle.BluetoothLe; -import com.digaus.capacitor.wifi.Wifi; -import com.getcapacitor.plugin.http.Http; - import java.util.ArrayList; import android.content.res.Configuration; import android.webkit.WebSettings; @@ -41,18 +36,4 @@ public void onResume() { super.onResume(); setDarkMode(); } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // Initializes the Bridge - this.init(savedInstanceState, new ArrayList>() {{ - // Additional plugins you've installed go here - add(BlobWriter.class); - add(BluetoothLe.class); - add(Wifi.class); - add(Http.class); - }}); - } } From c4467a186d08260230488fa1ab02fb9db5ca0fb0 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sun, 13 Feb 2022 04:03:32 +0800 Subject: [PATCH 37/81] Update Gradle to 7.0 --- android/build.gradle | 2 +- android/gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 68fcb19d0..62e8b4876 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.0.1' + classpath 'com.android.tools.build:gradle:4.2.0' classpath 'com.google.gms:google-services:4.3.3' // NOTE: Do not place your application dependencies here; they belong diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 6e0b1d215..899981480 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Sep 25 10:04:21 CST 2020 +#Sat Feb 12 17:09:14 CST 2022 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip From dd0e83393df76d0c7d7a9d70c1ebd564504f5933 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sun, 13 Feb 2022 04:06:27 +0800 Subject: [PATCH 38/81] Update Android variables --- android/variables.gradle | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/android/variables.gradle b/android/variables.gradle index 495259486..080ca73a1 100644 --- a/android/variables.gradle +++ b/android/variables.gradle @@ -2,15 +2,13 @@ ext { minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 - androidxAppCompatVersion = '1.1.0' - androidxCoreVersion = '1.2.0' - androidxMaterialVersion = '1.1.0-rc02' - androidxBrowserVersion = '1.2.0' - androidxLocalbroadcastmanagerVersion = '1.0.0' - firebaseMessagingVersion = '20.1.2' - playServicesLocationVersion = '17.0.0' - junitVersion = '4.12' - androidxJunitVersion = '1.1.1' - androidxEspressoCoreVersion = '3.2.0' + androidxActivityVersion = '1.2.0' + androidxAppCompatVersion = '1.2.0' + androidxCoordinatorLayoutVersion = '1.1.0' + androidxCoreVersion = '1.3.2' + androidxFragmentVersion = '1.3.0' + junitVersion = '4.13.1' + androidxJunitVersion = '1.1.2' + androidxEspressoCoreVersion = '3.3.0' cordovaAndroidVersion = '7.0.0' } \ No newline at end of file From 9e9f070e8a95ed97fe12690f3444c9e1a9a08780 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sun, 13 Feb 2022 04:29:57 +0800 Subject: [PATCH 39/81] migrate(version.service.ts): use @capacitor/app to get app version --- package-lock.json | 15 +++++++++++++++ package.json | 1 + src/app/shared/version/version.service.ts | 10 ++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index adaafbe25..224f7f269 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@capacitor-community/http": "^0.3.2", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", + "@capacitor/app": "^1.1.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", "@ionic/angular": "^5.6.11", @@ -2586,6 +2587,14 @@ "@capacitor/core": "^3.4.0" } }, + "node_modules/@capacitor/app": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/app/-/app-1.1.0.tgz", + "integrity": "sha512-CjcMLThYfPBGBexb6Xy98MHA9olduS0OL0X8Ot9z9x5RN/Cx5K5OmlZkGMKOncR2R1h2n/whdO5tmDbjeqS6tw==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/cli": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.4.1.tgz", @@ -27008,6 +27017,12 @@ "integrity": "sha512-4qQGEdZTW8W01PTOzSScmx9NBDcsi1GRl32tyYnpQrjdH2f7hI9OX2MLbNkirtOwKNCDeinQfEqqn0hVCkgHag==", "requires": {} }, + "@capacitor/app": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/app/-/app-1.1.0.tgz", + "integrity": "sha512-CjcMLThYfPBGBexb6Xy98MHA9olduS0OL0X8Ot9z9x5RN/Cx5K5OmlZkGMKOncR2R1h2n/whdO5tmDbjeqS6tw==", + "requires": {} + }, "@capacitor/cli": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.4.1.tgz", diff --git a/package.json b/package.json index c9140b802..abd67c1ee 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@capacitor-community/http": "^0.3.2", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", + "@capacitor/app": "^1.1.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", "@ionic/angular": "^5.6.11", diff --git a/src/app/shared/version/version.service.ts b/src/app/shared/version/version.service.ts index 2683cda57..33cf95076 100644 --- a/src/app/shared/version/version.service.ts +++ b/src/app/shared/version/version.service.ts @@ -1,19 +1,17 @@ import { Injectable } from '@angular/core'; -import { Plugins } from '@capacitor/core'; +import { App } from '@capacitor/app'; import { defer } from 'rxjs'; import { map } from 'rxjs/operators'; import packageInfo from '../../../../package.json'; -const { Device } = Plugins; - @Injectable({ providedIn: 'root', }) export class VersionService { - readonly version$ = defer(() => Device.getInfo()).pipe( + readonly version$ = defer(() => App.getInfo()).pipe( map(info => { - if (info.appVersion === '') return packageInfo.version; - return info.appVersion; + if (info.version === '') return packageInfo.version; + return info.version; }) ); } From 88d925d5784850495fd23d4361b1d3109561eb7d Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:11:06 +0800 Subject: [PATCH 40/81] migrate StoragePlugin to capacitor 3 --- package-lock.json | 15 +++++++++++++++ package.json | 1 + .../capacitor-plugins.module.ts | 4 ++-- .../capacitor-plugins/mock-storage-plugin.ts | 19 ++++++++++++++++++- .../auth/dia-backend-auth.service.ts | 4 ++-- .../preference-manager.service.ts | 2 +- .../capacitor-storage-preferences.spec.ts | 4 +--- .../capacitor-storage-preferences.ts | 2 +- 8 files changed, 41 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 224f7f269..190cfa973 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", + "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", "@ionic/pwa-elements": "^3.0.2", @@ -2667,6 +2668,14 @@ "@capacitor/core": "^3.4.0" } }, + "node_modules/@capacitor/storage": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", + "integrity": "sha512-AqA4KnCQNOmFJ1HuSfmyPf5jz80JY2cX04Uy4j1hpo5ex9bY6W8mUKLsePakTzt4ScDnYuOaXsmusUrpglgPfQ==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", @@ -27079,6 +27088,12 @@ "integrity": "sha512-ycFCyKI8DsgedVg7PW5MpCVgqFuD0PMHQGVfC5ichXc2C/jAATX32EVdEMCB0N3guKoH2k6T3Efwg59+Fcdx2w==", "requires": {} }, + "@capacitor/storage": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", + "integrity": "sha512-AqA4KnCQNOmFJ1HuSfmyPf5jz80JY2cX04Uy4j1hpo5ex9bY6W8mUKLsePakTzt4ScDnYuOaXsmusUrpglgPfQ==", + "requires": {} + }, "@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", diff --git a/package.json b/package.json index abd67c1ee..4d504b12d 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", + "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", "@ionic/pwa-elements": "^3.0.2", diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index 2622b80ba..68096e048 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -8,8 +8,8 @@ import { NetworkPlugin, Plugins, PushNotificationsPlugin, - StoragePlugin, } from '@capacitor/core'; +import { Storage, StoragePlugin } from '@capacitor/storage'; export const APP_PLUGIN = new InjectionToken('APP_PLUGIN'); export const CAMERA_PLUGIN = new InjectionToken('CAMERA_PLUGIN'); @@ -58,7 +58,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = }, { provide: STORAGE_PLUGIN, - useValue: Plugins.Storage, + useValue: Storage, }, { provide: PUSH_NOTIFICATIONS_PLUGIN, diff --git a/src/app/shared/capacitor-plugins/mock-storage-plugin.ts b/src/app/shared/capacitor-plugins/mock-storage-plugin.ts index 23d6fcd07..1bac15203 100644 --- a/src/app/shared/capacitor-plugins/mock-storage-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-storage-plugin.ts @@ -1,6 +1,11 @@ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { PluginListenerHandle, StoragePlugin } from '@capacitor/core'; +import { PluginListenerHandle } from '@capacitor/core'; +import { + ConfigureOptions, + MigrateResult, + StoragePlugin, +} from '@capacitor/storage'; export class MockStoragePlugin implements StoragePlugin { private readonly map = new Map(); @@ -25,6 +30,18 @@ export class MockStoragePlugin implements StoragePlugin { throw new Error('Method not implemented.'); } + async configure(_options: ConfigureOptions): Promise { + throw new Error('Method not implemented.'); + } + + async migrate(): Promise { + throw new Error('Method not implemented.'); + } + + async removeOld(): Promise { + throw new Error('Method not implemented.'); + } + addListener( _eventName: string, _listenerFunc: () => any diff --git a/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts b/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts index 5f8d359d9..abfb45ee2 100644 --- a/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts +++ b/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts @@ -1,6 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Plugins } from '@capacitor/core'; +import { Storage } from '@capacitor/storage'; import { isEqual, reject } from 'lodash-es'; import { combineLatest, defer, forkJoin, Observable, Subject } from 'rxjs'; import { @@ -18,8 +19,7 @@ import { LanguageService } from '../../language/service/language.service'; import { PreferenceManager } from '../../preference-manager/preference-manager.service'; import { PushNotificationService } from '../../push-notification/push-notification.service'; import { BASE_URL, TRUSTED_CLIENT_KEY } from '../secret'; - -const { Device, Storage } = Plugins; +const { Device } = Plugins; @Injectable({ providedIn: 'root', diff --git a/src/app/shared/preference-manager/preference-manager.service.ts b/src/app/shared/preference-manager/preference-manager.service.ts index eb366d663..a6634c8a6 100644 --- a/src/app/shared/preference-manager/preference-manager.service.ts +++ b/src/app/shared/preference-manager/preference-manager.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable } from '@angular/core'; -import { StoragePlugin } from '@capacitor/core'; +import { StoragePlugin } from '@capacitor/storage'; import { STORAGE_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; import { CapacitorStoragePreferences } from './preferences/capacitor-storage-preferences/capacitor-storage-preferences'; import { Preferences } from './preferences/preferences'; diff --git a/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.spec.ts b/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.spec.ts index ba9a853bc..98d05b2a6 100644 --- a/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.spec.ts +++ b/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { Plugins } from '@capacitor/core'; +import { Storage } from '@capacitor/storage'; import { defer, zip } from 'rxjs'; import { concatMapTo, first } from 'rxjs/operators'; import { STORAGE_PLUGIN } from '../../../capacitor-plugins/capacitor-plugins.module'; @@ -7,8 +7,6 @@ import { SharedTestingModule } from '../../../shared-testing.module'; import { Preferences } from '../preferences'; import { CapacitorStoragePreferences } from './capacitor-storage-preferences'; -const { Storage } = Plugins; - describe('CapacitorStoragePreferences', () => { let preferences: Preferences; const id = 'id'; diff --git a/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.ts b/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.ts index 93fdc8ea9..c57828ee9 100644 --- a/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.ts +++ b/src/app/shared/preference-manager/preferences/capacitor-storage-preferences/capacitor-storage-preferences.ts @@ -1,4 +1,4 @@ -import { StoragePlugin } from '@capacitor/core'; +import { StoragePlugin } from '@capacitor/storage'; import { Mutex } from 'async-mutex'; import { isEqual } from 'lodash-es'; import { BehaviorSubject, defer, Observable } from 'rxjs'; From 07b51d326fb5b6ec0b710e7e874999848b25c28a Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 13:02:32 +0800 Subject: [PATCH 41/81] migrate NetworkPlugin to capacitor 3 --- package-lock.json | 15 +++++++++++++++ package.json | 1 + .../capacitor-plugins.module.ts | 4 ++-- .../capacitor-plugins/mock-network-plugin.ts | 18 +++++++++--------- src/app/shared/network/network.service.ts | 4 ++-- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 190cfa973..fde1deab5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", + "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", @@ -2668,6 +2669,14 @@ "@capacitor/core": "^3.4.0" } }, + "node_modules/@capacitor/network": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/network/-/network-1.0.7.tgz", + "integrity": "sha512-Le1pcXlBB6Vsz+9Y5jkwcoFONq93Fm06T+EXfH52khrIH61k5rOYRM1HGR5Q0hu6pDKqA9jM/tU06h2kqsJteA==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/storage": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", @@ -27088,6 +27097,12 @@ "integrity": "sha512-ycFCyKI8DsgedVg7PW5MpCVgqFuD0PMHQGVfC5ichXc2C/jAATX32EVdEMCB0N3guKoH2k6T3Efwg59+Fcdx2w==", "requires": {} }, + "@capacitor/network": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/network/-/network-1.0.7.tgz", + "integrity": "sha512-Le1pcXlBB6Vsz+9Y5jkwcoFONq93Fm06T+EXfH52khrIH61k5rOYRM1HGR5Q0hu6pDKqA9jM/tU06h2kqsJteA==", + "requires": {} + }, "@capacitor/storage": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", diff --git a/package.json b/package.json index 4d504b12d..b79dc6b3c 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", + "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index 68096e048..357531fce 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -5,10 +5,10 @@ import { FilesystemPlugin, GeolocationPlugin, LocalNotificationsPlugin, - NetworkPlugin, Plugins, PushNotificationsPlugin, } from '@capacitor/core'; +import { Network, NetworkPlugin } from '@capacitor/network'; import { Storage, StoragePlugin } from '@capacitor/storage'; export const APP_PLUGIN = new InjectionToken('APP_PLUGIN'); @@ -54,7 +54,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = }, { provide: NETOWRK_PLUGIN, - useValue: Plugins.Network, + useValue: Network, }, { provide: STORAGE_PLUGIN, diff --git a/src/app/shared/capacitor-plugins/mock-network-plugin.ts b/src/app/shared/capacitor-plugins/mock-network-plugin.ts index be8ce42a6..3b3dc7f23 100644 --- a/src/app/shared/capacitor-plugins/mock-network-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-network-plugin.ts @@ -1,9 +1,10 @@ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ +import { PluginListenerHandle } from '@capacitor/core'; import { + ConnectionStatus as NetworkStatus, + ConnectionStatusChangeListener, NetworkPlugin, - NetworkStatus, - PluginListenerHandle, -} from '@capacitor/core'; +} from '@capacitor/network'; export class MockNetworkPlugin implements NetworkPlugin { async getStatus(): Promise { @@ -11,14 +12,13 @@ export class MockNetworkPlugin implements NetworkPlugin { } addListener( - _eventName: string, - _listenerFunc: (status: NetworkStatus) => any - ): PluginListenerHandle { - // eslint-disable-next-line @typescript-eslint/no-empty-function - return { remove: () => {} }; + _eventName: 'networkStatusChange', + _listenerFunc: ConnectionStatusChangeListener + ): Promise & PluginListenerHandle { + throw new Error('Method not implemented.'); } - removeAllListeners() { + async removeAllListeners(): Promise { throw new Error('Method not implemented.'); } } diff --git a/src/app/shared/network/network.service.ts b/src/app/shared/network/network.service.ts index 6f899c462..867af69e1 100644 --- a/src/app/shared/network/network.service.ts +++ b/src/app/shared/network/network.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable, NgZone } from '@angular/core'; -import { NetworkPlugin, NetworkStatus } from '@capacitor/core'; +import { ConnectionStatus, NetworkPlugin } from '@capacitor/network'; import { defer, merge, ReplaySubject } from 'rxjs'; import { distinctUntilChanged, pluck } from 'rxjs/operators'; import { NETOWRK_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; @@ -8,7 +8,7 @@ import { NETOWRK_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; providedIn: 'root', }) export class NetworkService { - private readonly status$ = new ReplaySubject(1); + private readonly status$ = new ReplaySubject(1); readonly connected$ = merge( defer(() => this.networkPlugin.getStatus()), From fd20009fd2f6139546bc1ce4f872b994cb5a2a00 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 13:13:31 +0800 Subject: [PATCH 42/81] migrate AppPlugin to capacitor 3 --- src/app/shared/camera/camera.service.ts | 2 +- .../capacitor-plugins.module.ts | 4 +- .../capacitor-plugins/mock-app-plugin.ts | 45 ++++++++++++++++--- .../dia-backend-notification.service.ts | 3 +- 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/app/shared/camera/camera.service.ts b/src/app/shared/camera/camera.service.ts index a8b427222..88ada93ad 100644 --- a/src/app/shared/camera/camera.service.ts +++ b/src/app/shared/camera/camera.service.ts @@ -1,6 +1,6 @@ import { Inject, Injectable } from '@angular/core'; +import { AppPlugin } from '@capacitor/app'; import { - AppPlugin, CameraPhoto, CameraPlugin, CameraResultType, diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index 357531fce..107c2508a 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -1,6 +1,6 @@ import { InjectionToken, NgModule } from '@angular/core'; +import { App, AppPlugin } from '@capacitor/app'; import { - AppPlugin, CameraPlugin, FilesystemPlugin, GeolocationPlugin, @@ -34,7 +34,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = providers: [ { provide: APP_PLUGIN, - useValue: Plugins.App, + useValue: App, }, { provide: CAMERA_PLUGIN, diff --git a/src/app/shared/capacitor-plugins/mock-app-plugin.ts b/src/app/shared/capacitor-plugins/mock-app-plugin.ts index d646b77c9..00193f4e2 100644 --- a/src/app/shared/capacitor-plugins/mock-app-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-app-plugin.ts @@ -1,18 +1,51 @@ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ import { + AppInfo, AppLaunchUrl, AppPlugin, AppState, - PluginListenerHandle, -} from '@capacitor/core'; + BackButtonListener, + RestoredListener, + StateChangeListener, + URLOpenListener, +} from '@capacitor/app'; +import { PluginListenerHandle } from '@capacitor/core'; export class MockAppPlugin implements AppPlugin { - addListener(): PluginListenerHandle { - return { remove: () => undefined }; + async getInfo(): Promise { + throw new Error('Method not implemented.'); } - // eslint-disable-next-line @typescript-eslint/no-empty-function - removeAllListeners(): void {} + async minimizeApp(): Promise { + throw new Error('Method not implemented.'); + } + + addListener( + eventName: 'appStateChange', + listenerFunc: StateChangeListener + ): Promise & PluginListenerHandle; + addListener( + eventName: 'appUrlOpen', + listenerFunc: URLOpenListener + ): Promise & PluginListenerHandle; + addListener( + eventName: 'appRestoredResult', + listenerFunc: RestoredListener + ): Promise & PluginListenerHandle; + addListener( + eventName: 'backButton', + listenerFunc: BackButtonListener + ): Promise & PluginListenerHandle; + addListener( + _eventName: any, + _listenerFunc: any + ): Promise & PluginListenerHandle { + throw new Error('Method not implemented.'); + } + + async removeAllListeners(): Promise { + throw new Error('Method not implemented.'); + } exitApp(): never { throw new Error('exited'); diff --git a/src/app/shared/dia-backend/notification/dia-backend-notification.service.ts b/src/app/shared/dia-backend/notification/dia-backend-notification.service.ts index be9418f0f..eceeb8e4a 100644 --- a/src/app/shared/dia-backend/notification/dia-backend-notification.service.ts +++ b/src/app/shared/dia-backend/notification/dia-backend-notification.service.ts @@ -1,5 +1,6 @@ import { Inject, Injectable } from '@angular/core'; -import { AppPlugin, Capacitor } from '@capacitor/core'; +import { AppPlugin } from '@capacitor/app'; +import { Capacitor } from '@capacitor/core'; import { TranslocoService } from '@ngneat/transloco'; import { combineLatest, defer, EMPTY, Observable } from 'rxjs'; import { concatMap, filter, tap } from 'rxjs/operators'; From 74ba6cc030eac332437e2f69d054b82047d1a1fd Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 13:14:03 +0800 Subject: [PATCH 43/81] migrate CameraPlugin to capacitor 3 --- package-lock.json | 15 +++++++++++ package.json | 1 + src/app/shared/camera/camera.service.ts | 4 +-- .../capacitor-plugins.module.ts | 4 +-- .../capacitor-plugins/mock-camera-plugin.ts | 25 +++++++++++++++---- 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index fde1deab5..ab3c93788 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", + "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", "@capacitor/network": "^1.0.7", @@ -2597,6 +2598,14 @@ "@capacitor/core": "^3.0.0" } }, + "node_modules/@capacitor/camera": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-1.3.0.tgz", + "integrity": "sha512-qulUOyrJS0TZJCjCB/88nvYiCEOAsIO4VKY0ZG4TEkytLWc1/RbevuGfUazDH94pU1wRoIO24zcc4rA+cZbKtw==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/cli": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.4.1.tgz", @@ -27041,6 +27050,12 @@ "integrity": "sha512-CjcMLThYfPBGBexb6Xy98MHA9olduS0OL0X8Ot9z9x5RN/Cx5K5OmlZkGMKOncR2R1h2n/whdO5tmDbjeqS6tw==", "requires": {} }, + "@capacitor/camera": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-1.3.0.tgz", + "integrity": "sha512-qulUOyrJS0TZJCjCB/88nvYiCEOAsIO4VKY0ZG4TEkytLWc1/RbevuGfUazDH94pU1wRoIO24zcc4rA+cZbKtw==", + "requires": {} + }, "@capacitor/cli": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.4.1.tgz", diff --git a/package.json b/package.json index b79dc6b3c..21be33b40 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", + "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", "@capacitor/ios": "^3.4.1", "@capacitor/network": "^1.0.7", diff --git a/src/app/shared/camera/camera.service.ts b/src/app/shared/camera/camera.service.ts index 88ada93ad..42ed05359 100644 --- a/src/app/shared/camera/camera.service.ts +++ b/src/app/shared/camera/camera.service.ts @@ -1,11 +1,11 @@ import { Inject, Injectable } from '@angular/core'; import { AppPlugin } from '@capacitor/app'; import { - CameraPhoto, CameraPlugin, CameraResultType, CameraSource, -} from '@capacitor/core'; + Photo as CameraPhoto, +} from '@capacitor/camera'; import { Subject } from 'rxjs'; import { blobToBase64 } from '../../utils/encoding/encoding'; import { fromExtension, MimeType } from '../../utils/mime-type'; diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index 107c2508a..2cd391782 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -1,7 +1,7 @@ import { InjectionToken, NgModule } from '@angular/core'; import { App, AppPlugin } from '@capacitor/app'; +import { Camera, CameraPlugin } from '@capacitor/camera'; import { - CameraPlugin, FilesystemPlugin, GeolocationPlugin, LocalNotificationsPlugin, @@ -38,7 +38,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = }, { provide: CAMERA_PLUGIN, - useValue: Plugins.Camera, + useValue: Camera, }, { provide: GEOLOCATION_PLUGIN, diff --git a/src/app/shared/capacitor-plugins/mock-camera-plugin.ts b/src/app/shared/capacitor-plugins/mock-camera-plugin.ts index ebf1be0b0..4d6e647e3 100644 --- a/src/app/shared/capacitor-plugins/mock-camera-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-camera-plugin.ts @@ -1,13 +1,28 @@ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ import { - CameraOptions, - CameraPhoto, CameraPlugin, - PluginListenerHandle, -} from '@capacitor/core'; + CameraPluginPermissions, + GalleryImageOptions, + GalleryPhotos, + ImageOptions, + PermissionStatus, + Photo as CameraPhoto, +} from '@capacitor/camera'; +import { PluginListenerHandle } from '@capacitor/core'; export class MockCameraPlugin implements CameraPlugin { - async getPhoto(_options: CameraOptions): Promise { + async pickImages(_: GalleryImageOptions): Promise { + throw new Error('Method not implemented.'); + } + async checkPermissions(): Promise { + throw new Error('Method not implemented.'); + } + async requestPermissions( + _?: CameraPluginPermissions + ): Promise { + throw new Error('Method not implemented.'); + } + async getPhoto(_options: ImageOptions): Promise { throw new Error('Method not implemented.'); } From 3921937db9c93e90058989b96da02479a539c374 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 13:17:20 +0800 Subject: [PATCH 44/81] migrate FilesystemPlugin to capacitor 3 --- package-lock.json | 15 ++++++ package.json | 1 + .../go-pro/services/go-pro-media.service.ts | 7 ++- .../capacitor-plugins.module.ts | 4 +- .../mock-filesystem-plugin.ts | 47 ++++++++++--------- src/app/shared/database/database.service.ts | 2 +- .../capacitor-filesystem-table.spec.ts | 4 +- .../capacitor-filesystem-table.ts | 6 +-- .../media-store/media-store.service.spec.ts | 4 +- .../media/media-store/media-store.service.ts | 6 +-- 10 files changed, 54 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index ab3c93788..600cac8c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", + "@capacitor/filesystem": "^1.1.0", "@capacitor/ios": "^3.4.1", "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", @@ -2670,6 +2671,14 @@ "tslib": "^2.1.0" } }, + "node_modules/@capacitor/filesystem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-1.1.0.tgz", + "integrity": "sha512-8O3UuvL8HNUEJvZnmn8yUmvgB1evtXfcF0oxIo3YbSlylqywJwS3JTiuhKmsvSxCdpbTy8IaTsutVh3gZgWbKg==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/ios": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.4.1.tgz", @@ -27106,6 +27115,12 @@ "tslib": "^2.1.0" } }, + "@capacitor/filesystem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-1.1.0.tgz", + "integrity": "sha512-8O3UuvL8HNUEJvZnmn8yUmvgB1evtXfcF0oxIo3YbSlylqywJwS3JTiuhKmsvSxCdpbTy8IaTsutVh3gZgWbKg==", + "requires": {} + }, "@capacitor/ios": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.4.1.tgz", diff --git a/package.json b/package.json index 21be33b40..984db9122 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", + "@capacitor/filesystem": "^1.1.0", "@capacitor/ios": "^3.4.1", "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", diff --git a/src/app/features/settings/go-pro/services/go-pro-media.service.ts b/src/app/features/settings/go-pro/services/go-pro-media.service.ts index 72226eb99..e2c47ca9d 100644 --- a/src/app/features/settings/go-pro/services/go-pro-media.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-media.service.ts @@ -2,12 +2,11 @@ import { HttpClient } from '@angular/common/http'; import { Inject, Injectable } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import '@capacitor-community/http'; +import { Capacitor, Plugins } from '@capacitor/core'; import { - Capacitor, - FilesystemDirectory, + Directory as FilesystemDirectory, FilesystemPlugin, - Plugins, -} from '@capacitor/core'; +} from '@capacitor/filesystem'; import { isPlatform } from '@ionic/core'; import { detectFileTypeFromUrl, diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index 2cd391782..f69ce6587 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -2,12 +2,12 @@ import { InjectionToken, NgModule } from '@angular/core'; import { App, AppPlugin } from '@capacitor/app'; import { Camera, CameraPlugin } from '@capacitor/camera'; import { - FilesystemPlugin, GeolocationPlugin, LocalNotificationsPlugin, Plugins, PushNotificationsPlugin, } from '@capacitor/core'; +import { Filesystem, FilesystemPlugin } from '@capacitor/filesystem'; import { Network, NetworkPlugin } from '@capacitor/network'; import { Storage, StoragePlugin } from '@capacitor/storage'; @@ -46,7 +46,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = }, { provide: FILESYSTEM_PLUGIN, - useValue: Plugins.Filesystem, + useValue: Filesystem, }, { provide: LOCAL_NOTIFICATIONS_PLUGIN, diff --git a/src/app/shared/capacitor-plugins/mock-filesystem-plugin.ts b/src/app/shared/capacitor-plugins/mock-filesystem-plugin.ts index 1ecddb1f7..dd99f35c9 100644 --- a/src/app/shared/capacitor-plugins/mock-filesystem-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-filesystem-plugin.ts @@ -1,37 +1,40 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ +import { PluginListenerHandle } from '@capacitor/core'; import { + AppendFileOptions as FileAppendOptions, CopyOptions, - CopyResult, - FileAppendOptions, - FileAppendResult, - FileDeleteOptions, - FileDeleteResult, - FileReadOptions, - FileReadResult, + DeleteFileOptions as FileDeleteOptions, FilesystemPlugin, - FileWriteOptions, - FileWriteResult, GetUriOptions, GetUriResult, MkdirOptions, - MkdirResult, - PluginListenerHandle, + PermissionStatus, ReaddirOptions, ReaddirResult, + ReadFileOptions as FileReadOptions, + ReadFileResult as FileReadResult, RenameOptions, - RenameResult, RmdirOptions, - RmdirResult, StatOptions, StatResult, -} from '@capacitor/core'; + WriteFileOptions as FileWriteOptions, + WriteFileResult as FileWriteResult, +} from '@capacitor/filesystem'; import { groupBy } from 'lodash-es'; import { base64ToString, stringToBase64 } from '../../utils/encoding/encoding'; export class MockFilesystemPlugin implements FilesystemPlugin { private readonly files = new Map(); + async checkPermissions(): Promise { + throw new Error('Method not implemented.'); + } + + async requestPermissions(): Promise { + throw new Error('Method not implemented.'); + } + async readFile(options: FileReadOptions): Promise { const path = `${options.directory ?? ''}/${options.path}`; if (!this.files.has(path)) { @@ -55,24 +58,22 @@ export class MockFilesystemPlugin implements FilesystemPlugin { return { uri: path }; } - async appendFile(options: FileAppendOptions): Promise { + async appendFile(options: FileAppendOptions): Promise { const result = await this.readFile(options); const newData = `${result.data}${options.data}`; await this.writeFile({ ...options, data: newData }); - return {}; } - async deleteFile(options: FileDeleteOptions): Promise { + async deleteFile(options: FileDeleteOptions): Promise { const path = `${options.directory ?? ''}/${options.path}`; this.files.delete(path); - return {}; } - async mkdir(_: MkdirOptions): Promise { - return {}; + async mkdir(_: MkdirOptions): Promise { + return; } - async rmdir(_: RmdirOptions): Promise { + async rmdir(_: RmdirOptions): Promise { throw new Error('Method not implemented.'); } @@ -101,11 +102,11 @@ export class MockFilesystemPlugin implements FilesystemPlugin { throw new Error('Method not implemented.'); } - async rename(_: RenameOptions): Promise { + async rename(_: RenameOptions): Promise { throw new Error('Method not implemented.'); } - async copy(_: CopyOptions): Promise { + async copy(_: CopyOptions): Promise { throw new Error('Method not implemented.'); } diff --git a/src/app/shared/database/database.service.ts b/src/app/shared/database/database.service.ts index ab1a59fba..3090dd041 100644 --- a/src/app/shared/database/database.service.ts +++ b/src/app/shared/database/database.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable } from '@angular/core'; -import { FilesystemPlugin } from '@capacitor/core'; +import { FilesystemPlugin } from '@capacitor/filesystem'; import { FILESYSTEM_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; import { CapacitorFilesystemTable } from './table/capacitor-filesystem-table/capacitor-filesystem-table'; import { Table, Tuple } from './table/table'; diff --git a/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.spec.ts b/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.spec.ts index 4dd30d0f7..1c3407039 100644 --- a/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.spec.ts +++ b/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.spec.ts @@ -1,12 +1,10 @@ /* eslint-disable @typescript-eslint/no-magic-numbers */ -import { Plugins } from '@capacitor/core'; +import { Filesystem } from '@capacitor/filesystem'; import { defer } from 'rxjs'; import { concatMapTo } from 'rxjs/operators'; import { OnConflictStrategy, Table, Tuple } from '../table'; import { CapacitorFilesystemTable } from './capacitor-filesystem-table'; -const { Filesystem } = Plugins; - describe('CapacitorFilesystemTable', () => { let table: Table; diff --git a/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.ts b/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.ts index 769a06763..fb69638f4 100644 --- a/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.ts +++ b/src/app/shared/database/table/capacitor-filesystem-table/capacitor-filesystem-table.ts @@ -1,9 +1,9 @@ /* eslint-disable rxjs/no-subject-value */ import { - FilesystemDirectory, - FilesystemEncoding, + Directory as FilesystemDirectory, + Encoding as FilesystemEncoding, FilesystemPlugin, -} from '@capacitor/core'; +} from '@capacitor/filesystem'; import { Mutex } from 'async-mutex'; import { differenceWith, intersectionWith, isEqual, uniqWith } from 'lodash-es'; import { BehaviorSubject, defer } from 'rxjs'; diff --git a/src/app/shared/media/media-store/media-store.service.spec.ts b/src/app/shared/media/media-store/media-store.service.spec.ts index 3bba5e9bf..f05af61f4 100644 --- a/src/app/shared/media/media-store/media-store.service.spec.ts +++ b/src/app/shared/media/media-store/media-store.service.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { Plugins } from '@capacitor/core'; +import { Filesystem } from '@capacitor/filesystem'; import { defer } from 'rxjs'; import { concatMap, first } from 'rxjs/operators'; import { stringToBase64 } from '../../../utils/encoding/encoding'; @@ -8,8 +8,6 @@ import { FILESYSTEM_PLUGIN } from '../../capacitor-plugins/capacitor-plugins.mod import { SharedTestingModule } from '../../shared-testing.module'; import { MediaStore } from './media-store.service'; -const { Filesystem } = Plugins; - describe('MediaStore', () => { let store: MediaStore; diff --git a/src/app/shared/media/media-store/media-store.service.ts b/src/app/shared/media/media-store/media-store.service.ts index d903448b4..4f2cf819e 100644 --- a/src/app/shared/media/media-store/media-store.service.ts +++ b/src/app/shared/media/media-store/media-store.service.ts @@ -1,10 +1,10 @@ import { HttpClient } from '@angular/common/http'; import { Inject, Injectable } from '@angular/core'; +import { Capacitor } from '@capacitor/core'; import { - Capacitor, - FilesystemDirectory, + Directory as FilesystemDirectory, FilesystemPlugin, -} from '@capacitor/core'; +} from '@capacitor/filesystem'; import { Mutex } from 'async-mutex'; import { writeFile } from 'capacitor-blob-writer'; import Compressor from 'compressorjs'; From 3a6101c402082aacdcf500a8cb85cc2c8738fa0e Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 13:18:59 +0800 Subject: [PATCH 45/81] migrate GeolocationPlugin to capacitor 3 --- package-lock.json | 15 +++++++++ package.json | 1 + .../capacitor-plugins.module.ts | 4 +-- .../mock-geolocation-plugin.ts | 32 ++++++++++++++----- .../shared/geolocation/geolocation.service.ts | 2 +- 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 600cac8c8..be9135534 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", "@capacitor/filesystem": "^1.1.0", + "@capacitor/geolocation": "^1.3.1", "@capacitor/ios": "^3.4.1", "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", @@ -2679,6 +2680,14 @@ "@capacitor/core": "^3.0.0" } }, + "node_modules/@capacitor/geolocation": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@capacitor/geolocation/-/geolocation-1.3.1.tgz", + "integrity": "sha512-3u9Hu4E0VBMa6r0d2t9MENDIR+bv5Tf144uPmb2Bl7XLQeFwvu4BSp2neNq39x58PvcROPMNX1BOTSGpQep+1Q==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/ios": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.4.1.tgz", @@ -27121,6 +27130,12 @@ "integrity": "sha512-8O3UuvL8HNUEJvZnmn8yUmvgB1evtXfcF0oxIo3YbSlylqywJwS3JTiuhKmsvSxCdpbTy8IaTsutVh3gZgWbKg==", "requires": {} }, + "@capacitor/geolocation": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@capacitor/geolocation/-/geolocation-1.3.1.tgz", + "integrity": "sha512-3u9Hu4E0VBMa6r0d2t9MENDIR+bv5Tf144uPmb2Bl7XLQeFwvu4BSp2neNq39x58PvcROPMNX1BOTSGpQep+1Q==", + "requires": {} + }, "@capacitor/ios": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.4.1.tgz", diff --git a/package.json b/package.json index 984db9122..ad632be5a 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", "@capacitor/filesystem": "^1.1.0", + "@capacitor/geolocation": "^1.3.1", "@capacitor/ios": "^3.4.1", "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index f69ce6587..0eb9d3a6f 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -2,12 +2,12 @@ import { InjectionToken, NgModule } from '@angular/core'; import { App, AppPlugin } from '@capacitor/app'; import { Camera, CameraPlugin } from '@capacitor/camera'; import { - GeolocationPlugin, LocalNotificationsPlugin, Plugins, PushNotificationsPlugin, } from '@capacitor/core'; import { Filesystem, FilesystemPlugin } from '@capacitor/filesystem'; +import { Geolocation, GeolocationPlugin } from '@capacitor/geolocation'; import { Network, NetworkPlugin } from '@capacitor/network'; import { Storage, StoragePlugin } from '@capacitor/storage'; @@ -42,7 +42,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = }, { provide: GEOLOCATION_PLUGIN, - useValue: Plugins.Geolocation, + useValue: Geolocation, }, { provide: FILESYSTEM_PLUGIN, diff --git a/src/app/shared/capacitor-plugins/mock-geolocation-plugin.ts b/src/app/shared/capacitor-plugins/mock-geolocation-plugin.ts index 18dd98fd9..2ed3cc19f 100644 --- a/src/app/shared/capacitor-plugins/mock-geolocation-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-geolocation-plugin.ts @@ -1,13 +1,25 @@ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ +import { PluginListenerHandle } from '@capacitor/core'; import { - GeolocationOptions, GeolocationPlugin, - GeolocationPosition, - GeolocationWatchCallback, - PluginListenerHandle, -} from '@capacitor/core'; + GeolocationPluginPermissions, + PermissionStatus, + Position as GeolocationPosition, + PositionOptions as GeolocationOptions, + WatchPositionCallback, +} from '@capacitor/geolocation'; export class MockGeolocationPlugin implements GeolocationPlugin { + async checkPermissions(): Promise { + throw new Error('Method not implemented.'); + } + + async requestPermissions( + _permissions?: GeolocationPluginPermissions + ): Promise { + throw new Error('Method not implemented.'); + } + async getCurrentPosition( _options?: GeolocationOptions ): Promise { @@ -17,14 +29,18 @@ export class MockGeolocationPlugin implements GeolocationPlugin { latitude: 0, longitude: 0, accuracy: 0, + altitudeAccuracy: 0, + altitude: 0, + heading: 0, + speed: 0, }, }; } - watchPosition( + async watchPosition( _options: GeolocationOptions, - _callback: GeolocationWatchCallback - ): string { + _callback: WatchPositionCallback + ): Promise { throw new Error('Method not implemented.'); } diff --git a/src/app/shared/geolocation/geolocation.service.ts b/src/app/shared/geolocation/geolocation.service.ts index 60d392c1b..62f1efb4e 100644 --- a/src/app/shared/geolocation/geolocation.service.ts +++ b/src/app/shared/geolocation/geolocation.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable } from '@angular/core'; -import { GeolocationPlugin } from '@capacitor/core'; +import { GeolocationPlugin } from '@capacitor/geolocation'; import { GEOLOCATION_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; import { BaseError } from '../error/errors'; From 8021bf96abe42f39cb4c2130ca1c5fb7aed0bfb1 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:12:35 +0800 Subject: [PATCH 46/81] migrate LocalNotificationsPlugin to capacitor 3 --- package-lock.json | 15 ++++++ package.json | 1 + .../capacitor-plugins.module.ts | 12 ++--- .../mock-local-notifications-plugin.ts | 48 +++++++++---------- .../notification/notification-item.spec.ts | 7 +-- .../shared/notification/notification-item.ts | 5 +- .../notification/notification.service.spec.ts | 4 +- .../notification/notification.service.ts | 4 +- 8 files changed, 57 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index be9135534..da5ff9bdb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@capacitor/filesystem": "^1.1.0", "@capacitor/geolocation": "^1.3.1", "@capacitor/ios": "^3.4.1", + "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", @@ -2696,6 +2697,14 @@ "@capacitor/core": "^3.4.0" } }, + "node_modules/@capacitor/local-notifications": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/local-notifications/-/local-notifications-1.1.0.tgz", + "integrity": "sha512-l6S9rBylxGPq/U+xpJzZcOL4l2s8I2Igq7uDTidR4imIxxX3bLRz9nDSQREWsbQkFx7ALFm/5Y8PJGz2C6qKPw==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/network": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@capacitor/network/-/network-1.0.7.tgz", @@ -27142,6 +27151,12 @@ "integrity": "sha512-ycFCyKI8DsgedVg7PW5MpCVgqFuD0PMHQGVfC5ichXc2C/jAATX32EVdEMCB0N3guKoH2k6T3Efwg59+Fcdx2w==", "requires": {} }, + "@capacitor/local-notifications": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/local-notifications/-/local-notifications-1.1.0.tgz", + "integrity": "sha512-l6S9rBylxGPq/U+xpJzZcOL4l2s8I2Igq7uDTidR4imIxxX3bLRz9nDSQREWsbQkFx7ALFm/5Y8PJGz2C6qKPw==", + "requires": {} + }, "@capacitor/network": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@capacitor/network/-/network-1.0.7.tgz", diff --git a/package.json b/package.json index ad632be5a..481472ead 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@capacitor/filesystem": "^1.1.0", "@capacitor/geolocation": "^1.3.1", "@capacitor/ios": "^3.4.1", + "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index 0eb9d3a6f..7c4afbbd7 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -1,13 +1,13 @@ import { InjectionToken, NgModule } from '@angular/core'; import { App, AppPlugin } from '@capacitor/app'; import { Camera, CameraPlugin } from '@capacitor/camera'; -import { - LocalNotificationsPlugin, - Plugins, - PushNotificationsPlugin, -} from '@capacitor/core'; +import { Plugins, PushNotificationsPlugin } from '@capacitor/core'; import { Filesystem, FilesystemPlugin } from '@capacitor/filesystem'; import { Geolocation, GeolocationPlugin } from '@capacitor/geolocation'; +import { + LocalNotifications, + LocalNotificationsPlugin, +} from '@capacitor/local-notifications'; import { Network, NetworkPlugin } from '@capacitor/network'; import { Storage, StoragePlugin } from '@capacitor/storage'; @@ -50,7 +50,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = }, { provide: LOCAL_NOTIFICATIONS_PLUGIN, - useValue: Plugins.LocalNotifications, + useValue: LocalNotifications, }, { provide: NETOWRK_PLUGIN, diff --git a/src/app/shared/capacitor-plugins/mock-local-notifications-plugin.ts b/src/app/shared/capacitor-plugins/mock-local-notifications-plugin.ts index beee14c26..096a9dd4b 100644 --- a/src/app/shared/capacitor-plugins/mock-local-notifications-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-local-notifications-plugin.ts @@ -1,18 +1,18 @@ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ +import { PluginListenerHandle } from '@capacitor/core'; import { - LocalNotification, - LocalNotificationActionPerformed, - LocalNotificationActionType, - LocalNotificationEnabledResult, - LocalNotificationPendingList, - LocalNotificationScheduleResult, + ActionPerformed as LocalNotificationActionPerformed, + ActionType as LocalNotificationActionType, + Channel as NotificationChannel, + EnabledResult as LocalNotificationEnabledResult, + ListChannelsResult as NotificationChannelList, + LocalNotificationSchema as LocalNotification, LocalNotificationsPlugin, - NotificationChannel, - NotificationChannelList, - NotificationPermissionResponse, - PluginListenerHandle, -} from '@capacitor/core'; + PendingResult as LocalNotificationPendingList, + PermissionStatus, + ScheduleResult as LocalNotificationScheduleResult, +} from '@capacitor/local-notifications'; export class MockLocalNotificationsPlugin implements LocalNotificationsPlugin { async schedule(options: { @@ -20,7 +20,7 @@ export class MockLocalNotificationsPlugin implements LocalNotificationsPlugin { }): Promise { return { notifications: options.notifications.map(notification => ({ - id: `${notification.id}`, + id: notification.id, })), }; } @@ -55,30 +55,30 @@ export class MockLocalNotificationsPlugin implements LocalNotificationsPlugin { throw new Error('Method not implemented.'); } - async requestPermission(): Promise { - return { granted: true }; + async checkPermissions(): Promise { + throw new Error('Method not implemented.'); + } + + async requestPermissions(): Promise { + return { display: 'granted' }; } addListener( eventName: 'localNotificationReceived', listenerFunc: (notification: LocalNotification) => void - ): PluginListenerHandle; + ): Promise & PluginListenerHandle; addListener( eventName: 'localNotificationActionPerformed', listenerFunc: (notificationAction: LocalNotificationActionPerformed) => void - ): PluginListenerHandle; + ): Promise & PluginListenerHandle; addListener( - _eventName: - | 'localNotificationReceived' - | 'localNotificationActionPerformed', - _listenerFunc: - | ((notification: LocalNotification) => void) - | ((notificationAction: LocalNotificationActionPerformed) => void) - ): PluginListenerHandle { + _eventName: any, + _listenerFunc: any + ): Promise & PluginListenerHandle { throw new Error('Method not implemented.'); } - removeAllListeners(): void { + async removeAllListeners(): Promise { throw new Error('Method not implemented.'); } } diff --git a/src/app/shared/notification/notification-item.spec.ts b/src/app/shared/notification/notification-item.spec.ts index 818582b3b..243e5b2ec 100644 --- a/src/app/shared/notification/notification-item.spec.ts +++ b/src/app/shared/notification/notification-item.spec.ts @@ -1,12 +1,13 @@ import { TestBed } from '@angular/core/testing'; -import { LocalNotificationsPlugin, Plugins } from '@capacitor/core'; +import { + LocalNotifications, + LocalNotificationsPlugin, +} from '@capacitor/local-notifications'; import { TranslocoService } from '@ngneat/transloco'; import { LOCAL_NOTIFICATIONS_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; import { SharedTestingModule } from '../shared-testing.module'; import { NotificationItem } from './notification-item'; -const { LocalNotifications } = Plugins; - describe('NotificationItem', () => { let item: NotificationItem; let localNotificationsPlugin: LocalNotificationsPlugin; diff --git a/src/app/shared/notification/notification-item.ts b/src/app/shared/notification/notification-item.ts index 69d165c79..a511df325 100644 --- a/src/app/shared/notification/notification-item.ts +++ b/src/app/shared/notification/notification-item.ts @@ -1,5 +1,8 @@ import { Inject } from '@angular/core'; -import { LocalNotification, LocalNotificationsPlugin } from '@capacitor/core'; +import { + LocalNotificationSchema as LocalNotification, + LocalNotificationsPlugin, +} from '@capacitor/local-notifications'; import { TranslocoService } from '@ngneat/transloco'; import { LOCAL_NOTIFICATIONS_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; diff --git a/src/app/shared/notification/notification.service.spec.ts b/src/app/shared/notification/notification.service.spec.ts index 300890ac4..f67a988c0 100644 --- a/src/app/shared/notification/notification.service.spec.ts +++ b/src/app/shared/notification/notification.service.spec.ts @@ -1,12 +1,10 @@ import { TestBed } from '@angular/core/testing'; -import { Plugins } from '@capacitor/core'; +import { LocalNotifications } from '@capacitor/local-notifications'; import { LOCAL_NOTIFICATIONS_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; import { SharedTestingModule } from '../shared-testing.module'; import { NotificationItem } from './notification-item'; import { NotificationService } from './notification.service'; -const { LocalNotifications } = Plugins; - describe('NotificationService', () => { let service: NotificationService; diff --git a/src/app/shared/notification/notification.service.ts b/src/app/shared/notification/notification.service.ts index ab83a768c..1ae8d1a77 100644 --- a/src/app/shared/notification/notification.service.ts +++ b/src/app/shared/notification/notification.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable } from '@angular/core'; -import { LocalNotificationsPlugin } from '@capacitor/core'; +import { LocalNotificationsPlugin } from '@capacitor/local-notifications'; import { TranslocoService } from '@ngneat/transloco'; import { LOCAL_NOTIFICATIONS_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; import { NotificationItem } from './notification-item'; @@ -17,7 +17,7 @@ export class NotificationService { ) {} async requestPermission() { - return this.localNotificationsPlugin.requestPermission(); + return this.localNotificationsPlugin.requestPermissions(); } createNotification() { From 6d516257e3c58967c9b76f305ddee23bf66fef12 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:13:14 +0800 Subject: [PATCH 47/81] migrate PushNotificationsPlugin to capacitor 3 --- package-lock.json | 15 ++++++ package.json | 1 + .../capacitor-plugins.module.ts | 7 ++- .../mock-push-notifications-plugin.ts | 51 +++++++++---------- .../push-notification.service.ts | 8 +-- 5 files changed, 49 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index da5ff9bdb..1b6e26667 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "@capacitor/ios": "^3.4.1", "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", + "@capacitor/push-notifications": "^1.0.9", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", @@ -2713,6 +2714,14 @@ "@capacitor/core": "^3.0.0" } }, + "node_modules/@capacitor/push-notifications": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.9.tgz", + "integrity": "sha512-NaH+drTYjOGgFMHl/2Jn1/+2rlgomtwP2NfK20E0i7+QoRze1ArcSThJ4vSF0m7VkYBsH3MgbXkWfNSSPaYrtw==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/storage": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", @@ -27163,6 +27172,12 @@ "integrity": "sha512-Le1pcXlBB6Vsz+9Y5jkwcoFONq93Fm06T+EXfH52khrIH61k5rOYRM1HGR5Q0hu6pDKqA9jM/tU06h2kqsJteA==", "requires": {} }, + "@capacitor/push-notifications": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.9.tgz", + "integrity": "sha512-NaH+drTYjOGgFMHl/2Jn1/+2rlgomtwP2NfK20E0i7+QoRze1ArcSThJ4vSF0m7VkYBsH3MgbXkWfNSSPaYrtw==", + "requires": {} + }, "@capacitor/storage": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", diff --git a/package.json b/package.json index 481472ead..5825df976 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@capacitor/ios": "^3.4.1", "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", + "@capacitor/push-notifications": "^1.0.9", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", diff --git a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts index 7c4afbbd7..3a50ef237 100644 --- a/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts +++ b/src/app/shared/capacitor-plugins/capacitor-plugins.module.ts @@ -1,7 +1,6 @@ import { InjectionToken, NgModule } from '@angular/core'; import { App, AppPlugin } from '@capacitor/app'; import { Camera, CameraPlugin } from '@capacitor/camera'; -import { Plugins, PushNotificationsPlugin } from '@capacitor/core'; import { Filesystem, FilesystemPlugin } from '@capacitor/filesystem'; import { Geolocation, GeolocationPlugin } from '@capacitor/geolocation'; import { @@ -9,6 +8,10 @@ import { LocalNotificationsPlugin, } from '@capacitor/local-notifications'; import { Network, NetworkPlugin } from '@capacitor/network'; +import { + PushNotifications, + PushNotificationsPlugin, +} from '@capacitor/push-notifications'; import { Storage, StoragePlugin } from '@capacitor/storage'; export const APP_PLUGIN = new InjectionToken('APP_PLUGIN'); @@ -62,7 +65,7 @@ export const PUSH_NOTIFICATIONS_PLUGIN = }, { provide: PUSH_NOTIFICATIONS_PLUGIN, - useValue: Plugins.PushNotifications, + useValue: PushNotifications, }, ], }) diff --git a/src/app/shared/capacitor-plugins/mock-push-notifications-plugin.ts b/src/app/shared/capacitor-plugins/mock-push-notifications-plugin.ts index 17dad34b7..8b8af2142 100644 --- a/src/app/shared/capacitor-plugins/mock-push-notifications-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-push-notifications-plugin.ts @@ -1,22 +1,26 @@ /* eslint-disable class-methods-use-this, @typescript-eslint/require-await */ +import { PluginListenerHandle } from '@capacitor/core'; import { - NotificationChannel, - NotificationChannelList, - NotificationPermissionResponse, - PluginListenerHandle, - PushNotification, - PushNotificationActionPerformed, - PushNotificationDeliveredList, + ActionPerformed as PushNotificationActionPerformed, + Channel as NotificationChannel, + DeliveredNotifications as PushNotificationDeliveredList, + ListChannelsResult as NotificationChannelList, + PermissionStatus, + PushNotificationSchema as PushNotification, PushNotificationsPlugin, - PushNotificationToken, -} from '@capacitor/core'; + Token as PushNotificationToken, +} from '@capacitor/push-notifications'; export class MockPushNotificationsPlugin implements PushNotificationsPlugin { + async checkPermissions(): Promise { + throw new Error('Method not implemented.'); + } + async register(): Promise { throw new Error('Method not implemented.'); } - async requestPermission(): Promise { + async requestPermissions(): Promise { throw new Error('Method not implemented.'); } @@ -49,36 +53,29 @@ export class MockPushNotificationsPlugin implements PushNotificationsPlugin { addListener( eventName: 'registration', listenerFunc: (token: PushNotificationToken) => void - ): PluginListenerHandle; + ): Promise & PluginListenerHandle; addListener( eventName: 'registrationError', listenerFunc: (error: any) => void - ): PluginListenerHandle; + ): Promise & PluginListenerHandle; addListener( eventName: 'pushNotificationReceived', listenerFunc: (notification: PushNotification) => void - ): PluginListenerHandle; + ): Promise & PluginListenerHandle; addListener( eventName: 'pushNotificationActionPerformed', listenerFunc: (notification: PushNotificationActionPerformed) => void - ): PluginListenerHandle; + ): Promise & PluginListenerHandle; addListener( - _eventName: - | 'registration' - | 'registrationError' - | 'pushNotificationReceived' - | 'pushNotificationActionPerformed', - _listenerFunc: - | ((token: PushNotificationToken) => void) - | ((error: any) => void) - | ((notification: PushNotification) => void) - | ((notification: PushNotificationActionPerformed) => void) - ): PluginListenerHandle { + _eventName: any, + _listenerFunc: any + ): Promise & PluginListenerHandle { // eslint-disable-next-line @typescript-eslint/no-empty-function - return { remove: () => {} }; + // return { remove: () => {} }; + throw new Error('Method not implemented.'); } - removeAllListeners(): void { + async removeAllListeners(): Promise { throw new Error('Method not implemented.'); } } diff --git a/src/app/shared/push-notification/push-notification.service.ts b/src/app/shared/push-notification/push-notification.service.ts index 8b00a0c54..76bc6663f 100644 --- a/src/app/shared/push-notification/push-notification.service.ts +++ b/src/app/shared/push-notification/push-notification.service.ts @@ -1,5 +1,6 @@ import { Inject, Injectable } from '@angular/core'; -import { Capacitor, PushNotificationsPlugin } from '@capacitor/core'; +import { Capacitor } from '@capacitor/core'; +import { PushNotificationsPlugin } from '@capacitor/push-notifications'; import { BehaviorSubject, Subject } from 'rxjs'; import { isNonNullable } from '../../utils/rx-operators/rx-operators'; import { PUSH_NOTIFICATIONS_PLUGIN } from '../capacitor-plugins/capacitor-plugins.module'; @@ -43,11 +44,10 @@ export class PushNotificationService { if (!Capacitor.isPluginAvailable('PushNotifications')) { return; } - await this.pushNotificationsPlugin.requestPermission(); - const result = await this.pushNotificationsPlugin.requestPermission(); + const result = await this.pushNotificationsPlugin.requestPermissions(); return new Promise((resolve, reject) => { - if (!result.granted) { + if (result.receive !== 'granted') { reject(new Error('Push notification permission denied.')); } this.pushNotificationsPlugin.addListener('registration', token => { From 46489eac455d8812bebc51dce7d4e518df4fd531 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:29:38 +0800 Subject: [PATCH 48/81] migrate DevicePlugin to capacitorr 3 --- package-lock.json | 15 +++++++++++++++ package.json | 1 + .../capacitor-facts-provider.service.ts | 16 ++++++++++++---- .../dia-backend/auth/dia-backend-auth.service.ts | 8 ++++---- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b6e26667..e34c19d7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", + "@capacitor/device": "^1.1.2", "@capacitor/filesystem": "^1.1.0", "@capacitor/geolocation": "^1.3.1", "@capacitor/ios": "^3.4.1", @@ -2674,6 +2675,14 @@ "tslib": "^2.1.0" } }, + "node_modules/@capacitor/device": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@capacitor/device/-/device-1.1.2.tgz", + "integrity": "sha512-1i6yvuSC7Ys7fs4JsUtfwG/00d2FF2TvWpbYs7YbkXhp1vOTL510gwjc5S6FTyhh8M9sAaUU5tKB68XwlSK/GA==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/filesystem": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-1.1.0.tgz", @@ -27142,6 +27151,12 @@ "tslib": "^2.1.0" } }, + "@capacitor/device": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@capacitor/device/-/device-1.1.2.tgz", + "integrity": "sha512-1i6yvuSC7Ys7fs4JsUtfwG/00d2FF2TvWpbYs7YbkXhp1vOTL510gwjc5S6FTyhh8M9sAaUU5tKB68XwlSK/GA==", + "requires": {} + }, "@capacitor/filesystem": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-1.1.0.tgz", diff --git a/package.json b/package.json index 5825df976..af991e2e5 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", + "@capacitor/device": "^1.1.2", "@capacitor/filesystem": "^1.1.0", "@capacitor/geolocation": "^1.3.1", "@capacitor/ios": "^3.4.1", diff --git a/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts b/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts index 0dad82e7c..9b21e236b 100644 --- a/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts +++ b/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; -import { Plugins } from '@capacitor/core'; +import { App } from '@capacitor/app'; +import { Device } from '@capacitor/device'; import { TranslocoService } from '@ngneat/transloco'; import { ErrorService } from '../../../error/error.service'; import { BaseError } from '../../../error/errors'; @@ -17,8 +18,6 @@ import { } from '../../../repositories/proof/proof'; import { FactsProvider } from '../facts-provider'; -const { Device } = Plugins; - @Injectable({ providedIn: 'root', }) @@ -79,7 +78,16 @@ export class CapacitorFactsProvider implements FactsProvider { if (!isDeviceInfoCollectionEnabled) { return; } - return { ...(await Device.getInfo()), ...(await Device.getBatteryInfo()) }; + const appInfo = await App.getInfo(); + return { + appVersion: appInfo.version, + appBuild: appInfo.build, + appId: appInfo.id, + appName: appInfo.name, + uuid: (await Device.getId()).uuid, + ...(await Device.getInfo()), + ...(await Device.getBatteryInfo()), + }; } private async collectLocationInfo(capturedTimestamp: number) { diff --git a/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts b/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts index abfb45ee2..eab516661 100644 --- a/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts +++ b/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Plugins } from '@capacitor/core'; +import { Device } from '@capacitor/device'; import { Storage } from '@capacitor/storage'; import { isEqual, reject } from 'lodash-es'; import { combineLatest, defer, forkJoin, Observable, Subject } from 'rxjs'; @@ -19,7 +19,6 @@ import { LanguageService } from '../../language/service/language.service'; import { PreferenceManager } from '../../preference-manager/preference-manager.service'; import { PushNotificationService } from '../../push-notification/push-notification.service'; import { BASE_URL, TRUSTED_CLIENT_KEY } from '../secret'; -const { Device } = Plugins; @Injectable({ providedIn: 'root', @@ -182,14 +181,15 @@ export class DiaBackendAuthService { return combineLatest([ this.pushNotificationService.getToken$(), defer(() => Device.getInfo()), + defer(() => Device.getId()), ]).pipe( - concatMap(([fcmToken, deviceInfo]) => + concatMap(([fcmToken, deviceInfo, deviceId]) => this.httpClient.post( `${BASE_URL}/auth/devices/`, { fcm_token: fcmToken, platform: deviceInfo.platform, - device_identifier: deviceInfo.uuid, + device_identifier: deviceId, }, { headers } ) From 370ca2fad0fc3a410092d629a000633584f32bea Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:33:35 +0800 Subject: [PATCH 49/81] migrate SplashScreenPlugin to capacitor 3 --- package-lock.json | 15 +++++++++++++++ package.json | 1 + src/app/app.component.ts | 4 +--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e34c19d7e..9e0c05d31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", "@capacitor/push-notifications": "^1.0.9", + "@capacitor/splash-screen": "^1.2.2", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", @@ -2731,6 +2732,14 @@ "@capacitor/core": "^3.0.0" } }, + "node_modules/@capacitor/splash-screen": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-1.2.2.tgz", + "integrity": "sha512-iGh9gc0rdS3R+Wr+bD/+tJl3qbmJZ5xVQAP5UsD6U6Y3ydCBo9KpA8DEqxaBZVsCDaLt67009hK5nxKBwjRn7Q==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/storage": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", @@ -27193,6 +27202,12 @@ "integrity": "sha512-NaH+drTYjOGgFMHl/2Jn1/+2rlgomtwP2NfK20E0i7+QoRze1ArcSThJ4vSF0m7VkYBsH3MgbXkWfNSSPaYrtw==", "requires": {} }, + "@capacitor/splash-screen": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-1.2.2.tgz", + "integrity": "sha512-iGh9gc0rdS3R+Wr+bD/+tJl3qbmJZ5xVQAP5UsD6U6Y3ydCBo9KpA8DEqxaBZVsCDaLt67009hK5nxKBwjRn7Q==", + "requires": {} + }, "@capacitor/storage": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@capacitor/storage/-/storage-1.2.4.tgz", diff --git a/package.json b/package.json index af991e2e5..059b8252d 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", "@capacitor/push-notifications": "^1.0.9", + "@capacitor/splash-screen": "^1.2.2", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", "@ionic/core": "^5.6.11", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2f998a325..735edf1cc 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer } from '@angular/platform-browser'; -import { Plugins } from '@capacitor/core'; +import { SplashScreen } from '@capacitor/splash-screen'; import { Platform } from '@ionic/angular'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { catchError, concatMap } from 'rxjs/operators'; @@ -18,8 +18,6 @@ import { LanguageService } from './shared/language/service/language.service'; import { NotificationService } from './shared/notification/notification.service'; import { PushNotificationService } from './shared/push-notification/push-notification.service'; -const { SplashScreen } = Plugins; - @UntilDestroy({ checkProperties: true }) @Component({ selector: 'app-root', From 389db9b791431390a00d5804e252fb0f7157c32e Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:39:43 +0800 Subject: [PATCH 50/81] migrate BrowserPlugin to capacitor 3 --- package-lock.json | 15 +++++++++++++++ package.json | 1 + src/app/features/home/details/details.page.ts | 3 ++- src/app/features/home/home.page.ts | 4 +--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9e0c05d31..d4edcf58f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", + "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", "@capacitor/device": "^1.1.2", @@ -2604,6 +2605,14 @@ "@capacitor/core": "^3.0.0" } }, + "node_modules/@capacitor/browser": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/browser/-/browser-1.0.7.tgz", + "integrity": "sha512-ni8IjsPyFUYqQ2JxBwzI7VpJUZHPr7QiRds5hQWM/1cpfH0+DWvjWHwzxQXuSbW0h+QGXGSJ/vwqjRns7NzLfQ==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/camera": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-1.3.0.tgz", @@ -27104,6 +27113,12 @@ "integrity": "sha512-CjcMLThYfPBGBexb6Xy98MHA9olduS0OL0X8Ot9z9x5RN/Cx5K5OmlZkGMKOncR2R1h2n/whdO5tmDbjeqS6tw==", "requires": {} }, + "@capacitor/browser": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/browser/-/browser-1.0.7.tgz", + "integrity": "sha512-ni8IjsPyFUYqQ2JxBwzI7VpJUZHPr7QiRds5hQWM/1cpfH0+DWvjWHwzxQXuSbW0h+QGXGSJ/vwqjRns7NzLfQ==", + "requires": {} + }, "@capacitor/camera": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-1.3.0.tgz", diff --git a/package.json b/package.json index 059b8252d..96306667f 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", + "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", "@capacitor/core": "^3.4.1", "@capacitor/device": "^1.1.2", diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index 3a72e4ec0..56cca15bd 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -3,6 +3,7 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; +import { Browser } from '@capacitor/browser'; import { Plugins } from '@capacitor/core'; import { ActionSheetController, AlertController } from '@ionic/angular'; import { ActionSheetButton } from '@ionic/core'; @@ -43,7 +44,7 @@ import { SwiperCore.use([Virtual]); -const { Browser, Clipboard } = Plugins; +const { Clipboard } = Plugins; @UntilDestroy() @Component({ diff --git a/src/app/features/home/home.page.ts b/src/app/features/home/home.page.ts index 3ca44418c..b8b8f9185 100644 --- a/src/app/features/home/home.page.ts +++ b/src/app/features/home/home.page.ts @@ -1,7 +1,7 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { Plugins } from '@capacitor/core'; +import { Browser } from '@capacitor/browser'; import { ActionSheetController, AlertController } from '@ionic/angular'; import { TranslocoService } from '@ngneat/transloco'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; @@ -28,8 +28,6 @@ import { switchTapTo, VOID$ } from '../../utils/rx-operators/rx-operators'; import { GoProBluetoothService } from '../settings/go-pro/services/go-pro-bluetooth.service'; import { PrefetchingDialogComponent } from './onboarding/prefetching-dialog/prefetching-dialog.component'; -const { Browser } = Plugins; - @UntilDestroy() @Component({ selector: 'app-home', From 99ad258467201704834f4e76367f8bada7bc7e0f Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:41:31 +0800 Subject: [PATCH 51/81] migrate ClipboardPlugin to capacitor 3 --- package-lock.json | 15 +++++++++++++++ package.json | 1 + src/app/features/home/details/details.page.ts | 4 +--- src/app/features/profile/profile.page.ts | 4 +--- .../export-private-key-modal.component.ts | 4 +--- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4edcf58f..8f95ec623 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", + "@capacitor/clipboard": "^1.0.7", "@capacitor/core": "^3.4.1", "@capacitor/device": "^1.1.2", "@capacitor/filesystem": "^1.1.0", @@ -2677,6 +2678,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@capacitor/clipboard": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/clipboard/-/clipboard-1.0.7.tgz", + "integrity": "sha512-vYf6wFPdZwhfM2NzT1qo/Yyhjh/czTSZXKvVlPP8DM28QufQzh9llIwqrEao9Jt59zw8fvvmh5nUqxyXqHpLUQ==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/core": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.4.1.tgz", @@ -27167,6 +27176,12 @@ } } }, + "@capacitor/clipboard": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/clipboard/-/clipboard-1.0.7.tgz", + "integrity": "sha512-vYf6wFPdZwhfM2NzT1qo/Yyhjh/czTSZXKvVlPP8DM28QufQzh9llIwqrEao9Jt59zw8fvvmh5nUqxyXqHpLUQ==", + "requires": {} + }, "@capacitor/core": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.4.1.tgz", diff --git a/package.json b/package.json index 96306667f..325b9e927 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", + "@capacitor/clipboard": "^1.0.7", "@capacitor/core": "^3.4.1", "@capacitor/device": "^1.1.2", "@capacitor/filesystem": "^1.1.0", diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index 56cca15bd..06bc12149 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -4,7 +4,7 @@ import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { Browser } from '@capacitor/browser'; -import { Plugins } from '@capacitor/core'; +import { Clipboard } from '@capacitor/clipboard'; import { ActionSheetController, AlertController } from '@ionic/angular'; import { ActionSheetButton } from '@ionic/core'; import { TranslocoService } from '@ngneat/transloco'; @@ -44,8 +44,6 @@ import { SwiperCore.use([Virtual]); -const { Clipboard } = Plugins; - @UntilDestroy() @Component({ selector: 'app-details', diff --git a/src/app/features/profile/profile.page.ts b/src/app/features/profile/profile.page.ts index b8972f930..ae9a340fc 100644 --- a/src/app/features/profile/profile.page.ts +++ b/src/app/features/profile/profile.page.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; -import { Plugins } from '@capacitor/core'; +import { Clipboard } from '@capacitor/clipboard'; import { AlertController } from '@ionic/angular'; import { TranslocoService } from '@ngneat/transloco'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; @@ -19,8 +19,6 @@ import { ExportPrivateKeyModalComponent } from '../../shared/export-private-key- import { MediaStore } from '../../shared/media/media-store/media-store.service'; import { PreferenceManager } from '../../shared/preference-manager/preference-manager.service'; -const { Clipboard } = Plugins; - @UntilDestroy({ checkProperties: true }) @Component({ selector: 'app-profile', diff --git a/src/app/shared/export-private-key-modal/export-private-key-modal.component.ts b/src/app/shared/export-private-key-modal/export-private-key-modal.component.ts index d7de08fa3..3ae32967c 100644 --- a/src/app/shared/export-private-key-modal/export-private-key-modal.component.ts +++ b/src/app/shared/export-private-key-modal/export-private-key-modal.component.ts @@ -1,11 +1,9 @@ import { Component, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; -import { Plugins } from '@capacitor/core'; +import { Clipboard } from '@capacitor/clipboard'; import { TranslocoService } from '@ngneat/transloco'; -const { Clipboard } = Plugins; - @Component({ selector: 'app-export-private-key-modal', templateUrl: './export-private-key-modal.component.html', From 854fd20820b9cbfec8f6885d6e810ce49eb8cad4 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 14:42:36 +0800 Subject: [PATCH 52/81] migrate SharePlugin to capacitor 3 --- package-lock.json | 15 +++++++++++++++ package.json | 1 + src/app/shared/share/share.service.ts | 3 +-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8f95ec623..968fff27a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", "@capacitor/push-notifications": "^1.0.9", + "@capacitor/share": "^1.1.1", "@capacitor/splash-screen": "^1.2.2", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", @@ -2750,6 +2751,14 @@ "@capacitor/core": "^3.0.0" } }, + "node_modules/@capacitor/share": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@capacitor/share/-/share-1.1.1.tgz", + "integrity": "sha512-KmHHsTr/55uoT5CNztwX2ON7yClsPxQr8BIqKnkH8UyYSrOCy8w354fFTK8Q5nADrQGUKKXVjojDCA4u5TAjSQ==", + "peerDependencies": { + "@capacitor/core": "^3.0.0" + } + }, "node_modules/@capacitor/splash-screen": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-1.2.2.tgz", @@ -27232,6 +27241,12 @@ "integrity": "sha512-NaH+drTYjOGgFMHl/2Jn1/+2rlgomtwP2NfK20E0i7+QoRze1ArcSThJ4vSF0m7VkYBsH3MgbXkWfNSSPaYrtw==", "requires": {} }, + "@capacitor/share": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@capacitor/share/-/share-1.1.1.tgz", + "integrity": "sha512-KmHHsTr/55uoT5CNztwX2ON7yClsPxQr8BIqKnkH8UyYSrOCy8w354fFTK8Q5nADrQGUKKXVjojDCA4u5TAjSQ==", + "requires": {} + }, "@capacitor/splash-screen": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-1.2.2.tgz", diff --git a/package.json b/package.json index 325b9e927..cc60aec0f 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@capacitor/local-notifications": "^1.1.0", "@capacitor/network": "^1.0.7", "@capacitor/push-notifications": "^1.0.9", + "@capacitor/share": "^1.1.1", "@capacitor/splash-screen": "^1.2.2", "@capacitor/storage": "^1.2.4", "@ionic/angular": "^5.6.11", diff --git a/src/app/shared/share/share.service.ts b/src/app/shared/share/share.service.ts index 44887c8c2..9811a581f 100644 --- a/src/app/shared/share/share.service.ts +++ b/src/app/shared/share/share.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Plugins } from '@capacitor/core'; +import { Share } from '@capacitor/share'; import { concatMap, first, map } from 'rxjs/operators'; import { blobToBase64 } from '../../utils/encoding/encoding'; import { @@ -8,7 +8,6 @@ import { DiaBackendAssetRepository, } from '../dia-backend/asset/dia-backend-asset-repository.service'; import { MediaStore } from '../media/media-store/media-store.service'; -const { Share } = Plugins; @Injectable({ providedIn: 'root', From da22d62deb2b715481e621f10afb75e6cccdf218 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 15:04:04 +0800 Subject: [PATCH 53/81] migrate capacitor-blob-writer Plugin to capacitor 3 --- package-lock.json | 17 +++++++++-------- package.json | 2 +- .../media/media-store/media-store.service.ts | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 968fff27a..578b8b257 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "@ngx-formly/schematics": "^5.10.22", "async-mutex": "^0.3.2", "buffer": "^5.7.1", - "capacitor-blob-writer": "^0.2.4", + "capacitor-blob-writer": "^1.0.4", "compressorjs": "^1.0.7", "immutable": "^4.0.0-rc.14", "lodash-es": "^4.17.21", @@ -6448,11 +6448,12 @@ "dev": true }, "node_modules/capacitor-blob-writer": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/capacitor-blob-writer/-/capacitor-blob-writer-0.2.4.tgz", - "integrity": "sha512-gPt5k16caQ8F08o762rJHpJxbbA4PyrErpKv1dcltR6cYJ8zu9er4jk/y4CHTjnFJXKT2FMuB65jXyc4y68XyQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capacitor-blob-writer/-/capacitor-blob-writer-1.0.4.tgz", + "integrity": "sha512-HLN9qHGXprnMacjFV50KSHFuk2e+Q6QHxSIsNNbVwxh3/8cEzA6bAwFdJthLocYSYjPENMC6o54hwxFWN3CiSQ==", "peerDependencies": { - "@capacitor/core": "^2.0.0" + "@capacitor/core": "^3.0.0", + "@capacitor/filesystem": "^1.0.0" } }, "node_modules/caseless": { @@ -30049,9 +30050,9 @@ "dev": true }, "capacitor-blob-writer": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/capacitor-blob-writer/-/capacitor-blob-writer-0.2.4.tgz", - "integrity": "sha512-gPt5k16caQ8F08o762rJHpJxbbA4PyrErpKv1dcltR6cYJ8zu9er4jk/y4CHTjnFJXKT2FMuB65jXyc4y68XyQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capacitor-blob-writer/-/capacitor-blob-writer-1.0.4.tgz", + "integrity": "sha512-HLN9qHGXprnMacjFV50KSHFuk2e+Q6QHxSIsNNbVwxh3/8cEzA6bAwFdJthLocYSYjPENMC6o54hwxFWN3CiSQ==", "requires": {} }, "caseless": { diff --git a/package.json b/package.json index cc60aec0f..b8c107997 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@ngx-formly/schematics": "^5.10.22", "async-mutex": "^0.3.2", "buffer": "^5.7.1", - "capacitor-blob-writer": "^0.2.4", + "capacitor-blob-writer": "^1.0.4", "compressorjs": "^1.0.7", "immutable": "^4.0.0-rc.14", "lodash-es": "^4.17.21", diff --git a/src/app/shared/media/media-store/media-store.service.ts b/src/app/shared/media/media-store/media-store.service.ts index 4f2cf819e..6e1ba4912 100644 --- a/src/app/shared/media/media-store/media-store.service.ts +++ b/src/app/shared/media/media-store/media-store.service.ts @@ -6,7 +6,7 @@ import { FilesystemPlugin, } from '@capacitor/filesystem'; import { Mutex } from 'async-mutex'; -import { writeFile } from 'capacitor-blob-writer'; +import write_blob from 'capacitor-blob-writer'; import Compressor from 'compressorjs'; import { defer, merge } from 'rxjs'; import { concatMap, map } from 'rxjs/operators'; @@ -104,10 +104,10 @@ export class MediaStore { const mediaExtension = await this.setMediaExtension(index, mimeType); if (Capacitor.isNative) { const blob = await base64ToBlob(base64, mimeType); - await writeFile({ + await write_blob({ directory: this.directory, path: `${this.rootDir}/${index}.${mediaExtension.extension}`, - data: blob, + blob: blob, recursive: true, }); } else { From ce11e584119c6f179c7b44bcdc4fcc7d73f27227 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 15:08:20 +0800 Subject: [PATCH 54/81] migrate http Plugin to capacitor 3 --- package-lock.json | 52 ++++++------------- package.json | 2 +- .../go-pro/services/go-pro-media.service.ts | 4 +- 3 files changed, 18 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 578b8b257..1aaf2ea1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@angular/platform-browser-dynamic": "^12.2.4", "@angular/router": "^12.2.4", "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", - "@capacitor-community/http": "^0.3.2", + "@capacitor-community/http": "^1.4.1", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", @@ -2560,26 +2560,16 @@ } }, "node_modules/@capacitor-community/http": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@capacitor-community/http/-/http-0.3.2.tgz", - "integrity": "sha512-yBHwQof07KRQqZpQHwymKByJfcZmjRAaFwXXd9w0w52GIjr9AlZ0Qg1R60Czbi4mgQdiqk90nsZIXrRpxpsAZA==", - "dependencies": { - "@capacitor/core": "2.4.7" - } - }, - "node_modules/@capacitor-community/http/node_modules/@capacitor/core": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.4.7.tgz", - "integrity": "sha512-ZPzXXQ4EPwR/ZhNDkmlxyzw4FvquIl/ROj8HMMM0MEd4xZfM8ulNGPIL6br9TWdlFLGBKq40eymPZjKaivGnig==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@capacitor-community/http/-/http-1.4.1.tgz", + "integrity": "sha512-+pCkBXrwfm97UfjOgjV950H/qZ8SE36Mrcb46BlL1ps3VIsGuIO+AulL8GqTC6LewheRVtGJpRspNtneXQotNA==", "dependencies": { - "tslib": "^1.9.0" + "@capacitor/android": "^3.0.0", + "@capacitor/core": "^3.0.0", + "@capacitor/filesystem": "^1.0.0", + "@capacitor/ios": "^3.0.0" } }, - "node_modules/@capacitor-community/http/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "node_modules/@capacitor-community/wifi": { "version": "0.0.1", "resolved": "git+ssh://git@github.com/digaus/community-capacitor-wifi.git#5052c6fb4ed5d6329215976dab2a735a852d52c9", @@ -27091,26 +27081,14 @@ } }, "@capacitor-community/http": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@capacitor-community/http/-/http-0.3.2.tgz", - "integrity": "sha512-yBHwQof07KRQqZpQHwymKByJfcZmjRAaFwXXd9w0w52GIjr9AlZ0Qg1R60Czbi4mgQdiqk90nsZIXrRpxpsAZA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@capacitor-community/http/-/http-1.4.1.tgz", + "integrity": "sha512-+pCkBXrwfm97UfjOgjV950H/qZ8SE36Mrcb46BlL1ps3VIsGuIO+AulL8GqTC6LewheRVtGJpRspNtneXQotNA==", "requires": { - "@capacitor/core": "2.4.7" - }, - "dependencies": { - "@capacitor/core": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.4.7.tgz", - "integrity": "sha512-ZPzXXQ4EPwR/ZhNDkmlxyzw4FvquIl/ROj8HMMM0MEd4xZfM8ulNGPIL6br9TWdlFLGBKq40eymPZjKaivGnig==", - "requires": { - "tslib": "^1.9.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - } + "@capacitor/android": "^3.0.0", + "@capacitor/core": "^3.0.0", + "@capacitor/filesystem": "^1.0.0", + "@capacitor/ios": "^3.0.0" } }, "@capacitor-community/wifi": { diff --git a/package.json b/package.json index b8c107997..04fda4c96 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@angular/platform-browser-dynamic": "^12.2.4", "@angular/router": "^12.2.4", "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", - "@capacitor-community/http": "^0.3.2", + "@capacitor-community/http": "^1.4.1", "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", diff --git a/src/app/features/settings/go-pro/services/go-pro-media.service.ts b/src/app/features/settings/go-pro/services/go-pro-media.service.ts index e2c47ca9d..83a8de1c0 100644 --- a/src/app/features/settings/go-pro/services/go-pro-media.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-media.service.ts @@ -2,7 +2,8 @@ import { HttpClient } from '@angular/common/http'; import { Inject, Injectable } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import '@capacitor-community/http'; -import { Capacitor, Plugins } from '@capacitor/core'; +import { Http } from '@capacitor-community/http'; +import { Capacitor } from '@capacitor/core'; import { Directory as FilesystemDirectory, FilesystemPlugin, @@ -17,7 +18,6 @@ import { FILESYSTEM_PLUGIN } from '../../../../shared/capacitor-plugins/capacito import { CaptureService } from '../../../../shared/capture/capture.service'; import { blobToBase64 } from '../../../../utils/encoding/encoding'; import { GoProFile } from '../go-pro-media-file'; -const { Http } = Plugins; @Injectable({ providedIn: 'root', From 876b167071c138882f7785b835a49d86f77f5a46 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 15:11:25 +0800 Subject: [PATCH 55/81] migrate wifi Plugin to capacitor 3 --- package-lock.json | 38 +++++++++---------- package.json | 2 +- .../features/settings/go-pro/go-pro.page.ts | 5 +-- .../go-pro/services/go-pro-wifi.service.ts | 4 +- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1aaf2ea1f..90078c891 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@angular/router": "^12.2.4", "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", "@capacitor-community/http": "^1.4.1", - "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", + "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", @@ -2572,13 +2572,13 @@ }, "node_modules/@capacitor-community/wifi": { "version": "0.0.1", - "resolved": "git+ssh://git@github.com/digaus/community-capacitor-wifi.git#5052c6fb4ed5d6329215976dab2a735a852d52c9", + "resolved": "git+ssh://git@github.com/sultanmyrza/community-capacitor-wifi.git#968e5c2427a78d7903d63ec56610aee749cffe4a", "license": "MIT", "dependencies": { - "node-wifi": "^2.0.13" + "node-wifi": "~2.0.15" }, "peerDependencies": { - "@capacitor/core": "^2.4.2" + "@capacitor/core": "^3.2.0" } }, "node_modules/@capacitor/android": { @@ -6906,9 +6906,9 @@ } }, "node_modules/command-line-args": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.0.tgz", - "integrity": "sha512-4zqtU1hYsSJzcJBOcNZIbW5Fbk9BkjCp1pZVhQKoRaWL5J7N4XphDLwo8aWwdQpTugxwu+jf9u2ZhkXiqp5Z6A==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", "dependencies": { "array-back": "^3.1.0", "find-replace": "^3.0.0", @@ -14851,9 +14851,9 @@ "dev": true }, "node_modules/node-wifi": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/node-wifi/-/node-wifi-2.0.15.tgz", - "integrity": "sha512-c/+pvm15uJ+rHWzMtvsysQO2KQgZKdcIkGYixaP+9P1EiLz6mOVKwumX2t1gwIAlBkqDOIWIv2H3dgN96A+2FQ==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/node-wifi/-/node-wifi-2.0.16.tgz", + "integrity": "sha512-WOgs7kqTvijHij1GLMVW/ReIZHEtcvJuZSMDExEDhBhLquQJPUbBOIsQxavnhJJ06MQnGXnW1qJKe9ADibOTIA==", "dependencies": { "command-line-args": "^5.2.0", "command-line-usage": "^6.1.1" @@ -27092,10 +27092,10 @@ } }, "@capacitor-community/wifi": { - "version": "git+ssh://git@github.com/digaus/community-capacitor-wifi.git#5052c6fb4ed5d6329215976dab2a735a852d52c9", - "from": "@capacitor-community/wifi@git+https://github.com/digaus/community-capacitor-wifi.git", + "version": "git+ssh://git@github.com/sultanmyrza/community-capacitor-wifi.git#968e5c2427a78d7903d63ec56610aee749cffe4a", + "from": "@capacitor-community/wifi@https://github.com/sultanmyrza/community-capacitor-wifi.git#capacitor3", "requires": { - "node-wifi": "^2.0.13" + "node-wifi": "~2.0.15" } }, "@capacitor/android": { @@ -30398,9 +30398,9 @@ } }, "command-line-args": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.0.tgz", - "integrity": "sha512-4zqtU1hYsSJzcJBOcNZIbW5Fbk9BkjCp1pZVhQKoRaWL5J7N4XphDLwo8aWwdQpTugxwu+jf9u2ZhkXiqp5Z6A==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", "requires": { "array-back": "^3.1.0", "find-replace": "^3.0.0", @@ -36615,9 +36615,9 @@ "dev": true }, "node-wifi": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/node-wifi/-/node-wifi-2.0.15.tgz", - "integrity": "sha512-c/+pvm15uJ+rHWzMtvsysQO2KQgZKdcIkGYixaP+9P1EiLz6mOVKwumX2t1gwIAlBkqDOIWIv2H3dgN96A+2FQ==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/node-wifi/-/node-wifi-2.0.16.tgz", + "integrity": "sha512-WOgs7kqTvijHij1GLMVW/ReIZHEtcvJuZSMDExEDhBhLquQJPUbBOIsQxavnhJJ06MQnGXnW1qJKe9ADibOTIA==", "requires": { "command-line-args": "^5.2.0", "command-line-usage": "^6.1.1" diff --git a/package.json b/package.json index 04fda4c96..06a85153e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@angular/router": "^12.2.4", "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", "@capacitor-community/http": "^1.4.1", - "@capacitor-community/wifi": "git+https://github.com/digaus/community-capacitor-wifi.git", + "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", "@capacitor/android": "^3.4.1", "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", diff --git a/src/app/features/settings/go-pro/go-pro.page.ts b/src/app/features/settings/go-pro/go-pro.page.ts index 7706e8dd4..fba485e2f 100644 --- a/src/app/features/settings/go-pro/go-pro.page.ts +++ b/src/app/features/settings/go-pro/go-pro.page.ts @@ -1,13 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { ScanResult } from '@capacitor-community/bluetooth-le'; -import { WifiPlugin } from '@capacitor-community/wifi'; -import { Plugins } from '@capacitor/core'; +import { Wifi } from '@capacitor-community/wifi'; import { LoadingController, ToastController } from '@ionic/angular'; import { GoProBluetoothService } from './services/go-pro-bluetooth.service'; -const Wifi: WifiPlugin = Plugins.Wifi as WifiPlugin; - interface GoProWiFiCreds { wifiPASS: string; wifiSSID: string; diff --git a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts index 1c240d334..4561d958f 100644 --- a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts @@ -1,10 +1,8 @@ import { Injectable } from '@angular/core'; -import { WifiPlugin } from '@capacitor-community/wifi'; -import { Plugins } from '@capacitor/core'; +import { Wifi } from '@capacitor-community/wifi'; import { Platform } from '@ionic/angular'; import { PreferenceManager } from '../../../../shared/preference-manager/preference-manager.service'; import { GoProBluetoothService } from './go-pro-bluetooth.service'; -const Wifi: WifiPlugin = Plugins.Wifi as WifiPlugin; @Injectable({ providedIn: 'root', From 8d5533f14b7d16dedf635608ec94e98bba7c935f Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 15:20:24 +0800 Subject: [PATCH 56/81] migrate bluetooth-le Plugin to capacitor 3 --- package-lock.json | 33 +++++++++++++++++---------------- package.json | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90078c891..3bc3818a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@angular/platform-browser": "^12.2.4", "@angular/platform-browser-dynamic": "^12.2.4", "@angular/router": "^12.2.4", - "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", + "@capacitor-community/bluetooth-le": "^1.7.0", "@capacitor-community/http": "^1.4.1", "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", "@capacitor/android": "^3.4.1", @@ -2548,15 +2548,15 @@ } }, "node_modules/@capacitor-community/bluetooth-le": { - "version": "0.6.1", - "resolved": "git+ssh://git@github.com/numbersprotocol/bluetooth-le.git#49bbb1a0a4fc87559f8337c1468e23027979d3a9", - "license": "MIT", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@capacitor-community/bluetooth-le/-/bluetooth-le-1.7.0.tgz", + "integrity": "sha512-cxQCoF8WlmxjDLulMUOfwBztwWsPEtHDZX9TvGquh/GQhQbSDkM3aJmqhIyUaeZMN1B9dh5QEa/fBkr1RwYbiw==", "dependencies": { - "@types/web-bluetooth": "^0.0.9", + "@types/web-bluetooth": "^0.0.12", "throat": "^6.0.1" }, "peerDependencies": { - "@capacitor/core": "^2.4.7" + "@capacitor/core": "^3.0.0" } }, "node_modules/@capacitor-community/http": { @@ -4412,9 +4412,9 @@ "dev": true }, "node_modules/@types/web-bluetooth": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.9.tgz", - "integrity": "sha512-P6oHnRSEqRCR1fdAtJXmKBiHE3fOWtNFyfjm9NQZPrxdQjSZgRSiKRiHjLyKBh8eCvM8ldDS8/VJN0qKg0Pk1Q==" + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.12.tgz", + "integrity": "sha512-Q4sUrowpylCOWjUWFtNwkNBHQUnCL8y44Iq2ZLtVMAuAGIwPSXa3kqIvu2LwXoc2d1jyaaw4Bg354degHrsADw==" }, "node_modules/@types/webpack-sources": { "version": "0.1.9", @@ -27073,10 +27073,11 @@ } }, "@capacitor-community/bluetooth-le": { - "version": "git+ssh://git@github.com/numbersprotocol/bluetooth-le.git#49bbb1a0a4fc87559f8337c1468e23027979d3a9", - "from": "@capacitor-community/bluetooth-le@github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@capacitor-community/bluetooth-le/-/bluetooth-le-1.7.0.tgz", + "integrity": "sha512-cxQCoF8WlmxjDLulMUOfwBztwWsPEtHDZX9TvGquh/GQhQbSDkM3aJmqhIyUaeZMN1B9dh5QEa/fBkr1RwYbiw==", "requires": { - "@types/web-bluetooth": "^0.0.9", + "@types/web-bluetooth": "^0.0.12", "throat": "^6.0.1" } }, @@ -27093,7 +27094,7 @@ }, "@capacitor-community/wifi": { "version": "git+ssh://git@github.com/sultanmyrza/community-capacitor-wifi.git#968e5c2427a78d7903d63ec56610aee749cffe4a", - "from": "@capacitor-community/wifi@https://github.com/sultanmyrza/community-capacitor-wifi.git#capacitor3", + "from": "@capacitor-community/wifi@github:sultanmyrza/community-capacitor-wifi#capacitor3", "requires": { "node-wifi": "~2.0.15" } @@ -28477,9 +28478,9 @@ "dev": true }, "@types/web-bluetooth": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.9.tgz", - "integrity": "sha512-P6oHnRSEqRCR1fdAtJXmKBiHE3fOWtNFyfjm9NQZPrxdQjSZgRSiKRiHjLyKBh8eCvM8ldDS8/VJN0qKg0Pk1Q==" + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.12.tgz", + "integrity": "sha512-Q4sUrowpylCOWjUWFtNwkNBHQUnCL8y44Iq2ZLtVMAuAGIwPSXa3kqIvu2LwXoc2d1jyaaw4Bg354degHrsADw==" }, "@types/webpack-sources": { "version": "0.1.9", diff --git a/package.json b/package.json index 06a85153e..b791d7d3f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@angular/platform-browser": "^12.2.4", "@angular/platform-browser-dynamic": "^12.2.4", "@angular/router": "^12.2.4", - "@capacitor-community/bluetooth-le": "github:numbersprotocol/bluetooth-le#fix-complilation-error-on-ios-15", + "@capacitor-community/bluetooth-le": "^1.7.0", "@capacitor-community/http": "^1.4.1", "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", "@capacitor/android": "^3.4.1", From 6c2677f7cf1e482d2912b836f8851b4845fde6c2 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Sat, 19 Feb 2022 15:26:19 +0800 Subject: [PATCH 57/81] run `npx cap sync` --- android/app/capacitor.build.gradle | 13 +++++ .../app/src/main/assets/capacitor.config.json | 42 ++++++++------- .../src/main/assets/capacitor.plugins.json | 52 +++++++++++++++++++ android/capacitor.settings.gradle | 39 ++++++++++++++ ios/App/App/capacitor.config.json | 42 ++++++++------- ios/App/Podfile | 13 +++++ 6 files changed, 163 insertions(+), 38 deletions(-) diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle index eb17818fa..e390d9e4a 100644 --- a/android/app/capacitor.build.gradle +++ b/android/app/capacitor.build.gradle @@ -12,6 +12,19 @@ dependencies { implementation project(':capacitor-community-bluetooth-le') implementation project(':capacitor-community-http') implementation project(':capacitor-community-wifi') + implementation project(':capacitor-app') + implementation project(':capacitor-browser') + implementation project(':capacitor-camera') + implementation project(':capacitor-clipboard') + implementation project(':capacitor-device') + implementation project(':capacitor-filesystem') + implementation project(':capacitor-geolocation') + implementation project(':capacitor-local-notifications') + implementation project(':capacitor-network') + implementation project(':capacitor-push-notifications') + implementation project(':capacitor-share') + implementation project(':capacitor-splash-screen') + implementation project(':capacitor-storage') implementation project(':capacitor-blob-writer') } diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index f4f49ca14..495f07067 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -1,21 +1,25 @@ { - "appId": "io.numbersprotocol.capturelite", - "appName": "Capture", - "bundledWebRuntime": false, - "npmClient": "npm", - "webDir": "www", - "plugins": { - "SplashScreen": { - "androidScaleType": "CENTER_CROP", - "launchAutoHide": false - }, - "PushNotifications": { - "presentationOptions": ["badge", "sound", "alert"] - }, - "LocalNotifications": { - "smallIcon": "ic_capture_lite", - "iconColor": "#564dfc" - } - }, - "cordova": {} + "appId": "io.numbersprotocol.capturelite", + "appName": "Capture", + "bundledWebRuntime": false, + "npmClient": "npm", + "webDir": "www", + "plugins": { + "SplashScreen": { + "androidScaleType": "CENTER_CROP", + "launchAutoHide": false + }, + "PushNotifications": { + "presentationOptions": [ + "badge", + "sound", + "alert" + ] + }, + "LocalNotifications": { + "smallIcon": "ic_capture_lite", + "iconColor": "#564dfc" + } + }, + "cordova": {} } diff --git a/android/app/src/main/assets/capacitor.plugins.json b/android/app/src/main/assets/capacitor.plugins.json index cbf8656a3..aa76ce170 100644 --- a/android/app/src/main/assets/capacitor.plugins.json +++ b/android/app/src/main/assets/capacitor.plugins.json @@ -11,6 +11,58 @@ "pkg": "@capacitor-community/wifi", "classpath": "com.digaus.capacitor.wifi.Wifi" }, + { + "pkg": "@capacitor/app", + "classpath": "com.capacitorjs.plugins.app.AppPlugin" + }, + { + "pkg": "@capacitor/browser", + "classpath": "com.capacitorjs.plugins.browser.BrowserPlugin" + }, + { + "pkg": "@capacitor/camera", + "classpath": "com.capacitorjs.plugins.camera.CameraPlugin" + }, + { + "pkg": "@capacitor/clipboard", + "classpath": "com.capacitorjs.plugins.clipboard.ClipboardPlugin" + }, + { + "pkg": "@capacitor/device", + "classpath": "com.capacitorjs.plugins.device.DevicePlugin" + }, + { + "pkg": "@capacitor/filesystem", + "classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin" + }, + { + "pkg": "@capacitor/geolocation", + "classpath": "com.capacitorjs.plugins.geolocation.GeolocationPlugin" + }, + { + "pkg": "@capacitor/local-notifications", + "classpath": "com.capacitorjs.plugins.localnotifications.LocalNotificationsPlugin" + }, + { + "pkg": "@capacitor/network", + "classpath": "com.capacitorjs.plugins.network.NetworkPlugin" + }, + { + "pkg": "@capacitor/push-notifications", + "classpath": "com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin" + }, + { + "pkg": "@capacitor/share", + "classpath": "com.capacitorjs.plugins.share.SharePlugin" + }, + { + "pkg": "@capacitor/splash-screen", + "classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin" + }, + { + "pkg": "@capacitor/storage", + "classpath": "com.capacitorjs.plugins.storage.StoragePlugin" + }, { "pkg": "capacitor-blob-writer", "classpath": "com.equimaps.capacitorblobwriter.BlobWriter" diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle index 64a141afc..72c6a0451 100644 --- a/android/capacitor.settings.gradle +++ b/android/capacitor.settings.gradle @@ -11,5 +11,44 @@ project(':capacitor-community-http').projectDir = new File('../node_modules/@cap include ':capacitor-community-wifi' project(':capacitor-community-wifi').projectDir = new File('../node_modules/@capacitor-community/wifi/android') +include ':capacitor-app' +project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android') + +include ':capacitor-browser' +project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/browser/android') + +include ':capacitor-camera' +project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/camera/android') + +include ':capacitor-clipboard' +project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android') + +include ':capacitor-device' +project(':capacitor-device').projectDir = new File('../node_modules/@capacitor/device/android') + +include ':capacitor-filesystem' +project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android') + +include ':capacitor-geolocation' +project(':capacitor-geolocation').projectDir = new File('../node_modules/@capacitor/geolocation/android') + +include ':capacitor-local-notifications' +project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android') + +include ':capacitor-network' +project(':capacitor-network').projectDir = new File('../node_modules/@capacitor/network/android') + +include ':capacitor-push-notifications' +project(':capacitor-push-notifications').projectDir = new File('../node_modules/@capacitor/push-notifications/android') + +include ':capacitor-share' +project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android') + +include ':capacitor-splash-screen' +project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android') + +include ':capacitor-storage' +project(':capacitor-storage').projectDir = new File('../node_modules/@capacitor/storage/android') + include ':capacitor-blob-writer' project(':capacitor-blob-writer').projectDir = new File('../node_modules/capacitor-blob-writer/android') diff --git a/ios/App/App/capacitor.config.json b/ios/App/App/capacitor.config.json index f4f49ca14..495f07067 100644 --- a/ios/App/App/capacitor.config.json +++ b/ios/App/App/capacitor.config.json @@ -1,21 +1,25 @@ { - "appId": "io.numbersprotocol.capturelite", - "appName": "Capture", - "bundledWebRuntime": false, - "npmClient": "npm", - "webDir": "www", - "plugins": { - "SplashScreen": { - "androidScaleType": "CENTER_CROP", - "launchAutoHide": false - }, - "PushNotifications": { - "presentationOptions": ["badge", "sound", "alert"] - }, - "LocalNotifications": { - "smallIcon": "ic_capture_lite", - "iconColor": "#564dfc" - } - }, - "cordova": {} + "appId": "io.numbersprotocol.capturelite", + "appName": "Capture", + "bundledWebRuntime": false, + "npmClient": "npm", + "webDir": "www", + "plugins": { + "SplashScreen": { + "androidScaleType": "CENTER_CROP", + "launchAutoHide": false + }, + "PushNotifications": { + "presentationOptions": [ + "badge", + "sound", + "alert" + ] + }, + "LocalNotifications": { + "smallIcon": "ic_capture_lite", + "iconColor": "#564dfc" + } + }, + "cordova": {} } diff --git a/ios/App/Podfile b/ios/App/Podfile index b30077299..39afafc75 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -12,6 +12,19 @@ def capacitor_pods pod 'CapacitorCommunityBluetoothLe', :path => '../../node_modules/@capacitor-community/bluetooth-le' pod 'CapacitorCommunityHttp', :path => '../../node_modules/@capacitor-community/http' pod 'CapacitorCommunityWifi', :path => '../../node_modules/@capacitor-community/wifi' + pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' + pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser' + pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera' + pod 'CapacitorClipboard', :path => '../../node_modules/@capacitor/clipboard' + pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device' + pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem' + pod 'CapacitorGeolocation', :path => '../../node_modules/@capacitor/geolocation' + pod 'CapacitorLocalNotifications', :path => '../../node_modules/@capacitor/local-notifications' + pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network' + pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications' + pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share' + pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen' + pod 'CapacitorStorage', :path => '../../node_modules/@capacitor/storage' pod 'CapacitorBlobWriter', :path => '../../node_modules/capacitor-blob-writer' end From 6b16702f94907c027bf77572391c8554d20a8583 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Wed, 23 Feb 2022 17:03:58 +0800 Subject: [PATCH 58/81] fix: App.getInfo() for Web --- .../capacitor-facts-provider.service.ts | 7 +++++-- src/app/shared/version/version.service.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts b/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts index 9b21e236b..c23d7a9b1 100644 --- a/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts +++ b/src/app/shared/collector/facts/capacitor-facts-provider/capacitor-facts-provider.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; -import { App } from '@capacitor/app'; +import { App, AppInfo } from '@capacitor/app'; import { Device } from '@capacitor/device'; +import { isPlatform } from '@ionic/core'; import { TranslocoService } from '@ngneat/transloco'; import { ErrorService } from '../../../error/error.service'; import { BaseError } from '../../../error/errors'; @@ -78,7 +79,9 @@ export class CapacitorFactsProvider implements FactsProvider { if (!isDeviceInfoCollectionEnabled) { return; } - const appInfo = await App.getInfo(); + let appInfo: AppInfo = { version: '', build: '', id: '', name: '' }; + if (isPlatform('hybrid')) appInfo = await App.getInfo(); + return { appVersion: appInfo.version, appBuild: appInfo.build, diff --git a/src/app/shared/version/version.service.ts b/src/app/shared/version/version.service.ts index 33cf95076..3cf75a81d 100644 --- a/src/app/shared/version/version.service.ts +++ b/src/app/shared/version/version.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; -import { App } from '@capacitor/app'; +import { App, AppInfo } from '@capacitor/app'; +import { isPlatform } from '@ionic/core'; import { defer } from 'rxjs'; import { map } from 'rxjs/operators'; import packageInfo from '../../../../package.json'; @@ -8,7 +9,11 @@ import packageInfo from '../../../../package.json'; providedIn: 'root', }) export class VersionService { - readonly version$ = defer(() => App.getInfo()).pipe( + readonly version$ = defer(async () => { + let appInfo: AppInfo = { version: '', build: '', id: '', name: '' }; + if (isPlatform('hybrid')) appInfo = await App.getInfo(); + return appInfo; + }).pipe( map(info => { if (info.version === '') return packageInfo.version; return info.version; From 51b9e7716d85277f3caf8539ed0834f21aeebdcc Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Wed, 23 Feb 2022 17:06:26 +0800 Subject: [PATCH 59/81] fix: show tutorial for mobile data --- .../go-pro-media-item-detail-on-camera.component.ts | 5 +---- .../settings/go-pro/services/go-pro-wifi.service.ts | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts index 19d5bce9a..c85192a23 100644 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.ts @@ -51,10 +51,7 @@ export class GoProMediaItemDetailOnCameraComponent implements OnInit { if (allowed) { await this.startUploadToCapture(); - if ( - (await this.goProWiFiService.showTutorialForMobileDataOnlyApps()) === - false - ) { + if (await this.goProWiFiService.showTutorialForMobileDataOnlyApps()) { this.showTutorialForMobileDataOnlyApps = true; } } diff --git a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts index 4561d958f..aa890ce9c 100644 --- a/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts +++ b/src/app/features/settings/go-pro/services/go-pro-wifi.service.ts @@ -42,10 +42,10 @@ export class GoProWifiService { } async showTutorialForMobileDataOnlyApps() { - if (this.platform.is('android') === false) return false; + if (this.platform.is('ios')) return false; const result = await this.preferences.getBoolean( - PrefKeys.SHOW_MOBILE_DATA_TUTORIAL_ON_IOS, + PrefKeys.SHOW_MOBILE_DATA_TUTORIAL, true ); @@ -54,12 +54,12 @@ export class GoProWifiService { async dontShowAgainTutorialForMobileDataOnlyApps() { await this.preferences.setBoolean( - PrefKeys.SHOW_MOBILE_DATA_TUTORIAL_ON_IOS, + PrefKeys.SHOW_MOBILE_DATA_TUTORIAL, false ); } } const enum PrefKeys { - SHOW_MOBILE_DATA_TUTORIAL_ON_IOS = 'GO_PRO_SHOW_MOBILE_DATA_TUTORIAL_ON_IOS', + SHOW_MOBILE_DATA_TUTORIAL = 'GO_PRO_SHOW_MOBILE_DATA_TUTORIAL', } From 5a749594a9055bd72574f81b20d4afc00aa79543 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Wed, 23 Feb 2022 18:05:04 +0800 Subject: [PATCH 60/81] Update dependency to use patched @capacitor/android --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3bc3818a5..83a8fcd31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@capacitor-community/bluetooth-le": "^1.7.0", "@capacitor-community/http": "^1.4.1", "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", - "@capacitor/android": "^3.4.1", + "@capacitor/android": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", @@ -2583,8 +2583,9 @@ }, "node_modules/@capacitor/android": { "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.4.1.tgz", - "integrity": "sha512-4qQGEdZTW8W01PTOzSScmx9NBDcsi1GRl32tyYnpQrjdH2f7hI9OX2MLbNkirtOwKNCDeinQfEqqn0hVCkgHag==", + "resolved": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", + "integrity": "sha512-UcljFzGUBnWHroX/eINEIURBdoKbf78exKzLRo8+iH1JT3DIU/Z+OUoEqKpV86BVQp5IJ0nSBDZ0qUmHNjojTw==", + "license": "MIT", "peerDependencies": { "@capacitor/core": "^3.4.0" } @@ -27100,9 +27101,8 @@ } }, "@capacitor/android": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.4.1.tgz", - "integrity": "sha512-4qQGEdZTW8W01PTOzSScmx9NBDcsi1GRl32tyYnpQrjdH2f7hI9OX2MLbNkirtOwKNCDeinQfEqqn0hVCkgHag==", + "version": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", + "integrity": "sha512-UcljFzGUBnWHroX/eINEIURBdoKbf78exKzLRo8+iH1JT3DIU/Z+OUoEqKpV86BVQp5IJ0nSBDZ0qUmHNjojTw==", "requires": {} }, "@capacitor/app": { diff --git a/package.json b/package.json index b791d7d3f..75a26a1e6 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@capacitor-community/bluetooth-le": "^1.7.0", "@capacitor-community/http": "^1.4.1", "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", - "@capacitor/android": "^3.4.1", + "@capacitor/android": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", From 66972f10b1b00aea26ada0d28aff6312ce325f26 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Thu, 24 Feb 2022 17:59:04 +0800 Subject: [PATCH 61/81] fix(dia-backend-auth.service.ts): pass deviceId.uuid as device_identifier --- src/app/shared/dia-backend/auth/dia-backend-auth.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts b/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts index eab516661..7cd205157 100644 --- a/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts +++ b/src/app/shared/dia-backend/auth/dia-backend-auth.service.ts @@ -189,7 +189,7 @@ export class DiaBackendAuthService { { fcm_token: fcmToken, platform: deviceInfo.platform, - device_identifier: deviceId, + device_identifier: deviceId.uuid, }, { headers } ) From 085369773a868b4cb0bf046874d6b75284f56449 Mon Sep 17 00:00:00 2001 From: "sultanmyrza@gmail.com" Date: Fri, 25 Feb 2022 07:08:15 +0800 Subject: [PATCH 62/81] fix(media-store.service.ts): fix ios thumbnail --- .../media/media-store/media-store.service.ts | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/app/shared/media/media-store/media-store.service.ts b/src/app/shared/media/media-store/media-store.service.ts index 6e1ba4912..69e36aa02 100644 --- a/src/app/shared/media/media-store/media-store.service.ts +++ b/src/app/shared/media/media-store/media-store.service.ts @@ -367,33 +367,34 @@ async function makeVideoThumbnail({ }) { return new Promise((resolve, reject) => { const videoElement = document.createElement('video'); - const canvas = document.createElement('canvas'); - videoElement.addEventListener('error', reject); - canvas.addEventListener('error', reject); - videoElement.addEventListener('canplay', () => { - canvas.width = videoElement.videoWidth; - canvas.height = videoElement.videoHeight; + videoElement.addEventListener('canplay', onCanPlay); + function onCanPlay() { + videoElement.removeEventListener('canplay', onCanPlay); + videoElement.addEventListener('seeked', onSeeked); + const oneSecond = 1; + videoElement.currentTime = Math.min(videoElement.duration || oneSecond); + } + function onSeeked() { + videoElement.removeEventListener('seeked', onSeeked); + const canvas = document.createElement('canvas'); + const { videoWidth, videoHeight } = videoElement; + canvas.width = videoWidth; + canvas.height = videoHeight; const context = canvas.getContext('2d'); if (!context) reject(TypeError('2d context is undefined.')); else { - context.drawImage( - videoElement, - 0, - 0, - videoElement.videoWidth, - videoElement.videoHeight - ); + context.drawImage(videoElement, 0, 0, videoWidth, videoHeight); canvas.toBlob( - blob => { - if (blob) - resolve(makeImageThumbnail({ image: blob, width, quality })); + image => { + if (image) resolve(makeImageThumbnail({ image, width, quality })); else reject(TypeError('canvas.toBlob is null.')); }, 'image/jpeg', quality ); } - }); + } + videoElement.addEventListener('error', reject); videoElement.preload = 'auto'; videoElement.src = videoUrl; videoElement.load(); From f7e18632a1ca064ef770b1c632ffaaec342cf645 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Wed, 9 Mar 2022 16:17:38 +0800 Subject: [PATCH 63/81] fix go-pro bluetooth & wifi tests --- .../go-pro/services/go-pro-bluetooth.service.spec.ts | 6 ++++-- .../settings/go-pro/services/go-pro-wifi.service.spec.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.spec.ts b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.spec.ts index f5a9ff2e5..987106fd1 100644 --- a/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.spec.ts +++ b/src/app/features/settings/go-pro/services/go-pro-bluetooth.service.spec.ts @@ -1,12 +1,14 @@ import { TestBed } from '@angular/core/testing'; - +import { SharedTestingModule } from '../../../../shared/shared-testing.module'; import { GoProBluetoothService } from './go-pro-bluetooth.service'; describe('GoProBluetoothService', () => { let service: GoProBluetoothService; beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ + imports: [SharedTestingModule], + }); service = TestBed.inject(GoProBluetoothService); }); diff --git a/src/app/features/settings/go-pro/services/go-pro-wifi.service.spec.ts b/src/app/features/settings/go-pro/services/go-pro-wifi.service.spec.ts index 48e474fe9..3ecb15698 100644 --- a/src/app/features/settings/go-pro/services/go-pro-wifi.service.spec.ts +++ b/src/app/features/settings/go-pro/services/go-pro-wifi.service.spec.ts @@ -1,12 +1,14 @@ import { TestBed } from '@angular/core/testing'; - +import { SharedTestingModule } from '../../../../shared/shared-testing.module'; import { GoProWifiService } from './go-pro-wifi.service'; describe('GoProWifiService', () => { let service: GoProWifiService; beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ + imports: [SharedTestingModule], + }); service = TestBed.inject(GoProWifiService); }); From 4dc6460481fe190ed685ac673ff37925ce2248aa Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Wed, 9 Mar 2022 16:18:27 +0800 Subject: [PATCH 64/81] fix tests for mock-plugins (AppPlugin, NetworkPlugin) --- src/app/shared/capacitor-plugins/mock-app-plugin.ts | 6 +++++- src/app/shared/capacitor-plugins/mock-network-plugin.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/shared/capacitor-plugins/mock-app-plugin.ts b/src/app/shared/capacitor-plugins/mock-app-plugin.ts index 00193f4e2..1746ab26c 100644 --- a/src/app/shared/capacitor-plugins/mock-app-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-app-plugin.ts @@ -40,7 +40,11 @@ export class MockAppPlugin implements AppPlugin { _eventName: any, _listenerFunc: any ): Promise & PluginListenerHandle { - throw new Error('Method not implemented.'); + // eslint-disable-next-line @typescript-eslint/no-empty-function + const remove = () => {}; + // @ts-expect-error don't know how to mock function that expects + // Promise & PluginListenerHandle at the same + return { remove }; } async removeAllListeners(): Promise { diff --git a/src/app/shared/capacitor-plugins/mock-network-plugin.ts b/src/app/shared/capacitor-plugins/mock-network-plugin.ts index 3b3dc7f23..90c712fbc 100644 --- a/src/app/shared/capacitor-plugins/mock-network-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-network-plugin.ts @@ -15,7 +15,11 @@ export class MockNetworkPlugin implements NetworkPlugin { _eventName: 'networkStatusChange', _listenerFunc: ConnectionStatusChangeListener ): Promise & PluginListenerHandle { - throw new Error('Method not implemented.'); + // eslint-disable-next-line @typescript-eslint/no-empty-function + const remove = () => {}; + // @ts-expect-error don't know how to mock function that expects + // Promise & PluginListenerHandle at the same + return { remove }; } async removeAllListeners(): Promise { From e5f23db79bd4387eb82402c8fbf823bc6dfc7a40 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Thu, 10 Mar 2022 16:24:15 +0800 Subject: [PATCH 65/81] better fix tests for mock-plugins (AppPlugin, NetworkPlugin) --- src/app/shared/capacitor-plugins/mock-app-plugin.ts | 10 ++++++---- .../shared/capacitor-plugins/mock-network-plugin.ts | 11 +++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/app/shared/capacitor-plugins/mock-app-plugin.ts b/src/app/shared/capacitor-plugins/mock-app-plugin.ts index 1746ab26c..5488bec0d 100644 --- a/src/app/shared/capacitor-plugins/mock-app-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-app-plugin.ts @@ -41,10 +41,12 @@ export class MockAppPlugin implements AppPlugin { _listenerFunc: any ): Promise & PluginListenerHandle { // eslint-disable-next-line @typescript-eslint/no-empty-function - const remove = () => {}; - // @ts-expect-error don't know how to mock function that expects - // Promise & PluginListenerHandle at the same - return { remove }; + const remove = async () => {}; + const listenerHandler: any = Promise.resolve({ remove }); + Object.defineProperty(listenerHandler, 'remove', { + value: async () => Promise.resolve({ remove }), + }); + return listenerHandler; } async removeAllListeners(): Promise { diff --git a/src/app/shared/capacitor-plugins/mock-network-plugin.ts b/src/app/shared/capacitor-plugins/mock-network-plugin.ts index 90c712fbc..b7bfbafa0 100644 --- a/src/app/shared/capacitor-plugins/mock-network-plugin.ts +++ b/src/app/shared/capacitor-plugins/mock-network-plugin.ts @@ -16,10 +16,13 @@ export class MockNetworkPlugin implements NetworkPlugin { _listenerFunc: ConnectionStatusChangeListener ): Promise & PluginListenerHandle { // eslint-disable-next-line @typescript-eslint/no-empty-function - const remove = () => {}; - // @ts-expect-error don't know how to mock function that expects - // Promise & PluginListenerHandle at the same - return { remove }; + // eslint-disable-next-line @typescript-eslint/no-empty-function + const remove = async () => {}; + const listenerHandler: any = Promise.resolve({ remove }); + Object.defineProperty(listenerHandler, 'remove', { + value: async () => Promise.resolve({ remove }), + }); + return listenerHandler; } async removeAllListeners(): Promise { From 29713f05aad0458f5c58c8a8eac8699e17bcada1 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Tue, 15 Mar 2022 16:07:17 +0800 Subject: [PATCH 66/81] install capcitor wifi, android plugins from numbersprotocol repository --- package-lock.json | 20 ++++++++++---------- package.json | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 83a8fcd31..4df59754f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,8 +19,8 @@ "@angular/router": "^12.2.4", "@capacitor-community/bluetooth-le": "^1.7.0", "@capacitor-community/http": "^1.4.1", - "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", - "@capacitor/android": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", + "@capacitor-community/wifi": "github:numbersprotocol/community-capacitor-wifi#capacitor3", + "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-3.4.1-range-request-fix", "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", @@ -2572,7 +2572,7 @@ }, "node_modules/@capacitor-community/wifi": { "version": "0.0.1", - "resolved": "git+ssh://git@github.com/sultanmyrza/community-capacitor-wifi.git#968e5c2427a78d7903d63ec56610aee749cffe4a", + "resolved": "git+ssh://git@github.com/numbersprotocol/community-capacitor-wifi.git#968e5c2427a78d7903d63ec56610aee749cffe4a", "license": "MIT", "dependencies": { "node-wifi": "~2.0.15" @@ -2582,9 +2582,9 @@ } }, "node_modules/@capacitor/android": { - "version": "3.4.1", - "resolved": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", - "integrity": "sha512-UcljFzGUBnWHroX/eINEIURBdoKbf78exKzLRo8+iH1JT3DIU/Z+OUoEqKpV86BVQp5IJ0nSBDZ0qUmHNjojTw==", + "version": "3.4.3", + "resolved": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-3.4.1-range-request-fix", + "integrity": "sha512-bHNttmfq0nlmnCWZjpFz035DFbIHg8N5nWeF7v5dityHcVGFFZ4p6ePH6SEKOEwACMnNNfjfnvaGfqANndRiBQ==", "license": "MIT", "peerDependencies": { "@capacitor/core": "^3.4.0" @@ -27094,15 +27094,15 @@ } }, "@capacitor-community/wifi": { - "version": "git+ssh://git@github.com/sultanmyrza/community-capacitor-wifi.git#968e5c2427a78d7903d63ec56610aee749cffe4a", - "from": "@capacitor-community/wifi@github:sultanmyrza/community-capacitor-wifi#capacitor3", + "version": "git+ssh://git@github.com/numbersprotocol/community-capacitor-wifi.git#968e5c2427a78d7903d63ec56610aee749cffe4a", + "from": "@capacitor-community/wifi@github:numbersprotocol/community-capacitor-wifi#capacitor3", "requires": { "node-wifi": "~2.0.15" } }, "@capacitor/android": { - "version": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", - "integrity": "sha512-UcljFzGUBnWHroX/eINEIURBdoKbf78exKzLRo8+iH1JT3DIU/Z+OUoEqKpV86BVQp5IJ0nSBDZ0qUmHNjojTw==", + "version": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-3.4.1-range-request-fix", + "integrity": "sha512-bHNttmfq0nlmnCWZjpFz035DFbIHg8N5nWeF7v5dityHcVGFFZ4p6ePH6SEKOEwACMnNNfjfnvaGfqANndRiBQ==", "requires": {} }, "@capacitor/app": { diff --git a/package.json b/package.json index 75a26a1e6..9a034265e 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "@angular/router": "^12.2.4", "@capacitor-community/bluetooth-le": "^1.7.0", "@capacitor-community/http": "^1.4.1", - "@capacitor-community/wifi": "github:sultanmyrza/community-capacitor-wifi#capacitor3", - "@capacitor/android": "https://gitpkg.now.sh/sultanmyrza/capacitor/android?release-3.4.1-range-request-fix", + "@capacitor-community/wifi": "github:numbersprotocol/community-capacitor-wifi#capacitor3", + "@capacitor/android": "https://gitpkg.now.sh/numbersprotocol/capacitor/android?release-3.4.1-range-request-fix", "@capacitor/app": "^1.1.0", "@capacitor/browser": "^1.0.7", "@capacitor/camera": "^1.3.0", From 6b60d54980500b93dbadd5cf71a61b35a389d723 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Tue, 15 Mar 2022 17:11:59 +0800 Subject: [PATCH 67/81] fix(profile.page.ts): remove unused imports --- src/app/features/profile/profile.page.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/features/profile/profile.page.ts b/src/app/features/profile/profile.page.ts index 7183f6510..b96aa8625 100644 --- a/src/app/features/profile/profile.page.ts +++ b/src/app/features/profile/profile.page.ts @@ -1,9 +1,5 @@ import { Component } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; -import { Browser } from '@capacitor/browser'; -import { Clipboard } from '@capacitor/clipboard'; import { AlertController } from '@ionic/angular'; import { TranslocoService } from '@ngneat/transloco'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; From c78368d5bcf512317bf8f1b6c9a12759f8437fe5 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Tue, 15 Mar 2022 17:14:45 +0800 Subject: [PATCH 68/81] fix(wallets.page.ts): import Browser, Clipboard from @capacitor packages --- src/app/features/wallets/wallets.page.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/features/wallets/wallets.page.ts b/src/app/features/wallets/wallets.page.ts index 55ee505f2..d0776b210 100644 --- a/src/app/features/wallets/wallets.page.ts +++ b/src/app/features/wallets/wallets.page.ts @@ -3,7 +3,8 @@ import { MatDialog } from '@angular/material/dialog'; import { MatIconRegistry } from '@angular/material/icon'; import { MatSnackBar } from '@angular/material/snack-bar'; import { DomSanitizer } from '@angular/platform-browser'; -import { Plugins } from '@capacitor/core'; +import { Browser } from '@capacitor/browser'; +import { Clipboard } from '@capacitor/clipboard'; import { TranslocoService } from '@ngneat/transloco'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { BehaviorSubject } from 'rxjs'; @@ -12,8 +13,6 @@ import { WebCryptoApiSignatureProvider } from '../../shared/collector/signature/ import { ConfirmAlert } from '../../shared/confirm-alert/confirm-alert.service'; import { DiaBackendWalletService } from '../../shared/dia-backend/wallet/dia-backend-wallet.service'; import { ExportPrivateKeyModalComponent } from '../../shared/export-private-key-modal/export-private-key-modal.component'; - -const { Browser, Clipboard } = Plugins; @UntilDestroy({ checkProperties: true }) @Component({ selector: 'app-wallets', From 47efb195896dd12ed58283b9f380dcbfcac28872 Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Tue, 15 Mar 2022 18:06:24 +0800 Subject: [PATCH 69/81] add translation for GoPro related features --- ...media-item-detail-on-camera.component.html | 2 +- ...go-pro-media-list-on-camera.component.html | 40 +++++++++++-------- src/assets/i18n/en-us.json | 19 +++++++++ src/assets/i18n/zh-tw.json | 19 +++++++++ 4 files changed, 62 insertions(+), 18 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html index 307d5dd93..1ce9a20cf 100644 --- a/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html +++ b/src/app/features/settings/go-pro/go-pro-media-item-detail-on-camera/go-pro-media-item-detail-on-camera.component.html @@ -31,7 +31,7 @@ expand="block" class="upload-to-capture-btn" > - Upload to capture directly from camera + {{ t('gopro.uploadToCapture') }} diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html index 5c4814321..8a500f0f5 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html @@ -3,7 +3,7 @@ - GoPro Media on Camera + {{ t('gopro.goProMediaOnCamera') }} @@ -11,7 +11,7 @@ close - {{ selectedGoProFiles.length }} file(s) selected + {{ t('gopro.filesSelected', { count: selectedGoProFiles.length }) }} @@ -20,15 +20,15 @@ -
-

Connected WiFi: {{ connectedWifiSSID }}

+
+

{{ t('gopro.connectedWiFi') }}: {{ connectedWifiSSID }}

- Connect to go pro WiFi (enable first) + {{ t('gopro.connectToGoProWiFiEnableFirst') }} Connected WiFi: {{ connectedWifiSSID }}

(click)="uploadSelectedFiles()" class="multi-select-mode-btn" > - Upload to capture + {{ t('gopro.uploadToCapture') }}

- Make sure you connected to GoPro WiFi first + {{ t('gopro.makeSureYouAreConnectedToGoProWiFiFirst') }}

{{ fetchingFilesError }}
- Hint: click refresh button at top right. + {{ t('gopro.hintClickTheRefreshButtonAtTheTopRight') }}

-

Fetching files...

+

{{ t('gopro.fetchingFiles') }}...

- Stay on this screen with the app open to ensure your downloads complete! + {{ + t('gopro.stayOnThisScreenWithTheAppOpenToEnsureYourDownloadsAreComplete') + }} - + + + Date: Wed, 16 Mar 2022 10:54:04 +0800 Subject: [PATCH 70/81] edit translation (remove enable wifi) --- .../go-pro-media-list-on-camera.component.html | 2 +- src/assets/i18n/en-us.json | 2 +- src/assets/i18n/zh-tw.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html index 8a500f0f5..7f3854597 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.html @@ -28,7 +28,7 @@

{{ t('gopro.connectedWiFi') }}: {{ connectedWifiSSID }}

(click)="connectToGoProWifi()" class="connect-to-go-pro-wifi-btn" > - {{ t('gopro.connectToGoProWiFiEnableFirst') }} + {{ t('gopro.connectToGoProWiFi') }} Date: Wed, 16 Mar 2022 11:02:29 +0800 Subject: [PATCH 71/81] bugfix hide connect to go pro wifi button after connecting to go pro wifi --- .../go-pro-media-list-on-camera.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts index 13eacd525..f57c7538c 100644 --- a/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts +++ b/src/app/features/settings/go-pro/go-pro-media-list-on-camera/go-pro-media-list-on-camera.component.ts @@ -75,6 +75,7 @@ export class GoProMediaListOnCameraComponent implements OnInit { async connectToGoProWifi() { try { this.connectedWifiSSID = await this.goProWifiService.connectToGoProWiFi(); + this.isConnectedToGoProWifi = true; await this.fetchFilesFromGoProWiFi(); } catch (error) { this.presentToast(JSON.stringify(error)); From 06062217ec7919fe8ef267e322a068aff078fc12 Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Mon, 28 Mar 2022 10:54:37 +0800 Subject: [PATCH 72/81] feat: warn user that the asset will become public when share asset profile --- src/app/features/home/details/details.page.ts | 16 ++++++++++++---- src/assets/i18n/en-us.json | 1 + src/assets/i18n/zh-tw.json | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index a4610a24f..07257241c 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -265,7 +265,7 @@ export class DetailsPage { concatMap( ([ diaBackendAsset, - [messageCopyIpfsAddress, messageShareC2paPhoto], + [messageCopyIpfsAddress, messageShareAssetProfile], ]) => new Promise(resolve => { const buttons: ActionSheetButton[] = []; @@ -281,9 +281,17 @@ export class DetailsPage { } if (diaBackendAsset?.cai_file) { buttons.push({ - text: messageShareC2paPhoto, - handler: () => { - this.share(); + text: messageShareAssetProfile, + handler: async () => { + const result = await this.confirmAlert.present({ + message: + this.translocoService.translate( + 'message.assetBecomePublicAfterSharing' + ) + '!', + }); + if (result) { + this.share(); + } resolve(); }, }); diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index 35780229f..876d330a7 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -179,6 +179,7 @@ "verificationSuccess": "Success", "copyIpfsAddress": "Copy IPFS address", "shareAssetProfile": "Share Asset Profile", + "assetBecomePublicAfterSharing": "This asset will become public after sharing", "mintNftToken": "Mint NFT token", "mintNftAlert": "Once the NFT is minted, photo and its information can be accessed publicly. Do you still want to proceed?", "sentSuccessfully": "Sent Successfully", diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index aa86acb33..d7db3233d 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -179,6 +179,7 @@ "verificationSuccess": "驗證成功", "copyIpfsAddress": "複製 IPFS 位址", "shareAssetProfile": "分享資產檔案", + "assetBecomePublicAfterSharing": "該資產將在分享後公開", "mintNftToken": "鑄造 NFT 代幣", "mintNftAlert": "NFT 代幣鑄造後,影像以及所有資訊都將可被公開檢視。確定要繼續嗎?", "sentSuccessfully": "成功送出", From 1518ffeb17d6f5661f568c41ebd5ac080a38ae69 Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Mon, 28 Mar 2022 11:35:08 +0800 Subject: [PATCH 73/81] feat: add loading indicator at capture transactions history page --- .../capture-transactions.component.html | 2 ++ .../capture-transactions.component.scss | 7 +++++++ .../capture-transactions.component.ts | 12 +++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/app/features/home/activities/capture-transactions/capture-transactions.component.html b/src/app/features/home/activities/capture-transactions/capture-transactions.component.html index fe15c1e6b..100499c58 100644 --- a/src/app/features/home/activities/capture-transactions/capture-transactions.component.html +++ b/src/app/features/home/activities/capture-transactions/capture-transactions.component.html @@ -1,3 +1,5 @@ + +
diff --git a/src/app/features/home/activities/capture-transactions/capture-transactions.component.scss b/src/app/features/home/activities/capture-transactions/capture-transactions.component.scss index 5fcf1d267..70e2d879e 100644 --- a/src/app/features/home/activities/capture-transactions/capture-transactions.component.scss +++ b/src/app/features/home/activities/capture-transactions/capture-transactions.component.scss @@ -1,3 +1,10 @@ +mat-spinner { + margin-left: auto; + margin-right: auto; + margin-top: 10%; + width: 100%; +} + #empty-transaction-msg { text-align: center; color: gray; diff --git a/src/app/features/home/activities/capture-transactions/capture-transactions.component.ts b/src/app/features/home/activities/capture-transactions/capture-transactions.component.ts index d2ca80c27..e4270a76d 100644 --- a/src/app/features/home/activities/capture-transactions/capture-transactions.component.ts +++ b/src/app/features/home/activities/capture-transactions/capture-transactions.component.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; -import { catchError, map, shareReplay } from 'rxjs/operators'; +import { BehaviorSubject, of } from 'rxjs'; +import { catchError, finalize, map, shareReplay, take } from 'rxjs/operators'; import { DiaBackendAuthService } from '../../../../shared/dia-backend/auth/dia-backend-auth.service'; import { DiaBackendTransactionRepository } from '../../../../shared/dia-backend/transaction/dia-backend-transaction-repository.service'; import { ErrorService } from '../../../../shared/error/error.service'; @@ -13,17 +14,22 @@ import { getStatus } from '../capture-transaction-details/capture-transaction-de export class CaptureTransactionsComponent { readonly transactionsWithStatus$ = this.diaBackendTransactionRepository.all$.pipe( - catchError((err: unknown) => this.errorService.toastError$(err)), + take(1), map(transactions => transactions.results.map(transaction => ({ ...transaction, status: getStatus(transaction, this.diaBackendAuthService.getEmail()), })) ), + catchError((err: unknown) => { + this.errorService.toastError$(err).subscribe(); + return of([]); + }), + finalize(() => this.isFetching$.next(false)), shareReplay({ bufferSize: 1, refCount: true }) ); - readonly isFetching$ = this.diaBackendTransactionRepository.isFetching$; + readonly isFetching$ = new BehaviorSubject(true); constructor( private readonly diaBackendAuthService: DiaBackendAuthService, From d6cb38fa757573d1f5a5fd0826d32ae3ae6d8081 Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Mon, 28 Mar 2022 14:28:33 +0800 Subject: [PATCH 74/81] feat: support optional network action parameters --- .../actions/actions-dialog/actions-dialog.component.ts | 8 +++++--- src/app/shared/actions/service/actions.service.ts | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/shared/actions/actions-dialog/actions-dialog.component.ts b/src/app/shared/actions/actions-dialog/actions-dialog.component.ts index 3b0e4b57d..dc89c7676 100644 --- a/src/app/shared/actions/actions-dialog/actions-dialog.component.ts +++ b/src/app/shared/actions/actions-dialog/actions-dialog.component.ts @@ -38,6 +38,8 @@ export class ActionsDialogComponent { private createFormFields() { for (const param of this.params) { + const isOptional = param.optional_boolean ?? false; + if (param.type_text === 'dropdown') this.fields.push({ key: param.name_text, @@ -49,7 +51,7 @@ export class ActionsDialogComponent { })), placeholder: param.placeholder_text, disabled: !param.user_input_boolean, - required: true, + required: !isOptional, }, }); else if (param.type_text === 'number') @@ -63,7 +65,7 @@ export class ActionsDialogComponent { disabled: !param.user_input_boolean, max: param.max_number, min: param.min_number, - required: true, + required: !isOptional, }, }); else @@ -75,7 +77,7 @@ export class ActionsDialogComponent { label: param.display_text_text, placeholder: param.placeholder_text, disabled: !param.user_input_boolean, - required: true, + required: !isOptional, }, }); } diff --git a/src/app/shared/actions/service/actions.service.ts b/src/app/shared/actions/service/actions.service.ts index e0c56d565..16b9ceb9c 100644 --- a/src/app/shared/actions/service/actions.service.ts +++ b/src/app/shared/actions/service/actions.service.ts @@ -55,6 +55,7 @@ export interface Param { readonly user_input_boolean: boolean; readonly max_number: number; readonly min_number: number; + readonly optional_boolean?: boolean; } export interface GetActionsResponse { From 6589ef4e83c3ddac220bb7cb6f5d7f13c6498e9e Mon Sep 17 00:00:00 2001 From: sultanmyrza Date: Mon, 28 Mar 2022 20:31:21 +0800 Subject: [PATCH 75/81] fix(share.service.ts): merge conflict --- src/app/shared/share/share.service.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/app/shared/share/share.service.ts b/src/app/shared/share/share.service.ts index d41ded8c8..3695c9ad9 100644 --- a/src/app/shared/share/share.service.ts +++ b/src/app/shared/share/share.service.ts @@ -1,11 +1,7 @@ -import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Plugins } from '@capacitor/core'; +import { Share } from '@capacitor/share'; import { catchError } from 'rxjs/operators'; import { getAssetProfileUrl } from '../../utils/url'; -import { Share } from '@capacitor/share'; -import { concatMap, first, map } from 'rxjs/operators'; -import { blobToBase64 } from '../../utils/encoding/encoding'; import { DiaBackendAsset, DiaBackendAssetRepository, From 8a0a19465b08dc3f0fc921495320e6016875e5f0 Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Tue, 29 Mar 2022 20:23:41 +0800 Subject: [PATCH 76/81] feat: support 0 parameter network action --- src/app/features/home/details/actions/actions.page.ts | 2 +- src/app/shared/actions/service/actions.service.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/features/home/details/actions/actions.page.ts b/src/app/features/home/details/actions/actions.page.ts index e64878f90..f6bdc71dd 100644 --- a/src/app/features/home/details/actions/actions.page.ts +++ b/src/app/features/home/details/actions/actions.page.ts @@ -119,7 +119,7 @@ export class ActionsPage { openActionDialog$(action: Action) { return combineLatest([ - this.actionsService.getParams$(action.params_list_custom_param1), + this.actionsService.getParams$(action.params_list_custom_param1 ?? []), this.authService.token$, this.id$, ]).pipe( diff --git a/src/app/shared/actions/service/actions.service.ts b/src/app/shared/actions/service/actions.service.ts index 16b9ceb9c..f177d078d 100644 --- a/src/app/shared/actions/service/actions.service.ts +++ b/src/app/shared/actions/service/actions.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { defer, forkJoin } from 'rxjs'; +import { defer, forkJoin, of } from 'rxjs'; import { map } from 'rxjs/operators'; import { BUBBLE_DB_URL } from '../../dia-backend/secret'; @@ -19,6 +19,7 @@ export class ActionsService { } getParams$(ids: string[]) { + if (ids.length === 0) return of([]); return defer(() => forkJoin( ids.map(id => @@ -40,7 +41,7 @@ export interface Action { readonly banner_image_url_text: string; readonly base_url_text: string; readonly description_text: string; - readonly params_list_custom_param1: string[]; + readonly params_list_custom_param1?: string[]; readonly title_text: string; readonly network_app_id_text: string; } From 77e4510b1cf93114b5096ca6301f730abbbdd1fa Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Wed, 30 Mar 2022 13:26:21 +0800 Subject: [PATCH 77/81] feat: add bubble db api token for creating network action order history --- .github/workflows/build.yml | 2 ++ .github/workflows/pre-release.yml | 3 +++ .github/workflows/uiux-release.yml | 1 + README.md | 3 ++- set-secret.js | 1 + src/app/shared/actions/service/order-history.service.ts | 5 ++++- 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b558f93fd..e3e067739 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,6 +76,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: npm run build - name: Build Android @@ -109,6 +110,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: npm run build - name: Import the Code-Signing PKCS12 Certificate diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 02dc7111f..33555c151 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -30,6 +30,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install @@ -90,6 +91,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install @@ -242,6 +244,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install diff --git a/.github/workflows/uiux-release.yml b/.github/workflows/uiux-release.yml index 4816265f2..93abb0481 100644 --- a/.github/workflows/uiux-release.yml +++ b/.github/workflows/uiux-release.yml @@ -20,6 +20,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install diff --git a/README.md b/README.md index f7ed1aafa..0e13bb045 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ Set the system environment variables `NUMBERS_STORAGE_BASE_URL`, `NUMBERS_STORAG ```txt export NUMBERS_STORAGE_BASE_URL="THE PRIVATE BASE URL" export NUMBERS_STORAGE_TRUSTED_CLIENT_KEY="THE TRUSTED CLIENT KEY" -export NUMBERS_BUBBLE_DB_URL="THE BUBBLE DB URL" +export NUMBERS_BUBBLE_DB_URL="BUBBLE DB URL" +export BUBBLE_DB_API_TOKEN="BUBBLE DB API TOKEN" ``` Preview the app in web browser. diff --git a/set-secret.js b/set-secret.js index 4f1ab3771..5542168fa 100644 --- a/set-secret.js +++ b/set-secret.js @@ -8,6 +8,7 @@ const envConfigFile = ` export const BASE_URL = '${process.env.NUMBERS_STORAGE_BASE_URL}'; export const TRUSTED_CLIENT_KEY = '${process.env.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY}'; export const BUBBLE_DB_URL = '${process.env.NUMBERS_BUBBLE_DB_URL}'; +export const BUBBLE_DB_API_TOKEN = '${process.env.NUMBERS_BUBBLE_DB_API_TOKEN}'; `; fs.writeFile(targetPath, envConfigFile, err => { if (err) { diff --git a/src/app/shared/actions/service/order-history.service.ts b/src/app/shared/actions/service/order-history.service.ts index 9aa3f8d48..49e1418c7 100644 --- a/src/app/shared/actions/service/order-history.service.ts +++ b/src/app/shared/actions/service/order-history.service.ts @@ -5,7 +5,7 @@ import { BehaviorSubject, combineLatest, defer, EMPTY, Observable } from 'rxjs'; import { concatMap, first, map, pluck, tap } from 'rxjs/operators'; import { WebCryptoApiSignatureProvider } from '../../collector/signature/web-crypto-api-signature-provider/web-crypto-api-signature-provider.service'; import { DiaBackendAssetRepository } from '../../dia-backend/asset/dia-backend-asset-repository.service'; -import { BUBBLE_DB_URL } from '../../dia-backend/secret'; +import { BUBBLE_DB_API_TOKEN, BUBBLE_DB_URL } from '../../dia-backend/secret'; import { NetworkAppOrder } from '../../dia-backend/store/dia-backend-store.service'; import { DiaBackendTransactionRepository } from '../../dia-backend/transaction/dia-backend-transaction-repository.service'; import { Proof } from '../../repositories/proof/proof'; @@ -64,6 +64,9 @@ export class OrderHistoryService { status_text: OrderStatus.Submitted, total_cost_number: Number(networkAppOrder.total_cost), uid_text: publicKey, + }, + { + headers: { authorization: `Bearer ${BUBBLE_DB_API_TOKEN}` }, } ) ) From 6f3b8463fe8594fdfa6df69092b1a2ae220524e3 Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Wed, 30 Mar 2022 15:50:32 +0800 Subject: [PATCH 78/81] fix: add bubble_db_api_token secrets for build-apks --- .github/workflows/build-apks.yml | 7 +++++++ .github/workflows/pre-release.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/build-apks.yml b/.github/workflows/build-apks.yml index 169e9a69b..6259fceeb 100644 --- a/.github/workflows/build-apks.yml +++ b/.github/workflows/build-apks.yml @@ -15,26 +15,32 @@ jobs: storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-qa storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-qa storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-dev-bubble-prod storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-prod storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-prod storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN steps: - uses: actions/checkout@v2 @@ -54,6 +60,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets[matrix.storage_base_url] }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets[matrix.storage_trusted_client_key] }} NUMBERS_BUBBLE_DB_URL: ${{ secrets[matrix.bubble_db_url] }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets[matrix.bubble_db_api_token] }} run: | npm install -g @ionic/cli npm install diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 33555c151..2972453b6 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -162,26 +162,32 @@ jobs: storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-qa storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-qa storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-dev-bubble-prod storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-prod storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-prod storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL + bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN steps: - uses: actions/checkout@v2 @@ -201,6 +207,7 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets[matrix.storage_base_url] }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets[matrix.storage_trusted_client_key] }} NUMBERS_BUBBLE_DB_URL: ${{ secrets[matrix.bubble_db_url] }} + NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets[matrix.bubble_db_api_token] }} run: | npm install -g @ionic/cli npm install From 4bf55e3367d6d59e10e4954109766b43338b198f Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Wed, 30 Mar 2022 18:17:45 +0800 Subject: [PATCH 79/81] feat: show insufficient NUM in order confirm dialog if applicable --- .../home/details/actions/actions.page.ts | 31 +++++--- .../store/dia-backend-store.service.ts | 4 + .../wallet/dia-backend-wallet.service.ts | 9 ++- .../order-detail-dialog.component.html | 78 +++++++++++-------- .../order-detail-dialog.component.ts | 6 ++ src/assets/i18n/en-us.json | 1 + src/assets/i18n/zh-tw.json | 1 + 7 files changed, 87 insertions(+), 43 deletions(-) diff --git a/src/app/features/home/details/actions/actions.page.ts b/src/app/features/home/details/actions/actions.page.ts index f6bdc71dd..158de2e34 100644 --- a/src/app/features/home/details/actions/actions.page.ts +++ b/src/app/features/home/details/actions/actions.page.ts @@ -4,7 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute } from '@angular/router'; import { TranslocoService } from '@ngneat/transloco'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { combineLatest, forkJoin, of } from 'rxjs'; +import { combineLatest, forkJoin, iif, of } from 'rxjs'; import { catchError, concatMap, first, map, take, tap } from 'rxjs/operators'; import { ActionsDialogComponent } from '../../../../shared/actions/actions-dialog/actions-dialog.component'; import { @@ -19,6 +19,7 @@ import { DiaBackendStoreService, NetworkAppOrder, } from '../../../../shared/dia-backend/store/dia-backend-store.service'; +import { DiaBackendWalletService } from '../../../../shared/dia-backend/wallet/dia-backend-wallet.service'; import { ErrorService } from '../../../../shared/error/error.service'; import { OrderDetailDialogComponent } from '../../../../shared/order-detail-dialog/order-detail-dialog.component'; import { @@ -54,7 +55,8 @@ export class ActionsPage { private readonly storeService: DiaBackendStoreService, private readonly orderHistoryService: OrderHistoryService, private readonly diaBackendStoreService: DiaBackendStoreService, - private readonly diaBackendSeriesRepository: DiaBackendSeriesRepository + private readonly diaBackendSeriesRepository: DiaBackendSeriesRepository, + private readonly diaBackendWalletService: DiaBackendWalletService ) {} canPerformAction$(action: Action) { @@ -201,16 +203,27 @@ export class ActionsPage { catchError((err: unknown) => { return this.errorService.toastError$(err); }), - concatMap(() => this.openActionDialog$(action)), - concatMap(createOrderInput => + concatMap(() => + combineLatest([this.openActionDialog$(action), of(action)]) + ), + concatMap(([createOrderInput, action]) => this.blockingActionService.run$( - this.createOrder$( - createOrderInput.networkApp, - createOrderInput.actionArgs - ) + forkJoin([ + this.createOrder$( + createOrderInput.networkApp, + createOrderInput.actionArgs + ), + // To display "Insufficient NUM" in order confirmation dialog, + // we need to sync asset wallet balance if the action cost NUM. + iif( + () => action.action_cost_number > 0, + this.diaBackendWalletService.syncAssetWalletBalance$(), + VOID$ + ), + ]) ) ), - concatMap(orderStatus => this.openOrderDialog$(orderStatus)), + concatMap(([orderStatus, _]) => this.openOrderDialog$(orderStatus)), concatMap(orderId => this.blockingActionService.run$(this.confirmOrder$(orderId)) ), diff --git a/src/app/shared/dia-backend/store/dia-backend-store.service.ts b/src/app/shared/dia-backend/store/dia-backend-store.service.ts index a55f8397a..ef4374220 100644 --- a/src/app/shared/dia-backend/store/dia-backend-store.service.ts +++ b/src/app/shared/dia-backend/store/dia-backend-store.service.ts @@ -67,6 +67,10 @@ export interface NetworkAppOrder { action_args: Record; price: string; fee: string | null; + num_charged: string; + num_paid: string; + points_charged: string; + points_paid: string; total_cost: string; quantity: number; fund_crypto_transaction_id: string; diff --git a/src/app/shared/dia-backend/wallet/dia-backend-wallet.service.ts b/src/app/shared/dia-backend/wallet/dia-backend-wallet.service.ts index d0630b3f3..a3369506b 100644 --- a/src/app/shared/dia-backend/wallet/dia-backend-wallet.service.ts +++ b/src/app/shared/dia-backend/wallet/dia-backend-wallet.service.ts @@ -1,7 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { combineLatest, defer, forkJoin } from 'rxjs'; -import { concatMap, first } from 'rxjs/operators'; +import { catchError, concatMap, first } from 'rxjs/operators'; +import { ErrorService } from '../../error/error.service'; import { NetworkService } from '../../network/network.service'; import { PreferenceManager } from '../../preference-manager/preference-manager.service'; import { DiaBackendAuthService } from '../auth/dia-backend-auth.service'; @@ -41,7 +42,8 @@ export class DiaBackendWalletService { private readonly httpClient: HttpClient, private readonly authService: DiaBackendAuthService, private readonly networkService: NetworkService, - private readonly preferenceManager: PreferenceManager + private readonly preferenceManager: PreferenceManager, + private readonly errorService: ErrorService ) {} getIntegrityWallet$() { @@ -97,7 +99,8 @@ export class DiaBackendWalletService { diaBackendWallet.address ), ]) - ) + ), + catchError((err: unknown) => this.errorService.toastDiaBackendError$(err)) ); } diff --git a/src/app/shared/order-detail-dialog/order-detail-dialog.component.html b/src/app/shared/order-detail-dialog/order-detail-dialog.component.html index 68c4c5d59..207157c27 100644 --- a/src/app/shared/order-detail-dialog/order-detail-dialog.component.html +++ b/src/app/shared/order-detail-dialog/order-detail-dialog.component.html @@ -1,33 +1,49 @@
-

{{ t('payment.confirmPayment') }}

- - - {{ t('payment.price') }} - - - {{ orderStatus.price | number: '1.2-2' }} NUM - - - - - {{ t('payment.fee') }} - - - {{ orderStatus.fee | number: '1.2-2' }} NUM - - - - - {{ t('payment.totalCost') }} - - - {{ orderStatus.total_cost | number: '1.2-2' }} NUM - - - - - - +
+

{{ t('payment.confirmPayment') }}

+ + + {{ t('payment.price') }} + + + {{ orderStatus.price | number: '1.2-2' }} NUM + + + + + {{ t('payment.fee') }} + + + {{ orderStatus.fee | number: '1.2-2' }} NUM + + + + + {{ t('payment.totalCost') }} + + + {{ orderStatus.total_cost | number: '1.2-2' }} NUM + + + + + {{ + t('insufficientNum') + }} + + + + + + +
diff --git a/src/app/shared/order-detail-dialog/order-detail-dialog.component.ts b/src/app/shared/order-detail-dialog/order-detail-dialog.component.ts index 2039081e2..409592be9 100644 --- a/src/app/shared/order-detail-dialog/order-detail-dialog.component.ts +++ b/src/app/shared/order-detail-dialog/order-detail-dialog.component.ts @@ -1,6 +1,7 @@ import { Component, Inject } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { NetworkAppOrder } from '../dia-backend/store/dia-backend-store.service'; +import { DiaBackendWalletService } from '../dia-backend/wallet/dia-backend-wallet.service'; @Component({ selector: 'app-order-detail-dialog', @@ -9,12 +10,17 @@ import { NetworkAppOrder } from '../dia-backend/store/dia-backend-store.service' }) export class OrderDetailDialogComponent { readonly orderStatus: NetworkAppOrder; + num_charged = 0; + readonly asset_wallet_bsc_num_balance$ = + this.diaBackendWalletService.assetWalletBscNumBalance$; constructor( private readonly dialogRef: MatDialogRef, + private readonly diaBackendWalletService: DiaBackendWalletService, @Inject(MAT_DIALOG_DATA) public data: NetworkAppOrder ) { this.orderStatus = data; + this.num_charged = Number(data.num_charged); } ok() { diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index 9142b9586..0bd9175bc 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -108,6 +108,7 @@ "order": "Order", "resultUrl": "Result URL", "noResultUrlAvailable": "No Result URL available", + "insufficientNum": "Insufficient NUM", "verification": { "verification": "Verification", "clickToVerify": "Click me to verify", diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index 5cf5e7ef5..656ecab2f 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -107,6 +107,7 @@ "copyToClipboard": "複製到剪貼簿", "order": "訂單", "resultUrl": "結果連結", + "insufficientNum": "NUM 餘額不足", "noResultUrlAvailable": "沒有可以顯示的結果連結", "verification": { "verification": "驗證", From 063b6e7fd5fa8a121fc337e66c6bd5af029624fb Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 31 Mar 2022 01:39:06 -0400 Subject: [PATCH 80/81] Revert "feat: add bubble db api token for creating network action order history" --- .github/workflows/build-apks.yml | 7 ------- .github/workflows/build.yml | 2 -- .github/workflows/pre-release.yml | 10 ---------- .github/workflows/uiux-release.yml | 1 - README.md | 3 +-- set-secret.js | 1 - .../shared/actions/service/order-history.service.ts | 5 +---- 7 files changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-apks.yml b/.github/workflows/build-apks.yml index 6259fceeb..169e9a69b 100644 --- a/.github/workflows/build-apks.yml +++ b/.github/workflows/build-apks.yml @@ -15,32 +15,26 @@ jobs: storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-qa storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-qa storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-dev-bubble-prod storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-prod storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-prod storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN steps: - uses: actions/checkout@v2 @@ -60,7 +54,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets[matrix.storage_base_url] }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets[matrix.storage_trusted_client_key] }} NUMBERS_BUBBLE_DB_URL: ${{ secrets[matrix.bubble_db_url] }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets[matrix.bubble_db_api_token] }} run: | npm install -g @ionic/cli npm install diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3e067739..b558f93fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: npm run build - name: Build Android @@ -110,7 +109,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: npm run build - name: Import the Code-Signing PKCS12 Certificate diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 2972453b6..02dc7111f 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -30,7 +30,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install @@ -91,7 +90,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install @@ -162,32 +160,26 @@ jobs: storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-qa storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-qa storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-dev-bubble-prod storage_base_url: NUMBERS_STORAGE_DEV_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_DEV_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-qa-bubble-prod storage_base_url: NUMBERS_STORAGE_QA_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_QA_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN - folder_name: storage-prod-bubble-prod storage_base_url: NUMBERS_STORAGE_BASE_URL storage_trusted_client_key: NUMBERS_STORAGE_TRUSTED_CLIENT_KEY bubble_db_url: NUMBERS_BUBBLE_DB_URL - bubble_db_api_token: NUMBERS_BUBBLE_DB_API_TOKEN steps: - uses: actions/checkout@v2 @@ -207,7 +199,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets[matrix.storage_base_url] }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets[matrix.storage_trusted_client_key] }} NUMBERS_BUBBLE_DB_URL: ${{ secrets[matrix.bubble_db_url] }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets[matrix.bubble_db_api_token] }} run: | npm install -g @ionic/cli npm install @@ -251,7 +242,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install diff --git a/.github/workflows/uiux-release.yml b/.github/workflows/uiux-release.yml index 93abb0481..4816265f2 100644 --- a/.github/workflows/uiux-release.yml +++ b/.github/workflows/uiux-release.yml @@ -20,7 +20,6 @@ jobs: NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }} NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }} NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }} - NUMBERS_BUBBLE_DB_API_TOKEN: ${{ secrets.NUMBERS_BUBBLE_DB_API_TOKEN }} run: | npm install -g @ionic/cli npm install diff --git a/README.md b/README.md index 0e13bb045..f7ed1aafa 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,7 @@ Set the system environment variables `NUMBERS_STORAGE_BASE_URL`, `NUMBERS_STORAG ```txt export NUMBERS_STORAGE_BASE_URL="THE PRIVATE BASE URL" export NUMBERS_STORAGE_TRUSTED_CLIENT_KEY="THE TRUSTED CLIENT KEY" -export NUMBERS_BUBBLE_DB_URL="BUBBLE DB URL" -export BUBBLE_DB_API_TOKEN="BUBBLE DB API TOKEN" +export NUMBERS_BUBBLE_DB_URL="THE BUBBLE DB URL" ``` Preview the app in web browser. diff --git a/set-secret.js b/set-secret.js index 5542168fa..4f1ab3771 100644 --- a/set-secret.js +++ b/set-secret.js @@ -8,7 +8,6 @@ const envConfigFile = ` export const BASE_URL = '${process.env.NUMBERS_STORAGE_BASE_URL}'; export const TRUSTED_CLIENT_KEY = '${process.env.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY}'; export const BUBBLE_DB_URL = '${process.env.NUMBERS_BUBBLE_DB_URL}'; -export const BUBBLE_DB_API_TOKEN = '${process.env.NUMBERS_BUBBLE_DB_API_TOKEN}'; `; fs.writeFile(targetPath, envConfigFile, err => { if (err) { diff --git a/src/app/shared/actions/service/order-history.service.ts b/src/app/shared/actions/service/order-history.service.ts index 49e1418c7..9aa3f8d48 100644 --- a/src/app/shared/actions/service/order-history.service.ts +++ b/src/app/shared/actions/service/order-history.service.ts @@ -5,7 +5,7 @@ import { BehaviorSubject, combineLatest, defer, EMPTY, Observable } from 'rxjs'; import { concatMap, first, map, pluck, tap } from 'rxjs/operators'; import { WebCryptoApiSignatureProvider } from '../../collector/signature/web-crypto-api-signature-provider/web-crypto-api-signature-provider.service'; import { DiaBackendAssetRepository } from '../../dia-backend/asset/dia-backend-asset-repository.service'; -import { BUBBLE_DB_API_TOKEN, BUBBLE_DB_URL } from '../../dia-backend/secret'; +import { BUBBLE_DB_URL } from '../../dia-backend/secret'; import { NetworkAppOrder } from '../../dia-backend/store/dia-backend-store.service'; import { DiaBackendTransactionRepository } from '../../dia-backend/transaction/dia-backend-transaction-repository.service'; import { Proof } from '../../repositories/proof/proof'; @@ -64,9 +64,6 @@ export class OrderHistoryService { status_text: OrderStatus.Submitted, total_cost_number: Number(networkAppOrder.total_cost), uid_text: publicKey, - }, - { - headers: { authorization: `Bearer ${BUBBLE_DB_API_TOKEN}` }, } ) ) From 725e59269d736f66706d10409c63548aafaf9478 Mon Sep 17 00:00:00 2001 From: Ray Hung Date: Thu, 31 Mar 2022 14:33:54 +0800 Subject: [PATCH 81/81] build: bump version to 0.53.0 --- CHANGELOG.md | 10 ++++++++++ android/app/build.gradle | 4 ++-- package-lock.json | 5 +++-- package.json | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b2642b1..994305cac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.53.0 - 2022-03-31 + +### Added + +- Display insufficient NUM in order confirm dialog if applicable. +- Add loading indicator at Capture transactions history page. +- Warn user that the asset will become public when sharing asset profile. +- Support network action that doesn't take in any parameter. +- Support optional network action parameters. + ## 0.52.1 - 2022-03-25 ### Fixed diff --git a/android/app/build.gradle b/android/app/build.gradle index 694ac9b76..82a980828 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "io.numbersprotocol.capturelite" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 351 - versionName "0.52.1" + versionCode 360 + versionName "0.53.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/package-lock.json b/package-lock.json index a0dace0ac..261aa6f26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "capture-lite", - "version": "0.52.1", + "version": "0.53.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.52.1", + "name": "capture-lite", + "version": "0.53.0", "dependencies": { "@angular/animations": "^12.2.4", "@angular/cdk": "^12.2.4", diff --git a/package.json b/package.json index 8864c936f..2493c1ab9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "capture-lite", - "version": "0.52.1", + "version": "0.53.0", "author": "numbersprotocol", "homepage": "https://numbersprotocol.io/", "scripts": {