@axinom/mosaic-service-common 0.22.2 → 0.23.0-rc.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/common/errors/graphql-errors-handler-mappers.d.ts.map +1 -1
- package/dist/common/errors/graphql-errors-handler-mappers.js +9 -0
- package/dist/common/errors/graphql-errors-handler-mappers.js.map +1 -1
- package/dist/common/errors/pg-error-code.d.ts +4 -0
- package/dist/common/errors/pg-error-code.d.ts.map +1 -1
- package/dist/common/errors/pg-error-code.js +4 -0
- package/dist/common/errors/pg-error-code.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-errors-handler-mappers.d.ts","sourceRoot":"","sources":["../../../src/common/errors/graphql-errors-handler-mappers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql-errors-handler-mappers.d.ts","sourceRoot":"","sources":["../../../src/common/errors/graphql-errors-handler-mappers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;CACzB;AAED,oBAAY,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,GAAG,SAAS,CAAC;AAEtE,oBAAY,cAAc,GAAG,CAC3B,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,MAAM,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,eA0ElC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAmBnC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultWriteLogMapper = exports.defaultPgErrorMapper = void 0;
|
|
4
|
+
const inflection_1 = require("inflection");
|
|
5
|
+
const helpers_1 = require("../helpers");
|
|
4
6
|
const logging_1 = require("../logging");
|
|
5
7
|
const error_code_1 = require("./error-code");
|
|
6
8
|
const pg_error_code_1 = require("./pg-error-code");
|
|
@@ -32,6 +34,13 @@ const defaultPgErrorMapper = (error) => {
|
|
|
32
34
|
message: 'Attempt to create or update an element failed, as it would have resulted in a duplicate element.',
|
|
33
35
|
code: error_code_1.ErrorCode.DatabaseValidationFailed,
|
|
34
36
|
};
|
|
37
|
+
case pg_error_code_1.PgErrorCode.NotNullConstraintError:
|
|
38
|
+
return {
|
|
39
|
+
message: `The '${(0, helpers_1.isNullOrWhitespace)(originalError === null || originalError === void 0 ? void 0 : originalError.column)
|
|
40
|
+
? 'value'
|
|
41
|
+
: (0, inflection_1.camelize)(originalError.column, true)}' must not be null.`,
|
|
42
|
+
code: error_code_1.ErrorCode.DatabaseValidationFailed,
|
|
43
|
+
};
|
|
35
44
|
case pg_error_code_1.PgErrorCode.MaxLengthConstraintError:
|
|
36
45
|
case pg_error_code_1.PgErrorCode.MinLengthConstraintError:
|
|
37
46
|
case pg_error_code_1.PgErrorCode.MaxConstraintError:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-errors-handler-mappers.js","sourceRoot":"","sources":["../../../src/common/errors/graphql-errors-handler-mappers.ts"],"names":[],"mappings":";;;AACA,wCAAgD;AAEhD,6CAAyC;AACzC,mDAA8C;AAmB9C;;GAEG;AACI,MAAM,oBAAoB,GAAoB,CACnD,KAAY,EACW,EAAE;;IACzB,MAAM,aAAa,GAAG,CAAC,MAAA,MAAC,KAAsB,0CAAE,aAAa,mCAC3D,KAAK,
|
|
1
|
+
{"version":3,"file":"graphql-errors-handler-mappers.js","sourceRoot":"","sources":["../../../src/common/errors/graphql-errors-handler-mappers.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AACtC,wCAAgD;AAChD,wCAAgD;AAEhD,6CAAyC;AACzC,mDAA8C;AAmB9C;;GAEG;AACI,MAAM,oBAAoB,GAAoB,CACnD,KAAY,EACW,EAAE;;IACzB,MAAM,aAAa,GAAG,CAAC,MAAA,MAAC,KAAsB,0CAAE,aAAa,mCAC3D,KAAK,CAA8C,CAAC;IACtD,6GAA6G;IAC7G,qCAAqC;IACrC,uEAAuE;IACvE,IAAI,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,0CAAE,MAAM,MAAK,CAAC,EAAE;QACrC,OAAO,SAAS,CAAC;KAClB;IAED,QAAQ,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,EAAE;QAC3B,KAAK,2BAAW,CAAC,yBAAyB;YACxC,OAAO;gBACL,OAAO,EAAE,kDAAkD;gBAC3D,IAAI,EAAE,sBAAS,CAAC,wBAAwB;aACzC,CAAC;QACJ,KAAK,2BAAW,CAAC,yBAAyB;YACxC,OAAO;gBACL,OAAO,EACL,kFAAkF;gBACpF,IAAI,EAAE,sBAAS,CAAC,wBAAwB;aACzC,CAAC;QACJ,KAAK,2BAAW,CAAC,qBAAqB;YACpC,OAAO;gBACL,OAAO,EACL,kGAAkG;gBACpG,IAAI,EAAE,sBAAS,CAAC,wBAAwB;aACzC,CAAC;QACJ,KAAK,2BAAW,CAAC,sBAAsB;YACrC,OAAO;gBACL,OAAO,EAAE,QACP,IAAA,4BAAkB,EAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC;oBACvC,CAAC,CAAC,OAAO;oBACT,CAAC,CAAC,IAAA,qBAAQ,EAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CACzC,qBAAqB;gBACrB,IAAI,EAAE,sBAAS,CAAC,wBAAwB;aACzC,CAAC;QACJ,KAAK,2BAAW,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IAAI,EAAE;QAC1B,KAAK,sBAAS,CAAC,mBAAmB,CAAC;QACnC,KAAK,sBAAS,CAAC,sBAAsB;YACnC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YACzB,MAAM;QAER,KAAK,sBAAS,CAAC,uBAAuB;YACpC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YACzB,MAAM;QAER;YACE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YACxB,MAAM;KACT;AACH,CAAC,CAAC;AAnBW,QAAA,qBAAqB,yBAmBhC"}
|
|
@@ -23,6 +23,10 @@ export declare enum PgErrorCode {
|
|
|
23
23
|
* Used to recognize that a PL/pgSQL Error was raised.
|
|
24
24
|
*/
|
|
25
25
|
ExceptionRaisedError = "P0001",
|
|
26
|
+
/**
|
|
27
|
+
* Used to recognize an error that has happened because of a not-null constraint violation.
|
|
28
|
+
*/
|
|
29
|
+
NotNullConstraintError = "23502",
|
|
26
30
|
/**
|
|
27
31
|
* Used to recognize an error that has happened because of a custom constraint that checks if string matches a regex patten.
|
|
28
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-error-code.d.ts","sourceRoot":"","sources":["../../../src/common/errors/pg-error-code.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,yBAAyB,UAAU;IACnC;;OAEG;IACH,qBAAqB,UAAU;IAC/B;;OAEG;IACH,yBAAyB,UAAU;IACnC;;OAEG;IACH,sBAAsB,UAAU;IAChC;;OAEG;IACH,oBAAoB,UAAU;IAC9B;;OAEG;IACH,6BAA6B,UAAU;IACvC;;OAEG;IACH,wBAAwB,UAAU;IAClC;;OAEG;IACH,wBAAwB,UAAU;IAClC;;OAEG;IACH,kBAAkB,UAAU;IAC5B;;OAEG;IACH,kBAAkB,UAAU;IAC5B;;OAEG;IACH,gCAAgC,UAAU;IAC1C;;OAEG;IACH,qCAAqC,UAAU;IAC/C;;OAEG;IACH,8BAA8B,UAAU;IACxC;;OAEG;IACH,iCAAiC,UAAU;IAC3C;;;;OAIG;IACH,wCAAwC,UAAU;IAClD;;OAEG;IACH,yBAAyB,UAAU;IACnC;;OAEG;IACH,8BAA8B,UAAU;IACxC;;OAEG;IACH,iBAAiB,UAAU;CAC5B"}
|
|
1
|
+
{"version":3,"file":"pg-error-code.d.ts","sourceRoot":"","sources":["../../../src/common/errors/pg-error-code.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,yBAAyB,UAAU;IACnC;;OAEG;IACH,qBAAqB,UAAU;IAC/B;;OAEG;IACH,yBAAyB,UAAU;IACnC;;OAEG;IACH,sBAAsB,UAAU;IAChC;;OAEG;IACH,oBAAoB,UAAU;IAC9B;;OAEG;IACH,sBAAsB,UAAU;IAChC;;OAEG;IACH,6BAA6B,UAAU;IACvC;;OAEG;IACH,wBAAwB,UAAU;IAClC;;OAEG;IACH,wBAAwB,UAAU;IAClC;;OAEG;IACH,kBAAkB,UAAU;IAC5B;;OAEG;IACH,kBAAkB,UAAU;IAC5B;;OAEG;IACH,gCAAgC,UAAU;IAC1C;;OAEG;IACH,qCAAqC,UAAU;IAC/C;;OAEG;IACH,8BAA8B,UAAU;IACxC;;OAEG;IACH,iCAAiC,UAAU;IAC3C;;;;OAIG;IACH,wCAAwC,UAAU;IAClD;;OAEG;IACH,yBAAyB,UAAU;IACnC;;OAEG;IACH,8BAA8B,UAAU;IACxC;;OAEG;IACH,iBAAiB,UAAU;CAC5B"}
|
|
@@ -27,6 +27,10 @@ var PgErrorCode;
|
|
|
27
27
|
* Used to recognize that a PL/pgSQL Error was raised.
|
|
28
28
|
*/
|
|
29
29
|
PgErrorCode["ExceptionRaisedError"] = "P0001";
|
|
30
|
+
/**
|
|
31
|
+
* Used to recognize an error that has happened because of a not-null constraint violation.
|
|
32
|
+
*/
|
|
33
|
+
PgErrorCode["NotNullConstraintError"] = "23502";
|
|
30
34
|
/**
|
|
31
35
|
* Used to recognize an error that has happened because of a custom constraint that checks if string matches a regex patten.
|
|
32
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-error-code.js","sourceRoot":"","sources":["../../../src/common/errors/pg-error-code.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"pg-error-code.js","sourceRoot":"","sources":["../../../src/common/errors/pg-error-code.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,WA+EX;AA/ED,WAAY,WAAW;IACrB;;OAEG;IACH,kDAAmC,CAAA;IACnC;;OAEG;IACH,8CAA+B,CAAA;IAC/B;;OAEG;IACH,kDAAmC,CAAA;IACnC;;OAEG;IACH,+CAAgC,CAAA;IAChC;;OAEG;IACH,6CAA8B,CAAA;IAC9B;;OAEG;IACH,+CAAgC,CAAA;IAChC;;OAEG;IACH,sDAAuC,CAAA;IACvC;;OAEG;IACH,iDAAkC,CAAA;IAClC;;OAEG;IACH,iDAAkC,CAAA;IAClC;;OAEG;IACH,2CAA4B,CAAA;IAC5B;;OAEG;IACH,2CAA4B,CAAA;IAC5B;;OAEG;IACH,yDAA0C,CAAA;IAC1C;;OAEG;IACH,8DAA+C,CAAA;IAC/C;;OAEG;IACH,uDAAwC,CAAA;IACxC;;OAEG;IACH,0DAA2C,CAAA;IAC3C;;;;OAIG;IACH,iEAAkD,CAAA;IAClD;;OAEG;IACH,kDAAmC,CAAA;IACnC;;OAEG;IACH,uDAAwC,CAAA;IACxC;;OAEG;IACH,0CAA2B,CAAA;AAC7B,CAAC,EA/EW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA+EtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-service-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0-rc.0",
|
|
4
4
|
"description": "Common helpers and PostgreSQL-related functionality",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "792f47e1c09d35defd9fcfdecb81a8322fdd29ee"
|
|
69
69
|
}
|