@itwin/core-backend 3.7.11 → 3.7.12
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 +6 -1
- package/lib/cjs/AliCloudStorageService.d.ts +23 -23
- package/lib/cjs/AliCloudStorageService.js +71 -71
- package/lib/cjs/AliCloudStorageService.js.map +1 -1
- package/lib/cjs/BackendHubAccess.d.ts +224 -224
- package/lib/cjs/BackendHubAccess.js +41 -41
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
- package/lib/cjs/BackendLoggerCategory.js +99 -99
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts +21 -21
- package/lib/cjs/BisCoreSchema.js +60 -60
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +170 -170
- package/lib/cjs/BriefcaseManager.js +414 -414
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +153 -153
- package/lib/cjs/Category.js +243 -243
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
- package/lib/cjs/ChangeSummaryManager.js +447 -447
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.d.ts +99 -99
- package/lib/cjs/ChangedElementsDb.js +165 -165
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.d.ts +39 -39
- package/lib/cjs/ChangedElementsManager.js +88 -88
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts +121 -121
- package/lib/cjs/CheckpointManager.js +363 -363
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +79 -79
- package/lib/cjs/ClassRegistry.js +250 -250
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +350 -350
- package/lib/cjs/CloudSqlite.js +153 -153
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CloudStorageBackend.d.ts +58 -58
- package/lib/cjs/CloudStorageBackend.js +173 -173
- package/lib/cjs/CloudStorageBackend.js.map +1 -1
- package/lib/cjs/CodeService.d.ts +396 -396
- package/lib/cjs/CodeService.js +63 -63
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +55 -55
- package/lib/cjs/CodeSpecs.js +124 -124
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +13 -13
- package/lib/cjs/ConcurrentQuery.js +36 -36
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
- package/lib/cjs/CustomViewState3dCreator.js +82 -82
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.d.ts +71 -71
- package/lib/cjs/DevTools.js +154 -154
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +106 -106
- package/lib/cjs/DisplayStyle.js +256 -256
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +194 -194
- package/lib/cjs/ECDb.js +355 -355
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
- package/lib/cjs/ECSchemaXmlContext.js +41 -41
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +473 -473
- package/lib/cjs/ECSqlStatement.js +791 -791
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +1109 -1109
- package/lib/cjs/Element.js +1427 -1427
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +179 -179
- package/lib/cjs/ElementAspect.js +211 -211
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts +9 -9
- package/lib/cjs/ElementGraphics.js +41 -41
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +162 -162
- package/lib/cjs/ElementTreeWalker.js +409 -409
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.d.ts +106 -106
- package/lib/cjs/Entity.js +134 -134
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.d.ts +49 -49
- package/lib/cjs/EntityReferences.js +95 -95
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +317 -317
- package/lib/cjs/ExportGraphics.js +208 -208
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +96 -96
- package/lib/cjs/ExternalSource.js +131 -131
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts +19 -19
- package/lib/cjs/GeoCoordConfig.js +85 -85
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeometrySummary.d.ts +4 -4
- package/lib/cjs/GeometrySummary.js +380 -380
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.d.ts +94 -94
- package/lib/cjs/HubMock.js +222 -222
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelCloneContext.d.ts +8 -8
- package/lib/cjs/IModelCloneContext.js +15 -15
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +1213 -1213
- package/lib/cjs/IModelDb.js +2392 -2392
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
- package/lib/cjs/IModelElementCloneContext.js +159 -159
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +370 -370
- package/lib/cjs/IModelHost.js +497 -497
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.d.ts +62 -62
- package/lib/cjs/IModelJsFs.js +140 -140
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts +104 -104
- package/lib/cjs/IpcHost.js +278 -278
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +311 -311
- package/lib/cjs/LineStyle.js +295 -295
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts +162 -162
- package/lib/cjs/LocalHub.js +585 -585
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.d.ts +21 -21
- package/lib/cjs/LocalhostIpcHost.js +81 -81
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/Material.d.ts +131 -131
- package/lib/cjs/Material.js +181 -181
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +392 -392
- package/lib/cjs/Model.js +485 -485
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.d.ts +51 -51
- package/lib/cjs/NativeAppStorage.js +202 -202
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.d.ts +52 -52
- package/lib/cjs/NativeHost.js +163 -163
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.d.ts +156 -156
- package/lib/cjs/NavigationRelationship.js +225 -225
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.d.ts +51 -51
- package/lib/cjs/PromiseMemoizer.js +101 -101
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.d.ts +132 -132
- package/lib/cjs/PropertyStore.js +11 -11
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +416 -416
- package/lib/cjs/Relationship.js +494 -494
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.d.ts +5 -5
- package/lib/cjs/RpcBackend.js +32 -32
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +219 -219
- package/lib/cjs/SQLiteDb.js +214 -214
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.d.ts +55 -55
- package/lib/cjs/Schema.js +83 -83
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/ServerBasedLocks.d.ts +57 -57
- package/lib/cjs/ServerBasedLocks.js +168 -168
- package/lib/cjs/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +360 -360
- package/lib/cjs/SqliteStatement.js +586 -586
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/Texture.d.ts +58 -58
- package/lib/cjs/Texture.js +82 -82
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.d.ts +25 -25
- package/lib/cjs/TileStorage.js +102 -102
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +202 -202
- package/lib/cjs/TxnManager.js +356 -356
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +439 -439
- package/lib/cjs/ViewDefinition.js +646 -646
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.d.ts +13 -13
- package/lib/cjs/ViewStateHydrator.js +103 -103
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
- package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
- package/lib/cjs/core-backend.d.ts +184 -184
- package/lib/cjs/core-backend.js +204 -204
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
- package/lib/cjs/domains/FunctionalElements.js +145 -145
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
- package/lib/cjs/domains/FunctionalSchema.js +40 -40
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +177 -177
- package/lib/cjs/domains/GenericElements.js +263 -263
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.d.ts +10 -10
- package/lib/cjs/domains/GenericSchema.js +28 -28
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/rpc/multipart.d.ts +11 -11
- package/lib/cjs/rpc/multipart.js +71 -71
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.d.ts +28 -28
- package/lib/cjs/rpc/tracing.js +74 -74
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.d.ts +9 -9
- package/lib/cjs/rpc/web/logging.js +43 -43
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.d.ts +6 -6
- package/lib/cjs/rpc/web/request.js +74 -74
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.d.ts +6 -6
- package/lib/cjs/rpc/web/response.js +106 -106
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +294 -294
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +211 -211
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
- package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +186 -186
- package/lib/cjs/workspace/Settings.js +155 -155
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
- package/lib/cjs/workspace/SettingsSchemas.js +191 -191
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +414 -414
- package/lib/cjs/workspace/Workspace.js +543 -543
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../src/rpc/web/logging.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,oDAA6G;AAC7G,yBAAyB;AAEzB,4CAA4C;AAE5C,MAAa,uBAAwB,SAAQ,8BAAgB;IACxC,KAAK,CAAC,gBAAgB,CAAC,KAAuB,EAAE,MAAqB;QACtF,QAAQ,KAAK,EAAE;YACb,KAAK,8BAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,8BAA8B,EAA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O;SACX,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AA9BD,0DA8BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../src/rpc/web/logging.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,oDAA6G;AAC7G,yBAAyB;AAEzB,4CAA4C;AAE5C,MAAa,uBAAwB,SAAQ,8BAAgB;IACxC,KAAK,CAAC,gBAAgB,CAAC,KAAuB,EAAE,MAAqB;QACtF,QAAQ,KAAK,EAAE;YACb,KAAK,8BAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YACxJ,KAAK,8BAAgB,CAAC,oBAAoB,CAAC,CAAC,OAAO,IAAI,CAAC,eAAe,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;YAC9G,KAAK,8BAAgB,CAAC,sBAAsB,CAAC,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,+BAA+B,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;SACjM;IACH,CAAC;IAEkB,WAAW;QAC5B,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,OAAe,EAAE,UAAyB;QACtE,MAAM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAChF,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,2CAA2C;QAElH,qBAAM,CAAC,OAAO,CAAC,kCAAoB,CAAC,mBAAmB,EAAE,GAAG,OAAO,IAAI,mBAAmB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YACnG,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM;YACjC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI;YAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,YAAY;YACZ,uGAAuG;YACvG,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,GAAG,OAAO;SACX,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AA9BD,0DA8BC","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 { Logger } from \"@itwin/core-bentley\";\nimport { CommonLoggerCategory, RpcInvocation, RpcProtocolEvent, WebAppRpcLogging } from \"@itwin/core-common\";\nimport * as os from \"os\";\n\n/* eslint-disable deprecation/deprecation */\n\nexport class WebAppRpcLoggingBackend extends WebAppRpcLogging {\n protected override async logProtocolEvent(event: RpcProtocolEvent, object: RpcInvocation): Promise<void> {\n switch (event) {\n case RpcProtocolEvent.RequestReceived: return this.logRequest(CommonLoggerCategory.RpcInterfaceBackend, \"RpcInterface.backend.request\", object.request);\n case RpcProtocolEvent.BackendErrorOccurred: return this.logErrorBackend(\"RpcInterface.backend.error\", object);\n case RpcProtocolEvent.BackendResponseCreated: return this.logResponse(CommonLoggerCategory.RpcInterfaceBackend, \"RpcInterface.backend.response\", object.request, object.status, object.elapsed);\n }\n }\n\n protected override getHostname(): string {\n return os.hostname();\n }\n\n private async logErrorBackend(message: string, invocation: RpcInvocation): Promise<void> {\n const operationDescriptor = this.buildOperationDescriptor(invocation.operation);\n const pathIds = this.findPathIds(invocation.request.path);\n const result = await invocation.result;\n const errorMessage = result.message ? result.message : result.objects; // Can be an error or an RpcSerializedValue\n\n Logger.logInfo(CommonLoggerCategory.RpcInterfaceBackend, `${message}.${operationDescriptor}`, () => ({\n method: invocation.request.method,\n path: invocation.request.path,\n status: invocation.status,\n errorMessage,\n // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!\n ActivityId: invocation.request.id, // eslint-disable-line @typescript-eslint/naming-convention\n MachineName: this.getHostname(), // eslint-disable-line @typescript-eslint/naming-convention\n ...pathIds,\n }));\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module RpcInterface
|
|
3
|
-
*/
|
|
4
|
-
import { HttpServerRequest, SerializedRpcRequest, WebAppRpcProtocol } from "@itwin/core-common";
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare function parseRequest(protocol: WebAppRpcProtocol, req: HttpServerRequest): Promise<SerializedRpcRequest>;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module RpcInterface
|
|
3
|
+
*/
|
|
4
|
+
import { HttpServerRequest, SerializedRpcRequest, WebAppRpcProtocol } from "@itwin/core-common";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare function parseRequest(protocol: WebAppRpcProtocol, req: HttpServerRequest): Promise<SerializedRpcRequest>;
|
|
7
7
|
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module RpcInterface
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.parseRequest = void 0;
|
|
11
|
-
const core_common_1 = require("@itwin/core-common");
|
|
12
|
-
/* eslint-disable deprecation/deprecation */
|
|
13
|
-
function parseHeaders(protocol, req) {
|
|
14
|
-
var _a;
|
|
15
|
-
const headerNames = protocol.serializedClientRequestContextHeaderNames;
|
|
16
|
-
const parsedHeaders = {
|
|
17
|
-
id: req.header(headerNames.id) || "",
|
|
18
|
-
applicationId: req.header(headerNames.applicationId) || "",
|
|
19
|
-
applicationVersion: req.header(headerNames.applicationVersion) || "",
|
|
20
|
-
sessionId: req.header(headerNames.sessionId) || "",
|
|
21
|
-
authorization: (_a = (headerNames.authorization ? req.header(headerNames.authorization) : "")) !== null && _a !== void 0 ? _a : "",
|
|
22
|
-
};
|
|
23
|
-
return parsedHeaders;
|
|
24
|
-
}
|
|
25
|
-
function parseFromPath(operation) {
|
|
26
|
-
const decoded = operation.encodedRequest ? Buffer.from(operation.encodedRequest, "base64").toString("binary") : "";
|
|
27
|
-
return core_common_1.RpcSerializedValue.create(decoded);
|
|
28
|
-
}
|
|
29
|
-
async function parseFromBody(req) {
|
|
30
|
-
const contentType = core_common_1.WebAppRpcProtocol.computeContentType(req.header(core_common_1.WEB_RPC_CONSTANTS.CONTENT));
|
|
31
|
-
if (contentType === core_common_1.RpcContentType.Binary) {
|
|
32
|
-
const objects = JSON.stringify([core_common_1.MarshalingBinaryMarker.createDefault()]);
|
|
33
|
-
const data = [req.body];
|
|
34
|
-
return core_common_1.RpcSerializedValue.create(objects, data);
|
|
35
|
-
}
|
|
36
|
-
else if (contentType === core_common_1.RpcContentType.Multipart) {
|
|
37
|
-
return core_common_1.RpcMultipart.parseRequest(req);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return core_common_1.RpcSerializedValue.create(req.body);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/** @internal */
|
|
44
|
-
async function parseRequest(protocol, req) {
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
|
-
const operation = protocol.getOperationFromPath(req.url);
|
|
47
|
-
const parsedHeaders = parseHeaders(protocol, req);
|
|
48
|
-
const request = {
|
|
49
|
-
...parsedHeaders,
|
|
50
|
-
operation: {
|
|
51
|
-
interfaceDefinition: operation.interfaceDefinition,
|
|
52
|
-
operationName: operation.operationName,
|
|
53
|
-
interfaceVersion: operation.interfaceVersion,
|
|
54
|
-
},
|
|
55
|
-
method: req.method,
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
57
|
-
path: req.url,
|
|
58
|
-
parameters: operation.encodedRequest ? parseFromPath(operation) : await parseFromBody(req),
|
|
59
|
-
caching: operation.encodedRequest ? core_common_1.RpcResponseCacheControl.Immutable : core_common_1.RpcResponseCacheControl.None,
|
|
60
|
-
};
|
|
61
|
-
request.ip = req.ip;
|
|
62
|
-
request.protocolVersion = 0;
|
|
63
|
-
if (protocol.protocolVersionHeaderName) {
|
|
64
|
-
const version = req.header(protocol.protocolVersionHeaderName);
|
|
65
|
-
if (version) {
|
|
66
|
-
request.protocolVersion = parseInt(version, 10);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (!request.id) {
|
|
70
|
-
throw new core_common_1.IModelError(core_common_1.BentleyStatus.ERROR, `Invalid request: Missing required activity ID.`);
|
|
71
|
-
}
|
|
72
|
-
return request;
|
|
73
|
-
}
|
|
74
|
-
exports.parseRequest = parseRequest;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module RpcInterface
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.parseRequest = void 0;
|
|
11
|
+
const core_common_1 = require("@itwin/core-common");
|
|
12
|
+
/* eslint-disable deprecation/deprecation */
|
|
13
|
+
function parseHeaders(protocol, req) {
|
|
14
|
+
var _a;
|
|
15
|
+
const headerNames = protocol.serializedClientRequestContextHeaderNames;
|
|
16
|
+
const parsedHeaders = {
|
|
17
|
+
id: req.header(headerNames.id) || "",
|
|
18
|
+
applicationId: req.header(headerNames.applicationId) || "",
|
|
19
|
+
applicationVersion: req.header(headerNames.applicationVersion) || "",
|
|
20
|
+
sessionId: req.header(headerNames.sessionId) || "",
|
|
21
|
+
authorization: (_a = (headerNames.authorization ? req.header(headerNames.authorization) : "")) !== null && _a !== void 0 ? _a : "",
|
|
22
|
+
};
|
|
23
|
+
return parsedHeaders;
|
|
24
|
+
}
|
|
25
|
+
function parseFromPath(operation) {
|
|
26
|
+
const decoded = operation.encodedRequest ? Buffer.from(operation.encodedRequest, "base64").toString("binary") : "";
|
|
27
|
+
return core_common_1.RpcSerializedValue.create(decoded);
|
|
28
|
+
}
|
|
29
|
+
async function parseFromBody(req) {
|
|
30
|
+
const contentType = core_common_1.WebAppRpcProtocol.computeContentType(req.header(core_common_1.WEB_RPC_CONSTANTS.CONTENT));
|
|
31
|
+
if (contentType === core_common_1.RpcContentType.Binary) {
|
|
32
|
+
const objects = JSON.stringify([core_common_1.MarshalingBinaryMarker.createDefault()]);
|
|
33
|
+
const data = [req.body];
|
|
34
|
+
return core_common_1.RpcSerializedValue.create(objects, data);
|
|
35
|
+
}
|
|
36
|
+
else if (contentType === core_common_1.RpcContentType.Multipart) {
|
|
37
|
+
return core_common_1.RpcMultipart.parseRequest(req);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return core_common_1.RpcSerializedValue.create(req.body);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** @internal */
|
|
44
|
+
async function parseRequest(protocol, req) {
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
|
+
const operation = protocol.getOperationFromPath(req.url);
|
|
47
|
+
const parsedHeaders = parseHeaders(protocol, req);
|
|
48
|
+
const request = {
|
|
49
|
+
...parsedHeaders,
|
|
50
|
+
operation: {
|
|
51
|
+
interfaceDefinition: operation.interfaceDefinition,
|
|
52
|
+
operationName: operation.operationName,
|
|
53
|
+
interfaceVersion: operation.interfaceVersion,
|
|
54
|
+
},
|
|
55
|
+
method: req.method,
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
57
|
+
path: req.url,
|
|
58
|
+
parameters: operation.encodedRequest ? parseFromPath(operation) : await parseFromBody(req),
|
|
59
|
+
caching: operation.encodedRequest ? core_common_1.RpcResponseCacheControl.Immutable : core_common_1.RpcResponseCacheControl.None,
|
|
60
|
+
};
|
|
61
|
+
request.ip = req.ip;
|
|
62
|
+
request.protocolVersion = 0;
|
|
63
|
+
if (protocol.protocolVersionHeaderName) {
|
|
64
|
+
const version = req.header(protocol.protocolVersionHeaderName);
|
|
65
|
+
if (version) {
|
|
66
|
+
request.protocolVersion = parseInt(version, 10);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (!request.id) {
|
|
70
|
+
throw new core_common_1.IModelError(core_common_1.BentleyStatus.ERROR, `Invalid request: Missing required activity ID.`);
|
|
71
|
+
}
|
|
72
|
+
return request;
|
|
73
|
+
}
|
|
74
|
+
exports.parseRequest = parseRequest;
|
|
75
75
|
//# sourceMappingURL=request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/rpc/web/request.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAc4B;AAE5B,4CAA4C;AAE5C,SAAS,YAAY,CAAC,QAA2B,EAAE,GAAsB;;IACvE,MAAM,WAAW,GAA0B,QAAQ,CAAC,yCAAyC,CAAC;IAC9F,MAAM,aAAa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,eAAe,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SACjD;KACF;IAED,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE;QACf,MAAM,IAAI,yBAAW,CAAC,2BAAa,CAAC,KAAK,EAAE,gDAAgD,CAAC,CAAC;KAC9F;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AApCD,oCAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/rpc/web/request.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAc4B;AAE5B,4CAA4C;AAE5C,SAAS,YAAY,CAAC,QAA2B,EAAE,GAAsB;;IACvE,MAAM,WAAW,GAA0B,QAAQ,CAAC,yCAAyC,CAAC;IAC9F,MAAM,aAAa,GAA0B;QAC3C,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QACpC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,EAAE;QAC1D,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE;QACpE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE;QAClD,aAAa,EAAE,MAAA,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,mCAAI,EAAE;KAC9F,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,aAAa,CAAC,SAAiC;IACtD,MAAM,OAAO,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,QAAQ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AAE,GAAG,CAAC,GAAI;QACd,UAAU,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC;QAC1F,OAAO,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,qCAAuB,CAAC,SAAS,CAAC,CAAC,CAAC,qCAAuB,CAAC,IAAI;KACrG,CAAC;IAEF,OAAO,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;IAEpB,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC;IAE5B,IAAI,QAAQ,CAAC,yBAAyB,EAAE;QACtC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;QAC/D,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,eAAe,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SACjD;KACF;IAED,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE;QACf,MAAM,IAAI,yBAAW,CAAC,2BAAa,CAAC,KAAK,EAAE,gDAAgD,CAAC,CAAC;KAC9F;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AApCD,oCAoCC","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 {\n BentleyStatus,\n HttpServerRequest,\n IModelError,\n MarshalingBinaryMarker,\n RpcContentType,\n RpcMultipart,\n RpcResponseCacheControl,\n RpcSerializedValue,\n SerializedRpcActivity,\n SerializedRpcOperation,\n SerializedRpcRequest,\n WEB_RPC_CONSTANTS,\n WebAppRpcProtocol,\n} from \"@itwin/core-common\";\n\n/* eslint-disable deprecation/deprecation */\n\nfunction parseHeaders(protocol: WebAppRpcProtocol, req: HttpServerRequest): SerializedRpcActivity {\n const headerNames: SerializedRpcActivity = protocol.serializedClientRequestContextHeaderNames;\n const parsedHeaders: SerializedRpcActivity = {\n id: req.header(headerNames.id) || \"\",\n applicationId: req.header(headerNames.applicationId) || \"\",\n applicationVersion: req.header(headerNames.applicationVersion) || \"\",\n sessionId: req.header(headerNames.sessionId) || \"\",\n authorization: (headerNames.authorization ? req.header(headerNames.authorization) : \"\") ?? \"\",\n };\n return parsedHeaders;\n}\n\nfunction parseFromPath(operation: SerializedRpcOperation): RpcSerializedValue {\n const decoded = operation.encodedRequest ? Buffer.from(operation.encodedRequest, \"base64\").toString(\"binary\") : \"\";\n return RpcSerializedValue.create(decoded);\n}\n\nasync function parseFromBody(req: HttpServerRequest): Promise<RpcSerializedValue> {\n const contentType = WebAppRpcProtocol.computeContentType(req.header(WEB_RPC_CONSTANTS.CONTENT));\n if (contentType === RpcContentType.Binary) {\n const objects = JSON.stringify([MarshalingBinaryMarker.createDefault()]);\n const data = [req.body as Buffer];\n return RpcSerializedValue.create(objects, data);\n } else if (contentType === RpcContentType.Multipart) {\n return RpcMultipart.parseRequest(req);\n } else {\n return RpcSerializedValue.create(req.body as string);\n }\n}\n\n/** @internal */\nexport async function parseRequest(protocol: WebAppRpcProtocol, req: HttpServerRequest): Promise<SerializedRpcRequest> {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const operation = protocol.getOperationFromPath(req.url!);\n\n const parsedHeaders = parseHeaders(protocol, req);\n\n const request: SerializedRpcRequest = {\n ...parsedHeaders,\n operation: {\n interfaceDefinition: operation.interfaceDefinition,\n operationName: operation.operationName,\n interfaceVersion: operation.interfaceVersion,\n },\n method: req.method,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n path: req.url!,\n parameters: operation.encodedRequest ? parseFromPath(operation) : await parseFromBody(req),\n caching: operation.encodedRequest ? RpcResponseCacheControl.Immutable : RpcResponseCacheControl.None,\n };\n\n request.ip = req.ip;\n\n request.protocolVersion = 0;\n\n if (protocol.protocolVersionHeaderName) {\n const version = req.header(protocol.protocolVersionHeaderName);\n if (version) {\n request.protocolVersion = parseInt(version, 10);\n }\n }\n\n if (!request.id) {\n throw new IModelError(BentleyStatus.ERROR, `Invalid request: Missing required activity ID.`);\n }\n\n return request;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module RpcInterface
|
|
3
|
-
*/
|
|
4
|
-
import { HttpServerRequest, HttpServerResponse, RpcRequestFulfillment, SerializedRpcRequest, WebAppRpcProtocol } from "@itwin/core-common";
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare function sendResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, req: HttpServerRequest, res: HttpServerResponse): Promise<void>;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module RpcInterface
|
|
3
|
+
*/
|
|
4
|
+
import { HttpServerRequest, HttpServerResponse, RpcRequestFulfillment, SerializedRpcRequest, WebAppRpcProtocol } from "@itwin/core-common";
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare function sendResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, req: HttpServerRequest, res: HttpServerResponse): Promise<void>;
|
|
7
7
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module RpcInterface
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.sendResponse = void 0;
|
|
11
|
-
const core_common_1 = require("@itwin/core-common");
|
|
12
|
-
/* eslint-disable deprecation/deprecation */
|
|
13
|
-
function configureResponse(protocol, request, fulfillment, res) {
|
|
14
|
-
const success = protocol.getStatus(fulfillment.status) === core_common_1.RpcRequestStatus.Resolved;
|
|
15
|
-
// TODO: Use stale-while-revalidate in cache headers. This needs to be tested, and does not currently have support in the router/caching-service.
|
|
16
|
-
// This will allow browsers to use stale cached responses while also revalidating with the router, allowing us to start up a backend if necessary.
|
|
17
|
-
// RPC Caching Service uses the s-maxage header to determine the TTL for the redis cache.
|
|
18
|
-
const oneHourInSeconds = 3600;
|
|
19
|
-
if (success && request.caching === core_common_1.RpcResponseCacheControl.Immutable) {
|
|
20
|
-
// If response size is > 50 MB, do not cache it.
|
|
21
|
-
if (fulfillment.result.objects.length > (50 * 10 ** 7)) {
|
|
22
|
-
res.set("Cache-Control", "no-store");
|
|
23
|
-
}
|
|
24
|
-
else if (request.operation.operationName === "generateTileContent") {
|
|
25
|
-
res.set("Cache-Control", "no-store");
|
|
26
|
-
}
|
|
27
|
-
else if (request.operation.operationName === "getConnectionProps") {
|
|
28
|
-
// GetConnectionprops can't be cached on the browser longer than the lifespan of the backend. The lifespan of backend may shrink too. Keep it at 1 second to be safe.
|
|
29
|
-
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 24}, max-age=1, immutable`);
|
|
30
|
-
}
|
|
31
|
-
else if (request.operation.operationName === "getTileCacheContainerUrl") {
|
|
32
|
-
// getTileCacheContainerUrl returns a SAS with an expiry of 23:59:59. We can't exceed that time when setting the max-age.
|
|
33
|
-
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 23}, max-age=${oneHourInSeconds * 23}, immutable`);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 24}, max-age=${oneHourInSeconds * 48}, immutable`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (fulfillment.retry) {
|
|
40
|
-
res.set("Retry-After", fulfillment.retry);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function configureText(fulfillment, res) {
|
|
44
|
-
res.set(core_common_1.WEB_RPC_CONSTANTS.CONTENT, core_common_1.WEB_RPC_CONSTANTS.TEXT);
|
|
45
|
-
return (fulfillment.status === 204) ? "" : fulfillment.result.objects;
|
|
46
|
-
}
|
|
47
|
-
function configureBinary(fulfillment, res) {
|
|
48
|
-
res.set(core_common_1.WEB_RPC_CONSTANTS.CONTENT, core_common_1.WEB_RPC_CONSTANTS.BINARY);
|
|
49
|
-
const data = fulfillment.result.data[0];
|
|
50
|
-
return Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
51
|
-
}
|
|
52
|
-
function configureMultipart(fulfillment, res) {
|
|
53
|
-
const response = core_common_1.RpcMultipart.createStream(fulfillment.result);
|
|
54
|
-
const headers = response.getHeaders();
|
|
55
|
-
for (const header in headers) {
|
|
56
|
-
if (headers.hasOwnProperty(header)) {
|
|
57
|
-
res.set(header, headers[header]);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return response;
|
|
61
|
-
}
|
|
62
|
-
function configureStream(fulfillment) {
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
|
-
return fulfillment.result.stream;
|
|
65
|
-
}
|
|
66
|
-
/** @internal */
|
|
67
|
-
async function sendResponse(protocol, request, fulfillment, req, res) {
|
|
68
|
-
var _a;
|
|
69
|
-
const versionHeader = protocol.protocolVersionHeaderName;
|
|
70
|
-
if (versionHeader && core_common_1.RpcProtocol.protocolVersion) {
|
|
71
|
-
res.set(versionHeader, core_common_1.RpcProtocol.protocolVersion.toString());
|
|
72
|
-
}
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
74
|
-
const { Readable, Stream } = await Promise.resolve().then(() => require(/* webpackIgnore: true */ "stream"));
|
|
75
|
-
const { createGzip } = await Promise.resolve().then(() => require(/* webpackIgnore: true */ "zlib"));
|
|
76
|
-
const transportType = core_common_1.WebAppRpcRequest.computeTransportType(fulfillment.result, fulfillment.rawResult);
|
|
77
|
-
let responseBody;
|
|
78
|
-
if (transportType === core_common_1.RpcContentType.Binary) {
|
|
79
|
-
responseBody = configureBinary(fulfillment, res);
|
|
80
|
-
}
|
|
81
|
-
else if (transportType === core_common_1.RpcContentType.Multipart) {
|
|
82
|
-
responseBody = configureMultipart(fulfillment, res);
|
|
83
|
-
}
|
|
84
|
-
else if (transportType === core_common_1.RpcContentType.Stream) {
|
|
85
|
-
responseBody = configureStream(fulfillment);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
responseBody = configureText(fulfillment, res);
|
|
89
|
-
}
|
|
90
|
-
configureResponse(protocol, request, fulfillment, res);
|
|
91
|
-
res.status(fulfillment.status);
|
|
92
|
-
if (fulfillment.allowCompression && ((_a = req.header("Accept-Encoding")) === null || _a === void 0 ? void 0 : _a.includes("gzip"))) {
|
|
93
|
-
res.set("Content-Encoding", "gzip");
|
|
94
|
-
const readableResponseBody = (responseBody instanceof Stream) ? responseBody : Readable.from(responseBody);
|
|
95
|
-
responseBody = readableResponseBody.pipe(createGzip());
|
|
96
|
-
}
|
|
97
|
-
// This check should in theory look for instances of Readable, but that would break backend implementation at
|
|
98
|
-
// core/backend/src/RpcBackend.ts
|
|
99
|
-
if (responseBody instanceof Stream) {
|
|
100
|
-
responseBody.pipe(res);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
res.send(responseBody);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
exports.sendResponse = sendResponse;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module RpcInterface
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.sendResponse = void 0;
|
|
11
|
+
const core_common_1 = require("@itwin/core-common");
|
|
12
|
+
/* eslint-disable deprecation/deprecation */
|
|
13
|
+
function configureResponse(protocol, request, fulfillment, res) {
|
|
14
|
+
const success = protocol.getStatus(fulfillment.status) === core_common_1.RpcRequestStatus.Resolved;
|
|
15
|
+
// TODO: Use stale-while-revalidate in cache headers. This needs to be tested, and does not currently have support in the router/caching-service.
|
|
16
|
+
// This will allow browsers to use stale cached responses while also revalidating with the router, allowing us to start up a backend if necessary.
|
|
17
|
+
// RPC Caching Service uses the s-maxage header to determine the TTL for the redis cache.
|
|
18
|
+
const oneHourInSeconds = 3600;
|
|
19
|
+
if (success && request.caching === core_common_1.RpcResponseCacheControl.Immutable) {
|
|
20
|
+
// If response size is > 50 MB, do not cache it.
|
|
21
|
+
if (fulfillment.result.objects.length > (50 * 10 ** 7)) {
|
|
22
|
+
res.set("Cache-Control", "no-store");
|
|
23
|
+
}
|
|
24
|
+
else if (request.operation.operationName === "generateTileContent") {
|
|
25
|
+
res.set("Cache-Control", "no-store");
|
|
26
|
+
}
|
|
27
|
+
else if (request.operation.operationName === "getConnectionProps") {
|
|
28
|
+
// GetConnectionprops can't be cached on the browser longer than the lifespan of the backend. The lifespan of backend may shrink too. Keep it at 1 second to be safe.
|
|
29
|
+
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 24}, max-age=1, immutable`);
|
|
30
|
+
}
|
|
31
|
+
else if (request.operation.operationName === "getTileCacheContainerUrl") {
|
|
32
|
+
// getTileCacheContainerUrl returns a SAS with an expiry of 23:59:59. We can't exceed that time when setting the max-age.
|
|
33
|
+
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 23}, max-age=${oneHourInSeconds * 23}, immutable`);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
res.set("Cache-Control", `s-maxage=${oneHourInSeconds * 24}, max-age=${oneHourInSeconds * 48}, immutable`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (fulfillment.retry) {
|
|
40
|
+
res.set("Retry-After", fulfillment.retry);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function configureText(fulfillment, res) {
|
|
44
|
+
res.set(core_common_1.WEB_RPC_CONSTANTS.CONTENT, core_common_1.WEB_RPC_CONSTANTS.TEXT);
|
|
45
|
+
return (fulfillment.status === 204) ? "" : fulfillment.result.objects;
|
|
46
|
+
}
|
|
47
|
+
function configureBinary(fulfillment, res) {
|
|
48
|
+
res.set(core_common_1.WEB_RPC_CONSTANTS.CONTENT, core_common_1.WEB_RPC_CONSTANTS.BINARY);
|
|
49
|
+
const data = fulfillment.result.data[0];
|
|
50
|
+
return Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
51
|
+
}
|
|
52
|
+
function configureMultipart(fulfillment, res) {
|
|
53
|
+
const response = core_common_1.RpcMultipart.createStream(fulfillment.result);
|
|
54
|
+
const headers = response.getHeaders();
|
|
55
|
+
for (const header in headers) {
|
|
56
|
+
if (headers.hasOwnProperty(header)) {
|
|
57
|
+
res.set(header, headers[header]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return response;
|
|
61
|
+
}
|
|
62
|
+
function configureStream(fulfillment) {
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
|
+
return fulfillment.result.stream;
|
|
65
|
+
}
|
|
66
|
+
/** @internal */
|
|
67
|
+
async function sendResponse(protocol, request, fulfillment, req, res) {
|
|
68
|
+
var _a;
|
|
69
|
+
const versionHeader = protocol.protocolVersionHeaderName;
|
|
70
|
+
if (versionHeader && core_common_1.RpcProtocol.protocolVersion) {
|
|
71
|
+
res.set(versionHeader, core_common_1.RpcProtocol.protocolVersion.toString());
|
|
72
|
+
}
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
74
|
+
const { Readable, Stream } = await Promise.resolve().then(() => require(/* webpackIgnore: true */ "stream"));
|
|
75
|
+
const { createGzip } = await Promise.resolve().then(() => require(/* webpackIgnore: true */ "zlib"));
|
|
76
|
+
const transportType = core_common_1.WebAppRpcRequest.computeTransportType(fulfillment.result, fulfillment.rawResult);
|
|
77
|
+
let responseBody;
|
|
78
|
+
if (transportType === core_common_1.RpcContentType.Binary) {
|
|
79
|
+
responseBody = configureBinary(fulfillment, res);
|
|
80
|
+
}
|
|
81
|
+
else if (transportType === core_common_1.RpcContentType.Multipart) {
|
|
82
|
+
responseBody = configureMultipart(fulfillment, res);
|
|
83
|
+
}
|
|
84
|
+
else if (transportType === core_common_1.RpcContentType.Stream) {
|
|
85
|
+
responseBody = configureStream(fulfillment);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
responseBody = configureText(fulfillment, res);
|
|
89
|
+
}
|
|
90
|
+
configureResponse(protocol, request, fulfillment, res);
|
|
91
|
+
res.status(fulfillment.status);
|
|
92
|
+
if (fulfillment.allowCompression && ((_a = req.header("Accept-Encoding")) === null || _a === void 0 ? void 0 : _a.includes("gzip"))) {
|
|
93
|
+
res.set("Content-Encoding", "gzip");
|
|
94
|
+
const readableResponseBody = (responseBody instanceof Stream) ? responseBody : Readable.from(responseBody);
|
|
95
|
+
responseBody = readableResponseBody.pipe(createGzip());
|
|
96
|
+
}
|
|
97
|
+
// This check should in theory look for instances of Readable, but that would break backend implementation at
|
|
98
|
+
// core/backend/src/RpcBackend.ts
|
|
99
|
+
if (responseBody instanceof Stream) {
|
|
100
|
+
responseBody.pipe(res);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
res.send(responseBody);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.sendResponse = sendResponse;
|
|
107
107
|
//# sourceMappingURL=response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/rpc/web/response.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAc4B;AAE5B,4CAA4C;AAE5C,SAAS,iBAAiB,CAAC,QAA2B,E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AG,CAAC,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QACpC,MAAM,oBAAoB,GAAG,CAAC,YAAY,YAAY,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3G,YAAY,GAAG,oBAAoB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;KACxD;IAED,6GAA6G;IAC7G,iCAAiC;IACjC,IAAI,YAAY,YAAY,MAAM,EAAE;QAClC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACxB;SAAM;QACL,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACxB;AACH,CAAC;AArCD,oCAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/rpc/web/response.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAc4B;AAE5B,4CAA4C;AAE5C,SAAS,iBAAiB,CAAC,QAA2B,EAAE,OAA6B,EAAE,WAAkC,EAAE,GAAuB;IAChJ,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,8BAAgB,CAAC,QAAQ,CAAC;IACrF,iJAAiJ;IACjJ,kJAAkJ;IAElJ,yFAAyF;IACzF,MAAM,gBAAgB,GAAG,IAAI,CAAC;IAC9B,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,qCAAuB,CAAC,SAAS,EAAE;QACpE,gDAAgD;QAChD,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE;YACtD,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;SACtC;aAAM,IAAI,OAAO,CAAC,SAAS,CAAC,aAAa,KAA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CAAC;IACjB,IAAI,aAAa,KAAK,4BAAc,CAAC,MAAM,EAAE;QAC3C,YAAY,GAAG,eAAe,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;KAClD;SAAM,IAAI,aAAa,KAAK,4BAAc,CAAC,SAAS,EAAE;QACrD,YAAY,GAAG,kBAAkB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;KACrD;SAAM,IAAI,aAAa,KAAK,4BAAc,CAAC,MAAM,EAAE;QAClD,YAAY,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;KAC7C;SAAM;QACL,YAAY,GAAG,aAAa,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;KAChD;IAED,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;IACvD,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAE/B,IAAI,WAAW,CAAC,gBAAgB,KAAI,MAAA,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,0CAAE,QAAQ,CAAC,MAAM,CAAC,CAAA,EAAE;QACnF,GAAG,CAAC,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QACpC,MAAM,oBAAoB,GAAG,CAAC,YAAY,YAAY,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3G,YAAY,GAAG,oBAAoB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;KACxD;IAED,6GAA6G;IAC7G,iCAAiC;IACjC,IAAI,YAAY,YAAY,MAAM,EAAE;QAClC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACxB;SAAM;QACL,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACxB;AACH,CAAC;AArCD,oCAqCC","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 {\n HttpServerRequest,\n HttpServerResponse,\n ReadableFormData,\n RpcContentType,\n RpcMultipart,\n RpcProtocol,\n RpcRequestFulfillment,\n RpcRequestStatus,\n RpcResponseCacheControl,\n SerializedRpcRequest,\n WEB_RPC_CONSTANTS,\n WebAppRpcProtocol,\n WebAppRpcRequest,\n} from \"@itwin/core-common\";\n\n/* eslint-disable deprecation/deprecation */\n\nfunction configureResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, res: HttpServerResponse) {\n const success = protocol.getStatus(fulfillment.status) === RpcRequestStatus.Resolved;\n // TODO: Use stale-while-revalidate in cache headers. This needs to be tested, and does not currently have support in the router/caching-service.\n // This will allow browsers to use stale cached responses while also revalidating with the router, allowing us to start up a backend if necessary.\n\n // RPC Caching Service uses the s-maxage header to determine the TTL for the redis cache.\n const oneHourInSeconds = 3600;\n if (success && request.caching === RpcResponseCacheControl.Immutable) {\n // If response size is > 50 MB, do not cache it.\n if (fulfillment.result.objects.length > (50 * 10 ** 7)) {\n res.set(\"Cache-Control\", \"no-store\");\n } else if (request.operation.operationName === \"generateTileContent\") {\n res.set(\"Cache-Control\", \"no-store\");\n } else if (request.operation.operationName === \"getConnectionProps\") {\n // GetConnectionprops can't be cached on the browser longer than the lifespan of the backend. The lifespan of backend may shrink too. Keep it at 1 second to be safe.\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=1, immutable`);\n } else if (request.operation.operationName === \"getTileCacheContainerUrl\") {\n // getTileCacheContainerUrl returns a SAS with an expiry of 23:59:59. We can't exceed that time when setting the max-age.\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 23}, max-age=${oneHourInSeconds * 23}, immutable`);\n } else {\n res.set(\"Cache-Control\", `s-maxage=${oneHourInSeconds * 24}, max-age=${oneHourInSeconds * 48}, immutable`);\n }\n }\n\n if (fulfillment.retry) {\n res.set(\"Retry-After\", fulfillment.retry);\n }\n}\n\nfunction configureText(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): string {\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.TEXT);\n return (fulfillment.status === 204) ? \"\" : fulfillment.result.objects;\n}\n\nfunction configureBinary(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): Buffer {\n res.set(WEB_RPC_CONSTANTS.CONTENT, WEB_RPC_CONSTANTS.BINARY);\n const data = fulfillment.result.data[0];\n return Buffer.isBuffer(data) ? data : Buffer.from(data);\n}\n\nfunction configureMultipart(fulfillment: RpcRequestFulfillment, res: HttpServerResponse): ReadableFormData {\n const response = RpcMultipart.createStream(fulfillment.result);\n const headers = response.getHeaders();\n for (const header in headers) {\n if (headers.hasOwnProperty(header)) {\n res.set(header, headers[header]);\n }\n }\n\n return response;\n}\n\nfunction configureStream(fulfillment: RpcRequestFulfillment) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return fulfillment.result.stream!;\n}\n\n/** @internal */\nexport async function sendResponse(protocol: WebAppRpcProtocol, request: SerializedRpcRequest, fulfillment: RpcRequestFulfillment, req: HttpServerRequest, res: HttpServerResponse) {\n const versionHeader = protocol.protocolVersionHeaderName;\n if (versionHeader && RpcProtocol.protocolVersion) {\n res.set(versionHeader, RpcProtocol.protocolVersion.toString());\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { Readable, Stream } = await import(/* webpackIgnore: true */ \"stream\");\n const { createGzip } = await import(/* webpackIgnore: true */ \"zlib\");\n\n const transportType = WebAppRpcRequest.computeTransportType(fulfillment.result, fulfillment.rawResult);\n let responseBody;\n if (transportType === RpcContentType.Binary) {\n responseBody = configureBinary(fulfillment, res);\n } else if (transportType === RpcContentType.Multipart) {\n responseBody = configureMultipart(fulfillment, res);\n } else if (transportType === RpcContentType.Stream) {\n responseBody = configureStream(fulfillment);\n } else {\n responseBody = configureText(fulfillment, res);\n }\n\n configureResponse(protocol, request, fulfillment, res);\n res.status(fulfillment.status);\n\n if (fulfillment.allowCompression && req.header(\"Accept-Encoding\")?.includes(\"gzip\")) {\n res.set(\"Content-Encoding\", \"gzip\");\n const readableResponseBody = (responseBody instanceof Stream) ? responseBody : Readable.from(responseBody);\n responseBody = readableResponseBody.pipe(createGzip());\n }\n\n // This check should in theory look for instances of Readable, but that would break backend implementation at\n // core/backend/src/RpcBackend.ts\n if (responseBody instanceof Stream) {\n responseBody.pipe(res);\n } else {\n res.send(responseBody);\n }\n}\n"]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module RpcInterface
|
|
3
|
-
*/
|
|
4
|
-
import { LogLevel } from "@itwin/core-bentley";
|
|
5
|
-
import { DevToolsRpcInterface, DevToolsStatsOptions, IModelRpcProps, RpcInterface } from "@itwin/core-common";
|
|
6
|
-
/** The backend implementation of WipRpcInterface.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare class DevToolsRpcImpl extends RpcInterface implements DevToolsRpcInterface {
|
|
10
|
-
static register(): void;
|
|
11
|
-
ping(_tokenProps: IModelRpcProps): Promise<boolean>;
|
|
12
|
-
stats(_tokenProps: IModelRpcProps, options: DevToolsStatsOptions): Promise<any>;
|
|
13
|
-
versions(_tokenProps: IModelRpcProps): Promise<any>;
|
|
14
|
-
setLogLevel(_tokenProps: IModelRpcProps, loggerCategory: string, logLevel: LogLevel): Promise<LogLevel | undefined>;
|
|
15
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module RpcInterface
|
|
3
|
+
*/
|
|
4
|
+
import { LogLevel } from "@itwin/core-bentley";
|
|
5
|
+
import { DevToolsRpcInterface, DevToolsStatsOptions, IModelRpcProps, RpcInterface } from "@itwin/core-common";
|
|
6
|
+
/** The backend implementation of WipRpcInterface.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class DevToolsRpcImpl extends RpcInterface implements DevToolsRpcInterface {
|
|
10
|
+
static register(): void;
|
|
11
|
+
ping(_tokenProps: IModelRpcProps): Promise<boolean>;
|
|
12
|
+
stats(_tokenProps: IModelRpcProps, options: DevToolsStatsOptions): Promise<any>;
|
|
13
|
+
versions(_tokenProps: IModelRpcProps): Promise<any>;
|
|
14
|
+
setLogLevel(_tokenProps: IModelRpcProps, loggerCategory: string, logLevel: LogLevel): Promise<LogLevel | undefined>;
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=DevToolsRpcImpl.d.ts.map
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DevToolsRpcImpl = void 0;
|
|
4
|
-
const core_common_1 = require("@itwin/core-common");
|
|
5
|
-
const DevTools_1 = require("../DevTools");
|
|
6
|
-
/** The backend implementation of WipRpcInterface.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
class DevToolsRpcImpl extends core_common_1.RpcInterface {
|
|
10
|
-
static register() { core_common_1.RpcManager.registerImpl(core_common_1.DevToolsRpcInterface, DevToolsRpcImpl); }
|
|
11
|
-
// Returns true if the backend received the ping
|
|
12
|
-
async ping(_tokenProps) {
|
|
13
|
-
return DevTools_1.DevTools.ping();
|
|
14
|
-
}
|
|
15
|
-
// Returns JSON object with statistics
|
|
16
|
-
async stats(_tokenProps, options) {
|
|
17
|
-
const stats = DevTools_1.DevTools.stats();
|
|
18
|
-
if (options === core_common_1.DevToolsStatsOptions.None)
|
|
19
|
-
return stats;
|
|
20
|
-
const formattedStats = DevTools_1.DevToolsStatsFormatter.toFormattedJson(stats);
|
|
21
|
-
return formattedStats;
|
|
22
|
-
}
|
|
23
|
-
// Returns JSON object with backend versions (application and iModelJs)
|
|
24
|
-
async versions(_tokenProps) {
|
|
25
|
-
return DevTools_1.DevTools.versions();
|
|
26
|
-
}
|
|
27
|
-
// Sets up a log level at the backend
|
|
28
|
-
async setLogLevel(_tokenProps, loggerCategory, logLevel) {
|
|
29
|
-
return DevTools_1.DevTools.setLogLevel(loggerCategory, logLevel);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.DevToolsRpcImpl = DevToolsRpcImpl;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DevToolsRpcImpl = void 0;
|
|
4
|
+
const core_common_1 = require("@itwin/core-common");
|
|
5
|
+
const DevTools_1 = require("../DevTools");
|
|
6
|
+
/** The backend implementation of WipRpcInterface.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
class DevToolsRpcImpl extends core_common_1.RpcInterface {
|
|
10
|
+
static register() { core_common_1.RpcManager.registerImpl(core_common_1.DevToolsRpcInterface, DevToolsRpcImpl); }
|
|
11
|
+
// Returns true if the backend received the ping
|
|
12
|
+
async ping(_tokenProps) {
|
|
13
|
+
return DevTools_1.DevTools.ping();
|
|
14
|
+
}
|
|
15
|
+
// Returns JSON object with statistics
|
|
16
|
+
async stats(_tokenProps, options) {
|
|
17
|
+
const stats = DevTools_1.DevTools.stats();
|
|
18
|
+
if (options === core_common_1.DevToolsStatsOptions.None)
|
|
19
|
+
return stats;
|
|
20
|
+
const formattedStats = DevTools_1.DevToolsStatsFormatter.toFormattedJson(stats);
|
|
21
|
+
return formattedStats;
|
|
22
|
+
}
|
|
23
|
+
// Returns JSON object with backend versions (application and iModelJs)
|
|
24
|
+
async versions(_tokenProps) {
|
|
25
|
+
return DevTools_1.DevTools.versions();
|
|
26
|
+
}
|
|
27
|
+
// Sets up a log level at the backend
|
|
28
|
+
async setLogLevel(_tokenProps, loggerCategory, logLevel) {
|
|
29
|
+
return DevTools_1.DevTools.setLogLevel(loggerCategory, logLevel);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.DevToolsRpcImpl = DevToolsRpcImpl;
|
|
33
33
|
//# sourceMappingURL=DevToolsRpcImpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevToolsRpcImpl.js","sourceRoot":"","sources":["../../../src/rpc-impl/DevToolsRpcImpl.ts"],"names":[],"mappings":";;;AAQA,oDAA0H;AAC1H,0CAA+D;AAE/D;;GAEG;AACH,MAAa,eAAgB,SAAQ,0BAAY;IACxC,MAAM,CAAC,QAAQ,KAAK,wBAAU,CAAC,YAAY,CAAC,kCAAoB,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE5F,gDAAgD;IACzC,KAAK,CAAC,IAAI,CAAC,WAA2B;QAC3C,OAAO,mBAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,KAAK,CAAC,WAA2B,EAAE,OAA6B;QAC3E,MAAM,KAAK,GAAG,mBAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,OAAO,KAAK,kCAAoB,CAAC,IAAI;YACvC,OAAO,KAAK,CAAC;QACf,MAAM,cAAc,GAAG,iCAAsB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACrE,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,uEAAuE;IAChE,KAAK,CAAC,QAAQ,CAAC,WAA2B;QAC/C,OAAO,mBAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED,qCAAqC;IAC9B,KAAK,CAAC,WAAW,CAAC,WAA2B,EAAE,cAAsB,EAAE,QAAkB;QAC9F,OAAO,mBAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AA1BD,0CA0BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"DevToolsRpcImpl.js","sourceRoot":"","sources":["../../../src/rpc-impl/DevToolsRpcImpl.ts"],"names":[],"mappings":";;;AAQA,oDAA0H;AAC1H,0CAA+D;AAE/D;;GAEG;AACH,MAAa,eAAgB,SAAQ,0BAAY;IACxC,MAAM,CAAC,QAAQ,KAAK,wBAAU,CAAC,YAAY,CAAC,kCAAoB,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE5F,gDAAgD;IACzC,KAAK,CAAC,IAAI,CAAC,WAA2B;QAC3C,OAAO,mBAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,KAAK,CAAC,WAA2B,EAAE,OAA6B;QAC3E,MAAM,KAAK,GAAG,mBAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,OAAO,KAAK,kCAAoB,CAAC,IAAI;YACvC,OAAO,KAAK,CAAC;QACf,MAAM,cAAc,GAAG,iCAAsB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACrE,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,uEAAuE;IAChE,KAAK,CAAC,QAAQ,CAAC,WAA2B;QAC/C,OAAO,mBAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED,qCAAqC;IAC9B,KAAK,CAAC,WAAW,CAAC,WAA2B,EAAE,cAAsB,EAAE,QAAkB;QAC9F,OAAO,mBAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AA1BD,0CA0BC","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 */\nimport { LogLevel } from \"@itwin/core-bentley\";\nimport { DevToolsRpcInterface, DevToolsStatsOptions, IModelRpcProps, RpcInterface, RpcManager } from \"@itwin/core-common\";\nimport { DevTools, DevToolsStatsFormatter } from \"../DevTools\";\n\n/** The backend implementation of WipRpcInterface.\n * @internal\n */\nexport class DevToolsRpcImpl extends RpcInterface implements DevToolsRpcInterface { // eslint-disable-line deprecation/deprecation\n public static register() { RpcManager.registerImpl(DevToolsRpcInterface, DevToolsRpcImpl); }\n\n // Returns true if the backend received the ping\n public async ping(_tokenProps: IModelRpcProps): Promise<boolean> {\n return DevTools.ping();\n }\n\n // Returns JSON object with statistics\n public async stats(_tokenProps: IModelRpcProps, options: DevToolsStatsOptions): Promise<any> {\n const stats = DevTools.stats();\n if (options === DevToolsStatsOptions.None)\n return stats;\n const formattedStats = DevToolsStatsFormatter.toFormattedJson(stats);\n return formattedStats;\n }\n\n // Returns JSON object with backend versions (application and iModelJs)\n public async versions(_tokenProps: IModelRpcProps): Promise<any> {\n return DevTools.versions();\n }\n\n // Sets up a log level at the backend\n public async setLogLevel(_tokenProps: IModelRpcProps, loggerCategory: string, logLevel: LogLevel): Promise<LogLevel | undefined> {\n return DevTools.setLogLevel(loggerCategory, logLevel);\n }\n}\n"]}
|