@itwin/core-backend 4.4.0-dev.31 → 4.4.0-dev.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/logging.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAwB,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK7G,qBAAa,uBAAwB,SAAQ,gBAAgB;cAClC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;cAQrF,WAAW,IAAI,MAAM;YAI1B,eAAe;CAiB9B"}
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/logging.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAwB,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK7G,qBAAa,uBAAwB,SAAQ,gBAAgB;cAClC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;cAQrF,WAAW,IAAI,MAAM;YAI1B,eAAe;CAqB9B"}
@@ -28,16 +28,19 @@ class WebAppRpcLoggingBackend extends core_common_1.WebAppRpcLogging {
28
28
  const pathIds = this.findPathIds(invocation.request.path);
29
29
  const result = await invocation.result;
30
30
  const errorMessage = result.message ? result.message : result.objects; // Can be an error or an RpcSerializedValue
31
- core_bentley_1.Logger.logInfo(core_common_1.CommonLoggerCategory.RpcInterfaceBackend, `${message}.${operationDescriptor}`, () => ({
31
+ const metadata = {
32
32
  method: invocation.request.method,
33
33
  path: invocation.request.path,
34
34
  status: invocation.status,
35
+ httpStatus: core_bentley_1.StatusCategory.for(result).code,
35
36
  errorMessage,
37
+ error: core_bentley_1.BentleyError.getErrorProps(result),
36
38
  // Alert! The following properties are required by Bentley DevOps standards. Do not change their names!
37
39
  ActivityId: invocation.request.id,
38
40
  MachineName: this.getHostname(),
39
41
  ...pathIds,
40
- }));
42
+ };
43
+ core_bentley_1.Logger.logError(core_common_1.CommonLoggerCategory.RpcInterfaceBackend, `${message}.${operationDescriptor}`, metadata);
41
44
  }
42
45
  }
43
46
  exports.WebAppRpcLoggingBackend = WebAppRpcLoggingBackend;
@@ -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,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
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../src/rpc/web/logging.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2E;AAC3E,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,KAA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AC;IAC3G,CAAC;CACF;AAlCD,0DAkCC","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 { BentleyError, Logger, StatusCategory } 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 const metadata = {\n method: invocation.request.method,\n path: invocation.request.path,\n status: invocation.status,\n httpStatus: StatusCategory.for(result).code,\n errorMessage,\n error: BentleyError.getErrorProps(result),\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 Logger.logError(CommonLoggerCategory.RpcInterfaceBackend, `${message}.${operationDescriptor}`, metadata);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-backend",
3
- "version": "4.4.0-dev.31",
3
+ "version": "4.4.0-dev.33",
4
4
  "description": "iTwin.js backend components",
5
5
  "main": "lib/cjs/core-backend.js",
6
6
  "typings": "lib/cjs/core-backend",
@@ -25,9 +25,9 @@
25
25
  "url": "http://www.bentley.com"
26
26
  },
27
27
  "peerDependencies": {
28
- "@itwin/core-bentley": "^4.4.0-dev.31",
29
- "@itwin/core-common": "^4.4.0-dev.31",
30
- "@itwin/core-geometry": "^4.4.0-dev.31",
28
+ "@itwin/core-bentley": "^4.4.0-dev.33",
29
+ "@itwin/core-common": "^4.4.0-dev.33",
30
+ "@itwin/core-geometry": "^4.4.0-dev.33",
31
31
  "@opentelemetry/api": "^1.0.4"
32
32
  },
33
33
  "peerDependenciesMeta": {
@@ -69,16 +69,16 @@
69
69
  "ts-node": "^10.8.2",
70
70
  "typescript": "~5.0.2",
71
71
  "webpack": "^5.76.0",
72
- "@itwin/build-tools": "4.4.0-dev.31",
73
- "@itwin/core-bentley": "4.4.0-dev.31",
74
- "@itwin/core-common": "4.4.0-dev.31",
75
- "@itwin/core-geometry": "4.4.0-dev.31",
76
- "@itwin/core-webpack-tools": "4.4.0-dev.31",
77
- "@itwin/ecsql-common": "4.4.0-dev.31",
78
- "internal-tools": "3.0.0-dev.69"
72
+ "@itwin/build-tools": "4.4.0-dev.33",
73
+ "@itwin/core-bentley": "4.4.0-dev.33",
74
+ "@itwin/core-geometry": "4.4.0-dev.33",
75
+ "@itwin/core-common": "4.4.0-dev.33",
76
+ "internal-tools": "3.0.0-dev.69",
77
+ "@itwin/ecsql-common": "4.4.0-dev.33",
78
+ "@itwin/core-webpack-tools": "4.4.0-dev.33"
79
79
  },
80
80
  "dependencies": {
81
- "@bentley/imodeljs-native": "4.4.1",
81
+ "@bentley/imodeljs-native": "4.4.2",
82
82
  "@itwin/cloud-agnostic-core": "^2.1.0",
83
83
  "@itwin/object-storage-azure": "^2.2.2",
84
84
  "@itwin/object-storage-core": "^2.2.2",
@@ -91,7 +91,7 @@
91
91
  "semver": "^7.3.5",
92
92
  "touch": "^3.1.0",
93
93
  "ws": "^7.5.3",
94
- "@itwin/core-telemetry": "4.4.0-dev.31"
94
+ "@itwin/core-telemetry": "4.4.0-dev.33"
95
95
  },
96
96
  "nyc": {
97
97
  "extends": "./node_modules/@itwin/build-tools/.nycrc"