@itwin/ecschema-rpcinterface-common 4.0.0-dev.10 → 4.0.0-dev.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,58 @@
1
1
  # Change Log - @itwin/ecschema-rpcinterface-common
2
2
 
3
- This log was last generated on Thu, 26 Jan 2023 22:53:27 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 25 Apr 2023 17:50:35 GMT and should not be manually modified.
4
+
5
+ ## 3.7.4
6
+ Tue, 25 Apr 2023 17:50:35 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.7.3
11
+ Thu, 20 Apr 2023 13:19:29 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.7.2
16
+ Wed, 12 Apr 2023 13:12:42 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 3.7.1
21
+ Mon, 03 Apr 2023 15:15:37 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 3.7.0
26
+ Wed, 29 Mar 2023 15:02:27 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 3.6.3
31
+ Mon, 27 Mar 2023 16:26:47 GMT
32
+
33
+ _Version update only_
34
+
35
+ ## 3.6.2
36
+ Fri, 17 Mar 2023 17:52:32 GMT
37
+
38
+ _Version update only_
39
+
40
+ ## 3.6.1
41
+ Fri, 24 Feb 2023 22:00:48 GMT
42
+
43
+ _Version update only_
44
+
45
+ ## 3.6.0
46
+ Wed, 08 Feb 2023 14:58:40 GMT
47
+
48
+ ### Updates
49
+
50
+ - React to RPC deprecations.
51
+
52
+ ## 3.5.6
53
+ Fri, 24 Feb 2023 16:02:47 GMT
54
+
55
+ _Version update only_
4
56
 
5
57
  ## 3.5.5
6
58
  Thu, 26 Jan 2023 22:53:27 GMT
@@ -1,35 +1,35 @@
1
- import { IModelRpcProps, RpcInterface } from "@itwin/core-common";
2
- import { SchemaKeyProps, SchemaProps } from "@itwin/ecschema-metadata";
3
- /***
4
- * Defines an RPC interface to get schema information from a given iModel context.
5
- * Method @see getSchemaNames will return the names of schemas that live in this iModel.
6
- * The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.
7
- * @internal
8
- */
9
- export declare abstract class ECSchemaRpcInterface extends RpcInterface {
10
- /** The version of the RPC Interface. */
11
- static version: string;
12
- static readonly interfaceName = "ECSchemaRpcInterface";
13
- static interfaceVersion: string;
14
- /**
15
- * Returns the RPC client instance for the frontend.
16
- * @returns A client to communicate with the RPC Interface.
17
- */
18
- static getClient(): ECSchemaRpcInterface;
19
- /**
20
- * Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call
21
- * SchemaKey.fromJson() to parse the props to a SchemaKey.
22
- * @param tokenProps The iModelToken props that hold the information which iModel is used.
23
- * @returns An array of SchemaKeyProps.
24
- */
25
- getSchemaKeys(_tokenProps: IModelRpcProps): Promise<SchemaKeyProps[]>;
26
- /**
27
- * Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which
28
- * the client can call Schema.fromJson() to return a Schema.
29
- * @param tokenProps The iModelToken props that hold the information which iModel is used.
30
- * @param schemaName The name of the schema that shall be returned.
31
- * @returns The SchemaProps.
32
- */
33
- getSchemaJSON(_tokenProps: IModelRpcProps, _schemaName: string): Promise<SchemaProps>;
34
- }
1
+ import { IModelRpcProps, RpcInterface } from "@itwin/core-common";
2
+ import { SchemaKeyProps, SchemaProps } from "@itwin/ecschema-metadata";
3
+ /***
4
+ * Defines an RPC interface to get schema information from a given iModel context.
5
+ * Method @see getSchemaNames will return the names of schemas that live in this iModel.
6
+ * The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.
7
+ * @internal
8
+ */
9
+ export declare abstract class ECSchemaRpcInterface extends RpcInterface {
10
+ /** The version of the RPC Interface. */
11
+ static version: string;
12
+ static readonly interfaceName = "ECSchemaRpcInterface";
13
+ static interfaceVersion: string;
14
+ /**
15
+ * Returns the RPC client instance for the frontend.
16
+ * @returns A client to communicate with the RPC Interface.
17
+ */
18
+ static getClient(): ECSchemaRpcInterface;
19
+ /**
20
+ * Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call
21
+ * SchemaKey.fromJson() to parse the props to a SchemaKey.
22
+ * @param tokenProps The iModelToken props that hold the information which iModel is used.
23
+ * @returns An array of SchemaKeyProps.
24
+ */
25
+ getSchemaKeys(_tokenProps: IModelRpcProps): Promise<SchemaKeyProps[]>;
26
+ /**
27
+ * Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which
28
+ * the client can call Schema.fromJson() to return a Schema.
29
+ * @param tokenProps The iModelToken props that hold the information which iModel is used.
30
+ * @param schemaName The name of the schema that shall be returned.
31
+ * @returns The SchemaProps.
32
+ */
33
+ getSchemaJSON(_tokenProps: IModelRpcProps, _schemaName: string): Promise<SchemaProps>;
34
+ }
35
35
  //# sourceMappingURL=ECSchemaRpcInterface.d.ts.map
