@vgroup/dialbox 0.0.63 → 0.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/dialbox.module.mjs +3 -29
- package/fesm2015/vgroup-dialbox.mjs +3 -106
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +3 -98
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/package.json +1 -1
- package/esm2020/lib/service/app-initializer.service.mjs +0 -76
- package/lib/service/app-initializer.service.d.ts +0 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject,
|
|
2
|
+
import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import swal from 'sweetalert2';
|
|
4
4
|
import { AsYouType } from 'libphonenumber-js';
|
|
5
5
|
import { throwError, BehaviorSubject, interval, Subscription } from 'rxjs';
|
|
@@ -12,7 +12,7 @@ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
|
12
12
|
import * as i5 from '@angular/router';
|
|
13
13
|
import { RouterLink, RouterModule } from '@angular/router';
|
|
14
14
|
import * as i4 from '@angular/common';
|
|
15
|
-
import {
|
|
15
|
+
import { CommonModule } from '@angular/common';
|
|
16
16
|
import * as i3 from '@angular/forms';
|
|
17
17
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
18
18
|
import { BrowserModule } from '@angular/platform-browser';
|
|
@@ -3176,76 +3176,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3176
3176
|
args: [MAT_DIALOG_DATA]
|
|
3177
3177
|
}] }]; } });
|
|
3178
3178
|
|
|
3179
|
-
class AppInitializerService {
|
|
3180
|
-
constructor(twilioService, extensionService, router, platformId) {
|
|
3181
|
-
this.twilioService = twilioService;
|
|
3182
|
-
this.extensionService = extensionService;
|
|
3183
|
-
this.router = router;
|
|
3184
|
-
this.platformId = platformId;
|
|
3185
|
-
}
|
|
3186
|
-
initializeApp() {
|
|
3187
|
-
return new Promise((resolve) => {
|
|
3188
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
3189
|
-
this.initializeServices().then(() => {
|
|
3190
|
-
resolve();
|
|
3191
|
-
});
|
|
3192
|
-
}
|
|
3193
|
-
else {
|
|
3194
|
-
resolve();
|
|
3195
|
-
}
|
|
3196
|
-
});
|
|
3197
|
-
}
|
|
3198
|
-
async initializeServices() {
|
|
3199
|
-
try {
|
|
3200
|
-
// Initialize Twilio device
|
|
3201
|
-
await this.initializeTwilio();
|
|
3202
|
-
// Fetch initial data
|
|
3203
|
-
await this.fetchInitialData();
|
|
3204
|
-
console.log('App initialization complete');
|
|
3205
|
-
}
|
|
3206
|
-
catch (error) {
|
|
3207
|
-
console.error('Error during app initialization:', error);
|
|
3208
|
-
}
|
|
3209
|
-
}
|
|
3210
|
-
async initializeTwilio() {
|
|
3211
|
-
const token = localStorage.getItem('ext_token');
|
|
3212
|
-
if (token) {
|
|
3213
|
-
await this.twilioService.initializeTwilioDevice();
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
async fetchInitialData() {
|
|
3217
|
-
const token = localStorage.getItem('ext_token');
|
|
3218
|
-
if (token) {
|
|
3219
|
-
try {
|
|
3220
|
-
// Fetch caller ID
|
|
3221
|
-
const response = await this.extensionService.fetchCallerId(token).toPromise();
|
|
3222
|
-
if (response && typeof response === 'object' && 'status' in response) {
|
|
3223
|
-
const callerIdRes = response;
|
|
3224
|
-
if (callerIdRes.status === 200) {
|
|
3225
|
-
const callerId = callerIdRes.callerid || 'Not set';
|
|
3226
|
-
localStorage.setItem('callerID', callerId);
|
|
3227
|
-
this.extensionService.changeMessage(callerId);
|
|
3228
|
-
}
|
|
3229
|
-
}
|
|
3230
|
-
}
|
|
3231
|
-
catch (error) {
|
|
3232
|
-
console.error('Error fetching initial data:', error);
|
|
3233
|
-
}
|
|
3234
|
-
}
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
AppInitializerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppInitializerService, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: i5.Router }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3238
|
-
AppInitializerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppInitializerService, providedIn: 'root' });
|
|
3239
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppInitializerService, decorators: [{
|
|
3240
|
-
type: Injectable,
|
|
3241
|
-
args: [{
|
|
3242
|
-
providedIn: 'root'
|
|
3243
|
-
}]
|
|
3244
|
-
}], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: i5.Router }, { type: Object, decorators: [{
|
|
3245
|
-
type: Inject,
|
|
3246
|
-
args: [PLATFORM_ID]
|
|
3247
|
-
}] }]; } });
|
|
3248
|
-
|
|
3249
3179
|
class DialboxModule {
|
|
3250
3180
|
}
|
|
3251
3181
|
DialboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -3262,19 +3192,7 @@ DialboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
3262
3192
|
IncomingCallComponent,
|
|
3263
3193
|
CallProgressComponent,
|
|
3264
3194
|
CallerIdDialogComponent] });
|
|
3265
|
-
DialboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule,
|
|
3266
|
-
{
|
|
3267
|
-
provide: APP_INITIALIZER,
|
|
3268
|
-
useFactory: (injector) => {
|
|
3269
|
-
return () => {
|
|
3270
|
-
const appInitializer = injector.get(AppInitializerService);
|
|
3271
|
-
return appInitializer.initializeApp();
|
|
3272
|
-
};
|
|
3273
|
-
},
|
|
3274
|
-
deps: [Injector],
|
|
3275
|
-
multi: true
|
|
3276
|
-
}
|
|
3277
|
-
], imports: [CommonModule,
|
|
3195
|
+
DialboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, imports: [CommonModule,
|
|
3278
3196
|
FormsModule,
|
|
3279
3197
|
ReactiveFormsModule,
|
|
3280
3198
|
HttpClientModule,
|
|
@@ -3303,19 +3221,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3303
3221
|
IncomingCallComponent,
|
|
3304
3222
|
CallProgressComponent,
|
|
3305
3223
|
CallerIdDialogComponent,
|
|
3306
|
-
],
|
|
3307
|
-
providers: [
|
|
3308
|
-
{
|
|
3309
|
-
provide: APP_INITIALIZER,
|
|
3310
|
-
useFactory: (injector) => {
|
|
3311
|
-
return () => {
|
|
3312
|
-
const appInitializer = injector.get(AppInitializerService);
|
|
3313
|
-
return appInitializer.initializeApp();
|
|
3314
|
-
};
|
|
3315
|
-
},
|
|
3316
|
-
deps: [Injector],
|
|
3317
|
-
multi: true
|
|
3318
|
-
}
|
|
3319
3224
|
]
|
|
3320
3225
|
}]
|
|
3321
3226
|
}] });
|