@webitel/ui-sdk 3.2.80 → 3.2.81

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "3.2.80",
3
+ "version": "3.2.81",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -11,61 +11,83 @@ export default class ApiStoreModule extends BaseStoreModule {
11
11
  .GET_LIST = (
12
12
  _,
13
13
  { context: callerContext = {}, params = {} },
14
- ) => api.getList({
15
- ...callerContext.state,
16
- parentId: getParentIdFromContext(callerContext),
17
- ...params,
18
- });
14
+ ) => {
15
+ if (!api.getList) throw Error('No API "getList" method provided');
16
+ return api.getList({
17
+ ...callerContext.state,
18
+ parentId: getParentIdFromContext(callerContext),
19
+ ...params,
20
+ });
21
+ };
22
+
19
23
  this.actions
20
24
  .GET_ITEM = (
21
25
  _,
22
26
  { context: callerContext = {}, params = {} } = {},
23
- ) => api.get({
24
- ...callerContext.state,
25
- parentId: getParentIdFromContext(callerContext),
26
- ...params,
27
- });
27
+ ) => {
28
+ if (!api.get) throw Error('No API "get" method provided');
29
+ return api.get({
30
+ ...callerContext.state,
31
+ parentId: getParentIdFromContext(callerContext),
32
+ ...params,
33
+ });
34
+ };
35
+
28
36
  this.actions
29
37
  .POST_ITEM = (
30
38
  _,
31
39
  { context: callerContext = {}, ...rest } = {},
32
- ) => api.add({
33
- ...callerContext.state,
34
- parentId: getParentIdFromContext(callerContext),
35
- ...rest,
36
- });
40
+ ) => {
41
+ if (!api.add) throw Error('No API "add" method provided');
42
+ return api.add({
43
+ ...callerContext.state,
44
+ parentId: getParentIdFromContext(callerContext),
45
+ ...rest,
46
+ });
47
+ };
48
+
37
49
  this.actions
38
50
  .PATCH_ITEM = (
39
51
  _,
40
52
  { context: callerContext = {}, id, changes, ...rest },
41
- ) => (
42
- api.patch({
53
+ ) => {
54
+ if (!api.patch) throw Error('No API "patch" method provided');
55
+ return api.patch({
43
56
  ...callerContext.state,
44
57
  ...rest,
45
58
  parentId: getParentIdFromContext(callerContext),
46
59
  id,
47
60
  changes,
48
- })
49
- );
61
+ });
62
+ };
63
+
50
64
  this.actions
51
65
  .UPD_ITEM = (
52
66
  _,
53
67
  { context: callerContext = {}, ...rest } = {},
54
- ) => api.update({
55
- ...callerContext.state,
56
- parentId: getParentIdFromContext(callerContext),
57
- ...rest,
58
- });
68
+ ) => {
69
+ if (!api.update) throw Error('No API "update" method provided');
70
+ return api.update({
71
+ ...callerContext.state,
72
+ parentId: getParentIdFromContext(callerContext),
73
+ ...rest,
74
+ });
75
+ };
76
+
59
77
  this.actions
60
78
  .DELETE_ITEM = (
61
79
  _,
62
80
  { context: callerContext = {}, id, ...rest },
63
- ) => api.delete({
64
- ...callerContext.state,
65
- parentId: getParentIdFromContext(callerContext),
66
- ...rest,
67
- id,
68
- });
81
+ ) => {
82
+ if (!api.delete) throw Error('No API "delete" method provided');
83
+ return api.delete({
84
+ ...callerContext.state,
85
+ parentId: getParentIdFromContext(callerContext),
86
+ ...rest,
87
+ id,
88
+ });
89
+ };
90
+
69
91
  return this;
70
92
  }
71
93
  }