bruce-models 0.4.3 → 0.4.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.
Files changed (78) hide show
  1. package/dist/bruce-models.es5.js +305 -291
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +301 -299
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account.js.map +1 -1
  6. package/dist/lib/ann-document/ann-document.js.map +1 -1
  7. package/dist/lib/api/bruce-api.js +80 -77
  8. package/dist/lib/api/bruce-api.js.map +1 -1
  9. package/dist/lib/api/cam-api.js +69 -66
  10. package/dist/lib/api/cam-api.js.map +1 -1
  11. package/dist/lib/api/global-api.js +72 -69
  12. package/dist/lib/api/global-api.js.map +1 -1
  13. package/dist/lib/api/idm-api.js +73 -70
  14. package/dist/lib/api/idm-api.js.map +1 -1
  15. package/dist/lib/client-file/client-file.js.map +1 -1
  16. package/dist/lib/custom-form/custom-form.js.map +1 -1
  17. package/dist/lib/data-lab/data-lab.js.map +1 -1
  18. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  19. package/dist/lib/entity/entity-attachment.js.map +1 -1
  20. package/dist/lib/entity/entity-comment.js.map +1 -1
  21. package/dist/lib/entity/entity-link.js.map +1 -1
  22. package/dist/lib/entity/entity-lod.js.map +1 -1
  23. package/dist/lib/entity/entity-relation-type.js.map +1 -1
  24. package/dist/lib/entity/entity-relation.js.map +1 -1
  25. package/dist/lib/entity/entity-source.js.map +1 -1
  26. package/dist/lib/entity/entity-tag.js.map +1 -1
  27. package/dist/lib/entity/entity-type.js.map +1 -1
  28. package/dist/lib/entity/entity.js.map +1 -1
  29. package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
  30. package/dist/lib/import/imported-file.js.map +1 -1
  31. package/dist/lib/program-key/program-key.js.map +1 -1
  32. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  33. package/dist/lib/project/project-view-tile-source.js +7 -10
  34. package/dist/lib/project/project-view-tile-source.js.map +1 -1
  35. package/dist/lib/project/project-view.js.map +1 -1
  36. package/dist/lib/server/pending-action.js.map +1 -1
  37. package/dist/lib/server/task.js.map +1 -1
  38. package/dist/lib/style/style.js.map +1 -1
  39. package/dist/lib/tileset/tileset.js.map +1 -1
  40. package/dist/lib/ucs/ucs.js.map +1 -1
  41. package/dist/lib/user/session.js.map +1 -1
  42. package/dist/lib/user/user-group.js.map +1 -1
  43. package/dist/lib/user/user.js.map +1 -1
  44. package/dist/types/account/account.d.ts +5 -5
  45. package/dist/types/ann-document/ann-document.d.ts +2 -2
  46. package/dist/types/api/bruce-api.d.ts +25 -18
  47. package/dist/types/api/cam-api.d.ts +18 -12
  48. package/dist/types/api/global-api.d.ts +22 -16
  49. package/dist/types/api/idm-api.d.ts +22 -16
  50. package/dist/types/client-file/client-file.d.ts +6 -6
  51. package/dist/types/custom-form/custom-form.d.ts +4 -4
  52. package/dist/types/data-lab/data-lab.d.ts +1 -1
  53. package/dist/types/entity/entity-attachment-type.d.ts +3 -3
  54. package/dist/types/entity/entity-attachment.d.ts +6 -6
  55. package/dist/types/entity/entity-comment.d.ts +3 -3
  56. package/dist/types/entity/entity-link.d.ts +3 -3
  57. package/dist/types/entity/entity-lod.d.ts +4 -4
  58. package/dist/types/entity/entity-relation-type.d.ts +4 -4
  59. package/dist/types/entity/entity-relation.d.ts +3 -3
  60. package/dist/types/entity/entity-source.d.ts +3 -3
  61. package/dist/types/entity/entity-tag.d.ts +5 -5
  62. package/dist/types/entity/entity-type.d.ts +4 -4
  63. package/dist/types/entity/entity.d.ts +5 -5
  64. package/dist/types/entity/getters/entity-filter-getter.d.ts +1 -1
  65. package/dist/types/import/imported-file.d.ts +2 -2
  66. package/dist/types/program-key/program-key.d.ts +4 -4
  67. package/dist/types/project/project-view-bookmark.d.ts +5 -5
  68. package/dist/types/project/project-view-tile-source.d.ts +3 -2
  69. package/dist/types/project/project-view.d.ts +4 -4
  70. package/dist/types/server/pending-action.d.ts +3 -3
  71. package/dist/types/server/task.d.ts +2 -2
  72. package/dist/types/style/style.d.ts +4 -4
  73. package/dist/types/tileset/tileset.d.ts +15 -15
  74. package/dist/types/ucs/ucs.d.ts +4 -4
  75. package/dist/types/user/session.d.ts +3 -3
  76. package/dist/types/user/user-group.d.ts +6 -6
  77. package/dist/types/user/user.d.ts +13 -13
  78. package/package.json +1 -1
