@webpieces/core-util 0.4.761 → 0.4.763

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.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/src/errors/ApiError.d.ts +43 -49
  4. package/src/errors/ApiError.js +54 -59
  5. package/src/errors/ApiError.js.map +1 -1
  6. package/src/errors/ApiErrorCodec.d.ts +11 -6
  7. package/src/errors/ApiErrorCodec.js +93 -87
  8. package/src/errors/ApiErrorCodec.js.map +1 -1
  9. package/src/errors/AuthErrorSubtypes.d.ts +9 -0
  10. package/src/errors/AuthErrorSubtypes.js +13 -0
  11. package/src/errors/AuthErrorSubtypes.js.map +1 -0
  12. package/src/errors/index.d.ts +3 -1
  13. package/src/errors/index.js +24 -15
  14. package/src/errors/index.js.map +1 -1
  15. package/src/http/{TimeoutError.d.ts → ApiCallTimeoutError.d.ts} +1 -1
  16. package/src/http/{TimeoutError.js → ApiCallTimeoutError.js} +5 -5
  17. package/src/http/ApiCallTimeoutError.js.map +1 -0
  18. package/src/http/{HttpErrorStatus.d.ts → ApiErrorHttpStatus.d.ts} +2 -1
  19. package/src/http/ApiErrorHttpStatus.js +43 -0
  20. package/src/http/ApiErrorHttpStatus.js.map +1 -0
  21. package/src/http/CallDeadline.js +2 -2
  22. package/src/http/CallDeadline.js.map +1 -1
  23. package/src/http/ErrorTranslators.d.ts +5 -3
  24. package/src/http/ErrorTranslators.js.map +1 -1
  25. package/src/http/HttpResponseDto.d.ts +1 -1
  26. package/src/http/HttpResponseDto.js +2 -2
  27. package/src/http/HttpResponseDto.js.map +1 -1
  28. package/src/http/WebpiecesDefaultFailureClassifier.d.ts +6 -6
  29. package/src/http/WebpiecesDefaultFailureClassifier.js +12 -12
  30. package/src/http/WebpiecesDefaultFailureClassifier.js.map +1 -1
  31. package/src/http/decorators.d.ts +1 -1
  32. package/src/http/decorators.js +1 -1
  33. package/src/http/decorators.js.map +1 -1
  34. package/src/http/networkReject.d.ts +2 -2
  35. package/src/http/networkReject.js +5 -5
  36. package/src/http/networkReject.js.map +1 -1
  37. package/src/index.d.ts +5 -4
  38. package/src/index.js +23 -38
  39. package/src/index.js.map +1 -1
  40. package/src/ipc/IpcConnection.js +14 -14
  41. package/src/ipc/IpcConnection.js.map +1 -1
  42. package/src/ipc/IpcDecorators.js +9 -9
  43. package/src/ipc/IpcDecorators.js.map +1 -1
  44. package/src/ipc/IpcIdentity.js +1 -1
  45. package/src/ipc/IpcIdentity.js.map +1 -1
  46. package/src/ipc/IpcProtocol.js +5 -5
  47. package/src/ipc/IpcProtocol.js.map +1 -1
  48. package/src/ipc/index.d.ts +1 -1
  49. package/src/ipc/index.js +3 -3
  50. package/src/ipc/index.js.map +1 -1
  51. package/src/http/HttpErrorStatus.js +0 -38
  52. package/src/http/HttpErrorStatus.js.map +0 -1
  53. package/src/http/TimeoutError.js.map +0 -1
  54. package/src/http/errors.d.ts +0 -56
  55. package/src/http/errors.js +0 -95
  56. package/src/http/errors.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"IpcProtocol.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/ipc/IpcProtocol.ts"],"names":[],"mappings":";;;AAAA,sCAA2D;AAC3D,+CAA4C;AAE5C,MAAa,cAAc;IAEV;IACA;IACA;IAHb,YACa,IAAY,EACZ,MAAc,EACd,YAAqB;QAFrB,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,iBAAY,GAAZ,YAAY,CAAS;QAE9B,yBAAW,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACxC,yBAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,IAAI,YAAY,KAAK,SAAS;YAAE,yBAAW,CAAC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACpF,CAAC;CACJ;AAVD,wCAUC;AAED,MAAa,UAAU;IAIN;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CAAC,CAAC;QACrE,CAAC;IACL,CAAC;IAED,oIAAoI;IACpI,MAAM,CAAC,WAAW,CAAC,CAAiB,EAAE,CAAiB;QACnD,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,YAAY,CAAC;IAC3F,CAAC;CACJ;AA9CD,kCA8CC","sourcesContent":["import { ApiErrorPayload, InternalError } from '../errors';\nimport { IpcIdentity } from './IpcIdentity';\n\nexport class IpcCallContext {\n constructor(\n readonly txId: string,\n readonly callId: string,\n readonly parentCallId?: string,\n ) {\n IpcIdentity.assert(txId, 'transaction');\n IpcIdentity.assert(callId, 'call');\n if (parentCallId !== undefined) IpcIdentity.assert(parentCallId, 'parent call');\n }\n}\n\nexport class IpcRequest {\n readonly version = 1;\n readonly type = 'request';\n constructor(\n readonly apiId: string,\n readonly methodId: string,\n readonly context: IpcCallContext,\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n readonly body: unknown,\n ) {}\n}\nexport class IpcSuccess {\n readonly version = 1;\n readonly type = 'success';\n constructor(\n readonly context: IpcCallContext,\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n readonly body: unknown,\n ) {}\n}\nexport class IpcFailure {\n readonly version = 1;\n readonly type = 'failure';\n constructor(\n readonly context: IpcCallContext,\n readonly error: ApiErrorPayload,\n ) {}\n}\nexport type IpcReply = IpcSuccess | IpcFailure;\nexport type IpcMessage = IpcRequest | IpcReply;\n\nexport class IpcProtocol {\n // webpieces-disable no-function-outside-class -- portable stateless IPC primitive; no platform DI container exists on this boundary; webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n static record(value: unknown): Record<string, unknown> {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new InternalError('Malformed IPC envelope');\n }\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n return value as Record<string, unknown>;\n }\n\n // webpieces-disable no-function-outside-class -- portable stateless IPC primitive; no platform DI container exists on this boundary\n static parse(json: string): IpcMessage {\n const value = IpcProtocol.record(JSON.parse(json));\n if (value['version'] !== 1) throw new InternalError('Unsupported IPC protocol version');\n const raw = IpcProtocol.record(value['context']);\n const context = new IpcCallContext(\n raw['txId'] as string,\n raw['callId'] as string,\n raw['parentCallId'] as string | undefined,\n );\n switch (value['type']) {\n case 'request':\n IpcIdentity.assert(value['apiId'], 'API');\n IpcIdentity.assert(value['methodId'], 'method');\n if (!Object.prototype.hasOwnProperty.call(value, 'body'))\n throw new InternalError('Missing IPC request body');\n return new IpcRequest(value['apiId'], value['methodId'], context, value['body']);\n case 'success':\n if (!Object.prototype.hasOwnProperty.call(value, 'body'))\n throw new InternalError('Missing IPC success body');\n return new IpcSuccess(context, value['body']);\n case 'failure':\n return new IpcFailure(\n context,\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n IpcProtocol.record(value['error']) as unknown as ApiErrorPayload,\n );\n default:\n throw new InternalError('Invalid IPC message discriminator');\n }\n }\n\n // webpieces-disable no-function-outside-class -- portable stateless IPC primitive; no platform DI container exists on this boundary\n static sameContext(a: IpcCallContext, b: IpcCallContext): boolean {\n return a.callId === b.callId && a.txId === b.txId && a.parentCallId === b.parentCallId;\n }\n}\n"]}
