@txo/service-graphql-react 2.3.117 → 2.3.119
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/CHANGELOG.md +14 -0
- package/lib/Api/ContextHelper.js +1 -1
- package/lib/Api/ContextHelper.js.map +1 -1
- package/lib/Api/ErrorMapHelper.js +33 -48
- package/lib/Api/ErrorMapHelper.js.map +1 -1
- package/lib/Api/OperationHelper.js +13 -11
- package/lib/Api/OperationHelper.js.map +1 -1
- package/lib/Api/PromiseHelper.js +6 -6
- package/lib/Api/PromiseHelper.js.map +1 -1
- package/lib/Hooks/UseServiceMutation.js +49 -116
- package/lib/Hooks/UseServiceMutation.js.map +1 -1
- package/lib/Hooks/UseServiceQuery.js +38 -42
- package/lib/Hooks/UseServiceQuery.js.map +1 -1
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.3.119](https://github.com/technology-studio/service-graphql-react/compare/v2.3.118...v2.3.119) (2023-11-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update dependency type-fest to ^4.8.2 ([9223b2c](https://github.com/technology-studio/service-graphql-react/commit/9223b2c1d21c2d726d81344c7f847139aca9be6a))
|
|
7
|
+
|
|
8
|
+
## [2.3.118](https://github.com/technology-studio/service-graphql-react/compare/v2.3.117...v2.3.118) (2023-11-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency type-fest to ^4.8.1 ([b77e908](https://github.com/technology-studio/service-graphql-react/commit/b77e9088ece61afd0d4b46bd478c109ebd1382d0))
|
|
14
|
+
|
|
1
15
|
## [2.3.117](https://github.com/technology-studio/service-graphql-react/compare/v2.3.116...v2.3.117) (2023-11-12)
|
|
2
16
|
|
|
3
17
|
|
package/lib/Api/ContextHelper.js
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
**/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.serviceContext = void 0;
|
|
9
|
-
|
|
9
|
+
const serviceContext = (serviceName, serviceAttributes) => (`${serviceName}(${JSON.stringify(serviceAttributes)})`.replace(/\./g, '_'));
|
|
10
10
|
exports.serviceContext = serviceContext;
|
|
11
11
|
//# sourceMappingURL=ContextHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextHelper.js","sourceRoot":"","sources":["../../src/Api/ContextHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEI,
|
|
1
|
+
{"version":3,"file":"ContextHelper.js","sourceRoot":"","sources":["../../src/Api/ContextHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEI,MAAM,cAAc,GAAG,CAAC,WAAmB,EAAE,iBAA0C,EAAU,EAAE,CAAC,CACzG,GAAG,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAC3E,CAAA;AAFY,QAAA,cAAc,kBAE1B"}
|
|
@@ -4,61 +4,47 @@
|
|
|
4
4
|
* @Date: 2022-03-17T14:03:65+01:00
|
|
5
5
|
* @Copyright: Technology Studio
|
|
6
6
|
**/
|
|
7
|
-
var __assign = (this && this.__assign) || function () {
|
|
8
|
-
__assign = Object.assign || function(t) {
|
|
9
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
-
s = arguments[i];
|
|
11
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
-
t[p] = s[p];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
|
-
return __assign.apply(this, arguments);
|
|
17
|
-
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
-
if (ar || !(i in from)) {
|
|
21
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
-
ar[i] = from[i];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
-
};
|
|
27
7
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
8
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
9
|
};
|
|
30
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
11
|
exports.applyErrorMap = exports.validationError = exports.ignoreError = void 0;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
const functional_1 = require("@txo/functional");
|
|
13
|
+
const lodash_set_1 = __importDefault(require("lodash.set"));
|
|
14
|
+
const Types_1 = require("../Model/Types");
|
|
15
|
+
const normaliseErrorMap = (errorMap) => {
|
|
36
16
|
if ((0, functional_1.isObject)(errorMap)) {
|
|
37
|
-
return Object.keys(errorMap).reduce(
|
|
17
|
+
return Object.keys(errorMap).reduce((normalisedErrorMap, key) => {
|
|
38
18
|
(0, lodash_set_1.default)(normalisedErrorMap, key, normaliseErrorMap(errorMap[key]));
|
|
39
19
|
return normalisedErrorMap;
|
|
40
20
|
}, {});
|
|
41
21
|
}
|
|
42
22
|
return errorMap;
|
|
43
23
|
};
|
|
44
|
-
|
|
24
|
+
const ignoreError = () => () => undefined;
|
|
45
25
|
exports.ignoreError = ignoreError;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
26
|
+
const validationError = (message) => ({ error, }) => {
|
|
27
|
+
const nextError = {
|
|
28
|
+
...error,
|
|
29
|
+
message: message ?? error.message,
|
|
30
|
+
meta: {
|
|
31
|
+
...error.meta,
|
|
32
|
+
type: Types_1.VALIDATION_ERROR,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
49
35
|
return nextError;
|
|
50
|
-
};
|
|
36
|
+
};
|
|
51
37
|
exports.validationError = validationError;
|
|
52
|
-
|
|
38
|
+
const getWithWildcardFallback = (errorMap, path) => {
|
|
53
39
|
if (errorMap === undefined) {
|
|
54
40
|
return undefined;
|
|
55
41
|
}
|
|
56
42
|
if (path !== '') {
|
|
57
43
|
if ((0, functional_1.isObject)(errorMap)) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
const pathList = path.split('.');
|
|
45
|
+
const currentPath = pathList.shift();
|
|
46
|
+
const keyList = Object.keys(errorMap);
|
|
47
|
+
const currentKey = currentPath != null && currentPath !== '' && keyList.includes(currentPath) ? currentPath : '*';
|
|
62
48
|
return getWithWildcardFallback(errorMap[currentKey], pathList.join('.'));
|
|
63
49
|
}
|
|
64
50
|
else {
|
|
@@ -67,21 +53,20 @@ var getWithWildcardFallback = function (errorMap, path) {
|
|
|
67
53
|
}
|
|
68
54
|
return typeof errorMap === 'function' ? errorMap : undefined;
|
|
69
55
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
.reduce(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var errorMapper = getWithWildcardFallback(normalisedErrorMap, path);
|
|
56
|
+
const applyErrorMap = (serviceErrorList, errorMap, onFieldErrors) => {
|
|
57
|
+
const normalisedErrorMap = normaliseErrorMap(errorMap);
|
|
58
|
+
let modified = false;
|
|
59
|
+
const fieldErrors = {};
|
|
60
|
+
const nextServiceErrorList = serviceErrorList
|
|
61
|
+
.reduce((nextServiceErrorList, serviceError) => {
|
|
62
|
+
const graphQlError = serviceError.data;
|
|
63
|
+
const path = [...(graphQlError?.path ?? []), serviceError.key].join('.');
|
|
64
|
+
const errorMapper = getWithWildcardFallback(normalisedErrorMap, path);
|
|
80
65
|
if (errorMapper != null) {
|
|
81
|
-
|
|
66
|
+
const nextServiceError = errorMapper({
|
|
82
67
|
error: serviceError,
|
|
83
|
-
fieldErrors
|
|
84
|
-
path
|
|
68
|
+
fieldErrors,
|
|
69
|
+
path,
|
|
85
70
|
});
|
|
86
71
|
if (nextServiceError !== serviceError) {
|
|
87
72
|
modified = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMapHelper.js","sourceRoot":"","sources":["../../src/Api/ErrorMapHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"ErrorMapHelper.js","sourceRoot":"","sources":["../../src/Api/ErrorMapHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAKH,gDAA0C;AAC1C,4DAA4B;AAO5B,0CAEuB;AAEvB,MAAM,iBAAiB,GAAG,CAAC,QAAkB,EAAY,EAAE;IACzD,IAAI,IAAA,qBAAQ,EAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,kBAA4C,EAAE,GAAG,EAAE,EAAE;YACxF,IAAA,oBAAG,EAAC,kBAAkB,EAAE,GAAG,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;YAC9D,OAAO,kBAAkB,CAAA;QAC3B,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAEM,MAAM,WAAW,GAAG,GAAgB,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS,CAAA;AAAhD,QAAA,WAAW,eAAqC;AACtD,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAe,EAAE,CAAC,CAAC,EACjE,KAAK,GACN,EAAE,EAAE;IACH,MAAM,SAAS,GAAiB;QAC9B,GAAG,KAAK;QACR,OAAO,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO;QACjC,IAAI,EAAE;YACJ,GAAG,KAAK,CAAC,IAAI;YACb,IAAI,EAAE,wBAAgB;SACvB;KACF,CAAA;IAED,OAAO,SAAS,C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E,EAAE;QACrC,MAAM,YAAY,GAAG,YAAY,CAAC,IAAoB,CAAA;QACtD,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACxE,MAAM,WAAW,GAAG,uBAAuB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAA;QAErE,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM,gBAAgB,GAAG,WAAW,CAAC;gBACnC,KAAK,EAAE,YAAY;gBACnB,WAAW;gBACX,IAAI;aACL,CAAC,CAAA;YACF,IAAI,gBAAgB,KAAK,YAAY,EAAE,CAAC;gBACtC,QAAQ,GAAG,IAAI,CAAA;YACjB,CAAC;YACD,CAAC,gBAAgB,IAAI,IAAI,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC3E,CAAC;aAAM,CAAC;YACN,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACzC,CAAC;QAED,OAAO,oBAAoB,CAAA;IAC7B,CAAC,EAAE,EAAE,CAAC,CAAA;IAER,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnE,aAAa,CAAC,WAAW,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,gBAAgB,CAAA;AAC3D,CAAC,CAAA;AArCY,QAAA,aAAa,iBAqCzB"}
|
|
@@ -6,19 +6,21 @@
|
|
|
6
6
|
**/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.getName = void 0;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const graphql_1 = require("graphql");
|
|
10
|
+
const upperCaseFirst = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
11
|
+
const pascalCase = (string) => (`${string}`
|
|
12
12
|
.replace(/[-_]+/g, ' ')
|
|
13
13
|
.replace(/[^\w\s]/g, '')
|
|
14
|
-
.replace(/\s+(.)(\w*)/g,
|
|
15
|
-
.replace(/\w/,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
.replace(/\s+(.)(\w*)/g, (_$1, $2, $3) => `${$2.toUpperCase() + $3.toLowerCase()}`)
|
|
15
|
+
.replace(/\w/, s => s.toUpperCase()));
|
|
16
|
+
const getName = (query) => {
|
|
17
|
+
const definition = query.definitions
|
|
18
|
+
.find(definition => (definition.kind === graphql_1.Kind.OPERATION_DEFINITION));
|
|
19
|
+
const operationName = definition?.name?.value
|
|
20
|
+
.split('_')
|
|
21
|
+
.map(pascalCase)
|
|
22
|
+
.join('.');
|
|
23
|
+
return operationName ?? upperCaseFirst(definition.operation);
|
|
22
24
|
};
|
|
23
25
|
exports.getName = getName;
|
|
24
26
|
//# sourceMappingURL=OperationHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationHelper.js","sourceRoot":"","sources":["../../src/Api/OperationHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"OperationHelper.js","sourceRoot":"","sources":["../../src/Api/OperationHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,qCAIgB;AAEhB,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC1F,MAAM,UAAU,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAC7C,GAAG,MAAM,EAAE;KACR,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;KACtB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;KACvB,OAAO,CACN,cAAc,EACd,CAAC,GAAG,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,CAC1E;KACA,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CACvC,CAAA;AAEM,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAU,EAAE;IACrD,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW;SACjC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAClB,UAAU,CAAC,IAAI,KAAK,cAAI,CAAC,oBAAoB,CAC9C,CAA4B,CAAA;IAC/B,MAAM,aAAa,GAAG,UAAU,EAAE,IAAI,EAAE,KAAK;SAC1C,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,UAAU,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,OAAO,aAAa,IAAI,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;AAC9D,CAAC,CAAA;AAVY,QAAA,OAAO,WAUnB"}
|
package/lib/Api/PromiseHelper.js
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
**/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.asyncToCallback = exports.suppressErrors = exports.suppressResults = void 0;
|
|
9
|
-
|
|
10
|
-
.then(
|
|
11
|
-
.catch(
|
|
9
|
+
const suppressResults = (promise) => promise
|
|
10
|
+
.then(() => undefined)
|
|
11
|
+
.catch(() => undefined);
|
|
12
12
|
exports.suppressResults = suppressResults;
|
|
13
|
-
|
|
13
|
+
const suppressErrors = (promise, thenCallback) => {
|
|
14
14
|
void promise
|
|
15
15
|
.then(thenCallback)
|
|
16
|
-
.catch(
|
|
16
|
+
.catch(() => undefined);
|
|
17
17
|
};
|
|
18
18
|
exports.suppressErrors = suppressErrors;
|
|
19
|
-
|
|
19
|
+
const asyncToCallback = (promise) => {
|
|
20
20
|
(0, exports.suppressResults)(promise);
|
|
21
21
|
};
|
|
22
22
|
exports.asyncToCallback = asyncToCallback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromiseHelper.js","sourceRoot":"","sources":["../../src/Api/PromiseHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAMI,
|
|
1
|
+
{"version":3,"file":"PromiseHelper.js","sourceRoot":"","sources":["../../src/Api/PromiseHelper.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAMI,MAAM,eAAe,GAAG,CAAC,OAAyB,EAAqB,EAAE,CAC7E,OAAO;KACL,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;KACrB,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CACzB,CAAA;AAJY,QAAA,eAAe,mBAI3B;AAEM,MAAM,cAAc,GAAG,CAC5B,OAAsB,EACtB,YAAkC,EAC5B,EAAE;IACR,KAAK,OAAO;SACT,IAAI,CAAC,YAAY,CAAC;SAClB,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;AAC3B,CAAC,CAAA;AAPY,QAAA,cAAc,kBAO1B;AAEM,MAAM,eAAe,GAAG,CAC7B,OAAyB,EACnB,EAAE;IACR,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAA;AAC1B,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B"}
|
|
@@ -4,129 +4,62 @@
|
|
|
4
4
|
* @Date: 2021-08-24T13:08:91+02:00
|
|
5
5
|
* @Copyright: Technology Studio
|
|
6
6
|
**/
|
|
7
|
-
var __assign = (this && this.__assign) || function () {
|
|
8
|
-
__assign = Object.assign || function(t) {
|
|
9
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
-
s = arguments[i];
|
|
11
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
-
t[p] = s[p];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
|
-
return __assign.apply(this, arguments);
|
|
17
|
-
};
|
|
18
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
19
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
20
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
21
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
22
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
23
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
24
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
28
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
29
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
30
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
31
|
-
function step(op) {
|
|
32
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
33
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
34
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
35
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
36
|
-
switch (op[0]) {
|
|
37
|
-
case 0: case 1: t = op; break;
|
|
38
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
39
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
40
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
41
|
-
default:
|
|
42
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
43
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
44
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
45
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
46
|
-
if (t[2]) _.ops.pop();
|
|
47
|
-
_.trys.pop(); continue;
|
|
48
|
-
}
|
|
49
|
-
op = body.call(thisArg, _);
|
|
50
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
51
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
8
|
exports.useServiceMutation = void 0;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const hooks_react_1 = require("@txo/hooks-react");
|
|
11
|
+
const client_1 = require("@apollo/client");
|
|
12
|
+
const service_error_handler_react_1 = require("@txo-peer-dep/service-error-handler-react");
|
|
13
|
+
const service_graphql_1 = require("@txo/service-graphql");
|
|
14
|
+
const ContextHelper_1 = require("../Api/ContextHelper");
|
|
15
|
+
const OperationHelper_1 = require("../Api/OperationHelper");
|
|
16
|
+
const ErrorMapHelper_1 = require("../Api/ErrorMapHelper");
|
|
17
|
+
const calculateContext = (mutation, variables) => ((0, ContextHelper_1.serviceContext)((0, OperationHelper_1.getName)(mutation), variables ?? {}));
|
|
18
|
+
const useServiceMutation = (mutationDocument, options) => {
|
|
19
|
+
const { onFieldErrors: defaultOnFieldErrors, onFieldErrorsDependencyList, errorMap, errorMapDependencyList, options: mutationOptions, mutateFactory, } = options ?? {};
|
|
20
|
+
const exceptionRef = (0, react_1.useRef)(null);
|
|
21
|
+
const memoizedErrorMap = (0, react_1.useMemo)(() => errorMap,
|
|
69
22
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
-
errorMapDependencyList
|
|
71
|
-
|
|
23
|
+
errorMapDependencyList ?? []);
|
|
24
|
+
const memoizedDefaultOnFieldErrors = (0, react_1.useMemo)(() => defaultOnFieldErrors,
|
|
72
25
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
|
-
onFieldErrorsDependencyList
|
|
74
|
-
|
|
75
|
-
|
|
26
|
+
onFieldErrorsDependencyList ?? []);
|
|
27
|
+
const [mutate, mutation] = (0, client_1.useMutation)(mutationDocument, mutationOptions);
|
|
28
|
+
const { addServiceErrorException, removeServiceErrorException, } = (0, react_1.useContext)(service_error_handler_react_1.ErrorHandlerContext);
|
|
76
29
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
case 1: return [2 /*return*/, (_a.sent())];
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}); };
|
|
101
|
-
nextMutate = (_b = mutateFactory === null || mutateFactory === void 0 ? void 0 : mutateFactory(mutateWithErrorProcessor)) !== null && _b !== void 0 ? _b : mutateWithErrorProcessor;
|
|
102
|
-
return [4 /*yield*/, (0, service_graphql_1.operationPromiseProcessor)(nextMutate(attributes), {
|
|
103
|
-
operationName: operationName,
|
|
104
|
-
context: context,
|
|
105
|
-
})
|
|
106
|
-
.catch(function (serviceErrorException) { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
-
return __generator(this, function (_a) {
|
|
108
|
-
if (memoizedErrorMap != null) {
|
|
109
|
-
serviceErrorException.serviceErrorList = (0, ErrorMapHelper_1.applyErrorMap)(serviceErrorException.serviceErrorList, memoizedErrorMap, onFieldErrors);
|
|
110
|
-
}
|
|
111
|
-
addServiceErrorException(serviceErrorException);
|
|
112
|
-
exceptionRef.current = serviceErrorException;
|
|
113
|
-
throw serviceErrorException;
|
|
114
|
-
});
|
|
115
|
-
}); })];
|
|
116
|
-
case 1: return [2 /*return*/, _c.sent()];
|
|
30
|
+
const memoizedOptions = (0, hooks_react_1.useMemoObject)(mutationOptions);
|
|
31
|
+
const wrappedCall = (0, react_1.useCallback)(async (variables, callAttributes) => {
|
|
32
|
+
const attributes = { variables, mutation: mutationDocument, ...memoizedOptions };
|
|
33
|
+
const onFieldErrors = callAttributes?.onFieldErrors ?? memoizedDefaultOnFieldErrors;
|
|
34
|
+
const context = calculateContext(mutationDocument, variables);
|
|
35
|
+
(exceptionRef.current != null) && removeServiceErrorException(context);
|
|
36
|
+
exceptionRef.current = null;
|
|
37
|
+
const operationName = (0, OperationHelper_1.getName)(mutationDocument);
|
|
38
|
+
const mutateWithErrorProcessor = async (options) => (await (0, service_graphql_1.operationPromiseProcessor)(mutate(options), {
|
|
39
|
+
operationName,
|
|
40
|
+
context,
|
|
41
|
+
}));
|
|
42
|
+
const nextMutate = mutateFactory?.(mutateWithErrorProcessor) ?? mutateWithErrorProcessor;
|
|
43
|
+
return await (0, service_graphql_1.operationPromiseProcessor)(nextMutate(attributes), {
|
|
44
|
+
operationName,
|
|
45
|
+
context,
|
|
46
|
+
})
|
|
47
|
+
.catch(async (serviceErrorException) => {
|
|
48
|
+
if (memoizedErrorMap != null) {
|
|
49
|
+
serviceErrorException.serviceErrorList = (0, ErrorMapHelper_1.applyErrorMap)(serviceErrorException.serviceErrorList, memoizedErrorMap, onFieldErrors);
|
|
117
50
|
}
|
|
51
|
+
addServiceErrorException(serviceErrorException);
|
|
52
|
+
exceptionRef.current = serviceErrorException;
|
|
53
|
+
throw serviceErrorException;
|
|
118
54
|
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return (0, react_1.useMemo)(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
call: wrappedCall,
|
|
128
|
-
});
|
|
129
|
-
}, [memoizedMutation, wrappedCall]);
|
|
55
|
+
}, [mutationDocument, memoizedOptions, memoizedDefaultOnFieldErrors, removeServiceErrorException, mutateFactory, mutate, memoizedErrorMap, addServiceErrorException]);
|
|
56
|
+
const memoizedMutation = (0, hooks_react_1.useMemoObject)(mutation);
|
|
57
|
+
return (0, react_1.useMemo)(() => ({
|
|
58
|
+
mutation: memoizedMutation,
|
|
59
|
+
data: memoizedMutation.data ?? null,
|
|
60
|
+
fetching: memoizedMutation.loading,
|
|
61
|
+
call: wrappedCall,
|
|
62
|
+
}), [memoizedMutation, wrappedCall]);
|
|
130
63
|
};
|
|
131
64
|
exports.useServiceMutation = useServiceMutation;
|
|
132
65
|
//# sourceMappingURL=UseServiceMutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseServiceMutation.js","sourceRoot":"","sources":["../../src/Hooks/UseServiceMutation.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"UseServiceMutation.js","sourceRoot":"","sources":["../../src/Hooks/UseServiceMutation.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,iCAKc;AAMd,kDAAgD;AAUhD,2CAEuB;AACvB,2FAA+E;AAC/E,0DAAgE;AAEhE,wDAAqD;AACrD,4DAAgD;AAEhD,0DAAqD;AAErD,MAAM,gBAAgB,GAAG,CAAC,QAAsB,EAAE,SAAmC,EAAU,EAAE,CAAC,CAChG,IAAA,8BAAc,EAAC,IA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AAgB,CAAC,OAAO;QAClC,IAAI,EAAE,WAAW;KAClB,CAAC,EAAE,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAA;AACtC,CAAC,CAAA;AAhFY,QAAA,kBAAkB,sBAgF9B"}
|
|
@@ -9,74 +9,70 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.useServiceQuery = void 0;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const client_1 = require("@apollo/client");
|
|
14
|
+
const lodash_get_1 = __importDefault(require("lodash.get"));
|
|
15
|
+
const service_prop_1 = require("@txo/service-prop");
|
|
16
|
+
const service_graphql_1 = require("@txo-peer-dep/service-graphql");
|
|
17
|
+
const hooks_react_1 = require("@txo/hooks-react");
|
|
18
|
+
const service_error_handler_react_1 = require("@txo-peer-dep/service-error-handler-react");
|
|
19
|
+
const ContextHelper_1 = require("../Api/ContextHelper");
|
|
20
|
+
const OperationHelper_1 = require("../Api/OperationHelper");
|
|
21
|
+
const PromiseHelper_1 = require("../Api/PromiseHelper");
|
|
22
|
+
const calculateContext = (query, variables) => ((0, ContextHelper_1.serviceContext)((0, OperationHelper_1.getName)(query), variables ?? {}));
|
|
23
|
+
const isServiceErrorListEqual = (a, b) => {
|
|
24
24
|
if (a.length !== b.length) {
|
|
25
25
|
return false;
|
|
26
26
|
}
|
|
27
|
-
if (a.every(
|
|
27
|
+
if (a.every((error, index) => (b[index].key === error.key) && (b[index].message === error.message))) {
|
|
28
28
|
return true;
|
|
29
29
|
}
|
|
30
30
|
return false;
|
|
31
31
|
};
|
|
32
32
|
// TODO: find a better way to parse type of dataPath (from attribute)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
const useServiceQuery = (queryDocument, options) => {
|
|
34
|
+
const { dataPath, options: queryOptions, } = options;
|
|
35
|
+
const query = (0, client_1.useQuery)(queryDocument, queryOptions);
|
|
36
|
+
const shownExceptionListRef = (0, react_1.useRef)([]);
|
|
37
|
+
const { addServiceErrorException, removeServiceErrorException, } = (0, react_1.useContext)(service_error_handler_react_1.ErrorHandlerContext);
|
|
38
|
+
const memoizedVariables = (0, hooks_react_1.useMemoObject)(queryOptions?.variables);
|
|
39
|
+
const memoizedQuery = (0, hooks_react_1.useMemoObject)(query);
|
|
40
|
+
const context = (0, react_1.useMemo)(() => (calculateContext(queryDocument, memoizedVariables)), [queryDocument, memoizedVariables]);
|
|
41
|
+
const exception = (0, react_1.useMemo)(() => {
|
|
42
|
+
const operationName = (0, OperationHelper_1.getName)(queryDocument);
|
|
43
43
|
if (memoizedQuery.error != null) {
|
|
44
|
-
|
|
45
|
-
context
|
|
46
|
-
operationName
|
|
44
|
+
const errorList = service_graphql_1.configManager.config.errorResponseTranslator(memoizedQuery.error, {
|
|
45
|
+
context,
|
|
46
|
+
operationName,
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
const exception = new service_prop_1.ServiceErrorException({
|
|
49
49
|
serviceErrorList: errorList,
|
|
50
50
|
serviceName: operationName,
|
|
51
|
-
context
|
|
51
|
+
context,
|
|
52
52
|
});
|
|
53
|
-
return
|
|
53
|
+
return exception;
|
|
54
54
|
}
|
|
55
55
|
return null;
|
|
56
56
|
}, [context, memoizedQuery, queryDocument]);
|
|
57
|
-
(0, react_1.useLayoutEffect)(
|
|
58
|
-
if ((exception != null) && (shownExceptionListRef.current.find(
|
|
57
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
58
|
+
if ((exception != null) && (shownExceptionListRef.current.find(shownException => (isServiceErrorListEqual(shownException.serviceErrorList, exception.serviceErrorList))) == null)) {
|
|
59
59
|
addServiceErrorException(exception);
|
|
60
60
|
shownExceptionListRef.current.push(exception);
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return () => {
|
|
63
63
|
(exception != null) && removeServiceErrorException(context);
|
|
64
64
|
};
|
|
65
65
|
}, [addServiceErrorException, context, exception, memoizedVariables, queryDocument, removeServiceErrorException]);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
69
|
-
args[_i] = arguments[_i];
|
|
70
|
-
}
|
|
71
|
-
(0, PromiseHelper_1.asyncToCallback)(memoizedQuery.refetch.apply(memoizedQuery, args));
|
|
66
|
+
const promiselessRefetch = (0, react_1.useCallback)((...args) => {
|
|
67
|
+
(0, PromiseHelper_1.asyncToCallback)(memoizedQuery.refetch(...args));
|
|
72
68
|
}, [memoizedQuery]);
|
|
73
|
-
return (0, react_1.useMemo)(
|
|
69
|
+
return (0, react_1.useMemo)(() => ({
|
|
74
70
|
query: memoizedQuery,
|
|
75
71
|
data: (0, lodash_get_1.default)(memoizedQuery.data, dataPath),
|
|
76
72
|
fetching: memoizedQuery.loading,
|
|
77
|
-
promiselessRefetch
|
|
78
|
-
exception
|
|
79
|
-
})
|
|
73
|
+
promiselessRefetch,
|
|
74
|
+
exception,
|
|
75
|
+
}), [memoizedQuery, dataPath, promiselessRefetch, exception]);
|
|
80
76
|
};
|
|
81
77
|
exports.useServiceQuery = useServiceQuery;
|
|
82
78
|
//# sourceMappingURL=UseServiceQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseServiceQuery.js","sourceRoot":"","sources":["../../src/Hooks/UseServiceQuery.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH
|
|
1
|
+
{"version":3,"file":"UseServiceQuery.js","sourceRoot":"","sources":["../../src/Hooks/UseServiceQuery.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,i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AC,SAAS,IAAI,IAAI,CAAC,IAAI,2BAA2B,CAAC,OAAO,CAAC,CAAA;QAC7D,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,wBAAwB,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,2BAA2B,CAAC,CAAC,CAAA;IAEjH,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,CAAC,GAAG,IAA8C,EAAE,EAAE;QAC3F,IAAA,+BAAe,EAAC,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;IACjD,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAA;IAEnB,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC;QACpB,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,IAAA,oBAAG,EAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAgC;QACtE,QAAQ,EAAE,aAAa,CAAC,OAAO;QAC/B,kBAAkB;QAClB,SAAS;KACV,CAAC,EAAE,CAAC,aAAa,EAAE,QAAQ,EAAE,kBAAkB,EAAE,SAAS,CAAC,CAAC,CAAA;AAC/D,CAAC,CAAA;AA/DY,QAAA,eAAe,mBA+D3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@txo/service-graphql-react",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.119",
|
|
4
4
|
"description": "Technology Studio - Service graphql react",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@txo/types": "^1.7.0",
|
|
44
44
|
"lodash.get": "^4.4.2",
|
|
45
45
|
"lodash.set": "^4.3.2",
|
|
46
|
-
"type-fest": "^4.
|
|
46
|
+
"type-fest": "^4.8.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@apollo/client": "^3.8.7",
|
|
@@ -56,16 +56,17 @@
|
|
|
56
56
|
"@txo-peer-dep/log": "^4.0.3",
|
|
57
57
|
"@txo-peer-dep/service-error-handler-react": "^1.2.26",
|
|
58
58
|
"@txo-peer-dep/service-graphql": "^3.3.2",
|
|
59
|
-
"@txo/commitlint": "^1.0.
|
|
59
|
+
"@txo/commitlint": "^1.0.8",
|
|
60
60
|
"@txo/log-console": "^3.0.0",
|
|
61
|
-
"@txo/semantic-release": "^1.0.
|
|
62
|
-
"@
|
|
61
|
+
"@txo/semantic-release": "^1.0.3",
|
|
62
|
+
"@txo/tsconfig": "^1.1.1",
|
|
63
|
+
"@types/jest": "^29.5.9",
|
|
63
64
|
"@types/lodash.get": "^4.4.9",
|
|
64
65
|
"@types/lodash.set": "^4.3.9",
|
|
65
66
|
"@types/node-fetch": "^2.6.9",
|
|
66
|
-
"@types/react": "^18.2.
|
|
67
|
+
"@types/react": "^18.2.38",
|
|
67
68
|
"concurrently": "^8.2.2",
|
|
68
|
-
"eslint-config-txo-typescript-react": "^2.0.
|
|
69
|
+
"eslint-config-txo-typescript-react": "^2.0.7",
|
|
69
70
|
"graphql": "^16.8.1",
|
|
70
71
|
"husky": "^8.0.3",
|
|
71
72
|
"jest": "^29.7.0",
|
|
@@ -75,6 +76,6 @@
|
|
|
75
76
|
"redux-saga": "^1.2.3",
|
|
76
77
|
"rimraf": "^5.0.5",
|
|
77
78
|
"ts-jest": "^29.1.1",
|
|
78
|
-
"typescript": "^5.
|
|
79
|
+
"typescript": "^5.3.2"
|
|
79
80
|
}
|
|
80
81
|
}
|