@webiny/app-security-access-management 5.23.0 → 5.24.0-beta.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.
@@ -1 +1 @@
1
- export declare const LIST_GROUPS: any;
1
+ export declare const LIST_GROUPS: import("graphql").DocumentNode;
@@ -1,2 +1,5 @@
1
- /// <reference types="react" />
2
- export declare const GroupAutocomplete: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ import { AutoCompleteProps } from "@webiny/ui/AutoComplete";
3
+ declare type GroupAutocompleteProps = Partial<AutoCompleteProps>;
4
+ export declare const GroupAutocomplete: React.FC<GroupAutocompleteProps>;
5
+ export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const NotAuthorizedError: () => JSX.Element;
1
+ import * as React from "react";
2
+ export declare const NotAuthorizedError: React.FC;
package/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import React from "react";
2
2
  declare const _default: () => any[];
3
+ /**
4
+ * TODO @ts-refactor
5
+ * Find out why is there empty default export
6
+ */
3
7
  export default _default;
4
8
  export declare const AccessManagementExtension: () => JSX.Element;
5
9
  export declare const AccessManagement: React.MemoExoticComponent<() => JSX.Element>;
package/index.js CHANGED
@@ -6,6 +6,12 @@ import { Permission } from "./plugins/constants";
6
6
  import { Groups } from "./ui/views/Groups";
7
7
  import { ApiKeys } from "./ui/views/ApiKeys";
8
8
  import accessManagementPugins from "./plugins";
9
+ /**
10
+ * TODO @ts-refactor
11
+ * Find out why is there empty default export
12
+ */
13
+ // @ts-ignore
14
+
9
15
  export default (function () {
10
16
  return [];
11
17
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-security-access-management",
3
- "version": "5.23.0",
3
+ "version": "5.24.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,14 +15,14 @@
15
15
  "dependencies": {
16
16
  "@apollo/react-hooks": "3.1.5",
17
17
  "@emotion/styled": "10.3.0",
18
- "@webiny/app": "5.23.0",
19
- "@webiny/app-admin": "5.23.0",
20
- "@webiny/app-security": "5.23.0",
21
- "@webiny/form": "5.23.0",
22
- "@webiny/plugins": "5.23.0",
23
- "@webiny/react-router": "5.23.0",
24
- "@webiny/ui": "5.23.0",
25
- "@webiny/validation": "5.23.0",
18
+ "@webiny/app": "5.24.0-beta.0",
19
+ "@webiny/app-admin": "5.24.0-beta.0",
20
+ "@webiny/app-security": "5.24.0-beta.0",
21
+ "@webiny/form": "5.24.0-beta.0",
22
+ "@webiny/plugins": "5.24.0-beta.0",
23
+ "@webiny/react-router": "5.24.0-beta.0",
24
+ "@webiny/ui": "5.24.0-beta.0",
25
+ "@webiny/validation": "5.24.0-beta.0",
26
26
  "emotion": "10.0.27",
27
27
  "graphql-tag": "2.12.6",
28
28
  "lodash": "4.17.21",
@@ -37,8 +37,9 @@
37
37
  "@babel/preset-env": "^7.16.4",
38
38
  "@babel/preset-react": "^7.16.0",
39
39
  "@babel/preset-typescript": "^7.16.0",
40
- "@webiny/cli": "^5.23.0",
41
- "@webiny/project-utils": "^5.23.0",
40
+ "@types/react-helmet": "^6.1.5",
41
+ "@webiny/cli": "^5.24.0-beta.0",
42
+ "@webiny/project-utils": "^5.24.0-beta.0",
42
43
  "babel-plugin-emotion": "^9.2.8",
43
44
  "babel-plugin-lodash": "^3.3.4",
44
45
  "rimraf": "^3.0.2",
@@ -60,5 +61,5 @@
60
61
  ]
61
62
  }
62
63
  },
