@lokalise/node-core 12.2.0 → 12.3.0

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type { ErrorDetails } from './src/errors/types';
2
- export { PublicNonRecoverableError, type PublicNonRecoverableErrorParams, } from './src/errors/PublicNonRecoverableError';
3
- export { InternalError, type InternalErrorParams, } from './src/errors/InternalError';
2
+ export { PublicNonRecoverableError, isPublicNonRecoverableError, type PublicNonRecoverableErrorParams, } from './src/errors/PublicNonRecoverableError';
3
+ export { InternalError, isInternalError, type InternalErrorParams, } from './src/errors/InternalError';
4
4
  export { isEntityGoneError } from './src/errors/errorTypeGuards';
5
5
  export { ConfigScope } from './src/config/ConfigScope';
6
6
  export { ensureClosingSlashTransformer } from './src/config/configTransformers';
@@ -10,7 +10,7 @@ export { type Either, type DefiniteEither, success, failure, isSuccess, isFailur
10
10
  export { EncryptionUtility } from './src/utils/encryptionUtility';
11
11
  export { chunk, callChunked, removeFalsy, removeNullish } from './src/utils/arrayUtils';
12
12
  export { groupBy, groupByPath, groupByUnique, pick, pickWithoutUndefined, copyWithoutUndefined, copyWithoutEmpty, isEmptyObject, convertDateFieldsToIsoString, deepClone, } from './src/utils/objectUtils';
13
- export { isError, isInternalError, isStandardizedError, isObject, isPublicNonRecoverableError, hasMessage, } from './src/utils/typeUtils';
13
+ export { isError, isStandardizedError, isObject, hasMessage, } from './src/utils/typeUtils';
14
14
  export { type StandardizedError } from './src/utils/typeUtils';
15
15
  export { generateHash, HashAlgorithm, HashEncoding } from './src/utils/hashUtils';
16
16
  export { resolveLoggerConfiguration, resolveMonorepoLoggerConfiguration, } from './src/logging/loggerConfigResolver';
package/dist/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateChecksumForBufferOrString = exports.generateChecksumForObject = exports.generateChecksumForReadable = exports.waitAndRetry = exports.AuthFailedError = exports.EntityGoneError = exports.EntityNotFoundError = exports.AccessDeniedError = exports.RequestValidationError = exports.resolveGlobalErrorLogObject = exports.globalLogger = exports.executeSettleAllAndHandleGlobalErrors = exports.executeAndHandleGlobalErrors = exports.executeAsyncAndHandleGlobalErrors = exports.resolveMonorepoLoggerConfiguration = exports.resolveLoggerConfiguration = exports.HashEncoding = exports.HashAlgorithm = exports.generateHash = exports.hasMessage = exports.isPublicNonRecoverableError = exports.isObject = exports.isStandardizedError = exports.isInternalError = exports.isError = exports.deepClone = exports.convertDateFieldsToIsoString = exports.isEmptyObject = exports.copyWithoutEmpty = exports.copyWithoutUndefined = exports.pickWithoutUndefined = exports.pick = exports.groupByUnique = exports.groupByPath = exports.groupBy = exports.removeNullish = exports.removeFalsy = exports.callChunked = exports.chunk = exports.EncryptionUtility = exports.isFailure = exports.isSuccess = exports.failure = exports.success = exports.createRangeValidator = exports.ensureClosingSlashTransformer = exports.ConfigScope = exports.isEntityGoneError = exports.InternalError = exports.PublicNonRecoverableError = void 0;
3
+ exports.generateChecksumForBufferOrString = exports.generateChecksumForObject = exports.generateChecksumForReadable = exports.waitAndRetry = exports.AuthFailedError = exports.EntityGoneError = exports.EntityNotFoundError = exports.AccessDeniedError = exports.RequestValidationError = exports.resolveGlobalErrorLogObject = exports.globalLogger = exports.executeSettleAllAndHandleGlobalErrors = exports.executeAndHandleGlobalErrors = exports.executeAsyncAndHandleGlobalErrors = exports.resolveMonorepoLoggerConfiguration = exports.resolveLoggerConfiguration = exports.HashEncoding = exports.HashAlgorithm = exports.generateHash = exports.hasMessage = exports.isObject = exports.isStandardizedError = exports.isError = exports.deepClone = exports.convertDateFieldsToIsoString = exports.isEmptyObject = exports.copyWithoutEmpty = exports.copyWithoutUndefined = exports.pickWithoutUndefined = exports.pick = exports.groupByUnique = exports.groupByPath = exports.groupBy = exports.removeNullish = exports.removeFalsy = exports.callChunked = exports.chunk = exports.EncryptionUtility = exports.isFailure = exports.isSuccess = exports.failure = exports.success = exports.createRangeValidator = exports.ensureClosingSlashTransformer = exports.ConfigScope = exports.isEntityGoneError = exports.isInternalError = exports.InternalError = exports.isPublicNonRecoverableError = exports.PublicNonRecoverableError = void 0;
4
4
  exports.FsReadableProvider = void 0;
5
5
  var PublicNonRecoverableError_1 = require("./src/errors/PublicNonRecoverableError");
6
6
  Object.defineProperty(exports, "PublicNonRecoverableError", { enumerable: true, get: function () { return PublicNonRecoverableError_1.PublicNonRecoverableError; } });
7
+ Object.defineProperty(exports, "isPublicNonRecoverableError", { enumerable: true, get: function () { return PublicNonRecoverableError_1.isPublicNonRecoverableError; } });
7
8
  var InternalError_1 = require("./src/errors/InternalError");
8
9
  Object.defineProperty(exports, "InternalError", { enumerable: true, get: function () { return InternalError_1.InternalError; } });
10
+ Object.defineProperty(exports, "isInternalError", { enumerable: true, get: function () { return InternalError_1.isInternalError; } });
9
11
  var errorTypeGuards_1 = require("./src/errors/errorTypeGuards");
10
12
  Object.defineProperty(exports, "isEntityGoneError", { enumerable: true, get: function () { return errorTypeGuards_1.isEntityGoneError; } });
11
13
  var ConfigScope_1 = require("./src/config/ConfigScope");
@@ -39,10 +41,8 @@ Object.defineProperty(exports, "convertDateFieldsToIsoString", { enumerable: tru
39
41
  Object.defineProperty(exports, "deepClone", { enumerable: true, get: function () { return objectUtils_1.deepClone; } });
40
42
  var typeUtils_1 = require("./src/utils/typeUtils");
41
43
  Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return typeUtils_1.isError; } });
