@itwin/ecschema-rpcinterface-common 4.8.0-dev.2 → 4.8.0-dev.20

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,26 @@
1
1
  # Change Log - @itwin/ecschema-rpcinterface-common
2
2
 
3
- This log was last generated on Sat, 08 Jun 2024 00:53:21 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 28 Jun 2024 17:05:11 GMT and should not be manually modified.
4
+
5
+ ## 4.7.3
6
+ Thu, 27 Jun 2024 21:09:02 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.7.2
11
+ Sat, 22 Jun 2024 01:09:54 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.7.1
16
+ Thu, 13 Jun 2024 22:47:32 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 4.7.0
21
+ Wed, 12 Jun 2024 18:02:16 GMT
22
+
23
+ _Version update only_
4
24
 
5
25
  ## 4.6.2
6
26
  Sat, 08 Jun 2024 00:50:25 GMT
@@ -2,7 +2,7 @@ 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
- * @alpha
5
+ * @beta
6
6
  */
7
7
  export declare class ECSchemaRpcLocater implements ISchemaLocater {
8
8
  readonly token: IModelRpcProps;
@@ -9,7 +9,7 @@ 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
- * @alpha
12
+ * @beta
13
13
  */
14
14
  class ECSchemaRpcLocater {
15
15
  constructor(token) { this.token = token; }
@@ -1 +1 @@
1
- {"version":3,"file":"ECSchemaRpcLocater.js","sourceRoot":"","sources":["../../src/ECSchemaRpcLocater.ts"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H,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,MAAW,CAAC;QACrB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjDD,gDAiDC","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 { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType, SchemaProps } from \"@itwin/ecschema-metadata\";\r\nimport { IModelRpcProps } from \"@itwin/core-common\";\r\nimport { ECSchemaRpcInterface } from \"./ECSchemaRpcInterface\";\r\n\r\n/**\r\n * Defines a schema locater that retrieves schemas using an RPC interface.\r\n * @alpha\r\n */\r\nexport class ECSchemaRpcLocater implements ISchemaLocater {\r\n public readonly token: IModelRpcProps;\r\n\r\n constructor(token: IModelRpcProps) { this.token = token; }\r\n\r\n /**\r\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\r\n * @param schemaKey Key to look up\r\n * @param matchType How to match key against candidate schemas\r\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\r\n */\r\n public async getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined> {\r\n await this.getSchemaInfo(schemaKey, matchType, context);\r\n\r\n const schema = await context.getCachedSchema(schemaKey, matchType);\r\n return schema as T;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * The fully loaded schema can be accessed via the schema context using the getCachedSchema method.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\r\n const schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\r\n const schemaInfo = await Schema.startLoadingFromJson(schemaJson, context || new SchemaContext());\r\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {\r\n return schemaInfo;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\r\n * @param schemaKey Key to look up\r\n * @param matchType How to match key against candidate schemas\r\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\r\n */\r\n public getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): T | undefined {\r\n const schemaJson = ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props: SchemaProps) => {\r\n return props;\r\n });\r\n const schema = Schema.fromJsonSync(schemaJson, context || new SchemaContext());\r\n if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {\r\n return schema as T;\r\n }\r\n return undefined;\r\n }\r\n}\r\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;IAG7B,YAAY,KAAqB,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IAE1D;;;;;MAKE;IACK,KAAK,CAAC,SAAS,CAAmB,SAA8B,EAAE,SAA0B,EAAE,OAAsB;QACzH,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,MAAW,CAAC;IACrB,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,aAAa,CAAC,SAA8B,EAAE,SAA0B,EAAE,OAAsB;QAC3G,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,CAAmB,SAA8B,EAAE,SAA0B,EAAE,OAAsB;QACvH,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,MAAW,CAAC;QACrB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjDD,gDAiDC","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 { ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType, SchemaProps } from \"@itwin/ecschema-metadata\";\r\nimport { IModelRpcProps } from \"@itwin/core-common\";\r\nimport { ECSchemaRpcInterface } from \"./ECSchemaRpcInterface\";\r\n\r\n/**\r\n * Defines a schema locater that retrieves schemas using an RPC interface.\r\n * @beta\r\n */\r\nexport class ECSchemaRpcLocater implements ISchemaLocater {\r\n public readonly token: IModelRpcProps;\r\n\r\n constructor(token: IModelRpcProps) { this.token = token; }\r\n\r\n /**\r\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\r\n * @param schemaKey Key to look up\r\n * @param matchType How to match key against candidate schemas\r\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\r\n */\r\n public async getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined> {\r\n await this.getSchemaInfo(schemaKey, matchType, context);\r\n\r\n const schema = await context.getCachedSchema(schemaKey, matchType);\r\n return schema as T;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * The fully loaded schema can be accessed via the schema context using the getCachedSchema method.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\r\n const schemaJson = await ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);\r\n const schemaInfo = await Schema.startLoadingFromJson(schemaJson, context || new SchemaContext());\r\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {\r\n return schemaInfo;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.\r\n * @param schemaKey Key to look up\r\n * @param matchType How to match key against candidate schemas\r\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\r\n */\r\n public getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): T | undefined {\r\n const schemaJson = ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props: SchemaProps) => {\r\n return props;\r\n });\r\n const schema = Schema.fromJsonSync(schemaJson, context || new SchemaContext());\r\n if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {\r\n return schema as T;\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-rpcinterface-common",
3
- "version": "4.8.0-dev.2",
3
+ "version": "4.8.0-dev.20",
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",
@@ -21,21 +21,21 @@
21
21
  "url": "http://www.bentley.com"
22
22
  },
23
23
  "peerDependencies": {
24
- "@itwin/core-bentley": "4.8.0-dev.2",
25
- "@itwin/core-common": "4.8.0-dev.2",
26
- "@itwin/core-geometry": "4.8.0-dev.2",
27
- "@itwin/ecschema-metadata": "4.8.0-dev.2"
24
+ "@itwin/core-bentley": "4.8.0-dev.20",
25
+ "@itwin/core-common": "4.8.0-dev.20",
26
+ "@itwin/core-geometry": "4.8.0-dev.20",
27
+ "@itwin/ecschema-metadata": "4.8.0-dev.20"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@itwin/eslint-plugin": "^4.0.2",
31
31
  "eslint": "^8.56.0",
32
32
  "rimraf": "^3.0.2",
33
33
  "typescript": "~5.3.3",
34
- "@itwin/build-tools": "4.8.0-dev.2",
35
- "@itwin/core-bentley": "4.8.0-dev.2",
36
- "@itwin/core-common": "4.8.0-dev.2",
37
- "@itwin/core-geometry": "4.8.0-dev.2",
38
- "@itwin/ecschema-metadata": "4.8.0-dev.2"
34
+ "@itwin/build-tools": "4.8.0-dev.20",
35
+ "@itwin/ecschema-metadata": "4.8.0-dev.20",
36
+ "@itwin/core-bentley": "4.8.0-dev.20",
37
+ "@itwin/core-common": "4.8.0-dev.20",
38
+ "@itwin/core-geometry": "4.8.0-dev.20"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "npm run -s build:cjs",