@itwin/ecschema-rpcinterface-tests 3.7.11 → 3.7.13

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.
@@ -2659,6 +2659,376 @@ class UserOperations extends _base_internal__WEBPACK_IMPORTED_MODULE_0__.Operati
2659
2659
  }
2660
2660
 
2661
2661
 
2662
+ /***/ }),
2663
+
2664
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/BaseClient.js":
2665
+ /*!*******************************************************************************************************************************!*\
2666
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/BaseClient.js ***!
2667
+ \*******************************************************************************************************************************/
2668
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2669
+
2670
+ "use strict";
2671
+ __webpack_require__.r(__webpack_exports__);
2672
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2673
+ /* harmony export */ "BaseClient": () => (/* binding */ BaseClient)
2674
+ /* harmony export */ });
2675
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "../../common/temp/node_modules/.pnpm/axios@0.25.0/node_modules/axios/index.js");
2676
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
2677
+
2678
+ class BaseClient {
2679
+ constructor(url) {
2680
+ this._baseUrl = "https://api.bentley.com/itwins";
2681
+ if (url !== undefined) {
2682
+ this._baseUrl = url;
2683
+ }
2684
+ else {
2685
+ const urlPrefix = process.env.IMJS_URL_PREFIX;
2686
+ if (urlPrefix) {
2687
+ const baseUrl = new URL(this._baseUrl);
2688
+ baseUrl.hostname = urlPrefix + baseUrl.hostname;
2689
+ this._baseUrl = baseUrl.href;
2690
+ }
2691
+ }
2692
+ }
2693
+ /**
2694
+ * Sends a basic API request
2695
+ * @param accessToken The client access token string
2696
+ * @param method The method type of the request (ex. GET, POST, DELETE, etc.)
2697
+ * @param url The url of the request
2698
+ * @param data (Optional) The payload of the request
2699
+ * @param property (Optional) The target property (ex. iTwins, repositories, etc.)
2700
+ * @param headers (Optional) Extra request headers.
2701
+ */
2702
+ async sendGenericAPIRequest(accessToken, method, url, data, property, headers) {
2703
+ const requestOptions = this.getRequestOptions(accessToken, method, url, data, headers);
2704
+ try {
2705
+ const response = await axios__WEBPACK_IMPORTED_MODULE_0___default()(requestOptions);
2706
+ return {
2707
+ status: response.status,
2708
+ data: response.data.error || response.data === "" ? undefined : property ? response.data[property] : response.data,
2709
+ error: response.data.error,
2710
+ };
2711
+ }
2712
+ catch (err) {
2713
+ return {
2714
+ status: 500,
2715
+ error: {
2716
+ code: "InternalServerError",
2717
+ message: "An internal exception happened while calling iTwins Service",
2718
+ },
2719
+ };
2720
+ }
2721
+ }
2722
+ /**
2723
+ * Build the request methods, headers, and other options
2724
+ * @param accessTokenString The client access token string
2725
+ * @param method The method type of the request (ex. GET, POST, DELETE, etc.)
2726
+ * @param url The url of the request
2727
+ * @param data (Optional) The payload of the request
2728
+ * @param headers (Optional) Extra request headers.
2729
+ */
2730
+ getRequestOptions(accessTokenString, method, url, data, headers = {}) {
2731
+ return {
2732
+ method,
2733
+ url,
2734
+ data,
2735
+ headers: {
2736
+ ...headers,
2737
+ "authorization": accessTokenString,
2738
+ "content-type": "application/json",
2739
+ },
2740
+ validateStatus(status) {
2741
+ return status < 500; // Resolve only if the status code is less than 500
2742
+ },
2743
+ };
2744
+ }
2745
+ /**
2746
+ * Build a query to be appended to a URL
2747
+ * @param queryArg Object container queryable properties
2748
+ * @returns query string with AccessControlQueryArg applied, which should be appended to a url
2749
+ */
2750
+ getQueryString(queryArg) {
2751
+ let queryString = "";
2752
+ if (queryArg.search) {
2753
+ queryString += `&$search=${queryArg.search}`;
2754
+ }
2755
+ if (queryArg.top) {
2756
+ queryString += `&$top=${queryArg.top}`;
2757
+ }
2758
+ if (queryArg.skip) {
2759
+ queryString += `&$skip=${queryArg.skip}`;
2760
+ }
2761
+ if (queryArg.displayName) {
2762
+ queryString += `&displayName=${queryArg.displayName}`;
2763
+ }
2764
+ if (queryArg.number) {
2765
+ queryString += `&number=${queryArg.number}`;
2766
+ }
2767
+ if (queryArg.type) {
2768
+ queryString += `&type=${queryArg.type}`;
2769
+ }
2770
+ // trim & from start of string
2771
+ queryString.replace(/^&+/, "");
2772
+ return queryString;
2773
+ }
2774
+ /**
2775
+ * Build a query to be appended to the URL for iTwin Repositories
2776
+ * @param queryArg Object container queryable properties
2777
+ * @returns query string with RepositoriesQueryArg applied, which should be appended to a url
2778
+ */
2779
+ getRepositoryQueryString(queryArg) {
2780
+ let queryString = "";
2781
+ if (queryArg.class) {
2782
+ queryString += `?class=${queryArg.class}`;
2783
+ }
2784
+ if (queryArg.subClass) {
2785
+ queryString += `&subClass=${queryArg.subClass}`;
2786
+ }
2787
+ // trim & from start of string
2788
+ queryString.replace(/^&+/, "");
2789
+ return queryString;
2790
+ }
2791
+ }
2792
+
2793
+
2794
+ /***/ }),
2795
+
2796
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/iTwinsAccessProps.js":
2797
+ /*!**************************************************************************************************************************************!*\
2798
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/iTwinsAccessProps.js ***!
2799
+ \**************************************************************************************************************************************/
2800
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2801
+
2802
+ "use strict";
2803
+ __webpack_require__.r(__webpack_exports__);
2804
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2805
+ /* harmony export */ "ITwinClass": () => (/* binding */ ITwinClass),
2806
+ /* harmony export */ "ITwinSubClass": () => (/* binding */ ITwinSubClass),
2807
+ /* harmony export */ "RepositoryClass": () => (/* binding */ RepositoryClass),
2808
+ /* harmony export */ "RepositorySubClass": () => (/* binding */ RepositorySubClass)
2809
+ /* harmony export */ });
2810
+ /*---------------------------------------------------------------------------------------------
2811
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
2812
+ * See LICENSE.md in the project root for license terms and full copyright notice.
2813
+ *--------------------------------------------------------------------------------------------*/
2814
+ /** @packageDocumentation
2815
+ * @module iTwinsClient
2816
+ */
2817
+ var ITwinSubClass;
2818
+ (function (ITwinSubClass) {
2819
+ ITwinSubClass["Account"] = "Account";
2820
+ ITwinSubClass["Asset"] = "Asset";
2821
+ ITwinSubClass["Project"] = "Project";
2822
+ })(ITwinSubClass || (ITwinSubClass = {}));
2823
+ var ITwinClass;
2824
+ (function (ITwinClass) {
2825
+ ITwinClass["Account"] = "Account";
2826
+ ITwinClass["Thing"] = "Thing";
2827
+ ITwinClass["Endeavor"] = "Endeavor";
2828
+ })(ITwinClass || (ITwinClass = {}));
2829
+ var RepositoryClass;
2830
+ (function (RepositoryClass) {
2831
+ RepositoryClass["iModels"] = "iModels";
2832
+ RepositoryClass["Storage"] = "Storage";
2833
+ RepositoryClass["Forms"] = "Forms";
2834
+ RepositoryClass["Issues"] = "Issues";
2835
+ RepositoryClass["RealityData"] = "RealityData";
2836
+ RepositoryClass["GeographicInformationSystem"] = "GeographicInformationSystem";
2837
+ })(RepositoryClass || (RepositoryClass = {}));
2838
+ var RepositorySubClass;
2839
+ (function (RepositorySubClass) {
2840
+ RepositorySubClass["WebMapService"] = "WebMapService";
2841
+ RepositorySubClass["WebMapTileService"] = "WebMapTileService";
2842
+ RepositorySubClass["MapServer"] = "MapServer";
2843
+ })(RepositorySubClass || (RepositorySubClass = {}));
2844
+
2845
+
2846
+ /***/ }),
2847
+
2848
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/iTwinsClient.js":
2849
+ /*!*********************************************************************************************************************************!*\
2850
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/iTwinsClient.js ***!
2851
+ \*********************************************************************************************************************************/
2852
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2853
+
2854
+ "use strict";
2855
+ __webpack_require__.r(__webpack_exports__);
2856
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2857
+ /* harmony export */ "ITwinsAccessClient": () => (/* binding */ ITwinsAccessClient)
2858
+ /* harmony export */ });
2859
+ /* harmony import */ var _BaseClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseClient */ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/BaseClient.js");
2860
+
2861
+ /** Client API to access the itwins service.
2862
+ * @beta
2863
+ */
2864
+ class ITwinsAccessClient extends _BaseClient__WEBPACK_IMPORTED_MODULE_0__.BaseClient {
2865
+ constructor(url) {
2866
+ super(url);
2867
+ }
2868
+ /** Get itwins accessible to the user
2869
+ * @param accessToken The client access token string
2870
+ * @param subClass Required parameter to search a specific iTwin subClass
2871
+ * @param arg Optional query arguments, for paging, searching, and filtering
2872
+ * @returns Array of projects, may be empty
2873
+ */
2874
+ async queryAsync(accessToken, subClass, arg) {
2875
+ const headers = this.getResultModeHeaders(arg && arg.resultMode);
2876
+ let url = `${this._baseUrl}?subClass=${subClass}`;
2877
+ if (arg)
2878
+ url += this.getQueryString(arg);
2879
+ return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "iTwins", headers);
2880
+ }
2881
+ /** Create a new iTwin
2882
+ * @param accessToken The client access token string
2883
+ * @param iTwin The iTwin to be created
2884
+ * @returns ITwin
2885
+ */
2886
+ async createiTwin(accessToken, iTwin) {
2887
+ const url = `${this._baseUrl}/`;
2888
+ return this.sendGenericAPIRequest(accessToken, "POST", url, iTwin, "iTwin");
2889
+ }
2890
+ /** Update the specified iTwin
2891
+ * @param accessToken The client access token string
2892
+ * @param iTwinId The id of the iTwin
2893
+ * @param iTwin The iTwin to be created
2894
+ * @returns ITwin
2895
+ */
2896
+ async updateiTwin(accessToken, iTwinId, iTwin) {
2897
+ const url = `${this._baseUrl}/${iTwinId}`;
2898
+ return this.sendGenericAPIRequest(accessToken, "PATCH", url, iTwin, "iTwin");
2899
+ }
2900
+ /** Delete the specified iTwin
2901
+ * @param accessToken The client access token string
2902
+ * @param iTwinId The id of the iTwin
2903
+ * @returns No Content
2904
+ */
2905
+ async deleteiTwin(accessToken, iTwinId) {
2906
+ const url = `${this._baseUrl}/${iTwinId}`;
2907
+ return this.sendGenericAPIRequest(accessToken, "DELETE", url);
2908
+ }
2909
+ /** Create a new iTwin Repository
2910
+ * @param accessToken The client access token string
2911
+ * @param iTwinId The id of the iTwin
2912
+ * @param repository The Repository to be created
2913
+ * @return Repository
2914
+ */
2915
+ async createRepository(accessToken, iTwinId, repository) {
2916
+ const url = `${this._baseUrl}/${iTwinId}/repositories`;
2917
+ return this.sendGenericAPIRequest(accessToken, "POST", url, repository, "repository");
2918
+ }
2919
+ /** Delete the specified iTwin Repository
2920
+ * @param accessToken The client access token string
2921
+ * @param iTwinId The id of the iTwin
2922
+ * @param repositoryId The id of the Repository
2923
+ * @return No Content
2924
+ */
2925
+ async deleteRepository(accessToken, iTwinId, repositoryId) {
2926
+ const url = `${this._baseUrl}/${iTwinId}/repositories/${repositoryId}`;
2927
+ return this.sendGenericAPIRequest(accessToken, "DELETE", url);
2928
+ }
2929
+ /** Get Repositories accessible to user
2930
+ * @param accessToken The client access token string
2931
+ * @param iTwinId The id of the iTwin
2932
+ * @param arg Optional query arguments, for class and subclass
2933
+ * @returns Array of Repositories, may be empty
2934
+ */
2935
+ async queryRepositoriesAsync(accessToken, iTwinId, arg) {
2936
+ let url = `${this._baseUrl}/${iTwinId}/repositories`;
2937
+ if (arg)
2938
+ url += this.getRepositoryQueryString(arg);
2939
+ return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "repositories");
2940
+ }
2941
+ /** Get itwin accessible to the user
2942
+ * @param accessToken The client access token string
2943
+ * @param iTwinId The id of the iTwin
2944
+ * @param resultMode (Optional) iTwin result mode: minimal or representation
2945
+ * @returns Array of projects, may be empty
2946
+ */
2947
+ async getAsync(accessToken, iTwinId, resultMode) {
2948
+ const headers = this.getResultModeHeaders(resultMode);
2949
+ const url = `${this._baseUrl}/${iTwinId}`;
2950
+ return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "iTwin", headers);
2951
+ }
2952
+ /** Get itwins accessible to the user
2953
+ * @param accessToken The client access token string
2954
+ * @param subClass Required parameter to search a specific iTwin subClass
2955
+ * @param arg Optional query arguments, for paging, searching, and filtering
2956
+ * @returns Array of projects, may be empty
2957
+ */
2958
+ async queryFavoritesAsync(accessToken, subClass, arg) {
2959
+ const headers = this.getResultModeHeaders(arg && arg.resultMode);
2960
+ let url = `${this._baseUrl}/favorites?subClass=${subClass}`;
2961
+ if (arg)
2962
+ url += this.getQueryString(arg);
2963
+ return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "iTwins", headers);
2964
+ }
2965
+ /** Get itwins accessible to the user
2966
+ * @param accessToken The client access token string
2967
+ * @param subClass Required parameter to search a specific iTwin subClass
2968
+ * @param arg Optional query arguments, for paging, searching, and filtering
2969
+ * @returns Array of projects, may be empty
2970
+ */
2971
+ async queryRecentsAsync(accessToken, subClass, arg) {
2972
+ const headers = this.getResultModeHeaders(arg && arg.resultMode);
2973
+ let url = `${this._baseUrl}/recents?subClass=${subClass}`;
2974
+ if (arg)
2975
+ url += this.getQueryString(arg);
2976
+ return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "iTwins", headers);
2977
+ }
2978
+ /** Get primary account accessible to the user
2979
+ * @returns Primary account
2980
+ */
2981
+ async getPrimaryAccountAsync(accessToken) {
2982
+ const url = `${this._baseUrl}/myprimaryaccount`;
2983
+ return this.sendGenericAPIRequest(accessToken, "GET", url, undefined, "iTwin");
2984
+ }
2985
+ /**
2986
+ * Format result mode parameter into a headers entry
2987
+ * @param resultMode (Optional) iTwin result mode
2988
+ * @protected
2989
+ */
2990
+ getResultModeHeaders(resultMode = "minimal") {
2991
+ return {
2992
+ prefer: `return=${resultMode}`,
2993
+ };
2994
+ }
2995
+ }
2996
+
2997
+
2998
+ /***/ }),
2999
+
3000
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/itwins-client.js":
3001
+ /*!**********************************************************************************************************************************!*\
3002
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/itwins-client.js ***!
3003
+ \**********************************************************************************************************************************/
3004
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3005
+
3006
+ "use strict";
3007
+ __webpack_require__.r(__webpack_exports__);
3008
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3009
+ /* harmony export */ "ITwinClass": () => (/* reexport safe */ _iTwinsAccessProps__WEBPACK_IMPORTED_MODULE_1__.ITwinClass),
3010
+ /* harmony export */ "ITwinSubClass": () => (/* reexport safe */ _iTwinsAccessProps__WEBPACK_IMPORTED_MODULE_1__.ITwinSubClass),
3011
+ /* harmony export */ "ITwinsAccessClient": () => (/* reexport safe */ _iTwinsClient__WEBPACK_IMPORTED_MODULE_0__.ITwinsAccessClient),
3012
+ /* harmony export */ "RepositoryClass": () => (/* reexport safe */ _iTwinsAccessProps__WEBPACK_IMPORTED_MODULE_1__.RepositoryClass),
3013
+ /* harmony export */ "RepositorySubClass": () => (/* reexport safe */ _iTwinsAccessProps__WEBPACK_IMPORTED_MODULE_1__.RepositorySubClass)
3014
+ /* harmony export */ });
3015
+ /* harmony import */ var _iTwinsClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iTwinsClient */ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/iTwinsClient.js");
3016
+ /* harmony import */ var _iTwinsAccessProps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iTwinsAccessProps */ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/iTwinsAccessProps.js");
3017
+ /*---------------------------------------------------------------------------------------------
3018
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3019
+ * See LICENSE.md in the project root for license terms and full copyright notice.
3020
+ *--------------------------------------------------------------------------------------------*/
3021
+
3022
+
3023
+ /** @docs-package-description
3024
+ * The itwins-client package provides a means of interfacing with services relating to iTwins.
3025
+ */
3026
+ /**
3027
+ * @docs-group-description iTwinsClient
3028
+ * Classes for communicating with the iTwins service.
3029
+ */
3030
+
3031
+
2662
3032
  /***/ }),