1
+ {"version":3,"file":"IpcProtocol.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/ipc/IpcProtocol.ts"],"names":[],"mappings":";;;AAAA,sCAAoE;AACpE,+CAA4C;AAE5C,MAAa,cAAc;IAEV;IACA;IACA;IAHb,YACa,IAAY,EACZ,MAAc,EACd,YAAqB;QAFrB,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,iBAAY,GAAZ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0BAA0B,CAAC,CAAC;gBACjE,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAClD,KAAK,SAAS;gBACV,OAAO,IAAI,UAAU,CACjB,OAAO;gBACP,0IAA0I;gBAC1I,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAA+B,CACnE,CAAC;YACN;gBACI,MAAM,IAAI,+BAAsB,CAAC,mCAAmC,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IAED,oIAAoI;IACpI,MAAM,CAAC,WAAW,CAAC,CAAiB,EAAE,CAAiB;QACnD,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,YAAY,CAAC;IAC3F,CAAC;CACJ;AA/CD,kCA+CC","sourcesContent":["import { ApiErrorPayload, ApiImplementationError } from '../errors';\nimport { IpcIdentity } from './IpcIdentity';\n\nexport class IpcCallContext {\n constructor(\n readonly txId: string,\n readonly callId: string,\n readonly parentCallId?: string,\n ) {\n IpcIdentity.assert(txId, 'transaction');\n IpcIdentity.assert(callId, 'call');\n if (parentCallId !== undefined) IpcIdentity.assert(parentCallId, 'parent call');\n }\n}\n\nexport class IpcRequest {\n readonly version = 1;\n readonly type = 'request';\n constructor(\n readonly apiId: string,\n readonly methodId: string,\n readonly context: IpcCallContext,\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n readonly body: unknown,\n ) {}\n}\nexport class IpcSuccess {\n readonly version = 1;\n readonly type = 'success';\n constructor(\n readonly context: IpcCallContext,\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n readonly body: unknown,\n ) {}\n}\nexport class IpcFailure {\n readonly version = 1;\n readonly type = 'failure';\n constructor(\n readonly context: IpcCallContext,\n readonly error: ApiErrorPayload,\n ) {}\n}\nexport type IpcReply = IpcSuccess | IpcFailure;\nexport type IpcMessage = IpcRequest | IpcReply;\n\nexport class IpcProtocol {\n // webpieces-disable no-function-outside-class -- portable stateless IPC primitive; no platform DI container exists on this boundary; webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n static record(value: unknown): Record<string, unknown> {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new ApiImplementationError('Malformed IPC envelope');\n }\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n return value as Record<string, unknown>;\n }\n\n // webpieces-disable no-function-outside-class -- portable stateless IPC primitive; no platform DI container exists on this boundary\n static parse(json: string): IpcMessage {\n const value = IpcProtocol.record(JSON.parse(json));\n if (value['version'] !== 1)\n throw new ApiImplementationError('Unsupported IPC protocol version');\n const raw = IpcProtocol.record(value['context']);\n const context = new IpcCallContext(\n raw['txId'] as string,\n raw['callId'] as string,\n raw['parentCallId'] as string | undefined,\n );\n switch (value['type']) {\n case 'request':\n IpcIdentity.assert(value['apiId'], 'API');\n IpcIdentity.assert(value['methodId'], 'method');\n if (!Object.prototype.hasOwnProperty.call(value, 'body'))\n throw new ApiImplementationError('Missing IPC request body');\n return new IpcRequest(value['apiId'], value['methodId'], context, value['body']);\n case 'success':\n if (!Object.prototype.hasOwnProperty.call(value, 'body'))\n throw new ApiImplementationError('Missing IPC success body');\n return new IpcSuccess(context, value['body']);\n case 'failure':\n return new IpcFailure(\n context,\n // webpieces-disable no-any-unknown -- untrusted IPC data is schema-validated; generic dispatch cannot assume a DTO type before validation\n IpcProtocol.record(value['error']) as unknown as ApiErrorPayload,\n );\n default:\n throw new ApiImplementationError('Invalid IPC message discriminator');\n }\n }\n\n // webpieces-disable no-function-outside-class -- portable stateless IPC primitive; no platform DI container exists on this boundary\n static sameContext(a: IpcCallContext, b: IpcCallContext): boolean {\n return a.callId === b.callId && a.txId === b.txId && a.parentCallId === b.parentCallId;\n }\n}\n"]}
@@ -12,5 +12,5 @@ export { MaskLog } from '../http/decorators';
12
12
  export { ApiMethodInfo } from '../http/ApiMethodInfo';