63
- "gitHead": "eaa0003e39194d687ab5397c08eeccdb3557fb28"
64
+ "gitHead": "05b90b92bbaf2ef3adf275d008c4641580cf5f42"
64
65
  }
@@ -1,5 +1,8 @@
1
- /// <reference types="react" />
2
- export declare const SecurityPermissions: ({ value, onChange }: {
3
- value: any;
4
- onChange: any;
5
- }) => JSX.Element;
1
+ import React from "react";
2
+ import { SecurityPermission } from "@webiny/app-security/types";
3
+ interface SecurityPermissionsProps {
4
+ value: SecurityPermission[];
5
+ onChange: (value: SecurityPermission[]) => void;
6
+ }
7
+ export declare const SecurityPermissions: React.FC<SecurityPermissionsProps>;
8
+ export {};
package/types.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { SecurityPermission } from "@webiny/app-security/types";
2
+ export interface Group {
3
+ id: string;
4
+ name: string;
5
+ description: string;
6
+ slug: string;
7
+ system?: boolean;
8
+ }
9
+ export interface ApiKey {
10
+ id: string;
11
+ token: string;
12
+ name: string;
13
+ description: string;
14
+ permissions: SecurityPermission[];
15
+ }
package/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { InputElement } from "@webiny/app-admin/ui/elements/form/InputElement";
3
+ import { FormFieldElementRenderProps } from "@webiny/app-admin/ui/elements/form/FormFieldElement";
3
4
  export declare class GroupAutocompleteElement extends InputElement {
4
- render({ formProps }: any): React.ReactElement;
5
+ render(props: FormFieldElementRenderProps): React.ReactElement;
5
6
  }
@@ -18,10 +18,10 @@ export var GroupAutocompleteElement = /*#__PURE__*/function (_InputElement) {
18
18
 
19
19
  _createClass(GroupAutocompleteElement, [{
20
20
  key: "render",
21
- value: function render(_ref) {
22
- var formProps = _ref.formProps;
23
- var _ref2 = formProps,
24
- Bind = _ref2.Bind;
21
+ value: function render(props) {
22
+ var formProps = props.formProps;
23
+ var _ref = formProps,
24
+ Bind = _ref.Bind;
25
25
  return /*#__PURE__*/React.createElement(Bind, {
26
26
  name: this.id,
27
27
  validators: this.config.validators
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
2
- declare const ApiKeyForm: () => JSX.Element;
3
- export default ApiKeyForm;
1
+ import React from "react";
2
+ export interface ApiKeyFormProps {
3
+ [key: string]: any;
4
+ }
5
+ export declare const ApiKeyForm: React.FC<ApiKeyFormProps>;
@@ -36,8 +36,7 @@ var ButtonWrapper = /*#__PURE__*/styled("div", {
36
36
  display: "flex",
37
37
  justifyContent: "space-between"
38
38
  });
39
-
40
- var ApiKeyForm = function ApiKeyForm() {
39
+ export var ApiKeyForm = function ApiKeyForm() {
41
40
  var _useRouter = useRouter(),
42
41
  location = _useRouter.location,
43
42
  history = _useRouter.history;
@@ -239,6 +238,4 @@ var ApiKeyForm = function ApiKeyForm() {
239
238
  onClick: form.submit
240
239
  }, t(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["Save API key"])))))));
241
240
  });
242
- };
243
-
244
- export default ApiKeyForm;
241
+ };
@@ -1,3 +1,8 @@
1
- /// <reference types="react" />
2
- declare const ApiKeys: ({ formProps, listProps }: any) => JSX.Element;
3
- export default ApiKeys;
1
+ import * as React from "react";
2
+ import { ApiKeysDataListProps } from "./ApiKeysDataList";
3
+ import { ApiKeyFormProps } from "./ApiKeyForm";
4
+ export interface ApiKeysProps {
5
+ listProps?: ApiKeysDataListProps;
6
+ formProps?: ApiKeyFormProps;
7
+ }
8
+ export declare const ApiKeys: React.FC<ApiKeysProps>;
@@ -1,12 +1,11 @@
1
1
  import * as React from "react";