2663
3033
 
2664
3034
  /***/ "../../common/temp/node_modules/.pnpm/@itwin+oidc-signin-tool@3.6.1/node_modules/@itwin/oidc-signin-tool/lib/cjs/TestFrontendAuthorizationClient.js":
@@ -2853,207 +3223,6 @@ __exportStar(__webpack_require__(/*! ./TestFrontendAuthorizationClient */ "../..
2853
3223
  __exportStar(__webpack_require__(/*! ./certa/certaCommon */ "../../common/temp/node_modules/.pnpm/@itwin+oidc-signin-tool@3.6.1/node_modules/@itwin/oidc-signin-tool/lib/cjs/certa/certaCommon.js"), exports);
2854
3224
  //# sourceMappingURL=frontend.js.map
2855
3225
 
2856
- /***/ }),
2857
-
2858
- /***/ "../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/ProjectsAccessProps.js":
2859
- /*!********************************************************************************************************************************************!*\
2860
- !*** ../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/ProjectsAccessProps.js ***!
2861
- \********************************************************************************************************************************************/
2862
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2863
-
2864
- "use strict";
2865
- __webpack_require__.r(__webpack_exports__);
2866
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2867
- /* harmony export */ "ProjectsSearchableProperty": () => (/* binding */ ProjectsSearchableProperty),
2868
- /* harmony export */ "ProjectsSource": () => (/* binding */ ProjectsSource)
2869
- /* harmony export */ });
2870
- /*---------------------------------------------------------------------------------------------
2871
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
2872
- * See LICENSE.md in the project root for license terms and full copyright notice.
2873
- *--------------------------------------------------------------------------------------------*/
2874
- /** @packageDocumentation
2875
- * @module ProjectsClient
2876
- */
2877
- /** Set of properties that can be searched
2878
- * @beta
2879
- */
2880
- var ProjectsSearchableProperty;
2881
- (function (ProjectsSearchableProperty) {
2882
- ProjectsSearchableProperty["Name"] = "displayName";
2883
- })(ProjectsSearchableProperty || (ProjectsSearchableProperty = {}));
2884
- /** Possible Project sources.
2885
- * @beta
2886
- */
2887
- var ProjectsSource;
2888
- (function (ProjectsSource) {
2889
- ProjectsSource["All"] = "";
2890
- ProjectsSource["Favorites"] = "favorites";
2891
- ProjectsSource["Recents"] = "recents";
2892
- })(ProjectsSource || (ProjectsSource = {}));
2893
-
2894
-
2895
- /***/ }),
2896
-
2897
- /***/ "../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/ProjectsClient.js":
2898
- /*!***************************************************************************************************************************************!*\
2899
- !*** ../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/ProjectsClient.js ***!
2900
- \***************************************************************************************************************************************/
2901
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2902
-
2903
- "use strict";
2904
- __webpack_require__.r(__webpack_exports__);
2905
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2906
- /* harmony export */ "ProjectsAccessClient": () => (/* binding */ ProjectsAccessClient)
2907
- /* harmony export */ });
2908
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "../../common/temp/node_modules/.pnpm/axios@0.25.0/node_modules/axios/index.js");
2909
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);
2910
-
2911
- /** Client API to access the project services.
2912
- * @beta
2913
- */
2914
- class ProjectsAccessClient {
2915
- constructor() {
2916
- this._baseUrl = "https://api.bentley.com/projects/";
2917
- const urlPrefix = process.env.IMJS_URL_PREFIX;
2918
- if (urlPrefix) {
2919
- const baseUrl = new URL(this._baseUrl);
2920
- baseUrl.hostname = urlPrefix + baseUrl.hostname;
2921
- this._baseUrl = baseUrl.href;
2922
- }
2923
- }
2924
- /** Get projects accessible to the user
2925
- * @param accessToken The client access token string
2926
- * @param arg Options for paging and/or searching
2927
- * @returns Array of projects, may be empty
2928
- */
2929
- async getAll(accessToken, arg) {
2930
- return (await this.getByQuery(accessToken, arg)).projects;
2931
- }
2932
- /** Gets projects using the given query options
2933
- * @param accessToken The client access token string
2934
- * @param arg Optional object containing queryable properties
2935
- * @returns Projects and links meeting the query's requirements
2936
- */
2937
- async getByQuery(accessToken, arg) {
2938
- let url = this._baseUrl;
2939
- if (arg)
2940
- url = url + this.getQueryString(arg);
2941
- return this.getByUrl(accessToken, url);
2942
- }
2943
- async getByUrl(accessToken, url) {
2944
- const requestOptions = this.getRequestOptions(accessToken);
2945
- const projects = [];
2946
- const links = {};
2947
- try {
2948
- const response = await axios__WEBPACK_IMPORTED_MODULE_0___default().get(url, requestOptions);
2949
- if (!response.data.projects) {
2950
- new Error("Expected array of projects not found in API response.");
2951
- }
2952
- response.data.projects.forEach((project) => {
2953
- projects.push({
2954
- id: project.id,
2955
- name: project.displayName,
2956
- code: project.projectNumber,
2957
- });
2958
- });
2959
- const linkData = response.data._links;
2960
- if (linkData) {
2961
- if (linkData.self && linkData.self.href)
2962
- links.self = async (token) => this.getByUrl(token, linkData.self.href);
2963
- if (linkData.next && linkData.next.href)
2964
- links.next = async (token) => this.getByUrl(token, linkData.next.href);
2965
- if (linkData.prev && linkData.prev.href)
2966
- links.previous = async (token) => this.getByUrl(token, linkData.prev.href);
2967
- }
2968
- }
2969
- catch (errorResponse) {
2970
- throw Error(`API request error: ${JSON.stringify(errorResponse)}`);
2971
- }
2972
- return { projects, links };
2973
- }
2974
- /**
2975
- * Build the request methods, headers, and other options
2976
- * @param accessTokenString The client access token string
2977
- */
2978
- getRequestOptions(accessTokenString) {
2979
- return {
2980
- method: "GET",
2981
- headers: {
2982
- "authorization": accessTokenString,
2983
- "content-type": "application/json",
2984
- },
2985
- };
2986
- }
2987
- /**
2988
- * Build a query to be appended to a URL
2989
- * @param queryArg Object container queryable properties
2990
- * @returns String beginning with '?' to be appended to a URL, or it may be empty
2991
- */
2992
- getQueryString(queryArg) {
2993
- let queryBuilder = "";
2994
- // Handle searches
2995
- if (queryArg.search) {
2996
- if (queryArg.search.exactMatch)
2997
- queryBuilder = `${queryBuilder}${queryArg.search.propertyName}=${queryArg.search.searchString}&`;
2998
- // Currently the API only allows substring searching across both name and code at the same time
2999
- else
3000
- queryBuilder = `${queryBuilder}$search=${queryArg.search.searchString}&`;
3001
- }
3002
- // Handle pagination
3003
- if (queryArg.pagination) {
3004
- if (queryArg.pagination.skip)
3005
- queryBuilder = `${queryBuilder}$skip=${queryArg.pagination.skip}&`;
3006
- if (queryArg.pagination.top)
3007
- queryBuilder = `${queryBuilder}$top=${queryArg.pagination.top}&`;
3008
- }
3009
- // slice off last '&'
3010
- if (queryBuilder.length > 0 && queryBuilder[queryBuilder.length - 1] === "&")
3011
- queryBuilder = queryBuilder.slice(0, -1);
3012
- // Handle source
3013
- let sourcePath = "";
3014
- if (queryArg.source !== undefined && queryArg.source.length > 0) {
3015
- sourcePath = `${queryArg.source}/`;
3016
- }
3017
- // No query
3018
- if (queryBuilder.length === 0)
3019
- return sourcePath;
3020
- return `${sourcePath}?${queryBuilder}`;
3021
- }
3022
- }
3023
-
3024
-
3025
- /***/ }),
3026
-
3027
- /***/ "../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/projects-client.js":
3028
- /*!****************************************************************************************************************************************!*\
3029
- !*** ../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/projects-client.js ***!
3030
- \****************************************************************************************************************************************/
3031
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3032
-
3033
- "use strict";
3034
- __webpack_require__.r(__webpack_exports__);
3035
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3036
- /* harmony export */ "ProjectsAccessClient": () => (/* reexport safe */ _ProjectsClient__WEBPACK_IMPORTED_MODULE_0__.ProjectsAccessClient),
3037
- /* harmony export */ "ProjectsSearchableProperty": () => (/* reexport safe */ _ProjectsAccessProps__WEBPACK_IMPORTED_MODULE_1__.ProjectsSearchableProperty),
3038
- /* harmony export */ "ProjectsSource": () => (/* reexport safe */ _ProjectsAccessProps__WEBPACK_IMPORTED_MODULE_1__.ProjectsSource)
3039
- /* harmony export */ });
3040
- /* harmony import */ var _ProjectsClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ProjectsClient */ "../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/ProjectsClient.js");
3041
- /* harmony import */ var _ProjectsAccessProps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ProjectsAccessProps */ "../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/ProjectsAccessProps.js");
3042
- /*---------------------------------------------------------------------------------------------
3043
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3044
- * See LICENSE.md in the project root for license terms and full copyright notice.
3045
- *--------------------------------------------------------------------------------------------*/
3046
-
3047
-
3048
- /** @docs-package-description
3049
- * The projects-client package provides a means of interfacing with services relating to projects which surround iModels.
3050
- */
3051
- /**
3052
- * @docs-group-description ProjectsClient
3053
- * Classes for communicating with the projects service.
3054
- */
3055
-
3056
-
3057
3226
  /***/ }),
