@itwin/ecschema-rpcinterface-common 5.0.0-dev.99 → 5.0.1

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,61 @@
1
1
  # Change Log - @itwin/ecschema-rpcinterface-common
2
2
 
3
- This log was last generated on Wed, 02 Apr 2025 19:38:36 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 17 Jun 2025 18:33:52 GMT and should not be manually modified.
4
+
5
+ ## 5.0.1
6
+ Tue, 17 Jun 2025 18:33:52 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 5.0.0
11
+ Fri, 13 Jun 2025 20:25:38 GMT
12
+
13
+ ### Updates
14
+
15
+ - Deprecated `getSchemaSync` method from ECSchemaRpcLocater.
16
+ - Add ESM build
17
+ - Upgrade compile target to ES2023 and module to ES2022
18
+ - applied changes in ecschema-metadatas SchemaLocater interface
19
+
20
+ ## 4.11.6
21
+ Mon, 16 Jun 2025 15:00:15 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 4.11.5
26
+ Fri, 06 Jun 2025 13:41:18 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 4.11.4
31
+ Tue, 03 Jun 2025 16:15:19 GMT
32
+
33
+ _Version update only_
34
+
35
+ ## 4.11.3
36
+ Wed, 28 May 2025 13:56:23 GMT
37
+
38
+ _Version update only_
39
+
40
+ ## 4.11.2
41
+ Tue, 20 May 2025 20:14:46 GMT
42
+
43
+ _Version update only_
44
+
45
+ ## 4.11.1
46
+ Wed, 30 Apr 2025 13:13:21 GMT
47
+
48
+ _Version update only_
49
+
50
+ ## 4.11.0
51
+ Wed, 16 Apr 2025 15:50:28 GMT
52
+
53
+ _Version update only_
54
+
55
+ ## 4.10.13
56
+ Thu, 10 Apr 2025 17:47:21 GMT
57
+
58
+ _Version update only_
4
59
 
5
60
  ## 4.10.12
6
61
  Wed, 02 Apr 2025 19:35:47 GMT
