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.
@@ -858,6 +858,80 @@ var IdmApi = /** @class */ (function (_super) {
858
858
  return IdmApi;
859
859
  }(AbstractApi));
860
860
 
861
+ /**
862
+ * This is the request handler for Global Api,
863
+ * it should be passed to any method that wants to communicate with this particular api.
864
+ */
865
+ var GlobalApi = /** @class */ (function (_super) {
866
+ __extends(GlobalApi, _super);
867
+ function GlobalApi(env) {
868
+ var _this = _super.call(this, "SSID") || this;
869
+ _this.baseUrl = "";
870
+ _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
871
+ _this.setBaseUrl();
872
+ return _this;
873
+ }
874
+ GlobalApi.prototype.setBaseUrl = function () {
875
+ var url;
876
+ var env = this.env.toUpperCase();
877
+ switch (env) {
878
+ case Api.EEnv.DEV:
879
+ url = "https://bruceglobal.nextspace-dev.net/";
880
+ break;
881
+ case Api.EEnv.STG:
882
+ url = "https://bruceglobal.nextspace-stg.net/";
883
+ break;
884
+ case Api.EEnv.UAT:
885
+ url = "https://bruceglobal.api.nextspace-uat.net/";
886
+ break;
887
+ case Api.EEnv.PROD:
888
+ url = "https://bruceglobal.api.nextspace.host/";
889
+ break;
890
+ default:
891
+ throw ("Specified Environment is not valid. SuppliedEnv=" + env);
892
+ }
893
+ this.baseUrl = url;
894
+ };
895
+ GlobalApi.prototype.GetBaseUrl = function () {
896
+ return this.baseUrl;
897
+ };
898
+ GlobalApi.prototype.SetBaseUrl = function (url) {
899
+ this.baseUrl = url;
900
+ if (!this.baseUrl.endsWith("/")) {
901
+ this.baseUrl += "/";
902
+ }
903
+ };
904
+ GlobalApi.prototype.GET = function (url, params) {
905
+ return __awaiter(this, void 0, void 0, function () {
906
+ return __generator(this, function (_a) {
907
+ return [2 /*return*/, this.get(this.baseUrl + url, params)];
908
+ });
909
+ });
910
+ };
911
+ GlobalApi.prototype.DELETE = function (url, params) {
912
+ return __awaiter(this, void 0, void 0, function () {
913
+ return __generator(this, function (_a) {
914
+ return [2 /*return*/, this.delete(this.baseUrl + url, params)];
915
+ });
916
+ });
917
+ };
918
+ GlobalApi.prototype.POST = function (url, data, params) {
919
+ return __awaiter(this, void 0, void 0, function () {
920
+ return __generator(this, function (_a) {
921
+ return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
922
+ });
923
+ });
924
+ };
925
+ GlobalApi.prototype.UPLOAD = function (url, blob, params) {
926
+ return __awaiter(this, void 0, void 0, function () {
927
+ return __generator(this, function (_a) {
928
+ return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
929
+ });
930
+ });
931
+ };
932
+ return GlobalApi;
933
+ }(AbstractApi));
934
+
861
935
  var Color;
862
936
  (function (Color) {
863
937
  var EBlendMode;
@@ -5911,5 +5985,5 @@ var DataLab;
5911
5985
  })(Entity = DataLab.Entity || (DataLab.Entity = {}));
5912
5986
  })(DataLab || (DataLab = {}));
5913
5987
 
5914
- export { AnnDocument, CustomForm, AbstractApi, Api, BruceApi, CamApi, IdmApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Ucs, Permission, Session, UserGroup, User, Account, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab };
5988
+ export { AnnDocument, CustomForm, AbstractApi, Api, BruceApi, CamApi, IdmApi, GlobalApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Ucs, Permission, Session, UserGroup, User, Account, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab };
5915
5989
  //# sourceMappingURL=bruce-models.es5.js.map