3058
3227
 
3059
3228
  /***/ "../../common/temp/node_modules/.pnpm/almost-equal@1.1.0/node_modules/almost-equal/almost_equal.js":
@@ -83281,6 +83450,8 @@ function consumeNextChunk(stream) {
83281
83450
  return undefined;
83282
83451
  const offset = stream.curPos + 8;
83283
83452
  const length = stream.readUint32();
83453
+ if (stream.isAtTheEnd)
83454
+ return undefined;
83284
83455
  const type = stream.readUint32();
83285
83456
  stream.advance(length);
83286
83457
  return stream.isPastTheEnd ? false : { offset, length, type };
@@ -160816,6 +160987,9 @@ class GltfReader {
160816
160987
  }
160817
160988
  let componentCount = 1;
160818
160989
  switch (accessor.type) {
160990
+ case "VEC4":
160991
+ componentCount = 4;
160992
+ break;
160819
160993
  case "VEC3":
160820
160994
  componentCount = 3;
160821
160995
  break;
@@ -161095,7 +161269,7 @@ class GltfReader {
161095
161269
  }
161096
161270
  }
161097
161271
  const uvs = (_e = draco.attributes.TEXCOORD_0) === null || _e === void 0 ? void 0 : _e.value;
161098
- if (uvs && (uvs.length & 2) === 0)
161272
+ if (uvs && (uvs.length % 2) === 0)
161099
161273
  for (let i = 0; i < uvs.length; i += 2)
161100
161274
  mesh.uvParams.push(new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d(uvs[i], uvs[i + 1]));
161101
161275
  const batchIds = (_f = draco.attributes._BATCHID) === null || _f === void 0 ? void 0 : _f.value;
@@ -274461,230 +274635,230 @@ __webpack_require__.r(__webpack_exports__);
274461
274635
  /* harmony import */ var i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18next-browser-languagedetector */ "../../common/temp/node_modules/.pnpm/i18next-browser-languagedetector@6.1.8/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js");