@@ -2,9 +2,10 @@ import { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMat
2
2
  import { IModelRpcProps } from "@itwin/core-common";
3
3
  /**
4
4
  * Defines a schema locater that retrieves schemas using an RPC interface.
5
- * @beta
5
+ * @public @preview
6
6
  */
7
7
  export declare class ECSchemaRpcLocater implements ISchemaLocater {
8
+ /** @internal */
8
9
  readonly token: IModelRpcProps;
9
10
  constructor(token: IModelRpcProps);
10
11
  /**
@@ -22,11 +23,14 @@ export declare class ECSchemaRpcLocater implements ISchemaLocater {
22
23
  */
23
24
  getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
24
25
  /**
25
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
26
- * @param schemaKey Key to look up
27
- * @param matchType How to match key against candidate schemas
28
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
26
+ * This method is not supported for locating schemas over RPC/HTTP.
27
+ * Use the asynchronous `getSchema` method instead.
28
+ * @param _schemaKey Key to look up
29
+ * @param _matchType How to match key against candidate schemas
30
+ * @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
31
+ * @throws Error Always throws an error indicating this method is not supported.
32
+ * @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.
29
33
  */
30
- getSchemaSync(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Schema | undefined;
34
+ getSchemaSync(_schemaKey: SchemaKey, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined;
31
35
  }
32
36
  //# sourceMappingURL=ECSchemaRpcLocater.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ECSchemaRpcLocater.d.ts","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAe,MAAM,0BAA0B,C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AU,GAAG,SAAS,CAAC;IASrI;;;;;;;;MAQE;IACK,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS;CAGtH"}
@@ -9,9 +9,10 @@ const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
9
9
  const ECSchemaRpcInterface_1 = require("./ECSchemaRpcInterface");
10
10
  /**
11
11
  * Defines a schema locater that retrieves schemas using an RPC interface.
12
- * @beta
12
+ * @public @preview
13
13
  */
14
14
  class ECSchemaRpcLocater {
15
+ /** @internal */
15
16
  token;
16
17
  constructor(token) { this.token = token; }
17
18
  /**
@@ -40,20 +41,16 @@ class ECSchemaRpcLocater {
40
41
  return undefined;
41
42
  }
42
43
  /**
43
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
44
- * @param schemaKey Key to look up
45
- * @param matchType How to match key against candidate schemas
46
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
44
+ * This method is not supported for locating schemas over RPC/HTTP.
45
+ * Use the asynchronous `getSchema` method instead.
46
+ * @param _schemaKey Key to look up
47
+ * @param _matchType How to match key against candidate schemas
48
+ * @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
49
+ * @throws Error Always throws an error indicating this method is not supported.
50
+ * @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.
47
51
  */
48
- getSchemaSync(schemaKey, matchType, context) {
49
- const schemaJson = ECSchemaRpcInterface_1.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props) => {
50
- return props;
51
- });
52
- const schema = ecschema_metadata_1.Schema.fromJsonSync(schemaJson, context || new ecschema_metadata_1.SchemaContext());
53
- if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
54
- return schema;
55
- }
56
- return undefined;
52
+ getSchemaSync(_schemaKey, _matchType, _context) {
53
+ throw new Error("getSchemaSync is not supported. Use the asynchronous getSchema method instead.");
57
54
  }
58
55
  }
59
56
  exports.ECSchemaRpcLocater = ECSchemaRpcLocater;
@@ -1 +1 @@
1
- {"version":3,"file":"ECSchemaRpcLocater.js","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsI;AAEtI,iEAA8D;AAE9D;;;GAGG;AACH,MAAa,kBAAkB;IACb,KAAK,CAAiB;IAEtC,YAAY,KAAqB,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IAE1D;;;;;MAKE;IACK,KAAK,CAAC,SAAS,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC7F,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QACjG,MAAM,UAAU,GAAG,MAAM,2CAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACpG,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI,iCAAa,EAAE,CAAC,CAAC;QACjG,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;YACnF,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;MAKE;IACK,aAAa,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC3F,MAAM,UAAU,GAAG,2CAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAkB,EAAE,EAAE;YACxH,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,0BAAM,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI,iCAAa,EAAE,CAAC,CAAC;QAC/E,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;YAC3E,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjDD,gDAiDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType, SchemaProps } from \"@itwin/ecschema-metadata\";\nimport { IModelRpcProps } from \"@itwin/core-common\";\nimport { ECSchemaRpcInterface } from \"./ECSchemaRpcInterface\";\n\n/**\n * Defines a schema locater that retrieves schemas using an RPC interface.\n * @beta\n */\nexport class ECSchemaRpcLocater implements ISchemaLocater {\n public readonly token: IModelRpcProps;\n\n constructor(token: IModelRpcProps) { this.token = token; }\n\n /**\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\n * @param schemaKey Key to look up\n * @param matchType How to match key against candidate schemas\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n */\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\n await this.getSchemaInfo(schemaKey, matchType, context);\n\n const schema = await context.getCachedSchema(schemaKey, matchType);\n return schema;\n }\n\n /**\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\n * The fully loaded schema can be accessed via the schema context using the getCachedSchema method.\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\n * @param matchType The match type to use when locating the schema\n */\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n const schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n const schemaInfo = await Schema.startLoadingFromJson(schemaJson, context || new SchemaContext());\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {\n return schemaInfo;\n }\n return undefined;\n }\n\n /**\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\n * @param schemaKey Key to look up\n * @param matchType How to match key against candidate schemas\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n */\n public getSchemaSync(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Schema | undefined {\n const schemaJson = ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props: SchemaProps) => {\n return props;\n });\n const schema = Schema.fromJsonSync(schemaJson, context || new SchemaContext());\n if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {\n return schema;\n }\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"ECSchemaRpcLocater.js","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAyH;AAEzH,iEAA8D;AAE9D;;;GAGG;AACH,MAAa,kBAAkB;IAC7B,gBAAgB;IACA,KAAK,CAAiB;IAEtC,YAAY,KAAqB,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IAE1D;;;;;MAKE;IACK,KAAK,CAAC,SAAS,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC7F,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QACjG,MAAM,UAAU,GAAG,MAAM,2CAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACpG,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI,iCAAa,EAAE,CAAC,CAAC;QACjG,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;YACnF,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;MAQE;IACK,aAAa,CAAC,UAAqB,EAAE,UAA2B,EAAE,QAAuB;QAC9F,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;IACpG,CAAC;CACF;AA9CD,gDA8CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { IModelRpcProps } from \"@itwin/core-common\";\nimport { ECSchemaRpcInterface } from \"./ECSchemaRpcInterface\";\n\n/**\n * Defines a schema locater that retrieves schemas using an RPC interface.\n * @public @preview\n */\nexport class ECSchemaRpcLocater implements ISchemaLocater {\n /** @internal */\n public readonly token: IModelRpcProps;\n\n constructor(token: IModelRpcProps) { this.token = token; }\n\n /**\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\n * @param schemaKey Key to look up\n * @param matchType How to match key against candidate schemas\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n */\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\n await this.getSchemaInfo(schemaKey, matchType, context);\n\n const schema = await context.getCachedSchema(schemaKey, matchType);\n return schema;\n }\n\n /**\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\n * The fully loaded schema can be accessed via the schema context using the getCachedSchema method.\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\n * @param matchType The match type to use when locating the schema\n */\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n const schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n const schemaInfo = await Schema.startLoadingFromJson(schemaJson, context || new SchemaContext());\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {\n return schemaInfo;\n }\n return undefined;\n }\n\n /**\n * This method is not supported for locating schemas over RPC/HTTP.\n * Use the asynchronous `getSchema` method instead.\n * @param _schemaKey Key to look up\n * @param _matchType How to match key against candidate schemas\n * @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n * @throws Error Always throws an error indicating this method is not supported.\n * @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.\n */\n public getSchemaSync(_schemaKey: SchemaKey, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined {\n throw new Error(\"getSchemaSync is not supported. Use the asynchronous getSchema method instead.\");\n }\n}\n"]}
@@ -2,9 +2,10 @@ import { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMat
2
2
  import { IModelRpcProps } from "@itwin/core-common";
3
3
  /**
4
4
  * Defines a schema locater that retrieves schemas using an RPC interface.
5
- * @beta
5
+ * @public @preview
6
6
  */
7
7
  export declare class ECSchemaRpcLocater implements ISchemaLocater {
8
+ /** @internal */
8
9
  readonly token: IModelRpcProps;
9
10
  constructor(token: IModelRpcProps);
10
11
  /**
@@ -22,11 +23,14 @@ export declare class ECSchemaRpcLocater implements ISchemaLocater {
22
23
  */
23
24
  getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
24
25
  /**
25
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
26
- * @param schemaKey Key to look up
27
- * @param matchType How to match key against candidate schemas
28
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
26
+ * This method is not supported for locating schemas over RPC/HTTP.
27
+ * Use the asynchronous `getSchema` method instead.
28
+ * @param _schemaKey Key to look up
29
+ * @param _matchType How to match key against candidate schemas
30
+ * @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
31
+ * @throws Error Always throws an error indicating this method is not supported.
32
+ * @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.
29
33
  */
30
- getSchemaSync(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Schema | undefined;
34
+ getSchemaSync(_schemaKey: SchemaKey, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined;
31
35
  }
32
36
  //# sourceMappingURL=ECSchemaRpcLocater.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ECSchemaRpcLocater.d.ts","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AACtI,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,SAAgB,KAAK,EAAE,cAAc,CAAC;gBAE1B,KAAK,EAAE,cAAc;IAE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6,10 @@ import { Schema, SchemaContext } from "@itwin/ecschema-metadata";
6
6
  import { ECSchemaRpcInterface } from "./ECSchemaRpcInterface";
7
7
  /**
8
8
  * Defines a schema locater that retrieves schemas using an RPC interface.
9
- * @beta
9
+ * @public @preview
10
10
  */
11
11
  export class ECSchemaRpcLocater {
12
+ /** @internal */
12
13
  token;
13
14
  constructor(token) { this.token = token; }
14
15
  /**
@@ -37,20 +38,16 @@ export class ECSchemaRpcLocater {
37
38
  return undefined;
38
39
  }
39
40
  /**
40
- * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
41
- * @param schemaKey Key to look up
42
- * @param matchType How to match key against candidate schemas
43
- * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
41
+ * This method is not supported for locating schemas over RPC/HTTP.
42
+ * Use the asynchronous `getSchema` method instead.
43
+ * @param _schemaKey Key to look up
44
+ * @param _matchType How to match key against candidate schemas
45
+ * @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
46
+ * @throws Error Always throws an error indicating this method is not supported.
47
+ * @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.
44
48
  */
45
- getSchemaSync(schemaKey, matchType, context) {
46
- const schemaJson = ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props) => {
47
- return props;
48
- });
49
- const schema = Schema.fromJsonSync(schemaJson, context || new SchemaContext());
50
- if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
51
- return schema;
52
- }
53
- return undefined;
49
+ getSchemaSync(_schemaKey, _matchType, _context) {
50
+ throw new Error("getSchemaSync is not supported. Use the asynchronous getSchema method instead.");
54
51
  }
55
52
  }
56
53
  //# sourceMappingURL=ECSchemaRpcLocater.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ECSchemaRpcLocater.js","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAkB,MAAM,EAAE,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OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI,aAAa,EAAE,CAAC,CAAC;QAC/E,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;YAC3E,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType, SchemaProps } from \"@itwin/ecschema-metadata\";\nimport { IModelRpcProps } from \"@itwin/core-common\";\nimport { ECSchemaRpcInterface } from \"./ECSchemaRpcInterface\";\n\n/**\n * Defines a schema locater that retrieves schemas using an RPC interface.\n * @beta\n */\nexport class ECSchemaRpcLocater implements ISchemaLocater {\n public readonly token: IModelRpcProps;\n\n constructor(token: IModelRpcProps) { this.token = token; }\n\n /**\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\n * @param schemaKey Key to look up\n * @param matchType How to match key against candidate schemas\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n */\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\n await this.getSchemaInfo(schemaKey, matchType, context);\n\n const schema = await context.getCachedSchema(schemaKey, matchType);\n return schema;\n }\n\n /**\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\n * The fully loaded schema can be accessed via the schema context using the getCachedSchema method.\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\n * @param matchType The match type to use when locating the schema\n */\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n const schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n const schemaInfo = await Schema.startLoadingFromJson(schemaJson, context || new SchemaContext());\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {\n return schemaInfo;\n }\n return undefined;\n }\n\n /**\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\n * @param schemaKey Key to look up\n * @param matchType How to match key against candidate schemas\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n */\n public getSchemaSync(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Schema | undefined {\n const schemaJson = ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props: SchemaProps) => {\n return props;\n });\n const schema = Schema.fromJsonSync(schemaJson, context || new SchemaContext());\n if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {\n return schema;\n }\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"ECSchemaRpcLocater.js","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAkB,MAAM,EAAE,aAAa,EAA0C,MAAM,0BAA0B,CAAC;AAEzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAC7B,gBAAgB;IACA,KAAK,CAAiB;IAEtC,YAAY,KAAqB,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IAE1D;;;;;MAKE;IACK,KAAK,CAAC,SAAS,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC7F,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QACjG,MAAM,UAAU,GAAG,MAAM,oBAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACpG,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI,aAAa,EAAE,CAAC,CAAC;QACjG,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;YACnF,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;MAQE;IACK,aAAa,CAAC,UAAqB,EAAE,UAA2B,EAAE,QAAuB;QAC9F,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;IACpG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { IModelRpcProps } from \"@itwin/core-common\";\nimport { ECSchemaRpcInterface } from \"./ECSchemaRpcInterface\";\n\n/**\n * Defines a schema locater that retrieves schemas using an RPC interface.\n * @public @preview\n */\nexport class ECSchemaRpcLocater implements ISchemaLocater {\n /** @internal */\n public readonly token: IModelRpcProps;\n\n constructor(token: IModelRpcProps) { this.token = token; }\n\n /**\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\n * @param schemaKey Key to look up\n * @param matchType How to match key against candidate schemas\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n */\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\n await this.getSchemaInfo(schemaKey, matchType, context);\n\n const schema = await context.getCachedSchema(schemaKey, matchType);\n return schema;\n }\n\n /**\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\n * The fully loaded schema can be accessed via the schema context using the getCachedSchema method.\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\n * @param matchType The match type to use when locating the schema\n */\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n const schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n const schemaInfo = await Schema.startLoadingFromJson(schemaJson, context || new SchemaContext());\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {\n return schemaInfo;\n }\n return undefined;\n }\n\n /**\n * This method is not supported for locating schemas over RPC/HTTP.\n * Use the asynchronous `getSchema` method instead.\n * @param _schemaKey Key to look up\n * @param _matchType How to match key against candidate schemas\n * @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\n * @throws Error Always throws an error indicating this method is not supported.\n * @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.\n */\n public getSchemaSync(_schemaKey: SchemaKey, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined {\n throw new Error(\"getSchemaSync is not supported. Use the asynchronous getSchema method instead.\");\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-rpcinterface-common",
3
- "version": "5.0.0-dev.99",
3
+ "version": "5.0.1",
4
4
  "description": "Schema RPC Interface common interface",
5
5
  "main": "lib/cjs/ecschema-rpc-interface.js",
6
6
  "module": "lib/esm/ecschema-rpc-interface.js",
@@ -22,21 +22,21 @@
22
22
  "url": "http://www.bentley.com"
23
23
  },