@@ -1,57 +1,57 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.ECSchemaRpcInterface = void 0;
10
- /*---------------------------------------------------------------------------------------------
11
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
12
- * See LICENSE.md in the project root for license terms and full copyright notice.
13
- *--------------------------------------------------------------------------------------------*/
14
- const core_common_1 = require("@itwin/core-common");
15
- /***
16
- * Defines an RPC interface to get schema information from a given iModel context.
17
- * Method @see getSchemaNames will return the names of schemas that live in this iModel.
18
- * The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.
19
- * @internal
20
- */
21
- class ECSchemaRpcInterface extends core_common_1.RpcInterface {
22
- /**
23
- * Returns the RPC client instance for the frontend.
24
- * @returns A client to communicate with the RPC Interface.
25
- */
26
- static getClient() {
27
- return core_common_1.RpcManager.getClientForInterface(ECSchemaRpcInterface);
28
- }
29
- /**
30
- * Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call
31
- * SchemaKey.fromJson() to parse the props to a SchemaKey.
32
- * @param tokenProps The iModelToken props that hold the information which iModel is used.
33
- * @returns An array of SchemaKeyProps.
34
- */
35
- async getSchemaKeys(_tokenProps) {
36
- return this.forward.apply(this, [arguments]);
37
- }
38
- /**
39
- * Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which
40
- * the client can call Schema.fromJson() to return a Schema.
41
- * @param tokenProps The iModelToken props that hold the information which iModel is used.
42
- * @param schemaName The name of the schema that shall be returned.
43
- * @returns The SchemaProps.
44
- */
45
- async getSchemaJSON(_tokenProps, _schemaName) {
46
- return this.forward.apply(this, [arguments]);
47
- }
48
- }
49
- /** The version of the RPC Interface. */
50
- ECSchemaRpcInterface.version = "2.0.0";
51
- ECSchemaRpcInterface.interfaceName = "ECSchemaRpcInterface";
52
- ECSchemaRpcInterface.interfaceVersion = ECSchemaRpcInterface.version;
53
- __decorate([
54
- core_common_1.RpcOperation.setPolicy({ allowResponseCompression: true })
55
- ], ECSchemaRpcInterface.prototype, "getSchemaJSON", null);
56
- exports.ECSchemaRpcInterface = ECSchemaRpcInterface;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ECSchemaRpcInterface = void 0;
10
+ /*---------------------------------------------------------------------------------------------
11
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
12
+ * See LICENSE.md in the project root for license terms and full copyright notice.
13
+ *--------------------------------------------------------------------------------------------*/
14
+ const core_common_1 = require("@itwin/core-common");
15
+ /***
16
+ * Defines an RPC interface to get schema information from a given iModel context.
17
+ * Method @see getSchemaNames will return the names of schemas that live in this iModel.
18
+ * The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.
19
+ * @internal
20
+ */
21
+ class ECSchemaRpcInterface extends core_common_1.RpcInterface {
22
+ /**
23
+ * Returns the RPC client instance for the frontend.
24
+ * @returns A client to communicate with the RPC Interface.
25
+ */
26
+ static getClient() {
27
+ return core_common_1.RpcManager.getClientForInterface(ECSchemaRpcInterface);
28
+ }
29
+ /**
30
+ * Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call
31
+ * SchemaKey.fromJson() to parse the props to a SchemaKey.
32
+ * @param tokenProps The iModelToken props that hold the information which iModel is used.
33
+ * @returns An array of SchemaKeyProps.
34
+ */
35
+ async getSchemaKeys(_tokenProps) {
36
+ return this.forward.apply(this, [arguments]);
37
+ }
38
+ /**
39
+ * Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which
40
+ * the client can call Schema.fromJson() to return a Schema.
41
+ * @param tokenProps The iModelToken props that hold the information which iModel is used.
42
+ * @param schemaName The name of the schema that shall be returned.
43
+ * @returns The SchemaProps.
44
+ */
45
+ async getSchemaJSON(_tokenProps, _schemaName) {
46
+ return this.forward.apply(this, [arguments]);
47
+ }
48
+ }
49
+ /** The version of the RPC Interface. */
50
+ ECSchemaRpcInterface.version = "2.0.0";
51
+ ECSchemaRpcInterface.interfaceName = "ECSchemaRpcInterface";
52
+ ECSchemaRpcInterface.interfaceVersion = ECSchemaRpcInterface.version;
53
+ __decorate([
54
+ core_common_1.RpcOperation.setPolicy({ allowResponseCompression: true })
55
+ ], ECSchemaRpcInterface.prototype, "getSchemaJSON", null);
56
+ exports.ECSchemaRpcInterface = ECSchemaRpcInterface;
57
57
  //# sourceMappingURL=ECSchemaRpcInterface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ECSchemaRpcInterface.js","sourceRoot":"","sources":["../../src/ECSchemaRpcInterface.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;+FAG+F;AAC/F,oDAA4F;AAG5F;;;;;GAKG;AACH,MAAsB,oBAAqB,SAAQ,0BAAY;IAO7D;;;OAGG;IACI,MAAM,CAAC,SAAS;QACrB,OAAO,wBAAU,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAC,WAA2B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAA8B,CAAC;IAC5E,CAAC;IAED;;;;;;OAMG;IAEI,KAAK,CAAC,aAAa,CAAC,WAA2B,EAAE,WAAmB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAyB,CAAC;IACvE,CAAC;;AAlCD,wCAAwC;AAC1B,4BAAO,GAAG,OAAO,CAAC;AAET,kCAAa,GAAG,sBAAsB,CAAC;AAChD,qCAAgB,GAAG,oBAAoB,CAAC,OAAO,CAAC;AA4B9D;IADC,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;yDAG1D;AAnCH,oDAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { IModelRpcProps, RpcInterface, RpcManager, RpcOperation } from \"@itwin/core-common\";\r\nimport { SchemaKeyProps, SchemaProps } from \"@itwin/ecschema-metadata\";\r\n\r\n/***\r\n * Defines an RPC interface to get schema information from a given iModel context.\r\n * Method @see getSchemaNames will return the names of schemas that live in this iModel.\r\n * The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.\r\n * @internal\r\n */\r\nexport abstract class ECSchemaRpcInterface extends RpcInterface { // eslint-disable-line deprecation/deprecation\r\n /** The version of the RPC Interface. */\r\n public static version = \"2.0.0\";\r\n\r\n public static readonly interfaceName = \"ECSchemaRpcInterface\";\r\n public static interfaceVersion = ECSchemaRpcInterface.version;\r\n\r\n /**\r\n * Returns the RPC client instance for the frontend.\r\n * @returns A client to communicate with the RPC Interface.\r\n */\r\n public static getClient(): ECSchemaRpcInterface {\r\n return RpcManager.getClientForInterface(ECSchemaRpcInterface);\r\n }\r\n\r\n /**\r\n * Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call\r\n * SchemaKey.fromJson() to parse the props to a SchemaKey.\r\n * @param tokenProps The iModelToken props that hold the information which iModel is used.\r\n * @returns An array of SchemaKeyProps.\r\n */\r\n public async getSchemaKeys(_tokenProps: IModelRpcProps): Promise<SchemaKeyProps[]> {\r\n return this.forward.apply(this, [arguments]) as Promise<SchemaKeyProps[]>;\r\n }\r\n\r\n /**\r\n * Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which\r\n * the client can call Schema.fromJson() to return a Schema.\r\n * @param tokenProps The iModelToken props that hold the information which iModel is used.\r\n * @param schemaName The name of the schema that shall be returned.\r\n * @returns The SchemaProps.\r\n */\r\n @RpcOperation.setPolicy({ allowResponseCompression: true })\r\n public async getSchemaJSON(_tokenProps: IModelRpcProps, _schemaName: string): Promise<SchemaProps> {\r\n return this.forward.apply(this, [arguments]) as Promise<SchemaProps>;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"ECSchemaRpcInterface.js","sourceRoot":"","sources":["../../src/ECSchemaRpcInterface.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;+FAG+F;AAC/F,oDAA4F;AAG5F;;;;;GAKG;AACH,MAAsB,oBAAqB,SAAQ,0BAAY;IAO7D;;;OAGG;IACI,MAAM,CAAC,SAAS;QACrB,OAAO,wBAAU,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAC,WAA2B;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAA8B,CAAC;IAC5E,CAAC;IAED;;;;;;OAMG;IAEU,AAAN,KAAK,CAAC,aAAa,CAAC,WAA2B,EAAE,WAAmB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAyB,CAAC;IACvE,CAAC;;AAlCD,wCAAwC;AAC1B,4BAAO,GAAG,OAAO,CAAC;AAET,kCAAa,GAAG,sBAAsB,CAAC;AAChD,qCAAgB,GAAG,oBAAoB,CAAC,OAAO,CAAC;AA4BjD;IADZ,0BAAY,CAAC,SAAS,CAAC,EAAE,wBAAwB,EAAE,IAAI,EAAE,CAAC;yDAG1D;AAnCmB,oDAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { IModelRpcProps, RpcInterface, RpcManager, RpcOperation } from \"@itwin/core-common\";\r\nimport { SchemaKeyProps, SchemaProps } from \"@itwin/ecschema-metadata\";\r\n\r\n/***\r\n * Defines an RPC interface to get schema information from a given iModel context.\r\n * Method @see getSchemaNames will return the names of schemas that live in this iModel.\r\n * The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.\r\n * @internal\r\n */\r\nexport abstract class ECSchemaRpcInterface extends RpcInterface { // eslint-disable-line deprecation/deprecation\r\n /** The version of the RPC Interface. */\r\n public static version = \"2.0.0\";\r\n\r\n public static readonly interfaceName = \"ECSchemaRpcInterface\";\r\n public static interfaceVersion = ECSchemaRpcInterface.version;\r\n\r\n /**\r\n * Returns the RPC client instance for the frontend.\r\n * @returns A client to communicate with the RPC Interface.\r\n */\r\n public static getClient(): ECSchemaRpcInterface {\r\n return RpcManager.getClientForInterface(ECSchemaRpcInterface);\r\n }\r\n\r\n /**\r\n * Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call\r\n * SchemaKey.fromJson() to parse the props to a SchemaKey.\r\n * @param tokenProps The iModelToken props that hold the information which iModel is used.\r\n * @returns An array of SchemaKeyProps.\r\n */\r\n public async getSchemaKeys(_tokenProps: IModelRpcProps): Promise<SchemaKeyProps[]> {\r\n return this.forward.apply(this, [arguments]) as Promise<SchemaKeyProps[]>;\r\n }\r\n\r\n /**\r\n * Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which\r\n * the client can call Schema.fromJson() to return a Schema.\r\n * @param tokenProps The iModelToken props that hold the information which iModel is used.\r\n * @param schemaName The name of the schema that shall be returned.\r\n * @returns The SchemaProps.\r\n */\r\n @RpcOperation.setPolicy({ allowResponseCompression: true })\r\n public async getSchemaJSON(_tokenProps: IModelRpcProps, _schemaName: string): Promise<SchemaProps> {\r\n return this.forward.apply(this, [arguments]) as Promise<SchemaProps>;\r\n }\r\n\r\n}\r\n"]}