274462
274636
  /* harmony import */ var i18next_http_backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@1.4.5/node_modules/i18next-http-backend/esm/index.js");
274463
274637
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
274464
- /*---------------------------------------------------------------------------------------------
274465
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
274466
- * See LICENSE.md in the project root for license terms and full copyright notice.
274467
- *--------------------------------------------------------------------------------------------*/
274468
- /** @packageDocumentation
274469
- * @module Localization
274470
- */
274471
-
274472
-
274473
-
274474
-
274475
- const DEFAULT_MAX_RETRIES = 1; // a low number prevents wasted time and potential timeouts when requesting localization files throws an error
274476
- /** Supplies localizations for iTwin.js
274477
- * @note this class uses the [i18next](https://www.i18next.com/) package.
274478
- * @public
274479
- */
274480
- class ITwinLocalization {
274481
- constructor(options) {
274482
- var _a, _b, _c;
274483
- this._namespaces = new Map();
274484
- this.i18next = i18next__WEBPACK_IMPORTED_MODULE_0__["default"].createInstance();
274485
- this._backendOptions = {
274486
- loadPath: (_a = options === null || options === void 0 ? void 0 : options.urlTemplate) !== null && _a !== void 0 ? _a : "locales/{{lng}}/{{ns}}.json",
274487
- crossDomain: true,
274488
- ...options === null || options === void 0 ? void 0 : options.backendHttpOptions,
274489
- };
274490
- this._detectionOptions = {
274491
- order: ["querystring", "navigator", "htmlTag"],
274492
- lookupQuerystring: "lng",
274493
- caches: [],
274494
- ...options === null || options === void 0 ? void 0 : options.detectorOptions,
274495
- };
274496
- this._initOptions = {
274497
- interpolation: { escapeValue: true },
274498
- fallbackLng: "en",
274499
- maxRetries: DEFAULT_MAX_RETRIES,
274500
- backend: this._backendOptions,
274501
- detection: this._detectionOptions,
274502
- ...options === null || options === void 0 ? void 0 : options.initOptions,
274503
- };
274504
- this.i18next
274505
- .use((_b = options === null || options === void 0 ? void 0 : options.detectorPlugin) !== null && _b !== void 0 ? _b : i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__["default"])
274506
- .use((_c = options === null || options === void 0 ? void 0 : options.backendPlugin) !== null && _c !== void 0 ? _c : i18next_http_backend__WEBPACK_IMPORTED_MODULE_2__["default"])
274507
- .use(TranslationLogger);
274508
- }
274509
- async initialize(namespaces) {
274510
- var _a;
274511
- // Also consider namespaces passed into constructor
274512
- const initNamespaces = [this._initOptions.ns || []].flat();
274513
- const combinedNamespaces = new Set([...namespaces, ...initNamespaces]); // without duplicates
274514
- const defaultNamespace = (_a = this._initOptions.defaultNS) !== null && _a !== void 0 ? _a : namespaces[0];
274515
- if (defaultNamespace)
274516
- combinedNamespaces.add(defaultNamespace); // Make sure default namespace is in namespaces list
274517
- const initOptions = {
274518
- ...this._initOptions,
274519
- defaultNS: defaultNamespace,
274520
- ns: [...combinedNamespaces],
274521
- };
274522
- // if in a development environment, set debugging
274523
- if (false)
274524
- {}
274525
- const initPromise = this.i18next.init(initOptions);
274526
- for (const ns of namespaces)
274527
- this._namespaces.set(ns, initPromise);
274528
- return initPromise;
274529
- }
274530
- /** Replace all instances of `%{key}` within a string with the translations of those keys.
274531
- * For example:
274532
- * ``` ts
274533
- * "MyKeys": {
274534
- * "Key1": "First value",
274535
- * "Key2": "Second value"
274536
- * }
274537
- * ```
274538
- *
274539
- * ``` ts
274540
- * i18.translateKeys("string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!"") // returns "string with First Value followed by Second Value!"
274541
- * ```
274542
- * @param line The input line, potentially containing %{keys}.
274543
- * @returns The line with all %{keys} translated
274544
- * @public
274545
- */
274546
- getLocalizedKeys(line) {
274547
- return line.replace(/\%\{(.+?)\}/g, (_match, tag) => this.getLocalizedString(tag));
274548
- }
274549
- /** Return the translated value of a key.
274550
- * @param key - the key that matches a property in the JSON localization file.
274551
- * @note The key includes the namespace, which identifies the particular localization file that contains the property,
274552
- * followed by a colon, followed by the property in the JSON file.
274553
- * For example:
274554
- * ``` ts
274555
- * const dataString: string = IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.BingDataAttribution");
274556
- * ```
274557
- * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.
274558
- * @returns The string corresponding to the first key that resolves.
274559
- * @throws Error if no keys resolve to a string.
274560
- * @public
274561
- */
274562
- getLocalizedString(key, options) {
274563
- if ((options === null || options === void 0 ? void 0 : options.returnDetails) || (options === null || options === void 0 ? void 0 : options.returnObjects)) {
274564
- throw new Error("Translation key must map to a string, but the given options will result in an object");
274565
- }
274566
- const value = this.i18next.t(key, options);
274567
- if (typeof value !== "string") {
274568
- throw new Error("Translation key(s) string not found");
274569
- }
274570
- return value;
274571
- }
274572
- /** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need
274573
- * to include a namespace. If a key includes a namespace, that namespace will be used for interpolating that key.
274574
- * @param namespace - the namespace that identifies the particular localization file that contains the property.
274575
- * @param key - the key that matches a property in the JSON localization file.
274576
- * @returns The string corresponding to the first key that resolves.
274577
- * @throws Error if no keys resolve to a string.
274578
- * @internal
274579
- */
274580
- getLocalizedStringWithNamespace(namespace, key, options) {
274581
- let fullKey = "";
274582
- if (typeof key === "string") {
274583
- fullKey = `${namespace}:${key}`;
274584
- }
274585
- else {
274586
- fullKey = key.map((subKey) => {
274587
- return `${namespace}:${subKey}`;
274588
- });
274589
- }
274590
- return this.getLocalizedString(fullKey, options);
274591
- }
274592
- /** Gets the English translation.
274593
- * @param namespace - the namespace that identifies the particular localization file that contains the property.
274594
- * @param key - the key that matches a property in the JSON localization file.
274595
- * @returns The string corresponding to the first key that resolves.
274596
- * @throws Error if no keys resolve to a string.
274597
- * @internal
274598
- */
274599
- getEnglishString(namespace, key, options) {
274600
- if ((options === null || options === void 0 ? void 0 : options.returnDetails) || (options === null || options === void 0 ? void 0 : options.returnObjects)) {
274601
- throw new Error("Translation key must map to a string, but the given options will result in an object");
274602
- }
274603
- options = {
274604
- ...options,
274605
- ns: namespace, // ensure namespace argument is used
274606
- };
274607
- const en = this.i18next.getFixedT("en", namespace);
274608
- const str = en(key, options);
274609
- if (typeof str !== "string")
274610
- throw new Error("Translation key(s) not found");
274611
- return str;
274612
- }
274613
- /** Get the promise for an already registered Namespace.
274614
- * @param name - the name of the namespace
274615
- * @public
274616
- */
274617
- getNamespacePromise(name) {
274618
- return this._namespaces.get(name);
274619
- }
274620
- /** @internal */
274621
- getLanguageList() {
274622
- return this.i18next.languages;
274623
- }
274624
- /** override the language detected in the browser */
274625
- async changeLanguage(language) {
274626
- return this.i18next.changeLanguage(language);
274627
- }
274628
- /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.
274629
- * @param name - the name of the namespace, which is the base name of the JSON file that contains the localization properties.
274630
- * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,
274631
- * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await
274632
- * fulfillment of the readPromise Promise property of the returned LocalizationNamespace.
274633
- * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)
274634
- * @public
274635
- */
274636
- async registerNamespace(name) {
274637
- const existing = this._namespaces.get(name);
274638
- if (existing !== undefined)
274639
- return existing;
274640
- const theReadPromise = new Promise((resolve) => {
274641
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
274642
- this.i18next.loadNamespaces(name, (err) => {
274643
- if (!err)
274644
- return resolve();
274645
- // Here we got a non-null err object.
274646
- // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.
274647
- // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.
274648
- // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.
274649
- // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.
274650
- let locales = this.getLanguageList().map((thisLocale) => `/${thisLocale}/`);
274651
- try {
274652
- for (const thisError of err) {
274653
- if (typeof thisError === "string")
274654
- locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));
274655
- }
274656
- }
274657
- catch (e) {
274658
- locales = [];
274659
- }
274660
- // if we removed every locale from the array, it wasn't loaded.
274661
- if (locales.length === 0)
274662
- _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logError("i18n", `No resources for namespace ${name} could be loaded`);
274663
- resolve();
274664
- });
274665
- });
274666
- this._namespaces.set(name, theReadPromise);
274667
- return theReadPromise;
274668
- }
274669
- /** @internal */
274670
- unregisterNamespace(name) {
274671
- this._namespaces.delete(name);
274672
- }
274673
- }
274674
- class TranslationLogger {
274675
- log(args) { _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logInfo("i18n", this.createLogMessage(args)); }
274676
- warn(args) { _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logWarning("i18n", this.createLogMessage(args)); }
274677
- error(args) { _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logError("i18n", this.createLogMessage(args)); }
274678
- createLogMessage(args) {
274679
- let message = args[0];
274680
- for (let i = 1; i < args.length; ++i) {
274681
- if (typeof args[i] === "string")
274682
- message += `\n ${args[i]}`;
274683
- }
274684
- return message;
274685
- }
274686
- }
274687
- TranslationLogger.type = "logger";
274638
+ /*---------------------------------------------------------------------------------------------
274639
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
274640
+ * See LICENSE.md in the project root for license terms and full copyright notice.
274641
+ *--------------------------------------------------------------------------------------------*/
274642
+ /** @packageDocumentation
274643
+ * @module Localization
274644
+ */
274645
+
274646
+
274647
+
274648
+
274649
+ const DEFAULT_MAX_RETRIES = 1; // a low number prevents wasted time and potential timeouts when requesting localization files throws an error
274650
+ /** Supplies localizations for iTwin.js
274651
+ * @note this class uses the [i18next](https://www.i18next.com/) package.
274652
+ * @public
274653
+ */
274654
+ class ITwinLocalization {
274655
+ constructor(options) {
274656
+ var _a, _b, _c;
274657
+ this._namespaces = new Map();
274658
+ this.i18next = i18next__WEBPACK_IMPORTED_MODULE_0__["default"].createInstance();
274659
+ this._backendOptions = {
274660
+ loadPath: (_a = options === null || options === void 0 ? void 0 : options.urlTemplate) !== null && _a !== void 0 ? _a : "locales/{{lng}}/{{ns}}.json",
274661
+ crossDomain: true,
274662
+ ...options === null || options === void 0 ? void 0 : options.backendHttpOptions,
274663
+ };
274664
+ this._detectionOptions = {
274665
+ order: ["querystring", "navigator", "htmlTag"],
274666
+ lookupQuerystring: "lng",
274667
+ caches: [],
274668
+ ...options === null || options === void 0 ? void 0 : options.detectorOptions,
274669
+ };
274670
+ this._initOptions = {
274671
+ interpolation: { escapeValue: true },
274672
+ fallbackLng: "en",
274673
+ maxRetries: DEFAULT_MAX_RETRIES,
274674
+ backend: this._backendOptions,
274675
+ detection: this._detectionOptions,
274676
+ ...options === null || options === void 0 ? void 0 : options.initOptions,
274677
+ };
274678
+ this.i18next
274679
+ .use((_b = options === null || options === void 0 ? void 0 : options.detectorPlugin) !== null && _b !== void 0 ? _b : i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__["default"])
274680
+ .use((_c = options === null || options === void 0 ? void 0 : options.backendPlugin) !== null && _c !== void 0 ? _c : i18next_http_backend__WEBPACK_IMPORTED_MODULE_2__["default"])
274681
+ .use(TranslationLogger);
274682
+ }
274683
+ async initialize(namespaces) {
274684
+ var _a;
274685
+ // Also consider namespaces passed into constructor
274686
+ const initNamespaces = [this._initOptions.ns || []].flat();
274687
+ const combinedNamespaces = new Set([...namespaces, ...initNamespaces]); // without duplicates
274688
+ const defaultNamespace = (_a = this._initOptions.defaultNS) !== null && _a !== void 0 ? _a : namespaces[0];
274689
+ if (defaultNamespace)
274690
+ combinedNamespaces.add(defaultNamespace); // Make sure default namespace is in namespaces list
274691
+ const initOptions = {
274692
+ ...this._initOptions,
274693
+ defaultNS: defaultNamespace,
274694
+ ns: [...combinedNamespaces],
274695
+ };
274696
+ // if in a development environment, set debugging
274697
+ if (false)
274698
+ {}
274699
+ const initPromise = this.i18next.init(initOptions);
274700
+ for (const ns of namespaces)
274701
+ this._namespaces.set(ns, initPromise);
274702
+ return initPromise;
274703
+ }
274704
+ /** Replace all instances of `%{key}` within a string with the translations of those keys.
274705
+ * For example:
274706
+ * ``` ts
274707
+ * "MyKeys": {
274708
+ * "Key1": "First value",
274709
+ * "Key2": "Second value"
274710
+ * }
274711
+ * ```
274712
+ *
274713
+ * ``` ts
274714
+ * i18.translateKeys("string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!"") // returns "string with First Value followed by Second Value!"
274715
+ * ```
274716
+ * @param line The input line, potentially containing %{keys}.
274717
+ * @returns The line with all %{keys} translated
274718
+ * @public
274719
+ */
274720
+ getLocalizedKeys(line) {
274721
+ return line.replace(/\%\{(.+?)\}/g, (_match, tag) => this.getLocalizedString(tag));
274722
+ }
274723
+ /** Return the translated value of a key.
274724
+ * @param key - the key that matches a property in the JSON localization file.
274725
+ * @note The key includes the namespace, which identifies the particular localization file that contains the property,
274726
+ * followed by a colon, followed by the property in the JSON file.
274727
+ * For example:
274728
+ * ``` ts
274729
+ * const dataString: string = IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.BingDataAttribution");
274730
+ * ```
274731
+ * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.
274732
+ * @returns The string corresponding to the first key that resolves.
274733
+ * @throws Error if no keys resolve to a string.
274734
+ * @public
274735
+ */
274736
+ getLocalizedString(key, options) {
274737
+ if ((options === null || options === void 0 ? void 0 : options.returnDetails) || (options === null || options === void 0 ? void 0 : options.returnObjects)) {
274738
+ throw new Error("Translation key must map to a string, but the given options will result in an object");
274739
+ }
274740
+ const value = this.i18next.t(key, options);
274741
+ if (typeof value !== "string") {
274742
+ throw new Error("Translation key(s) string not found");
274743
+ }
274744
+ return value;
274745
+ }
274746
+ /** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need
274747
+ * to include a namespace. If a key includes a namespace, that namespace will be used for interpolating that key.
274748
+ * @param namespace - the namespace that identifies the particular localization file that contains the property.
274749
+ * @param key - the key that matches a property in the JSON localization file.
274750
+ * @returns The string corresponding to the first key that resolves.
274751
+ * @throws Error if no keys resolve to a string.
274752
+ * @internal
274753
+ */
274754
+ getLocalizedStringWithNamespace(namespace, key, options) {
274755
+ let fullKey = "";
274756
+ if (typeof key === "string") {
274757
+ fullKey = `${namespace}:${key}`;
274758
+ }
274759
+ else {
274760
+ fullKey = key.map((subKey) => {
274761
+ return `${namespace}:${subKey}`;
274762
+ });
274763
+ }
274764
+ return this.getLocalizedString(fullKey, options);
274765
+ }
274766
+ /** Gets the English translation.
274767
+ * @param namespace - the namespace that identifies the particular localization file that contains the property.
274768
+ * @param key - the key that matches a property in the JSON localization file.
274769
+ * @returns The string corresponding to the first key that resolves.
274770
+ * @throws Error if no keys resolve to a string.
274771
+ * @internal
274772
+ */
274773
+ getEnglishString(namespace, key, options) {
274774
+ if ((options === null || options === void 0 ? void 0 : options.returnDetails) || (options === null || options === void 0 ? void 0 : options.returnObjects)) {
274775
+ throw new Error("Translation key must map to a string, but the given options will result in an object");
274776
+ }
274777
+ options = {
274778
+ ...options,
274779
+ ns: namespace, // ensure namespace argument is used
274780
+ };
274781
+ const en = this.i18next.getFixedT("en", namespace);
274782
+ const str = en(key, options);
274783
+ if (typeof str !== "string")
274784
+ throw new Error("Translation key(s) not found");
274785
+ return str;
274786
+ }
274787
+ /** Get the promise for an already registered Namespace.
274788
+ * @param name - the name of the namespace
274789
+ * @public
274790
+ */
274791
+ getNamespacePromise(name) {
274792
+ return this._namespaces.get(name);
274793
+ }
274794
+ /** @internal */
274795
+ getLanguageList() {
274796
+ return this.i18next.languages;
274797
+ }
274798
+ /** override the language detected in the browser */
274799
+ async changeLanguage(language) {
274800
+ return this.i18next.changeLanguage(language);
274801
+ }
274802
+ /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.
274803
+ * @param name - the name of the namespace, which is the base name of the JSON file that contains the localization properties.
274804
+ * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,
274805
+ * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await
274806
+ * fulfillment of the readPromise Promise property of the returned LocalizationNamespace.
274807
+ * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)
274808
+ * @public
274809
+ */
274810
+ async registerNamespace(name) {
274811
+ const existing = this._namespaces.get(name);
274812
+ if (existing !== undefined)
274813
+ return existing;
274814
+ const theReadPromise = new Promise((resolve) => {
274815
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
274816
+ this.i18next.loadNamespaces(name, (err) => {
274817
+ if (!err)
274818
+ return resolve();
274819
+ // Here we got a non-null err object.
274820
+ // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.
274821
+ // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.
274822
+ // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.
274823
+ // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.
274824
+ let locales = this.getLanguageList().map((thisLocale) => `/${thisLocale}/`);
274825
+ try {
274826
+ for (const thisError of err) {
274827
+ if (typeof thisError === "string")
274828
+ locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));
274829
+ }
274830
+ }
274831
+ catch (e) {
274832
+ locales = [];
274833
+ }
274834
+ // if we removed every locale from the array, it wasn't loaded.
274835
+ if (locales.length === 0)
274836
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logError("i18n", `No resources for namespace ${name} could be loaded`);
274837
+ resolve();
274838
+ });
274839
+ });
274840
+ this._namespaces.set(name, theReadPromise);
274841
+ return theReadPromise;
274842
+ }
274843
+ /** @internal */
274844
+ unregisterNamespace(name) {
274845
+ this._namespaces.delete(name);
274846
+ }
274847
+ }
274848
+ class TranslationLogger {
274849
+ log(args) { _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logInfo("i18n", this.createLogMessage(args)); }
274850
+ warn(args) { _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logWarning("i18n", this.createLogMessage(args)); }
274851
+ error(args) { _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logError("i18n", this.createLogMessage(args)); }
274852
+ createLogMessage(args) {
274853
+ let message = args[0];
274854
+ for (let i = 1; i < args.length; ++i) {
274855
+ if (typeof args[i] === "string")
274856
+ message += `\n ${args[i]}`;
274857
+ }
274858
+ return message;
274859
+ }
274860
+ }
274861
+ TranslationLogger.type = "logger";
274688
274862
 