24
24
  "peerDependencies": {
25
- "@itwin/core-bentley": "5.0.0-dev.99",
26
- "@itwin/core-common": "5.0.0-dev.99",
27
- "@itwin/core-geometry": "5.0.0-dev.99",
28
- "@itwin/ecschema-metadata": "5.0.0-dev.99"
25
+ "@itwin/core-bentley": "5.0.1",
26
+ "@itwin/core-common": "5.0.1",
27
+ "@itwin/ecschema-metadata": "5.0.1",
28
+ "@itwin/core-geometry": "5.0.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@itwin/eslint-plugin": "5.0.0-dev.1",
32
32
  "eslint": "^9.13.0",
33
33
  "rimraf": "^6.0.1",
34
34
  "typescript": "~5.6.2",
35
- "@itwin/build-tools": "5.0.0-dev.99",
36
- "@itwin/ecschema-metadata": "5.0.0-dev.99",
37
- "@itwin/core-bentley": "5.0.0-dev.99",
38
- "@itwin/core-common": "5.0.0-dev.99",
39
- "@itwin/core-geometry": "5.0.0-dev.99"
35
+ "@itwin/build-tools": "5.0.1",
36
+ "@itwin/core-common": "5.0.1",
37
+ "@itwin/core-geometry": "5.0.1",
38
+ "@itwin/core-bentley": "5.0.1",
39
+ "@itwin/ecschema-metadata": "5.0.1"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "npm run -s build:cjs && npm run -s build:esm",