13
13
  export { LogApiCallImpl } from '../http/LogApiCall';
14
14
  export type { ApiCallContext } from '../http/ApiCallContext';
15
- export { TimeoutError } from '../http/TimeoutError';
15
+ export { ApiCallTimeoutError } from '../http/ApiCallTimeoutError';
16
16
  export { toError } from '../lib/errorUtils';
package/src/ipc/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toError = exports.TimeoutError = exports.LogApiCallImpl = exports.ApiMethodInfo = exports.MaskLog = exports.MaskSpec = exports.IpcCallLogger = exports.IpcErrors = exports.IpcTransportError = exports.IpcConnectionOptions = exports.IpcConnection = exports.IpcProtocol = exports.IpcFailure = exports.IpcSuccess = exports.IpcRequest = exports.IpcCallContext = exports.IPC_METADATA_KEYS = exports.assertNotInternalApi = exports.assertInternalApi = exports.getIpcMaskSpec = exports.getIpcEndpointKind = exports.getIpcEndpoints = exports.getIpcApiId = exports.isInternalApi = exports.WpIpcEndpoint = exports.WpInternal = exports.IpcIdentity = void 0;
3
+ exports.toError = exports.ApiCallTimeoutError = exports.LogApiCallImpl = exports.ApiMethodInfo = exports.MaskLog = exports.MaskSpec = exports.IpcCallLogger = exports.IpcErrors = exports.IpcTransportError = exports.IpcConnectionOptions = exports.IpcConnection = exports.IpcProtocol = exports.IpcFailure = exports.IpcSuccess = exports.IpcRequest = exports.IpcCallContext = exports.IPC_METADATA_KEYS = exports.assertNotInternalApi = exports.assertInternalApi = exports.getIpcMaskSpec = exports.getIpcEndpointKind = exports.getIpcEndpoints = exports.getIpcApiId = exports.isInternalApi = exports.WpIpcEndpoint = exports.WpInternal = exports.IpcIdentity = void 0;
4
4
  var IpcIdentity_1 = require("./IpcIdentity");
5
5
  Object.defineProperty(exports, "IpcIdentity", { enumerable: true, get: function () { return IpcIdentity_1.IpcIdentity; } });
6
6
  var IpcDecorators_1 = require("./IpcDecorators");
@@ -35,8 +35,8 @@ var ApiMethodInfo_1 = require("../http/ApiMethodInfo");
35
35
  Object.defineProperty(exports, "ApiMethodInfo", { enumerable: true, get: function () { return ApiMethodInfo_1.ApiMethodInfo; } });
36
36
  var LogApiCall_1 = require("../http/LogApiCall");
37
37
  Object.defineProperty(exports, "LogApiCallImpl", { enumerable: true, get: function () { return LogApiCall_1.LogApiCallImpl; } });
38
- var TimeoutError_1 = require("../http/TimeoutError");
39
- Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return TimeoutError_1.TimeoutError; } });
38
+ var ApiCallTimeoutError_1 = require("../http/ApiCallTimeoutError");
39
+ Object.defineProperty(exports, "ApiCallTimeoutError", { enumerable: true, get: function () { return ApiCallTimeoutError_1.ApiCallTimeoutError; } });
40
40
  var errorUtils_1 = require("../lib/errorUtils");
41
41
  Object.defineProperty(exports, "toError", { enumerable: true, get: function () { return errorUtils_1.toError; } });
