@pepperi-addons/ngx-lib 0.3.11-beta.2 → 0.3.11-beta.3
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 +31 -15
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/core/common/services/addon.service.d.ts +1 -1
- package/esm2015/core/common/services/addon.service.js +29 -14
- package/fesm2015/pepperi-addons-ngx-lib.js +28 -13
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/package.json +1 -1
- package/pepperi-addons-ngx-lib.metadata.json +1 -1
|
@@ -2649,16 +2649,45 @@
|
|
|
2649
2649
|
return this.sessionService.setObject(this.ADDON_ASSETS_PATH_KEY, path);
|
|
2650
2650
|
}
|
|
2651
2651
|
};
|
|
2652
|
+
PepAddonService.prototype.getServerBaseUrl = function (addonUUID, fileName, isAsync, localhostPort) {
|
|
2653
|
+
if (fileName === void 0) { fileName = ''; }
|
|
2654
|
+
if (isAsync === void 0) { isAsync = false; }
|
|
2655
|
+
if (localhostPort === void 0) { localhostPort = 4500; }
|
|
2656
|
+
var fileToAdd = fileName.length > 0 ? "/" + fileName : '';
|
|
2657
|
+
// For devServer run server on localhost.
|
|
2658
|
+
if (this.devServer) {
|
|
2659
|
+
return "http://localhost:" + localhostPort + fileToAdd;
|
|
2660
|
+
}
|
|
2661
|
+
else {
|
|
2662
|
+
var baseUrl = this.sessionService.getPapiBaseUrl();
|
|
2663
|
+
return "" + baseUrl + this.getAddonBaseRelativePath(isAsync) + "/" + addonUUID + fileToAdd;
|
|
2664
|
+
}
|
|
2665
|
+
};
|
|
2652
2666
|
PepAddonService.prototype.getAddonApiCall = function (addonUUID, fileName, functionName, httpOptions, isAsync) {
|
|
2653
2667
|
if (httpOptions === void 0) { httpOptions = {}; }
|
|
2654
2668
|
if (isAsync === void 0) { isAsync = false; }
|
|
2655
|
-
return this.httpService.getPapiApiCall(
|
|
2669
|
+
// return this.httpService.getPapiApiCall(
|
|
2670
|
+
// `${this.getAddonBaseRelativePath(
|
|
2671
|
+
// isAsync
|
|
2672
|
+
// )}/${addonUUID}/${fileName}/${functionName}`,
|
|
2673
|
+
// httpOptions
|
|
2674
|
+
// );
|
|
2675
|
+
var papiBaseUrl = this.getServerBaseUrl(addonUUID, fileName, isAsync);
|
|
2676
|
+
return this.httpService.getHttpCall(papiBaseUrl + "/" + functionName, httpOptions);
|
|
2656
2677
|
};
|
|
2657
2678
|
PepAddonService.prototype.postAddonApiCall = function (addonUUID, fileName, functionName, body, httpOptions, isAsync) {
|
|
2658
2679
|
if (body === void 0) { body = {}; }
|
|
2659
2680
|
if (httpOptions === void 0) { httpOptions = {}; }
|
|
2660
2681
|
if (isAsync === void 0) { isAsync = false; }
|
|
2661
|
-
return this.httpService.postPapiApiCall(
|
|
2682
|
+
// return this.httpService.postPapiApiCall(
|
|
2683
|
+
// `${this.getAddonBaseRelativePath(
|
|
2684
|
+
// isAsync
|
|
2685
|
+
// )}/${addonUUID}/${fileName}/${functionName}`,
|
|
2686
|
+
// body,
|
|
2687
|
+
// httpOptions
|
|
2688
|
+
// );
|
|
2689
|
+
var papiBaseUrl = this.getServerBaseUrl(addonUUID, fileName, isAsync);
|
|
2690
|
+
return this.httpService.postHttpCall(papiBaseUrl + "/" + functionName, body, httpOptions);
|
|
2662
2691
|
};
|
|
2663
2692
|
// TODO: need to chek this if the loader is working.
|
|
2664
2693
|
PepAddonService.prototype.fetch = function (input, init) {
|
|
@@ -2692,19 +2721,6 @@
|
|
|
2692
2721
|
if (urlLangParam === void 0) { urlLangParam = 'userLang'; }
|
|
2693
2722
|
this.translateService.setDefaultTranslateLang(translate, urlLangParam);
|
|
2694
2723
|
};
|
|
2695
|
-
PepAddonService.prototype.getServerBaseUrl = function (addonUUID, fileName, localhostPort) {
|
|
2696
|
-
if (fileName === void 0) { fileName = ''; }
|
|
2697
|
-
if (localhostPort === void 0) { localhostPort = 4500; }
|
|
2698
|
-
var fileToAdd = fileName.length > 0 ? "/" + fileName : '';
|
|
2699
|
-
// For devServer run server on localhost.
|
|
2700
|
-
if (this.devServer) {
|
|
2701
|
-
return "http://localhost:" + localhostPort + fileToAdd;
|
|
2702
|
-
}
|
|
2703
|
-
else {
|
|
2704
|
-
var baseUrl = this.sessionService.getPapiBaseUrl();
|
|
2705
|
-
return "" + baseUrl + this.getAddonBaseRelativePath() + "/" + addonUUID + fileToAdd;
|
|
2706
|
-
}
|
|
2707
|
-
};
|
|
2708
2724
|
// Deprecated need to delete in next major.
|
|
2709
2725
|
PepAddonService.createDefaultMultiTranslateLoader = function (http, fileService, addonService, subAddonUUID) {
|
|
2710
2726
|
if (subAddonUUID === void 0) { subAddonUUID = ''; }
|