@itwin/core-common 4.7.0-dev.0 → 4.7.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/lib/cjs/ChangesetProps.d.ts +3 -1
- package/lib/cjs/ChangesetProps.d.ts.map +1 -1
- package/lib/cjs/ChangesetProps.js +2 -0
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/QPoint.d.ts +4 -3
- package/lib/cjs/QPoint.d.ts.map +1 -1
- package/lib/cjs/QPoint.js +2 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts +41 -35
- package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +38 -17
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.d.ts +0 -38
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +0 -14
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.d.ts +0 -4
- package/lib/cjs/annotation/TextBlockGeometryProps.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.d.ts +0 -12
- package/lib/cjs/annotation/TextStyle.d.ts.map +1 -1
- package/lib/cjs/annotation/TextStyle.js +0 -4
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.d.ts +2 -4
- package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js +2 -4
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.d.ts +0 -2
- package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js +0 -2
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js +1 -2
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.d.ts +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts +1 -1
- package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +4 -2
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
- package/lib/cjs/tile/IModelTileIO.js +2 -2
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.d.ts +3 -1
- package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +9 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/ChangesetProps.d.ts +3 -1
- package/lib/esm/ChangesetProps.d.ts.map +1 -1
- package/lib/esm/ChangesetProps.js +2 -0
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/QPoint.d.ts +4 -3
- package/lib/esm/QPoint.d.ts.map +1 -1
- package/lib/esm/QPoint.js +2 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts +41 -35
- package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +38 -17
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.d.ts +0 -38
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlock.js +0 -14
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.d.ts +0 -4
- package/lib/esm/annotation/TextBlockGeometryProps.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextStyle.d.ts +0 -12
- package/lib/esm/annotation/TextStyle.d.ts.map +1 -1
- package/lib/esm/annotation/TextStyle.js +0 -4
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts +2 -4
- package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js +2 -4
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.d.ts +0 -2
- package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/esm/geometry/GeometryStream.js +0 -2
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js +1 -2
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.d.ts +1 -1
- package/lib/esm/rpc/core/RpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts +1 -1
- package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +4 -2
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +2 -2
- package/lib/esm/tile/IModelTileIO.js +2 -2
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.d.ts +3 -1
- package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
- package/lib/esm/tile/TileMetadata.js +9 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +8 -8
|
@@ -48,7 +48,7 @@ export interface RpcRequestFulfillment {
|
|
|
48
48
|
/** A protocol-specific status code value for the request. */
|
|
49
49
|
status: number;
|
|
50
50
|
retry?: string;
|
|
51
|
-
/** Whether to compress the result with one of the client's supported encodings. */
|
|
51
|
+
/** Whether to compress the result with one of the client's supported encodings. Defaults to true. */
|
|
52
52
|
allowCompression?: boolean;
|
|
53
53
|
}
|
|
54
54
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcProtocol.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcProtocol.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,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,oBAAe,GAAY,KAAK,CAAC;QAExC,0EAA0E;QACnE,eAAU,GAAY,KAAK,CAAC;QAEnC,gEAAgE;QACzD,2BAAsB,GAAY,KAAK,CAAC;QAkD7C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,gBAAgB;IACT,sBAAsB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAEnG,gBAAgB;IACT,oBAAoB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;IAE/F,gBAAgB;IACT,qBAAqB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAElG,gBAAgB;IACT,mBAAmB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;;AAjHhG,kCAkHC;AAjHC,+DAA+D;AACxC,kBAAM,GAAqC,IAAI,sBAAO,EAAE,AAAlD,CAAmD;AAEhF,oFAAoF;AAC7D,2BAAe,GAAW,kBAAkB,CAAC,wBAAwB,AAAtD,CAAuD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcConfiguration } from \"./RpcConfiguration\";\nimport { RpcProtocolEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\nimport { RpcNotFoundResponse } from \"./RpcControl\";\nimport { RpcInvocation, SerializedRpcActivity } from \"./RpcInvocation\";\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\nimport { RpcOperation } from \"./RpcOperation\";\nimport { RpcRequest } from \"./RpcRequest\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** A serialized RPC operation descriptor.\n * @internal\n */\nexport interface SerializedRpcOperation {\n interfaceDefinition: string;\n operationName: string;\n interfaceVersion: string;\n encodedRequest?: string;\n}\n\n/** A serialized RPC operation request.\n * @internal\n */\nexport interface SerializedRpcRequest extends SerializedRpcActivity {\n operation: SerializedRpcOperation;\n method: string;\n path: string;\n parameters: RpcSerializedValue;\n caching: RpcResponseCacheControl;\n ip?: string;\n protocolVersion?: number;\n parametersOverride?: any[];\n}\n\n/** An RPC operation request fulfillment.\n * @internal\n */\nexport interface RpcRequestFulfillment {\n /** The RPC interface for the request. */\n interfaceName: string;\n\n /** The id for the request. */\n id: string;\n\n /** The result for the request. */\n result: RpcSerializedValue;\n\n /** The un-serialized result for the request. */\n rawResult: any;\n\n /** A protocol-specific status code value for the request. */\n status: number;\n\n /* A protocol-specific value for retrying this request. */\n retry?: string;\n\n /** Whether to compress the result with one of the client's supported encodings. */\n allowCompression?: boolean;\n}\n\n/** @internal */\nexport namespace RpcRequestFulfillment {\n export async function forUnknownError(request: SerializedRpcRequest, error: any): Promise<RpcRequestFulfillment> {\n const result = RpcMarshaling.serialize(undefined, error);\n\n return {\n interfaceName: request.operation.interfaceDefinition,\n id: request.id,\n result,\n rawResult: error,\n status: RpcRequestStatus.Rejected,\n };\n }\n}\n\n/** Handles RPC protocol events.\n * @internal\n */\nexport type RpcProtocolEventHandler = (type: RpcProtocolEvent, object: RpcRequest | RpcInvocation, err?: any) => void;\n\n/** Documents changes to the RPC protocol version.\n * @internal\n */\nexport enum RpcProtocolVersion {\n None = 0,\n IntroducedNoContent = 1,\n IntroducedStatusCategory = 2\n}\n\n/**\n * A backend response that is handled internally by the RPC system.\n * @internal\n */\nexport interface RpcManagedStatus {\n iTwinRpcCoreResponse: true;\n managedStatus: \"pending\" | \"notFound\" | \"noContent\";\n responseValue: string | { message: string } | RpcNotFoundResponse;\n}\n\n/** An application protocol for an RPC interface.\n * @internal\n */\nexport abstract class RpcProtocol {\n /** Events raised by all protocols. See [[RpcProtocolEvent]] */\n public static readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\n\n /** A version code that identifies the RPC protocol capabilties of this endpoint. */\n public static readonly protocolVersion: number = RpcProtocolVersion.IntroducedStatusCategory;\n\n /** The name of the RPC protocol version header. */\n public protocolVersionHeaderName = \"\";\n\n /** Events raised by the protocol. See [[RpcProtocolEvent]] */\n public readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\n\n /** The configuration for the protocol. */\n public readonly configuration: RpcConfiguration;\n\n /** The RPC request class for this protocol. */\n public abstract readonly requestType: typeof RpcRequest;\n\n /** The RPC invocation class for this protocol. */\n public readonly invocationType: typeof RpcInvocation = RpcInvocation;\n\n public serializedClientRequestContextHeaderNames: SerializedRpcActivity = {\n /** The name of the request id header. */\n id: \"\",\n\n /** The name of the application id header */\n applicationId: \"\",\n\n /** The name of the version header. */\n applicationVersion: \"\",\n\n /** The name of the session id header */\n sessionId: \"\",\n\n /** The name of the authorization header. */\n authorization: \"\",\n };\n\n /** If greater than zero, specifies where to break large binary request payloads. */\n public transferChunkThreshold: number = 0;\n\n /** Used by protocols that can transmit stream values natively. */\n public preserveStreams: boolean = false;\n\n /** Used by protocols that can transmit IModelRpcProps values natively. */\n public checkToken: boolean = false;\n\n /** Used by protocols that support user-defined status codes. */\n public supportsStatusCategory: boolean = false;\n\n /** If checkToken is true, will be called on the backend to inflate the IModelRpcProps for each request. */\n public inflateToken(tokenFromBody: IModelRpcProps, _request: SerializedRpcRequest): IModelRpcProps { return tokenFromBody; }\n\n /** Override to supply the status corresponding to a protocol-specific code value. */\n public getStatus(code: number): RpcRequestStatus {\n return code;\n }\n\n /** Override to supply the protocol-specific code corresponding to a status value. */\n public getCode(status: RpcRequestStatus): number {\n return status;\n }\n\n /** Override to supply the protocol-specific path value for an RPC operation. */\n public supplyPathForOperation(operation: RpcOperation, _request: RpcRequest | undefined): string {\n return JSON.stringify(operation);\n }\n\n /** Override to supply the operation for a protocol-specific path value. */\n public getOperationFromPath(path: string): SerializedRpcOperation {\n return JSON.parse(path);\n }\n\n /** Obtains the implementation result on the backend for an RPC operation request. */\n public async fulfill(request: SerializedRpcRequest): Promise<RpcRequestFulfillment> {\n return new (this.invocationType)(this, request).fulfillment;\n }\n\n /** Serializes a request. */\n public async serialize(request: RpcRequest): Promise<SerializedRpcRequest> {\n const serializedContext = await RpcConfiguration.requestContext.serialize(request);\n return {\n ...serializedContext,\n operation: {\n interfaceDefinition: request.operation.interfaceDefinition.interfaceName,\n operationName: request.operation.operationName,\n interfaceVersion: request.operation.interfaceVersion,\n },\n method: request.method,\n path: request.path,\n parameters: RpcMarshaling.serialize(request.protocol, request.parameters),\n caching: RpcResponseCacheControl.None,\n protocolVersion: RpcProtocol.protocolVersion,\n };\n }\n\n /** Constructs a protocol. */\n public constructor(configuration: RpcConfiguration) {\n this.configuration = configuration;\n this.events.addListener((type, object) => RpcProtocol.events.raiseEvent(type, object));\n }\n\n /** @internal */\n public onRpcClientInitialized(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\n\n /** @internal */\n public onRpcImplInitialized(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\n\n /** @internal */\n public onRpcClientTerminated(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\n\n /** @internal */\n public onRpcImplTerminated(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RpcProtocol.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAG9C,yDAAsD;AACtD,iDAA6F;AAE7F,mDAAuE;AACvE,mDAAoE;AAwDpE,gBAAgB;AAChB,IAAiB,qBAAqB,CAYrC;AAZD,WAAiB,qBAAqB;IAC7B,KAAK,U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AAC;QAkD7C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,gBAAgB;IACT,sBAAsB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAEnG,gBAAgB;IACT,oBAAoB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;IAE/F,gBAAgB;IACT,qBAAqB,CAAC,WAAmC,EAAE,OAAqB,IAAU,CAAC;IAElG,gBAAgB;IACT,mBAAmB,CAAC,WAAmC,EAAE,KAAmB,IAAU,CAAC;;AAjHhG,kCAkHC;AAjHC,+DAA+D;AACxC,kBAAM,GAAqC,IAAI,sBAAO,EAAE,AAAlD,CAAmD;AAEhF,oFAAoF;AAC7D,2BAAe,GAAW,kBAAkB,CAAC,wBAAwB,AAAtD,CAAuD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { RpcInterface, RpcInterfaceDefinition } from \"../../RpcInterface\";\nimport { RpcConfiguration } from \"./RpcConfiguration\";\nimport { RpcProtocolEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\nimport { RpcNotFoundResponse } from \"./RpcControl\";\nimport { RpcInvocation, SerializedRpcActivity } from \"./RpcInvocation\";\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\nimport { RpcOperation } from \"./RpcOperation\";\nimport { RpcRequest } from \"./RpcRequest\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** A serialized RPC operation descriptor.\n * @internal\n */\nexport interface SerializedRpcOperation {\n interfaceDefinition: string;\n operationName: string;\n interfaceVersion: string;\n encodedRequest?: string;\n}\n\n/** A serialized RPC operation request.\n * @internal\n */\nexport interface SerializedRpcRequest extends SerializedRpcActivity {\n operation: SerializedRpcOperation;\n method: string;\n path: string;\n parameters: RpcSerializedValue;\n caching: RpcResponseCacheControl;\n ip?: string;\n protocolVersion?: number;\n parametersOverride?: any[];\n}\n\n/** An RPC operation request fulfillment.\n * @internal\n */\nexport interface RpcRequestFulfillment {\n /** The RPC interface for the request. */\n interfaceName: string;\n\n /** The id for the request. */\n id: string;\n\n /** The result for the request. */\n result: RpcSerializedValue;\n\n /** The un-serialized result for the request. */\n rawResult: any;\n\n /** A protocol-specific status code value for the request. */\n status: number;\n\n /* A protocol-specific value for retrying this request. */\n retry?: string;\n\n /** Whether to compress the result with one of the client's supported encodings. Defaults to true. */\n allowCompression?: boolean;\n}\n\n/** @internal */\nexport namespace RpcRequestFulfillment {\n export async function forUnknownError(request: SerializedRpcRequest, error: any): Promise<RpcRequestFulfillment> {\n const result = RpcMarshaling.serialize(undefined, error);\n\n return {\n interfaceName: request.operation.interfaceDefinition,\n id: request.id,\n result,\n rawResult: error,\n status: RpcRequestStatus.Rejected,\n };\n }\n}\n\n/** Handles RPC protocol events.\n * @internal\n */\nexport type RpcProtocolEventHandler = (type: RpcProtocolEvent, object: RpcRequest | RpcInvocation, err?: any) => void;\n\n/** Documents changes to the RPC protocol version.\n * @internal\n */\nexport enum RpcProtocolVersion {\n None = 0,\n IntroducedNoContent = 1,\n IntroducedStatusCategory = 2\n}\n\n/**\n * A backend response that is handled internally by the RPC system.\n * @internal\n */\nexport interface RpcManagedStatus {\n iTwinRpcCoreResponse: true;\n managedStatus: \"pending\" | \"notFound\" | \"noContent\";\n responseValue: string | { message: string } | RpcNotFoundResponse;\n}\n\n/** An application protocol for an RPC interface.\n * @internal\n */\nexport abstract class RpcProtocol {\n /** Events raised by all protocols. See [[RpcProtocolEvent]] */\n public static readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\n\n /** A version code that identifies the RPC protocol capabilties of this endpoint. */\n public static readonly protocolVersion: number = RpcProtocolVersion.IntroducedStatusCategory;\n\n /** The name of the RPC protocol version header. */\n public protocolVersionHeaderName = \"\";\n\n /** Events raised by the protocol. See [[RpcProtocolEvent]] */\n public readonly events: BeEvent<RpcProtocolEventHandler> = new BeEvent();\n\n /** The configuration for the protocol. */\n public readonly configuration: RpcConfiguration;\n\n /** The RPC request class for this protocol. */\n public abstract readonly requestType: typeof RpcRequest;\n\n /** The RPC invocation class for this protocol. */\n public readonly invocationType: typeof RpcInvocation = RpcInvocation;\n\n public serializedClientRequestContextHeaderNames: SerializedRpcActivity = {\n /** The name of the request id header. */\n id: \"\",\n\n /** The name of the application id header */\n applicationId: \"\",\n\n /** The name of the version header. */\n applicationVersion: \"\",\n\n /** The name of the session id header */\n sessionId: \"\",\n\n /** The name of the authorization header. */\n authorization: \"\",\n };\n\n /** If greater than zero, specifies where to break large binary request payloads. */\n public transferChunkThreshold: number = 0;\n\n /** Used by protocols that can transmit stream values natively. */\n public preserveStreams: boolean = false;\n\n /** Used by protocols that can transmit IModelRpcProps values natively. */\n public checkToken: boolean = false;\n\n /** Used by protocols that support user-defined status codes. */\n public supportsStatusCategory: boolean = false;\n\n /** If checkToken is true, will be called on the backend to inflate the IModelRpcProps for each request. */\n public inflateToken(tokenFromBody: IModelRpcProps, _request: SerializedRpcRequest): IModelRpcProps { return tokenFromBody; }\n\n /** Override to supply the status corresponding to a protocol-specific code value. */\n public getStatus(code: number): RpcRequestStatus {\n return code;\n }\n\n /** Override to supply the protocol-specific code corresponding to a status value. */\n public getCode(status: RpcRequestStatus): number {\n return status;\n }\n\n /** Override to supply the protocol-specific path value for an RPC operation. */\n public supplyPathForOperation(operation: RpcOperation, _request: RpcRequest | undefined): string {\n return JSON.stringify(operation);\n }\n\n /** Override to supply the operation for a protocol-specific path value. */\n public getOperationFromPath(path: string): SerializedRpcOperation {\n return JSON.parse(path);\n }\n\n /** Obtains the implementation result on the backend for an RPC operation request. */\n public async fulfill(request: SerializedRpcRequest): Promise<RpcRequestFulfillment> {\n return new (this.invocationType)(this, request).fulfillment;\n }\n\n /** Serializes a request. */\n public async serialize(request: RpcRequest): Promise<SerializedRpcRequest> {\n const serializedContext = await RpcConfiguration.requestContext.serialize(request);\n return {\n ...serializedContext,\n operation: {\n interfaceDefinition: request.operation.interfaceDefinition.interfaceName,\n operationName: request.operation.operationName,\n interfaceVersion: request.operation.interfaceVersion,\n },\n method: request.method,\n path: request.path,\n parameters: RpcMarshaling.serialize(request.protocol, request.parameters),\n caching: RpcResponseCacheControl.None,\n protocolVersion: RpcProtocol.protocolVersion,\n };\n }\n\n /** Constructs a protocol. */\n public constructor(configuration: RpcConfiguration) {\n this.configuration = configuration;\n this.events.addListener((type, object) => RpcProtocol.events.raiseEvent(type, object));\n }\n\n /** @internal */\n public onRpcClientInitialized(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\n\n /** @internal */\n public onRpcImplInitialized(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\n\n /** @internal */\n public onRpcClientTerminated(_definition: RpcInterfaceDefinition, _client: RpcInterface): void { }\n\n /** @internal */\n public onRpcImplTerminated(_definition: RpcInterfaceDefinition, _impl: RpcInterface): void { }\n}\n"]}
|
|
@@ -66,7 +66,7 @@ export type RpcRequestEventHandler = (type: RpcRequestEvent, request: RpcRequest
|
|
|
66
66
|
/** Resolves "not found" responses for RPC requests.
|
|
67
67
|
* @internal
|
|
68
68
|
*/
|
|
69
|
-
export type RpcRequestNotFoundHandler = (request: RpcRequest, response: RpcNotFoundResponse, resubmit: () => void, reject: (reason
|
|
69
|
+
export type RpcRequestNotFoundHandler = (request: RpcRequest, response: RpcNotFoundResponse, resubmit: () => void, reject: (reason?: any) => void) => void;
|
|
70
70
|
/** A RPC operation request.
|
|
71
71
|
* @internal
|
|
72
72
|
*/
|
|
@@ -1 +1 @@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O,CAAC,uBAAuB;IA6B/B,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,OAAO;IAoBf,OAAO,CAAC,UAAU;IAYlB,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI;IAgBnC,gBAAgB;IACT,OAAO,IAAI,IAAI;IAWtB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,oBAAoB;cAeZ,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA2B3C,OAAO,CAAC,SAAS;CAOlB;AAED,gBAAgB;AAChB,eAAO,MAAM,oBAAoB,YA+C7B,CAAC"}
|
|
@@ -324,6 +324,8 @@ class RpcRequest {
|
|
|
324
324
|
return this.reject(new IModelError_1.NoContentError());
|
|
325
325
|
}
|
|
326
326
|
handleNotFound(status, value) {
|
|
327
|
+
if (RpcRequest.notFoundHandlers.numberOfListeners === 0)
|
|
328
|
+
this.handleRejected(value);
|
|
327
329
|
const response = RpcMarshaling_1.RpcMarshaling.deserialize(this.protocol, value);
|
|
328
330
|
this.setStatus(status);
|
|
329
331
|
let resubmitted = false;
|
|
@@ -331,8 +333,8 @@ class RpcRequest {
|
|
|
331
333
|
if (resubmitted)
|
|
332
334
|
throw new IModelError_1.IModelError(core_bentley_1.BentleyStatus.ERROR, `Already resubmitted using this handler.`);
|
|
333
335
|
resubmitted = true;
|
|
334
|
-
this.submit();
|
|
335
|
-
}, (reason) => this.reject(reason));
|
|
336
|
+
void this.submit();
|
|
337
|
+
}, (reason) => reason ? this.reject(reason) : this.handleRejected(value));
|
|
336
338
|
return;
|
|
337
339
|
}
|
|
338
340
|
resolve(result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcRequest.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcRequest.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH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E,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BeEvent, BentleyStatus, Guid } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { BackendError, IModelError, NoContentError } from \"../../IModelError\";\nimport { RpcInterface } from \"../../RpcInterface\";\nimport { RpcConfiguration } from \"./RpcConfiguration\";\nimport { RpcProtocolEvent, RpcRequestEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\nimport { RpcNotFoundResponse } from \"./RpcControl\";\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\nimport { RpcOperation } from \"./RpcOperation\";\nimport { RpcManagedStatus, RpcProtocol, RpcProtocolVersion } from \"./RpcProtocol\";\nimport { CURRENT_REQUEST } from \"./RpcRegistry\";\n\n/* eslint-disable @typescript-eslint/naming-convention */\n// cspell:ignore csrf\n/* eslint-disable deprecation/deprecation */\n\n/** @internal */\nexport const aggregateLoad = { lastRequest: 0, lastResponse: 0 };\n\n/** @internal */\nexport class ResponseLike implements Response {\n private _data: Promise<any>;\n public get body() { return null; }\n public async arrayBuffer(): Promise<ArrayBuffer> { return this._data; }\n public async blob(): Promise<Blob> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public async formData(): Promise<FormData> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public async json(): Promise<any> { return this._data; }\n public async text(): Promise<string> { return this._data; }\n public get bodyUsed() { return false; }\n public get headers(): Headers { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public get ok(): boolean { return this.status >= 200 && this.status <= 299; }\n public get redirected() { return false; }\n public get status() { return 200; }\n public get statusText() { return \"\"; }\n public get trailer(): Promise<Headers> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public get type(): ResponseType { return \"basic\"; }\n public get url() { return \"\"; }\n public clone() { return { ...this }; }\n\n public constructor(data: any) {\n this._data = Promise.resolve(data);\n }\n}\n\n/** Supplies an IModelRpcProps for an RPC request.\n * @internal\n */\nexport type RpcRequestTokenSupplier_T = (request: RpcRequest) => IModelRpcProps | undefined;\n\n/** Supplies the initial retry interval for an RPC request.\n * @internal\n */\nexport type RpcRequestInitialRetryIntervalSupplier_T = (configuration: RpcConfiguration) => number;\n\n/** Notification callback for an RPC request.\n * @internal\n */\nexport type RpcRequestCallback_T = (request: RpcRequest) => void;\n\n/** Determines if caching is permitted for a RPC response.\n * @internal\n */\nexport type RpcResponseCachingCallback_T = (request: RpcRequest) => RpcResponseCacheControl;\n\n/** Runtime information related to the operation load of one or more RPC interfaces.\n * @internal\n */\nexport interface RpcOperationsProfile {\n readonly lastRequest: number;\n readonly lastResponse: number;\n}\n\n/** Handles RPC request events.\n * @internal\n */\nexport type RpcRequestEventHandler = (type: RpcRequestEvent, request: RpcRequest) => void;\n\n/** Resolves \"not found\" responses for RPC requests.\n * @internal\n */\nexport type RpcRequestNotFoundHandler = (request: RpcRequest, response: RpcNotFoundResponse, resubmit: () => void, reject: (reason: any) => void) => void;\n\nclass Cancellable<T> {\n public promise: Promise<T | undefined>;\n public cancel() { }\n\n public constructor(task: Promise<T>) {\n this.promise = new Promise((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.cancel = () => resolve(undefined);\n task.then(resolve, reject);\n });\n }\n}\n\n/** A RPC operation request.\n * @internal\n */\nexport abstract class RpcRequest<TResponse = any> {\n private static _activeRequests: Map<string, RpcRequest> = new Map();\n private _resolve: (value?: TResponse | PromiseLike<TResponse> | undefined) => void = () => undefined;\n protected _resolveRaw: (value?: Response | PromiseLike<Response> | undefined) => void = () => undefined;\n private _reject: (reason?: any) => void = () => undefined;\n private _rejectRaw: (reason?: any) => void = () => undefined;\n private _created: number = 0;\n private _lastSubmitted: number = 0;\n private _lastUpdated: number = 0;\n\n /** @internal */\n public _status: RpcRequestStatus = RpcRequestStatus.Unknown;\n\n /** @internal */\n public _extendedStatus: string = \"\";\n\n private _connecting: boolean = false;\n private _active: boolean = true;\n private _hasRawListener = false;\n private _raw: ArrayBuffer | string | undefined = undefined;\n private _sending?: Cancellable<number>;\n private _attempts = 0;\n private _retryAfter: number | null = null;\n private _transientFaults = 0;\n protected _response: Response | undefined = undefined;\n protected _rawPromise: Promise<Response | undefined>;\n public responseProtocolVersion = RpcProtocolVersion.None;\n\n /** All RPC requests that are currently in flight. */\n public static get activeRequests(): ReadonlyMap<string, RpcRequest> { return this._activeRequests; }\n\n /** Events raised by RpcRequest. See [[RpcRequestEvent]] */\n public static readonly events: BeEvent<RpcRequestEventHandler> = new BeEvent();\n\n /** Resolvers for \"not found\" requests. See [[RpcRequestNotFoundHandler]] */\n public static readonly notFoundHandlers: BeEvent<RpcRequestNotFoundHandler> = new BeEvent();\n\n /** The aggregate operations profile of all active RPC interfaces. */\n public static get aggregateLoad(): RpcOperationsProfile { return aggregateLoad; }\n\n /**\n * The request for the current RPC operation.\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.\n */\n public static current(context: RpcInterface): RpcRequest {\n return (context as any)[CURRENT_REQUEST];\n }\n\n /** The unique identifier of this request. */\n public readonly id: string;\n\n /** The operation for this request. */\n public readonly operation: RpcOperation;\n\n /** The parameters for this request. */\n public parameters: any[];\n\n /** The RPC client instance for this request. */\n public readonly client: RpcInterface;\n\n /** Convenience access to the protocol of this request. */\n public readonly protocol: RpcProtocol;\n\n /** The implementation response for this request. */\n public readonly response: Promise<TResponse | undefined>;\n\n /** The status of this request. */\n public get status() { return this._status; }\n\n /** Extended status information for this request (if available). */\n public get extendedStatus() { return this._extendedStatus; }\n\n /** The last submission for this request. */\n public get lastSubmitted() { return this._lastSubmitted; }\n\n /** The last status update received for this request. */\n public get lastUpdated() { return this._lastUpdated; }\n\n /** The target interval (in milliseconds) between submission attempts for this request. */\n public retryInterval: number;\n\n /** Whether a connection is active for this request. */\n public get connecting() { return this._connecting; }\n\n /** Whether this request is pending. */\n public get pending(): boolean {\n switch (this.status) {\n case RpcRequestStatus.Submitted:\n case RpcRequestStatus.Pending: {\n return true;\n }\n\n default: {\n return false;\n }\n }\n }\n\n /** The elapsed time for this request. */\n public get elapsed(): number {\n return this._lastUpdated - this._created;\n }\n\n /** A protocol-specific path identifier for this request. */\n public path: string;\n\n /** A protocol-specific method identifier for this request. */\n public method: string;\n\n /** An attempt-specific value for when to next retry this request. */\n public get retryAfter() { return this._retryAfter; }\n\n /** Finds the first parameter of a given structural type if present. */\n public findParameterOfType<T>(requiredProperties: { [index: string]: string }): T | undefined {\n for (const param of this.parameters) {\n if (typeof (param) === \"object\" && param !== null) {\n for (const prop of Object.getOwnPropertyNames(requiredProperties)) {\n if (param.hasOwnProperty(prop) && typeof (param[prop]) === requiredProperties[prop]) {\n return param;\n }\n }\n }\n }\n\n return undefined;\n }\n\n /** Finds the first IModelRpcProps parameter if present. */\n public findTokenPropsParameter(): IModelRpcProps | undefined {\n return this.findParameterOfType({ iModelId: \"string\" });\n\n }\n\n /** The raw implementation response for this request. */\n public get rawResponse(): Promise<Response | undefined> {\n this._hasRawListener = true;\n return this._rawPromise;\n }\n\n /** Constructs an RPC request. */\n public constructor(client: RpcInterface, operation: string, parameters: any[]) {\n this._created = new Date().getTime();\n this.path = \"\";\n this.method = \"\";\n this.client = client;\n this.protocol = client.configuration.protocol;\n this.operation = RpcOperation.lookup(client.constructor as any, operation);\n this.parameters = parameters;\n this.retryInterval = this.operation.policy.retryInterval(client.configuration);\n this.response = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n\n this._rawPromise = new Promise((resolve, reject) => {\n this._resolveRaw = resolve;\n this._rejectRaw = reject;\n });\n\n this.id = RpcConfiguration.requestContext.getId(this) || Guid.createValue();\n this.setStatus(RpcRequestStatus.Created);\n this.operation.policy.requestCallback(this);\n }\n\n /** Override to send the request. */\n protected abstract send(): Promise<number>;\n\n /** Override to load response value. */\n protected abstract load(): Promise<RpcSerializedValue>;\n\n /** Override to set request header values. */\n protected abstract setHeader(name: string, value: string): void;\n\n /** Sets the last updated time for the request. */\n protected setLastUpdatedTime() {\n this._lastUpdated = new Date().getTime();\n }\n\n protected computeRetryAfter(attempts: number) {\n return (((Math.pow(2, attempts) - 1) / 2) * 500) + 500;\n }\n\n protected recordTransientFault() {\n ++this._transientFaults;\n }\n\n protected resetTransientFaultCount() {\n this._transientFaults = 0;\n }\n\n protected supportsStatusCategory() {\n if (!this.protocol.supportsStatusCategory) {\n return false;\n }\n\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.responseProtocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;\n }\n\n /* @internal */\n public cancel() {\n if (typeof (this._sending) === \"undefined\") {\n return;\n }\n\n this._sending.cancel();\n this._sending = undefined;\n\n this._connecting = false;\n RpcRequest._activeRequests.delete(this.id);\n this.setStatus(RpcRequestStatus.Cancelled);\n }\n\n /* @internal */\n public async submit(): Promise<void> {\n if (!this._active)\n return;\n\n this._lastSubmitted = new Date().getTime();\n this._retryAfter = null;\n ++this._attempts;\n\n if (this.status === RpcRequestStatus.Created || this.status === RpcRequestStatus.NotFound || this.status === RpcRequestStatus.Cancelled) {\n this.setStatus(RpcRequestStatus.Submitted);\n }\n\n try {\n this._connecting = true;\n RpcRequest._activeRequests.set(this.id, this);\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestCreated, this);\n this._sending = new Cancellable(this.setHeaders().then(async () => this.send()));\n this.operation.policy.sentCallback(this);\n\n const response = await this._sending.promise;\n if (typeof (response) === \"undefined\") {\n return;\n }\n this._sending = undefined;\n\n const status = this.protocol.getStatus(response);\n\n if (this._hasRawListener && status === RpcRequestStatus.Resolved && typeof (this._response) !== \"undefined\") {\n this._connecting = false;\n RpcRequest._activeRequests.delete(this.id);\n this.resolveRaw();\n } else {\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoading, this);\n\n if (status === RpcRequestStatus.Unknown) {\n this._connecting = false;\n RpcRequest._activeRequests.delete(this.id);\n this.handleUnknownResponse(response);\n return;\n }\n\n const value = await this.load();\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoaded, this);\n RpcRequest._activeRequests.delete(this.id);\n this._connecting = false;\n this.handleResponse(response, value);\n }\n } catch (err) {\n this.protocol.events.raiseEvent(RpcProtocolEvent.ConnectionErrorReceived, this, err);\n RpcRequest._activeRequests.delete(this.id);\n this._connecting = false;\n this.reject(err);\n }\n }\n\n protected handleUnknownResponse(code: number) {\n this.reject(new IModelError(BentleyStatus.ERROR, `Unknown response ${code}.`));\n }\n\n private handleResponse(code: number, value: RpcSerializedValue) {\n const protocolStatus = this.protocol.getStatus(code);\n const status = this.transformResponseStatus(protocolStatus, value);\n\n if (RpcRequestStatus.isTransientError(status)) {\n return this.handleTransientError(status);\n }\n\n switch (status) {\n case RpcRequestStatus.Resolved: {\n return this.handleResolved(value);\n }\n\n case RpcRequestStatus.Rejected: {\n return this.handleRejected(value);\n }\n\n case RpcRequestStatus.Pending: {\n return this.setPending(status, value.objects);\n }\n\n case RpcRequestStatus.NotFound: {\n return this.handleNotFound(status, value);\n }\n\n case RpcRequestStatus.NoContent: {\n return this.handleNoContent();\n }\n }\n }\n\n private transformResponseStatus(protocolStatus: RpcRequestStatus, value: RpcSerializedValue): RpcRequestStatus {\n if (!this.supportsStatusCategory()) {\n return protocolStatus;\n }\n\n let status = protocolStatus;\n\n if (protocolStatus === RpcRequestStatus.Pending) {\n status = RpcRequestStatus.Rejected;\n } else if (protocolStatus === RpcRequestStatus.NotFound) {\n status = RpcRequestStatus.Rejected;\n } else if (protocolStatus === RpcRequestStatus.Unknown) {\n status = RpcRequestStatus.Rejected;\n }\n\n if (value.objects.indexOf(\"iTwinRpcCoreResponse\") !== -1 && value.objects.indexOf(\"managedStatus\") !== -1) {\n const managedStatus: RpcManagedStatus = JSON.parse(value.objects);\n value.objects = managedStatus.responseValue as string;\n\n if (managedStatus.managedStatus === \"pending\") {\n status = RpcRequestStatus.Pending;\n } else if (managedStatus.managedStatus === \"notFound\") {\n status = RpcRequestStatus.NotFound;\n }\n }\n\n return status;\n }\n\n private handleResolved(value: RpcSerializedValue) {\n try {\n this._raw = value.objects;\n const result: TResponse = RpcMarshaling.deserialize(this.protocol, value);\n\n if (ArrayBuffer.isView(result)) {\n this._raw = result.buffer;\n }\n\n return this.resolve(result);\n } catch (err) {\n return this.reject(err);\n }\n }\n\n private handleRejected(value: RpcSerializedValue) {\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorReceived, this);\n\n try {\n const error = RpcMarshaling.deserialize(this.protocol, value);\n const hasInfo = error && typeof (error) === \"object\" && error.hasOwnProperty(\"name\") && error.hasOwnProperty(\"message\");\n const name = hasInfo ? error.name : \"\";\n const message = hasInfo ? error.message : \"\";\n const errorNumber = (hasInfo && error.hasOwnProperty(\"errorNumber\")) ? error.errorNumber : BentleyStatus.ERROR;\n return this.reject(new BackendError(errorNumber, name, message, () => error));\n } catch (err) {\n return this.reject(err);\n }\n }\n\n private handleNoContent() {\n return this.reject(new NoContentError());\n }\n\n private handleNotFound(status: RpcRequestStatus, value: RpcSerializedValue) {\n const response = RpcMarshaling.deserialize(this.protocol, value);\n this.setStatus(status);\n\n let resubmitted = false;\n RpcRequest.notFoundHandlers.raiseEvent(this, response, () => {\n if (resubmitted)\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n\n resubmitted = true;\n this.submit(); // eslint-disable-line @typescript-eslint/no-floating-promises\n }, (reason: any) => this.reject(reason));\n return;\n }\n\n private resolve(result: TResponse): void {\n if (!this._active)\n return;\n\n this._active = false;\n this.setLastUpdatedTime();\n this._resolve(result);\n\n if (this._hasRawListener) {\n if (typeof (this._raw) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\n }\n\n this._resolveRaw(new ResponseLike(this._raw));\n }\n\n this.setStatus(RpcRequestStatus.Resolved);\n this.dispose();\n }\n\n private resolveRaw() {\n if (typeof (this._response) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\n }\n\n this._active = false;\n this.setLastUpdatedTime();\n this._resolveRaw(this._response);\n this.setStatus(RpcRequestStatus.Resolved);\n this.dispose();\n }\n\n protected reject(reason: any): void {\n if (!this._active)\n return;\n\n this._active = false;\n this.setLastUpdatedTime();\n this._reject(reason);\n\n if (this._hasRawListener) {\n this._rejectRaw(reason);\n }\n\n this.setStatus(RpcRequestStatus.Rejected);\n this.dispose();\n }\n\n /** @internal */\n public dispose(): void {\n this.setStatus(RpcRequestStatus.Disposed);\n this._raw = undefined;\n this._response = undefined;\n\n const client = this.client as any;\n if (client[CURRENT_REQUEST] === this) {\n client[CURRENT_REQUEST] = undefined;\n }\n }\n\n private setPending(status: RpcRequestStatus.Pending, extendedStatus: string): void {\n if (!this._active)\n return;\n\n this.setLastUpdatedTime();\n this._extendedStatus = extendedStatus;\n this.setStatus(status);\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, this);\n }\n\n private handleTransientError(status: RpcRequestStatus) {\n if (!this._active)\n return;\n\n this.setLastUpdatedTime();\n this._retryAfter = this.computeRetryAfter(this._attempts - 1);\n\n if (this._transientFaults > this.protocol.configuration.transientFaultLimit) {\n this.reject(new IModelError(BentleyStatus.ERROR, `Exceeded transient fault limit.`));\n } else {\n this.setStatus(status);\n RpcRequest.events.raiseEvent(RpcRequestEvent.TransientErrorReceived, this);\n }\n }\n\n protected async setHeaders(): Promise<void> {\n const versionHeader = this.protocol.protocolVersionHeaderName;\n if (versionHeader && RpcProtocol.protocolVersion)\n this.setHeader(versionHeader, RpcProtocol.protocolVersion.toString());\n\n const headerNames = this.protocol.serializedClientRequestContextHeaderNames;\n const headerValues = await RpcConfiguration.requestContext.serialize(this);\n\n if (headerNames.id)\n this.setHeader(headerNames.id, headerValues.id || this.id); // Cannot be empty\n\n if (headerNames.applicationVersion)\n this.setHeader(headerNames.applicationVersion, headerValues.applicationVersion);\n\n if (headerNames.applicationId)\n this.setHeader(headerNames.applicationId, headerValues.applicationId);\n\n if (headerNames.sessionId)\n this.setHeader(headerNames.sessionId, headerValues.sessionId);\n\n if (headerNames.authorization && headerValues.authorization)\n this.setHeader(headerNames.authorization, headerValues.authorization);\n\n if (headerValues.csrfToken)\n this.setHeader(headerValues.csrfToken.headerName, headerValues.csrfToken.headerValue);\n }\n\n private setStatus(status: RpcRequestStatus): void {\n if (this._status === status)\n return;\n\n this._status = status;\n RpcRequest.events.raiseEvent(RpcRequestEvent.StatusChanged, this);\n }\n}\n\n/** @internal */\nexport const initializeRpcRequest = (() => {\n let initialized = false;\n\n return () => {\n if (initialized) {\n return;\n }\n\n initialized = true;\n\n RpcRequest.events.addListener((type, request) => {\n if (type !== RpcRequestEvent.StatusChanged)\n return;\n\n switch (request.status) {\n case RpcRequestStatus.Submitted: {\n aggregateLoad.lastRequest = request.lastSubmitted;\n break;\n }\n\n case RpcRequestStatus.Pending:\n case RpcRequestStatus.Resolved:\n case RpcRequestStatus.Rejected: {\n aggregateLoad.lastResponse = request.lastUpdated;\n break;\n }\n }\n });\n\n RpcProtocol.events.addListener((type) => {\n const now = new Date().getTime();\n\n switch (type) {\n case RpcProtocolEvent.RequestReceived: {\n aggregateLoad.lastRequest = now;\n break;\n }\n\n case RpcProtocolEvent.BackendReportedPending:\n case RpcProtocolEvent.BackendErrorOccurred:\n case RpcProtocolEvent.BackendResponseCreated: {\n aggregateLoad.lastResponse = now;\n break;\n }\n }\n });\n };\n})();\n"]}
|
|
1
|
+
{"version":3,"file":"RpcRequest.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcRequest.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmE;AAEnE,mDAA8E;AAE9E,yDAAsD;AACtD,iDAA8G;AAE9G,mDAAoE;AACpE,iDAA8C;AAC9C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M;gBACR,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BeEvent, BentleyStatus, Guid } from \"@itwin/core-bentley\";\nimport { IModelRpcProps } from \"../../IModel\";\nimport { BackendError, IModelError, NoContentError } from \"../../IModelError\";\nimport { RpcInterface } from \"../../RpcInterface\";\nimport { RpcConfiguration } from \"./RpcConfiguration\";\nimport { RpcProtocolEvent, RpcRequestEvent, RpcRequestStatus, RpcResponseCacheControl } from \"./RpcConstants\";\nimport { RpcNotFoundResponse } from \"./RpcControl\";\nimport { RpcMarshaling, RpcSerializedValue } from \"./RpcMarshaling\";\nimport { RpcOperation } from \"./RpcOperation\";\nimport { RpcManagedStatus, RpcProtocol, RpcProtocolVersion } from \"./RpcProtocol\";\nimport { CURRENT_REQUEST } from \"./RpcRegistry\";\n\n/* eslint-disable @typescript-eslint/naming-convention */\n// cspell:ignore csrf\n/* eslint-disable deprecation/deprecation */\n\n/** @internal */\nexport const aggregateLoad = { lastRequest: 0, lastResponse: 0 };\n\n/** @internal */\nexport class ResponseLike implements Response {\n private _data: Promise<any>;\n public get body() { return null; }\n public async arrayBuffer(): Promise<ArrayBuffer> { return this._data; }\n public async blob(): Promise<Blob> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public async formData(): Promise<FormData> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public async json(): Promise<any> { return this._data; }\n public async text(): Promise<string> { return this._data; }\n public get bodyUsed() { return false; }\n public get headers(): Headers { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public get ok(): boolean { return this.status >= 200 && this.status <= 299; }\n public get redirected() { return false; }\n public get status() { return 200; }\n public get statusText() { return \"\"; }\n public get trailer(): Promise<Headers> { throw new IModelError(BentleyStatus.ERROR, \"Not implemented.\"); }\n public get type(): ResponseType { return \"basic\"; }\n public get url() { return \"\"; }\n public clone() { return { ...this }; }\n\n public constructor(data: any) {\n this._data = Promise.resolve(data);\n }\n}\n\n/** Supplies an IModelRpcProps for an RPC request.\n * @internal\n */\nexport type RpcRequestTokenSupplier_T = (request: RpcRequest) => IModelRpcProps | undefined;\n\n/** Supplies the initial retry interval for an RPC request.\n * @internal\n */\nexport type RpcRequestInitialRetryIntervalSupplier_T = (configuration: RpcConfiguration) => number;\n\n/** Notification callback for an RPC request.\n * @internal\n */\nexport type RpcRequestCallback_T = (request: RpcRequest) => void;\n\n/** Determines if caching is permitted for a RPC response.\n * @internal\n */\nexport type RpcResponseCachingCallback_T = (request: RpcRequest) => RpcResponseCacheControl;\n\n/** Runtime information related to the operation load of one or more RPC interfaces.\n * @internal\n */\nexport interface RpcOperationsProfile {\n readonly lastRequest: number;\n readonly lastResponse: number;\n}\n\n/** Handles RPC request events.\n * @internal\n */\nexport type RpcRequestEventHandler = (type: RpcRequestEvent, request: RpcRequest) => void;\n\n/** Resolves \"not found\" responses for RPC requests.\n * @internal\n */\nexport type RpcRequestNotFoundHandler = (request: RpcRequest, response: RpcNotFoundResponse, resubmit: () => void, reject: (reason?: any) => void) => void;\n\nclass Cancellable<T> {\n public promise: Promise<T | undefined>;\n public cancel() { }\n\n public constructor(task: Promise<T>) {\n this.promise = new Promise((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n this.cancel = () => resolve(undefined);\n task.then(resolve, reject);\n });\n }\n}\n\n/** A RPC operation request.\n * @internal\n */\nexport abstract class RpcRequest<TResponse = any> {\n private static _activeRequests: Map<string, RpcRequest> = new Map();\n private _resolve: (value?: TResponse | PromiseLike<TResponse> | undefined) => void = () => undefined;\n protected _resolveRaw: (value?: Response | PromiseLike<Response> | undefined) => void = () => undefined;\n private _reject: (reason?: any) => void = () => undefined;\n private _rejectRaw: (reason?: any) => void = () => undefined;\n private _created: number = 0;\n private _lastSubmitted: number = 0;\n private _lastUpdated: number = 0;\n\n /** @internal */\n public _status: RpcRequestStatus = RpcRequestStatus.Unknown;\n\n /** @internal */\n public _extendedStatus: string = \"\";\n\n private _connecting: boolean = false;\n private _active: boolean = true;\n private _hasRawListener = false;\n private _raw: ArrayBuffer | string | undefined = undefined;\n private _sending?: Cancellable<number>;\n private _attempts = 0;\n private _retryAfter: number | null = null;\n private _transientFaults = 0;\n protected _response: Response | undefined = undefined;\n protected _rawPromise: Promise<Response | undefined>;\n public responseProtocolVersion = RpcProtocolVersion.None;\n\n /** All RPC requests that are currently in flight. */\n public static get activeRequests(): ReadonlyMap<string, RpcRequest> { return this._activeRequests; }\n\n /** Events raised by RpcRequest. See [[RpcRequestEvent]] */\n public static readonly events: BeEvent<RpcRequestEventHandler> = new BeEvent();\n\n /** Resolvers for \"not found\" requests. See [[RpcRequestNotFoundHandler]] */\n public static readonly notFoundHandlers: BeEvent<RpcRequestNotFoundHandler> = new BeEvent();\n\n /** The aggregate operations profile of all active RPC interfaces. */\n public static get aggregateLoad(): RpcOperationsProfile { return aggregateLoad; }\n\n /**\n * The request for the current RPC operation.\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.\n */\n public static current(context: RpcInterface): RpcRequest {\n return (context as any)[CURRENT_REQUEST];\n }\n\n /** The unique identifier of this request. */\n public readonly id: string;\n\n /** The operation for this request. */\n public readonly operation: RpcOperation;\n\n /** The parameters for this request. */\n public parameters: any[];\n\n /** The RPC client instance for this request. */\n public readonly client: RpcInterface;\n\n /** Convenience access to the protocol of this request. */\n public readonly protocol: RpcProtocol;\n\n /** The implementation response for this request. */\n public readonly response: Promise<TResponse | undefined>;\n\n /** The status of this request. */\n public get status() { return this._status; }\n\n /** Extended status information for this request (if available). */\n public get extendedStatus() { return this._extendedStatus; }\n\n /** The last submission for this request. */\n public get lastSubmitted() { return this._lastSubmitted; }\n\n /** The last status update received for this request. */\n public get lastUpdated() { return this._lastUpdated; }\n\n /** The target interval (in milliseconds) between submission attempts for this request. */\n public retryInterval: number;\n\n /** Whether a connection is active for this request. */\n public get connecting() { return this._connecting; }\n\n /** Whether this request is pending. */\n public get pending(): boolean {\n switch (this.status) {\n case RpcRequestStatus.Submitted:\n case RpcRequestStatus.Pending: {\n return true;\n }\n\n default: {\n return false;\n }\n }\n }\n\n /** The elapsed time for this request. */\n public get elapsed(): number {\n return this._lastUpdated - this._created;\n }\n\n /** A protocol-specific path identifier for this request. */\n public path: string;\n\n /** A protocol-specific method identifier for this request. */\n public method: string;\n\n /** An attempt-specific value for when to next retry this request. */\n public get retryAfter() { return this._retryAfter; }\n\n /** Finds the first parameter of a given structural type if present. */\n public findParameterOfType<T>(requiredProperties: { [index: string]: string }): T | undefined {\n for (const param of this.parameters) {\n if (typeof (param) === \"object\" && param !== null) {\n for (const prop of Object.getOwnPropertyNames(requiredProperties)) {\n if (param.hasOwnProperty(prop) && typeof (param[prop]) === requiredProperties[prop]) {\n return param;\n }\n }\n }\n }\n\n return undefined;\n }\n\n /** Finds the first IModelRpcProps parameter if present. */\n public findTokenPropsParameter(): IModelRpcProps | undefined {\n return this.findParameterOfType({ iModelId: \"string\" });\n\n }\n\n /** The raw implementation response for this request. */\n public get rawResponse(): Promise<Response | undefined> {\n this._hasRawListener = true;\n return this._rawPromise;\n }\n\n /** Constructs an RPC request. */\n public constructor(client: RpcInterface, operation: string, parameters: any[]) {\n this._created = new Date().getTime();\n this.path = \"\";\n this.method = \"\";\n this.client = client;\n this.protocol = client.configuration.protocol;\n this.operation = RpcOperation.lookup(client.constructor as any, operation);\n this.parameters = parameters;\n this.retryInterval = this.operation.policy.retryInterval(client.configuration);\n this.response = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n\n this._rawPromise = new Promise((resolve, reject) => {\n this._resolveRaw = resolve;\n this._rejectRaw = reject;\n });\n\n this.id = RpcConfiguration.requestContext.getId(this) || Guid.createValue();\n this.setStatus(RpcRequestStatus.Created);\n this.operation.policy.requestCallback(this);\n }\n\n /** Override to send the request. */\n protected abstract send(): Promise<number>;\n\n /** Override to load response value. */\n protected abstract load(): Promise<RpcSerializedValue>;\n\n /** Override to set request header values. */\n protected abstract setHeader(name: string, value: string): void;\n\n /** Sets the last updated time for the request. */\n protected setLastUpdatedTime() {\n this._lastUpdated = new Date().getTime();\n }\n\n protected computeRetryAfter(attempts: number) {\n return (((Math.pow(2, attempts) - 1) / 2) * 500) + 500;\n }\n\n protected recordTransientFault() {\n ++this._transientFaults;\n }\n\n protected resetTransientFaultCount() {\n this._transientFaults = 0;\n }\n\n protected supportsStatusCategory() {\n if (!this.protocol.supportsStatusCategory) {\n return false;\n }\n\n return RpcProtocol.protocolVersion >= RpcProtocolVersion.IntroducedStatusCategory && this.responseProtocolVersion >= RpcProtocolVersion.IntroducedStatusCategory;\n }\n\n /* @internal */\n public cancel() {\n if (typeof (this._sending) === \"undefined\") {\n return;\n }\n\n this._sending.cancel();\n this._sending = undefined;\n\n this._connecting = false;\n RpcRequest._activeRequests.delete(this.id);\n this.setStatus(RpcRequestStatus.Cancelled);\n }\n\n /* @internal */\n public async submit(): Promise<void> {\n if (!this._active)\n return;\n\n this._lastSubmitted = new Date().getTime();\n this._retryAfter = null;\n ++this._attempts;\n\n if (this.status === RpcRequestStatus.Created || this.status === RpcRequestStatus.NotFound || this.status === RpcRequestStatus.Cancelled) {\n this.setStatus(RpcRequestStatus.Submitted);\n }\n\n try {\n this._connecting = true;\n RpcRequest._activeRequests.set(this.id, this);\n this.protocol.events.raiseEvent(RpcProtocolEvent.RequestCreated, this);\n this._sending = new Cancellable(this.setHeaders().then(async () => this.send()));\n this.operation.policy.sentCallback(this);\n\n const response = await this._sending.promise;\n if (typeof (response) === \"undefined\") {\n return;\n }\n this._sending = undefined;\n\n const status = this.protocol.getStatus(response);\n\n if (this._hasRawListener && status === RpcRequestStatus.Resolved && typeof (this._response) !== \"undefined\") {\n this._connecting = false;\n RpcRequest._activeRequests.delete(this.id);\n this.resolveRaw();\n } else {\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoading, this);\n\n if (status === RpcRequestStatus.Unknown) {\n this._connecting = false;\n RpcRequest._activeRequests.delete(this.id);\n this.handleUnknownResponse(response);\n return;\n }\n\n const value = await this.load();\n this.protocol.events.raiseEvent(RpcProtocolEvent.ResponseLoaded, this);\n RpcRequest._activeRequests.delete(this.id);\n this._connecting = false;\n this.handleResponse(response, value);\n }\n } catch (err) {\n this.protocol.events.raiseEvent(RpcProtocolEvent.ConnectionErrorReceived, this, err);\n RpcRequest._activeRequests.delete(this.id);\n this._connecting = false;\n this.reject(err);\n }\n }\n\n protected handleUnknownResponse(code: number) {\n this.reject(new IModelError(BentleyStatus.ERROR, `Unknown response ${code}.`));\n }\n\n private handleResponse(code: number, value: RpcSerializedValue) {\n const protocolStatus = this.protocol.getStatus(code);\n const status = this.transformResponseStatus(protocolStatus, value);\n\n if (RpcRequestStatus.isTransientError(status)) {\n return this.handleTransientError(status);\n }\n\n switch (status) {\n case RpcRequestStatus.Resolved: {\n return this.handleResolved(value);\n }\n\n case RpcRequestStatus.Rejected: {\n return this.handleRejected(value);\n }\n\n case RpcRequestStatus.Pending: {\n return this.setPending(status, value.objects);\n }\n\n case RpcRequestStatus.NotFound: {\n return this.handleNotFound(status, value);\n }\n\n case RpcRequestStatus.NoContent: {\n return this.handleNoContent();\n }\n }\n }\n\n private transformResponseStatus(protocolStatus: RpcRequestStatus, value: RpcSerializedValue): RpcRequestStatus {\n if (!this.supportsStatusCategory()) {\n return protocolStatus;\n }\n\n let status = protocolStatus;\n\n if (protocolStatus === RpcRequestStatus.Pending) {\n status = RpcRequestStatus.Rejected;\n } else if (protocolStatus === RpcRequestStatus.NotFound) {\n status = RpcRequestStatus.Rejected;\n } else if (protocolStatus === RpcRequestStatus.Unknown) {\n status = RpcRequestStatus.Rejected;\n }\n\n if (value.objects.indexOf(\"iTwinRpcCoreResponse\") !== -1 && value.objects.indexOf(\"managedStatus\") !== -1) {\n const managedStatus: RpcManagedStatus = JSON.parse(value.objects);\n value.objects = managedStatus.responseValue as string;\n\n if (managedStatus.managedStatus === \"pending\") {\n status = RpcRequestStatus.Pending;\n } else if (managedStatus.managedStatus === \"notFound\") {\n status = RpcRequestStatus.NotFound;\n }\n }\n\n return status;\n }\n\n private handleResolved(value: RpcSerializedValue) {\n try {\n this._raw = value.objects;\n const result: TResponse = RpcMarshaling.deserialize(this.protocol, value);\n\n if (ArrayBuffer.isView(result)) {\n this._raw = result.buffer;\n }\n\n return this.resolve(result);\n } catch (err) {\n return this.reject(err);\n }\n }\n\n private handleRejected(value: RpcSerializedValue) {\n this.protocol.events.raiseEvent(RpcProtocolEvent.BackendErrorReceived, this);\n\n try {\n const error = RpcMarshaling.deserialize(this.protocol, value);\n const hasInfo = error && typeof (error) === \"object\" && error.hasOwnProperty(\"name\") && error.hasOwnProperty(\"message\");\n const name = hasInfo ? error.name : \"\";\n const message = hasInfo ? error.message : \"\";\n const errorNumber = (hasInfo && error.hasOwnProperty(\"errorNumber\")) ? error.errorNumber : BentleyStatus.ERROR;\n return this.reject(new BackendError(errorNumber, name, message, () => error));\n } catch (err) {\n return this.reject(err);\n }\n }\n\n private handleNoContent() {\n return this.reject(new NoContentError());\n }\n\n private handleNotFound(status: RpcRequestStatus, value: RpcSerializedValue) {\n if (RpcRequest.notFoundHandlers.numberOfListeners === 0)\n this.handleRejected(value);\n\n const response = RpcMarshaling.deserialize(this.protocol, value);\n this.setStatus(status);\n\n let resubmitted = false;\n RpcRequest.notFoundHandlers.raiseEvent(this, response, () => {\n if (resubmitted)\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n\n resubmitted = true;\n void this.submit();\n }, (reason: any) => reason ? this.reject(reason) : this.handleRejected(value));\n return;\n }\n\n private resolve(result: TResponse): void {\n if (!this._active)\n return;\n\n this._active = false;\n this.setLastUpdatedTime();\n this._resolve(result);\n\n if (this._hasRawListener) {\n if (typeof (this._raw) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\n }\n\n this._resolveRaw(new ResponseLike(this._raw));\n }\n\n this.setStatus(RpcRequestStatus.Resolved);\n this.dispose();\n }\n\n private resolveRaw() {\n if (typeof (this._response) === \"undefined\") {\n throw new IModelError(BentleyStatus.ERROR, \"Cannot access raw response.\");\n }\n\n this._active = false;\n this.setLastUpdatedTime();\n this._resolveRaw(this._response);\n this.setStatus(RpcRequestStatus.Resolved);\n this.dispose();\n }\n\n protected reject(reason: any): void {\n if (!this._active)\n return;\n\n this._active = false;\n this.setLastUpdatedTime();\n this._reject(reason);\n\n if (this._hasRawListener) {\n this._rejectRaw(reason);\n }\n\n this.setStatus(RpcRequestStatus.Rejected);\n this.dispose();\n }\n\n /** @internal */\n public dispose(): void {\n this.setStatus(RpcRequestStatus.Disposed);\n this._raw = undefined;\n this._response = undefined;\n\n const client = this.client as any;\n if (client[CURRENT_REQUEST] === this) {\n client[CURRENT_REQUEST] = undefined;\n }\n }\n\n private setPending(status: RpcRequestStatus.Pending, extendedStatus: string): void {\n if (!this._active)\n return;\n\n this.setLastUpdatedTime();\n this._extendedStatus = extendedStatus;\n this.setStatus(status);\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, this);\n }\n\n private handleTransientError(status: RpcRequestStatus) {\n if (!this._active)\n return;\n\n this.setLastUpdatedTime();\n this._retryAfter = this.computeRetryAfter(this._attempts - 1);\n\n if (this._transientFaults > this.protocol.configuration.transientFaultLimit) {\n this.reject(new IModelError(BentleyStatus.ERROR, `Exceeded transient fault limit.`));\n } else {\n this.setStatus(status);\n RpcRequest.events.raiseEvent(RpcRequestEvent.TransientErrorReceived, this);\n }\n }\n\n protected async setHeaders(): Promise<void> {\n const versionHeader = this.protocol.protocolVersionHeaderName;\n if (versionHeader && RpcProtocol.protocolVersion)\n this.setHeader(versionHeader, RpcProtocol.protocolVersion.toString());\n\n const headerNames = this.protocol.serializedClientRequestContextHeaderNames;\n const headerValues = await RpcConfiguration.requestContext.serialize(this);\n\n if (headerNames.id)\n this.setHeader(headerNames.id, headerValues.id || this.id); // Cannot be empty\n\n if (headerNames.applicationVersion)\n this.setHeader(headerNames.applicationVersion, headerValues.applicationVersion);\n\n if (headerNames.applicationId)\n this.setHeader(headerNames.applicationId, headerValues.applicationId);\n\n if (headerNames.sessionId)\n this.setHeader(headerNames.sessionId, headerValues.sessionId);\n\n if (headerNames.authorization && headerValues.authorization)\n this.setHeader(headerNames.authorization, headerValues.authorization);\n\n if (headerValues.csrfToken)\n this.setHeader(headerValues.csrfToken.headerName, headerValues.csrfToken.headerValue);\n }\n\n private setStatus(status: RpcRequestStatus): void {\n if (this._status === status)\n return;\n\n this._status = status;\n RpcRequest.events.raiseEvent(RpcRequestEvent.StatusChanged, this);\n }\n}\n\n/** @internal */\nexport const initializeRpcRequest = (() => {\n let initialized = false;\n\n return () => {\n if (initialized) {\n return;\n }\n\n initialized = true;\n\n RpcRequest.events.addListener((type, request) => {\n if (type !== RpcRequestEvent.StatusChanged)\n return;\n\n switch (request.status) {\n case RpcRequestStatus.Submitted: {\n aggregateLoad.lastRequest = request.lastSubmitted;\n break;\n }\n\n case RpcRequestStatus.Pending:\n case RpcRequestStatus.Resolved:\n case RpcRequestStatus.Rejected: {\n aggregateLoad.lastResponse = request.lastUpdated;\n break;\n }\n }\n });\n\n RpcProtocol.events.addListener((type) => {\n const now = new Date().getTime();\n\n switch (type) {\n case RpcProtocolEvent.RequestReceived: {\n aggregateLoad.lastRequest = now;\n break;\n }\n\n case RpcProtocolEvent.BackendReportedPending:\n case RpcProtocolEvent.BackendErrorOccurred:\n case RpcProtocolEvent.BackendResponseCreated: {\n aggregateLoad.lastResponse = now;\n break;\n }\n }\n });\n };\n})();\n"]}
|
|
@@ -27,13 +27,13 @@ export declare enum CurrentImdlVersion {
|
|
|
27
27
|
* front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a
|
|
28
28
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
29
29
|
*/
|
|
30
|
-
Major =
|
|
30
|
+
Major = 34,
|
|
31
31
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
32
32
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
33
33
|
*/
|
|
34
34
|
Minor = 0,
|
|
35
35
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
36
|
-
Combined =
|
|
36
|
+
Combined = 2228224
|
|
37
37
|
}
|
|
38
38
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
39
39
|
* @internal
|
|
@@ -36,13 +36,13 @@ var CurrentImdlVersion;
|
|
|
36
36
|
* front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a
|
|
37
37
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
38
38
|
*/
|
|
39
|
-
CurrentImdlVersion[CurrentImdlVersion["Major"] =
|
|
39
|
+
CurrentImdlVersion[CurrentImdlVersion["Major"] = 34] = "Major";
|
|
40
40
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
41
41
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
42
42
|
*/
|
|
43
43
|
CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
|
|
44
44
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
45
|
-
CurrentImdlVersion[CurrentImdlVersion["Combined"] =
|
|
45
|
+
CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2228224] = "Combined";
|
|
46
46
|
})(CurrentImdlVersion || (exports.CurrentImdlVersion = CurrentImdlVersion = {}));
|
|
47
47
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
48
48
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|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AAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9F,CAAC;IAID,YAAoB,MAAc,EAAE,gBAAwB,EAAE,KAAa;QACzE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;;AAtBH,gDAuBC;AAPe,8BAAW,GAAG,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tile\n */\n\nimport { assert, ByteStream } from \"@itwin/core-bentley\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d } from \"../geometry/Placement\";\nimport { nextPoint3d64FromByteStream, TileFormat, TileHeader } from \"./TileIO\";\n\n/** Flags describing the geometry contained within a tile in iMdl format.\n * @internal\n */\nexport enum ImdlFlags {\n /** No special flags */\n None = 0,\n /** The tile contains some curved geometry */\n ContainsCurves = 1 << 0,\n /** Some geometry within the tile range was omitted based on its size */\n Incomplete = 1 << 2,\n /** The tile must be refined by sub-division, not magnification. */\n DisallowMagnification = 1 << 3,\n /** The tile's feature table contains features from multiple models. */\n MultiModelFeatureTable = 1 << 4,\n}\n\n/** Describes the maximum major and minor version of the iMdl tile format supported by this version of this package.\n * @internal\n */\nexport enum CurrentImdlVersion {\n /** The unsigned 16-bit major version number. If the major version specified in the tile header is greater than this value, then this\n * front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a\n * greater minor version than CurrentVersion.Minor, although some data may be skipped.\n */\n Major =
|
|
1
|
+
{"version":3,"file":"IModelTileIO.js","sourceRoot":"","sources":["../../../src/tile/IModelTileIO.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACz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G,MAAM,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;;AAtBH,gDAuBC;AAPe,8BAAW,GAAG,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tile\n */\n\nimport { assert, ByteStream } from \"@itwin/core-bentley\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d } from \"../geometry/Placement\";\nimport { nextPoint3d64FromByteStream, TileFormat, TileHeader } from \"./TileIO\";\n\n/** Flags describing the geometry contained within a tile in iMdl format.\n * @internal\n */\nexport enum ImdlFlags {\n /** No special flags */\n None = 0,\n /** The tile contains some curved geometry */\n ContainsCurves = 1 << 0,\n /** Some geometry within the tile range was omitted based on its size */\n Incomplete = 1 << 2,\n /** The tile must be refined by sub-division, not magnification. */\n DisallowMagnification = 1 << 3,\n /** The tile's feature table contains features from multiple models. */\n MultiModelFeatureTable = 1 << 4,\n}\n\n/** Describes the maximum major and minor version of the iMdl tile format supported by this version of this package.\n * @internal\n */\nexport enum CurrentImdlVersion {\n /** The unsigned 16-bit major version number. If the major version specified in the tile header is greater than this value, then this\n * front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a\n * greater minor version than CurrentVersion.Minor, although some data may be skipped.\n */\n Major = 34,\n /** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can\n * read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.\n */\n Minor = 0,\n /** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */\n Combined = (Major << 0x10) | Minor,\n}\n\n/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.\n * @internal\n */\nexport class ImdlHeader extends TileHeader {\n /** The size of this header in bytes. */\n public readonly headerLength: number;\n /** Flags describing the geometry contained within the tile */\n public readonly flags: ImdlFlags;\n /** A bounding box no larger than the tile's range, tightly enclosing the tile's geometry; or a null range if the tile is empty */\n public readonly contentRange: ElementAlignedBox3d;\n /** The chord tolerance in meters at which the tile's geometry was faceted */\n public readonly tolerance: number;\n /** The number of elements which contributed at least some geometry to the tile content */\n public readonly numElementsIncluded: number;\n /** The number of elements within the tile range which contributed no geometry to the tile content */\n public readonly numElementsExcluded: number;\n /** The total number of bytes in the binary tile data, including this header */\n public readonly tileLength: number;\n /** A bitfield wherein each set bit indicates an empty sub-volume. */\n public readonly emptySubRanges: number;\n\n public get versionMajor(): number { return this.version >>> 0x10; }\n public get versionMinor(): number { return (this.version & 0xffff) >>> 0; }\n\n public get isValid(): boolean { return TileFormat.IModel === this.format; }\n public get isReadableVersion(): boolean { return this.versionMajor <= CurrentImdlVersion.Major; }\n\n /** Deserialize a header from the binary data at the stream's current position.\n * If the binary data does not contain a valid header, the Header will be marked 'invalid'.\n */\n public constructor(stream: ByteStream) {\n super(stream);\n this.headerLength = stream.readUint32();\n this.flags = stream.readUint32();\n\n this.contentRange = new Range3d();\n nextPoint3d64FromByteStream(stream, this.contentRange.low);\n nextPoint3d64FromByteStream(stream, this.contentRange.high);\n\n this.tolerance = stream.readFloat64();\n this.numElementsIncluded = stream.readUint32();\n this.numElementsExcluded = stream.readUint32();\n this.tileLength = stream.readUint32();\n\n // empty sub-volume bit field introduced in format v02.00\n this.emptySubRanges = this.versionMajor >= 2 ? stream.readUint32() : 0;\n\n // Skip any unprocessed bytes in header\n const remainingHeaderBytes = this.headerLength - stream.curPos;\n assert(remainingHeaderBytes >= 0);\n stream.advance(remainingHeaderBytes);\n\n if (stream.isPastTheEnd)\n this.invalidate();\n }\n}\n\n/** Header preceding the feature table embedded in an iMdl tile's content.\n * @internal\n */\nexport class FeatureTableHeader {\n // The number of bytes the entire table occupies.\n public readonly length: number;\n // The number of subcategories in the table.\n // NOTE: This used to be \"max features\" which was useless and unused. It is only accurate if ImdlFlags.HasMultiModelFeatureTable is set.\n public readonly numSubCategories: number;\n // The number of features in the table.\n public readonly count: number;\n\n public static readFrom(stream: ByteStream) {\n const length = stream.readUint32();\n const maxFeatures = stream.readUint32();\n const count = stream.readUint32();\n return stream.isPastTheEnd ? undefined : new FeatureTableHeader(length, maxFeatures, count);\n }\n\n public static sizeInBytes = 12;\n\n private constructor(length: number, numSubCategories: number, count: number) {\n this.length = length;\n this.numSubCategories = numSubCategories;\n this.count = count;\n }\n}\n"]}
|
|
@@ -51,6 +51,7 @@ export interface TileOptions {
|
|
|
51
51
|
readonly ignoreAreaPatterns: boolean;
|
|
52
52
|
readonly enableExternalTextures: boolean;
|
|
53
53
|
readonly useProjectExtents: boolean;
|
|
54
|
+
readonly expandProjectExtents: boolean;
|
|
54
55
|
readonly optimizeBRepProcessing: boolean;
|
|
55
56
|
readonly useLargerTiles: boolean;
|
|
56
57
|
readonly disableMagnification: boolean;
|
|
@@ -90,7 +91,8 @@ export declare enum TreeFlags {
|
|
|
90
91
|
UseProjectExtents = 1,// Use project extents as the basis of the tile tree's range.
|
|
91
92
|
EnforceDisplayPriority = 2,// For 3d plan projection models, group graphics into layers based on subcategory.
|
|
92
93
|
OptimizeBRepProcessing = 4,// Use an optimized pipeline for producing facets from BRep entities.
|
|
93
|
-
UseLargerTiles = 8
|
|
94
|
+
UseLargerTiles = 8,// Produce tiles of larger size in screen pixels.
|
|
95
|
+
ExpandProjectExtents = 16
|
|
94
96
|
}
|
|
95
97
|
/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.
|
|
96
98
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileMetadata.d.ts","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACG,UAAU,EAAgH,UAAU,EAC7I,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAY,MAAM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B,yBAAyB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAS3G;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;gBAEpB,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW;IAMvE;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,YAAY;CAkBhE"}
|
|
@@ -52,6 +52,7 @@ var TileOptions;
|
|
|
52
52
|
ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),
|
|
53
53
|
enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),
|
|
54
54
|
useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),
|
|
55
|
+
expandProjectExtents: 0 !== (tree.flags & TreeFlags.ExpandProjectExtents),
|
|
55
56
|
optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),
|
|
56
57
|
useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),
|
|
57
58
|
disableMagnification: false,
|
|
@@ -196,6 +197,7 @@ exports.defaultTileOptions = Object.freeze({
|
|
|
196
197
|
ignoreAreaPatterns: false,
|
|
197
198
|
enableExternalTextures: true,
|
|
198
199
|
useProjectExtents: true,
|
|
200
|
+
expandProjectExtents: true,
|
|
199
201
|
optimizeBRepProcessing: true,
|
|
200
202
|
useLargerTiles: true,
|
|
201
203
|
disableMagnification: false,
|
|
@@ -296,6 +298,7 @@ var TreeFlags;
|
|
|
296
298
|
TreeFlags[TreeFlags["EnforceDisplayPriority"] = 2] = "EnforceDisplayPriority";
|
|
297
299
|
TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
|
|
298
300
|
TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
|
|
301
|
+
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents"; // If UseProjectExtents, round them up/down to nearest powers of ten.
|
|
299
302
|
})(TreeFlags || (exports.TreeFlags = TreeFlags = {}));
|
|
300
303
|
function animationIdToString(animationId) {
|
|
301
304
|
return `A:${animationId}_`;
|
|
@@ -310,6 +313,8 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
310
313
|
flags |= TreeFlags.OptimizeBRepProcessing;
|
|
311
314
|
if (options.useLargerTiles)
|
|
312
315
|
flags |= TreeFlags.UseLargerTiles;
|
|
316
|
+
if (options.expandProjectExtents)
|
|
317
|
+
flags |= TreeFlags.ExpandProjectExtents;
|
|
313
318
|
if (FeatureTable_1.BatchType.Primary === treeId.type) {
|
|
314
319
|
if (undefined !== treeId.animationId)
|
|
315
320
|
idStr = `${idStr}${animationIdToString(treeId.animationId)}`;
|
|
@@ -322,8 +327,11 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
322
327
|
else {
|
|
323
328
|
const typeStr = FeatureTable_1.BatchType.PlanarClassifier === treeId.type ? "CP" : "C";
|
|
324
329
|
idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;
|
|
325
|
-
if (FeatureTable_1.BatchType.VolumeClassifier === treeId.type)
|
|
330
|
+
if (FeatureTable_1.BatchType.VolumeClassifier === treeId.type) {
|
|
331
|
+
// Volume classifiers always use the exact project extents.
|
|
326
332
|
flags |= TreeFlags.UseProjectExtents;
|
|
333
|
+
flags &= ~TreeFlags.ExpandProjectExtents;
|
|
334
|
+
}
|
|
327
335
|
if (undefined !== treeId.animationId)
|
|
328
336
|
idStr = `${idStr}${animationIdToString(treeId.animationId)}`;
|
|
329
337
|
}
|