bruce-models 0.3.3 → 0.3.4
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/dist/bruce-models.es5.js +75 -1
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +75 -0
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -0
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -853,6 +853,80 @@
|
|
|
853
853
|
return IdmApi;
|
|
854
854
|
}(AbstractApi));
|
|
855
855
|
|
|
856
|
+
/**
|
|
857
|
+
* This is the request handler for Global Api,
|
|
858
|
+
* it should be passed to any method that wants to communicate with this particular api.
|
|
859
|
+
*/
|
|
860
|
+
var GlobalApi = /** @class */ (function (_super) {
|
|
861
|
+
__extends(GlobalApi, _super);
|
|
862
|
+
function GlobalApi(env) {
|
|
863
|
+
var _this = _super.call(this, "SSID") || this;
|
|
864
|
+
_this.baseUrl = "";
|
|
865
|
+
_this.env = env !== null && env !== void 0 ? env : exports.Api.EEnv.PROD;
|
|
866
|
+
_this.setBaseUrl();
|
|
867
|
+
return _this;
|
|
868
|
+
}
|
|
869
|
+
GlobalApi.prototype.setBaseUrl = function () {
|
|
870
|
+
var url;
|
|
871
|
+
var env = this.env.toUpperCase();
|
|
872
|
+
switch (env) {
|
|
873
|
+
case exports.Api.EEnv.DEV:
|
|
874
|
+
url = "https://bruceglobal.nextspace-dev.net/";
|
|
875
|
+
break;
|
|
876
|
+
case exports.Api.EEnv.STG:
|
|
877
|
+
url = "https://bruceglobal.nextspace-stg.net/";
|
|
878
|
+
break;
|
|
879
|
+
case exports.Api.EEnv.UAT:
|
|
880
|
+
url = "https://bruceglobal.api.nextspace-uat.net/";
|
|
881
|
+
break;
|
|
882
|
+
case exports.Api.EEnv.PROD:
|
|
883
|
+
url = "https://bruceglobal.api.nextspace.host/";
|
|
884
|
+
break;
|
|
885
|
+
default:
|
|
886
|
+
throw ("Specified Environment is not valid. SuppliedEnv=" + env);
|
|
887
|
+
}
|
|
888
|
+
this.baseUrl = url;
|
|
889
|
+
};
|
|
890
|
+
GlobalApi.prototype.GetBaseUrl = function () {
|
|
891
|
+
return this.baseUrl;
|
|
892
|
+
};
|
|
893
|
+
GlobalApi.prototype.SetBaseUrl = function (url) {
|
|
894
|
+
this.baseUrl = url;
|
|
895
|
+
if (!this.baseUrl.endsWith("/")) {
|
|
896
|
+
this.baseUrl += "/";
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
GlobalApi.prototype.GET = function (url, params) {
|
|
900
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
901
|
+
return __generator(this, function (_a) {
|
|
902
|
+
return [2 /*return*/, this.get(this.baseUrl + url, params)];
|
|
903
|
+
});
|
|
904
|
+
});
|
|
905
|
+
};
|
|
906
|
+
GlobalApi.prototype.DELETE = function (url, params) {
|
|
907
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
908
|
+
return __generator(this, function (_a) {
|
|
909
|
+
return [2 /*return*/, this.delete(this.baseUrl + url, params)];
|
|
910
|
+
});
|
|
911
|
+
});
|
|
912
|
+
};
|
|
913
|
+
GlobalApi.prototype.POST = function (url, data, params) {
|
|
914
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
915
|
+
return __generator(this, function (_a) {
|
|
916
|
+
return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
};
|
|
920
|
+
GlobalApi.prototype.UPLOAD = function (url, blob, params) {
|
|
921
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
922
|
+
return __generator(this, function (_a) {
|
|
923
|
+
return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
|
|
924
|
+
});
|
|
925
|
+
});
|
|
926
|
+
};
|
|
927
|
+
return GlobalApi;
|
|
928
|
+
}(AbstractApi));
|
|
929
|
+
|
|
856
930
|
(function (Color) {
|
|
857
931
|
var EBlendMode;
|
|
858
932
|
(function (EBlendMode) {
|
|
@@ -5725,6 +5799,7 @@
|
|
|
5725
5799
|
exports.BruceApi = BruceApi;
|
|
5726
5800
|
exports.CamApi = CamApi;
|
|
5727
5801
|
exports.IdmApi = IdmApi;
|
|
5802
|
+
exports.GlobalApi = GlobalApi;
|
|
5728
5803
|
exports.BruceEvent = BruceEvent;
|
|
5729
5804
|
exports.CacheControl = CacheControl;
|
|
5730
5805
|
exports.DelayQueue = DelayQueue;
|