@itwin/core-common 5.10.0-dev.1 → 5.10.0-dev.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"WebAppRpcLogging.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcLogging.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,qEAAkE;AAClE,mDAAgD;AAEhD,uDAAwD;AACxD,yDAAsD;AAItD,yDAAsD;AAEtD,qDAAqD;AAErD,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AAEhE,gBAAgB;AAChB,MAAsB,gBAAgB;IAC7B,MAAM,CAAC,iBAAiB,CAAC,QAA0B;QACvD,UAAkB,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,QAA0B;QACxD,UAAkB,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAC3C,CAAC;IAEO,MAAM,KAAK,OAAO;QACxB,MAAM,QAAQ,GAAI,UAAkB,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,WAAW,EAAE,CAAC;YACtC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,CAAC;QACpF,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,MAAM,KAAK,QAAQ;QACzB,MAAM,QAAQ,GAAI,UAAkB,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,WAAW,EAAE,CAAC;YACtC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK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C,2CAAoB,CAAC,oBAAoB,EAAE,gCAAgC,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3L,KAAK,+BAAgB,CAAC,uBAAuB,CAAC,CAAC,OAAO,IAAI,CAAC,gBAAgB,CAAC,uCAAuC,EAAE,MAAM,CAAC,CAAC;YAC7H,KAAK,+BAAgB,CAAC,iBAAiB,CAAC,CAAC,OAAO,IAAI,CAAC,gBAAgB,CAAC,yCAAyC,EAAE,MAAM,CAAC,CAAC;QAC3H,CAAC;IACH,CAAC;IAEkB,WAAW;QAC5B,OAAO,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,iBAAiB,CAAC;IAChE,CAAC;IAEO,gBAAgB,CAAC,OAAe,EAAE,OAAyB;QACjE,MAAM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE/C,qBAAM,CAAC,OAAO,CAAC,2CAAoB,CAAC,oBAAoB,EAAE,GAAG,OAAO,IAAI,mBAAmB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YACpG,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,uGAAuG;YACvG,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,2DAA2D;YACnF,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,2DAA2D;YAC5F,GAAG,OAAO;SACX,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAED,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC","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\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { BentleyStatus, Logger } from \"@itwin/core-bentley\";\r\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterfaceDefinition } from \"../../RpcInterface\";\r\nimport { RpcProtocolEvent } from \"../core/RpcConstants\";\r\nimport { RpcInvocation } from \"../core/RpcInvocation\";\r\nimport { RpcOperation } from \"../core/RpcOperation\";\r\nimport { SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\r\nimport { RpcRequest } from \"../core/RpcRequest\";\r\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\r\n\r\n/* eslint-disable @typescript-eslint/no-deprecated */\r\n\r\n/** @internal */\r\nconst BACKEND = Symbol.for(\"@itwin.WebAppRpcLogging.Backend\");\r\nconst FRONTEND = Symbol.for(\"@itwin.WebAppRpcLogging.Frontend\");\r\n\r\n/** @internal */\r\nexport abstract class WebAppRpcLogging {\r\n public static initializeBackend(instance: WebAppRpcLogging) {\r\n (globalThis as any)[BACKEND] = instance;\r\n }\r\n\r\n public static initializeFrontend(instance: WebAppRpcLogging) {\r\n (globalThis as any)[FRONTEND] = instance;\r\n }\r\n\r\n private static get backend(): WebAppRpcLogging {\r\n const instance = (globalThis as any)[BACKEND];\r\n if (typeof (instance) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Backend logging is not initialized.\");\r\n }\r\n\r\n return instance;\r\n }\r\n\r\n private static get frontend(): WebAppRpcLogging {\r\n const instance = (globalThis as any)[FRONTEND];\r\n if (typeof (instance) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Frontend logging is not initialized.\");\r\n }\r\n\r\n return instance;\r\n }\r\n\r\n public static async logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void> {\r\n if (object instanceof WebAppRpcRequest) {\r\n await WebAppRpcLogging.frontend.logProtocolEvent(event, object);\r\n } else if (object instanceof RpcInvocation) {\r\n await WebAppRpcLogging.backend.logProtocolEvent(event, object);\r\n }\r\n }\r\n\r\n protected abstract logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void>;\r\n\r\n protected abstract getHostname(): string;\r\n\r\n protected getRpcInterfaceName(g: string | RpcInterfaceDefinition): string {\r\n return (typeof g === \"string\") ? g : g.interfaceName;\r\n }\r\n\r\n protected findPathIds(path: string) {\r\n let iTwinId = \"\";\r\n let iModelId = \"\";\r\n\r\n const tokens = path.split(\"/\");\r\n for (let i = 0; i !== tokens.length; ++i) {\r\n // For backwards compatibility, find old \"context\" or current \"iTwin\" terminology\r\n if ((/^context$/i).test(tokens[i]) || (/^itwin$/i).test(tokens[i])) {\r\n iTwinId = tokens[i + 1] || \"\";\r\n }\r\n\r\n if ((/^imodel$/i).test(tokens[i])) {\r\n iModelId = tokens[i + 1] || \"\";\r\n }\r\n }\r\n\r\n return { iTwinId, iModelId };\r\n }\r\n\r\n protected buildOperationDescriptor(operation: RpcOperation | SerializedRpcOperation): string {\r\n if (!operation) {\r\n return \"unknown.unknown\";\r\n }\r\n\r\n const interfaceName = typeof (operation.interfaceDefinition) === \"string\" ? operation.interfaceDefinition : operation.interfaceDefinition.interfaceName;\r\n const operationName = operation.operationName;\r\n return `${interfaceName}.${operationName}`;\r\n }\r\n\r\n protected logRequest(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest): void {\r\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\r\n const pathIds = this.findPathIds(object.path);\r\n\r\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\r\n method: object.method,\r\n path: object.path,\r\n operation: object.operation.operationName,\r\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\r\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\r\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n TimeElapsed: (\"elapsed\" in object) ? object.elapsed : 0, // eslint-disable-line @typescript-eslint/naming-convention\r\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\r\n ...pathIds,\r\n }));\r\n }\r\n\r\n protected logResponse(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest, status: number, elapsed: number): void {\r\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\r\n const pathIds = this.findPathIds(object.path);\r\n\r\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\r\n method: object.method,\r\n path: object.path,\r\n operation: object.operation.operationName,\r\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\r\n status,\r\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\r\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n TimeElapsed: elapsed, // eslint-disable-line @typescript-eslint/naming-convention\r\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\r\n ...pathIds,\r\n }));\r\n }\r\n}\r\n\r\ndeclare global {\r\n \r\n var window: any;\r\n}\r\n\r\nclass WebAppRpcLoggingFrontend extends WebAppRpcLogging {\r\n protected override async logProtocolEvent(event: RpcProtocolEvent, object: WebAppRpcRequest): Promise<void> {\r\n switch (event) {\r\n case RpcProtocolEvent.RequestCreated: return this.logRequest(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.request\", object);\r\n case RpcProtocolEvent.ResponseLoaded: return this.logResponse(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.response\", object, object.metadata.status, object.elapsed);\r\n case RpcProtocolEvent.ConnectionErrorReceived: return this.logErrorFrontend(\"RpcInterface.frontend.connectionError\", object);\r\n case RpcProtocolEvent.ConnectionAborted: return this.logErrorFrontend(\"RpcInterface.frontend.connectionAborted\", object);\r\n }\r\n }\r\n\r\n protected override getHostname(): string {\r\n return globalThis.window?.location?.host ?? \"imodeljs-mobile\";\r\n }\r\n\r\n private logErrorFrontend(message: string, request: WebAppRpcRequest): void {\r\n const operationDescriptor = this.buildOperationDescriptor(request.operation);\r\n const pathIds = this.findPathIds(request.path);\r\n\r\n Logger.logInfo(CommonLoggerCategory.RpcInterfaceFrontend, `${message}.${operationDescriptor}`, () => ({\r\n method: request.method,\r\n path: request.path,\r\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\r\n ActivityId: request.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\r\n ...pathIds,\r\n }));\r\n }\r\n}\r\n\r\nWebAppRpcLogging.initializeFrontend(new WebAppRpcLoggingFrontend());\r\n"]}
1
+ {"version":3,"file":"WebAppRpcLogging.js","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcLogging.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,qEAAkE;AAClE,mDAAgD;AAEhD,uDAAwD;AACxD,yDAAsD;AAItD,yDAAsD;AAEtD,qDAAqD;AAErD,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AAEhE,gBAAgB;AAChB,MAAsB,gBAAgB;IAC7B,MAAM,CAAC,iBAAiB,CAAC,QAA0B;QACvD,UAAkB,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,QAA0B;QACxD,UAAkB,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAC3C,CAAC;IAEO,MAAM,KAAK,OAAO;QACxB,MAAM,QAAQ,GAAI,UAAkB,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,WAAW,EAAE,CAAC;YACtC,MAAM,IAAI,yBAAW,CAAC,4BAAa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AAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,2DAA2D;YAC5F,GAAG,OAAO;SACX,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAED,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC","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\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { BentleyStatus, Logger } from \"@itwin/core-bentley\";\r\nimport { CommonLoggerCategory } from \"../../CommonLoggerCategory\";\r\nimport { IModelError } from \"../../IModelError\";\r\nimport { RpcInterfaceDefinition } from \"../../RpcInterface\";\r\nimport { RpcProtocolEvent } from \"../core/RpcConstants\";\r\nimport { RpcInvocation } from \"../core/RpcInvocation\";\r\nimport { RpcOperation } from \"../core/RpcOperation\";\r\nimport { SerializedRpcOperation, SerializedRpcRequest } from \"../core/RpcProtocol\";\r\nimport { RpcRequest } from \"../core/RpcRequest\";\r\nimport { WebAppRpcRequest } from \"./WebAppRpcRequest\";\r\n\r\n/* eslint-disable @typescript-eslint/no-deprecated */\r\n\r\n/** @internal */\r\nconst BACKEND = Symbol.for(\"@itwin.WebAppRpcLogging.Backend\");\r\nconst FRONTEND = Symbol.for(\"@itwin.WebAppRpcLogging.Frontend\");\r\n\r\n/** @internal */\r\nexport abstract class WebAppRpcLogging {\r\n public static initializeBackend(instance: WebAppRpcLogging) {\r\n (globalThis as any)[BACKEND] = instance;\r\n }\r\n\r\n public static initializeFrontend(instance: WebAppRpcLogging) {\r\n (globalThis as any)[FRONTEND] = instance;\r\n }\r\n\r\n private static get backend(): WebAppRpcLogging {\r\n const instance = (globalThis as any)[BACKEND];\r\n if (typeof (instance) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Backend logging is not initialized.\");\r\n }\r\n\r\n return instance;\r\n }\r\n\r\n private static get frontend(): WebAppRpcLogging {\r\n const instance = (globalThis as any)[FRONTEND];\r\n if (typeof (instance) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Frontend logging is not initialized.\");\r\n }\r\n\r\n return instance;\r\n }\r\n\r\n public static async logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void> {\r\n if (object instanceof WebAppRpcRequest) {\r\n await WebAppRpcLogging.frontend.logProtocolEvent(event, object);\r\n } else if (object instanceof RpcInvocation) {\r\n await WebAppRpcLogging.backend.logProtocolEvent(event, object);\r\n }\r\n }\r\n\r\n protected abstract logProtocolEvent(event: RpcProtocolEvent, object: RpcRequest | RpcInvocation): Promise<void>;\r\n\r\n protected abstract getHostname(): string;\r\n\r\n protected getRpcInterfaceName(g: string | RpcInterfaceDefinition): string {\r\n return (typeof g === \"string\") ? g : g.interfaceName;\r\n }\r\n\r\n protected findPathIds(path: string) {\r\n let iTwinId = \"\";\r\n let iModelId = \"\";\r\n\r\n const tokens = path.split(\"/\");\r\n for (let i = 0; i !== tokens.length; ++i) {\r\n // For backwards compatibility, find old \"context\" or current \"iTwin\" terminology\r\n if ((/^context$/i).test(tokens[i]) || (/^itwin$/i).test(tokens[i])) {\r\n iTwinId = tokens[i + 1] || \"\";\r\n }\r\n\r\n if ((/^imodel$/i).test(tokens[i])) {\r\n iModelId = tokens[i + 1] || \"\";\r\n }\r\n }\r\n\r\n return { iTwinId, iModelId };\r\n }\r\n\r\n protected buildOperationDescriptor(operation: RpcOperation | SerializedRpcOperation): string {\r\n if (!operation) {\r\n return \"unknown.unknown\";\r\n }\r\n\r\n const interfaceName = typeof (operation.interfaceDefinition) === \"string\" ? operation.interfaceDefinition : operation.interfaceDefinition.interfaceName;\r\n const operationName = operation.operationName;\r\n return `${interfaceName}.${operationName}`;\r\n }\r\n\r\n protected logRequest(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest): void {\r\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\r\n const pathIds = this.findPathIds(object.path);\r\n\r\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\r\n method: object.method,\r\n path: object.path,\r\n operation: object.operation.operationName,\r\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\r\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\r\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n TimeElapsed: (\"elapsed\" in object) ? object.elapsed : 0, // eslint-disable-line @typescript-eslint/naming-convention\r\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\r\n ...pathIds,\r\n }));\r\n }\r\n\r\n protected logResponse(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest, status: number, elapsed: number): void {\r\n const operationDescriptor = this.buildOperationDescriptor(object.operation);\r\n const pathIds = this.findPathIds(object.path);\r\n\r\n Logger.logTrace(loggerCategory, `${message}.${operationDescriptor}`, () => ({\r\n method: object.method,\r\n path: object.path,\r\n operation: object.operation.operationName,\r\n rpcInterface: this.getRpcInterfaceName(object.operation.interfaceDefinition),\r\n status,\r\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\r\n ActivityId: object.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n TimeElapsed: elapsed, // eslint-disable-line @typescript-eslint/naming-convention\r\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\r\n ...pathIds,\r\n }));\r\n }\r\n}\r\n\r\nclass WebAppRpcLoggingFrontend extends WebAppRpcLogging {\r\n protected override async logProtocolEvent(event: RpcProtocolEvent, object: WebAppRpcRequest): Promise<void> {\r\n switch (event) {\r\n case RpcProtocolEvent.RequestCreated: return this.logRequest(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.request\", object);\r\n case RpcProtocolEvent.ResponseLoaded: return this.logResponse(CommonLoggerCategory.RpcInterfaceFrontend, \"RpcInterface.frontend.response\", object, object.metadata.status, object.elapsed);\r\n case RpcProtocolEvent.ConnectionErrorReceived: return this.logErrorFrontend(\"RpcInterface.frontend.connectionError\", object);\r\n case RpcProtocolEvent.ConnectionAborted: return this.logErrorFrontend(\"RpcInterface.frontend.connectionAborted\", object);\r\n }\r\n }\r\n\r\n protected override getHostname(): string {\r\n return (globalThis as any).window?.location?.host ?? \"imodeljs-mobile\";\r\n }\r\n\r\n private logErrorFrontend(message: string, request: WebAppRpcRequest): void {\r\n const operationDescriptor = this.buildOperationDescriptor(request.operation);\r\n const pathIds = this.findPathIds(request.path);\r\n\r\n Logger.logInfo(CommonLoggerCategory.RpcInterfaceFrontend, `${message}.${operationDescriptor}`, () => ({\r\n method: request.method,\r\n path: request.path,\r\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\r\n ActivityId: request.id, // eslint-disable-line @typescript-eslint/naming-convention\r\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\r\n ...pathIds,\r\n }));\r\n }\r\n}\r\n\r\nWebAppRpcLogging.initializeFrontend(new WebAppRpcLoggingFrontend());\r\n"]}
@@ -148,12 +148,12 @@ export interface IpcAppFunctions {
148
148
  /** see BriefcaseConnection.close */
149
149
  closeIModel: (key: string) => Promise<void>;
150
150
  /**
151
- * @deprecated Use methods on EditCommand instead.
151
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.
152
152
  * see BriefcaseConnection.saveChanges
153
153
  */
154
154
  saveChanges: (key: string, description?: string) => Promise<void>;
155
155
  /**
156
- * @deprecated Use methods on EditCommand instead.
156
+ * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.
157
157
  * see BriefcaseConnection.abandonChanges
158
158
  */
159
159
  abandonChanges: (key: string) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"IpcAppProps.js","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAwBH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,cAAc,CAAC,SAAS,gBAAgB,QAAQ,EAAE,CAAC;AAwBpH,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,4BAA4B;CAClC,CAAC","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\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { GuidString, Id64String, IModelStatus, LogLevel, OpenMode } from \"@itwin/core-bentley\";\r\nimport { Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { OpenBriefcaseProps, OpenCheckpointArgs } from \"./BriefcaseTypes\";\r\nimport { ChangedEntities } from \"./ChangedEntities\";\r\nimport { ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetProps } from \"./ChangesetProps\";\r\nimport { GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\r\nimport { BriefcaseConnectionProps, EcefLocationProps, IModelConnectionProps, IModelRpcProps, RootSubjectProps, SnapshotOpenOptions, StandaloneOpenOptions } from \"./IModel\";\r\nimport { ModelGeometryChangesProps } from \"./ModelGeometryChanges\";\r\nimport { ReinstateTxnArgs, ReverseTxnArgs, TxnProps } from \"./TxnProps\";\r\n\r\n/** Options for pulling changes into iModel.\r\n * @internal\r\n */\r\nexport interface PullChangesOptions {\r\n /** Enables progress reporting. */\r\n reportProgress?: boolean;\r\n /** Interval for reporting progress (in milliseconds). */\r\n progressInterval?: number;\r\n /** Enables checks for abort. */\r\n enableCancellation?: boolean;\r\n}\r\n\r\n/** Get IPC channel name used for reporting progress of pulling changes into iModel.\r\n * @internal\r\n */\r\nexport const getPullChangesIpcChannel = (iModelId: string) => `${ipcAppChannels.functions}/pullChanges/${iModelId}`;\r\n\r\n/** Identifies a list of tile content Ids belonging to a single tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeContentIds {\r\n treeId: string;\r\n contentIds: string[];\r\n}\r\n\r\n/** Specifies a [GeometricModel]($backend)'s Id and a Guid identifying the current state of the geometry contained within the model.\r\n * @see [TxnManager.onModelGeometryChanged]($backend) and [BriefcaseTxns.onModelGeometryChanged]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelIdAndGeometryGuid {\r\n /** The model's Id. */\r\n id: Id64String;\r\n /** A unique identifier for the current state of the model's geometry. If the guid differs between two revisions of the same iModel, it indicates that the geometry differs.\r\n * This is primarily an implementation detail used to determine whether [Tile]($frontend)s produced for one revision are compatible with another revision.\r\n */\r\n guid: GuidString;\r\n}\r\n\r\n/** @internal */\r\nexport const ipcAppChannels = {\r\n functions: \"itwinjs-core/ipc-app\",\r\n appNotify: \"itwinjs-core/ipcApp-notify\",\r\n txns: \"itwinjs-core/txns\",\r\n editingScope: \"itwinjs-core/editing-scope\",\r\n} as const;\r\n\r\n/**\r\n * Interface implemented by the frontend [NotificationHandler]($common) to be notified of events from IpcApp backend.\r\n * @internal\r\n */\r\nexport interface IpcAppNotifications {\r\n notifyApp: () => void;\r\n}\r\n\r\n/** @internal */\r\nexport interface NotifyEntitiesChangedMetadata {\r\n /** Class full name (\"Schema:Class\") */\r\n name: string;\r\n /** The indices in [[NotifyEntitiesChangedArgs.meta]] of each of this class's **direct** base classes. */\r\n bases: number[];\r\n}\r\n\r\n/** Arguments supplied to [[TxnNotifications.notifyElementsChanged]] and [[TxnNotifications.notifyModelsChanged]].\r\n * @internal\r\n */\r\nexport interface NotifyEntitiesChangedArgs extends ChangedEntities {\r\n /** An array of the same length as [[ChangedEntities.inserted]] (or empty if that array is undefined), containing the index in the [[meta]] array at which the\r\n * metadata for each entity's class is located.\r\n */\r\n insertedMeta: number[];\r\n /** See insertedMeta. */\r\n updatedMeta: number[];\r\n /** See insertedMeta. */\r\n deletedMeta: number[];\r\n\r\n /** Metadata describing each unique class of entity in this set of changes, followed by each unique direct or indirect base class of those classes. */\r\n meta: NotifyEntitiesChangedMetadata[];\r\n}\r\n\r\n/** Interface implemented by the frontend [NotificationHandler]($common) to be notified of changes to an iModel.\r\n * @see [TxnManager]($backend) for the source of these events.\r\n * @see [BriefcaseTxns]($frontend) for the frontend implementation.\r\n * @internal\r\n */\r\nexport interface TxnNotifications {\r\n notifyElementsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyModelsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyGeometryGuidsChanged: (changes: ModelIdAndGeometryGuid[]) => void;\r\n notifyCommit: () => void;\r\n notifyCommitted: (hasPendingTxns: boolean, time: number) => void;\r\n notifyReplayExternalTxns: () => void;\r\n notifyReplayedExternalTxns: () => void;\r\n notifyChangesApplied: () => void;\r\n notifyBeforeUndoRedo: (isUndo: boolean) => void;\r\n notifyAfterUndoRedo: (isUndo: boolean) => void;\r\n notifyPulledChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n notifyPushedChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n\r\n notifyIModelNameChanged: (name: string) => void;\r\n notifyRootSubjectChanged: (subject: RootSubjectProps) => void;\r\n notifyProjectExtentsChanged: (extents: Range3dProps) => void;\r\n notifyGlobalOriginChanged: (origin: XYZProps) => void;\r\n notifyEcefLocationChanged: (ecef: EcefLocationProps | undefined) => void;\r\n notifyGeographicCoordinateSystemChanged: (gcs: GeographicCRSProps | undefined) => void;\r\n\r\n notifyPullMergeBegin: (changeset: ChangesetIdWithIndex) => void;\r\n notifyRebaseBegin: (txns: TxnProps[]) => void;\r\n notifyRebaseTxnBegin: (txnProps: TxnProps) => void;\r\n notifyRebaseTxnEnd: (txnProps: TxnProps) => void;\r\n notifyRebaseEnd: (txns: TxnProps[]) => void;\r\n notifyPullMergeEnd: (changeset: ChangesetIdWithIndex) => void;\r\n notifyDownloadChangesetsBegin: () => void;\r\n notifyDownloadChangesetsEnd: () => void;\r\n notifyReverseLocalChangesBegin: () => void;\r\n notifyReverseLocalChangesEnd: (txns: TxnProps[]) => void;\r\n notifyApplyIncomingChangesBegin: (changes: ChangesetProps[]) => void;\r\n notifyApplyIncomingChangesEnd: (changes: ChangesetProps[]) => void;\r\n\r\n}\r\n\r\n/**\r\n * Interface registered by the frontend [NotificationHandler]($common) to be notified of changes to an iModel during an [GraphicalEditingScope]($frontend).\r\n * @internal\r\n */\r\nexport interface EditingScopeNotifications {\r\n notifyGeometryChanged: (modelProps: ModelGeometryChangesProps[]) => void;\r\n}\r\n\r\n/**\r\n * The methods that may be invoked via Ipc from the frontend of an IpcApp and are implemented on its backend.\r\n * @internal\r\n */\r\nexport interface IpcAppFunctions {\r\n /** Send frontend log to backend.\r\n * @param _level Specify log level.\r\n * @param _category Specify log category.\r\n * @param _message Specify log message.\r\n * @param _metaData metaData if any.\r\n */\r\n log: (_timestamp: number, _level: LogLevel, _category: string, _message: string, _metaData?: any) => Promise<void>;\r\n\r\n /** see BriefcaseConnection.openFile */\r\n openBriefcase: (args: OpenBriefcaseProps) => Promise<BriefcaseConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openCheckpoint: (args: OpenCheckpointArgs) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openStandalone: (filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see SnapshotConnection.openFile */\r\n openSnapshot: (filePath: string, opts?: SnapshotOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.close */\r\n closeIModel: (key: string) => Promise<void>;\r\n /**\r\n * @deprecated Use methods on EditCommand instead.\r\n * see BriefcaseConnection.saveChanges\r\n */\r\n saveChanges: (key: string, description?: string) => Promise<void>;\r\n /**\r\n * @deprecated Use methods on EditCommand instead.\r\n * see BriefcaseConnection.abandonChanges\r\n */\r\n abandonChanges: (key: string) => Promise<void>;\r\n /** see BriefcaseTxns.hasPendingTxns */\r\n hasPendingTxns: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isUndoPossible */\r\n isUndoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isRedoPossible */\r\n isRedoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.getUndoString */\r\n getUndoString: (key: string) => Promise<string>;\r\n /** see BriefcaseTxns.getRedoString */\r\n getRedoString: (key: string) => Promise<string>;\r\n\r\n /** see BriefcaseConnection.pullChanges */\r\n pullChanges: (key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions) => Promise<ChangesetIndexAndId>;\r\n /** Cancels pull of changes. */\r\n cancelPullChangesRequest: (key: string) => Promise<void>;\r\n /** see BriefcaseConnection.pushChanges */\r\n pushChanges: (key: string, description: string) => Promise<ChangesetIndexAndId>;\r\n /** Cancels currently pending or active generation of tile content. */\r\n cancelTileContentRequests: (tokenProps: IModelRpcProps, _contentIds: TileTreeContentIds[]) => Promise<void>;\r\n\r\n /** Cancel element graphics requests.\r\n * @see [[IModelTileRpcInterface.requestElementGraphics]].\r\n */\r\n cancelElementGraphicsRequests: (key: string, _requestIds: string[]) => Promise<void>;\r\n\r\n toggleGraphicalEditingScope: (key: string, _startSession: boolean) => Promise<boolean>;\r\n isGraphicalEditingSupported: (key: string) => Promise<boolean>;\r\n\r\n reverseTxns: (key: string, numOperations: number) => Promise<IModelStatus>;\r\n reverseAllTxn: (key: string) => Promise<IModelStatus>;\r\n reinstateTxn: (key: string) => Promise<IModelStatus>;\r\n reverseTxnsAsync: (key: string, numOperations: number, args?: ReverseTxnArgs) => Promise<void>;\r\n reverseAllTxnsAsync: (key: string, args?: ReverseTxnArgs) => Promise<void>;\r\n reinstateTxnAsync: (key: string, args?: ReinstateTxnArgs) => Promise<void>;\r\n restartTxnSession: (key: string) => Promise<void>;\r\n\r\n /** Query the number of concurrent threads supported by the host's IO or CPU thread pool. */\r\n queryConcurrency: (pool: \"io\" | \"cpu\") => Promise<number>;\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"IpcAppProps.js","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAwBH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,cAAc,CAAC,SAAS,gBAAgB,QAAQ,EAAE,CAAC;AAwBpH,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,4BAA4B;CAClC,CAAC","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\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { GuidString, Id64String, IModelStatus, LogLevel, OpenMode } from \"@itwin/core-bentley\";\r\nimport { Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { OpenBriefcaseProps, OpenCheckpointArgs } from \"./BriefcaseTypes\";\r\nimport { ChangedEntities } from \"./ChangedEntities\";\r\nimport { ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetProps } from \"./ChangesetProps\";\r\nimport { GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\r\nimport { BriefcaseConnectionProps, EcefLocationProps, IModelConnectionProps, IModelRpcProps, RootSubjectProps, SnapshotOpenOptions, StandaloneOpenOptions } from \"./IModel\";\r\nimport { ModelGeometryChangesProps } from \"./ModelGeometryChanges\";\r\nimport { ReinstateTxnArgs, ReverseTxnArgs, TxnProps } from \"./TxnProps\";\r\n\r\n/** Options for pulling changes into iModel.\r\n * @internal\r\n */\r\nexport interface PullChangesOptions {\r\n /** Enables progress reporting. */\r\n reportProgress?: boolean;\r\n /** Interval for reporting progress (in milliseconds). */\r\n progressInterval?: number;\r\n /** Enables checks for abort. */\r\n enableCancellation?: boolean;\r\n}\r\n\r\n/** Get IPC channel name used for reporting progress of pulling changes into iModel.\r\n * @internal\r\n */\r\nexport const getPullChangesIpcChannel = (iModelId: string) => `${ipcAppChannels.functions}/pullChanges/${iModelId}`;\r\n\r\n/** Identifies a list of tile content Ids belonging to a single tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeContentIds {\r\n treeId: string;\r\n contentIds: string[];\r\n}\r\n\r\n/** Specifies a [GeometricModel]($backend)'s Id and a Guid identifying the current state of the geometry contained within the model.\r\n * @see [TxnManager.onModelGeometryChanged]($backend) and [BriefcaseTxns.onModelGeometryChanged]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelIdAndGeometryGuid {\r\n /** The model's Id. */\r\n id: Id64String;\r\n /** A unique identifier for the current state of the model's geometry. If the guid differs between two revisions of the same iModel, it indicates that the geometry differs.\r\n * This is primarily an implementation detail used to determine whether [Tile]($frontend)s produced for one revision are compatible with another revision.\r\n */\r\n guid: GuidString;\r\n}\r\n\r\n/** @internal */\r\nexport const ipcAppChannels = {\r\n functions: \"itwinjs-core/ipc-app\",\r\n appNotify: \"itwinjs-core/ipcApp-notify\",\r\n txns: \"itwinjs-core/txns\",\r\n editingScope: \"itwinjs-core/editing-scope\",\r\n} as const;\r\n\r\n/**\r\n * Interface implemented by the frontend [NotificationHandler]($common) to be notified of events from IpcApp backend.\r\n * @internal\r\n */\r\nexport interface IpcAppNotifications {\r\n notifyApp: () => void;\r\n}\r\n\r\n/** @internal */\r\nexport interface NotifyEntitiesChangedMetadata {\r\n /** Class full name (\"Schema:Class\") */\r\n name: string;\r\n /** The indices in [[NotifyEntitiesChangedArgs.meta]] of each of this class's **direct** base classes. */\r\n bases: number[];\r\n}\r\n\r\n/** Arguments supplied to [[TxnNotifications.notifyElementsChanged]] and [[TxnNotifications.notifyModelsChanged]].\r\n * @internal\r\n */\r\nexport interface NotifyEntitiesChangedArgs extends ChangedEntities {\r\n /** An array of the same length as [[ChangedEntities.inserted]] (or empty if that array is undefined), containing the index in the [[meta]] array at which the\r\n * metadata for each entity's class is located.\r\n */\r\n insertedMeta: number[];\r\n /** See insertedMeta. */\r\n updatedMeta: number[];\r\n /** See insertedMeta. */\r\n deletedMeta: number[];\r\n\r\n /** Metadata describing each unique class of entity in this set of changes, followed by each unique direct or indirect base class of those classes. */\r\n meta: NotifyEntitiesChangedMetadata[];\r\n}\r\n\r\n/** Interface implemented by the frontend [NotificationHandler]($common) to be notified of changes to an iModel.\r\n * @see [TxnManager]($backend) for the source of these events.\r\n * @see [BriefcaseTxns]($frontend) for the frontend implementation.\r\n * @internal\r\n */\r\nexport interface TxnNotifications {\r\n notifyElementsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyModelsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyGeometryGuidsChanged: (changes: ModelIdAndGeometryGuid[]) => void;\r\n notifyCommit: () => void;\r\n notifyCommitted: (hasPendingTxns: boolean, time: number) => void;\r\n notifyReplayExternalTxns: () => void;\r\n notifyReplayedExternalTxns: () => void;\r\n notifyChangesApplied: () => void;\r\n notifyBeforeUndoRedo: (isUndo: boolean) => void;\r\n notifyAfterUndoRedo: (isUndo: boolean) => void;\r\n notifyPulledChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n notifyPushedChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n\r\n notifyIModelNameChanged: (name: string) => void;\r\n notifyRootSubjectChanged: (subject: RootSubjectProps) => void;\r\n notifyProjectExtentsChanged: (extents: Range3dProps) => void;\r\n notifyGlobalOriginChanged: (origin: XYZProps) => void;\r\n notifyEcefLocationChanged: (ecef: EcefLocationProps | undefined) => void;\r\n notifyGeographicCoordinateSystemChanged: (gcs: GeographicCRSProps | undefined) => void;\r\n\r\n notifyPullMergeBegin: (changeset: ChangesetIdWithIndex) => void;\r\n notifyRebaseBegin: (txns: TxnProps[]) => void;\r\n notifyRebaseTxnBegin: (txnProps: TxnProps) => void;\r\n notifyRebaseTxnEnd: (txnProps: TxnProps) => void;\r\n notifyRebaseEnd: (txns: TxnProps[]) => void;\r\n notifyPullMergeEnd: (changeset: ChangesetIdWithIndex) => void;\r\n notifyDownloadChangesetsBegin: () => void;\r\n notifyDownloadChangesetsEnd: () => void;\r\n notifyReverseLocalChangesBegin: () => void;\r\n notifyReverseLocalChangesEnd: (txns: TxnProps[]) => void;\r\n notifyApplyIncomingChangesBegin: (changes: ChangesetProps[]) => void;\r\n notifyApplyIncomingChangesEnd: (changes: ChangesetProps[]) => void;\r\n\r\n}\r\n\r\n/**\r\n * Interface registered by the frontend [NotificationHandler]($common) to be notified of changes to an iModel during an [GraphicalEditingScope]($frontend).\r\n * @internal\r\n */\r\nexport interface EditingScopeNotifications {\r\n notifyGeometryChanged: (modelProps: ModelGeometryChangesProps[]) => void;\r\n}\r\n\r\n/**\r\n * The methods that may be invoked via Ipc from the frontend of an IpcApp and are implemented on its backend.\r\n * @internal\r\n */\r\nexport interface IpcAppFunctions {\r\n /** Send frontend log to backend.\r\n * @param _level Specify log level.\r\n * @param _category Specify log category.\r\n * @param _message Specify log message.\r\n * @param _metaData metaData if any.\r\n */\r\n log: (_timestamp: number, _level: LogLevel, _category: string, _message: string, _metaData?: any) => Promise<void>;\r\n\r\n /** see BriefcaseConnection.openFile */\r\n openBriefcase: (args: OpenBriefcaseProps) => Promise<BriefcaseConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openCheckpoint: (args: OpenCheckpointArgs) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openStandalone: (filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see SnapshotConnection.openFile */\r\n openSnapshot: (filePath: string, opts?: SnapshotOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.close */\r\n closeIModel: (key: string) => Promise<void>;\r\n /**\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.\r\n * see BriefcaseConnection.saveChanges\r\n */\r\n saveChanges: (key: string, description?: string) => Promise<void>;\r\n /**\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.\r\n * see BriefcaseConnection.abandonChanges\r\n */\r\n abandonChanges: (key: string) => Promise<void>;\r\n /** see BriefcaseTxns.hasPendingTxns */\r\n hasPendingTxns: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isUndoPossible */\r\n isUndoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isRedoPossible */\r\n isRedoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.getUndoString */\r\n getUndoString: (key: string) => Promise<string>;\r\n /** see BriefcaseTxns.getRedoString */\r\n getRedoString: (key: string) => Promise<string>;\r\n\r\n /** see BriefcaseConnection.pullChanges */\r\n pullChanges: (key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions) => Promise<ChangesetIndexAndId>;\r\n /** Cancels pull of changes. */\r\n cancelPullChangesRequest: (key: string) => Promise<void>;\r\n /** see BriefcaseConnection.pushChanges */\r\n pushChanges: (key: string, description: string) => Promise<ChangesetIndexAndId>;\r\n /** Cancels currently pending or active generation of tile content. */\r\n cancelTileContentRequests: (tokenProps: IModelRpcProps, _contentIds: TileTreeContentIds[]) => Promise<void>;\r\n\r\n /** Cancel element graphics requests.\r\n * @see [[IModelTileRpcInterface.requestElementGraphics]].\r\n */\r\n cancelElementGraphicsRequests: (key: string, _requestIds: string[]) => Promise<void>;\r\n\r\n toggleGraphicalEditingScope: (key: string, _startSession: boolean) => Promise<boolean>;\r\n isGraphicalEditingSupported: (key: string) => Promise<boolean>;\r\n\r\n reverseTxns: (key: string, numOperations: number) => Promise<IModelStatus>;\r\n reverseAllTxn: (key: string) => Promise<IModelStatus>;\r\n reinstateTxn: (key: string) => Promise<IModelStatus>;\r\n reverseTxnsAsync: (key: string, numOperations: number, args?: ReverseTxnArgs) => Promise<void>;\r\n reverseAllTxnsAsync: (key: string, args?: ReverseTxnArgs) => Promise<void>;\r\n reinstateTxnAsync: (key: string, args?: ReinstateTxnArgs) => Promise<void>;\r\n restartTxnSession: (key: string) => Promise<void>;\r\n\r\n /** Query the number of concurrent threads supported by the host's IO or CPU thread pool. */\r\n queryConcurrency: (pool: \"io\" | \"cpu\") => Promise<number>;\r\n}\r\n\r\n"]}
