@pepperi-addons/ngx-lib 0.3.11-beta.6 → 0.3.11-beta.9
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/bundles/pepperi-addons-ngx-lib.umd.js +49 -9
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/core/common/services/addon.service.d.ts +5 -1
- package/esm2015/core/common/services/addon.service.js +40 -7
- package/fesm2015/pepperi-addons-ngx-lib.js +39 -6
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/package.json +1 -1
- package/pepperi-addons-ngx-lib.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@ngx-translate/core'), require('@angular/platform-browser'), require('@angular/cdk/coercion'), require('ngx-translate-multi-http-loader')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@pepperi-addons/ngx-lib', ['exports', '@angular/core', '@angular/common', '@angular/common/http', '@angular/forms', 'rxjs', 'rxjs/operators', '@ngx-translate/core', '@angular/platform-browser', '@angular/cdk/coercion', 'ngx-translate-multi-http-loader'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = {}), global.ng.core, global.ng.common, global.ng.common.http, global.ng.forms, global.rxjs, global.rxjs.operators, global.translate, global.ng.platformBrowser, global.ng.cdk.coercion, global['ngx-translate-multi-http-loader']));
|
|
5
|
-
}(this, (function (exports, i0, i1$1, i3, i3$1, rxjs, operators, i1, platformBrowser, coercion, ngxTranslateMultiHttpLoader) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@ngx-translate/core'), require('@angular/platform-browser'), require('@angular/cdk/coercion'), require('@angular/router'), require('ngx-translate-multi-http-loader')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@pepperi-addons/ngx-lib', ['exports', '@angular/core', '@angular/common', '@angular/common/http', '@angular/forms', 'rxjs', 'rxjs/operators', '@ngx-translate/core', '@angular/platform-browser', '@angular/cdk/coercion', '@angular/router', 'ngx-translate-multi-http-loader'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = {}), global.ng.core, global.ng.common, global.ng.common.http, global.ng.forms, global.rxjs, global.rxjs.operators, global.translate, global.ng.platformBrowser, global.ng.cdk.coercion, global.ng.router, global['ngx-translate-multi-http-loader']));
|
|
5
|
+
}(this, (function (exports, i0, i1$1, i3, i3$1, rxjs, operators, i1, platformBrowser, coercion, i6, ngxTranslateMultiHttpLoader) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
30
30
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
31
31
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
32
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
33
|
|
|
33
34
|
// import { ToastrService } from 'ngx-toastr';
|
|
34
35
|
var PepErrorInterceptor = /** @class */ (function () {
|
|
@@ -2605,19 +2606,28 @@
|
|
|
2605
2606
|
This service is the webapp api for addon usege.
|
|
2606
2607
|
*/
|
|
2607
2608
|
var PepAddonService = /** @class */ (function () {
|
|
2608
|
-
function PepAddonService(sessionService, httpService, loaderService, translateService, fileService) {
|
|
2609
|
+
function PepAddonService(sessionService, httpService, loaderService, translateService, fileService, route) {
|
|
2609
2610
|
this.sessionService = sessionService;
|
|
2610
2611
|
this.httpService = httpService;
|
|
2611
2612
|
this.loaderService = loaderService;
|
|
2612
2613
|
this.translateService = translateService;
|
|
2613
2614
|
this.fileService = fileService;
|
|
2615
|
+
this.route = route;
|
|
2614
2616
|
this.ADDON_ASSETS_PATH_KEY = 'AddonAssetsPath';
|
|
2615
2617
|
this.ADDONS_DICTIONARY_ASSETS_PATH_KEY = 'AddonsDictionaryAssetsPath';
|
|
2616
2618
|
this.ADDON_API_RELATIVE_PATH = '/addons/api';
|
|
2617
2619
|
this.ADDON_API_ASYNC_RELATIVE_PATH = this.ADDON_API_RELATIVE_PATH + "/async";
|
|
2618
2620
|
//
|
|
2619
2621
|
}
|
|
2622
|
+
Object.defineProperty(PepAddonService.prototype, "devServer", {
|
|
2623
|
+
get: function () {
|
|
2624
|
+
return this.route.snapshot.queryParamMap.get('devServer') === 'true';
|
|
2625
|
+
},
|
|
2626
|
+
enumerable: false,
|
|
2627
|
+
configurable: true
|
|
2628
|
+
});
|
|
2620
2629
|
PepAddonService.prototype.getAddonBaseRelativePath = function (isAsync) {
|
|
2630
|
+
if (isAsync === void 0) { isAsync = false; }
|
|
2621
2631
|
return isAsync
|
|
2622
2632
|
? this.ADDON_API_ASYNC_RELATIVE_PATH
|
|
2623
2633
|
: this.ADDON_API_RELATIVE_PATH;
|
|
@@ -2644,16 +2654,45 @@
|
|
|
2644
2654
|
return this.sessionService.setObject(this.ADDON_ASSETS_PATH_KEY, path);
|
|
2645
2655
|
}
|
|
2646
2656
|
};
|
|
2657
|
+
PepAddonService.prototype.getServerBaseUrl = function (addonUUID, fileName, isAsync, localhostPort) {
|
|
2658
|
+
if (fileName === void 0) { fileName = ''; }
|
|
2659
|
+
if (isAsync === void 0) { isAsync = false; }
|
|
2660
|
+
if (localhostPort === void 0) { localhostPort = 4500; }
|
|
2661
|
+
var fileToAdd = fileName.length > 0 ? "/" + fileName : '';
|
|
2662
|
+
// For devServer run server on localhost.
|
|
2663
|
+
if (this.devServer) {
|
|
2664
|
+
return "http://localhost:" + localhostPort + fileToAdd;
|
|
2665
|
+
}
|
|
2666
|
+
else {
|
|
2667
|
+
var baseUrl = this.sessionService.getPapiBaseUrl();
|
|
2668
|
+
return "" + baseUrl + this.getAddonBaseRelativePath(isAsync) + "/" + addonUUID + fileToAdd;
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2647
2671
|
PepAddonService.prototype.getAddonApiCall = function (addonUUID, fileName, functionName, httpOptions, isAsync) {
|
|
2648
2672
|
if (httpOptions === void 0) { httpOptions = {}; }
|
|
2649
2673
|
if (isAsync === void 0) { isAsync = false; }
|
|
2650
|
-
return this.httpService.getPapiApiCall(
|
|
2674
|
+
// return this.httpService.getPapiApiCall(
|
|
2675
|
+
// `${this.getAddonBaseRelativePath(
|
|
2676
|
+
// isAsync
|
|
2677
|
+
// )}/${addonUUID}/${fileName}/${functionName}`,
|
|
2678
|
+
// httpOptions
|
|
2679
|
+
// );
|
|
2680
|
+
var papiBaseUrl = this.getServerBaseUrl(addonUUID, fileName, isAsync);
|
|
2681
|
+
return this.httpService.getHttpCall(papiBaseUrl + "/" + functionName, httpOptions);
|
|
2651
2682
|
};
|
|
2652
2683
|
PepAddonService.prototype.postAddonApiCall = function (addonUUID, fileName, functionName, body, httpOptions, isAsync) {
|
|
2653
2684
|
if (body === void 0) { body = {}; }
|
|
2654
2685
|
if (httpOptions === void 0) { httpOptions = {}; }
|
|
2655
2686
|
if (isAsync === void 0) { isAsync = false; }
|
|
2656
|
-
return this.httpService.postPapiApiCall(
|
|
2687
|
+
// return this.httpService.postPapiApiCall(
|
|
2688
|
+
// `${this.getAddonBaseRelativePath(
|
|
2689
|
+
// isAsync
|
|
2690
|
+
// )}/${addonUUID}/${fileName}/${functionName}`,
|
|
2691
|
+
// body,
|
|
2692
|
+
// httpOptions
|
|
2693
|
+
// );
|
|
2694
|
+
var papiBaseUrl = this.getServerBaseUrl(addonUUID, fileName, isAsync);
|
|
2695
|
+
return this.httpService.postHttpCall(papiBaseUrl + "/" + functionName, body, httpOptions);
|
|
2657
2696
|
};
|
|
2658
2697
|
// TODO: need to chek this if the loader is working.
|
|
2659
2698
|
PepAddonService.prototype.fetch = function (input, init) {
|
|
@@ -2714,7 +2753,7 @@
|
|
|
2714
2753
|
};
|
|
2715
2754
|
return PepAddonService;
|
|
2716
2755
|
}());
|
|
2717
|
-
PepAddonService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PepAddonService_Factory() { return new PepAddonService(i0__namespace.ɵɵinject(PepSessionService), i0__namespace.ɵɵinject(PepHttpService), i0__namespace.ɵɵinject(PepLoaderService), i0__namespace.ɵɵinject(PepTranslateService), i0__namespace.ɵɵinject(PepFileService)); }, token: PepAddonService, providedIn: "root" });
|
|
2756
|
+
PepAddonService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PepAddonService_Factory() { return new PepAddonService(i0__namespace.ɵɵinject(PepSessionService), i0__namespace.ɵɵinject(PepHttpService), i0__namespace.ɵɵinject(PepLoaderService), i0__namespace.ɵɵinject(PepTranslateService), i0__namespace.ɵɵinject(PepFileService), i0__namespace.ɵɵinject(i6__namespace.ActivatedRoute)); }, token: PepAddonService, providedIn: "root" });
|
|
2718
2757
|
PepAddonService.decorators = [
|
|
2719
2758
|
{ type: i0.Injectable, args: [{
|
|
2720
2759
|
providedIn: 'root',
|
|
@@ -2725,7 +2764,8 @@
|
|
|
2725
2764
|
{ type: PepHttpService },
|
|
2726
2765
|
{ type: PepLoaderService },
|
|
2727
2766
|
{ type: PepTranslateService },
|
|
2728
|
-
{ type: PepFileService }
|
|
2767
|
+
{ type: PepFileService },
|
|
2768
|
+
{ type: i6.ActivatedRoute }
|
|
2729
2769
|
]; };
|
|
2730
2770
|
|
|
2731
2771
|
var PepColorService = /** @class */ (function () {
|