@itwin/ecschema-rpcinterface-common 5.2.0-dev.3 → 5.2.0-dev.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.
- package/CHANGELOG.md +14 -1
- package/lib/cjs/ECSchemaRpcLocater.d.ts +1 -1
- package/lib/cjs/ECSchemaRpcLocater.js +1 -1
- package/lib/cjs/ECSchemaRpcLocater.js.map +1 -1
- package/lib/esm/ECSchemaRpcLocater.d.ts +1 -1
- package/lib/esm/ECSchemaRpcLocater.js +1 -1
- package/lib/esm/ECSchemaRpcLocater.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Change Log - @itwin/ecschema-rpcinterface-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 08 Aug 2025 18:10:14 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.1.1
|
|
6
|
+
Fri, 08 Aug 2025 18:06:10 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 5.1.0
|
|
11
|
+
Fri, 08 Aug 2025 12:51:53 GMT
|
|
12
|
+
|
|
13
|
+
### Updates
|
|
14
|
+
|
|
15
|
+
- Deprecated `getSchemaSync` method from ECSchemaRpcLocater.
|
|
16
|
+
- Added RpcIncrementalSchemaLocater which is an ISchemaLocater implementation that provides asynchronous incremental loading of EC Schemas from iModels using ECSql queries.
|
|
4
17
|
|
|
5
18
|
## 5.0.5
|
|
6
19
|
Wed, 06 Aug 2025 15:34:15 GMT
|
|
@@ -29,7 +29,7 @@ export declare class ECSchemaRpcLocater implements ISchemaLocater {
|
|
|
29
29
|
* @param _matchType How to match key against candidate schemas
|
|
30
30
|
* @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
31
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.
|
|
32
|
+
* @deprecated in 5.0 - will not be removed until after 2026-08-08. Use the asynchronous `getSchema` method for schema retrieval.
|
|
33
33
|
*/
|
|
34
34
|
getSchemaSync(_schemaKey: SchemaKey, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined;
|
|
35
35
|
}
|
|
@@ -55,7 +55,7 @@ class ECSchemaRpcLocater {
|
|
|
55
55
|
* @param _matchType How to match key against candidate schemas
|
|
56
56
|
* @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
57
57
|
* @throws Error Always throws an error indicating this method is not supported.
|
|
58
|
-
* @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.
|
|
58
|
+
* @deprecated in 5.0 - will not be removed until after 2026-08-08. Use the asynchronous `getSchema` method for schema retrieval.
|
|
59
59
|
*/
|
|
60
60
|
getSchemaSync(_schemaKey, _matchType, _context) {
|
|
61
61
|
throw new Error("getSchemaSync is not supported. Use the asynchronous getSchema method instead.");
|
|
@@ -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;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,IAAI,UAAuB,CAAC;QAC5B,IAAI,CAAC;YACH,UAAU,GAAG,MAAM,2CAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAChG,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK,kBAAkB;gBAC/C,OAAO,SAAS,CAAC;YAEnB,MAAK,CAAC,CAAC,CAAC,CAAC;QACX,CAAC;QACD,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;AAtDD,gDAsDC","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 * @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 let schemaJson: SchemaProps;\n try {\n schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n } catch(e: any) {\n if (e.message && e.message === \"schema not found\")\n return undefined;\n\n throw(e);\n }\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"]}
|
|
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;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,IAAI,UAAuB,CAAC;QAC5B,IAAI,CAAC;YACH,UAAU,GAAG,MAAM,2CAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAChG,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK,kBAAkB;gBAC/C,OAAO,SAAS,CAAC;YAEnB,MAAK,CAAC,CAAC,CAAC,CAAC;QACX,CAAC;QACD,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;AAtDD,gDAsDC","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 * @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 let schemaJson: SchemaProps;\n try {\n schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n } catch(e: any) {\n if (e.message && e.message === \"schema not found\")\n return undefined;\n\n throw(e);\n }\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 - will not be removed until after 2026-08-08. 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"]}
|
|
@@ -29,7 +29,7 @@ export declare class ECSchemaRpcLocater implements ISchemaLocater {
|
|
|
29
29
|
* @param _matchType How to match key against candidate schemas
|
|
30
30
|
* @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
31
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.
|
|
32
|
+
* @deprecated in 5.0 - will not be removed until after 2026-08-08. Use the asynchronous `getSchema` method for schema retrieval.
|
|
33
33
|
*/
|
|
34
34
|
getSchemaSync(_schemaKey: SchemaKey, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined;
|
|
35
35
|
}
|
|
@@ -52,7 +52,7 @@ export class ECSchemaRpcLocater {
|
|
|
52
52
|
* @param _matchType How to match key against candidate schemas
|
|
53
53
|
* @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
54
54
|
* @throws Error Always throws an error indicating this method is not supported.
|
|
55
|
-
* @deprecated in 5.0. Use the asynchronous `getSchema` method for schema retrieval.
|
|
55
|
+
* @deprecated in 5.0 - will not be removed until after 2026-08-08. Use the asynchronous `getSchema` method for schema retrieval.
|
|
56
56
|
*/
|
|
57
57
|
getSchemaSync(_schemaKey, _matchType, _context) {
|
|
58
58
|
throw new Error("getSchemaSync is not supported. Use the asynchronous getSchema method instead.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSchemaRpcLocater.js","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAkB,MAAM,EAAE,aAAa,EAAuD,MAAM,0BAA0B,CAAC;AAEtI,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,IAAI,UAAuB,CAAC;QAC5B,IAAI,CAAC;YACH,UAAU,GAAG,MAAM,oBAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAChG,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK,kBAAkB;gBAC/C,OAAO,SAAS,CAAC;YAEnB,MAAK,CAAC,CAAC,CAAC,CAAC;QACX,CAAC;QACD,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, 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 * @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 let schemaJson: SchemaProps;\n try {\n schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n } catch(e: any) {\n if (e.message && e.message === \"schema not found\")\n return undefined;\n\n throw(e);\n }\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"]}
|
|
1
|
+
{"version":3,"file":"ECSchemaRpcLocater.js","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAkB,MAAM,EAAE,aAAa,EAAuD,MAAM,0BAA0B,CAAC;AAEtI,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,IAAI,UAAuB,CAAC;QAC5B,IAAI,CAAC;YACH,UAAU,GAAG,MAAM,oBAAoB,CAAC,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAChG,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK,kBAAkB;gBAC/C,OAAO,SAAS,CAAC;YAEnB,MAAK,CAAC,CAAC,CAAC,CAAC;QACX,CAAC;QACD,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, 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 * @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 let schemaJson: SchemaProps;\n try {\n schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\n } catch(e: any) {\n if (e.message && e.message === \"schema not found\")\n return undefined;\n\n throw(e);\n }\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 - will not be removed until after 2026-08-08. 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.2.0-dev.
|
|
3
|
+
"version": "5.2.0-dev.7",
|
|
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,10 +22,10 @@
|
|
|
22
22
|
"url": "http://www.bentley.com"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@itwin/core-bentley": "5.2.0-dev.
|
|
26
|
-
"@itwin/core-common": "5.2.0-dev.
|
|
27
|
-
"@itwin/core-geometry": "5.2.0-dev.
|
|
28
|
-
"@itwin/ecschema-metadata": "5.2.0-dev.
|
|
25
|
+
"@itwin/core-bentley": "5.2.0-dev.7",
|
|
26
|
+
"@itwin/core-common": "5.2.0-dev.7",
|
|
27
|
+
"@itwin/core-geometry": "5.2.0-dev.7",
|
|
28
|
+
"@itwin/ecschema-metadata": "5.2.0-dev.7"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@itwin/eslint-plugin": "5.2.2-dev.2",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"sinon": "^17.0.2",
|
|
39
39
|
"rimraf": "^6.0.1",
|
|
40
40
|
"typescript": "~5.6.2",
|
|
41
|
-
"@itwin/build-tools": "5.2.0-dev.
|
|
42
|
-
"@itwin/core-common": "5.2.0-dev.
|
|
43
|
-
"@itwin/core-bentley": "5.2.0-dev.
|
|
44
|
-
"@itwin/ecschema-metadata": "5.2.0-dev.
|
|
45
|
-
"@itwin/core-geometry": "5.2.0-dev.
|
|
41
|
+
"@itwin/build-tools": "5.2.0-dev.7",
|
|
42
|
+
"@itwin/core-common": "5.2.0-dev.7",
|
|
43
|
+
"@itwin/core-bentley": "5.2.0-dev.7",
|
|
44
|
+
"@itwin/ecschema-metadata": "5.2.0-dev.7",
|
|
45
|
+
"@itwin/core-geometry": "5.2.0-dev.7"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "npm run -s build:cjs && npm run -s build:esm",
|