42
- Object.defineProperty(exports, "isInternalError", { enumerable: true, get: function () { return typeUtils_1.isInternalError; } });
43
44
  Object.defineProperty(exports, "isStandardizedError", { enumerable: true, get: function () { return typeUtils_1.isStandardizedError; } });
44
45
  Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return typeUtils_1.isObject; } });
45
- Object.defineProperty(exports, "isPublicNonRecoverableError", { enumerable: true, get: function () { return typeUtils_1.isPublicNonRecoverableError; } });
46
46
  Object.defineProperty(exports, "hasMessage", { enumerable: true, get: function () { return typeUtils_1.hasMessage; } });
47
47
  var hashUtils_1 = require("./src/utils/hashUtils");
48
48
  Object.defineProperty(exports, "generateHash", { enumerable: true, get: function () { return hashUtils_1.generateHash; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAEA,oFAG+C;AAF7C,sIAAA,yBAAyB,OAAA;AAI3B,4DAGmC;AAFjC,8GAAA,aAAa,OAAA;AAGf,gEAAgE;AAAvD,oHAAA,iBAAiB,OAAA;AAE1B,wDAAsD;AAA7C,0GAAA,WAAW,OAAA;AACpB,sEAA+E;AAAtE,mIAAA,6BAA6B,OAAA;AACtC,kEAAoE;AAA3D,wHAAA,oBAAoB,OAAA;AAQ7B,8CAO4B;AAJ1B,iGAAA,OAAO,OAAA;AACP,iGAAA,OAAO,OAAA;AACP,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AAGX,mEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAE1B,qDAAuF;AAA9E,mGAAA,KAAK,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACvD,uDAWgC;AAV9B,sGAAA,OAAO,OAAA;AACP,0GAAA,WAAW,OAAA;AACX,4GAAA,aAAa,OAAA;AACb,mGAAA,IAAI,OAAA;AACJ,mHAAA,oBAAoB,OAAA;AACpB,mHAAA,oBAAoB,OAAA;AACpB,+GAAA,gBAAgB,OAAA;AAChB,4GAAA,aAAa,OAAA;AACb,2HAAA,4BAA4B,OAAA;AAC5B,wGAAA,SAAS,OAAA;AAGX,mDAO8B;AAN5B,oGAAA,OAAO,OAAA;AACP,4GAAA,eAAe,OAAA;AACf,gHAAA,mBAAmB,OAAA;AACnB,qGAAA,QAAQ,OAAA;AACR,wHAAA,2BAA2B,OAAA;AAC3B,uGAAA,UAAU,OAAA;AAIZ,mDAAiF;AAAxE,yGAAA,YAAY,OAAA;AAAE,0GAAA,aAAa,OAAA;AAAE,yGAAA,YAAY,OAAA;AAElD,2EAG2C;AAFzC,kIAAA,0BAA0B,OAAA;AAC1B,0IAAA,kCAAkC,OAAA;AAUpC,sEAMwC;AALtC,uIAAA,iCAAiC,OAAA;AACjC,kIAAA,4BAA4B,OAAA;AAC5B,2IAAA,qCAAqC,OAAA;AACrC,kHAAA,YAAY,OAAA;AACZ,iIAAA,2BAA2B,OAAA;AAK7B,0DASkC;AALhC,sHAAA,sBAAsB,OAAA;AACtB,iHAAA,iBAAiB,OAAA;AACjB,mHAAA,mBAAmB,OAAA;AACnB,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA;AAGjB,mDAAoD;AAA3C,yGAAA,YAAY,OAAA;AAIrB,2DAIkC;AAHhC,4HAAA,2BAA2B,OAAA;AAC3B,0HAAA,yBAAyB,OAAA;AACzB,kIAAA,iCAAiC,OAAA;AAEnC,uDAA4D;AAAnD,iHAAA,kBAAkB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAEA,oFAI+C;AAH7C,sIAAA,yBAAyB,OAAA;AACzB,wIAAA,2BAA2B,OAAA;AAI7B,4DAImC;AAHjC,8GAAA,aAAa,OAAA;AACb,gHAAA,eAAe,OAAA;AAGjB,gEAAgE;AAAvD,oHAAA,iBAAiB,OAAA;AAE1B,wDAAsD;AAA7C,0GAAA,WAAW,OAAA;AACpB,sEAA+E;AAAtE,mIAAA,6BAA6B,OAAA;AACtC,kEAAoE;AAA3D,wHAAA,oBAAoB,OAAA;AAQ7B,8CAO4B;AAJ1B,iGAAA,OAAO,OAAA;AACP,iGAAA,OAAO,OAAA;AACP,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AAGX,mEAAiE;AAAxD,sHAAA,iBAAiB,OAAA;AAE1B,qDAAuF;AAA9E,mGAAA,KAAK,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACvD,uDAWgC;AAV9B,sGAAA,OAAO,OAAA;AACP,0GAAA,WAAW,OAAA;AACX,4GAAA,aAAa,OAAA;AACb,mGAAA,IAAI,OAAA;AACJ,mHAAA,oBAAoB,OAAA;AACpB,mHAAA,oBAAoB,OAAA;AACpB,+GAAA,gBAAgB,OAAA;AAChB,4GAAA,aAAa,OAAA;AACb,2HAAA,4BAA4B,OAAA;AAC5B,wGAAA,SAAS,OAAA;AAGX,mDAK8B;AAJ5B,oGAAA,OAAO,OAAA;AACP,gHAAA,mBAAmB,OAAA;AACnB,qGAAA,QAAQ,OAAA;AACR,uGAAA,UAAU,OAAA;AAIZ,mDAAiF;AAAxE,yGAAA,YAAY,OAAA;AAAE,0GAAA,aAAa,OAAA;AAAE,yGAAA,YAAY,OAAA;AAElD,2EAG2C;AAFzC,kIAAA,0BAA0B,OAAA;AAC1B,0IAAA,kCAAkC,OAAA;AAUpC,sEAMwC;AALtC,uIAAA,iCAAiC,OAAA;AACjC,kIAAA,4BAA4B,OAAA;AAC5B,2IAAA,qCAAqC,OAAA;AACrC,kHAAA,YAAY,OAAA;AACZ,iIAAA,2BAA2B,OAAA;AAK7B,0DASkC;AALhC,sHAAA,sBAAsB,OAAA;AACtB,iHAAA,iBAAiB,OAAA;AACjB,mHAAA,mBAAmB,OAAA;AACnB,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA;AAGjB,mDAAoD;AAA3C,yGAAA,YAAY,OAAA;AAIrB,2DAIkC;AAHhC,4HAAA,2BAA2B,OAAA;AAC3B,0HAAA,yBAAyB,OAAA;AACzB,kIAAA,iCAAiC,OAAA;AAEnC,uDAA4D;AAAnD,iHAAA,kBAAkB,OAAA"}
@@ -5,8 +5,12 @@ export type InternalErrorParams<T = ErrorDetails> = {
5
5
  details?: T;
6
6
  cause?: unknown;
7
7
  };
8
+ declare const internalErrorSymbol: unique symbol;
8
9
  export declare class InternalError<T = ErrorDetails> extends Error {
10
+ readonly [internalErrorSymbol] = true;
9
11
  readonly details?: T;
10
12
  readonly errorCode: string;
11
13
  constructor(params: InternalErrorParams<T>);
12
14
  }
15
+ export declare function isInternalError(error: unknown): error is InternalError;
16
+ export {};
@@ -1,17 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InternalError = void 0;
4
+ exports.isInternalError = isInternalError;
5
+ const typeUtils_1 = require("../utils/typeUtils");
6
+ const INTERNAL_ERROR_SYMBOL_KEY = 'INTERNAL_ERROR_KEY';
7
+ const internalErrorSymbol = Symbol.for(INTERNAL_ERROR_SYMBOL_KEY);
4
8
  class InternalError extends Error {
9
+ [internalErrorSymbol] = true;
5
10
  details;
6
11
  errorCode;
7
12
  constructor(params) {
8
13
  super(params.message, {
9
14
  cause: params.cause,
10
15
  });
11
- this.name = 'InternalError';
16
+ // set the name as the class name for every class that extends InternalError
17
+ this.name = this.constructor.name;
12
18
  this.details = params.details;
13
19
  this.errorCode = params.errorCode;
14
20
  }
15
21
  }
16
22
  exports.InternalError = InternalError;
23
+ function isInternalError(error) {
24
+ return ((0, typeUtils_1.isError)(error) &&
25
+ // biome-ignore lint/suspicious/noExplicitAny: checking for existence of prop outside or Error interface
26
+ (error[Symbol.for(INTERNAL_ERROR_SYMBOL_KEY)] === true ||
27
+ error.name === 'InternalError'));
28
+ }
17
29
  //# sourceMappingURL=InternalError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalError.js","sourceRoot":"","sources":["../../../src/errors/InternalError.ts"],"names":[],"mappings":";;;AASA,MAAa,aAAgC,SAAQ,KAAK;IACxC,OAAO,CAAI;IACX,SAAS,CAAQ;IAEjC,YAAY,MAA8B;QACxC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;IACnC,CAAC;CACF;AAZD,sCAYC"}
1
+ {"version":3,"file":"InternalError.js","sourceRoot":"","sources":["../../../src/errors/InternalError.ts"],"names":[],"mappings":";;;AA6BA,0CAOC;AApCD,kDAA4C;AAU5C,MAAM,yBAAyB,GAAG,oBAAoB,CAAA;AACtD,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;AAEjE,MAAa,aAAgC,SAAQ,KAAK;IAC/C,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAA;IACrB,OAAO,CAAI;IACX,SAAS,CAAQ;IAEjC,YAAY,MAA8B;QACxC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAA;QACF,4EAA4E;QAC5E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;IACnC,CAAC;CACF;AAdD,sCAcC;AAED,SAAgB,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,IAAA,mBAAO,EAAC,KAAK,CAAC;QACd,wGAAwG;QACxG,CAAE,KAAa,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,KAAK,IAAI;YAC7D,KAAK,CAAC,IAAI,KAAK,eAAe,CAAC,CAClC,CAAA;AACH,CAAC"}
@@ -6,12 +6,16 @@ export type PublicNonRecoverableErrorParams<T = ErrorDetails> = {
6
6
  httpStatusCode?: number;
7
7
  cause?: unknown;
8
8
  };
9
+ declare const publicNonRecoverableErrorSymbol: unique symbol;
9
10
  /**
10
11
  * This error is returned to the consumer of API
11
12
  */
12
13
  export declare class PublicNonRecoverableError<T = ErrorDetails> extends Error {
14
+ readonly [publicNonRecoverableErrorSymbol] = true;
13
15
  readonly details?: T;
14
16
  readonly errorCode: string;
15
17
  readonly httpStatusCode: number;
16
18
  constructor(params: PublicNonRecoverableErrorParams<T>);
17
19
  }
20
+ export declare function isPublicNonRecoverableError(error: unknown): error is PublicNonRecoverableError;
21
+ export {};
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PublicNonRecoverableError = void 0;
4
+ exports.isPublicNonRecoverableError = isPublicNonRecoverableError;
5
+ const typeUtils_1 = require("../utils/typeUtils");
6
+ const PUBLIC_NON_RECOVERABLE_ERROR_SYMBOL_KEY = 'PUBLIC_NON_RECOVERABLE_ERROR_KEY';
7
+ const publicNonRecoverableErrorSymbol = Symbol.for(PUBLIC_NON_RECOVERABLE_ERROR_SYMBOL_KEY);
4
8
  /**
5
9
  * This error is returned to the consumer of API
6
10
  */
7
11
  class PublicNonRecoverableError extends Error {
12
+ [publicNonRecoverableErrorSymbol] = true;
8
13
  details;
9
14
  errorCode;
10
15
  httpStatusCode;
@@ -12,11 +17,18 @@ class PublicNonRecoverableError extends Error {
12
17
  super(params.message, {
13
18
  cause: params.cause,
14
19
  });
15
- this.name = 'PublicNonRecoverableError';
20
+ // set the name as the class name for every class that extends PublicNonRecoverableError
21
+ this.name = this.constructor.name;
16
22
  this.details = params.details;
17
23
  this.errorCode = params.errorCode;
18
24
  this.httpStatusCode = params.httpStatusCode ?? 500;
19
25
  }
20
26
  }
21
27
  exports.PublicNonRecoverableError = PublicNonRecoverableError;
28
+ function isPublicNonRecoverableError(error) {
29
+ return ((0, typeUtils_1.isError)(error) &&
30
+ // biome-ignore lint/suspicious/noExplicitAny: checking for existence of prop outside or Error interface
31
+ (error[Symbol.for(PUBLIC_NON_RECOVERABLE_ERROR_SYMBOL_KEY)] === true ||
32
+ error.name === 'PublicNonRecoverableError'));
33
+ }
22
34
  //# sourceMappingURL=PublicNonRecoverableError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PublicNonRecoverableError.js","sourceRoot":"","sources":["../../../src/errors/PublicNonRecoverableError.ts"],"names":[],"mappings":";;;AAUA;;GAEG;AACH,MAAa,yBAA4C,SAAQ,KAAK;IACpD,OAAO,CAAI;IACX,SAAS,CAAQ;IACjB,cAAc,CAAQ;IAEtC,YAAY,MAA0C;QACpD,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAA;QACvC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,GAAG,CAAA;IACpD,CAAC;CACF;AAdD,8DAcC"}
1
+ {"version":3,"file":"PublicNonRecoverableError.js","sourceRoot":"","sources":["../../../src/errors/PublicNonRecoverableError.ts"],"names":[],"mappings":";;;AAmCA,kEAOC;AA1CD,kDAA4C;AAW5C,MAAM,uCAAuC,GAAG,kCAAkC,CAAA;AAClF,MAAM,+BAA+B,GAAG,MAAM,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;AAE3F;;GAEG;AACH,MAAa,yBAA4C,SAAQ,KAAK;IAC3D,CAAC,+BAA+B,CAAC,GAAG,IAAI,CAAA;IACjC,OAAO,CAAI;IACX,SAAS,CAAQ;IACjB,cAAc,CAAQ;IAEtC,YAAY,MAA0C;QACpD,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAA;QACF,wFAAwF;QACxF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAC7B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,GAAG,CAAA;IACpD,CAAC;CACF;AAhBD,8DAgBC;AAED,SAAgB,2BAA2B,CAAC,KAAc;IACxD,OAAO,CACL,IAAA,mBAAO,EAAC,KAAK,CAAC;QACd,wGAAwG;QACxG,CAAE,KAAa,CAAC,MAAM,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC,KAAK,IAAI;YAC3E,KAAK,CAAC,IAAI,KAAK,2BAA2B,CAAC,CAC9C,CAAA;AACH,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isEntityGoneError = isEntityGoneError;
4
- const typeUtils_1 = require("../utils/typeUtils");
4
+ const PublicNonRecoverableError_1 = require("../errors/PublicNonRecoverableError");
5
5
  function isEntityGoneError(entity) {
6
- return (0, typeUtils_1.isPublicNonRecoverableError)(entity) && entity.httpStatusCode === 410;
6
+ return (0, PublicNonRecoverableError_1.isPublicNonRecoverableError)(entity) && entity.httpStatusCode === 410;
7
7
  }
8
8
  //# sourceMappingURL=errorTypeGuards.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorTypeGuards.js","sourceRoot":"","sources":["../../../src/errors/errorTypeGuards.ts"],"names":[],"mappings":";;AAIA,8CAEC;AAND,kDAAgE;AAIhE,SAAgB,iBAAiB,CAAC,MAAe;IAC/C,OAAO,IAAA,uCAA2B,EAAC,MAAM,CAAC,IAAI,MAAM,CAAC,cAAc,KAAK,GAAG,CAAA;AAC7E,CAAC"}
1
+ {"version":3,"file":"errorTypeGuards.js","sourceRoot":"","sources":["../../../src/errors/errorTypeGuards.ts"],"names":[],"mappings":";;AAIA,8CAEC;AAND,mFAAiF;AAIjF,SAAgB,iBAAiB,CAAC,MAAe;IAC/C,OAAO,IAAA,uDAA2B,EAAC,MAAM,CAAC,IAAI,MAAM,CAAC,cAAc,KAAK,GAAG,CAAA;AAC7E,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { TransactionObservabilityManager } from './observabilityTypes';
2
+ /**
3
+ * Groups different TransactionObservabilityManager instances into one
4
+ * to facilitate tracking transactions across multiple observability tools.
5
+ */
6
+ export declare class MultiTransactionObservabilityManager implements TransactionObservabilityManager {
7
+ private readonly managers;
8
+ constructor(managers: TransactionObservabilityManager[]);
9
+ start(transactionName: string, uniqueTransactionKey: string): void;
10
+ startWithGroup(transactionName: string, uniqueTransactionKey: string, transactionGroup: string): void;
11
+ stop(uniqueTransactionKey: string, wasSuccessful?: boolean): void;
12
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultiTransactionObservabilityManager = void 0;
4
+ /**
5
+ * Groups different TransactionObservabilityManager instances into one
6
+ * to facilitate tracking transactions across multiple observability tools.
7
+ */
8
+ class MultiTransactionObservabilityManager {
9
+ managers;
10
+ constructor(managers) {
11
+ this.managers = managers;
12
+ }
13
+ start(transactionName, uniqueTransactionKey) {
14
+ for (const manager of this.managers) {
15
+ manager.start(transactionName, uniqueTransactionKey);
16
+ }
17
+ }
18
+ startWithGroup(transactionName, uniqueTransactionKey, transactionGroup) {
19
+ for (const manager of this.managers) {
20
+ manager.startWithGroup(transactionName, uniqueTransactionKey, transactionGroup);
21
+ }
22
+ }
23
+ stop(uniqueTransactionKey, wasSuccessful) {
24
+ for (const manager of this.managers) {
25
+ manager.stop(uniqueTransactionKey, wasSuccessful);
26
+ }
27
+ }
28
+ }
29
+ exports.MultiTransactionObservabilityManager = MultiTransactionObservabilityManager;
30
+ //# sourceMappingURL=MultiTransactionObservabilityManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiTransactionObservabilityManager.js","sourceRoot":"","sources":["../../../src/observability/MultiTransactionObservabilityManager.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,oCAAoC;IAC9B,QAAQ,CAAmC;IAE5D,YAAY,QAA2C;QACrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,KAAK,CAAC,eAAuB,EAAE,oBAA4B;QACzD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;IAED,cAAc,CACZ,eAAuB,EACvB,oBAA4B,EAC5B,gBAAwB;QAExB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,OAAO,CAAC,cAAc,CAAC,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,CAAC,CAAA;QACjF,CAAC;IACH,CAAC;IAED,IAAI,CAAC,oBAA4B,EAAE,aAAuB;QACxD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAA;QACnD,CAAC;IACH,CAAC;CACF;AA5BD,oFA4BC"}
@@ -1,5 +1,3 @@
1
- import type { InternalError } from '../errors/InternalError';
2
- import type { PublicNonRecoverableError } from '../errors/PublicNonRecoverableError';
3
1
  export type StandardizedError = {
4
2
  code: string;
5
3
  message: string;
@@ -9,6 +7,4 @@ export declare function hasMessage(maybe: unknown): maybe is {
9
7
  };
10
8
  export declare function isObject(maybeObject: unknown): maybeObject is Record<PropertyKey, unknown>;
11
9
  export declare function isStandardizedError(error: unknown): error is StandardizedError;
12
- export declare function isInternalError(error: unknown): error is InternalError;
13
10
  export declare function isError(maybeError: unknown): maybeError is Error;
14
- export declare function isPublicNonRecoverableError(error: unknown): error is PublicNonRecoverableError;
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasMessage = hasMessage;
4
4
  exports.isObject = isObject;
5
5
  exports.isStandardizedError = isStandardizedError;
6
- exports.isInternalError = isInternalError;
7
6
  exports.isError = isError;
8
- exports.isPublicNonRecoverableError = isPublicNonRecoverableError;
9
7
  function hasMessage(maybe) {
10
8
  return isObject(maybe) && typeof maybe.message === 'string';
11
9
  }
@@ -15,13 +13,7 @@ function isObject(maybeObject) {
15
13
  function isStandardizedError(error) {
16
14
  return isObject(error) && typeof error.code === 'string' && typeof error.message === 'string';
17
15
  }
18
- function isInternalError(error) {
19
- return isObject(error) && error.name === 'InternalError';
20
- }
21
16
  function isError(maybeError) {
22
17
  return (maybeError instanceof Error || Object.prototype.toString.call(maybeError) === '[object Error]');
23
18
  }
24
- function isPublicNonRecoverableError(error) {
25
- return isObject(error) && error.name === 'PublicNonRecoverableError';
26
- }
27
19
  //# sourceMappingURL=typeUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../../src/utils/typeUtils.ts"],"names":[],"mappings":";;AASA,gCAEC;AAED,4BAEC;AAED,kDAEC;AAED,0CAEC;AAED,0BAIC;AAED,kEAEC;AAxBD,SAAgB,UAAU,CAAC,KAAc;IACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAA;AAC7D,CAAC;AAED,SAAgB,QAAQ,CAAC,WAAoB;IAC3C,OAAO,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,KAAK,IAAI,CAAA;AAChE,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAAc;IAChD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAA;AAC/F,CAAC;AAED,SAAgB,eAAe,CAAC,KAAc;IAC5C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,CAAA;AAC1D,CAAC;AAED,SAAgB,OAAO,CAAC,UAAmB;IACzC,OAAO,CACL,UAAU,YAAY,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,gBAAgB,CAC/F,CAAA;AACH,CAAC;AAED,SAAgB,2BAA2B,CAAC,KAAc;IACxD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,2BAA2B,CAAA;AACtE,CAAC"}
1
+ {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../../src/utils/typeUtils.ts"],"names":[],"mappings":";;AAMA,gCAEC;AAED,4BAEC;AAED,kDAEC;AAED,0BAIC;AAhBD,SAAgB,UAAU,CAAC,KAAc;IACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAA;AAC7D,CAAC;AAED,SAAgB,QAAQ,CAAC,WAAoB;IAC3C,OAAO,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,KAAK,IAAI,CAAA;AAChE,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAAc;IAChD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAA;AAC/F,CAAC;AAED,SAAgB,OAAO,CAAC,UAAmB;IACzC,OAAO,CACL,UAAU,YAAY,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,gBAAgB,CAC/F,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/node-core",
3
- "version": "12.2.0",
3
+ "version": "12.3.0",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"