@@ -1,25 +1,25 @@
1
- import { ISchemaLocater, Schema, SchemaContext, SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata";
2
- import { IModelRpcProps } from "@itwin/core-common";
3
- /**
4
- * Defines a schema locater that retrieves schemas using an RPC interface.
5
- * @alpha
6
- */
7
- export declare class ECSchemaRpcLocater implements ISchemaLocater {
8
- readonly token: IModelRpcProps;
9
- constructor(token: IModelRpcProps);
10
- /**
11
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
12
- * @param schemaKey Key to look up
13
- * @param matchType How to match key against candidate schemas
14
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
15
- */
16
- getSchema<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;
17
- /**
18
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
19
- * @param schemaKey Key to look up
20
- * @param matchType How to match key against candidate schemas
21
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
22
- */
23
- getSchemaSync<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): T | undefined;
24
- }
1
+ import { ISchemaLocater, Schema, SchemaContext, SchemaKey, SchemaMatchType } from "@itwin/ecschema-metadata";
2
+ import { IModelRpcProps } from "@itwin/core-common";
3
+ /**
4
+ * Defines a schema locater that retrieves schemas using an RPC interface.
5
+ * @alpha
6
+ */
7
+ export declare class ECSchemaRpcLocater implements ISchemaLocater {
8
+ readonly token: IModelRpcProps;
9
+ constructor(token: IModelRpcProps);
10
+ /**
11
+ * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
12
+ * @param schemaKey Key to look up
13
+ * @param matchType How to match key against candidate schemas
14
+ * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
15
+ */
16
+ getSchema<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;
17
+ /**
18
+ * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
19
+ * @param schemaKey Key to look up
20
+ * @param matchType How to match key against candidate schemas
21
+ * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
22
+ */
23
+ getSchemaSync<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): T | undefined;
24
+ }
25
25
  //# sourceMappingURL=ECSchemaRpcLocater.d.ts.map
