@lokalise/node-core 11.2.0 → 12.0.1-test-realms

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/README.md CHANGED
@@ -2,16 +2,12 @@
2
2
 
3
3
  Core libraries for Node.js backend services.
4
4
 
5
- - [Overview](#overview)
6
- - [HTTP Client](#http-client)
7
5
  - [Default Logging Configuration](#default-logging-configuration)
8
6
  - [ConfigScope](#configscope)
9
7
  - [Error Handling](#error-handling)
10
8
 
11
9
  See [docs](/docs) for further instructions on how to use.
12
10
 
13
- ## Overview
14
-
15
11
  ## Default Logging Configuration
16
12
 
17
13
  The library provides methods to resolve the default logging configuration. Public methods available are:
@@ -136,11 +132,13 @@ The library exposes classes for the following errors:
136
132
  - `InternalError`, which issues a `500` status code and is not exposed in the global error handler. It expects the following parameters:
137
133
  - `message`;
138
134
  - `errorCode`;
139
- - `details` – (optional).
135
+ - `details` – (optional);
136
+ - `cause` – (optional).
140
137
  - `PublicNonRecoverableError`, which issues the HTTP status code provided and signals that the user did something wrong, hence the error is returned to the consumer of the API. It expects the following parameters:
141
138
  - `message`;
142
139
  - `errorCode`;
143
140
  - `details` – (optional);
141
+ - `cause` – (optional);
144
142
  - `httpStatusCode` – (optional). Defaults to `500`;
145
143
 
146
144
  ### Either
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export { PublicNonRecoverableError, type PublicNonRecoverableErrorParams, } from './src/errors/PublicNonRecoverableError';
2
- export { InternalError, type ErrorDetails, type InternalErrorParams, } from './src/errors/InternalError';
1
+ export type { ErrorDetails } from './src/errors/types';
2
+ export { PublicNonRecoverableError, isPublicNonRecoverableError, type PublicNonRecoverableErrorParams, } from './src/errors/PublicNonRecoverableError';
3
+ export { InternalError, isInternalError, type InternalErrorParams, } from './src/errors/InternalError';
3
4
  export { isEntityGoneError } from './src/errors/errorTypeGuards';
4
5
  export { ConfigScope } from './src/config/ConfigScope';
5
6
  export { ensureClosingSlashTransformer } from './src/config/configTransformers';
@@ -9,7 +10,7 @@ export { type Either, type DefiniteEither, success, failure, isSuccess, isFailur
9
10
  export { EncryptionUtility } from './src/utils/encryptionUtility';
10
11
  export { chunk, callChunked, removeFalsy, removeNullish } from './src/utils/arrayUtils';
11
12
  export { groupBy, groupByPath, groupByUnique, pick, pickWithoutUndefined, copyWithoutUndefined, copyWithoutEmpty, isEmptyObject, convertDateFieldsToIsoString, deepClone, } from './src/utils/objectUtils';
12
- export { isError, isInternalError, isStandardizedError, isObject, isPublicNonRecoverableError, hasMessage, } from './src/utils/typeUtils';
13
+ export { isError, isStandardizedError, isObject, hasMessage, } from './src/utils/typeUtils';
13
14
  export { type StandardizedError } from './src/utils/typeUtils';
14
15
  export { generateHash, HashAlgorithm, HashEncoding } from './src/utils/hashUtils';
15
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":";;;;AAAA,oFAG+C;AAF7C,sIAAA,yBAAyB,OAAA;AAI3B,4DAImC;AAHjC,8GAAA,aAAa,OAAA;AAIf,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,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AAA,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,12 +1,16 @@
1
- export type ErrorDetails = Record<string, unknown>;
1
+ import type { ErrorDetails } from './types';
2
2
  export type InternalErrorParams<T = ErrorDetails> = {
3
3
  message: string;
4
4
  errorCode: string;
5
5
  details?: T;
6
- cause?: Error;
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,7 +1,12 @@
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) {
@@ -14,4 +19,8 @@ class InternalError extends Error {
14
19
  }
15
20
  }
16
21
  exports.InternalError = InternalError;
22
+ function isInternalError(error) {
23
+ // biome-ignore lint/suspicious/noExplicitAny: checking for existence of prop outside or Error interface
24
+ return (0, typeUtils_1.isError)(error) && error[Symbol.for(INTERNAL_ERROR_SYMBOL_KEY)] === true;
25
+ }
17
26
  //# 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":";;;AA4BA,0CAGC;AA/BD,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,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;AAbD,sCAaC;AAED,SAAgB,eAAe,CAAC,KAAc;IAC5C,wGAAwG;IACxG,OAAO,IAAA,mBAAO,EAAC,KAAK,CAAC,IAAK,KAAa,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,KAAK,IAAI,CAAA;AACzF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ErrorDetails } from './types';
2
+ export type InternalErrorParams<T = ErrorDetails> = {
3
+ message: string;
4
+ errorCode: string;
5
+ details?: T;
6
+ cause?: unknown;
7
+ };
8
+ declare const internalErrorSymbol: unique symbol;
9
+ export declare class InternalError2<T = ErrorDetails> extends Error {
10
+ readonly [internalErrorSymbol] = true;
11
+ readonly details?: T;
12
+ readonly errorCode: string;
13
+ constructor(params: InternalErrorParams<T>);
14
+ }
15
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InternalError2 = void 0;
4
+ const INTERNAL_ERROR_SYMBOL_KEY = 'INTERNAL_ERROR_KEY';
5
+ const internalErrorSymbol = Symbol.for(INTERNAL_ERROR_SYMBOL_KEY);
6
+ class InternalError2 extends Error {
7
+ [internalErrorSymbol] = true;
8
+ details;
9
+ errorCode;
10
+ constructor(params) {
11
+ super(params.message, {
12
+ cause: params.cause,
13
+ });
14
+ this.name = 'InternalError';
15
+ this.details = params.details;
16
+ this.errorCode = params.errorCode;
17
+ }
18
+ }
19
+ exports.InternalError2 = InternalError2;
20
+ //# sourceMappingURL=InternalError2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalError2.js","sourceRoot":"","sources":["../../../src/errors/InternalError2.ts"],"names":[],"mappings":";;;AAUA,MAAM,yBAAyB,GAAG,oBAAoB,CAAA;AACtD,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;AAEjE,MAAa,cAAiC,SAAQ,KAAK;IAChD,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,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;AAbD,wCAaC"}
@@ -1,17 +1,21 @@
1
- import type { ErrorDetails } from './InternalError';
2
- export type PublicNonRecoverableErrorParams = {
1
+ import type { ErrorDetails } from './types';
2
+ export type PublicNonRecoverableErrorParams<T = ErrorDetails> = {
3
3
  message: string;
4
4
  errorCode: string;
5
- details?: ErrorDetails;
5
+ details?: T;
6
6
  httpStatusCode?: number;
7
- cause?: Error;
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
- export declare class PublicNonRecoverableError extends Error {
13
- readonly details?: ErrorDetails;
13
+ export declare class PublicNonRecoverableError<T = ErrorDetails> extends Error {
14
+ readonly [publicNonRecoverableErrorSymbol] = true;
15
+ readonly details?: T;
14
16
  readonly errorCode: string;
15
17
  readonly httpStatusCode: number;
16
- constructor(params: PublicNonRecoverableErrorParams);
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;
@@ -19,4 +24,9 @@ class PublicNonRecoverableError extends Error {
19
24
  }
20
25
  }
21
26
  exports.PublicNonRecoverableError = PublicNonRecoverableError;
27
+ function isPublicNonRecoverableError(error) {
28
+ return (
29
+ // biome-ignore lint/suspicious/noExplicitAny: checking for existence of prop outside or Error interface
30
+ (0, typeUtils_1.isError)(error) && error[Symbol.for(PUBLIC_NON_RECOVERABLE_ERROR_SYMBOL_KEY)] === true);
31
+ }
22
32
  //# sourceMappingURL=PublicNonRecoverableError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PublicNonRecoverableError.js","sourceRoot":"","sources":["../../../src/errors/PublicNonRecoverableError.ts"],"names":[],"mappings":";;;AAUA;;GAEG;AACH,MAAa,yBAA0B,SAAQ,KAAK;IAClC,OAAO,CAAe;IACtB,SAAS,CAAQ;IACjB,cAAc,CAAQ;IAEtC,YAAY,MAAuC;QACjD,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":";;;AAkCA,kEAKC;AAvCD,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,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;AAfD,8DAeC;AAED,SAAgB,2BAA2B,CAAC,KAAc;IACxD,OAAO;IACL,wGAAwG;IACxG,IAAA,mBAAO,EAAC,KAAK,CAAC,IAAK,KAAa,CAAC,MAAM,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC,KAAK,IAAI,CAC/F,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { RequestResult } from 'undici-retry';
2
+ import { InternalError } from './InternalError';
3
+ export declare class ResponseStatusError extends InternalError {
4
+ readonly response: RequestResult<any>;
5
+ readonly isResponseStatusError = true;
6
+ constructor(requestResult: RequestResult<any>, requestLabel?: string);
7
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseStatusError = void 0;
4
+ const InternalError_1 = require("./InternalError");
5
+ class ResponseStatusError extends InternalError_1.InternalError {
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ response;
8
+ isResponseStatusError = true;
9
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ constructor(requestResult, requestLabel = 'N/A') {
11
+ super({
12
+ message: `Response status code ${requestResult.statusCode}`,
13
+ details: {
14
+ requestLabel,
15
+ response: {
16
+ statusCode: requestResult.statusCode,
17
+ body: requestResult.body,
18
+ },
19
+ },
20
+ errorCode: 'REQUEST_ERROR',
21
+ });
22
+ this.response = requestResult;
23
+ this.name = 'ResponseStatusError';
24
+ }
25
+ }
26
+ exports.ResponseStatusError = ResponseStatusError;
27
+ //# sourceMappingURL=ResponseStatusError.js.map
@@ -0,0 +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;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"}
@@ -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 @@
1
+ export type ErrorDetails = Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errors/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,53 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import type { Readable } from 'stream';
4
+ import { Client } from 'undici';
5
+ import type { FormData } from 'undici';
6
+ import type { RequestResult, RetryConfig } from 'undici-retry';
7
+ import type { DefiniteEither } from '../errors/either';
8
+ type RecordObject = Record<string, any>;
9
+ export type HttpRequestContext = {
10
+ reqId: string;
11
+ };
12
+ export type ResponseSchema<Output = any> = {
13
+ parse(data: unknown): Output;
14
+ };
15
+ export type RequestOptions<T> = {
16
+ headers?: RecordObject;
17
+ query?: RecordObject;
18
+ timeout: number | undefined;
19
+ throwOnError?: boolean;
20
+ reqContext?: HttpRequestContext;
21
+ safeParseJson?: boolean;
22
+ blobResponseBody?: boolean;
23
+ requestLabel: string;
24
+ disableKeepAlive?: boolean;
25
+ retryConfig?: RetryConfig;
26
+ clientOptions?: Client.Options;
27
+ responseSchema?: ResponseSchema<T>;
28
+ validateResponse: boolean;
29
+ };
30
+ export type Response<T> = {
31
+ body: T;
32
+ headers: RecordObject;
33
+ statusCode: number;
34
+ };
35
+ export declare function sendGet<T>(client: Client, path: string, options?: Partial<RequestOptions<T>>): Promise<DefiniteEither<RequestResult<unknown>, RequestResult<T>>>;
36
+ export declare function sendDelete<T>(client: Client, path: string, options?: Partial<RequestOptions<T>>): Promise<DefiniteEither<RequestResult<unknown>, RequestResult<T>>>;
37
+ export declare function sendPost<T>(client: Client, path: string, body: RecordObject | undefined, options?: Partial<RequestOptions<T>>): Promise<DefiniteEither<RequestResult<unknown>, RequestResult<T>>>;
38
+ export declare function sendPostBinary<T>(client: Client, path: string, body: Buffer | Uint8Array | Readable | FormData | null, options?: Partial<RequestOptions<T>>): Promise<DefiniteEither<RequestResult<unknown>, RequestResult<T>>>;
39
+ export declare function sendPut<T>(client: Client, path: string, body: RecordObject | undefined, options?: Partial<RequestOptions<T>>): Promise<DefiniteEither<RequestResult<unknown>, RequestResult<T>>>;
40
+ export declare function sendPutBinary<T>(client: Client, path: string, body: Buffer | Uint8Array | Readable | FormData | null, options?: Partial<RequestOptions<T>>): Promise<DefiniteEither<RequestResult<unknown>, RequestResult<T>>>;
41
+ export declare function sendPatch<T>(client: Client, path: string, body: RecordObject | undefined, options?: Partial<RequestOptions<T>>): Promise<DefiniteEither<RequestResult<unknown>, RequestResult<T>>>;
42
+ export declare function buildClient(baseUrl: string, clientOptions?: Client.Options): Client;
43
+ export declare const httpClient: {
44
+ get: typeof sendGet;
45
+ post: typeof sendPost;
46
+ put: typeof sendPut;
47
+ patch: typeof sendPatch;
48
+ del: typeof sendDelete;
49
+ };
50
+ export declare const JSON_HEADERS: {
51
+ 'Content-Type': string;
52
+ };
53
+ export {};
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JSON_HEADERS = exports.httpClient = exports.buildClient = exports.sendPatch = exports.sendPutBinary = exports.sendPut = exports.sendPostBinary = exports.sendPost = exports.sendDelete = exports.sendGet = void 0;
4
+ const undici_1 = require("undici");
5
+ const undici_retry_1 = require("undici-retry");
6
+ const ResponseStatusError_1 = require("../errors/ResponseStatusError");
7
+ const objectUtils_1 = require("../utils/objectUtils");
8
+ const DEFAULT_OPTIONS = {
9
+ validateResponse: true,
10
+ throwOnError: true,
11
+ timeout: 30000,
12
+ };
13
+ const defaultClientOptions = {
14
+ keepAliveMaxTimeout: 300_000,
15
+ keepAliveTimeout: 4000,
16
+ };
17
+ async function sendGet(client, path, options = {}) {
18
+ const result = await (0, undici_retry_1.sendWithRetry)(client, {
19
+ ...DEFAULT_OPTIONS,
20
+ path: path,
21
+ method: 'GET',
22
+ query: options.query,
23
+ headers: (0, objectUtils_1.copyWithoutUndefined)({
24
+ 'x-request-id': options.reqContext?.reqId,
25
+ ...options.headers,
26
+ }),
27
+ reset: options.disableKeepAlive ?? false,
28
+ bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
29
+ headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
30
+ throwOnError: false,
31
+ }, resolveRetryConfig(options), resolveRequestConfig(options));
32
+ return resolveResult(result, options.throwOnError ?? DEFAULT_OPTIONS.throwOnError, options.validateResponse ?? DEFAULT_OPTIONS.validateResponse, options.responseSchema, options.requestLabel);
33
+ }
34
+ exports.sendGet = sendGet;
35
+ async function sendDelete(client, path, options = {}) {
36
+ const result = await (0, undici_retry_1.sendWithRetry)(client, {
37
+ ...DEFAULT_OPTIONS,
38
+ path,
39
+ method: 'DELETE',
40
+ query: options.query,
41
+ headers: (0, objectUtils_1.copyWithoutUndefined)({
42
+ 'x-request-id': options.reqContext?.reqId,
43
+ ...options.headers,
44
+ }),
45
+ reset: options.disableKeepAlive ?? false,
46
+ bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
47
+ headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
48
+ throwOnError: false,
49
+ }, resolveRetryConfig(options), resolveRequestConfig(options));
50
+ return resolveResult(result, options.throwOnError ?? DEFAULT_OPTIONS.throwOnError, options.validateResponse ?? DEFAULT_OPTIONS.validateResponse, options.responseSchema, options.requestLabel);
51
+ }
52
+ exports.sendDelete = sendDelete;
53
+ async function sendPost(client, path, body, options = {}) {
54
+ const result = await (0, undici_retry_1.sendWithRetry)(client, {
55
+ ...DEFAULT_OPTIONS,
56
+ path: path,
57
+ method: 'POST',
58
+ body: body ? JSON.stringify(body) : undefined,
59
+ query: options.query,
60
+ headers: (0, objectUtils_1.copyWithoutUndefined)({
61
+ 'x-request-id': options.reqContext?.reqId,
62
+ ...options.headers,
63
+ }),
64
+ reset: options.disableKeepAlive ?? false,
65
+ bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
66
+ headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
67
+ throwOnError: false,
68
+ }, resolveRetryConfig(options), resolveRequestConfig(options));
69
+ return resolveResult(result, options.throwOnError ?? DEFAULT_OPTIONS.throwOnError, options.validateResponse ?? DEFAULT_OPTIONS.validateResponse, options.responseSchema, options.requestLabel);
70
+ }
71
+ exports.sendPost = sendPost;
72
+ async function sendPostBinary(client, path, body, options = {}) {
73
+ const result = await (0, undici_retry_1.sendWithRetry)(client, {
74
+ ...DEFAULT_OPTIONS,
75
+ path: path,
76
+ method: 'POST',
77
+ body,
78
+ query: options.query,
79
+ headers: (0, objectUtils_1.copyWithoutUndefined)({
80
+ 'x-request-id': options.reqContext?.reqId,
81
+ ...options.headers,
82
+ }),
83
+ reset: options.disableKeepAlive ?? false,
84
+ bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
85
+ headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
86
+ throwOnError: false,
87
+ }, resolveRetryConfig(options), resolveRequestConfig(options));
88
+ return resolveResult(result, options.throwOnError ?? DEFAULT_OPTIONS.throwOnError, options.validateResponse ?? DEFAULT_OPTIONS.validateResponse, options.responseSchema, options.requestLabel);
89
+ }
90
+ exports.sendPostBinary = sendPostBinary;
91
+ async function sendPut(client, path, body, options = {}) {
92
+ const result = await (0, undici_retry_1.sendWithRetry)(client, {
93
+ ...DEFAULT_OPTIONS,
94
+ path: path,
95
+ method: 'PUT',
96
+ body: body ? JSON.stringify(body) : undefined,
97
+ query: options.query,
98
+ headers: (0, objectUtils_1.copyWithoutUndefined)({
99
+ 'x-request-id': options.reqContext?.reqId,
100
+ ...options.headers,
101
+ }),
102
+ reset: options.disableKeepAlive ?? false,
103
+ bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
104
+ headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
105
+ throwOnError: false,
106
+ }, resolveRetryConfig(options), resolveRequestConfig(options));
107
+ return resolveResult(result, options.throwOnError ?? DEFAULT_OPTIONS.throwOnError, options.validateResponse ?? DEFAULT_OPTIONS.validateResponse, options.responseSchema, options.requestLabel);
108
+ }
109
+ exports.sendPut = sendPut;
110
+ async function sendPutBinary(client, path, body, options = {}) {
111
+ const result = await (0, undici_retry_1.sendWithRetry)(client, {
112
+ ...DEFAULT_OPTIONS,
113
+ path: path,
114
+ method: 'PUT',
115
+ body,
116
+ query: options.query,
117
+ headers: (0, objectUtils_1.copyWithoutUndefined)({
118
+ 'x-request-id': options.reqContext?.reqId,
119
+ ...options.headers,
120
+ }),
121
+ reset: options.disableKeepAlive ?? false,
122
+ bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
123
+ headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
124
+ throwOnError: false,
125
+ }, resolveRetryConfig(options), resolveRequestConfig(options));
126
+ return resolveResult(result, options.throwOnError ?? DEFAULT_OPTIONS.throwOnError, options.validateResponse ?? DEFAULT_OPTIONS.validateResponse, options.responseSchema, options.requestLabel);
127
+ }
128
+ exports.sendPutBinary = sendPutBinary;
129
+ async function sendPatch(client, path, body, options = {}) {
130
+ const result = await (0, undici_retry_1.sendWithRetry)(client, {
131
+ ...DEFAULT_OPTIONS,
132
+ path: path,
133
+ method: 'PATCH',
134
+ body: body ? JSON.stringify(body) : undefined,
135
+ query: options.query,
136
+ headers: (0, objectUtils_1.copyWithoutUndefined)({
137
+ 'x-request-id': options.reqContext?.reqId,
138
+ ...options.headers,
139
+ }),
140
+ reset: options.disableKeepAlive ?? false,
141
+ bodyTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
142
+ headersTimeout: Object.hasOwn(options, 'timeout') ? options.timeout : DEFAULT_OPTIONS.timeout,
143
+ throwOnError: false,
144
+ }, resolveRetryConfig(options), resolveRequestConfig(options));
145
+ return resolveResult(result, options.throwOnError ?? DEFAULT_OPTIONS.throwOnError, options.validateResponse ?? DEFAULT_OPTIONS.validateResponse, options.responseSchema, options.requestLabel);
146
+ }
147
+ exports.sendPatch = sendPatch;
148
+ function resolveRequestConfig(options) {
149
+ return {
150
+ safeParseJson: options.safeParseJson ?? false,
151
+ blobBody: options.blobResponseBody ?? false,
152
+ throwOnInternalError: false,
153
+ requestLabel: options.requestLabel,
154
+ };
155
+ }
156
+ function resolveRetryConfig(options) {
157
+ return options.retryConfig ?? undici_retry_1.NO_RETRY_CONFIG;
158
+ }
159
+ function buildClient(baseUrl, clientOptions) {
160
+ const newClient = new undici_1.Client(baseUrl, {
161
+ ...defaultClientOptions,
162
+ ...clientOptions,
163
+ });
164
+ return newClient;
165
+ }
166
+ exports.buildClient = buildClient;
167
+ function resolveResult(requestResult, throwOnError, validateResponse, validationSchema, requestLabel) {
168
+ // Throw response error
169
+ if (requestResult.error && throwOnError) {
170
+ if ((0, undici_retry_1.isRequestResult)(requestResult.error)) {
171
+ throw new ResponseStatusError_1.ResponseStatusError(requestResult.error, requestLabel);
172
+ }
173
+ throw requestResult.error;
174
+ }
175
+ if (requestResult.result && validateResponse && validationSchema) {
176
+ requestResult.result.body = validationSchema.parse(requestResult.result.body);
177
+ }
178
+ return requestResult;
179
+ }
180
+ exports.httpClient = {
181
+ get: sendGet,
182
+ post: sendPost,
183
+ put: sendPut,
184
+ patch: sendPatch,
185
+ del: sendDelete,
186
+ };
187
+ exports.JSON_HEADERS = {
188
+ 'Content-Type': 'application/json',
189
+ };
190
+ //# sourceMappingURL=httpClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpClient.js","sourceRoot":"","sources":["../../../src/http/httpClient.ts"],"names":[],"mappings":";;;AAEA,mCAA+B;AAE/B,+CAA8E;AAI9E,uEAAmE;AAEnE,sDAA2D;AAgC3D,MAAM,eAAe,GAAG;IACtB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,KAAK;CAC4C,CAAA;AAE5D,MAAM,oBAAoB,GAA4B;IACpD,mBAAmB,EAAE,OAAO;IAC5B,gBAAgB,EAAE,IAAI;CACvB,CAAA;AAQM,KAAK,UAAU,OAAO,CAC3B,MAAc,EACd,IAAY,EACZ,UAAsC,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AE,SAAS;IAChB,GAAG,EAAE,UAAU;CAChB,CAAA;AAEY,QAAA,YAAY,GAAG;IAC1B,cAAc,EAAE,kBAAkB;CACnC,CAAA"}
@@ -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,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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,55 +1,51 @@
1
1
  {
2
- "name": "@lokalise/node-core",
3
- "version": "11.2.0",
4
- "author": {
5
- "name": "Lokalise",
6
- "url": "https://lokalise.com/"
7
- },
8
- "homepage": "https://github.com/lokalise/node-core",
9
- "repository": {
10
- "type": "git",
11
- "url": "git://github.com/lokalise/node-core.git"
12
- },
13
- "license": "Apache-2.0",
14
- "files": [
15
- "dist/**",
16
- "LICENSE",
17
- "README.md"
18
- ],
19
- "main": "dist/index.js",
20
- "types": "dist/index.d.ts",
21
- "type": "commonjs",
22
- "publishConfig": {
23
- "access": "public"
24
- },
25
- "scripts": {
26
- "build": "tsc",
27
- "test": "vitest",
28
- "test:coverage": "vitest --coverage",
29
- "test:ci": "npm run lint && npm run test:coverage",
30
- "test:update-snapshots": "vitest -u",
31
- "lint": "biome check . && tsc --project tsconfig.lint.json --noEmit",
32
- "lint:fix": "biome check --write",
33
- "version": "auto-changelog -p && git add CHANGELOG.md",
34
- "prepublishOnly": "npm run build"
35
- },
36
- "dependencies": {
37
- "dot-prop": "6.0.1",
38
- "pino": "^9.3.1",
39
- "pino-pretty": "^11.2.1",
40
- "tslib": "^2.6.3",
41
- "zod": "^3.23.8"
42
- },
43
- "devDependencies": {
44
- "@biomejs/biome": "^1.8.3",
45
- "@lokalise/biome-config": "^1.3.0",
46
- "@types/node": "^20.14.11",
47
- "@types/tmp": "^0.2.6",
48
- "@vitest/coverage-v8": "2.0.3",
49
- "auto-changelog": "^2.4.0",
50
- "pino-test": "^1.0.1",
51
- "tmp": "^0.2.3",
52
- "typescript": "^5.5.3",
53
- "vitest": "2.0.3"
54
- }
2
+ "name": "@lokalise/node-core",
3
+ "version": "12.0.1-test-realms",
4
+ "author": {
5
+ "name": "Lokalise",
6
+ "url": "https://lokalise.com/"
7
+ },
8
+ "homepage": "https://github.com/lokalise/node-core",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git://github.com/lokalise/node-core.git"
12
+ },
13
+ "license": "Apache-2.0",
14
+ "files": ["dist/**", "LICENSE", "README.md"],
15
+ "main": "dist/index.js",
16
+ "types": "dist/index.d.ts",
17
+ "type": "commonjs",
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "test": "vitest",
24
+ "test:coverage": "vitest --coverage",
25
+ "test:ci": "npm run lint && npm run test:coverage",
26
+ "test:update-snapshots": "vitest -u",
27
+ "lint": "biome check . && tsc --project tsconfig.lint.json --noEmit",
28
+ "lint:fix": "biome check --write",
29
+ "version": "auto-changelog -p && git add CHANGELOG.md",
30
+ "prepublishOnly": "npm run build"
31
+ },
32
+ "dependencies": {
33
+ "dot-prop": "6.0.1",
34
+ "pino": "^9.3.1",
35
+ "pino-pretty": "^11.2.1",
36
+ "tslib": "^2.6.3",
37
+ "zod": "^3.23.8"
38
+ },
39
+ "devDependencies": {
40
+ "@biomejs/biome": "^1.8.3",
41
+ "@lokalise/biome-config": "^1.3.0",
42
+ "@types/node": "^20.14.11",
43
+ "@types/tmp": "^0.2.6",
44
+ "@vitest/coverage-v8": "2.0.3",
45
+ "auto-changelog": "^2.4.0",
46
+ "pino-test": "^1.0.1",
47
+ "tmp": "^0.2.3",
48
+ "typescript": "^5.5.3",
49
+ "vitest": "2.0.3"
50
+ }
55
51
  }