@txo/service-graphql-react 2.3.118 → 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 CHANGED
@@ -1,3 +1,10 @@
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
+
1
8
  ## [2.3.118](https://github.com/technology-studio/service-graphql-react/compare/v2.3.117...v2.3.118) (2023-11-17)
2
9
 
3
10
 
@@ -6,6 +6,6 @@
6
6
  **/
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.serviceContext = void 0;
9
- var serviceContext = function (serviceName, serviceAttributes) { return ("".concat(serviceName, "(").concat(JSON.stringify(serviceAttributes), ")").replace(/\./g, '_')); };
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,IAAM,cAAc,GAAG,UAAC,WAAmB,EAAE,iBAA0C,IAAa,OAAA,CACzG,UAAG,WAAW,cAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAC3E,EAF0G,CAE1G,CAAA;AAFY,QAAA,cAAc,kBAE1B"}
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
- var functional_1 = require("@txo/functional");
33
- var lodash_set_1 = __importDefault(require("lodash.set"));
34
- var Types_1 = require("../Model/Types");
35
- var normaliseErrorMap = function (errorMap) {
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(function (normalisedErrorMap, key) {
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
- var ignoreError = function () { return function () { return undefined; }; };
24
+ const ignoreError = () => () => undefined;
45
25
  exports.ignoreError = ignoreError;
46
- var validationError = function (message) { return function (_a) {
47
- var error = _a.error;
48
- var nextError = __assign(__assign({}, error), { message: message !== null && message !== void 0 ? message : error.message, meta: __assign(__assign({}, error.meta), { type: Types_1.VALIDATION_ERROR }) });
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
- var getWithWildcardFallback = function (errorMap, path) {
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
- var pathList = path.split('.');
59
- var currentPath = pathList.shift();
60
- var keyList = Object.keys(errorMap);
61
- var currentKey = currentPath != null && currentPath !== '' && keyList.includes(currentPath) ? currentPath : '*';
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
- var applyErrorMap = function (serviceErrorList, errorMap, onFieldErrors) {
71
- var normalisedErrorMap = normaliseErrorMap(errorMap);
72
- var modified = false;
73
- var fieldErrors = {};
74
- var nextServiceErrorList = serviceErrorList
75
- .reduce(function (nextServiceErrorList, serviceError) {
76
- var _a;
77
- var graphQlError = serviceError.data;
78
- var path = __spreadArray(__spreadArray([], ((_a = graphQlError === null || graphQlError === void 0 ? void 0 : graphQlError.path) !== null && _a !== void 0 ? _a : []), true), [serviceError.key], false).join('.');
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
- var nextServiceError = errorMapper({
66
+ const nextServiceError = errorMapper({
82
67
  error: serviceError,
83
- fieldErrors: fieldErrors,
84
- path: 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;;;;;;;;;;;;;;;;;;;;;;;;;;AAKH,8CAA0C;AAC1C,0DAA4B;AAO5B,wCAEuB;AAEvB,IAAM,iBAAiB,GAAG,UAAC,QAAkB;IAC3C,IAAI,IAAA,qBAAQ,EAAC,QAAQ,CAAC,EAAE;QACtB,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAC,kBAA4C,EAAE,GAAG;YACpF,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;KACP;IACD,OA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AAY,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
- var graphql_1 = require("graphql");
10
- var upperCaseFirst = function (str) { return str.charAt(0).toUpperCase() + str.slice(1); };
11
- var pascalCase = function (string) { return ("".concat(string)
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, function (_$1, $2, $3) { return "".concat($2.toUpperCase() + $3.toLowerCase()); })
15
- .replace(/\w/, function (s) { return s.toUpperCase(); })); };
16
- var getName = function (query) {
17
- var _a;
18
- var definition = query.definitions
19
- .find(function (definition) { return (definition.kind === graphql_1.Kind.OPERATION_DEFINITION); });
20
- var operationName = (_a = definition === null || definition === void 0 ? void 0 : definition.name) === null || _a === void 0 ? void 0 : _a.value.split('_').map(pascalCase).join('.');
21
- return operationName !== null && operationName !== void 0 ? operationName : upperCaseFirst(definition.operation);
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,mCAIgB;AAEhB,IAAM,cAAc,GAAG,UAAC,GAAW,IAAa,OAAA,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAA1C,CAA0C,CAAA;AAC1F,IAAM,UAAU,GAAG,UAAC,MAAc,IAAa,OAAA,CAC7C,UAAG,MAAM,CAAE;KACR,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;KACtB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;KACvB,OAAO,CACN,cAAc,EACd,UAAC,GA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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"}
@@ -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
- var suppressResults = function (promise) { return promise
10
- .then(function () { return undefined; })
11
- .catch(function () { return undefined; }); };
9
+ const suppressResults = (promise) => promise
10
+ .then(() => undefined)
11
+ .catch(() => undefined);
12
12
  exports.suppressResults = suppressResults;
13
- var suppressErrors = function (promise, thenCallback) {
13
+ const suppressErrors = (promise, thenCallback) => {
14
14
  void promise
15
15
  .then(thenCallback)
16
- .catch(function () { return undefined; });
16
+ .catch(() => undefined);
17
17
  };
18
18
  exports.suppressErrors = suppressErrors;
19
- var asyncToCallback = function (promise) {
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,IAAM,eAAe,GAAG,UAAC,OAAyB,IAAwB,OAC9E,OAAO;KACL,IAAI,CAAC,cAAM,OAAA,SAAS,EAAT,CAAS,CAAC;KACrB,KAAK,CAAC,cAAM,OAAA,SAAS,EAAT,CAAS,CACzB,EAJgF,CAIhF,CAAA;AAJY,QAAA,eAAe,mBAI3B;AAEM,IAAM,cAAc,GAAG,UAC5B,OAAsB,EACtB,YAAkC;IAElC,KAAK,OAAO;SACT,IAAI,CAAC,YAAY,CAAC;SAClB,KAAK,CAAC,cAAM,OAAA,SAAS,EAAT,CAAS,CAAC,CAAA;AAC3B,CAAC,CAAA;AAPY,QAAA,cAAc,kBAO1B;AAEM,IAAM,eAAe,GAAG,UAC7B,OAAyB;IAEzB,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAA;AAC1B,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B"}
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
- var react_1 = require("react");
57
- var hooks_react_1 = require("@txo/hooks-react");
58
- var client_1 = require("@apollo/client");
59
- var service_error_handler_react_1 = require("@txo-peer-dep/service-error-handler-react");
60
- var service_graphql_1 = require("@txo/service-graphql");
61
- var ContextHelper_1 = require("../Api/ContextHelper");
62
- var OperationHelper_1 = require("../Api/OperationHelper");
63
- var ErrorMapHelper_1 = require("../Api/ErrorMapHelper");
64
- var calculateContext = function (mutation, variables) { return ((0, ContextHelper_1.serviceContext)((0, OperationHelper_1.getName)(mutation), variables !== null && variables !== void 0 ? variables : {})); };
65
- var useServiceMutation = function (mutationDocument, options) {
66
- var _a = options !== null && options !== void 0 ? options : {}, defaultOnFieldErrors = _a.onFieldErrors, onFieldErrorsDependencyList = _a.onFieldErrorsDependencyList, errorMap = _a.errorMap, errorMapDependencyList = _a.errorMapDependencyList, mutationOptions = _a.options, mutateFactory = _a.mutateFactory;
67
- var exceptionRef = (0, react_1.useRef)(null);
68
- var memoizedErrorMap = (0, react_1.useMemo)(function () { return errorMap; },
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 !== null && errorMapDependencyList !== void 0 ? errorMapDependencyList : []);
71
- var memoizedDefaultOnFieldErrors = (0, react_1.useMemo)(function () { return defaultOnFieldErrors; },
23
+ errorMapDependencyList ?? []);
24
+ const memoizedDefaultOnFieldErrors = (0, react_1.useMemo)(() => defaultOnFieldErrors,
72
25
  // eslint-disable-next-line react-hooks/exhaustive-deps
73
- onFieldErrorsDependencyList !== null && onFieldErrorsDependencyList !== void 0 ? onFieldErrorsDependencyList : []);
74
- var _b = (0, client_1.useMutation)(mutationDocument, mutationOptions), mutate = _b[0], mutation = _b[1];
75
- var _c = (0, react_1.useContext)(service_error_handler_react_1.ErrorHandlerContext), addServiceErrorException = _c.addServiceErrorException, removeServiceErrorException = _c.removeServiceErrorException;
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
- var memoizedOptions = (0, hooks_react_1.useMemoObject)(mutationOptions);
78
- var wrappedCall = (0, react_1.useCallback)(function (variables, callAttributes) { return __awaiter(void 0, void 0, void 0, function () {
79
- var attributes, onFieldErrors, context, operationName, mutateWithErrorProcessor, nextMutate;
80
- var _a, _b;
81
- return __generator(this, function (_c) {
82
- switch (_c.label) {
83
- case 0:
84
- attributes = __assign({ variables: variables, mutation: mutationDocument }, memoizedOptions);
85
- onFieldErrors = (_a = callAttributes === null || callAttributes === void 0 ? void 0 : callAttributes.onFieldErrors) !== null && _a !== void 0 ? _a : memoizedDefaultOnFieldErrors;
86
- context = calculateContext(mutationDocument, variables);
87
- (exceptionRef.current != null) && removeServiceErrorException(context);
88
- exceptionRef.current = null;
89
- operationName = (0, OperationHelper_1.getName)(mutationDocument);
90
- mutateWithErrorProcessor = function (options) { return __awaiter(void 0, void 0, void 0, function () {
91
- return __generator(this, function (_a) {
92
- switch (_a.label) {
93
- case 0: return [4 /*yield*/, (0, service_graphql_1.operationPromiseProcessor)(mutate(options), {
94
- operationName: operationName,
95
- context: context,
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
- }); }, [mutationDocument, memoizedOptions, memoizedDefaultOnFieldErrors, removeServiceErrorException, mutateFactory, mutate, memoizedErrorMap, addServiceErrorException]);
120
- var memoizedMutation = (0, hooks_react_1.useMemoObject)(mutation);
121
- return (0, react_1.useMemo)(function () {
122
- var _a;
123
- return ({
124
- mutation: memoizedMutation,
125
- data: (_a = memoizedMutation.data) !== null && _a !== void 0 ? _a : null,
126
- fetching: memoizedMutation.loading,
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,+BAKc;AAMd,gDAAgD;AAUhD,yCAEuB;AACvB,yFAA+E;AAC/E,wDAAgE;AAEhE,sDAAqD;AACrD,0DAAgD;AAEhD,wDAAqD;AAErD,IAAM,gBAAgB,GAAG,UAAC,QAAsB,EAAE,SAAmC,IAAa,OAAA,CAChG,IAAA,8BAAc,EAAC,IAAA,yBAAO,EAAC,QAAQ,CAAC,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC,CACnD,EAFiG,CAEjG,CAAA;AAmBM,IAAM,kBAAkB,GAAG,UAK9B,gBAAqD,EACrD,OAA2C;IAEvC,IAAA,KAOF,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EANA,oBAAoB,mBAAA,EACnC,2BAA2B,iCAAA,EAC3B,QAAQ,cAAA,EACR,sBAAsB,4BAAA,EACb,eAAe,aAAA,EACxB,aAAa,mBACE,CAAA;IACjB,IAAM,YAAY,GAAG,IAAA,cAAM,EAA+B,IAAI,CAAC,CAAA;IAC/D,IAAM,gBAAgB,GAAG,IAAA,eAAO,EAC9B,cAAM,OAAA,QAAQ,EAAR,CAAQ;IACd,uDAAuD;IACvD,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,EAAE,CAC7B,CAAA;IACD,IAAM,4BAA4B,GAAG,IAAA,eAAO,EAC1C,cAAM,OAAA,oBAAoB,EAApB,CAAo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B,IAAI,EAAE,gBAAgB,CAAC,IAAI,IAAI,IAAI;QACnC,QAAQ,EAAE,gBAAgB,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
- var react_1 = require("react");
13
- var client_1 = require("@apollo/client");
14
- var lodash_get_1 = __importDefault(require("lodash.get"));
15
- var service_prop_1 = require("@txo/service-prop");
16
- var service_graphql_1 = require("@txo-peer-dep/service-graphql");
17
- var hooks_react_1 = require("@txo/hooks-react");
18
- var service_error_handler_react_1 = require("@txo-peer-dep/service-error-handler-react");
19
- var ContextHelper_1 = require("../Api/ContextHelper");
20
- var OperationHelper_1 = require("../Api/OperationHelper");
21
- var PromiseHelper_1 = require("../Api/PromiseHelper");
22
- var calculateContext = function (query, variables) { return ((0, ContextHelper_1.serviceContext)((0, OperationHelper_1.getName)(query), variables !== null && variables !== void 0 ? variables : {})); };
23
- var isServiceErrorListEqual = function (a, b) {
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(function (error, index) { return (b[index].key === error.key) && (b[index].message === error.message); })) {
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
- var useServiceQuery = function (queryDocument, options) {
34
- var dataPath = options.dataPath, queryOptions = options.options;
35
- var query = (0, client_1.useQuery)(queryDocument, queryOptions);
36
- var shownExceptionListRef = (0, react_1.useRef)([]);
37
- var _a = (0, react_1.useContext)(service_error_handler_react_1.ErrorHandlerContext), addServiceErrorException = _a.addServiceErrorException, removeServiceErrorException = _a.removeServiceErrorException;
38
- var memoizedVariables = (0, hooks_react_1.useMemoObject)(queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.variables);
39
- var memoizedQuery = (0, hooks_react_1.useMemoObject)(query);
40
- var context = (0, react_1.useMemo)(function () { return (calculateContext(queryDocument, memoizedVariables)); }, [queryDocument, memoizedVariables]);
41
- var exception = (0, react_1.useMemo)(function () {
42
- var operationName = (0, OperationHelper_1.getName)(queryDocument);
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
- var errorList = service_graphql_1.configManager.config.errorResponseTranslator(memoizedQuery.error, {
45
- context: context,
46
- operationName: operationName,
44
+ const errorList = service_graphql_1.configManager.config.errorResponseTranslator(memoizedQuery.error, {
45
+ context,
46
+ operationName,
47
47
  });
48
- var exception_1 = new service_prop_1.ServiceErrorException({
48
+ const exception = new service_prop_1.ServiceErrorException({
49
49
  serviceErrorList: errorList,
50
50
  serviceName: operationName,
51
- context: context,
51
+ context,
52
52
  });
53
- return exception_1;
53
+ return exception;
54
54
  }
55
55
  return null;
56
56
  }, [context, memoizedQuery, queryDocument]);
57
- (0, react_1.useLayoutEffect)(function () {
58
- if ((exception != null) && (shownExceptionListRef.current.find(function (shownException) { return (isServiceErrorListEqual(shownException.serviceErrorList, exception.serviceErrorList)); }) == null)) {
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 function () {
62
+ return () => {
63
63
  (exception != null) && removeServiceErrorException(context);
64
64
  };
65
65
  }, [addServiceErrorException, context, exception, memoizedVariables, queryDocument, removeServiceErrorException]);
66
- var promiselessRefetch = (0, react_1.useCallback)(function () {
67
- var args = [];
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)(function () { return ({
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: promiselessRefetch,
78
- exception: exception,
79
- }); }, [memoizedQuery, dataPath, promiselessRefetch, exception]);
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,+BAMc;AAQd,yCAEuB;AACvB,0DAA4B;AAO5B,kDAE0B;AAC1B,iEAA6D;AAC7D,gDAEyB;AACzB,yFAA+E;AAG/E,sDAAqD;AACrD,0DAAgD;AAChD,sDAAsD;AAEtD,IAAM,gBAAgB,GAAG,UAAC,KAAmB,EAAE,SAA8C,IAAa,OAAA,CACxG,IAAA,8BAAc,EAAC,IAAA,yBAAO,EAAC,KAAK,CAAC,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC,CAChD,EAFyG,CAEzG,CAAA;AAcD,IAAM,uBAAuB,GAAG,UAAC,CAAiB,EAAE,CAAiB;IACnE,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,KAAK,CAAA;KACb;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,UAAC,KAAK,EAAE,KAAK,IAAK,OAAA,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,CAAC,EAApE,CAAoE,CAAC,EAAE;QACnG,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,qEAAqE;AAC9D,IAAM,eAAe,GAAG,UAM3B,aAAkD,EAClD,OAAkD;IAGlD,IAAA,QAAQ,GAEN,OAAO,SAFD,EACC,YAAY,GACnB,OAAO,QADY,CACZ;IACX,IA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,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.118",
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.8.1"
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.7",
59
+ "@txo/commitlint": "^1.0.8",
60
60
  "@txo/log-console": "^3.0.0",
61
61
  "@txo/semantic-release": "^1.0.3",
62
- "@types/jest": "^29.5.8",
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.37",
67
+ "@types/react": "^18.2.38",
67
68
  "concurrently": "^8.2.2",
68
- "eslint-config-txo-typescript-react": "^2.0.5",
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.2.2"
79
+ "typescript": "^5.3.2"
79
80
  }
80
81
  }