@@ -155,11 +155,11 @@ export interface ViewDefinitionProps extends DefinitionElementProps {
155
155
  /** The [[DisplayStyle]] for this view. */
156
156
  displayStyle?: RelatedElementProps;
157
157
  /** The Id of the [[CategorySelector]] for this view.
158
- * @deprecated in 5.9. Use `categorySelector` instead.
158
+ * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `categorySelector` instead.
159
159
  */
160
160
  categorySelectorId: ViewIdString;
161
161
  /** The Id of the [[DisplayStyle]] for this view.
162
- * @deprecated in 5.9. Use `displayStyle` instead.
162
+ * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `displayStyle` instead.
163
163
  */
164
164
  displayStyleId: ViewIdString;
165
165
  description?: string;
@@ -196,7 +196,7 @@ export interface SpatialViewDefinitionProps extends ViewDefinition3dProps {
196
196
  /** The [[ModelSelector]] for this view. */
197
197
  modelSelector?: RelatedElementProps;
198
198
  /** The Id of the [[ModelSelector]] for this view.
199
- * @deprecated in 5.9. Use `modelSelector` instead.
199
+ * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `modelSelector` instead.
200
200
  */
201
201
  modelSelectorId: ViewIdString;
202
202
  }
@@ -208,7 +208,7 @@ export interface ViewDefinition2dProps extends ViewDefinitionProps {
208
208
  /** The base model displayed by this view. */
209
209
  baseModel?: RelatedElementProps;
210
210
  /** The Id of the base model displayed by this view.
211
- * @deprecated in 5.9. Use `baseModel` instead.
211
+ * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `baseModel` instead.
212
212
  */
213
213
  baseModelId: Id64String;
214
214
  origin: XYProps;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewProps.js","sourceRoot":"","sources":["../../src/ViewProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAmJH;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAwC,EAAE,mBAA+B;IACxG,OAAO,OAAO,EAAE,EAAE,IAAI,mBAAmB,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAwC,EAAE,mBAA+B;IACtG,OAAO,OAAO,IAAI,EAAE,EAAE,EAAE,mBAAmB,EAAE,CAAC;AAChD,CAAC;AAmHD;;;GAGG;AACH,MAAM,KAAW,YAAY,CA0W5B;AA1WD,WAAiB,YAAY;IAE3B;;;;OAIG;IACU,oBAAO,GAAG,OAAO,CAAC;IAkC/B,qGAAqG;IACxF,0BAAa,GAAG,CAAC,EAAiB,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;AAgUnF,CAAC,EA1WgB,YAAY,KAAZ,YAAY,QA0W5B","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\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { AngleProps, Range3dProps, TransformProps, XYProps, XYZProps, YawPitchRollProps } from \"@itwin/core-geometry\";\r\nimport { CameraProps } from \"./Camera\";\r\nimport { DisplayStyleProps, DisplayStyleSettingsProps } from \"./DisplayStyleSettings\";\r\nimport { DefinitionElementProps, DisplayStyleLoadProps, ElementProps, RelatedElementProps, RenderTimelineProps, SheetProps, ViewAttachmentProps } from \"./ElementProps\";\r\nimport { EntityQueryParams } from \"./EntityProps\";\r\nimport { ModelProps } from \"./ModelProps\";\r\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\r\nimport { ViewDetails3dProps, ViewDetailsProps } from \"./ViewDetails\";\r\nimport { ThumbnailProps } from \"./Thumbnail\";\r\nimport { RenderSchedule } from \"./RenderSchedule\";\r\n\r\n/** The id of either an element or an entry in a ViewStore.\r\n * @public\r\n */\r\nexport type ViewIdString = Id64String; // should also include ViewStoreRpc.IdString when that's @public\r\n\r\n/** As part of a [[ViewStateProps]], describes the [[SpatialViewDefinition]] from which a [SectionDrawing]($backend) was generated.\r\n * @see [[SectionDrawingProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SectionDrawingViewProps {\r\n /** The Id of the spatial view from which the SectionDrawing was generated. */\r\n spatialView: Id64String;\r\n /** If true, the spatial view should be displayed in the context of the drawing view. */\r\n displaySpatialView: boolean;\r\n /** Transform from drawing coordinates to spatial coordinates. If undefined, use identity transform. */\r\n drawingToSpatialTransform?: TransformProps;\r\n}\r\n\r\n/** The response props from the getCustomViewState3dData RPC endpoint\r\n * @internal\r\n */\r\nexport interface CustomViewState3dProps {\r\n modelIds: CompressedId64Set;\r\n modelExtents: Range3dProps;\r\n categoryIds: CompressedId64Set;\r\n}\r\n\r\n/**\r\n * The options passed to the getCustomViewState3dData RPC endpoint.\r\n * @internal\r\n */\r\nexport interface CustomViewState3dCreatorOptions {\r\n modelIds?: CompressedId64Set;\r\n}\r\n\r\n/**\r\n * A result row from querying for subcategories\r\n * @internal\r\n */\r\nexport interface SubCategoryResultRow {\r\n parentId: Id64String;\r\n id: Id64String;\r\n appearance: SubCategoryAppearance.Props;\r\n}\r\n\r\n/**\r\n * Request props for the hydrateViewState RPC endpoint.\r\n * @internal\r\n */\r\nexport interface HydrateViewStateRequestProps {\r\n acsId?: string;\r\n notLoadedModelSelectorStateModels?: CompressedId64Set;\r\n sheetViewAttachmentIds?: CompressedId64Set;\r\n viewStateLoadProps?: ViewStateLoadProps;\r\n baseModelId?: Id64String;\r\n spatialViewId?: Id64String;\r\n}\r\n\r\n/** Response props from the hydrateViewState RPC endpoint.\r\n * @internal\r\n */\r\nexport interface HydrateViewStateResponseProps {\r\n acsElementProps?: ElementProps;\r\n modelSelectorStateModels?: ModelProps[];\r\n // cast this to viewAttachmentInfo[] on the frontend.\r\n sheetViewAttachmentProps?: ViewAttachmentProps[];\r\n sheetViewViews?: (ViewStateProps | undefined)[];\r\n baseModelProps?: ModelProps;\r\n spatialViewProps?: ViewStateProps;\r\n}\r\n\r\n/** Returned from [IModelDb.Views.getViewStateProps]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewStateProps {\r\n viewDefinitionProps: ViewDefinitionProps;\r\n categorySelectorProps: CategorySelectorProps;\r\n modelSelectorProps?: ModelSelectorProps;\r\n displayStyleProps: DisplayStyleProps;\r\n /** Sheet-specific properties, if this is a view of a [SheetModel]($backend). */\r\n sheetProps?: SheetProps;\r\n /** The Ids of the [ViewAttachment]($backend)s contained within the [SheetModel]($backend), if this is a sheet view. */\r\n sheetAttachments?: Id64Array;\r\n /** For a [DrawingViewState]($frontend), the extents of the [DrawingModel]($backend), used for determining the upper limits of the view's extents. */\r\n modelExtents?: Range3dProps;\r\n /** Information about the [SectionDrawing]($backend) relevant to displaying a drawing view. */\r\n sectionDrawing?: SectionDrawingViewProps;\r\n}\r\n\r\n/** Options for loading a [[ViewStateProps]] via [IModelConnection.Views.load]($frontend) or [IModelDb.Views.getViewStateProps]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewStateLoadProps {\r\n /** Options for loading the view's [[DisplayStyleProps]]. */\r\n displayStyle?: DisplayStyleLoadProps;\r\n\r\n /**\r\n * bindings for query-based selectors\r\n * @beta\r\n */\r\n queryBindings?: {\r\n modelSelector?: ViewStoreRpc.QueryBindings;\r\n categorySelector?: ViewStoreRpc.QueryBindings;\r\n };\r\n}\r\n\r\n/** Properties that define a ModelSelector\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelSelectorProps extends DefinitionElementProps {\r\n models: Id64Array;\r\n}\r\n\r\n/** Properties that define a CategorySelector\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CategorySelectorProps extends DefinitionElementProps {\r\n categories: Id64Array;\r\n}\r\n\r\n/** Parameters for performing a query on [ViewDefinition]($backend) classes.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewQueryParams extends EntityQueryParams {\r\n wantPrivate?: boolean;\r\n}\r\n\r\n/**\r\n * Helper to resolve navigation property ids represented as independent Id64Strings.\r\n * @internal\r\n *\r\n * @note This function will be redundant once all deprecated fields are removed. All calls to this function will need to be removed as well.\r\n */\r\nexport function resolveNavPropId(navProp: RelatedElementProps | undefined, deprecatedNavPropId: Id64String): Id64String {\r\n return navProp?.id ?? deprecatedNavPropId;\r\n}\r\n\r\n/**\r\n * Helper to resolve navigation properties represented as Id64Strings.\r\n * @internal\r\n *\r\n * @note This function will be redundant once all deprecated fields are removed. All calls to this function will need to be removed as well.\r\n */\r\nexport function resolveNavProp(navProp: RelatedElementProps | undefined, deprecatedNavPropId: Id64String): RelatedElementProps {\r\n return navProp ?? { id: deprecatedNavPropId };\r\n}\r\n\r\n/** Parameters used to construct a ViewDefinition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinitionProps extends DefinitionElementProps {\r\n /** The [[CategorySelector]] for this view. */\r\n categorySelector?: RelatedElementProps;\r\n\r\n /** The [[DisplayStyle]] for this view. */\r\n displayStyle?: RelatedElementProps;\r\n\r\n /** The Id of the [[CategorySelector]] for this view.\r\n * @deprecated in 5.9. Use `categorySelector` instead.\r\n */\r\n categorySelectorId: ViewIdString;\r\n /** The Id of the [[DisplayStyle]] for this view.\r\n * @deprecated in 5.9. Use `displayStyle` instead.\r\n */\r\n displayStyleId: ViewIdString;\r\n description?: string;\r\n jsonProperties?: {\r\n /** Additional properties of the view. */\r\n viewDetails?: ViewDetailsProps;\r\n };\r\n}\r\n\r\n/** Parameters to construct a ViewDefinition3d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinition3dProps extends ViewDefinitionProps {\r\n /** if true, camera is valid. */\r\n cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n origin: XYZProps;\r\n /** The extent of the view frustum. */\r\n extents: XYZProps;\r\n /** Rotation of the view frustum (could be undefined if going Matrix3d -> YawPitchRoll). */\r\n angles?: YawPitchRollProps;\r\n /** The camera used for this view. */\r\n camera: CameraProps;\r\n jsonProperties?: {\r\n /** Additional properties of the view. */\r\n viewDetails?: ViewDetails3dProps;\r\n };\r\n}\r\n\r\n/** Parameters to construct a SpatialViewDefinition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialViewDefinitionProps extends ViewDefinition3dProps {\r\n /** The [[ModelSelector]] for this view. */\r\n modelSelector?: RelatedElementProps;\r\n\r\n /** The Id of the [[ModelSelector]] for this view.\r\n * @deprecated in 5.9. Use `modelSelector` instead.\r\n */\r\n modelSelectorId: ViewIdString;\r\n}\r\n\r\n/** Parameters used to construct a ViewDefinition2d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinition2dProps extends ViewDefinitionProps {\r\n /** The base model displayed by this view. */\r\n baseModel?: RelatedElementProps;\r\n\r\n /** The Id of the base model displayed by this view.\r\n * @deprecated in 5.9. Use `baseModel` instead.\r\n */\r\n baseModelId: Id64String;\r\n origin: XYProps;\r\n delta: XYProps;\r\n angle: AngleProps;\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystemProps extends ElementProps {\r\n type?: number;\r\n description?: string;\r\n}\r\n\r\n/** Properties of AuxCoordSystem2d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystem2dProps extends AuxCoordSystemProps {\r\n /** Origin of the AuxCoordSystem2d */\r\n origin?: XYProps;\r\n /** Rotation angle */\r\n angle?: AngleProps;\r\n}\r\n\r\n/** Properties of AuxCoordSystem3d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystem3dProps extends AuxCoordSystemProps {\r\n /** Origin of the AuxCoordSystem3d */\r\n origin?: XYZProps;\r\n /** Yaw angle */\r\n yaw?: AngleProps;\r\n /** Pitch angle */\r\n pitch?: AngleProps;\r\n /** Roll angle */\r\n roll?: AngleProps;\r\n}\r\n\r\n/**\r\n * Access to a ViewStore from the frontend.\r\n * @beta\r\n */\r\nexport namespace ViewStoreRpc {\r\n\r\n /**\r\n * Version of the Rpc interface. If any methods or interfaces of this API change, this number should\r\n * be incremented according to the rules of semantic versioning. See .\\rpc\\README-RpcInterfaceVersioning.md for more information.\r\n * @internal\r\n */\r\n export const version = \"4.0.0\";\r\n\r\n /** an Id of a View, DisplayStyle, ModelSelector, CategorySelector, or Timeline in a ViewStore.\r\n * Will be a base-36 number with a leading \"@\".\r\n * @public\r\n */\r\n export type IdString = string;\r\n\r\n /**\r\n * A string identifying a group. This may either be a \"group name path\" or the RowString of a group (e.g. either \"group1/design/issues\" or \"@4e3\")\r\n * The syntax is not ambiguous because ViewStoreIdStrings always start with \"@\" and Group names can never contain \"@\".\r\n */\r\n export type ViewGroupSpec = IdString | ViewGroupPath;\r\n\r\n /** The name for a view. */\r\n export type ViewName = string;\r\n\r\n /** The name for a Tag. */\r\n export type TagName = string;\r\n\r\n /** The name of an \"owner\". Should come from the authentication system, so it will be guaranteed unique.\r\n * This name should be chosen by the user rather than their email address.\r\n */\r\n export type OwnerName = string;\r\n\r\n /** The path name of a view group (e.g. \"group1/design/issues\"). Does not include the \"root\" group. */\r\n export type ViewGroupPath = string;\r\n\r\n /** The name for a view group. */\r\n export type ViewGroupName = string;\r\n\r\n /** The name for a view group. */\r\n export type ClassFullName = string;\r\n\r\n /** Determine if a string is an Id of an entry in a ViewStore (base-36 integer with a leading \"@\") */\r\n export const isViewStoreId = (id?: ViewIdString) => true === id?.startsWith(\"@\");\r\n\r\n /** Parameters for querying for views in a ViewStore. */\r\n export interface QueryParams {\r\n /** a list of classFullNames to accept. If not present, all classes are returned. */\r\n readonly classNames?: ClassFullName[];\r\n /** Optional \"LIMIT\" clause to limit the number of views returned. */\r\n readonly limit?: number;\r\n /** Optional \"OFFSET\" clause. Only valid if Limit is also present. */\r\n readonly offset?: number;\r\n /** A string to filter view names. May include wildcards if the `nameCompare` uses LIKE or GLOB (see SQLite documentation for LIKE and GLOB). */\r\n readonly nameSearch?: string;\r\n /** The comparison operator for `nameSearch`. Default is `=` */\r\n readonly nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\r\n /* the Id of the view group to query. If not present, the root group is used. There is no way to query for views from multiple view groups in one request. */\r\n readonly group?: IdString;\r\n /** A list of tags to filter views. If present, only views that have one or more of the tags will be returned. */\r\n readonly tags?: TagName[];\r\n /* The name of an owner for private views. If present, private views owned by the owner will also be returned. Shared views are always returned. */\r\n readonly owner?: OwnerName;\r\n }\r\n\r\n /** Parameters for specifying a Query to select Categories or Models. */\r\n export interface SelectorQuery {\r\n /**\r\n * The full ClassName from which to select. If this SelectorQuery is for Categories, this must be or derive from \"BisCore:Category\".\r\n * If this SelectorQuery is for Models, this must be or derive from \"BisCore:Model\".\r\n */\r\n from: ClassFullName;\r\n /** If true, only return instances of `from`. Otherwise, return instances of `from` and any subclasses of `from`. */\r\n only?: boolean;\r\n /**\r\n * filter for query. If present, only instances of `from` that satisfy the filter will be returned.\r\n * If not supplied, all instances of `from` are returned.\r\n * @note\r\n * This value is used into the ECQuery:`SELECT ECInstanceId FROM ${query.from} WHERE ${query.where}`.\r\n */\r\n where?: string;\r\n /** List of Model or Category ids to add to the query results.\r\n * @note This is only valid if there is a `where` clause. Otherwise all instances of `from` will be returned so there is no value in adding ids.\r\n */\r\n adds?: Id64Array | CompressedId64Set;\r\n /** List of Model or Category Ids to remove from the query results. */\r\n removes?: Id64Array | CompressedId64Set;\r\n }\r\n\r\n /** A Model or Category selector may either be a query or a list of Ids. */\r\n export type SelectorProps = { query: SelectorQuery, ids?: never } | { query?: never, ids: Id64Array | CompressedId64Set };\r\n\r\n /** Information about a View in a ViewStore. */\r\n export interface ViewInfo {\r\n /** The Id of the view. */\r\n id: IdString;\r\n /** The name of the view. */\r\n name?: ViewName;\r\n /** The name of the owner of the view. */\r\n owner?: OwnerName;\r\n /** The className of the view. */\r\n className: ClassFullName;\r\n /** The Id of the view group containing the view. */\r\n groupId: IdString;\r\n /** If true, the view is private (unshared) and will only be returned by queries that specify the owner's name. */\r\n isPrivate: boolean;\r\n /** The Id of a ModelSelector, if the view has one. */\r\n modelSelectorId?: IdString;\r\n /** The Id of the CategorySelector for this view. */\r\n categorySelectorId: IdString;\r\n /** The Id of a DisplayStyle for the view. */\r\n displayStyleId: IdString;\r\n /** a list of tags for the view. */\r\n tags?: TagName[];\r\n }\r\n\r\n /** Information about a ViewGroup in a ViewStore. */\r\n export interface ViewGroupInfo {\r\n /** The Id of this view group. */\r\n id: IdString;\r\n /** The name of this view group. */\r\n name: ViewGroupName;\r\n /** The Id of the parent of this view group. If undefined, this is the root group. */\r\n parent?: IdString;\r\n /** The Id of the default view for this view group. */\r\n defaultView?: IdString;\r\n }\r\n\r\n /** Arguments for adding a new view to a ViewStore. */\r\n export interface AddViewArgs {\r\n /** the properties of the ViewDefinition for the new view. */\r\n readonly viewDefinition: ViewDefinitionProps;\r\n\r\n /**\r\n * The properties of a category selector for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.categorySelector.id` is **not** a valid `IdString`.\r\n * In that case, a new category selector will be created with these properties and its Id will be used.\r\n * Otherwise, the categorySelector from the ViewDefinition is used. If it does not represent a valid category\r\n * selector, an error is thrown.\r\n */\r\n readonly categorySelectorProps?: CategorySelectorProps;\r\n\r\n /** The properties of a model selector for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.modelSelector.id` is **not** a valid `IdString`.\r\n * In that case, a new model selector will be created with these properties and its Id will be used.\r\n * Otherwise, the modelSelector from the ViewDefinition is used. If it does not represent a valid model selector,\r\n * an error is thrown.\r\n */\r\n readonly modelSelectorProps?: ModelSelectorProps;\r\n\r\n /** The properties of a display style for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.displayStyle.id` is **not** a valid `IdString`.\r\n * In that case, a new display style will be created with these properties and its Id will be used.\r\n * Otherwise, the displayStyle from the ViewDefinition is used. If it does not represent a valid display style, an\r\n * error is thrown.\r\n */\r\n readonly displayStyleProps?: DisplayStyleProps;\r\n\r\n /* the owner of the view. Must be present if isPrivate is true. */\r\n readonly owner?: OwnerName;\r\n\r\n /* the Id of the view group for the view. If not present, the view is added to the root group. */\r\n readonly group?: IdString;\r\n\r\n /* if true, the view is private (unshared). */\r\n readonly isPrivate?: boolean;\r\n\r\n /* an optional list of tags for the view. */\r\n readonly tags?: TagName[];\r\n\r\n /** optional thumbnail for the view. */\r\n readonly thumbnail?: ThumbnailProps;\r\n }\r\n\r\n /** Argument for finding a category selector, model selector, display style, or timeline by name or Id. */\r\n export type NameOrId = { name: string, id?: never } | { id: IdString, name?: never };\r\n\r\n /** Bindings for parameterized values in where clause of SelectorQuery\r\n * @see[[ECSqlStatement.bindValues]]\r\n */\r\n export interface QueryBindings {\r\n bindings?: any[] | object;\r\n }\r\n\r\n /**\r\n * Methods for reading from a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreReader`. These\r\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\r\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\r\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\r\n * user only needs read permission to the ViewStore.\r\n */\r\n export interface Reader {\r\n /** Find all views owned by the supplied owner name. */\r\n findViewsByOwner(args: { owner: OwnerName }): Promise<ViewInfo[]>;\r\n\r\n /** Get a category selector by Id. Throws if it does not exist. */\r\n getCategorySelector(args: NameOrId & QueryBindings): Promise<CategorySelectorProps>;\r\n\r\n /** Get a display style by Id. Throws if it does not exist. */\r\n getDisplayStyle(args: NameOrId & { opts?: DisplayStyleLoadProps }): Promise<DisplayStyleProps>;\r\n\r\n /** Get a model selector by Id. Throws if it does not exist. */\r\n getModelSelector(args: NameOrId & QueryBindings): Promise<ModelSelectorProps>;\r\n\r\n /** Get a thumbnail for a view. */\r\n getThumbnail(args: { viewId: IdString }): Promise<ThumbnailProps | undefined>;\r\n\r\n /** Get a render timeline by Id. Throws if it does not exist. */\r\n getTimeline(args: NameOrId): Promise<RenderTimelineProps>;\r\n\r\n /** Get a view by name. The name can include the *view group path*, if no `groupId` is supplied. */\r\n getViewByName(arg: { name: ViewName, groupId?: IdString }): Promise<ViewInfo | undefined>;\r\n\r\n /** Get a view definition by viewId. Throws if it does not exist. */\r\n getViewDefinition(args: { viewId: IdString }): Promise<ViewDefinitionProps>;\r\n\r\n /** get the properties of a ViewGroup by id. This will include the defaultViewId, if one exists. */\r\n getViewGroupInfo(args: { groupId?: IdString }): Promise<ViewGroupInfo | undefined>;\r\n\r\n /** Get a list of ViewGroups that are children of the supplied parent. If no parent is supplied, the root group is used.\r\n * Each entry in the list includes the id and name of the ViewGroup.\r\n */\r\n getViewGroups(args: { parent?: ViewGroupSpec }): Promise<{ id: IdString, name: string }[]>;\r\n\r\n /** Get the ViewInfo for a view by Id. Returns undefined if the view does not exist. */\r\n getViewInfo(args: { viewId: IdString }): Promise<ViewInfo | undefined>;\r\n\r\n /** Query for a list of ViewInfos for views that match the supplied [[QueryParams]].\r\n * @note The array will be sorted by name, ascending. To limit the size of the array, supply `limit` and `offset` in the QueryParams.\r\n */\r\n queryViews(queryParams: QueryParams): Promise<ViewInfo[]>;\r\n }\r\n\r\n /**\r\n * Methods for writing to a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreWriter`. These\r\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\r\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\r\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\r\n * user must have write permission to the ViewStore.\r\n */\r\n export interface Writer {\r\n /**\r\n * Add a category selector to a ViewStore.\r\n * @returns The IdString of the new category selector.\r\n */\r\n addCategorySelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Add a display style to a ViewStore.\r\n * @returns The IdString of the new display style.\r\n */\r\n addDisplayStyle(args: { name?: string, className: string, settings: DisplayStyleSettingsProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /**\r\n * Add a model selector to a ViewStore.\r\n * @returns The IdString of the new model selector.\r\n */\r\n addModelSelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /**\r\n * Add a thumbnail for a view. If the view already has a thumbnail, it is replaced.\r\n * If a view is deleted, its thumbnail is also deleted.\r\n * @note The thumbnail must be a valid image in PNG or JPEG format.\r\n */\r\n addOrReplaceThumbnail(args: { viewId: IdString, thumbnail: ThumbnailProps }): Promise<void>;\r\n\r\n /** Add tags to a view. If the view already has tags, the new tags are appended to the existing tags. */\r\n addTagsToView(args: { viewId: IdString, tags: TagName[] }): Promise<void>;\r\n\r\n /** Add a render timeline to a ViewStore.\r\n * @returns The IdString of the new timeline.\r\n */\r\n addTimeline(args: { name?: string, timeline: RenderSchedule.ScriptProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Add a view to a ViewStore. If no group is supplied, the new view is added to the root view group.\r\n * @returns The IdString of the new view\r\n */\r\n addView(args: AddViewArgs): Promise<IdString>;\r\n\r\n /** Add a view group to a ViewStore. If no parent is supplied, the new group is added to the root view group.\r\n * @returns the IdString of new view group\r\n */\r\n addViewGroup(args: { name: string, parentId?: IdString, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Change the default view for a view group. If no group is supplied, this changes the default view for the root view group. */\r\n changeDefaultViewId(args: { defaultView: IdString, group?: ViewGroupSpec }): Promise<void>;\r\n\r\n /** Delete the thumbnail for a view. */\r\n deleteThumbnail(args: { viewId: IdString }): Promise<void>;\r\n\r\n /**\r\n * Delete a view from a ViewStore. If this is the default view for a view group, it cannot be deleted until another\r\n * view is set as the default.\r\n * @note If this view references a category selector, model selector, or display style that is not referenced by any\r\n * other view, *and do not have a name*, they will each also be deleted. If the view has a thumbnail, it is also\r\n * deleted.\r\n */\r\n deleteView(args: { viewId: IdString }): Promise<void>;\r\n\r\n /** Delete a view group from a ViewStore. This will also delete all views in the group. */\r\n deleteViewGroup(args: { name: ViewGroupSpec }): Promise<void>;\r\n\r\n /** Delete a display style from a ViewStore. If the display style is referenced by any view, it cannot be deleted\r\n * and an exception will be thrown.\r\n */\r\n deleteDisplayStyle(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a model selector from a ViewStore. If the model selector is referenced by any view, it cannot be deleted\r\n * and an exception will be thrown. */\r\n deleteModelSelector(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a category selector from a ViewStore. If the category selector is referenced by any view, it cannot be\r\n * deleted and an exception will be thrown.\r\n */\r\n deleteCategorySelector(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a render timeline from a ViewStore. */\r\n deleteTimeline(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a tag. This removes it from all views where it was used. */\r\n deleteTag(args: { name: TagName }): Promise<void>;\r\n\r\n /** remove a tag from a view. */\r\n removeTagFromView(args: { viewId: IdString, tag: TagName }): Promise<void>;\r\n\r\n /** Update the properties of a category selector. */\r\n updateCategorySelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\r\n\r\n /** Update the properties of a display style. */\r\n updateDisplayStyle(args: NameOrId & { className: string, settings: DisplayStyleSettingsProps }): Promise<void>;\r\n\r\n /** Update the properties of a model selector. */\r\n updateModelSelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\r\n\r\n /** Update the properties of a render timeline. */\r\n updateTimeline(args: NameOrId & { timeline: RenderSchedule.ScriptProps }): Promise<void>;\r\n\r\n /** Update the properties of a view definition. */\r\n updateViewDefinition(args: { viewId: IdString, viewDefinition: ViewDefinitionProps }): Promise<void>;\r\n\r\n /** Change a view from shared to private, or vice versa. If changing to private, the owner must be supplied. */\r\n updateViewShared(arg: { viewId: IdString, isShared: boolean, owner?: string }): Promise<void>;\r\n\r\n /** Set the name of a category selector. */\r\n renameCategorySelector(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a display style. */\r\n renameDisplayStyle(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a model selector. */\r\n renameModelSelector(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a render timeline. */\r\n renameTimeline(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a view. */\r\n renameView(args: { viewId: IdString, name: string }): Promise<void>;\r\n\r\n /** Set the name of a view group. */\r\n renameViewGroup(args: { groupId: IdString, name: string }): Promise<void>;\r\n\r\n /** rename an existing tag. */\r\n renameTag(args: { oldName: TagName, newName: TagName }): Promise<void>;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewProps.js","sourceRoot":"","sources":["../../src/ViewProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAmJH;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAwC,EAAE,mBAA+B;IACxG,OAAO,OAAO,EAAE,EAAE,IAAI,mBAAmB,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAwC,EAAE,mBAA+B;IACtG,OAAO,OAAO,IAAI,EAAE,EAAE,EAAE,mBAAmB,EAAE,CAAC;AAChD,CAAC;AAmHD;;;GAGG;AACH,MAAM,KAAW,YAAY,CA0W5B;AA1WD,WAAiB,YAAY;IAE3B;;;;OAIG;IACU,oBAAO,GAAG,OAAO,CAAC;IAkC/B,qGAAqG;IACxF,0BAAa,GAAG,CAAC,EAAiB,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;AAgUnF,CAAC,EA1WgB,YAAY,KAAZ,YAAY,QA0W5B","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\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { AngleProps, Range3dProps, TransformProps, XYProps, XYZProps, YawPitchRollProps } from \"@itwin/core-geometry\";\r\nimport { CameraProps } from \"./Camera\";\r\nimport { DisplayStyleProps, DisplayStyleSettingsProps } from \"./DisplayStyleSettings\";\r\nimport { DefinitionElementProps, DisplayStyleLoadProps, ElementProps, RelatedElementProps, RenderTimelineProps, SheetProps, ViewAttachmentProps } from \"./ElementProps\";\r\nimport { EntityQueryParams } from \"./EntityProps\";\r\nimport { ModelProps } from \"./ModelProps\";\r\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\r\nimport { ViewDetails3dProps, ViewDetailsProps } from \"./ViewDetails\";\r\nimport { ThumbnailProps } from \"./Thumbnail\";\r\nimport { RenderSchedule } from \"./RenderSchedule\";\r\n\r\n/** The id of either an element or an entry in a ViewStore.\r\n * @public\r\n */\r\nexport type ViewIdString = Id64String; // should also include ViewStoreRpc.IdString when that's @public\r\n\r\n/** As part of a [[ViewStateProps]], describes the [[SpatialViewDefinition]] from which a [SectionDrawing]($backend) was generated.\r\n * @see [[SectionDrawingProps]]\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SectionDrawingViewProps {\r\n /** The Id of the spatial view from which the SectionDrawing was generated. */\r\n spatialView: Id64String;\r\n /** If true, the spatial view should be displayed in the context of the drawing view. */\r\n displaySpatialView: boolean;\r\n /** Transform from drawing coordinates to spatial coordinates. If undefined, use identity transform. */\r\n drawingToSpatialTransform?: TransformProps;\r\n}\r\n\r\n/** The response props from the getCustomViewState3dData RPC endpoint\r\n * @internal\r\n */\r\nexport interface CustomViewState3dProps {\r\n modelIds: CompressedId64Set;\r\n modelExtents: Range3dProps;\r\n categoryIds: CompressedId64Set;\r\n}\r\n\r\n/**\r\n * The options passed to the getCustomViewState3dData RPC endpoint.\r\n * @internal\r\n */\r\nexport interface CustomViewState3dCreatorOptions {\r\n modelIds?: CompressedId64Set;\r\n}\r\n\r\n/**\r\n * A result row from querying for subcategories\r\n * @internal\r\n */\r\nexport interface SubCategoryResultRow {\r\n parentId: Id64String;\r\n id: Id64String;\r\n appearance: SubCategoryAppearance.Props;\r\n}\r\n\r\n/**\r\n * Request props for the hydrateViewState RPC endpoint.\r\n * @internal\r\n */\r\nexport interface HydrateViewStateRequestProps {\r\n acsId?: string;\r\n notLoadedModelSelectorStateModels?: CompressedId64Set;\r\n sheetViewAttachmentIds?: CompressedId64Set;\r\n viewStateLoadProps?: ViewStateLoadProps;\r\n baseModelId?: Id64String;\r\n spatialViewId?: Id64String;\r\n}\r\n\r\n/** Response props from the hydrateViewState RPC endpoint.\r\n * @internal\r\n */\r\nexport interface HydrateViewStateResponseProps {\r\n acsElementProps?: ElementProps;\r\n modelSelectorStateModels?: ModelProps[];\r\n // cast this to viewAttachmentInfo[] on the frontend.\r\n sheetViewAttachmentProps?: ViewAttachmentProps[];\r\n sheetViewViews?: (ViewStateProps | undefined)[];\r\n baseModelProps?: ModelProps;\r\n spatialViewProps?: ViewStateProps;\r\n}\r\n\r\n/** Returned from [IModelDb.Views.getViewStateProps]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewStateProps {\r\n viewDefinitionProps: ViewDefinitionProps;\r\n categorySelectorProps: CategorySelectorProps;\r\n modelSelectorProps?: ModelSelectorProps;\r\n displayStyleProps: DisplayStyleProps;\r\n /** Sheet-specific properties, if this is a view of a [SheetModel]($backend). */\r\n sheetProps?: SheetProps;\r\n /** The Ids of the [ViewAttachment]($backend)s contained within the [SheetModel]($backend), if this is a sheet view. */\r\n sheetAttachments?: Id64Array;\r\n /** For a [DrawingViewState]($frontend), the extents of the [DrawingModel]($backend), used for determining the upper limits of the view's extents. */\r\n modelExtents?: Range3dProps;\r\n /** Information about the [SectionDrawing]($backend) relevant to displaying a drawing view. */\r\n sectionDrawing?: SectionDrawingViewProps;\r\n}\r\n\r\n/** Options for loading a [[ViewStateProps]] via [IModelConnection.Views.load]($frontend) or [IModelDb.Views.getViewStateProps]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewStateLoadProps {\r\n /** Options for loading the view's [[DisplayStyleProps]]. */\r\n displayStyle?: DisplayStyleLoadProps;\r\n\r\n /**\r\n * bindings for query-based selectors\r\n * @beta\r\n */\r\n queryBindings?: {\r\n modelSelector?: ViewStoreRpc.QueryBindings;\r\n categorySelector?: ViewStoreRpc.QueryBindings;\r\n };\r\n}\r\n\r\n/** Properties that define a ModelSelector\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelSelectorProps extends DefinitionElementProps {\r\n models: Id64Array;\r\n}\r\n\r\n/** Properties that define a CategorySelector\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CategorySelectorProps extends DefinitionElementProps {\r\n categories: Id64Array;\r\n}\r\n\r\n/** Parameters for performing a query on [ViewDefinition]($backend) classes.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewQueryParams extends EntityQueryParams {\r\n wantPrivate?: boolean;\r\n}\r\n\r\n/**\r\n * Helper to resolve navigation property ids represented as independent Id64Strings.\r\n * @internal\r\n *\r\n * @note This function will be redundant once all deprecated fields are removed. All calls to this function will need to be removed as well.\r\n */\r\nexport function resolveNavPropId(navProp: RelatedElementProps | undefined, deprecatedNavPropId: Id64String): Id64String {\r\n return navProp?.id ?? deprecatedNavPropId;\r\n}\r\n\r\n/**\r\n * Helper to resolve navigation properties represented as Id64Strings.\r\n * @internal\r\n *\r\n * @note This function will be redundant once all deprecated fields are removed. All calls to this function will need to be removed as well.\r\n */\r\nexport function resolveNavProp(navProp: RelatedElementProps | undefined, deprecatedNavPropId: Id64String): RelatedElementProps {\r\n return navProp ?? { id: deprecatedNavPropId };\r\n}\r\n\r\n/** Parameters used to construct a ViewDefinition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinitionProps extends DefinitionElementProps {\r\n /** The [[CategorySelector]] for this view. */\r\n categorySelector?: RelatedElementProps;\r\n\r\n /** The [[DisplayStyle]] for this view. */\r\n displayStyle?: RelatedElementProps;\r\n\r\n /** The Id of the [[CategorySelector]] for this view.\r\n * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `categorySelector` instead.\r\n */\r\n categorySelectorId: ViewIdString;\r\n /** The Id of the [[DisplayStyle]] for this view.\r\n * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `displayStyle` instead.\r\n */\r\n displayStyleId: ViewIdString;\r\n description?: string;\r\n jsonProperties?: {\r\n /** Additional properties of the view. */\r\n viewDetails?: ViewDetailsProps;\r\n };\r\n}\r\n\r\n/** Parameters to construct a ViewDefinition3d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinition3dProps extends ViewDefinitionProps {\r\n /** if true, camera is valid. */\r\n cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n origin: XYZProps;\r\n /** The extent of the view frustum. */\r\n extents: XYZProps;\r\n /** Rotation of the view frustum (could be undefined if going Matrix3d -> YawPitchRoll). */\r\n angles?: YawPitchRollProps;\r\n /** The camera used for this view. */\r\n camera: CameraProps;\r\n jsonProperties?: {\r\n /** Additional properties of the view. */\r\n viewDetails?: ViewDetails3dProps;\r\n };\r\n}\r\n\r\n/** Parameters to construct a SpatialViewDefinition\r\n * @public\r\n * @extensions\r\n */\r\nexport interface SpatialViewDefinitionProps extends ViewDefinition3dProps {\r\n /** The [[ModelSelector]] for this view. */\r\n modelSelector?: RelatedElementProps;\r\n\r\n /** The Id of the [[ModelSelector]] for this view.\r\n * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `modelSelector` instead.\r\n */\r\n modelSelectorId: ViewIdString;\r\n}\r\n\r\n/** Parameters used to construct a ViewDefinition2d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewDefinition2dProps extends ViewDefinitionProps {\r\n /** The base model displayed by this view. */\r\n baseModel?: RelatedElementProps;\r\n\r\n /** The Id of the base model displayed by this view.\r\n * @deprecated in 5.9 - will not be removed until after 2027-05-04. Use `baseModel` instead.\r\n */\r\n baseModelId: Id64String;\r\n origin: XYProps;\r\n delta: XYProps;\r\n angle: AngleProps;\r\n}\r\n\r\n/**\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystemProps extends ElementProps {\r\n type?: number;\r\n description?: string;\r\n}\r\n\r\n/** Properties of AuxCoordSystem2d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystem2dProps extends AuxCoordSystemProps {\r\n /** Origin of the AuxCoordSystem2d */\r\n origin?: XYProps;\r\n /** Rotation angle */\r\n angle?: AngleProps;\r\n}\r\n\r\n/** Properties of AuxCoordSystem3d\r\n * @public\r\n * @extensions\r\n */\r\nexport interface AuxCoordSystem3dProps extends AuxCoordSystemProps {\r\n /** Origin of the AuxCoordSystem3d */\r\n origin?: XYZProps;\r\n /** Yaw angle */\r\n yaw?: AngleProps;\r\n /** Pitch angle */\r\n pitch?: AngleProps;\r\n /** Roll angle */\r\n roll?: AngleProps;\r\n}\r\n\r\n/**\r\n * Access to a ViewStore from the frontend.\r\n * @beta\r\n */\r\nexport namespace ViewStoreRpc {\r\n\r\n /**\r\n * Version of the Rpc interface. If any methods or interfaces of this API change, this number should\r\n * be incremented according to the rules of semantic versioning. See .\\rpc\\README-RpcInterfaceVersioning.md for more information.\r\n * @internal\r\n */\r\n export const version = \"4.0.0\";\r\n\r\n /** an Id of a View, DisplayStyle, ModelSelector, CategorySelector, or Timeline in a ViewStore.\r\n * Will be a base-36 number with a leading \"@\".\r\n * @public\r\n */\r\n export type IdString = string;\r\n\r\n /**\r\n * A string identifying a group. This may either be a \"group name path\" or the RowString of a group (e.g. either \"group1/design/issues\" or \"@4e3\")\r\n * The syntax is not ambiguous because ViewStoreIdStrings always start with \"@\" and Group names can never contain \"@\".\r\n */\r\n export type ViewGroupSpec = IdString | ViewGroupPath;\r\n\r\n /** The name for a view. */\r\n export type ViewName = string;\r\n\r\n /** The name for a Tag. */\r\n export type TagName = string;\r\n\r\n /** The name of an \"owner\". Should come from the authentication system, so it will be guaranteed unique.\r\n * This name should be chosen by the user rather than their email address.\r\n */\r\n export type OwnerName = string;\r\n\r\n /** The path name of a view group (e.g. \"group1/design/issues\"). Does not include the \"root\" group. */\r\n export type ViewGroupPath = string;\r\n\r\n /** The name for a view group. */\r\n export type ViewGroupName = string;\r\n\r\n /** The name for a view group. */\r\n export type ClassFullName = string;\r\n\r\n /** Determine if a string is an Id of an entry in a ViewStore (base-36 integer with a leading \"@\") */\r\n export const isViewStoreId = (id?: ViewIdString) => true === id?.startsWith(\"@\");\r\n\r\n /** Parameters for querying for views in a ViewStore. */\r\n export interface QueryParams {\r\n /** a list of classFullNames to accept. If not present, all classes are returned. */\r\n readonly classNames?: ClassFullName[];\r\n /** Optional \"LIMIT\" clause to limit the number of views returned. */\r\n readonly limit?: number;\r\n /** Optional \"OFFSET\" clause. Only valid if Limit is also present. */\r\n readonly offset?: number;\r\n /** A string to filter view names. May include wildcards if the `nameCompare` uses LIKE or GLOB (see SQLite documentation for LIKE and GLOB). */\r\n readonly nameSearch?: string;\r\n /** The comparison operator for `nameSearch`. Default is `=` */\r\n readonly nameCompare?: \"GLOB\" | \"LIKE\" | \"NOT GLOB\" | \"NOT LIKE\" | \"=\" | \"<\" | \">\";\r\n /* the Id of the view group to query. If not present, the root group is used. There is no way to query for views from multiple view groups in one request. */\r\n readonly group?: IdString;\r\n /** A list of tags to filter views. If present, only views that have one or more of the tags will be returned. */\r\n readonly tags?: TagName[];\r\n /* The name of an owner for private views. If present, private views owned by the owner will also be returned. Shared views are always returned. */\r\n readonly owner?: OwnerName;\r\n }\r\n\r\n /** Parameters for specifying a Query to select Categories or Models. */\r\n export interface SelectorQuery {\r\n /**\r\n * The full ClassName from which to select. If this SelectorQuery is for Categories, this must be or derive from \"BisCore:Category\".\r\n * If this SelectorQuery is for Models, this must be or derive from \"BisCore:Model\".\r\n */\r\n from: ClassFullName;\r\n /** If true, only return instances of `from`. Otherwise, return instances of `from` and any subclasses of `from`. */\r\n only?: boolean;\r\n /**\r\n * filter for query. If present, only instances of `from` that satisfy the filter will be returned.\r\n * If not supplied, all instances of `from` are returned.\r\n * @note\r\n * This value is used into the ECQuery:`SELECT ECInstanceId FROM ${query.from} WHERE ${query.where}`.\r\n */\r\n where?: string;\r\n /** List of Model or Category ids to add to the query results.\r\n * @note This is only valid if there is a `where` clause. Otherwise all instances of `from` will be returned so there is no value in adding ids.\r\n */\r\n adds?: Id64Array | CompressedId64Set;\r\n /** List of Model or Category Ids to remove from the query results. */\r\n removes?: Id64Array | CompressedId64Set;\r\n }\r\n\r\n /** A Model or Category selector may either be a query or a list of Ids. */\r\n export type SelectorProps = { query: SelectorQuery, ids?: never } | { query?: never, ids: Id64Array | CompressedId64Set };\r\n\r\n /** Information about a View in a ViewStore. */\r\n export interface ViewInfo {\r\n /** The Id of the view. */\r\n id: IdString;\r\n /** The name of the view. */\r\n name?: ViewName;\r\n /** The name of the owner of the view. */\r\n owner?: OwnerName;\r\n /** The className of the view. */\r\n className: ClassFullName;\r\n /** The Id of the view group containing the view. */\r\n groupId: IdString;\r\n /** If true, the view is private (unshared) and will only be returned by queries that specify the owner's name. */\r\n isPrivate: boolean;\r\n /** The Id of a ModelSelector, if the view has one. */\r\n modelSelectorId?: IdString;\r\n /** The Id of the CategorySelector for this view. */\r\n categorySelectorId: IdString;\r\n /** The Id of a DisplayStyle for the view. */\r\n displayStyleId: IdString;\r\n /** a list of tags for the view. */\r\n tags?: TagName[];\r\n }\r\n\r\n /** Information about a ViewGroup in a ViewStore. */\r\n export interface ViewGroupInfo {\r\n /** The Id of this view group. */\r\n id: IdString;\r\n /** The name of this view group. */\r\n name: ViewGroupName;\r\n /** The Id of the parent of this view group. If undefined, this is the root group. */\r\n parent?: IdString;\r\n /** The Id of the default view for this view group. */\r\n defaultView?: IdString;\r\n }\r\n\r\n /** Arguments for adding a new view to a ViewStore. */\r\n export interface AddViewArgs {\r\n /** the properties of the ViewDefinition for the new view. */\r\n readonly viewDefinition: ViewDefinitionProps;\r\n\r\n /**\r\n * The properties of a category selector for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.categorySelector.id` is **not** a valid `IdString`.\r\n * In that case, a new category selector will be created with these properties and its Id will be used.\r\n * Otherwise, the categorySelector from the ViewDefinition is used. If it does not represent a valid category\r\n * selector, an error is thrown.\r\n */\r\n readonly categorySelectorProps?: CategorySelectorProps;\r\n\r\n /** The properties of a model selector for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.modelSelector.id` is **not** a valid `IdString`.\r\n * In that case, a new model selector will be created with these properties and its Id will be used.\r\n * Otherwise, the modelSelector from the ViewDefinition is used. If it does not represent a valid model selector,\r\n * an error is thrown.\r\n */\r\n readonly modelSelectorProps?: ModelSelectorProps;\r\n\r\n /** The properties of a display style for the new view.\r\n * @note This value is only used, and should only be present if `viewDefinition.displayStyle.id` is **not** a valid `IdString`.\r\n * In that case, a new display style will be created with these properties and its Id will be used.\r\n * Otherwise, the displayStyle from the ViewDefinition is used. If it does not represent a valid display style, an\r\n * error is thrown.\r\n */\r\n readonly displayStyleProps?: DisplayStyleProps;\r\n\r\n /* the owner of the view. Must be present if isPrivate is true. */\r\n readonly owner?: OwnerName;\r\n\r\n /* the Id of the view group for the view. If not present, the view is added to the root group. */\r\n readonly group?: IdString;\r\n\r\n /* if true, the view is private (unshared). */\r\n readonly isPrivate?: boolean;\r\n\r\n /* an optional list of tags for the view. */\r\n readonly tags?: TagName[];\r\n\r\n /** optional thumbnail for the view. */\r\n readonly thumbnail?: ThumbnailProps;\r\n }\r\n\r\n /** Argument for finding a category selector, model selector, display style, or timeline by name or Id. */\r\n export type NameOrId = { name: string, id?: never } | { id: IdString, name?: never };\r\n\r\n /** Bindings for parameterized values in where clause of SelectorQuery\r\n * @see[[ECSqlStatement.bindValues]]\r\n */\r\n export interface QueryBindings {\r\n bindings?: any[] | object;\r\n }\r\n\r\n /**\r\n * Methods for reading from a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreReader`. These\r\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\r\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\r\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\r\n * user only needs read permission to the ViewStore.\r\n */\r\n export interface Reader {\r\n /** Find all views owned by the supplied owner name. */\r\n findViewsByOwner(args: { owner: OwnerName }): Promise<ViewInfo[]>;\r\n\r\n /** Get a category selector by Id. Throws if it does not exist. */\r\n getCategorySelector(args: NameOrId & QueryBindings): Promise<CategorySelectorProps>;\r\n\r\n /** Get a display style by Id. Throws if it does not exist. */\r\n getDisplayStyle(args: NameOrId & { opts?: DisplayStyleLoadProps }): Promise<DisplayStyleProps>;\r\n\r\n /** Get a model selector by Id. Throws if it does not exist. */\r\n getModelSelector(args: NameOrId & QueryBindings): Promise<ModelSelectorProps>;\r\n\r\n /** Get a thumbnail for a view. */\r\n getThumbnail(args: { viewId: IdString }): Promise<ThumbnailProps | undefined>;\r\n\r\n /** Get a render timeline by Id. Throws if it does not exist. */\r\n getTimeline(args: NameOrId): Promise<RenderTimelineProps>;\r\n\r\n /** Get a view by name. The name can include the *view group path*, if no `groupId` is supplied. */\r\n getViewByName(arg: { name: ViewName, groupId?: IdString }): Promise<ViewInfo | undefined>;\r\n\r\n /** Get a view definition by viewId. Throws if it does not exist. */\r\n getViewDefinition(args: { viewId: IdString }): Promise<ViewDefinitionProps>;\r\n\r\n /** get the properties of a ViewGroup by id. This will include the defaultViewId, if one exists. */\r\n getViewGroupInfo(args: { groupId?: IdString }): Promise<ViewGroupInfo | undefined>;\r\n\r\n /** Get a list of ViewGroups that are children of the supplied parent. If no parent is supplied, the root group is used.\r\n * Each entry in the list includes the id and name of the ViewGroup.\r\n */\r\n getViewGroups(args: { parent?: ViewGroupSpec }): Promise<{ id: IdString, name: string }[]>;\r\n\r\n /** Get the ViewInfo for a view by Id. Returns undefined if the view does not exist. */\r\n getViewInfo(args: { viewId: IdString }): Promise<ViewInfo | undefined>;\r\n\r\n /** Query for a list of ViewInfos for views that match the supplied [[QueryParams]].\r\n * @note The array will be sorted by name, ascending. To limit the size of the array, supply `limit` and `offset` in the QueryParams.\r\n */\r\n queryViews(queryParams: QueryParams): Promise<ViewInfo[]>;\r\n }\r\n\r\n /**\r\n * Methods for writing to a ViewStore via Rpc from a frontend via `IModelConnection.views.viewsStoreWriter`. These\r\n * methods use the *current* ViewStore for the iModel, and attempt to load the default ViewStore if no ViewStore is\r\n * currently loaded. They will throw exceptions if the request cannot be fulfilled.\r\n * @note The user's accessToken is validated against the ViewStore for every request. For each of these methods, the\r\n * user must have write permission to the ViewStore.\r\n */\r\n export interface Writer {\r\n /**\r\n * Add a category selector to a ViewStore.\r\n * @returns The IdString of the new category selector.\r\n */\r\n addCategorySelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Add a display style to a ViewStore.\r\n * @returns The IdString of the new display style.\r\n */\r\n addDisplayStyle(args: { name?: string, className: string, settings: DisplayStyleSettingsProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /**\r\n * Add a model selector to a ViewStore.\r\n * @returns The IdString of the new model selector.\r\n */\r\n addModelSelector(args: { name?: string, selector: SelectorProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /**\r\n * Add a thumbnail for a view. If the view already has a thumbnail, it is replaced.\r\n * If a view is deleted, its thumbnail is also deleted.\r\n * @note The thumbnail must be a valid image in PNG or JPEG format.\r\n */\r\n addOrReplaceThumbnail(args: { viewId: IdString, thumbnail: ThumbnailProps }): Promise<void>;\r\n\r\n /** Add tags to a view. If the view already has tags, the new tags are appended to the existing tags. */\r\n addTagsToView(args: { viewId: IdString, tags: TagName[] }): Promise<void>;\r\n\r\n /** Add a render timeline to a ViewStore.\r\n * @returns The IdString of the new timeline.\r\n */\r\n addTimeline(args: { name?: string, timeline: RenderSchedule.ScriptProps, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Add a view to a ViewStore. If no group is supplied, the new view is added to the root view group.\r\n * @returns The IdString of the new view\r\n */\r\n addView(args: AddViewArgs): Promise<IdString>;\r\n\r\n /** Add a view group to a ViewStore. If no parent is supplied, the new group is added to the root view group.\r\n * @returns the IdString of new view group\r\n */\r\n addViewGroup(args: { name: string, parentId?: IdString, owner?: OwnerName }): Promise<IdString>;\r\n\r\n /** Change the default view for a view group. If no group is supplied, this changes the default view for the root view group. */\r\n changeDefaultViewId(args: { defaultView: IdString, group?: ViewGroupSpec }): Promise<void>;\r\n\r\n /** Delete the thumbnail for a view. */\r\n deleteThumbnail(args: { viewId: IdString }): Promise<void>;\r\n\r\n /**\r\n * Delete a view from a ViewStore. If this is the default view for a view group, it cannot be deleted until another\r\n * view is set as the default.\r\n * @note If this view references a category selector, model selector, or display style that is not referenced by any\r\n * other view, *and do not have a name*, they will each also be deleted. If the view has a thumbnail, it is also\r\n * deleted.\r\n */\r\n deleteView(args: { viewId: IdString }): Promise<void>;\r\n\r\n /** Delete a view group from a ViewStore. This will also delete all views in the group. */\r\n deleteViewGroup(args: { name: ViewGroupSpec }): Promise<void>;\r\n\r\n /** Delete a display style from a ViewStore. If the display style is referenced by any view, it cannot be deleted\r\n * and an exception will be thrown.\r\n */\r\n deleteDisplayStyle(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a model selector from a ViewStore. If the model selector is referenced by any view, it cannot be deleted\r\n * and an exception will be thrown. */\r\n deleteModelSelector(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a category selector from a ViewStore. If the category selector is referenced by any view, it cannot be\r\n * deleted and an exception will be thrown.\r\n */\r\n deleteCategorySelector(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a render timeline from a ViewStore. */\r\n deleteTimeline(args: { id: IdString }): Promise<void>;\r\n\r\n /** Delete a tag. This removes it from all views where it was used. */\r\n deleteTag(args: { name: TagName }): Promise<void>;\r\n\r\n /** remove a tag from a view. */\r\n removeTagFromView(args: { viewId: IdString, tag: TagName }): Promise<void>;\r\n\r\n /** Update the properties of a category selector. */\r\n updateCategorySelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\r\n\r\n /** Update the properties of a display style. */\r\n updateDisplayStyle(args: NameOrId & { className: string, settings: DisplayStyleSettingsProps }): Promise<void>;\r\n\r\n /** Update the properties of a model selector. */\r\n updateModelSelector(args: NameOrId & { selector: SelectorProps }): Promise<void>;\r\n\r\n /** Update the properties of a render timeline. */\r\n updateTimeline(args: NameOrId & { timeline: RenderSchedule.ScriptProps }): Promise<void>;\r\n\r\n /** Update the properties of a view definition. */\r\n updateViewDefinition(args: { viewId: IdString, viewDefinition: ViewDefinitionProps }): Promise<void>;\r\n\r\n /** Change a view from shared to private, or vice versa. If changing to private, the owner must be supplied. */\r\n updateViewShared(arg: { viewId: IdString, isShared: boolean, owner?: string }): Promise<void>;\r\n\r\n /** Set the name of a category selector. */\r\n renameCategorySelector(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a display style. */\r\n renameDisplayStyle(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a model selector. */\r\n renameModelSelector(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a render timeline. */\r\n renameTimeline(args: { id: IdString, name?: string }): Promise<void>;\r\n\r\n /** Set the name of a view. */\r\n renameView(args: { viewId: IdString, name: string }): Promise<void>;\r\n\r\n /** Set the name of a view group. */\r\n renameViewGroup(args: { groupId: IdString, name: string }): Promise<void>;\r\n\r\n /** rename an existing tag. */\r\n renameTag(args: { oldName: TagName, newName: TagName }): Promise<void>;\r\n }\r\n}\r\n"]}
@@ -16,7 +16,7 @@ export declare const aggregateLoad: {
16
16
  lastResponse: number;
17
17
  };
18
18
  /** @internal */
19
- export declare class ResponseLike implements Response {
19
+ export declare class ResponseLike {
20
20
  private _data;
21
21
  get body(): null;
22
22
  arrayBuffer(): Promise<ArrayBuffer>;
@@ -1 +1 @@
1
- {"version":3,"file":"RpcRequest.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcRequest.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAuB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAoB,eAAe,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAoB,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOlF,gBAAgB;AAChB,eAAO,MAAM,aAAa;;;CAAsC,CAAC;AAEjE,gBAAgB;AAChB,qBAAa,YAAa,YAAW,QAAQ;IAC3C,OAAO,CAAC,KAAK,CAAe;IAC5B,IAAW,IAAI,SAAmB;IACrB,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IACnC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IAC7B,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IACpB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IACpC,IAAW,QAAQ,YAAoB;IACvC,IAAW,OAAO,IAAI,OAAO,CAAoE;IACjG,IAAW,EAAE,IAAI,OAAO,CAAqD;IAC7E,IAAW,UAAU,YAAoB;IACzC,IAAW,MAAM,WAAkB;IACnC,IA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AgB,CAAC,eAAe,CAAC,CAAC,CAAC;oBACtC,aAAa,CAAC,WAAW,GAAG,GAAG,CAAC;oBAChC,MAAM;gBACR,CAAC;gBAED,KAAK,gBAAgB,CAAC,sBAAsB,CAAC;gBAC7C,KAAK,gBAAgB,CAAC,oBAAoB,CAAC;gBAC3C,KAAK,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC;oBAC7C,aAAa,CAAC,YAAY,GAAG,GAAG,CAAC;oBACjC,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC","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\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { BeEvent, BentleyStatus, Guid } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { BackendError, IModelError, NoContentError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcProtocolEvent, RpcRequestEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\r\nimport { RpcNotFoundResponse } from \"./RpcControl\";\r\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcManagedStatus, RpcProtocol, RpcProtocolVersion } from \"./RpcProtocol\";\r\nimport { CURRENT_REQUEST } from \"./RpcRegistry\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n// cspell:ignore csrf\r\n/* eslint-disable @typescript-eslint/no-deprecated */\r\n\r\n/** @internal */\r\nexport const aggregateLoad = { lastRequest: 0, lastResponse: 0 };\r\n\r\n/** @internal */\r\nexport class ResponseLike implements Response {\r\n private _data: Promise<any>;\r\n public get body() { return null; }\r\n public async arrayBuffer(): Promise<ArrayBuffer> { return this._data; }\r\n public async blob(): Promise<Blob> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public async formData(): Promise<FormData> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public async json(): Promise<any> { return this._data; }\r\n public async text(): Promise<string> { return this._data; }\r\n public get bodyUsed() { return false; }\r\n public get headers(): Headers { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public get ok(): boolean { return this.status >= 200 && this.status <= 299; }\r\n public get redirected() { return false; }\r\n public get status() { return 200; }\r\n public get statusText() { return \"\"; }\r\n public get trailer(): Promise<Headers> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public get type(): \"basic\" | \"cors\" | \"default\" | \"error\" | \"opaque\" | \"opaqueredirect\" { return \"basic\"; }\r\n public get url() { return \"\"; }\r\n public clone() { return { ...this }; }\r\n\r\n public constructor(data: any) {\r\n this._data = Promise.resolve(data);\r\n }\r\n}\r\n\r\n/** Supplies an IModelRpcProps for an RPC request.\r\n * @internal\r\n */\r\nexport type RpcRequestTokenSupplier_T = (request: RpcRequest) => IModelRpcProps | undefined;\r\n\r\n/** Supplies the initial retry interval for an RPC request.\r\n * @internal\r\n */\r\nexport type RpcRequestInitialRetryIntervalSupplier_T = (configuration: RpcConfiguration) => number;\r\n\r\n/** Notification callback for an RPC request.\r\n * @internal\r\n */\r\nexport type RpcRequestCallback_T = (request: RpcRequest) => void;\r\n\r\n/** Determines if caching is permitted for a RPC response.\r\n * @internal\r\n */\r\nexport type RpcResponseCachingCallback_T = (request: RpcRequest) => RpcResponseCacheControl;\r\n\r\n/** Runtime information related to the operation load of one or more RPC interfaces.\r\n * @internal\r\n */\r\nexport interface RpcOperationsProfile {\r\n readonly lastRequest: number;\r\n readonly lastResponse: number;\r\n}\r\n\r\n/** Handles RPC request events.\r\n * @internal\r\n */\r\nexport type RpcRequestEventHandler = (type: RpcRequestEvent, request: RpcRequest) => void;\r\n\r\n/** Resolves \"not found\" responses for RPC requests.\r\n * @internal\r\n */\r\nexport type RpcRequestNotFoundHandler = (request: RpcRequest, response: RpcNotFoundResponse, resubmit: () => void, reject: (reason?: any) => void) => void;\r\n\r\nclass Cancellable<T> {\r\n public promise: Promise<T | undefined>;\r\n public cancel() { }\r\n\r\n public constructor(task: Promise<T>) {\r\n this.promise = new Promise((resolve, reject) => {\r\n this.cancel = () => resolve(undefined);\r\n task.then(resolve, reject);\r\n });\r\n }\r\n}\r\n\r\n/** A RPC operation request.\r\n * @internal\r\n */\r\nexport abstract class RpcRequest<TResponse = any> {\r\n private static _activeRequests: Map<string, RpcRequest> = new Map();\r\n private _resolve: (value?: TResponse | PromiseLike<TResponse> | undefined) => void = () => undefined;\r\n protected _resolveRaw: (value?: Response | PromiseLike<Response> | undefined) => void = () => undefined;\r\n private _reject: (reason?: any) => void = () => undefined;\r\n private _rejectRaw: (reason?: any) => void = () => undefined;\r\n private _created: number = 0;\r\n private _lastSubmitted: number = 0;\r\n private _lastUpdated: number = 0;\r\n\r\n /** @internal */\r\n public _status: RpcRequestStatus = RpcRequestStatus.Unknown;\r\n\r\n /** @internal */\r\n public _extendedStatus: string = \"\";\r\n\r\n private _connecting: boolean = false;\r\n private _active: boolean = true;\r\n private _hasRawListener = false;\r\n private _raw: ArrayBuffer | string | undefined = undefined;\r\n private _sending?: Cancellable<number>;\r\n private _attempts = 0;\r\n private _retryAfter: number | null = null;\r\n private _transientFaults = 0;\r\n protected _response: Response | undefined = undefined;\r\n protected _rawPromise: Promise<Response | undefined>;\r\n public responseProtocolVersion = RpcProtocolVersion.None;\r\n\r\n /** All RPC requests that are currently in flight. */\r\n public static get activeRequests(): ReadonlyMap<string, RpcRequest> { return this._activeRequests; }\r\n\r\n /** Events raised by RpcRequest. See [[RpcRequestEvent]] */\r\n public static readonly events: BeEvent<RpcRequestEventHandler> = new BeEvent();\r\n\r\n /** Resolvers for \"not found\" requests. See [[RpcRequestNotFoundHandler]] */\r\n public static readonly notFoundHandlers: BeEvent<RpcRequestNotFoundHandler> = new BeEvent();\r\n\r\n /** The aggregate operations profile of all active RPC interfaces. */\r\n public static get aggregateLoad(): RpcOperationsProfile { return aggregateLoad; }\r\n\r\n /**\r\n * The request for the current RPC operation.\r\n * @note The return value of this function is only reliable if program control was received from a RPC interface class member function that directly returns the result of calling RpcInterface.forward.\r\n */\r\n public static current(context: RpcInterface): RpcRequest {\r\n return (context as any)[CURRENT_REQUEST];\r\n }\r\n\r\n /** The unique identifier of this request. */\r\n public readonly id: string;\r\n\r\n /** The operation for this request. */\r\n public readonly operation: RpcOperation;\r\n\r\n /** The parameters for this request. */\r\n public parameters: any[];\r\n\r\n /** The RPC client instance for this request. */\r\n public readonly client: RpcInterface;\r\n\r\n /** Convenience access to the protocol of this request. */\r\n public readonly protocol: RpcProtocol;\r\n\r\n /** The implementation response for this request. */\r\n public readonly response: Promise<TResponse | undefined>;\r\n\r\n /** The status of this request. */\r\n public get status() { return this._status; }\r\n\r\n /** Extended status information for this request (if available). */\r\n public get extendedStatus() { return this._extendedStatus; }\r\n\r\n /** The last submission for this request. */\r\n public get lastSubmitted() { return this._lastSubmitted; }\r\n\r\n /** The last status update received for this request. */\r\n public get lastUpdated() { return this._lastUpdated; }\r\n\r\n /** The target interval (in milliseconds) between submission attempts for this request. */\r\n public retryInterval: number;\r\n\r\n /** Whether a connection is active for this request. */\r\n public get connecting() { return this._connecting; }\r\n\r\n /** Whether this request is pending. */\r\n public get pending(): boolean {\r\n switch (this.status) {\r\n case RpcRequestStatus.Submitted:\r\n case RpcRequestStatus.Pending: {\r\n return true;\r\n }\r\n\r\n default: {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n /** The elapsed time for this request. */\r\n public get elapsed(): number {\r\n return this._lastUpdated - this._created;\r\n }\r\n\r\n /** A protocol-specific path identifier for this request. */\r\n public path: string;\r\n\r\n /** A protocol-specific method identifier for this request. */\r\n public method: string;\r\n\r\n /** An attempt-specific value for when to next retry this request. */\r\n public get retryAfter() { return this._retryAfter; }\r\n\r\n /** Finds the first parameter of a given structural type if present. */\r\n public findParameterOfType<T>(requiredProperties: { [index: string]: string }): T | undefined {\r\n for (const param of this.parameters) {\r\n if (typeof (param) === \"object\" && param !== null) {\r\n for (const prop of Object.getOwnPropertyNames(requiredProperties)) {\r\n if (prop in param && typeof (param[prop]) === requiredProperties[prop]) {\r\n return param;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Finds the first IModelRpcProps parameter if present. */\r\n public findTokenPropsParameter(): IModelRpcProps | undefined {\r\n return this.findParameterOfType({ iModelId: \"string\" });\r\n\r\n }\r\n\r\n /** The raw implementation response for this request. */\r\n public get rawResponse(): Promise<Response | undefined> {\r\n this._hasRawListener = true;\r\n return this._rawPromise;\r\n }\r\n\r\n /** Constructs an RPC request. */\r\n public constructor(client: RpcInterface, operation: string, parameters: any[]) {\r\n this._created = new Date().getTime();\r\n this.path = \"\";\r\n this.method = \"\";\r\n this.client = client;\r\n this.protocol = client.configuration.protocol;\r\n this.operation = RpcOperation.lookup(client.constructor as any, operation);\r\n this.parameters = parameters;\r\n this.retryInterval = this.operation.policy.retryInterval(client.configuration);\r\n this.response = new Promise((resolve, reject) => {\r\n this._resolve = resolve;\r\n this._reject = reject;\r\n });\r\n\r\n this._rawPromise = new Promise((resolve, reject) => {\r\n this._resolveRaw = resolve;\r\n this._rejectRaw = reject;\r\n });\r\n\r\n this.id = RpcConfiguration.requestContext.getId(this) || Guid.createValue();\r\n this.setStatus(RpcRequestStatus.Created);\r\n this.operation.policy.requestCallback(this);\r\n }\r\n\r\n /** Override to send the request. */\r\n protected abstract send(): Promise<number>;\r\n\r\n /** Override to load response value. */\r\n protected abstract load(): Promise<RpcSerializedValue>;\r\n\r\n /** Override to set request header values. */\r\n protected abstract setHeader(name: string, value: string): void;\r\n\r\n /** Sets the last updated time for the request. */\r\n protected setLastUpdatedTime() {\r\n this._lastUpdated = new Date().getTime();\r\n }\r\n\r\n protected computeRetryAfter(attempts: number) {\r\n return (((Math.pow(2, attempts) - 1) / 2) * 500) + 500;\r\n }\r\n\r\n protected recordTransientFault() {\r\n ++this._transientFaults;\r\n }\r\n\r\n protected resetTransientFaultCount() {\r\n this._transientFaults = 0;\r\n }\r\n\r\n protected supportsStatusCategory() {\r\n if (!this.protocol.supportsStatusCategory) {\r\n return false;\r\n }\r\n\r\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.responseProtocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;\r\n }\r\n\r\n /* @internal */\r\n public cancel() {\r\n if (typeof (this._sending) === \"undefined\") {\r\n return;\r\n }\r\n\r\n this._sending.cancel();\r\n this._sending = undefined;\r\n\r\n this._connecting = false;\r\n RpcRequest._activeRequests.delete(this.id);\r\n this.setStatus(RpcRequestStatus.Cancelled);\r\n }\r\n\r\n /* @internal */\r\n public async submit(): Promise<void> {\r\n if (!this._active)\r\n return;\r\n\r\n this._lastSubmitted = new Date().getTime();\r\n this._retryAfter = null;\r\n ++this._attempts;\r\n\r\n if (this.status === RpcRequestStatus.Created || this.status === RpcRequestStatus.NotFound || this.status === RpcRequestStatus.Cancelled) {\r\n this.setStatus(RpcRequestStatus.Submitted);\r\n }\r\n\r\n try {\r\n this._connecting = true;\r\n RpcRequest._activeRequests.set(this.id, this);\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestCreated, this);\r\n this._sending = new Cancellable(this.setHeaders().then(async () => this.send()));\r\n this.operation.policy.sentCallback(this);\r\n\r\n const response = await this._sending.promise;\r\n if (typeof (response) === \"undefined\") {\r\n return;\r\n }\r\n this._sending = undefined;\r\n\r\n const status = this.protocol.getStatus(response);\r\n\r\n if (this._hasRawListener && status === RpcRequestStatus.Resolved && typeof (this._response) !== \"undefined\") {\r\n this._connecting = false;\r\n RpcRequest._activeRequests.delete(this.id);\r\n this.resolveRaw();\r\n } else {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoading, this);\r\n\r\n if (status === RpcRequestStatus.Unknown) {\r\n this._connecting = false;\r\n RpcRequest._activeRequests.delete(this.id);\r\n this.handleUnknownResponse(response);\r\n return;\r\n }\r\n\r\n const value = await this.load();\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoaded, this);\r\n RpcRequest._activeRequests.delete(this.id);\r\n this._connecting = false;\r\n this.handleResponse(response, value);\r\n }\r\n } catch (err) {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ConnectionErrorReceived, this, err);\r\n RpcRequest._activeRequests.delete(this.id);\r\n this._connecting = false;\r\n this.reject(err);\r\n }\r\n }\r\n\r\n protected handleUnknownResponse(code: number) {\r\n this.reject(new IModelError(BentleyStatus.ERROR, `Unknown response ${code}.`));\r\n }\r\n\r\n private handleResponse(code: number, value: RpcSerializedValue) {\r\n const protocolStatus = this.protocol.getStatus(code);\r\n const status = this.transformResponseStatus(protocolStatus, value);\r\n\r\n if (RpcRequestStatus.isTransientError(status)) {\r\n return this.handleTransientError(status);\r\n }\r\n\r\n switch (status) {\r\n case RpcRequestStatus.Resolved: {\r\n return this.handleResolved(value);\r\n }\r\n\r\n case RpcRequestStatus.Rejected: {\r\n return this.handleRejected(value);\r\n }\r\n\r\n case RpcRequestStatus.Pending: {\r\n return this.setPending(status, value.objects);\r\n }\r\n\r\n case RpcRequestStatus.NotFound: {\r\n return this.handleNotFound(status, value);\r\n }\r\n\r\n case RpcRequestStatus.NoContent: {\r\n return this.handleNoContent();\r\n }\r\n }\r\n }\r\n\r\n private transformResponseStatus(protocolStatus: RpcRequestStatus, value: RpcSerializedValue): RpcRequestStatus {\r\n if (!this.supportsStatusCategory()) {\r\n return protocolStatus;\r\n }\r\n\r\n let status = protocolStatus;\r\n\r\n if (protocolStatus === RpcRequestStatus.Pending) {\r\n status = RpcRequestStatus.Rejected;\r\n } else if (protocolStatus === RpcRequestStatus.NotFound) {\r\n status = RpcRequestStatus.Rejected;\r\n } else if (protocolStatus === RpcRequestStatus.Unknown) {\r\n status = RpcRequestStatus.Rejected;\r\n }\r\n\r\n if (value.objects.indexOf(\"iTwinRpcCoreResponse\") !== -1 && value.objects.indexOf(\"managedStatus\") !== -1) {\r\n const managedStatus: RpcManagedStatus = JSON.parse(value.objects);\r\n value.objects = managedStatus.responseValue as string;\r\n\r\n if (managedStatus.managedStatus === \"pending\") {\r\n status = RpcRequestStatus.Pending;\r\n } else if (managedStatus.managedStatus === \"notFound\") {\r\n status = RpcRequestStatus.NotFound;\r\n }\r\n }\r\n\r\n return status;\r\n }\r\n\r\n private handleResolved(value: RpcSerializedValue) {\r\n try {\r\n this._raw = value.objects;\r\n const result: TResponse = RpcMarshaling.deserialize(this.protocol, value);\r\n\r\n if (ArrayBuffer.isView(result)) {\r\n this._raw = result.buffer;\r\n }\r\n\r\n return this.resolve(result);\r\n } catch (err) {\r\n return this.reject(err);\r\n }\r\n }\r\n\r\n private handleRejected(value: RpcSerializedValue) {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorReceived, this);\r\n\r\n try {\r\n const error = RpcMarshaling.deserialize(this.protocol, value);\r\n const hasInfo = error && typeof (error) === \"object\" && error.hasOwnProperty(\"name\") && error.hasOwnProperty(\"message\");\r\n const name = hasInfo ? error.name : \"\";\r\n const message = hasInfo ? error.message : \"\";\r\n const errorNumber = (hasInfo && error.hasOwnProperty(\"errorNumber\")) ? error.errorNumber : BentleyStatus.ERROR;\r\n return this.reject(new BackendError(errorNumber, name, message, () => error));\r\n } catch (err) {\r\n return this.reject(err);\r\n }\r\n }\r\n\r\n private handleNoContent() {\r\n return this.reject(new NoContentError());\r\n }\r\n\r\n private handleNotFound(status: RpcRequestStatus, value: RpcSerializedValue) {\r\n if (RpcRequest.notFoundHandlers.numberOfListeners === 0)\r\n this.handleRejected(value);\r\n\r\n const response = RpcMarshaling.deserialize(this.protocol, value);\r\n this.setStatus(status);\r\n\r\n let resubmitted = false;\r\n RpcRequest.notFoundHandlers.raiseEvent(this, response, () => {\r\n if (resubmitted)\r\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\r\n\r\n resubmitted = true;\r\n void this.submit();\r\n }, (reason: any) => reason ? this.reject(reason) : this.handleRejected(value));\r\n return;\r\n }\r\n\r\n private resolve(result: TResponse): void {\r\n if (!this._active)\r\n return;\r\n\r\n this._active = false;\r\n this.setLastUpdatedTime();\r\n this._resolve(result);\r\n\r\n if (this._hasRawListener) {\r\n if (typeof (this._raw) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\r\n }\r\n\r\n this._resolveRaw(new ResponseLike(this._raw));\r\n }\r\n\r\n this.setStatus(RpcRequestStatus.Resolved);\r\n this[Symbol.dispose]();\r\n }\r\n\r\n private resolveRaw() {\r\n if (typeof (this._response) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\r\n }\r\n\r\n this._active = false;\r\n this.setLastUpdatedTime();\r\n this._resolveRaw(this._response);\r\n this.setStatus(RpcRequestStatus.Resolved);\r\n this[Symbol.dispose]();\r\n }\r\n\r\n protected reject(reason: any): void {\r\n if (!this._active)\r\n return;\r\n\r\n this._active = false;\r\n this.setLastUpdatedTime();\r\n this._reject(reason);\r\n\r\n if (this._hasRawListener) {\r\n this._rejectRaw(reason);\r\n }\r\n\r\n this.setStatus(RpcRequestStatus.Rejected);\r\n this[Symbol.dispose]();\r\n }\r\n\r\n /** @internal */\r\n public [Symbol.dispose](): void {\r\n this.setStatus(RpcRequestStatus.Disposed);\r\n this._raw = undefined;\r\n this._response = undefined;\r\n\r\n const client = this.client as any;\r\n if (client[CURRENT_REQUEST] === this) {\r\n client[CURRENT_REQUEST] = undefined;\r\n }\r\n }\r\n\r\n private setPending(status: RpcRequestStatus.Pending, extendedStatus: string): void {\r\n if (!this._active)\r\n return;\r\n\r\n this.setLastUpdatedTime();\r\n this._extendedStatus = extendedStatus;\r\n this.setStatus(status);\r\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, this);\r\n }\r\n\r\n private handleTransientError(status: RpcRequestStatus) {\r\n if (!this._active)\r\n return;\r\n\r\n this.setLastUpdatedTime();\r\n this._retryAfter = this.computeRetryAfter(this._attempts - 1);\r\n\r\n if (this._transientFaults > this.protocol.configuration.transientFaultLimit) {\r\n this.reject(new IModelError(BentleyStatus.ERROR, `Exceeded transient fault limit.`));\r\n } else {\r\n this.setStatus(status);\r\n RpcRequest.events.raiseEvent(RpcRequestEvent.TransientErrorReceived, this);\r\n }\r\n }\r\n\r\n protected async setHeaders(): Promise<void> {\r\n const versionHeader = this.protocol.protocolVersionHeaderName;\r\n if (versionHeader && RpcProtocol.protocolVersion)\r\n this.setHeader(versionHeader, RpcProtocol.protocolVersion.toString());\r\n\r\n const headerNames = this.protocol.serializedClientRequestContextHeaderNames;\r\n const headerValues = await RpcConfiguration.requestContext.serialize(this);\r\n\r\n if (headerNames.id)\r\n this.setHeader(headerNames.id, headerValues.id || this.id); // Cannot be empty\r\n\r\n if (headerNames.applicationVersion)\r\n this.setHeader(headerNames.applicationVersion, headerValues.applicationVersion);\r\n\r\n if (headerNames.applicationId)\r\n this.setHeader(headerNames.applicationId, headerValues.applicationId);\r\n\r\n if (headerNames.sessionId)\r\n this.setHeader(headerNames.sessionId, headerValues.sessionId);\r\n\r\n if (headerNames.authorization && headerValues.authorization)\r\n this.setHeader(headerNames.authorization, headerValues.authorization);\r\n\r\n if (headerValues.csrfToken)\r\n this.setHeader(headerValues.csrfToken.headerName, headerValues.csrfToken.headerValue);\r\n }\r\n\r\n private setStatus(status: RpcRequestStatus): void {\r\n if (this._status === status)\r\n return;\r\n\r\n this._status = status;\r\n RpcRequest.events.raiseEvent(RpcRequestEvent.StatusChanged, this);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const initializeRpcRequest = (() => {\r\n let initialized = false;\r\n\r\n return () => {\r\n if (initialized) {\r\n return;\r\n }\r\n\r\n initialized = true;\r\n\r\n RpcRequest.events.addListener((type, request) => {\r\n if (type !== RpcRequestEvent.StatusChanged)\r\n return;\r\n\r\n switch (request.status) {\r\n case RpcRequestStatus.Submitted: {\r\n aggregateLoad.lastRequest = request.lastSubmitted;\r\n break;\r\n }\r\n\r\n case RpcRequestStatus.Pending:\r\n case RpcRequestStatus.Resolved:\r\n case RpcRequestStatus.Rejected: {\r\n aggregateLoad.lastResponse = request.lastUpdated;\r\n break;\r\n }\r\n }\r\n });\r\n\r\n RpcProtocol.events.addListener((type) => {\r\n const now = new Date().getTime();\r\n\r\n switch (type) {\r\n case RpcProtocolEvent.RequestReceived: {\r\n aggregateLoad.lastRequest = now;\r\n break;\r\n }\r\n\r\n case RpcProtocolEvent.BackendReportedPending:\r\n case RpcProtocolEvent.BackendErrorOccurred:\r\n case RpcProtocolEvent.BackendResponseCreated: {\r\n aggregateLoad.lastResponse = now;\r\n break;\r\n }\r\n }\r\n });\r\n };\r\n})();\r\n"]}
1
+ {"version":3,"file":"RpcRequest.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcRequest.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAA2B,MAAM,gBAAgB,CAAC;AAE9G,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAoB,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,yDAAyD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Q,IAAI,EAAE,CAAC;gBACb,KAAK,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;oBACtC,aAAa,CAAC,WAAW,GAAG,GAAG,CAAC;oBAChC,MAAM;gBACR,CAAC;gBAED,KAAK,gBAAgB,CAAC,sBAAsB,CAAC;gBAC7C,KAAK,gBAAgB,CAAC,oBAAoB,CAAC;gBAC3C,KAAK,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC;oBAC7C,aAAa,CAAC,YAAY,GAAG,GAAG,CAAC;oBACjC,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC","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\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { BeEvent, BentleyStatus, Guid } from \"@itwin/core-bentley\";\r\nimport { IModelRpcProps } from \"../../IModel\";\r\nimport { BackendError, IModelError, NoContentError } from \"../../IModelError\";\r\nimport { RpcInterface } from \"../../RpcInterface\";\r\nimport { RpcConfiguration } from \"./RpcConfiguration\";\r\nimport { RpcProtocolEvent, RpcRequestEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\r\nimport { RpcNotFoundResponse } from \"./RpcControl\";\r\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\r\nimport { RpcOperation } from \"./RpcOperation\";\r\nimport { RpcManagedStatus, RpcProtocol, RpcProtocolVersion } from \"./RpcProtocol\";\r\nimport { CURRENT_REQUEST } from \"./RpcRegistry\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n// cspell:ignore csrf\r\n/* eslint-disable @typescript-eslint/no-deprecated */\r\n\r\n/** @internal */\r\nexport const aggregateLoad = { lastRequest: 0, lastResponse: 0 };\r\n\r\n/** @internal */\r\nexport class ResponseLike {\r\n private _data: Promise<any>;\r\n public get body() { return null; }\r\n public async arrayBuffer(): Promise<ArrayBuffer> { return this._data; }\r\n public async blob(): Promise<Blob> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public async formData(): Promise<FormData> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public async json(): Promise<any> { return this._data; }\r\n public async text(): Promise<string> { return this._data; }\r\n public get bodyUsed() { return false; }\r\n public get headers(): Headers { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public get ok(): boolean { return this.status >= 200 && this.status <= 299; }\r\n public get redirected() { return false; }\r\n public get status() { return 200; }\r\n public get statusText() { return \"\"; }\r\n public get trailer(): Promise<Headers> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\r\n public get type(): \"basic\" | \"cors\" | \"default\" | \"error\" | \"opaque\" | \"opaqueredirect\" { return \"basic\"; }\r\n public get url() { return \"\"; }\r\n public clone() { return { ...this }; }\r\n\r\n public constructor(data: any) {\r\n this._data = Promise.resolve(data);\r\n }\r\n}\r\n\r\n/** Supplies an IModelRpcProps for an RPC request.\r\n * @internal\r\n */\r\nexport type RpcRequestTokenSupplier_T = (request: RpcRequest) => IModelRpcProps | undefined;\r\n\r\n/** Supplies the initial retry interval for an RPC request.\r\n * @internal\r\n */\r\nexport type RpcRequestInitialRetryIntervalSupplier_T = (configuration: RpcConfiguration) => number;\r\n\r\n/** Notification callback for an RPC request.\r\n * @internal\r\n */\r\nexport type RpcRequestCallback_T = (request: RpcRequest) => void;\r\n\r\n/** Determines if caching is permitted for a RPC response.\r\n * @internal\r\n */\r\nexport type RpcResponseCachingCallback_T = (request: RpcRequest) => RpcResponseCacheControl;\r\n\r\n/** Runtime information related to the operation load of one or more RPC interfaces.\r\n * @internal\r\n */\r\nexport interface RpcOperationsProfile {\r\n readonly lastRequest: number;\r\n readonly lastResponse: number;\r\n}\r\n\r\n/** Handles RPC request events.\r\n * @internal\r\n */\r\nexport type RpcRequestEventHandler = (type: RpcRequestEvent, request: RpcRequest) => void;\r\n\r\n/** Resolves \"not found\" responses for RPC requests.\r\n * @internal\r\n */\r\nexport type RpcRequestNotFoundHandler = (request: RpcRequest, response: RpcNotFoundResponse, resubmit: () => void, reject: (reason?: any) => void) => void;\r\n\r\nclass Cancellable<T> {\r\n public promise: Promise<T | undefined>;\r\n public cancel() { }\r\n\r\n public constructor(task: Promise<T>) {\r\n this.promise = new Promise((resolve, reject) => {\r\n this.cancel = () => resolve(undefined);\r\n task.then(resolve, reject);\r\n });\r\n }\r\n}\r\n\r\n/** A RPC operation request.\r\n * @internal\r\n */\r\nexport abstract class RpcRequest<TResponse = any> {\r\n private static _activeRequests: Map<string, RpcRequest> = new Map();\r\n private _resolve: (value?: TResponse | PromiseLike<TResponse> | undefined) => void = () => undefined;\r\n protected _resolveRaw: (value?: Response | PromiseLike<Response> | undefined) => void = () => undefined;\r\n private _reject: (reason?: any) => void = () => undefined;\r\n private _rejectRaw: (reason?: any) => void = () => undefined;\r\n private _created: number = 0;\r\n private _lastSubmitted: number = 0;\r\n private _lastUpdated: number = 0;\r\n\r\n /** @internal */\r\n public _status: RpcRequestStatus = RpcRequestStatus.Unknown;\r\n\r\n /** @internal */\r\n public _extendedStatus: string = \"\";\r\n\r\n private _connecting: boolean = false;\r\n private _active: boolean = true;\r\n private _hasRawListener = false;\r\n private _raw: ArrayBuffer | string | undefined = undefined;\r\n private _sending?: Cancellable<number>;\r\n private _attempts = 0;\r\n private _retryAfter: number | null = null;\r\n private _transientFaults = 0;\r\n protected _response: Response | undefined = undefined;\r\n protected _rawPromise: Promise<Response | undefined>;\r\n public responseProtocolVersion = RpcProtocolVersion.None;\r\n\r\n /** All RPC requests that are currently in flight. */\r\n public static get activeRequests(): ReadonlyMap<string, RpcRequest> { return this._activeRequests; }\r\n\r\n /** Events raised by RpcRequest. See [[RpcRequestEvent]] */\r\n public static readonly events: BeEvent<RpcRequestEventHandler> = new BeEvent();\r\n\r\n /** Resolvers for \"not found\" requests. See [[RpcRequestNotFoundHandler]] */\r\n public static readonly notFoundHandlers: BeEvent<RpcRequestNotFoundHandler> = new BeEvent();\r\n\r\n /** The aggregate operations profile of all active RPC interfaces. */\r\n public static get aggregateLoad(): RpcOperationsProfile { return aggregateLoad; }\r\n\r\n /**\r\n * The request for the current RPC operation.\r\n * @note The return value of this function is only reliable if program control was received from a RPC interface class member function that directly returns the result of calling RpcInterface.forward.\r\n */\r\n public static current(context: RpcInterface): RpcRequest {\r\n return (context as any)[CURRENT_REQUEST];\r\n }\r\n\r\n /** The unique identifier of this request. */\r\n public readonly id: string;\r\n\r\n /** The operation for this request. */\r\n public readonly operation: RpcOperation;\r\n\r\n /** The parameters for this request. */\r\n public parameters: any[];\r\n\r\n /** The RPC client instance for this request. */\r\n public readonly client: RpcInterface;\r\n\r\n /** Convenience access to the protocol of this request. */\r\n public readonly protocol: RpcProtocol;\r\n\r\n /** The implementation response for this request. */\r\n public readonly response: Promise<TResponse | undefined>;\r\n\r\n /** The status of this request. */\r\n public get status() { return this._status; }\r\n\r\n /** Extended status information for this request (if available). */\r\n public get extendedStatus() { return this._extendedStatus; }\r\n\r\n /** The last submission for this request. */\r\n public get lastSubmitted() { return this._lastSubmitted; }\r\n\r\n /** The last status update received for this request. */\r\n public get lastUpdated() { return this._lastUpdated; }\r\n\r\n /** The target interval (in milliseconds) between submission attempts for this request. */\r\n public retryInterval: number;\r\n\r\n /** Whether a connection is active for this request. */\r\n public get connecting() { return this._connecting; }\r\n\r\n /** Whether this request is pending. */\r\n public get pending(): boolean {\r\n switch (this.status) {\r\n case RpcRequestStatus.Submitted:\r\n case RpcRequestStatus.Pending: {\r\n return true;\r\n }\r\n\r\n default: {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n /** The elapsed time for this request. */\r\n public get elapsed(): number {\r\n return this._lastUpdated - this._created;\r\n }\r\n\r\n /** A protocol-specific path identifier for this request. */\r\n public path: string;\r\n\r\n /** A protocol-specific method identifier for this request. */\r\n public method: string;\r\n\r\n /** An attempt-specific value for when to next retry this request. */\r\n public get retryAfter() { return this._retryAfter; }\r\n\r\n /** Finds the first parameter of a given structural type if present. */\r\n public findParameterOfType<T>(requiredProperties: { [index: string]: string }): T | undefined {\r\n for (const param of this.parameters) {\r\n if (typeof (param) === \"object\" && param !== null) {\r\n for (const prop of Object.getOwnPropertyNames(requiredProperties)) {\r\n if (prop in param && typeof (param[prop]) === requiredProperties[prop]) {\r\n return param;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Finds the first IModelRpcProps parameter if present. */\r\n public findTokenPropsParameter(): IModelRpcProps | undefined {\r\n return this.findParameterOfType({ iModelId: \"string\" });\r\n\r\n }\r\n\r\n /** The raw implementation response for this request. */\r\n public get rawResponse(): Promise<Response | undefined> {\r\n this._hasRawListener = true;\r\n return this._rawPromise;\r\n }\r\n\r\n /** Constructs an RPC request. */\r\n public constructor(client: RpcInterface, operation: string, parameters: any[]) {\r\n this._created = new Date().getTime();\r\n this.path = \"\";\r\n this.method = \"\";\r\n this.client = client;\r\n this.protocol = client.configuration.protocol;\r\n this.operation = RpcOperation.lookup(client.constructor as any, operation);\r\n this.parameters = parameters;\r\n this.retryInterval = this.operation.policy.retryInterval(client.configuration);\r\n this.response = new Promise((resolve, reject) => {\r\n this._resolve = resolve;\r\n this._reject = reject;\r\n });\r\n\r\n this._rawPromise = new Promise((resolve, reject) => {\r\n this._resolveRaw = resolve;\r\n this._rejectRaw = reject;\r\n });\r\n\r\n this.id = RpcConfiguration.requestContext.getId(this) || Guid.createValue();\r\n this.setStatus(RpcRequestStatus.Created);\r\n this.operation.policy.requestCallback(this);\r\n }\r\n\r\n /** Override to send the request. */\r\n protected abstract send(): Promise<number>;\r\n\r\n /** Override to load response value. */\r\n protected abstract load(): Promise<RpcSerializedValue>;\r\n\r\n /** Override to set request header values. */\r\n protected abstract setHeader(name: string, value: string): void;\r\n\r\n /** Sets the last updated time for the request. */\r\n protected setLastUpdatedTime() {\r\n this._lastUpdated = new Date().getTime();\r\n }\r\n\r\n protected computeRetryAfter(attempts: number) {\r\n return (((Math.pow(2, attempts) - 1) / 2) * 500) + 500;\r\n }\r\n\r\n protected recordTransientFault() {\r\n ++this._transientFaults;\r\n }\r\n\r\n protected resetTransientFaultCount() {\r\n this._transientFaults = 0;\r\n }\r\n\r\n protected supportsStatusCategory() {\r\n if (!this.protocol.supportsStatusCategory) {\r\n return false;\r\n }\r\n\r\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.responseProtocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;\r\n }\r\n\r\n /* @internal */\r\n public cancel() {\r\n if (typeof (this._sending) === \"undefined\") {\r\n return;\r\n }\r\n\r\n this._sending.cancel();\r\n this._sending = undefined;\r\n\r\n this._connecting = false;\r\n RpcRequest._activeRequests.delete(this.id);\r\n this.setStatus(RpcRequestStatus.Cancelled);\r\n }\r\n\r\n /* @internal */\r\n public async submit(): Promise<void> {\r\n if (!this._active)\r\n return;\r\n\r\n this._lastSubmitted = new Date().getTime();\r\n this._retryAfter = null;\r\n ++this._attempts;\r\n\r\n if (this.status === RpcRequestStatus.Created || this.status === RpcRequestStatus.NotFound || this.status === RpcRequestStatus.Cancelled) {\r\n this.setStatus(RpcRequestStatus.Submitted);\r\n }\r\n\r\n try {\r\n this._connecting = true;\r\n RpcRequest._activeRequests.set(this.id, this);\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestCreated, this);\r\n this._sending = new Cancellable(this.setHeaders().then(async () => this.send()));\r\n this.operation.policy.sentCallback(this);\r\n\r\n const response = await this._sending.promise;\r\n if (typeof (response) === \"undefined\") {\r\n return;\r\n }\r\n this._sending = undefined;\r\n\r\n const status = this.protocol.getStatus(response);\r\n\r\n if (this._hasRawListener && status === RpcRequestStatus.Resolved && typeof (this._response) !== \"undefined\") {\r\n this._connecting = false;\r\n RpcRequest._activeRequests.delete(this.id);\r\n this.resolveRaw();\r\n } else {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoading, this);\r\n\r\n if (status === RpcRequestStatus.Unknown) {\r\n this._connecting = false;\r\n RpcRequest._activeRequests.delete(this.id);\r\n this.handleUnknownResponse(response);\r\n return;\r\n }\r\n\r\n const value = await this.load();\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoaded, this);\r\n RpcRequest._activeRequests.delete(this.id);\r\n this._connecting = false;\r\n this.handleResponse(response, value);\r\n }\r\n } catch (err) {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ConnectionErrorReceived, this, err);\r\n RpcRequest._activeRequests.delete(this.id);\r\n this._connecting = false;\r\n this.reject(err);\r\n }\r\n }\r\n\r\n protected handleUnknownResponse(code: number) {\r\n this.reject(new IModelError(BentleyStatus.ERROR, `Unknown response ${code}.`));\r\n }\r\n\r\n private handleResponse(code: number, value: RpcSerializedValue) {\r\n const protocolStatus = this.protocol.getStatus(code);\r\n const status = this.transformResponseStatus(protocolStatus, value);\r\n\r\n if (RpcRequestStatus.isTransientError(status)) {\r\n return this.handleTransientError(status);\r\n }\r\n\r\n switch (status) {\r\n case RpcRequestStatus.Resolved: {\r\n return this.handleResolved(value);\r\n }\r\n\r\n case RpcRequestStatus.Rejected: {\r\n return this.handleRejected(value);\r\n }\r\n\r\n case RpcRequestStatus.Pending: {\r\n return this.setPending(status, value.objects);\r\n }\r\n\r\n case RpcRequestStatus.NotFound: {\r\n return this.handleNotFound(status, value);\r\n }\r\n\r\n case RpcRequestStatus.NoContent: {\r\n return this.handleNoContent();\r\n }\r\n }\r\n }\r\n\r\n private transformResponseStatus(protocolStatus: RpcRequestStatus, value: RpcSerializedValue): RpcRequestStatus {\r\n if (!this.supportsStatusCategory()) {\r\n return protocolStatus;\r\n }\r\n\r\n let status = protocolStatus;\r\n\r\n if (protocolStatus === RpcRequestStatus.Pending) {\r\n status = RpcRequestStatus.Rejected;\r\n } else if (protocolStatus === RpcRequestStatus.NotFound) {\r\n status = RpcRequestStatus.Rejected;\r\n } else if (protocolStatus === RpcRequestStatus.Unknown) {\r\n status = RpcRequestStatus.Rejected;\r\n }\r\n\r\n if (value.objects.indexOf(\"iTwinRpcCoreResponse\") !== -1 && value.objects.indexOf(\"managedStatus\") !== -1) {\r\n const managedStatus: RpcManagedStatus = JSON.parse(value.objects);\r\n value.objects = managedStatus.responseValue as string;\r\n\r\n if (managedStatus.managedStatus === \"pending\") {\r\n status = RpcRequestStatus.Pending;\r\n } else if (managedStatus.managedStatus === \"notFound\") {\r\n status = RpcRequestStatus.NotFound;\r\n }\r\n }\r\n\r\n return status;\r\n }\r\n\r\n private handleResolved(value: RpcSerializedValue) {\r\n try {\r\n this._raw = value.objects;\r\n const result: TResponse = RpcMarshaling.deserialize(this.protocol, value);\r\n\r\n if (ArrayBuffer.isView(result)) {\r\n this._raw = result.buffer;\r\n }\r\n\r\n return this.resolve(result);\r\n } catch (err) {\r\n return this.reject(err);\r\n }\r\n }\r\n\r\n private handleRejected(value: RpcSerializedValue) {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorReceived, this);\r\n\r\n try {\r\n const error = RpcMarshaling.deserialize(this.protocol, value);\r\n const hasInfo = error && typeof (error) === \"object\" && error.hasOwnProperty(\"name\") && error.hasOwnProperty(\"message\");\r\n const name = hasInfo ? error.name : \"\";\r\n const message = hasInfo ? error.message : \"\";\r\n const errorNumber = (hasInfo && error.hasOwnProperty(\"errorNumber\")) ? error.errorNumber : BentleyStatus.ERROR;\r\n return this.reject(new BackendError(errorNumber, name, message, () => error));\r\n } catch (err) {\r\n return this.reject(err);\r\n }\r\n }\r\n\r\n private handleNoContent() {\r\n return this.reject(new NoContentError());\r\n }\r\n\r\n private handleNotFound(status: RpcRequestStatus, value: RpcSerializedValue) {\r\n if (RpcRequest.notFoundHandlers.numberOfListeners === 0)\r\n this.handleRejected(value);\r\n\r\n const response = RpcMarshaling.deserialize(this.protocol, value);\r\n this.setStatus(status);\r\n\r\n let resubmitted = false;\r\n RpcRequest.notFoundHandlers.raiseEvent(this, response, () => {\r\n if (resubmitted)\r\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\r\n\r\n resubmitted = true;\r\n void this.submit();\r\n }, (reason: any) => reason ? this.reject(reason) : this.handleRejected(value));\r\n return;\r\n }\r\n\r\n private resolve(result: TResponse): void {\r\n if (!this._active)\r\n return;\r\n\r\n this._active = false;\r\n this.setLastUpdatedTime();\r\n this._resolve(result);\r\n\r\n if (this._hasRawListener) {\r\n if (typeof (this._raw) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\r\n }\r\n\r\n this._resolveRaw(new ResponseLike(this._raw));\r\n }\r\n\r\n this.setStatus(RpcRequestStatus.Resolved);\r\n this[Symbol.dispose]();\r\n }\r\n\r\n private resolveRaw() {\r\n if (typeof (this._response) === \"undefined\") {\r\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\r\n }\r\n\r\n this._active = false;\r\n this.setLastUpdatedTime();\r\n this._resolveRaw(this._response);\r\n this.setStatus(RpcRequestStatus.Resolved);\r\n this[Symbol.dispose]();\r\n }\r\n\r\n protected reject(reason: any): void {\r\n if (!this._active)\r\n return;\r\n\r\n this._active = false;\r\n this.setLastUpdatedTime();\r\n this._reject(reason);\r\n\r\n if (this._hasRawListener) {\r\n this._rejectRaw(reason);\r\n }\r\n\r\n this.setStatus(RpcRequestStatus.Rejected);\r\n this[Symbol.dispose]();\r\n }\r\n\r\n /** @internal */\r\n public [Symbol.dispose](): void {\r\n this.setStatus(RpcRequestStatus.Disposed);\r\n this._raw = undefined;\r\n this._response = undefined;\r\n\r\n const client = this.client as any;\r\n if (client[CURRENT_REQUEST] === this) {\r\n client[CURRENT_REQUEST] = undefined;\r\n }\r\n }\r\n\r\n private setPending(status: RpcRequestStatus.Pending, extendedStatus: string): void {\r\n if (!this._active)\r\n return;\r\n\r\n this.setLastUpdatedTime();\r\n this._extendedStatus = extendedStatus;\r\n this.setStatus(status);\r\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, this);\r\n }\r\n\r\n private handleTransientError(status: RpcRequestStatus) {\r\n if (!this._active)\r\n return;\r\n\r\n this.setLastUpdatedTime();\r\n this._retryAfter = this.computeRetryAfter(this._attempts - 1);\r\n\r\n if (this._transientFaults > this.protocol.configuration.transientFaultLimit) {\r\n this.reject(new IModelError(BentleyStatus.ERROR, `Exceeded transient fault limit.`));\r\n } else {\r\n this.setStatus(status);\r\n RpcRequest.events.raiseEvent(RpcRequestEvent.TransientErrorReceived, this);\r\n }\r\n }\r\n\r\n protected async setHeaders(): Promise<void> {\r\n const versionHeader = this.protocol.protocolVersionHeaderName;\r\n if (versionHeader && RpcProtocol.protocolVersion)\r\n this.setHeader(versionHeader, RpcProtocol.protocolVersion.toString());\r\n\r\n const headerNames = this.protocol.serializedClientRequestContextHeaderNames;\r\n const headerValues = await RpcConfiguration.requestContext.serialize(this);\r\n\r\n if (headerNames.id)\r\n this.setHeader(headerNames.id, headerValues.id || this.id); // Cannot be empty\r\n\r\n if (headerNames.applicationVersion)\r\n this.setHeader(headerNames.applicationVersion, headerValues.applicationVersion);\r\n\r\n if (headerNames.applicationId)\r\n this.setHeader(headerNames.applicationId, headerValues.applicationId);\r\n\r\n if (headerNames.sessionId)\r\n this.setHeader(headerNames.sessionId, headerValues.sessionId);\r\n\r\n if (headerNames.authorization && headerValues.authorization)\r\n this.setHeader(headerNames.authorization, headerValues.authorization);\r\n\r\n if (headerValues.csrfToken)\r\n this.setHeader(headerValues.csrfToken.headerName, headerValues.csrfToken.headerValue);\r\n }\r\n\r\n private setStatus(status: RpcRequestStatus): void {\r\n if (this._status === status)\r\n return;\r\n\r\n this._status = status;\r\n RpcRequest.events.raiseEvent(RpcRequestEvent.StatusChanged, this);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const initializeRpcRequest = (() => {\r\n let initialized = false;\r\n\r\n return () => {\r\n if (initialized) {\r\n return;\r\n }\r\n\r\n initialized = true;\r\n\r\n RpcRequest.events.addListener((type, request) => {\r\n if (type !== RpcRequestEvent.StatusChanged)\r\n return;\r\n\r\n switch (request.status) {\r\n case RpcRequestStatus.Submitted: {\r\n aggregateLoad.lastRequest = request.lastSubmitted;\r\n break;\r\n }\r\n\r\n case RpcRequestStatus.Pending:\r\n case RpcRequestStatus.Resolved:\r\n case RpcRequestStatus.Rejected: {\r\n aggregateLoad.lastResponse = request.lastUpdated;\r\n break;\r\n }\r\n }\r\n });\r\n\r\n RpcProtocol.events.addListener((type) => {\r\n const now = new Date().getTime();\r\n\r\n switch (type) {\r\n case RpcProtocolEvent.RequestReceived: {\r\n aggregateLoad.lastRequest = now;\r\n break;\r\n }\r\n\r\n case RpcProtocolEvent.BackendReportedPending:\r\n case RpcProtocolEvent.BackendErrorOccurred:\r\n case RpcProtocolEvent.BackendResponseCreated: {\r\n aggregateLoad.lastResponse = now;\r\n break;\r\n }\r\n }\r\n });\r\n };\r\n})();\r\n"]}
@@ -26,7 +26,4 @@ export declare abstract class WebAppRpcLogging {
26
26
  protected logRequest(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest): void;
27
27
  protected logResponse(loggerCategory: string, message: string, object: WebAppRpcRequest | SerializedRpcRequest, status: number, elapsed: number): void;
28
28
  }
29
- declare global {
30
- var window: any;
31
- }
32
29
  //# sourceMappingURL=WebAppRpcLogging.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebAppRpcLogging.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/WebAppRpcLogging.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO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