@@ -1,48 +1,48 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ECSchemaRpcLocater = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
9
- const ECSchemaRpcInterface_1 = require("./ECSchemaRpcInterface");
10
- /**
11
- * Defines a schema locater that retrieves schemas using an RPC interface.
12
- * @alpha
13
- */
14
- class ECSchemaRpcLocater {
15
- constructor(token) { this.token = token; }
16
- /**
17
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
18
- * @param schemaKey Key to look up
19
- * @param matchType How to match key against candidate schemas
20
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
21
- */
22
- async getSchema(schemaKey, matchType, context) {
23
- const schemaJson = await ECSchemaRpcInterface_1.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);
24
- const schema = await ecschema_metadata_1.Schema.fromJson(schemaJson, context || new ecschema_metadata_1.SchemaContext());
25
- if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
26
- return schema;
27
- }
28
- return undefined;
29
- }
30
- /**
31
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
32
- * @param schemaKey Key to look up
33
- * @param matchType How to match key against candidate schemas
34
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
35
- */
36
- getSchemaSync(schemaKey, matchType, context) {
37
- const schemaJson = ECSchemaRpcInterface_1.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props) => {
38
- return props;
39
- });
40
- const schema = ecschema_metadata_1.Schema.fromJsonSync(schemaJson, context || new ecschema_metadata_1.SchemaContext());
41
- if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
42
- return schema;
43
- }
44
- return undefined;
45
- }
46
- }
47
- exports.ECSchemaRpcLocater = ECSchemaRpcLocater;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ECSchemaRpcLocater = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
9
+ const ECSchemaRpcInterface_1 = require("./ECSchemaRpcInterface");
10
+ /**
11
+ * Defines a schema locater that retrieves schemas using an RPC interface.
12
+ * @alpha
13
+ */
14
+ class ECSchemaRpcLocater {
15
+ constructor(token) { this.token = token; }
16
+ /**
17
+ * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
18
+ * @param schemaKey Key to look up
19
+ * @param matchType How to match key against candidate schemas
20
+ * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
21
+ */
22
+ async getSchema(schemaKey, matchType, context) {
23
+ const schemaJson = await ECSchemaRpcInterface_1.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);
24
+ const schema = await ecschema_metadata_1.Schema.fromJson(schemaJson, context || new ecschema_metadata_1.SchemaContext());
25
+ if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
26
+ return schema;
27
+ }
28
+ return undefined;
29
+ }
30
+ /**
31
+ * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
32
+ * @param schemaKey Key to look up
33
+ * @param matchType How to match key against candidate schemas
34
+ * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
35
+ */
36
+ getSchemaSync(schemaKey, matchType, context) {
37
+ const schemaJson = ECSchemaRpcInterface_1.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props) => {
38
+ return props;
39
+ });
40
+ const schema = ecschema_metadata_1.Schema.fromJsonSync(schemaJson, context || new ecschema_metadata_1.SchemaContext());
41
+ if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
42
+ return schema;
43
+ }
44
+ return undefined;
45
+ }
46
+ }
47
+ exports.ECSchemaRpcLocater = ECSchemaRpcLocater;
48
48
  //# sourceMappingURL=ECSchemaRpcLocater.js.map
