@senhainfo/shared-utils 1.1.2 → 1.1.4
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/lib/exceptions/index.d.ts +1 -0
- package/lib/exceptions/index.d.ts.map +1 -1
- package/lib/exceptions/index.js +1 -0
- package/lib/exceptions/index.js.map +1 -1
- package/lib/exceptions/internal-server-exception.d.ts +12 -0
- package/lib/exceptions/internal-server-exception.d.ts.map +1 -0
- package/lib/exceptions/internal-server-exception.js +25 -0
- package/lib/exceptions/internal-server-exception.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/split-array.d.ts +8 -0
- package/lib/split-array.d.ts.map +1 -0
- package/lib/split-array.js +18 -0
- package/lib/split-array.js.map +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ export * from "./app-exception";
|
|
|
2
2
|
export * from "./bad-request-exception";
|
|
3
3
|
export * from "./forbidden-exception";
|
|
4
4
|
export * from "./inactive-exception";
|
|
5
|
+
export * from "./internal-server-exception";
|
|
5
6
|
export * from "./invalid-credentials-exception";
|
|
6
7
|
export * from "./invalid-token-exception";
|
|
7
8
|
export * from "./missing-token-exception";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
|
package/lib/exceptions/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./app-exception"), exports);
|
|
|
18
18
|
__exportStar(require("./bad-request-exception"), exports);
|
|
19
19
|
__exportStar(require("./forbidden-exception"), exports);
|
|
20
20
|
__exportStar(require("./inactive-exception"), exports);
|
|
21
|
+
__exportStar(require("./internal-server-exception"), exports);
|
|
21
22
|
__exportStar(require("./invalid-credentials-exception"), exports);
|
|
22
23
|
__exportStar(require("./invalid-token-exception"), exports);
|
|
23
24
|
__exportStar(require("./missing-token-exception"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,0DAAwC;AACxC,wDAAsC;AACtC,uDAAqC;AACrC,kEAAgD;AAChD,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC;AACtC,2DAAyC;AACzC,gEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,0DAAwC;AACxC,wDAAsC;AACtC,uDAAqC;AACrC,8DAA4C;AAC5C,kEAAgD;AAChD,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC;AACtC,2DAAyC;AACzC,gEAA8C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppException, AppExceptionProps } from "./app-exception";
|
|
2
|
+
export declare class InternalServerException extends AppException {
|
|
3
|
+
/**
|
|
4
|
+
* Construtor do erro "InternalServerException"
|
|
5
|
+
*
|
|
6
|
+
* @param name - Nome do erro @default AppExceptionEnum.INTERNAL_SERVER_ERROR
|
|
7
|
+
* @param message - Mensagem de erro @default "Erro ao processar requisição"
|
|
8
|
+
* @param details - Detalhes do erro
|
|
9
|
+
*/
|
|
10
|
+
constructor(props?: AppExceptionProps);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=internal-server-exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-server-exception.d.ts","sourceRoot":"","sources":["../../src/exceptions/internal-server-exception.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAoB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpF,qBAAa,uBAAwB,SAAQ,YAAY;IACvD;;;;;;OAMG;gBACS,KAAK,CAAC,EAAE,iBAAiB;CAUtC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternalServerException = void 0;
|
|
4
|
+
const http_status_enum_1 = require("../http-status-enum");
|
|
5
|
+
const app_exception_1 = require("./app-exception");
|
|
6
|
+
class InternalServerException extends app_exception_1.AppException {
|
|
7
|
+
/**
|
|
8
|
+
* Construtor do erro "InternalServerException"
|
|
9
|
+
*
|
|
10
|
+
* @param name - Nome do erro @default AppExceptionEnum.INTERNAL_SERVER_ERROR
|
|
11
|
+
* @param message - Mensagem de erro @default "Erro ao processar requisição"
|
|
12
|
+
* @param details - Detalhes do erro
|
|
13
|
+
*/
|
|
14
|
+
constructor(props) {
|
|
15
|
+
if (!props) {
|
|
16
|
+
props = {
|
|
17
|
+
name: app_exception_1.AppExceptionEnum.INTERNAL_SERVER_ERROR,
|
|
18
|
+
message: "Erro ao processar requisição",
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
super(props.name, props.message, http_status_enum_1.HttpStatusCodes.INTERNAL_SERVER_ERROR, props.details);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.InternalServerException = InternalServerException;
|
|
25
|
+
//# sourceMappingURL=internal-server-exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-server-exception.js","sourceRoot":"","sources":["../../src/exceptions/internal-server-exception.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AACtD,mDAAoF;AAEpF,MAAa,uBAAwB,SAAQ,4BAAY;IACvD;;;;;;OAMG;IACH,YAAY,KAAyB;QACnC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG;gBACN,IAAI,EAAE,gCAAgB,CAAC,qBAAqB;gBAC5C,OAAO,EAAE,8BAA8B;aACxC,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,kCAAe,CAAC,qBAAqB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AAlBD,0DAkBC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./generate-metadata-response";
|
|
|
7
7
|
export * from "./get-ip-address";
|
|
8
8
|
export * from "./http-status-enum";
|
|
9
9
|
export * from "./parse-request-url";
|
|
10
|
+
export * from "./split-array";
|
|
10
11
|
export * from "./xor-encrypt";
|
|
11
12
|
export * as Exceptions from "./exceptions";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAE9B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __exportStar(require("./generate-metadata-response"), exports);
|
|
|
46
46
|
__exportStar(require("./get-ip-address"), exports);
|
|
47
47
|
__exportStar(require("./http-status-enum"), exports);
|
|
48
48
|
__exportStar(require("./parse-request-url"), exports);
|
|
49
|
+
__exportStar(require("./split-array"), exports);
|
|
49
50
|
__exportStar(require("./xor-encrypt"), exports);
|
|
50
51
|
exports.Exceptions = __importStar(require("./exceptions"));
|
|
51
52
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0DAAwC;AACxC,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,+DAA6C;AAC7C,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,gDAA8B;AAE9B,2DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0DAAwC;AACxC,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,+DAA6C;AAC7C,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,gDAA8B;AAC9B,gDAA8B;AAE9B,2DAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-array.d.ts","sourceRoot":"","sources":["../src/split-array.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe,CAAC,CAAC;IACzB,SAAS,EAAE,CAAC,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAkBxF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitArray = splitArray;
|
|
4
|
+
function splitArray({ baseArray, limit, skipSplit }) {
|
|
5
|
+
if (skipSplit) {
|
|
6
|
+
return [baseArray];
|
|
7
|
+
}
|
|
8
|
+
let result = [];
|
|
9
|
+
for (let i = 0; i < baseArray.length; i++) {
|
|
10
|
+
let groupIndex = Math.floor(i / limit);
|
|
11
|
+
if (!result[groupIndex]) {
|
|
12
|
+
result[groupIndex] = [];
|
|
13
|
+
}
|
|
14
|
+
result[groupIndex].push(baseArray[i]);
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=split-array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-array.js","sourceRoot":"","sources":["../src/split-array.ts"],"names":[],"mappings":";;AAMA,gCAkBC;AAlBD,SAAgB,UAAU,CAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAsB;IAC/E,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,GAAU,EAAE,CAAC;IAEvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;QAEvC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|