@@ -631,312 +631,328 @@ var AbstractApi = /** @class */ (function () {
631
631
  return AbstractApi;
632
632
  }());
633
633
 
634
- /**
635
- * This is the request handler for Bruce Api,
636
- * it should be passed to any method that wants to communicate with this particular api.
637
- */
638
- var BruceApi = /** @class */ (function (_super) {
639
- __extends(BruceApi, _super);
640
- function BruceApi(accountId, env) {
641
- var _this = _super.call(this, "x-sessionid") || this;
642
- _this.baseUrl = "";
643
- _this.accountId = accountId;
644
- _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
645
- _this.setBaseUrl();
646
- return _this;
647
- }
648
- BruceApi.prototype.setBaseUrl = function () {
649
- var prefix = "https://" + this.accountId + ".api.nextspace";
650
- var url;
651
- var env = this.env.toUpperCase();
652
- switch (env) {
653
- case Api.EEnv.DEV:
654
- url = prefix + "-dev.net/";
655
- break;
656
- case Api.EEnv.STG:
657
- url = prefix + "-stg.net/";
658
- break;
659
- case Api.EEnv.UAT:
660
- url = prefix + "-uat.net/";
661
- break;
662
- case Api.EEnv.PROD:
663
- url = prefix + ".host/";
664
- break;
665
- default:
666
- throw ("Specified Environment is not valid. SuppliedEnv=" + env);
667
- }
668
- this.baseUrl = url;
669
- };
670
- BruceApi.prototype.GetBaseUrl = function () {
671
- return this.baseUrl;
672
- };
673
- BruceApi.prototype.SetBaseUrl = function (url) {
674
- this.baseUrl = url;
675
- if (!this.baseUrl.endsWith("/")) {
676
- this.baseUrl += "/";
677
- }
678
- };
679
- BruceApi.prototype.GET = function (url, params) {
680
- return __awaiter(this, void 0, void 0, function () {
681
- return __generator(this, function (_a) {
682
- return [2 /*return*/, this.get(this.baseUrl + url, params)];
634
+ var BruceApi;
635
+ (function (BruceApi) {
636
+ /**
637
+ * This is the request handler for Bruce Api,
638
+ * it should be passed to any method that wants to communicate with this particular api.
639
+ */
640
+ var Api$$1 = /** @class */ (function (_super) {
641
+ __extends(Api$$1, _super);
642
+ function Api$$1(accountId, env) {
643
+ var _this = _super.call(this, "x-sessionid") || this;
644
+ _this.baseUrl = "";
645
+ _this.accountId = accountId;
646
+ _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
647
+ _this.setBaseUrl();
648
+ return _this;
649
+ }
650
+ Api$$1.prototype.setBaseUrl = function () {
651
+ var prefix = "https://" + this.accountId + ".api.nextspace";
652
+ var url;
653
+ var env = this.env.toUpperCase();
654
+ switch (env) {
655
+ case Api.EEnv.DEV:
656
+ url = prefix + "-dev.net/";
657
+ break;
658
+ case Api.EEnv.STG:
659
+ url = prefix + "-stg.net/";
660
+ break;
661
+ case Api.EEnv.UAT:
662
+ url = prefix + "-uat.net/";
663
+ break;
664
+ case Api.EEnv.PROD:
665
+ url = prefix + ".host/";
666
+ break;
667
+ default:
668
+ throw ("Specified Environment is not valid. SuppliedEnv=" + env);
669
+ }
670
+ this.baseUrl = url;
671
+ };
672
+ Api$$1.prototype.GetBaseUrl = function () {
673
+ return this.baseUrl;
674
+ };
675
+ Api$$1.prototype.SetBaseUrl = function (url) {
676
+ this.baseUrl = url;
677
+ if (!this.baseUrl.endsWith("/")) {
678
+ this.baseUrl += "/";
679
+ }
680
+ };
681
+ Api$$1.prototype.GET = function (url, params) {
682
+ return __awaiter(this, void 0, void 0, function () {
683
+ return __generator(this, function (_a) {
684
+ return [2 /*return*/, this.get(this.baseUrl + url, params)];
685
+ });
683
686
  });
684
- });
685
- };
686
- BruceApi.prototype.DELETE = function (url, params) {
687
- return __awaiter(this, void 0, void 0, function () {
688
- return __generator(this, function (_a) {
689
- return [2 /*return*/, this.delete(this.baseUrl + url, params)];
687
+ };
688
+ Api$$1.prototype.DELETE = function (url, params) {
689
+ return __awaiter(this, void 0, void 0, function () {
690
+ return __generator(this, function (_a) {
691
+ return [2 /*return*/, this.delete(this.baseUrl + url, params)];
692
+ });
690
693
  });
691
- });
692
- };
693
- BruceApi.prototype.POST = function (url, data, params) {
694
- return __awaiter(this, void 0, void 0, function () {
695
- return __generator(this, function (_a) {
696
- return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
694
+ };
695
+ Api$$1.prototype.POST = function (url, data, params) {
696
+ return __awaiter(this, void 0, void 0, function () {
697
+ return __generator(this, function (_a) {
698
+ return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
699
+ });
697
700
  });
698
- });
699
- };
700
- BruceApi.prototype.PUT = function (url, data, params) {
701
- return __awaiter(this, void 0, void 0, function () {
702
- return __generator(this, function (_a) {
703
- return [2 /*return*/, this.put(this.baseUrl + url, data, params)];
701
+ };
702
+ Api$$1.prototype.PUT = function (url, data, params) {
703
+ return __awaiter(this, void 0, void 0, function () {
704
+ return __generator(this, function (_a) {
705
+ return [2 /*return*/, this.put(this.baseUrl + url, data, params)];
706
+ });
704
707
  });
705
- });
706
- };
707
- BruceApi.prototype.UPLOAD = function (url, blob, params) {
708
- return __awaiter(this, void 0, void 0, function () {
709
- return __generator(this, function (_a) {
710
- return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
708
+ };
709
+ Api$$1.prototype.UPLOAD = function (url, blob, params) {
710
+ return __awaiter(this, void 0, void 0, function () {
711
+ return __generator(this, function (_a) {
712
+ return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
713
+ });
711
714
  });
712
- });
713
- };
714
- return BruceApi;
715
- }(AbstractApi));
715
+ };
716
+ return Api$$1;
717
+ }(AbstractApi));
718
+ BruceApi.Api = Api$$1;
719
+ })(BruceApi || (BruceApi = {}));
716
720
 
717
721
  /**
718
722
  * This is the request handler for Cam Api,
719
723
  * it should be passed to any method that wants to communicate with this particular api.
720
724
  */
721
- var CamApi = /** @class */ (function (_super) {
722
- __extends(CamApi, _super);
723
- function CamApi(env) {
724
- var _this = _super.call(this, "SSID") || this;
725
- _this.baseUrl = "";
726
- _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
727
- _this.setBaseUrl();
728
- return _this;
729
- }
730
- CamApi.prototype.setBaseUrl = function () {
731
- var prefix = "https://cam.nextspace";
732
- var url;
733
- var env = this.env.toUpperCase();
734
- switch (env) {
735
- case Api.EEnv.DEV:
736
- url = prefix + "-dev.net/";
737
- break;
738
- case Api.EEnv.STG:
739
- url = prefix + "-stg.net/";
740
- break;
741
- case Api.EEnv.UAT:
742
- url = prefix + "-uat.net/";
743
- break;
744
- case Api.EEnv.PROD:
745
- url = prefix + ".host/";
746
- break;
747
- default:
748
- throw ("Specified Environment is not valid. SuppliedEnv=" + env);
749
- }
750
- this.baseUrl = url;
751
- };
752
- CamApi.prototype.GetBaseUrl = function () {
753
- return this.baseUrl;
754
- };
755
- CamApi.prototype.SetBaseUrl = function (url) {
756
- this.baseUrl = url;
757
- if (!this.baseUrl.endsWith("/")) {
758
- this.baseUrl += "/";
759
- }
760
- };
761
- CamApi.prototype.GET = function (url, params) {
762
- return __awaiter(this, void 0, void 0, function () {
763
- return __generator(this, function (_a) {
764
- return [2 /*return*/, this.get(this.baseUrl + url, params)];
725
+ var CamApi;
726
+ (function (CamApi) {
727
+ var Api$$1 = /** @class */ (function (_super) {
728
+ __extends(Api$$1, _super);
729
+ function Api$$1(env) {
730
+ var _this = _super.call(this, "SSID") || this;
731
+ _this.baseUrl = "";
732
+ _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
733
+ _this.setBaseUrl();
734
+ return _this;
735
+ }
736
+ Api$$1.prototype.setBaseUrl = function () {
737
+ var prefix = "https://cam.nextspace";
738
+ var url;
739
+ var env = this.env.toUpperCase();
740
+ switch (env) {
741
+ case Api.EEnv.DEV:
742
+ url = prefix + "-dev.net/";
743
+ break;
744
+ case Api.EEnv.STG:
745
+ url = prefix + "-stg.net/";
746
+ break;
747
+ case Api.EEnv.UAT:
748
+ url = prefix + "-uat.net/";
749
+ break;
750
+ case Api.EEnv.PROD:
751
+ url = prefix + ".host/";
752
+ break;
753
+ default:
754
+ throw ("Specified Environment is not valid. SuppliedEnv=" + env);
755
+ }
756
+ this.baseUrl = url;
757
+ };
758
+ Api$$1.prototype.GetBaseUrl = function () {
759
+ return this.baseUrl;
760
+ };
761
+ Api$$1.prototype.SetBaseUrl = function (url) {
762
+ this.baseUrl = url;
763
+ if (!this.baseUrl.endsWith("/")) {
764
+ this.baseUrl += "/";
765
+ }
766
+ };
767
+ Api$$1.prototype.GET = function (url, params) {
768
+ return __awaiter(this, void 0, void 0, function () {
769
+ return __generator(this, function (_a) {
770
+ return [2 /*return*/, this.get(this.baseUrl + url, params)];
771
+ });
765
772
  });
766
- });
767
- };
768
- CamApi.prototype.DELETE = function (url, params) {
769
- return __awaiter(this, void 0, void 0, function () {
770
- return __generator(this, function (_a) {
771
- return [2 /*return*/, this.delete(this.baseUrl + url, params)];
773
+ };
774
+ Api$$1.prototype.DELETE = function (url, params) {
775
+ return __awaiter(this, void 0, void 0, function () {
776
+ return __generator(this, function (_a) {
777
+ return [2 /*return*/, this.delete(this.baseUrl + url, params)];
778
+ });
772
779
  });
773
- });
774
- };
775
- CamApi.prototype.POST = function (url, data, params) {
776
- return __awaiter(this, void 0, void 0, function () {
777
- return __generator(this, function (_a) {
778
- return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
780
+ };
781
+ Api$$1.prototype.POST = function (url, data, params) {
782
+ return __awaiter(this, void 0, void 0, function () {
783
+ return __generator(this, function (_a) {
784
+ return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
785
+ });
779
786
  });
780
- });
781
- };
782
- CamApi.prototype.UPLOAD = function (url, blob, params) {
783
- return __awaiter(this, void 0, void 0, function () {
784
- return __generator(this, function (_a) {
785
- return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
787
+ };
788
+ Api$$1.prototype.UPLOAD = function (url, blob, params) {
789
+ return __awaiter(this, void 0, void 0, function () {
790
+ return __generator(this, function (_a) {
791
+ return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
792
+ });
786
793
  });
787
- });
788
- };
789
- return CamApi;
790
- }(AbstractApi));
794
+ };
795
+ return Api$$1;
796
+ }(AbstractApi));
797
+ CamApi.Api = Api$$1;
798
+ })(CamApi || (CamApi = {}));
791
799
 
792
- /**
793
- * This is the request handler for Idm Api,
794
- * it should be passed to any method that wants to communicate with this particular api.
795
- */
796
- var IdmApi = /** @class */ (function (_super) {
797
- __extends(IdmApi, _super);
798
- function IdmApi(env) {
799
- var _this = _super.call(this, "SSID") || this;
800
- _this.baseUrl = "";
801
- _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
802
- _this.setBaseUrl();
803
- return _this;
804
- }
805
- IdmApi.prototype.setBaseUrl = function () {
806
- var prefix = "https://idm.nextspace";
807
- var url;
808
- var env = this.env.toUpperCase();
809
- switch (env) {
810
- case Api.EEnv.DEV:
811
- url = prefix + "-dev.net/";
812
- break;
813
- case Api.EEnv.STG:
814
- url = prefix + "-stg.net/";
815
- break;
816
- case Api.EEnv.UAT:
817
- url = prefix + "-uat.net/";
818
- break;
819
- case Api.EEnv.PROD:
820
- url = prefix + ".host/";
821
- break;
822
- default:
823
- throw ("Specified Environment is not valid. SuppliedEnv1=" + env);
824
- }
825
- this.baseUrl = url;
826
- };
827
- IdmApi.prototype.GetBaseUrl = function () {
828
- return this.baseUrl;
829
- };
830
- IdmApi.prototype.SetBaseUrl = function (url) {
831
- this.baseUrl = url;
832
- if (!this.baseUrl.endsWith("/")) {
833
- this.baseUrl += "/";
834
- }
835
- };
836
- IdmApi.prototype.GET = function (url, params) {
837
- return __awaiter(this, void 0, void 0, function () {
838
- return __generator(this, function (_a) {
839
- return [2 /*return*/, this.get(this.baseUrl + url, params)];
800
+ var IdmApi;
801
+ (function (IdmApi) {
802
+ /**
803
+ * This is the request handler for Idm Api,
804
+ * it should be passed to any method that wants to communicate with this particular api.
805
+ */
806
+ var Api$$1 = /** @class */ (function (_super) {
807
+ __extends(Api$$1, _super);
808
+ function Api$$1(env) {
809
+ var _this = _super.call(this, "SSID") || this;
810
+ _this.baseUrl = "";
811
+ _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
812
+ _this.setBaseUrl();
813
+ return _this;
814
+ }
815
+ Api$$1.prototype.setBaseUrl = function () {
816
+ var prefix = "https://idm.nextspace";
817
+ var url;
818
+ var env = this.env.toUpperCase();
819
+ switch (env) {
820
+ case Api.EEnv.DEV:
821
+ url = prefix + "-dev.net/";
822
+ break;
823
+ case Api.EEnv.STG:
824
+ url = prefix + "-stg.net/";
825
+ break;
826
+ case Api.EEnv.UAT:
827
+ url = prefix + "-uat.net/";
828
+ break;
829
+ case Api.EEnv.PROD:
830
+ url = prefix + ".host/";
831
+ break;
832
+ default:
833
+ throw ("Specified Environment is not valid. SuppliedEnv1=" + env);
834
+ }
835
+ this.baseUrl = url;
836
+ };
837
+ Api$$1.prototype.GetBaseUrl = function () {
838
+ return this.baseUrl;
839
+ };
840
+ Api$$1.prototype.SetBaseUrl = function (url) {
841
+ this.baseUrl = url;
842
+ if (!this.baseUrl.endsWith("/")) {
843
+ this.baseUrl += "/";
844
+ }
845
+ };
846
+ Api$$1.prototype.GET = function (url, params) {
847
+ return __awaiter(this, void 0, void 0, function () {
848
+ return __generator(this, function (_a) {
849
+ return [2 /*return*/, this.get(this.baseUrl + url, params)];
850
+ });
840
851
  });
841
- });
842
- };
843
- IdmApi.prototype.DELETE = function (url, params) {
844
- return __awaiter(this, void 0, void 0, function () {
845
- return __generator(this, function (_a) {
846
- return [2 /*return*/, this.delete(this.baseUrl + url, params)];
852
+ };
853
+ Api$$1.prototype.DELETE = function (url, params) {
854
+ return __awaiter(this, void 0, void 0, function () {
855
+ return __generator(this, function (_a) {
856
+ return [2 /*return*/, this.delete(this.baseUrl + url, params)];
857
+ });
847
858
  });
848
- });
849
- };
850
- IdmApi.prototype.POST = function (url, data, params) {
851
- return __awaiter(this, void 0, void 0, function () {
852
- return __generator(this, function (_a) {
853
- return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
859
+ };
860
+ Api$$1.prototype.POST = function (url, data, params) {
861
+ return __awaiter(this, void 0, void 0, function () {
862
+ return __generator(this, function (_a) {
863
+ return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
864
+ });
854
865
  });
855
- });
856
- };
857
- IdmApi.prototype.UPLOAD = function (url, blob, params) {
858
- return __awaiter(this, void 0, void 0, function () {
859
- return __generator(this, function (_a) {
860
- return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
866
+ };
867
+ Api$$1.prototype.UPLOAD = function (url, blob, params) {
868
+ return __awaiter(this, void 0, void 0, function () {
869
+ return __generator(this, function (_a) {
870
+ return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
871
+ });
861
872
  });
862
- });
863
- };
864
- return IdmApi;
865
- }(AbstractApi));
873
+ };
874
+ return Api$$1;
875
+ }(AbstractApi));
876
+ IdmApi.Api = Api$$1;
877
+ })(IdmApi || (IdmApi = {}));
866
878
 
867
- /**
868
- * This is the request handler for Global Api,
869
- * it should be passed to any method that wants to communicate with this particular api.
870
- */
871
- var GlobalApi = /** @class */ (function (_super) {
872
- __extends(GlobalApi, _super);
873
- function GlobalApi(env) {
874
- var _this = _super.call(this, "SSID") || this;
875
- _this.baseUrl = "";
876
- _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
877
- _this.setBaseUrl();
878
- return _this;
879
- }
880
- GlobalApi.prototype.setBaseUrl = function () {
881
- var url;
882
- var env = this.env.toUpperCase();
883
- switch (env) {
884
- case Api.EEnv.DEV:
885
- url = "https://bruceglobal.nextspace-dev.net/";
886
- break;
887
- case Api.EEnv.STG:
888
- url = "https://bruceglobal.nextspace-stg.net/";
889
- break;
890
- case Api.EEnv.UAT:
891
- url = "https://bruceglobal.api.nextspace-uat.net/";
892
- break;
893
- case Api.EEnv.PROD:
894
- url = "https://bruceglobal.api.nextspace.host/";
895
- break;
896
- default:
897
- throw ("Specified Environment is not valid. SuppliedEnv=" + env);
898
- }
899
- this.baseUrl = url;
900
- };
901
- GlobalApi.prototype.GetBaseUrl = function () {
902
- return this.baseUrl;
903
- };
904
- GlobalApi.prototype.SetBaseUrl = function (url) {
905
- this.baseUrl = url;
906
- if (!this.baseUrl.endsWith("/")) {
907
- this.baseUrl += "/";
908
- }
909
- };
910
- GlobalApi.prototype.GET = function (url, params) {
911
- return __awaiter(this, void 0, void 0, function () {
912
- return __generator(this, function (_a) {
913
- return [2 /*return*/, this.get(this.baseUrl + url, params)];
879
+ var GlobalApi;
880
+ (function (GlobalApi) {
881
+ /**
882
+ * This is the request handler for Global Api,
883
+ * it should be passed to any method that wants to communicate with this particular api.
884
+ */
885
+ var Api$$1 = /** @class */ (function (_super) {
886
+ __extends(Api$$1, _super);
887
+ function Api$$1(env) {
888
+ var _this = _super.call(this, "SSID") || this;
889
+ _this.baseUrl = "";
890
+ _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
891
+ _this.setBaseUrl();
892
+ return _this;
893
+ }
894
+ Api$$1.prototype.setBaseUrl = function () {
895
+ var url;
896
+ var env = this.env.toUpperCase();
897
+ switch (env) {
898
+ case Api.EEnv.DEV:
899
+ url = "https://bruceglobal.nextspace-dev.net/";
900
+ break;
901
+ case Api.EEnv.STG:
902
+ url = "https://bruceglobal.nextspace-stg.net/";
903
+ break;
904
+ case Api.EEnv.UAT:
905
+ url = "https://bruceglobal.api.nextspace-uat.net/";
906
+ break;
907
+ case Api.EEnv.PROD:
908
+ url = "https://bruceglobal.api.nextspace.host/";
909
+ break;
910
+ default:
911
+ throw ("Specified Environment is not valid. SuppliedEnv=" + env);
912
+ }
913
+ this.baseUrl = url;
914
+ };
915
+ Api$$1.prototype.GetBaseUrl = function () {
916
+ return this.baseUrl;
917
+ };
918
+ Api$$1.prototype.SetBaseUrl = function (url) {
919
+ this.baseUrl = url;
920
+ if (!this.baseUrl.endsWith("/")) {
921
+ this.baseUrl += "/";
922
+ }
923
+ };
924
+ Api$$1.prototype.GET = function (url, params) {
925
+ return __awaiter(this, void 0, void 0, function () {
926
+ return __generator(this, function (_a) {
927
+ return [2 /*return*/, this.get(this.baseUrl + url, params)];
928
+ });
914
929
  });
915
- });
916
- };
917
- GlobalApi.prototype.DELETE = function (url, params) {
918
- return __awaiter(this, void 0, void 0, function () {
919
- return __generator(this, function (_a) {
920
- return [2 /*return*/, this.delete(this.baseUrl + url, params)];
930
+ };
931
+ Api$$1.prototype.DELETE = function (url, params) {
932
+ return __awaiter(this, void 0, void 0, function () {
933
+ return __generator(this, function (_a) {
934
+ return [2 /*return*/, this.delete(this.baseUrl + url, params)];
935
+ });
921
936
  });
922
- });
923
- };
924
- GlobalApi.prototype.POST = function (url, data, params) {
925
- return __awaiter(this, void 0, void 0, function () {
926
- return __generator(this, function (_a) {
927
- return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
937
+ };
938
+ Api$$1.prototype.POST = function (url, data, params) {
939
+ return __awaiter(this, void 0, void 0, function () {
940
+ return __generator(this, function (_a) {
941
+ return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
942
+ });
928
943
  });
929
- });
930
- };
931
- GlobalApi.prototype.UPLOAD = function (url, blob, params) {
932
- return __awaiter(this, void 0, void 0, function () {
933
- return __generator(this, function (_a) {
934
- return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
944
+ };
945
+ Api$$1.prototype.UPLOAD = function (url, blob, params) {
946
+ return __awaiter(this, void 0, void 0, function () {
947
+ return __generator(this, function (_a) {
948
+ return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
949
+ });
935
950
  });
936
- });
937
- };
938
- return GlobalApi;
939
- }(AbstractApi));
951
+ };
952
+ return Api$$1;
953
+ }(AbstractApi));
954
+ GlobalApi.Api = Api$$1;
955
+ })(GlobalApi || (GlobalApi = {}));
940
956
 
941
957
  var Color;
942
958
  (function (Color) {
@@ -4668,15 +4684,13 @@ var ProjectView;
4668
4684
  ProjectView.Update = Update;
4669
4685
  })(ProjectView || (ProjectView = {}));
4670
4686
 
4671
- function getTemplateSettings() {
4687
+ function getTemplateSettings(apiGetter) {
4672
4688
  var _a;
4673
4689
  return __awaiter(this, void 0, void 0, function () {
4674
- var templateApi, view;
4690
+ var view;
4675
4691
  return __generator(this, function (_b) {
4676
4692
  switch (_b.label) {
4677
- case 0:
4678
- templateApi = new BruceApi(Api.TEMPLATE_ACCOUNT_ID);
4679
- return [4 /*yield*/, ProjectView.Get(templateApi, "default")];
4693
+ case 0: return [4 /*yield*/, ProjectView.Get(apiGetter.getApi(Api.TEMPLATE_ACCOUNT_ID, apiGetter.env), "default")];
4680
4694
  case 1:
4681
4695
  view = _b.sent();
4682
4696
  return [2 /*return*/, (_a = view.Settings) !== null && _a !== void 0 ? _a : {}];
@@ -4703,13 +4717,13 @@ function checkSourceToTemplate(items, templateItem, addIfMissing) {
4703
4717
  */
4704
4718
  var ProjectViewTileSource;
4705
4719
  (function (ProjectViewTileSource) {
4706
- function MergeMapTemplateData(items, addIfMissing) {
4720
+ function MergeMapTemplateData(getter, items, addIfMissing) {
4707
4721
  var _a;
4708
4722
  return __awaiter(this, void 0, void 0, function () {
4709
4723
  var settings, maps, i, mapSource;
4710
4724
  return __generator(this, function (_b) {
4711
4725
  switch (_b.label) {
4712
- case 0: return [4 /*yield*/, getTemplateSettings()];
4726
+ case 0: return [4 /*yield*/, getTemplateSettings(getter)];
4713
4727
  case 1:
4714
4728
  settings = _b.sent();
4715
4729
  maps = (_a = settings.CesiumMapSources) !== null && _a !== void 0 ? _a : [];
@@ -4723,13 +4737,13 @@ var ProjectViewTileSource;
4723
4737
  });
4724
4738
  }
4725
4739
  ProjectViewTileSource.MergeMapTemplateData = MergeMapTemplateData;
4726
- function MergeTerrainTemplateData(items, addIfMissing) {
4740
+ function MergeTerrainTemplateData(getter, items, addIfMissing) {
4727
4741
  var _a;
4728
4742
  return __awaiter(this, void 0, void 0, function () {
4729
4743
  var settings, terrains, i, terrainSource;
4730
4744
  return __generator(this, function (_b) {
4731
4745
  switch (_b.label) {
4732
- case 0: return [4 /*yield*/, getTemplateSettings()];
4746
+ case 0: return [4 /*yield*/, getTemplateSettings(getter)];
4733
4747
  case 1:
4734
4748
  settings = _b.sent();
4735
4749
  terrains = (_a = settings.CesiumTerrainSources) !== null && _a !== void 0 ? _a : [];