@@ -1,3 +1,3 @@
1
- export * from "./ECSchemaRpcInterface";
2
- export * from "./ECSchemaRpcLocater";
1
+ export * from "./ECSchemaRpcInterface";
2
+ export * from "./ECSchemaRpcLocater";
3
3
  //# sourceMappingURL=ecschema-rpc-interface.d.ts.map
@@ -1,19 +1,23 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- /*---------------------------------------------------------------------------------------------
14
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
15
- * See LICENSE.md in the project root for license terms and full copyright notice.
16
- *--------------------------------------------------------------------------------------------*/
17
- __exportStar(require("./ECSchemaRpcInterface"), exports);
18
- __exportStar(require("./ECSchemaRpcLocater"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /*---------------------------------------------------------------------------------------------
18
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
19
+ * See LICENSE.md in the project root for license terms and full copyright notice.
20
+ *--------------------------------------------------------------------------------------------*/
21
+ __exportStar(require("./ECSchemaRpcInterface"), exports);
22
+ __exportStar(require("./ECSchemaRpcLocater"), exports);
19
23
  //# sourceMappingURL=ecschema-rpc-interface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecschema-rpc-interface.js","sourceRoot":"","sources":["../../src/ecschema-rpc-interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,yDAAuC;AACvC,uDAAqC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./ECSchemaRpcInterface\";\r\nexport * from \"./ECSchemaRpcLocater\";\r\n"]}
1
+ {"version":3,"file":"ecschema-rpc-interface.js","sourceRoot":"","sources":["../../src/ecschema-rpc-interface.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,yDAAuC;AACvC,uDAAqC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./ECSchemaRpcInterface\";\r\nexport * from \"./ECSchemaRpcLocater\";\r\n"]}
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-rpcinterface-common",
3
- "version": "4.0.0-dev.10",
3
+ "version": "4.0.0-dev.100",
4
4
  "description": "Schema RPC Interface common interface",
5
5
  "main": "lib/cjs/ecschema-rpc-interface.js",
6
6
  "typings": "lib/cjs/ecschema-rpc-interface",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/iTwin/itwinjs-core/tree/master/core/ecschema-rpc/common"
10
+ "url": "https://github.com/iTwin/itwinjs-core.git",
11
+ "directory": "core/ecschema-rpc/common"
11
12
  },
12
13
  "keywords": [
13
14
  "iModel",
@@ -20,21 +21,21 @@
20
21
  "url": "http://www.bentley.com"
21
22
  },
22
23
  "peerDependencies": {
23
- "@itwin/core-bentley": "4.0.0-dev.10",
24
- "@itwin/core-common": "4.0.0-dev.10",
25
- "@itwin/core-geometry": "4.0.0-dev.10",
26
- "@itwin/ecschema-metadata": "4.0.0-dev.10"
24
+ "@itwin/core-bentley": "4.0.0-dev.100",
25
+ "@itwin/core-common": "4.0.0-dev.100",
26
+ "@itwin/core-geometry": "4.0.0-dev.100",
27
+ "@itwin/ecschema-metadata": "4.0.0-dev.100"
27
28
  },
28
29
  "devDependencies": {
29
- "@itwin/build-tools": "4.0.0-dev.10",
30
- "@itwin/core-bentley": "4.0.0-dev.10",
31
- "@itwin/core-common": "4.0.0-dev.10",
32
- "@itwin/core-geometry": "4.0.0-dev.10",
33
- "@itwin/ecschema-metadata": "4.0.0-dev.10",
34
- "@itwin/eslint-plugin": "4.0.0-dev.10",
35
- "eslint": "^7.11.0",
30
+ "@itwin/eslint-plugin": "^4.0.0-dev.33",
31
+ "eslint": "^8.36.0",
36
32
  "rimraf": "^3.0.2",
37
- "typescript": "~4.4.0"
33
+ "typescript": "~5.0.2",
34
+ "@itwin/build-tools": "4.0.0-dev.100",
35
+ "@itwin/core-bentley": "4.0.0-dev.100",
36
+ "@itwin/ecschema-metadata": "4.0.0-dev.100",
37
+ "@itwin/core-common": "4.0.0-dev.100",
38
+ "@itwin/core-geometry": "4.0.0-dev.100"
38
39
  },
39
40
  "eslintConfig": {
40
41
  "plugins": [
@@ -44,7 +45,6 @@
44
45
  },
45
46
  "scripts": {
46
47
  "build": "npm run -s build:cjs",
47
- "build:ci": "npm run -s build",
48
48
  "build:cjs": "tsc 1>&2 --outDir lib/cjs",
49
49
  "clean": "rimraf lib .rush/temp/package-deps*.json",
50
50
  "cover": "",
@@ -52,6 +52,5 @@
52
52
  "extract-api": "betools extract-api --entry=ecschema-rpc-interface",
53
53
  "lint": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
54
54
  "test": ""
55
- },
56
- "readme": "# iTwin.js Schema RPC Interface\r\n\r\nCopyright © Bentley Systems, Incorporated. All rights reserved.\r\n\r\nThis package contains the Schema RPC Interface that can be used to connect to a backend with the Schema RPC Interface Impl, available in the @itwin/ecschema-rpcinterface-impl package.\r\n"
55
+ }
57
56
  }