2
2
  import { SplitView, LeftPanel, RightPanel } from "@webiny/app-admin/components/SplitView";
3
- import ApiKeysDataList from "./ApiKeysDataList";
4
- import ApiKeyForm from "./ApiKeyForm";
5
-
6
- var ApiKeys = function ApiKeys(_ref) {
7
- var formProps = _ref.formProps,
8
- listProps = _ref.listProps;
3
+ import { ApiKeysDataList } from "./ApiKeysDataList";
4
+ import { ApiKeyForm } from "./ApiKeyForm";
5
+ export var ApiKeys = function ApiKeys(_ref) {
6
+ var _ref$formProps = _ref.formProps,
7
+ formProps = _ref$formProps === void 0 ? {} : _ref$formProps,
8
+ _ref$listProps = _ref.listProps,
9
+ listProps = _ref$listProps === void 0 ? {} : _ref$listProps;
9
10
  return /*#__PURE__*/React.createElement(SplitView, null, /*#__PURE__*/React.createElement(LeftPanel, null, /*#__PURE__*/React.createElement(ApiKeysDataList, listProps)), /*#__PURE__*/React.createElement(RightPanel, null, /*#__PURE__*/React.createElement(ApiKeyForm, formProps)));
10
- };
11
-
12
- export default ApiKeys;
11
+ };
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
2
- declare const ApiKeysDataList: () => JSX.Element;
3
- export default ApiKeysDataList;
1
+ import React from "react";
2
+ export interface ApiKeysDataListProps {
3
+ [key: string]: any;
4
+ }
5
+ export declare const ApiKeysDataList: React.FC<ApiKeysDataListProps>;
@@ -21,37 +21,28 @@ import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDi
21
21
  import * as GQL from "./graphql";
22
22
  import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
23
23
  import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
24
- import { serializeSorters, deserializeSorters } from "../utils";
24
+ import { deserializeSorters } from "../utils";
25
25
  var t = i18n.ns("app-security/admin/groups/data-list");
26
26
  var SORTERS = [{
27
27
  label: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Newest to oldest"]))),
28
- sorters: {
29
- createdOn: "desc"
30
- }
28
+ sorter: "createdOn_DESC"
31
29
  }, {
32
30
  label: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Oldest to newest"]))),
33
- sorters: {
34
- createdOn: "asc"
35
- }
31
+ sorter: "createdOn_ASC"
36
32
  }, {
37
33
  label: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Name A-Z"]))),
38
- sorters: {
39
- name: "asc"
40
- }
34
+ sorter: "name_ASC"
41
35
  }, {
42
36
  label: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Name Z-A"]))),
43
- sorters: {
44
- name: "desc"
45
- }
37
+ sorter: "name_DESC"
46
38
  }];
47
-
48
- var ApiKeysDataList = function ApiKeysDataList() {
39
+ export var ApiKeysDataList = function ApiKeysDataList() {
49
40
  var _useState = useState(""),
50
41
  _useState2 = _slicedToArray(_useState, 2),
51
42
  filter = _useState2[0],
52
43
  setFilter = _useState2[1];
53
44
 
54
- var _useState3 = useState(serializeSorters(SORTERS[0].sorters)),
45
+ var _useState3 = useState(SORTERS[0].sorter),
55
46
  _useState4 = _slicedToArray(_useState3, 2),
56
47
  sort = _useState4[0],
57
48
  setSort = _useState4[1];
@@ -78,11 +69,10 @@ var ApiKeysDataList = function ApiKeysDataList() {
78
69
  return list;
79
70
  }
80
71
 
81
- var _Object$entries = Object.entries(deserializeSorters(sort)),
82
- _Object$entries2 = _slicedToArray(_Object$entries, 1),
83
- _Object$entries2$ = _slicedToArray(_Object$entries2[0], 2),
84
- key = _Object$entries2$[0],
85
- value = _Object$entries2$[1];
72
+ var _deserializeSorters = deserializeSorters(sort),
73
+ _deserializeSorters2 = _slicedToArray(_deserializeSorters, 2),
74
+ key = _deserializeSorters2[0],
75
+ value = _deserializeSorters2[1];
86
76
 
87
77
  return orderBy(list, [key], [value]);
88
78
  }, [sort]);