274689
274863
 
274690
274864
  /***/ }),
@@ -274701,17 +274875,17 @@ __webpack_require__.r(__webpack_exports__);
274701
274875
  /* harmony export */ "ITwinLocalization": () => (/* reexport safe */ _ITwinLocalization__WEBPACK_IMPORTED_MODULE_0__.ITwinLocalization)
274702
274876
  /* harmony export */ });
274703
274877
  /* harmony import */ var _ITwinLocalization__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ITwinLocalization */ "../../core/i18n/lib/esm/ITwinLocalization.js");
274704
- /*---------------------------------------------------------------------------------------------
274705
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
274706
- * See LICENSE.md in the project root for license terms and full copyright notice.
274707
- *--------------------------------------------------------------------------------------------*/
274708
-
274709
- /** @docs-package-description
274710
- * The core-i18n package contains classes related to internationalization and localization.
274711
- */
274712
- /** @docs-group-description Localization
274713
- * Classes for internationalization and localization of your app.
274714
- */
274878
+ /*---------------------------------------------------------------------------------------------
274879
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
274880
+ * See LICENSE.md in the project root for license terms and full copyright notice.
274881
+ *--------------------------------------------------------------------------------------------*/
274882
+
274883
+ /** @docs-package-description
274884
+ * The core-i18n package contains classes related to internationalization and localization.
274885
+ */
274886
+ /** @docs-group-description Localization
274887
+ * Classes for internationalization and localization of your app.
274888
+ */
274715
274889
 