42
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/ipc/index.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iDAWyB;AAVrB,2GAAA,UAAU,OAAA;AACV,8GAAA,aAAa,OAAA;AACb,8GAAA,aAAa,OAAA;AACb,4GAAA,WAAW,OAAA;AACX,gHAAA,eAAe,OAAA;AACf,mHAAA,kBAAkB,OAAA;AAClB,+GAAA,cAAc,OAAA;AACd,kHAAA,iBAAiB,OAAA;AACjB,qHAAA,oBAAoB,OAAA;AACpB,kHAAA,iBAAiB,OAAA;AAGrB,6CAAgG;AAAvF,6GAAA,cAAc,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,0GAAA,WAAW,OAAA;AAExE,iDAAoG;AAA3F,8GAAA,aAAa,OAAA;AAAE,qHAAA,oBAAoB,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAAE,0GAAA,SAAS,OAAA;AAE1E,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAEtB,qDAAgD;AAAvC,wGAAA,QAAQ,OAAA;AACjB,iDAA6C;AAApC,qGAAA,OAAO,OAAA;AAChB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,iDAAoD;AAA3C,4GAAA,cAAc,OAAA;AAEvB,qDAAoD;AAA3C,4GAAA,YAAY,OAAA;AAErB,gDAA4C;AAAnC,qGAAA,OAAO,OAAA","sourcesContent":["export { IpcIdentity } from './IpcIdentity';\nexport {\n WpInternal,\n WpIpcEndpoint,\n isInternalApi,\n getIpcApiId,\n getIpcEndpoints,\n getIpcEndpointKind,\n getIpcMaskSpec,\n assertInternalApi,\n assertNotInternalApi,\n IPC_METADATA_KEYS,\n} from './IpcDecorators';\nexport type { IpcApiType, IpcEndpointKind, IpcEndpointOptions } from './IpcDecorators';\nexport { IpcCallContext, IpcRequest, IpcSuccess, IpcFailure, IpcProtocol } from './IpcProtocol';\nexport type { IpcReply, IpcMessage } from './IpcProtocol';\nexport { IpcConnection, IpcConnectionOptions, IpcTransportError, IpcErrors } from './IpcConnection';\nexport type { IpcTransport, IpcScheduler, IpcErrorOwner } from './IpcConnection';\nexport { IpcCallLogger } from './IpcLogging';\nexport type { IpcLogging } from './IpcLogging';\nexport { MaskSpec } from '../http/LogFieldMask';\nexport { MaskLog } from '../http/decorators';\nexport { ApiMethodInfo } from '../http/ApiMethodInfo';\nexport { LogApiCallImpl } from '../http/LogApiCall';\nexport type { ApiCallContext } from '../http/ApiCallContext';\nexport { TimeoutError } from '../http/TimeoutError';\n\nexport { toError } from '../lib/errorUtils';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/ipc/index.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iDAWyB;AAVrB,2GAAA,UAAU,OAAA;AACV,8GAAA,aAAa,OAAA;AACb,8GAAA,aAAa,OAAA;AACb,4GAAA,WAAW,OAAA;AACX,gHAAA,eAAe,OAAA;AACf,mHAAA,kBAAkB,OAAA;AAClB,+GAAA,cAAc,OAAA;AACd,kHAAA,iBAAiB,OAAA;AACjB,qHAAA,oBAAoB,OAAA;AACpB,kHAAA,iBAAiB,OAAA;AAGrB,6CAAgG;AAAvF,6GAAA,cAAc,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,0GAAA,WAAW,OAAA;AAExE,iDAAoG;AAA3F,8GAAA,aAAa,OAAA;AAAE,qHAAA,oBAAoB,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAAE,0GAAA,SAAS,OAAA;AAE1E,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AAEtB,qDAAgD;AAAvC,wGAAA,QAAQ,OAAA;AACjB,iDAA6C;AAApC,qGAAA,OAAO,OAAA;AAChB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,iDAAoD;AAA3C,4GAAA,cAAc,OAAA;AAEvB,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA;AAE5B,gDAA4C;AAAnC,qGAAA,OAAO,OAAA","sourcesContent":["export { IpcIdentity } from './IpcIdentity';\nexport {\n WpInternal,\n WpIpcEndpoint,\n isInternalApi,\n getIpcApiId,\n getIpcEndpoints,\n getIpcEndpointKind,\n getIpcMaskSpec,\n assertInternalApi,\n assertNotInternalApi,\n IPC_METADATA_KEYS,\n} from './IpcDecorators';\nexport type { IpcApiType, IpcEndpointKind, IpcEndpointOptions } from './IpcDecorators';\nexport { IpcCallContext, IpcRequest, IpcSuccess, IpcFailure, IpcProtocol } from './IpcProtocol';\nexport type { IpcReply, IpcMessage } from './IpcProtocol';\nexport { IpcConnection, IpcConnectionOptions, IpcTransportError, IpcErrors } from './IpcConnection';\nexport type { IpcTransport, IpcScheduler, IpcErrorOwner } from './IpcConnection';\nexport { IpcCallLogger } from './IpcLogging';\nexport type { IpcLogging } from './IpcLogging';\nexport { MaskSpec } from '../http/LogFieldMask';\nexport { MaskLog } from '../http/decorators';\nexport { ApiMethodInfo } from '../http/ApiMethodInfo';\nexport { LogApiCallImpl } from '../http/LogApiCall';\nexport type { ApiCallContext } from '../http/ApiCallContext';\nexport { ApiCallTimeoutError } from '../http/ApiCallTimeoutError';\n\nexport { toError } from '../lib/errorUtils';\n"]}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpErrorStatus = void 0;
4
- const ApiError_1 = require("../errors/ApiError");
5
- const errors_1 = require("./errors");
6
- /** HTTP-only adapter: semantic errors themselves have no protocol status property. */
7
- class HttpErrorStatus {
8
- // webpieces-disable no-function-outside-class -- stateless mapping shared by HTTP adapters
9
- static code(error) {
10
- if (error instanceof errors_1.HttpError)
11
- return error.code;
12
- if (error instanceof ApiError_1.UserError)
13
- return 266;
14
- if (error instanceof ApiError_1.BadRequestError)
15
- return 400;
16
- if (error instanceof ApiError_1.UnauthorizedError)
17
- return 401;
18
- if (error instanceof ApiError_1.ForbiddenError)
19
- return 403;
20
- if (error instanceof ApiError_1.NotFoundError)
21
- return 404;
22
- if (error instanceof ApiError_1.RequestTimeoutError)
23
- return 408;
24
- if (error instanceof ApiError_1.TooManyRequestsError)
25
- return 429;
26
- if (error instanceof ApiError_1.BadGatewayError)
27
- return 502;
28
- if (error instanceof ApiError_1.ServiceUnavailableError)
29
- return 503;
30
- if (error instanceof ApiError_1.GatewayTimeoutError)
31
- return 504;
32
- if (error instanceof ApiError_1.VendorError)
33
- return 598;
34
- return 500;
35
- }
36
- }
37
- exports.HttpErrorStatus = HttpErrorStatus;
38
- //# sourceMappingURL=HttpErrorStatus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpErrorStatus.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/http/HttpErrorStatus.ts"],"names":[],"mappings":";;;AAAA,iDAI4B;AAC5B,qCAAqC;AAErC,sFAAsF;AACtF,MAAa,eAAe;IACxB,2FAA2F;IAC3F,MAAM,CAAC,IAAI,CAAC,KAAe;QACvB,IAAI,KAAK,YAAY,kBAAS;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC;QAClD,IAAI,KAAK,YAAY,oBAAS;YAAE,OAAO,GAAG,CAAC;QAC3C,IAAI,KAAK,YAAY,0BAAe;YAAE,OAAO,GAAG,CAAC;QACjD,IAAI,KAAK,YAAY,4BAAiB;YAAE,OAAO,GAAG,CAAC;QACnD,IAAI,KAAK,YAAY,yBAAc;YAAE,OAAO,GAAG,CAAC;QAChD,IAAI,KAAK,YAAY,wBAAa;YAAE,OAAO,GAAG,CAAC;QAC/C,IAAI,KAAK,YAAY,8BAAmB;YAAE,OAAO,GAAG,CAAC;QACrD,IAAI,KAAK,YAAY,+BAAoB;YAAE,OAAO,GAAG,CAAC;QACtD,IAAI,KAAK,YAAY,0BAAe;YAAE,OAAO,GAAG,CAAC;QACjD,IAAI,KAAK,YAAY,kCAAuB;YAAE,OAAO,GAAG,CAAC;QACzD,IAAI,KAAK,YAAY,8BAAmB;YAAE,OAAO,GAAG,CAAC;QACrD,IAAI,KAAK,YAAY,sBAAW;YAAE,OAAO,GAAG,CAAC;QAC7C,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AAjBD,0CAiBC","sourcesContent":["import {\n ApiError, UserError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError,\n RequestTimeoutError, TooManyRequestsError, BadGatewayError, ServiceUnavailableError,\n GatewayTimeoutError, VendorError,\n} from '../errors/ApiError';\nimport { HttpError } from './errors';\n\n/** HTTP-only adapter: semantic errors themselves have no protocol status property. */\nexport class HttpErrorStatus {\n // webpieces-disable no-function-outside-class -- stateless mapping shared by HTTP adapters\n static code(error: ApiError): number {\n if (error instanceof HttpError) return error.code;\n if (error instanceof UserError) return 266;\n if (error instanceof BadRequestError) return 400;\n if (error instanceof UnauthorizedError) return 401;\n if (error instanceof ForbiddenError) return 403;\n if (error instanceof NotFoundError) return 404;\n if (error instanceof RequestTimeoutError) return 408;\n if (error instanceof TooManyRequestsError) return 429;\n if (error instanceof BadGatewayError) return 502;\n if (error instanceof ServiceUnavailableError) return 503;\n if (error instanceof GatewayTimeoutError) return 504;\n if (error instanceof VendorError) return 598;\n return 500;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeoutError.js","sourceRoot":"","sources":["../../../../../../packages/core/core-util/src/http/TimeoutError.ts"],"names":[],"mappings":";;;AAEA,6EAA6E;AAC7E,MAAa,YAAa,SAAQ,KAAK;IAEf;IACA;IAFpB,YACoB,SAAiB,EACjB,OAAoB;QAEpC,KAAK,CAAC,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,oBAAoB,SAAS,IAAI,CAAC,CAAC;QAHjE,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAa;QAGpC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC/B,CAAC;CACJ;AARD,oCAQC","sourcesContent":["import { CallContext } from './CallStrategy';\n\n/** Stopped waiting; this does not prove the remote operation did not run. */\nexport class TimeoutError extends Error {\n constructor(\n public readonly timeoutMs: number,\n public readonly context: CallContext,\n ) {\n super(`${context.apiName}.${context.methodName} timed out after ${timeoutMs}ms`);\n this.name = 'TimeoutError';\n }\n}\n"]}
@@ -1,56 +0,0 @@
1
- import { ApiError } from '../errors/ApiError';
2
- export declare class ProtocolError {
3
- message?: string;
4
- subType?: string;
5
- field?: string;
6
- waitSeconds?: number;
7
- /**
8
- * Filled only by an app's own `ErrorTranslators.toWire()`. The built-in HttpError ladder does NOT
9
- * send it: nothing on the client reads it, and for a subclass it is an internal class name.
10
- */
11
- name?: string;
12
- guiAlertMessage?: string;
13
- errorCode?: string;
14
- }
15
- export declare const ENTITY_NOT_FOUND = "EntityNotFoundError";
16
- export declare const WRONG_LOGIN_TYPE = "wrongLoginType";
17
- export declare const WRONG_LOGIN = "wronglogin";
18
- export declare const NOT_APPROVED = "notapproved";
19
- export declare const EMAIL_NOT_CONFIRMED = "email_not_confirmed";
20
- export declare const WRONG_DOMAIN = "wrongdomain";
21
- export declare const WRONG_COMPANY = "wrongcompany";
22
- export declare const NO_REG_CODE = "noregcode";
23
- /** @deprecated Prefer ApiError semantic subclasses; custom HTTP status belongs in ErrorTranslators. */
24
- export declare class HttpError extends ApiError {
25
- code: number;
26
- constructor(message: string, code: number, subType?: string, cause?: Error);
27
- /** @deprecated Use the standard Error.cause. */
28
- get httpCause(): Error | undefined;
29
- }
30
- export { EndpointNotFoundError, OfflineError } from '../errors/ApiError';
31
- /** @deprecated Use NotFoundError from @webpieces/core-util/errors. Same constructor identity. */
32
- export { NotFoundError as HttpNotFoundError } from '../errors/ApiError';
33
- /** @deprecated Use BadRequestError from @webpieces/core-util/errors. Same constructor identity. */
34
- export { BadRequestError as HttpBadRequestError } from '../errors/ApiError';
35
- /** @deprecated Use UnauthorizedError from @webpieces/core-util/errors. Same constructor identity. */
36
- export { UnauthorizedError as HttpUnauthorizedError } from '../errors/ApiError';
37
- /** @deprecated Use TooManyRequestsError from @webpieces/core-util/errors. Same constructor identity. */
38
- export { TooManyRequestsError as HttpTooManyRequestsError } from '../errors/ApiError';
39
- /** @deprecated Use ForbiddenError from @webpieces/core-util/errors. Same constructor identity. */
40
- export { ForbiddenError as HttpForbiddenError } from '../errors/ApiError';
41
- /** @deprecated Use RequestTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
42
- export { RequestTimeoutError as HttpTimeoutError } from '../errors/ApiError';
43
- /** @deprecated Use BadGatewayError from @webpieces/core-util/errors. Same constructor identity. */
44
- export { BadGatewayError as HttpBadGatewayError } from '../errors/ApiError';
45
- /** @deprecated Use ServiceUnavailableError from @webpieces/core-util/errors. Same constructor identity. */
46
- export { ServiceUnavailableError as HttpServiceUnavailableError } from '../errors/ApiError';
47
- /** @deprecated Use GatewayTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
48
- export { GatewayTimeoutError as HttpGatewayTimeoutError } from '../errors/ApiError';
49
- /** @deprecated Use InternalError from @webpieces/core-util/errors. Same constructor identity. */
50
- export { InternalError as HttpInternalServerError } from '../errors/ApiError';
51
- /** @deprecated Use VendorError from @webpieces/core-util/errors. Same constructor identity. */
52
- export { VendorError as HttpVendorError } from '../errors/ApiError';
53
- /** @deprecated Use UserError from @webpieces/core-util/errors. Same constructor identity. */
54
- export { UserError as HttpUserError } from '../errors/ApiError';
55
- export { NotFoundError, BadGatewayError, ServiceUnavailableError, GatewayTimeoutError, InternalError, TooManyRequestsError, ForbiddenError, RequestTimeoutError, UserError, BadRequestError, UnauthorizedError, VendorError, } from '../errors/ApiError';
56
- export { ApiError };
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApiError = exports.VendorError = exports.UnauthorizedError = exports.BadRequestError = exports.UserError = exports.RequestTimeoutError = exports.ForbiddenError = exports.TooManyRequestsError = exports.InternalError = exports.GatewayTimeoutError = exports.ServiceUnavailableError = exports.BadGatewayError = exports.NotFoundError = exports.HttpUserError = exports.HttpVendorError = exports.HttpInternalServerError = exports.HttpGatewayTimeoutError = exports.HttpServiceUnavailableError = exports.HttpBadGatewayError = exports.HttpTimeoutError = exports.HttpForbiddenError = exports.HttpTooManyRequestsError = exports.HttpUnauthorizedError = exports.HttpBadRequestError = exports.HttpNotFoundError = exports.OfflineError = exports.EndpointNotFoundError = exports.HttpError = exports.NO_REG_CODE = exports.WRONG_COMPANY = exports.WRONG_DOMAIN = exports.EMAIL_NOT_CONFIRMED = exports.NOT_APPROVED = exports.WRONG_LOGIN = exports.WRONG_LOGIN_TYPE = exports.ENTITY_NOT_FOUND = exports.ProtocolError = void 0;
4
- const ApiError_1 = require("../errors/ApiError");
5
- Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return ApiError_1.ApiError; } });
6
- class ProtocolError {
7
- message;
8
- subType;
9
- field;
10
- waitSeconds;
11
- /**
12
- * Filled only by an app's own `ErrorTranslators.toWire()`. The built-in HttpError ladder does NOT
13
- * send it: nothing on the client reads it, and for a subclass it is an internal class name.
14
- */
15
- name;
16
- guiAlertMessage;
17
- errorCode;
18
- }
19
- exports.ProtocolError = ProtocolError;
20
- // Error subtype constants
21
- exports.ENTITY_NOT_FOUND = 'EntityNotFoundError';
22
- exports.WRONG_LOGIN_TYPE = 'wrongLoginType';
23
- exports.WRONG_LOGIN = 'wronglogin';
24
- exports.NOT_APPROVED = 'notapproved';
25
- exports.EMAIL_NOT_CONFIRMED = 'email_not_confirmed';
26
- exports.WRONG_DOMAIN = 'wrongdomain';
27
- exports.WRONG_COMPANY = 'wrongcompany';
28
- exports.NO_REG_CODE = 'noregcode';
29
- /** @deprecated Prefer ApiError semantic subclasses; custom HTTP status belongs in ErrorTranslators. */
30
- class HttpError extends ApiError_1.ApiError {
31
- code;
32
- constructor(message, code, subType, cause) {
33
- super(message, cause);
34
- this.code = code;
35
- this.subType = subType;
36
- }
37
- /** @deprecated Use the standard Error.cause. */
38
- get httpCause() {
39
- return this.cause instanceof Error ? this.cause : undefined;
40
- }
41
- }
42
- exports.HttpError = HttpError;
43
- var ApiError_2 = require("../errors/ApiError");
44
- Object.defineProperty(exports, "EndpointNotFoundError", { enumerable: true, get: function () { return ApiError_2.EndpointNotFoundError; } });
45
- Object.defineProperty(exports, "OfflineError", { enumerable: true, get: function () { return ApiError_2.OfflineError; } });
46
- /** @deprecated Use NotFoundError from @webpieces/core-util/errors. Same constructor identity. */
47
- var ApiError_3 = require("../errors/ApiError");
48
- Object.defineProperty(exports, "HttpNotFoundError", { enumerable: true, get: function () { return ApiError_3.NotFoundError; } });
49
- /** @deprecated Use BadRequestError from @webpieces/core-util/errors. Same constructor identity. */
50
- var ApiError_4 = require("../errors/ApiError");
51
- Object.defineProperty(exports, "HttpBadRequestError", { enumerable: true, get: function () { return ApiError_4.BadRequestError; } });
52
- /** @deprecated Use UnauthorizedError from @webpieces/core-util/errors. Same constructor identity. */
53
- var ApiError_5 = require("../errors/ApiError");
54
- Object.defineProperty(exports, "HttpUnauthorizedError", { enumerable: true, get: function () { return ApiError_5.UnauthorizedError; } });
55
- /** @deprecated Use TooManyRequestsError from @webpieces/core-util/errors. Same constructor identity. */
56
- var ApiError_6 = require("../errors/ApiError");
57
- Object.defineProperty(exports, "HttpTooManyRequestsError", { enumerable: true, get: function () { return ApiError_6.TooManyRequestsError; } });
58
- /** @deprecated Use ForbiddenError from @webpieces/core-util/errors. Same constructor identity. */
59
- var ApiError_7 = require("../errors/ApiError");
60
- Object.defineProperty(exports, "HttpForbiddenError", { enumerable: true, get: function () { return ApiError_7.ForbiddenError; } });
61
- /** @deprecated Use RequestTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
62
- var ApiError_8 = require("../errors/ApiError");
63
- Object.defineProperty(exports, "HttpTimeoutError", { enumerable: true, get: function () { return ApiError_8.RequestTimeoutError; } });
64
- /** @deprecated Use BadGatewayError from @webpieces/core-util/errors. Same constructor identity. */
65
- var ApiError_9 = require("../errors/ApiError");
66
- Object.defineProperty(exports, "HttpBadGatewayError", { enumerable: true, get: function () { return ApiError_9.BadGatewayError; } });
67
- /** @deprecated Use ServiceUnavailableError from @webpieces/core-util/errors. Same constructor identity. */
68
- var ApiError_10 = require("../errors/ApiError");
69
- Object.defineProperty(exports, "HttpServiceUnavailableError", { enumerable: true, get: function () { return ApiError_10.ServiceUnavailableError; } });
70
- /** @deprecated Use GatewayTimeoutError from @webpieces/core-util/errors. Same constructor identity. */
71
- var ApiError_11 = require("../errors/ApiError");
72
- Object.defineProperty(exports, "HttpGatewayTimeoutError", { enumerable: true, get: function () { return ApiError_11.GatewayTimeoutError; } });
73
- /** @deprecated Use InternalError from @webpieces/core-util/errors. Same constructor identity. */
74
- var ApiError_12 = require("../errors/ApiError");
75
- Object.defineProperty(exports, "HttpInternalServerError", { enumerable: true, get: function () { return ApiError_12.InternalError; } });
76
- /** @deprecated Use VendorError from @webpieces/core-util/errors. Same constructor identity. */
77
- var ApiError_13 = require("../errors/ApiError");
78
- Object.defineProperty(exports, "HttpVendorError", { enumerable: true, get: function () { return ApiError_13.VendorError; } });
79
- /** @deprecated Use UserError from @webpieces/core-util/errors. Same constructor identity. */
80
- var ApiError_14 = require("../errors/ApiError");
81
- Object.defineProperty(exports, "HttpUserError", { enumerable: true, get: function () { return ApiError_14.UserError; } });
82
- var ApiError_15 = require("../errors/ApiError");
83
- Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return ApiError_15.NotFoundError; } });
84
- Object.defineProperty(exports, "BadGatewayError", { enumerable: true, get: function () { return ApiError_15.BadGatewayError; } });
85
- Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return ApiError_15.ServiceUnavailableError; } });
86
- Object.defineProperty(exports, "GatewayTimeoutError", { enumerable: true, get: function () { return ApiError_15.GatewayTimeoutError; } });
87
- Object.defineProperty(exports, "InternalError", { enumerable: true, get: function () { return ApiError_15.InternalError; } });
88
- Object.defineProperty(exports, "TooManyRequestsError", { enumerable: true, get: function () { return ApiError_15.TooManyRequestsError; } });
89
- Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return ApiError_15.ForbiddenError; } });
90
- Object.defineProperty(exports, "RequestTimeoutError", { enumerable: true, get: function () { return ApiError_15.RequestTimeoutError; } });
91
- Object.defineProperty(exports, "UserError", { enumerable: true, get: function () { return ApiError_15.UserError; } });
92
- Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return ApiError_15.BadRequestError; } });
93
- Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return ApiError_15.UnauthorizedError; } });
94
- Object.defineProperty(exports, "VendorError", { enumerable: true, get: function () { return ApiError_15.VendorError; } });
95
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../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BAAiB,OAAyB;AACnD,wGAAwG;AACxG,+CAAsF;AAA7E,oHAAA,oBAAoB,OAA4B;AACzD,kGAAkG;AAClG,+CAA0E;AAAjE,8GAAA,cAAc,OAAsB;AAC7C,uGAAuG;AACvG,+CAA6E;AAApE,4GAAA,mBAAmB,OAAoB;AAChD,mGAAmG;AACnG,+CAA4E;AAAnE,+GAAA,eAAe,OAAuB;AAC/C,2GAA2G;AAC3G,gDAA4F;AAAnF,wHAAA,uBAAuB,OAA+B;AAC/D,uGAAuG;AACvG,gDAAoF;AAA3E,oHAAA,mBAAmB,OAA2B;AACvD,iGAAiG;AACjG,gDAA8E;AAArE,oHAAA,aAAa,OAA2B;AACjD,+FAA+F;AAC/F,gDAAoE;AAA3D,4GAAA,WAAW,OAAmB;AACvC,6FAA6F;AAC7F,gDAAgE;AAAvD,0GAAA,SAAS,OAAiB;AAEnC,gDAa4B;AAZxB,0GAAA,aAAa,OAAA;AACb,4GAAA,eAAe,OAAA;AACf,oHAAA,uBAAuB,OAAA;AACvB,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AACb,iHAAA,oBAAoB,OAAA;AACpB,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AACnB,sGAAA,SAAS,OAAA;AACT,4GAAA,eAAe,OAAA;AACf,8GAAA,iBAAiB,OAAA;AACjB,wGAAA,WAAW,OAAA","sourcesContent":["import { ApiError } from '../errors/ApiError';\nexport class ProtocolError {\n public message?: string;\n public subType?: string;\n public field?: string;\n public waitSeconds?: number;\n /**\n * Filled only by an app's own `ErrorTranslators.toWire()`. The built-in HttpError ladder does NOT\n * send it: nothing on the client reads it, and for a subclass it is an internal class name.\n */\n public name?: string;\n public guiAlertMessage?: string;\n public errorCode?: string;\n}\n\n// Error subtype constants\nexport const ENTITY_NOT_FOUND = 'EntityNotFoundError';\nexport const WRONG_LOGIN_TYPE = 'wrongLoginType';\nexport const WRONG_LOGIN = 'wronglogin';\nexport const NOT_APPROVED = 'notapproved';\nexport const EMAIL_NOT_CONFIRMED = 'email_not_confirmed';\nexport const WRONG_DOMAIN = 'wrongdomain';\nexport const WRONG_COMPANY = 'wrongcompany';\nexport const NO_REG_CODE = 'noregcode';\n\n/** @deprecated Prefer ApiError semantic subclasses; custom HTTP status belongs in ErrorTranslators. */\nexport class HttpError extends ApiError {\n constructor(\n message: string,\n public code: number,\n subType?: string,\n cause?: Error,\n ) {\n super(message, cause);\n this.subType = subType;\n }\n /** @deprecated Use the standard Error.cause. */\n get httpCause(): Error | undefined {\n return this.cause instanceof Error ? this.cause : undefined;\n }\n}\nexport { EndpointNotFoundError, OfflineError } from '../errors/ApiError';\n/** @deprecated Use NotFoundError from @webpieces/core-util/errors. Same constructor identity. */\nexport { NotFoundError as HttpNotFoundError } from '../errors/ApiError';\n/** @deprecated Use BadRequestError from @webpieces/core-util/errors. Same constructor identity. */\nexport { BadRequestError as HttpBadRequestError } from '../errors/ApiError';\n/** @deprecated Use UnauthorizedError from @webpieces/core-util/errors. Same constructor identity. */\nexport { UnauthorizedError as HttpUnauthorizedError } from '../errors/ApiError';\n/** @deprecated Use TooManyRequestsError from @webpieces/core-util/errors. Same constructor identity. */\nexport { TooManyRequestsError as HttpTooManyRequestsError } from '../errors/ApiError';\n/** @deprecated Use ForbiddenError from @webpieces/core-util/errors. Same constructor identity. */\nexport { ForbiddenError as HttpForbiddenError } from '../errors/ApiError';\n/** @deprecated Use RequestTimeoutError from @webpieces/core-util/errors. Same constructor identity. */\nexport { RequestTimeoutError as HttpTimeoutError } from '../errors/ApiError';\n/** @deprecated Use BadGatewayError from @webpieces/core-util/errors. Same constructor identity. */\nexport { BadGatewayError as HttpBadGatewayError } from '../errors/ApiError';\n/** @deprecated Use ServiceUnavailableError from @webpieces/core-util/errors. Same constructor identity. */\nexport { ServiceUnavailableError as HttpServiceUnavailableError } from '../errors/ApiError';\n/** @deprecated Use GatewayTimeoutError from @webpieces/core-util/errors. Same constructor identity. */\nexport { GatewayTimeoutError as HttpGatewayTimeoutError } from '../errors/ApiError';\n/** @deprecated Use InternalError from @webpieces/core-util/errors. Same constructor identity. */\nexport { InternalError as HttpInternalServerError } from '../errors/ApiError';\n/** @deprecated Use VendorError from @webpieces/core-util/errors. Same constructor identity. */\nexport { VendorError as HttpVendorError } from '../errors/ApiError';\n/** @deprecated Use UserError from @webpieces/core-util/errors. Same constructor identity. */\nexport { UserError as HttpUserError } from '../errors/ApiError';\n\nexport {\n NotFoundError,\n BadGatewayError,\n ServiceUnavailableError,\n GatewayTimeoutError,\n InternalError,\n TooManyRequestsError,\n ForbiddenError,\n RequestTimeoutError,\n UserError,\n BadRequestError,\n UnauthorizedError,\n VendorError,\n} from '../errors/ApiError';\nexport { ApiError };\n"]}