@itwin/rpcinterface-full-stack-tests 4.0.5 → 4.0.7

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_mdtbcqczpmeuv6yjzfaigjndwi/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_mdtbcqczpmeuv6yjzfaigjndwi/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":
@@ -274671,7 +274840,7 @@ exports.IModelSession = void 0;
274671
274840
  *--------------------------------------------------------------------------------------------*/
274672
274841
  const chai_1 = __webpack_require__(/*! chai */ "../../common/temp/node_modules/.pnpm/chai@4.3.7/node_modules/chai/index.js");
274673
274842
  const core_frontend_1 = __webpack_require__(/*! @itwin/core-frontend */ "../../core/frontend/lib/esm/core-frontend.js");
274674
- 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");
274843
+ 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");
274675
274844
  const core_common_1 = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
274676
274845
  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");
274677
274846
  const imodels_access_frontend_1 = __webpack_require__(/*! @itwin/imodels-access-frontend */ "../../common/temp/node_modules/.pnpm/@itwin+imodels-access-frontend@3.0.0_ueafa4slb6ohrhyf7kbp6egmha/node_modules/@itwin/imodels-access-frontend/lib/esm/index.js");
@@ -274689,19 +274858,19 @@ class IModelSession {
274689
274858
  if (iModelData.useITwinName) {
274690
274859
  if (!iModelData.iTwinName)
274691
274860
  throw new Error(`The iModel has no iTwin name, so it cannot get the iTwin.`);
274692
- const client = new projects_client_1.ProjectsAccessClient();
274693
- const iTwinList = await client.getAll(requestContext, {
274694
- search: {
274695
- searchString: iModelData.iTwinName,
274696
- propertyName: projects_client_1.ProjectsSearchableProperty.Name,
274697
- exactMatch: true,
274698
- }
274861
+ const client = new itwins_client_1.ITwinsAccessClient();
274862
+ const iTwinListResponse = await client.queryAsync(requestContext, itwins_client_1.ITwinSubClass.Project, {
274863
+ displayName: iModelData.iTwinName,
274699
274864
  });
274865
+ const iTwinList = iTwinListResponse.data;
274866
+ if (!iTwinList) {
274867
+ throw new Error(`ITwin ${iModelData.iTwinName} returned with no data when queried.`);
274868
+ }
274700
274869
  if (iTwinList.length === 0)
274701
274870
  throw new Error(`ITwin ${iModelData.iTwinName} was not found for the user.`);
274702
274871
  else if (iTwinList.length > 1)
274703
274872
  throw new Error(`Multiple iTwins named ${iModelData.iTwinName} were found for the user.`);
274704
- iTwinId = iTwinList[0].id;
274873
+ iTwinId = iTwinList[0].id ?? iModelData.iTwinId;
274705
274874
  }
274706
274875
  else
274707
274876
  iTwinId = iModelData.iTwinId;
@@ -274814,7 +274983,7 @@ class TestContext {
274814
274983
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
274815
274984
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
274816
274985
  await core_frontend_1.NoRenderApp.startup({
274817
- applicationVersion: "4.0.5",
274986
+ applicationVersion: "4.0.7",
274818
274987
  applicationId: this.settings.gprid,
274819
274988
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
274820
274989
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -294188,7 +294357,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
294188
294357
  /***/ ((module) => {
294189
294358
 
294190
294359
  "use strict";
294191
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.5","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 && 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 \\"./node_modules/@itwin/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.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.0.5","@itwin/core-bentley":"workspace:^4.0.5","@itwin/core-common":"workspace:^4.0.5","@itwin/core-geometry":"workspace:^4.0.5","@itwin/core-orbitgt":"workspace:^4.0.5","@itwin/core-quantity":"workspace:^4.0.5"},"//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":"^4.0.0-dev.33","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@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":"^8.36.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":"~5.0.2","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:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","inversify":"~6.0.1","reflect-metadata":"^0.1.13","wms-capabilities":"0.4.0"},"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"}}]}}');
294360
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.7","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 && 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 \\"./node_modules/@itwin/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.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.0.7","@itwin/core-bentley":"workspace:^4.0.7","@itwin/core-common":"workspace:^4.0.7","@itwin/core-geometry":"workspace:^4.0.7","@itwin/core-orbitgt":"workspace:^4.0.7","@itwin/core-quantity":"workspace:^4.0.7"},"//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":"^4.0.0-dev.33","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@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":"^8.36.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":"~5.0.2","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:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","inversify":"~6.0.1","reflect-metadata":"^0.1.13","wms-capabilities":"0.4.0"},"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"}}]}}');
294192
294361
 
294193
294362
  /***/ }),
294194
294363