274716
274890
 
274717
274891
  /***/ }),
@@ -294796,7 +294970,7 @@ exports.IModelSession = void 0;
294796
294970
  const chai_1 = __webpack_require__(/*! chai */ "../../common/temp/node_modules/.pnpm/chai@4.3.7/node_modules/chai/index.js");
294797
294971
  const core_frontend_1 = __webpack_require__(/*! @itwin/core-frontend */ "../../core/frontend/lib/esm/core-frontend.js");
294798
294972
  const imodels_client_management_1 = __webpack_require__(/*! @itwin/imodels-client-management */ "../../common/temp/node_modules/.pnpm/@itwin+imodels-client-management@3.0.0/node_modules/@itwin/imodels-client-management/lib/esm/index.js");
294799
- const projects_client_1 = __webpack_require__(/*! @itwin/projects-client */ "../../common/temp/node_modules/.pnpm/@itwin+projects-client@0.6.0/node_modules/@itwin/projects-client/lib/esm/projects-client.js");
294973
+ const itwins_client_1 = __webpack_require__(/*! @itwin/itwins-client */ "../../common/temp/node_modules/.pnpm/@itwin+itwins-client@1.2.0/node_modules/@itwin/itwins-client/lib/esm/itwins-client.js");
294800
294974
  const imodels_access_frontend_1 = __webpack_require__(/*! @itwin/imodels-access-frontend */ "../../common/temp/node_modules/.pnpm/@itwin+imodels-access-frontend@3.0.0/node_modules/@itwin/imodels-access-frontend/lib/esm/index.js");