@@ -153,10 +143,10 @@ var ApiKeysDataList = function ApiKeysDataList() {
153
143
  label: t(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Sort by"])))
154
144
  }, SORTERS.map(function (_ref3) {
155
145
  var label = _ref3.label,
156
- sorters = _ref3.sorters;
146
+ sorter = _ref3.sorter;
157
147
  return /*#__PURE__*/React.createElement("option", {
158
148
  key: label,
159
- value: serializeSorters(sorters)
149
+ value: sorter
160
150
  }, label);
161
151
  })))));
162
152
  }, [sort]);
@@ -204,6 +194,4 @@ var ApiKeysDataList = function ApiKeysDataList() {
204
194
  }))));
205
195
  }));
206
196
  });
207
- };
208
-
209
- export default ApiKeysDataList;
197
+ };
@@ -1,5 +1,5 @@
1
- export declare const LIST_API_KEYS: any;
2
- export declare const READ_API_KEY: any;
3
- export declare const CREATE_API_KEY: any;
4
- export declare const UPDATE_API_KEY: any;
5
- export declare const DELETE_API_KEY: any;
1
+ export declare const LIST_API_KEYS: import("graphql").DocumentNode;
2
+ export declare const READ_API_KEY: import("graphql").DocumentNode;
3
+ export declare const CREATE_API_KEY: import("graphql").DocumentNode;
4
+ export declare const UPDATE_API_KEY: import("graphql").DocumentNode;
5
+ export declare const DELETE_API_KEY: import("graphql").DocumentNode;
@@ -1 +1 @@
1
- export { default as ApiKeys } from "./ApiKeys";
1
+ export * from "./ApiKeys";
@@ -1 +1 @@
1
- export { default as ApiKeys } from "./ApiKeys";
1
+ export * from "./ApiKeys";
@@ -1 +1,2 @@
1
- export declare const pickDataForAPI: (data: any) => any;
1
+ import { ApiKey } from "../../../types";
2
+ export declare const pickDataForAPI: (data: ApiKey) => Pick<ApiKey, "name" | "description" | "permissions">;
@@ -1,3 +1,8 @@
1
- /// <reference types="react" />
2
- declare const Groups: ({ formProps, listProps }: any) => JSX.Element;
3
- export default Groups;
1
+ import React from "react";
2
+ import { GroupsDataListProps } from "./GroupsDataList";
3
+ import { GroupsFormProps } from "./GroupsForm";
4
+ export interface GroupsProps {
5
+ listProps?: GroupsDataListProps;
6
+ formProps?: GroupsFormProps;
7
+ }
8
+ export declare const Groups: React.FC<GroupsProps>;
@@ -1,12 +1,11 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  import { SplitView, LeftPanel, RightPanel } from "@webiny/app-admin/components/SplitView";
3
- import GroupsDataList from "./GroupsDataList";
4
- import GroupsForm from "./GroupsForm";
5
-
6
- var Groups = function Groups(_ref) {
7
- var formProps = _ref.formProps,
8
- listProps = _ref.listProps;
3
+ import { GroupsDataList } from "./GroupsDataList";
4
+ import { GroupsForm } from "./GroupsForm";
5
+ export var Groups = function Groups(_ref) {
6
+ var _ref$formProps = _ref.formProps,
7
+ formProps = _ref$formProps === void 0 ? {} : _ref$formProps,
8
+ _ref$listProps = _ref.listProps,
9
+ listProps = _ref$listProps === void 0 ? {} : _ref$listProps;
9
10
  return /*#__PURE__*/React.createElement(SplitView, null, /*#__PURE__*/React.createElement(LeftPanel, null, /*#__PURE__*/React.createElement(GroupsDataList, listProps)), /*#__PURE__*/React.createElement(RightPanel, null, /*#__PURE__*/React.createElement(GroupsForm, formProps)));
10
- };
11
-
12
- export default Groups;
11
+ };
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
2
- declare const GroupsDataList: () => JSX.Element;
3
- export default GroupsDataList;
1
+ import React from "react";
2
+ export interface GroupsDataListProps {
3
+ [key: string]: any;
4
+ }
5
+ export declare const GroupsDataList: React.FC<GroupsDataListProps>;
@@ -22,37 +22,28 @@ import { Select } from "@webiny/ui/Select";
22
22
  import SearchUI from "@webiny/app-admin/components/SearchUI";
