@lokalise/node-core 9.6.1 → 9.7.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
@@ -2,6 +2,7 @@ export { sendPut, sendPutBinary, sendDelete, sendPatch, sendGet, sendPost, sendP
2
2
  export { PublicNonRecoverableError, type PublicNonRecoverableErrorParams, } from './src/errors/PublicNonRecoverableError';
3
3
  export { InternalError, type ErrorDetails, type InternalErrorParams, } from './src/errors/InternalError';
4
4
  export { ResponseStatusError } from './src/errors/ResponseStatusError';
5
+ export { isResponseStatusError } from './src/errors/errorTypeGuards';
5
6
  export { ConfigScope } from './src/config/ConfigScope';
6
7
  export { ensureClosingSlashTransformer } from './src/config/configTransformers';
7
8
  export { createRangeValidator } from './src/config/configValidators';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitAndRetry = exports.AuthFailedError = exports.EntityNotFoundError = exports.AccessDeniedError = exports.RequestValidationError = exports.resolveGlobalErrorLogObject = exports.globalLogger = exports.executeSettleAllAndHandleGlobalErrors = exports.executeAndHandleGlobalErrors = exports.executeAsyncAndHandleGlobalErrors = exports.resolveMonorepoLoggerConfiguration = exports.resolveLoggerConfiguration = exports.hasMessage = exports.isPublicNonRecoverableError = exports.isObject = exports.isStandardizedError = exports.isInternalError = exports.deepClone = exports.convertDateFieldsToIsoString = exports.isEmptyObject = exports.copyWithoutUndefined = exports.pickWithoutUndefined = exports.pick = exports.groupByUnique = exports.groupBy = exports.removeNullish = exports.removeFalsy = exports.callChunked = exports.chunk = exports.isFailure = exports.isSuccess = exports.failure = exports.success = exports.createRangeValidator = exports.ensureClosingSlashTransformer = exports.ConfigScope = exports.ResponseStatusError = exports.InternalError = exports.PublicNonRecoverableError = exports.buildClient = exports.httpClient = exports.sendPostBinary = exports.sendPost = exports.sendGet = exports.sendPatch = exports.sendDelete = exports.sendPutBinary = exports.sendPut = void 0;
3
+ exports.waitAndRetry = exports.AuthFailedError = exports.EntityNotFoundError = exports.AccessDeniedError = exports.RequestValidationError = exports.resolveGlobalErrorLogObject = exports.globalLogger = exports.executeSettleAllAndHandleGlobalErrors = exports.executeAndHandleGlobalErrors = exports.executeAsyncAndHandleGlobalErrors = exports.resolveMonorepoLoggerConfiguration = exports.resolveLoggerConfiguration = exports.hasMessage = exports.isPublicNonRecoverableError = exports.isObject = exports.isStandardizedError = exports.isInternalError = exports.deepClone = exports.convertDateFieldsToIsoString = exports.isEmptyObject = exports.copyWithoutUndefined = exports.pickWithoutUndefined = exports.pick = exports.groupByUnique = exports.groupBy = exports.removeNullish = exports.removeFalsy = exports.callChunked = exports.chunk = exports.isFailure = exports.isSuccess = exports.failure = exports.success = exports.createRangeValidator = exports.ensureClosingSlashTransformer = exports.ConfigScope = exports.isResponseStatusError = exports.ResponseStatusError = exports.InternalError = exports.PublicNonRecoverableError = exports.buildClient = exports.httpClient = exports.sendPostBinary = exports.sendPost = exports.sendGet = exports.sendPatch = exports.sendDelete = exports.sendPutBinary = exports.sendPut = void 0;
4
4
  var httpClient_1 = require("./src/http/httpClient");
5
5
  Object.defineProperty(exports, "sendPut", { enumerable: true, get: function () { return httpClient_1.sendPut; } });
6
6
  Object.defineProperty(exports, "sendPutBinary", { enumerable: true, get: function () { return httpClient_1.sendPutBinary; } });
@@ -17,6 +17,8 @@ var InternalError_1 = require("./src/errors/InternalError");
17
17
  Object.defineProperty(exports, "InternalError", { enumerable: true, get: function () { return InternalError_1.InternalError; } });
18
18
  var ResponseStatusError_1 = require("./src/errors/ResponseStatusError");
19
19
  Object.defineProperty(exports, "ResponseStatusError", { enumerable: true, get: function () { return ResponseStatusError_1.ResponseStatusError; } });
20
+ var errorTypeGuards_1 = require("./src/errors/errorTypeGuards");
21
+ Object.defineProperty(exports, "isResponseStatusError", { enumerable: true, get: function () { return errorTypeGuards_1.isResponseStatusError; } });
20
22
  var ConfigScope_1 = require("./src/config/ConfigScope");
21
23
  Object.defineProperty(exports, "ConfigScope", { enumerable: true, get: function () { return ConfigScope_1.ConfigScope; } });
22
24
  var configTransformers_1 = require("./src/config/configTransformers");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,oDAc8B;AAb5B,qGAAA,OAAO,OAAA;AACP,2GAAA,aAAa,OAAA;AACb,wGAAA,UAAU,OAAA;AACV,uGAAA,SAAS,OAAA;AACT,qGAAA,OAAO,OAAA;AACP,sGAAA,QAAQ,OAAA;AACR,4GAAA,cAAc,OAAA;AACd,wGAAA,UAAU,OAAA;AACV,yGAAA,WAAW,OAAA;AAOb,oFAG+C;AAF7C,sIAAA,yBAAyB,OAAA;AAI3B,4DAImC;AAHjC,8GAAA,aAAa,OAAA;AAIf,wEAAsE;AAA7D,0HAAA,mBAAmB,OAAA;AAE5B,wDAAsD;AAA7C,0GAAA,WAAW,OAAA;AACpB,sEAA+E;AAAtE,mIAAA,6BAA6B,OAAA;AACtC,kEAAoE;AAA3D,wHAAA,oBAAoB,OAAA;AAQ7B,8CAAyF;AAAnE,iGAAA,OAAO,OAAA;AAAE,iGAAA,OAAO,OAAA;AAAE,mGAAA,SAAS,OAAA;AAAE,mGAAA,SAAS,OAAA;AAE5D,qDAAuF;AAA9E,mGAAA,KAAK,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACvD,uDASgC;AAR9B,sGAAA,OAAO,OAAA;AACP,4GAAA,aAAa,OAAA;AACb,mGAAA,IAAI,OAAA;AACJ,mHAAA,oBAAoB,OAAA;AACpB,mHAAA,oBAAoB,OAAA;AACpB,4GAAA,aAAa,OAAA;AACb,2HAAA,4BAA4B,OAAA;AAC5B,wGAAA,SAAS,OAAA;AAGX,mDAM8B;AAL5B,4GAAA,eAAe,OAAA;AACf,gHAAA,mBAAmB,OAAA;AACn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E,yGAAA,WAAW,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACvD,uDASgC;AAR9B,sGAAA,OAAO,OAAA;AACP,4GAAA,aAAa,OAAA;AACb,mGAAA,IAAI,OAAA;AACJ,mHAAA,oBAAoB,OAAA;AACpB,mHAAA,oBAAoB,OAAA;AACpB,4GAAA,aAAa,OAAA;AACb,2HAAA,4BAA4B,OAAA;AAC5B,wGAAA,SAAS,OAAA;AAGX,mDAM8B;AAL5B,4GAAA,eAAe,OAAA;AACf,gHAAA,mBAAmB,OAAA;AACnB,qGAAA,QAAQ,OAAA;AACR,wHAAA,2BAA2B,OAAA;AAC3B,uGAAA,UAAU,OAAA;AAIZ,2EAG2C;AAFzC,kIAAA,0BAA0B,OAAA;AAC1B,0IAAA,kCAAkC,OAAA;AASpC,sEAMwC;AALtC,uIAAA,iCAAiC,OAAA;AACjC,kIAAA,4BAA4B,OAAA;AAC5B,2IAAA,qCAAqC,OAAA;AACrC,kHAAA,YAAY,OAAA;AACZ,iIAAA,2BAA2B,OAAA;AAK7B,0DAQkC;AAPhC,sHAAA,sBAAsB,OAAA;AACtB,iHAAA,iBAAiB,OAAA;AACjB,mHAAA,mBAAmB,OAAA;AAInB,+GAAA,eAAe,OAAA;AAGjB,mDAAoD;AAA3C,yGAAA,YAAY,OAAA"}
@@ -2,5 +2,6 @@ import type { RequestResult } from 'undici-retry';
2
2
  import { InternalError } from './InternalError';
3
3
  export declare class ResponseStatusError extends InternalError {
4
4
  readonly response: RequestResult<any>;
5
+ readonly isResponseStatusError = true;
5
6
  constructor(requestResult: RequestResult<any>, requestLabel?: string);
6
7
  }
@@ -5,6 +5,7 @@ const InternalError_1 = require("./InternalError");
5
5
  class ResponseStatusError extends InternalError_1.InternalError {
6
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
7
  response;
8
+ isResponseStatusError = true;
8
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
10
  constructor(requestResult, requestLabel = 'N/A') {
10
11
  super({
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseStatusError.js","sourceRoot":"","sources":["../../../src/errors/ResponseStatusError.ts"],"names":[],"mappings":";;;AAEA,mDAA+C;AAE/C,MAAa,mBAAoB,SAAQ,6BAAa;IACpD,8DAA8D;IAC9C,QAAQ,CAAoB;IAE5C,8DAA8D;IAC9D,YAAY,aAAiC,EAAE,YAAY,GAAG,KAAK;QACjE,KAAK,CAAC;YACJ,OAAO,EAAE,wBAAwB,aAAa,CAAC,UAAU,EAAE;YAC3D,OAAO,EAAE;gBACP,YAAY;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,aAAa,CAAC,UAAU;oBACpC,IAAI,EAAE,aAAa,CAAC,IAAI;iBACzB;aACF;YACD,SAAS,EAAE,eAAe;SAC3B,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnC,CAAC;CACF;AApBD,kDAoBC"}
1
+ {"version":3,"file":"ResponseStatusError.js","sourceRoot":"","sources":["../../../src/errors/ResponseStatusError.ts"],"names":[],"mappings":";;;AAEA,mDAA+C;AAE/C,MAAa,mBAAoB,SAAQ,6BAAa;IACpD,8DAA8D;IAC9C,QAAQ,CAAoB;IAC5B,qBAAqB,GAAG,IAAI,CAAA;IAE5C,8DAA8D;IAC9D,YAAY,aAAiC,EAAE,YAAY,GAAG,KAAK;QACjE,KAAK,CAAC;YACJ,OAAO,EAAE,wBAAwB,aAAa,CAAC,UAAU,EAAE;YAC3D,OAAO,EAAE;gBACP,YAAY;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,aAAa,CAAC,UAAU;oBACpC,IAAI,EAAE,aAAa,CAAC,IAAI;iBACzB;aACF;YACD,SAAS,EAAE,eAAe;SAC3B,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnC,CAAC;CACF;AArBD,kDAqBC"}
@@ -0,0 +1,2 @@
1
+ import type { ResponseStatusError } from './ResponseStatusError';
2
+ export declare function isResponseStatusError(entity: unknown): entity is ResponseStatusError;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isResponseStatusError = void 0;
4
+ function isResponseStatusError(entity) {
5
+ return 'isResponseStatusError' in entity;
6
+ }
7
+ exports.isResponseStatusError = isResponseStatusError;
8
+ //# sourceMappingURL=errorTypeGuards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorTypeGuards.js","sourceRoot":"","sources":["../../../src/errors/errorTypeGuards.ts"],"names":[],"mappings":";;;AAEA,SAAgB,qBAAqB,CAAC,MAAe;IACnD,OAAO,uBAAuB,IAAK,MAA8B,CAAA;AACnE,CAAC;AAFD,sDAEC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const InternalError_1 = require("./InternalError");
5
+ const ResponseStatusError_1 = require("./ResponseStatusError");
6
+ const errorTypeGuards_1 = require("./errorTypeGuards");
7
+ (0, vitest_1.describe)('errorTypeGuards', () => {
8
+ (0, vitest_1.describe)('isResponseStatusError', () => {
9
+ it('Returns true for ResponseStatusError', () => {
10
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
11
+ const error = new ResponseStatusError_1.ResponseStatusError({}, 'label');
12
+ expect((0, errorTypeGuards_1.isResponseStatusError)(error)).toBe(true);
13
+ });
14
+ it('Returns false for not a ResponseStatusError', () => {
15
+ const error = new InternalError_1.InternalError({
16
+ message: 'message',
17
+ errorCode: 'CODE',
18
+ });
19
+ expect((0, errorTypeGuards_1.isResponseStatusError)(error)).toBe(false);
20
+ });
21
+ });
22
+ });
23
+ //# sourceMappingURL=errorTypeGuards.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorTypeGuards.spec.js","sourceRoot":"","sources":["../../../src/errors/errorTypeGuards.spec.ts"],"names":[],"mappings":";;AAAA,mCAAiC;AAEjC,mDAA+C;AAC/C,+DAA2D;AAC3D,uDAAyD;AAEzD,IAAA,iBAAQ,EAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAA,iBAAQ,EAAC,uBAAuB,EAAE,GAAG,EAAE;QACrC,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,oGAAoG;YACpG,MAAM,KAAK,GAAG,IAAI,yCAAmB,CAAC,EAAS,EAAE,OAAO,CAAC,CAAA;YAEzD,MAAM,CAAC,IAAA,uCAAqB,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,KAAK,GAAG,IAAI,6BAAa,CAAC;gBAC9B,OAAO,EAAE,SAAS;gBAClB,SAAS,EAAE,MAAM;aAClB,CAAC,CAAA;YAEF,MAAM,CAAC,IAAA,uCAAqB,EAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/node-core",
3
- "version": "9.6.1",
3
+ "version": "9.7.0",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"