294801
294975
  class IModelSession {
294802
294976
  constructor(iModelId, iTwinId, changesetId) {
@@ -294805,29 +294979,29 @@ class IModelSession {
294805
294979
  this.changesetId = changesetId;
294806
294980
  }
294807
294981
  static async create(accessToken, iModelData) {
294808
- var _a;
294982
+ var _a, _b;
294809
294983
  let iTwinId;
294810
294984
  let imodelId;
294811
294985
  // Turn the iTwin name into an id
294812
294986
  if (iModelData.useITwinName && iModelData.iTwinName) {
294813
- const client = new projects_client_1.ProjectsAccessClient();
294814
- const iTwinList = await client.getAll(accessToken, {
294815
- search: {
294816
- searchString: iModelData.iTwinName,
294817
- propertyName: projects_client_1.ProjectsSearchableProperty.Name,
294818
- exactMatch: true,
294819
- },
294987
+ const client = new itwins_client_1.ITwinsAccessClient();
294988
+ const iTwinListResponse = await client.queryAsync(accessToken, itwins_client_1.ITwinSubClass.Project, {
294989
+ displayName: iModelData.iTwinName,
294820
294990
  });
294991
+ const iTwinList = iTwinListResponse.data;
294992
+ if (!iTwinList) {
294993
+ throw new Error(`ITwin ${iModelData.iTwinName} returned with no data when queried.`);
294994
+ }
294821
294995
  if (iTwinList.length === 0)
294822
294996
  throw new Error(`ITwin ${iModelData.iTwinName} was not found for the user.`);
294823
294997
  else if (iTwinList.length > 1)
294824
294998
  throw new Error(`Multiple iTwins named ${iModelData.iTwinName} were found for the user.`);
294825
- iTwinId = iTwinList[0].id;
294999
+ iTwinId = (_a = iTwinList[0].id) !== null && _a !== void 0 ? _a : iModelData.iTwinId;
294826
295000
  }
294827
295001
  else
294828
295002
  iTwinId = iModelData.iTwinId;
294829
295003
  if (iModelData.useName) {
294830
- const imodelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${(_a = process.env.IMJS_URL_PREFIX) !== null && _a !== void 0 ? _a : ""}api.bentley.com/imodels` } });
295004
+ const imodelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${(_b = process.env.IMJS_URL_PREFIX) !== null && _b !== void 0 ? _b : ""}api.bentley.com/imodels` } });
294831
295005
  const iModels = imodelClient.iModels.getRepresentationList({
294832
295006
  authorization: imodels_access_frontend_1.AccessTokenAdapter.toAuthorizationCallback(accessToken),
294833
295007
  urlParams: {
@@ -305324,7 +305498,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
305324
305498
  /***/ ((module) => {
305325
305499
 
305326
305500
  "use strict";
305327
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.7.11","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs","build:ci":"npm run -s build && npm run -s build:esm","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^3.7.11","@itwin/core-bentley":"workspace:^3.7.11","@itwin/core-common":"workspace:^3.7.11","@itwin/core-geometry":"workspace:^3.7.11","@itwin/core-orbitgt":"workspace:^3.7.11","@itwin/core-quantity":"workspace:^3.7.11","@itwin/webgl-compatibility":"workspace:^3.7.11"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/lodash":"^4.14.0","@types/mocha":"^8.2.2","@types/node":"18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/object-storage-azure":"^2.0.0","@itwin/cloud-agnostic-core":"^2.0.0","@itwin/object-storage-core":"^2.0.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","inversify":"~6.0.1","lodash":"^4.17.10","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"^0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
305501
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.7.13","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs","build:ci":"npm run -s build && npm run -s build:esm","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^3.7.13","@itwin/core-bentley":"workspace:^3.7.13","@itwin/core-common":"workspace:^3.7.13","@itwin/core-geometry":"workspace:^3.7.13","@itwin/core-orbitgt":"workspace:^3.7.13","@itwin/core-quantity":"workspace:^3.7.13","@itwin/webgl-compatibility":"workspace:^3.7.13"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/lodash":"^4.14.0","@types/mocha":"^8.2.2","@types/node":"18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/object-storage-azure":"^2.0.0","@itwin/cloud-agnostic-core":"^2.0.0","@itwin/object-storage-core":"^2.0.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","inversify":"~6.0.1","lodash":"^4.17.10","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"^0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
305328
305502
 
305329
305503
  /***/ })
305330
305504