23
23
  import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
24
24
  import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
25
- import { deserializeSorters, serializeSorters } from "../utils";
25
+ import { deserializeSorters } from "../utils";
26
26
  var t = i18n.ns("app-security/admin/groups/data-list");
27
27
  var SORTERS = [{
28
28
  label: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Newest to oldest"]))),
29
- sorters: {
30
- createdOn: "desc"
31
- }
29
+ sorter: "createdOn_DESC"
32
30
  }, {
33
31
  label: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Oldest to newest"]))),
34
- sorters: {
35
- createdOn: "asc"
36
- }
32
+ sorter: "createdOn_ASC"
37
33
  }, {
38
34
  label: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Name A-Z"]))),
39
- sorters: {
40
- name: "asc"
41
- }
35
+ sorter: "name_ASC"
42
36
  }, {
43
37
  label: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Name Z-A"]))),
44
- sorters: {
45
- name: "desc"
46
- }
38
+ sorter: "name_DESC"
47
39
  }];
48
-
49
- var GroupsDataList = function GroupsDataList() {
40
+ export var GroupsDataList = function GroupsDataList() {
50
41
  var _useState = useState(""),
51
42
  _useState2 = _slicedToArray(_useState, 2),
52
43
  filter = _useState2[0],
53
44
  setFilter = _useState2[1];
54
45
 
55
- var _useState3 = useState(serializeSorters(SORTERS[0].sorters)),
46
+ var _useState3 = useState(SORTERS[0].sorter),
56
47
  _useState4 = _slicedToArray(_useState3, 2),
57
48
  sort = _useState4[0],
58
49
  setSort = _useState4[1];
@@ -95,13 +86,12 @@ var GroupsDataList = function GroupsDataList() {
95
86
  return groups;
96
87
  }
97
88
 
98
- var _Object$entries = Object.entries(deserializeSorters(sort)),
99
- _Object$entries2 = _slicedToArray(_Object$entries, 1),
100
- _Object$entries2$ = _slicedToArray(_Object$entries2[0], 2),
101
- key = _Object$entries2$[0],
102
- value = _Object$entries2$[1];
89
+ var _deserializeSorters = deserializeSorters(sort),
90
+ _deserializeSorters2 = _slicedToArray(_deserializeSorters, 2),
91
+ key = _deserializeSorters2[0],
92
+ sortBy = _deserializeSorters2[1];
103
93
 
104
- return orderBy(groups, [key], [value]);
94
+ return orderBy(groups, [key], [sortBy]);
105
95
  }, [sort]);
106
96
  var deleteItem = useCallback(function (item) {
107
97
  showConfirmation( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -154,10 +144,10 @@ var GroupsDataList = function GroupsDataList() {
154
144
  label: t(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Sort by"])))
155
145
  }, SORTERS.map(function (_ref3) {
156
146
  var label = _ref3.label,
157
- sorters = _ref3.sorters;
147
+ sorter = _ref3.sorter;
158
148
  return /*#__PURE__*/React.createElement("option", {
159
149
  key: label,
160
- value: serializeSorters(sorters)
150
+ value: sorter
161
151
  }, label);
162
152
  })))));
163
153
  }, [sort]);
@@ -210,6 +200,4 @@ var GroupsDataList = function GroupsDataList() {
210
200
  })))));
211
201
  }));
212
202
  });
213
- };
214
-
215
- export default GroupsDataList;
203
+ };
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
2
- declare const GroupForm: () => JSX.Element;
3
- export default GroupForm;
1
+ import React from "react";
2
+ export interface GroupsFormProps {
3
+ [key: string]: any;
4
+ }
5
+ export declare const GroupsForm: React.FC<GroupsFormProps>;
@@ -36,8 +36,7 @@ var ButtonWrapper = /*#__PURE__*/styled("div", {
36
36
  display: "flex",
37
37
  justifyContent: "space-between"
38
38
  });
39
-
40
- var GroupForm = function GroupForm() {
39
+ export var GroupsForm = function GroupsForm() {
41
40
  var _useRouter = useRouter(),
42
41
  location = _useRouter.location,
43
42
  history = _useRouter.history;
@@ -229,6 +228,4 @@ var GroupForm = function GroupForm() {
229
228
  onClick: form.submit
230
229
  }, t(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["Save group"])))))));
231
230
  });
232
- };
233
-
234
- export default GroupForm;
231
+ };
@@ -1,5 +1,5 @@
1
- export declare const LIST_GROUPS: any;
2
- export declare const READ_GROUP: any;
3
- export declare const CREATE_GROUP: any;
4
- export declare const UPDATE_GROUP: any;
5
- export declare const DELETE_GROUP: any;
1
+ export declare const LIST_GROUPS: import("graphql").DocumentNode;
2
+ export declare const READ_GROUP: import("graphql").DocumentNode;
3
+ export declare const CREATE_GROUP: import("graphql").DocumentNode;
4
+ export declare const UPDATE_GROUP: import("graphql").DocumentNode;
5
+ export declare const DELETE_GROUP: import("graphql").DocumentNode;
@@ -1 +1 @@
1
- export { default as Groups } from "./Groups";
1
+ export * from "./Groups";
@@ -1 +1 @@
1
- export { default as Groups } from "./Groups";
1
+ export * from "./Groups";
@@ -1,2 +1,3 @@
1
- export declare const serializeSorters: (data: any) => any;
2
- export declare const deserializeSorters: (data: string) => Record<string, "asc" | "desc" | boolean>;
1
+ declare type SortTypes = "asc" | "desc";
2
+ export declare const deserializeSorters: (data: string) => [string, SortTypes];
3
+ export {};
package/ui/views/utils.js CHANGED
@@ -1,27 +1,14 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- export var serializeSorters = function serializeSorters(data) {
4
- if (!data) {
5
- return data;
6
- }
7
-
8
- var _Object$entries = Object.entries(data),
9
- _Object$entries2 = _slicedToArray(_Object$entries, 1),
10
- _Object$entries2$ = _slicedToArray(_Object$entries2[0], 2),
11
- key = _Object$entries2$[0],
12
- value = _Object$entries2$[1];
13
-
14
- return "".concat(key, ":").concat(value);
15
- };
16
2
  export var deserializeSorters = function deserializeSorters(data) {
17
3
  if (typeof data !== "string") {
18
4
  return data;
19
5
  }
20
6
 
21
- var _ref = data.split(":"),
7
+ var _ref = data.split("_"),
22
8
  _ref2 = _slicedToArray(_ref, 2),
23
- key = _ref2[0],
24
- value = _ref2[1];
9
+ field = _ref2[0],
10
+ orderBy = _ref2[1];
25
11
 
26
- return _defineProperty({}, key, value);
12
+ var order = String(orderBy).toLowerCase() === "asc" ? "asc" : "desc";
13
+ return [field, order];
27
14
  };