@webiny/app-security-access-management 0.0.0-unstable.fcdad0bc61 → 0.0.0-unstable.fdd9228b5d

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.
Files changed (114) hide show
  1. package/README.md +6 -4
  2. package/components/GroupAutocomplete/graphql.js +17 -16
  3. package/components/GroupAutocomplete/graphql.js.map +1 -1
  4. package/components/GroupAutocomplete/index.d.ts +3 -3
  5. package/components/GroupAutocomplete/index.js +12 -25
  6. package/components/GroupAutocomplete/index.js.map +1 -1
  7. package/components/GroupsMultiAutocomplete/graphql.d.ts +1 -0
  8. package/components/GroupsMultiAutocomplete/graphql.js +23 -0
  9. package/components/GroupsMultiAutocomplete/graphql.js.map +1 -0
  10. package/components/GroupsMultiAutocomplete/index.d.ts +5 -0
  11. package/components/GroupsMultiAutocomplete/index.js +19 -0
  12. package/components/GroupsMultiAutocomplete/index.js.map +1 -0
  13. package/components/NotAuthorizedError/NotAuthorizedError.d.ts +1 -1
  14. package/components/NotAuthorizedError/NotAuthorizedError.js +19 -67
  15. package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -1
  16. package/components/NotAuthorizedError/index.js +2 -12
  17. package/components/NotAuthorizedError/index.js.map +1 -1
  18. package/components/TeamAutocomplete/graphql.d.ts +1 -0
  19. package/components/TeamAutocomplete/graphql.js +18 -0
  20. package/components/TeamAutocomplete/graphql.js.map +1 -0
  21. package/components/TeamAutocomplete/index.d.ts +5 -0
  22. package/components/TeamAutocomplete/index.js +18 -0
  23. package/components/TeamAutocomplete/index.js.map +1 -0
  24. package/components/TeamsMultiAutocomplete/graphql.d.ts +1 -0
  25. package/components/TeamsMultiAutocomplete/graphql.js +23 -0
  26. package/components/TeamsMultiAutocomplete/graphql.js.map +1 -0
  27. package/components/TeamsMultiAutocomplete/index.d.ts +5 -0
  28. package/components/TeamsMultiAutocomplete/index.js +19 -0
  29. package/components/TeamsMultiAutocomplete/index.js.map +1 -0
  30. package/index.d.ts +1 -8
  31. package/index.js +79 -76
  32. package/index.js.map +1 -1
  33. package/package.json +22 -30
  34. package/plugins/constants.d.ts +1 -0
  35. package/plugins/constants.js +6 -11
  36. package/plugins/constants.js.map +1 -1
  37. package/plugins/index.d.ts +1 -1
  38. package/plugins/index.js +5 -19
  39. package/plugins/index.js.map +1 -1
  40. package/plugins/installation.d.ts +1 -1
  41. package/plugins/installation.js +77 -98
  42. package/plugins/installation.js.map +1 -1
  43. package/plugins/permissionRenderer/SecurityPermissions.d.ts +2 -2
  44. package/plugins/permissionRenderer/SecurityPermissions.js +110 -134
  45. package/plugins/permissionRenderer/SecurityPermissions.js.map +1 -1
  46. package/plugins/permissionRenderer/index.js +18 -35
  47. package/plugins/permissionRenderer/index.js.map +1 -1
  48. package/plugins/routes.d.ts +1 -1
  49. package/plugins/routes.js +24 -44
  50. package/plugins/routes.js.map +1 -1
  51. package/plugins/secureRouteError.d.ts +2 -2
  52. package/plugins/secureRouteError.js +8 -18
  53. package/plugins/secureRouteError.js.map +1 -1
  54. package/types.d.ts +14 -1
  55. package/types.js +2 -4
  56. package/types.js.map +1 -1
  57. package/ui/elements/GroupAutocompleteElement.d.ts +1 -1
  58. package/ui/elements/GroupAutocompleteElement.js +30 -62
  59. package/ui/elements/GroupAutocompleteElement.js.map +1 -1
  60. package/ui/elements/GroupsMultiAutocompleteElement.d.ts +6 -0
  61. package/ui/elements/GroupsMultiAutocompleteElement.js +32 -0
  62. package/ui/elements/GroupsMultiAutocompleteElement.js.map +1 -0
  63. package/ui/elements/TeamAutocompleteElement.d.ts +6 -0
  64. package/ui/elements/TeamAutocompleteElement.js +32 -0
  65. package/ui/elements/TeamAutocompleteElement.js.map +1 -0
  66. package/ui/views/ApiKeys/ApiKeyForm.d.ts +1 -1
  67. package/ui/views/ApiKeys/ApiKeyForm.js +143 -245
  68. package/ui/views/ApiKeys/ApiKeyForm.js.map +1 -1
  69. package/ui/views/ApiKeys/ApiKeys.d.ts +3 -3
  70. package/ui/views/ApiKeys/ApiKeys.js +10 -24
  71. package/ui/views/ApiKeys/ApiKeys.js.map +1 -1
  72. package/ui/views/ApiKeys/ApiKeysDataList.d.ts +1 -1
  73. package/ui/views/ApiKeys/ApiKeysDataList.js +115 -202
  74. package/ui/views/ApiKeys/ApiKeysDataList.js.map +1 -1
  75. package/ui/views/ApiKeys/graphql.d.ts +8 -0
  76. package/ui/views/ApiKeys/graphql.js +81 -25
  77. package/ui/views/ApiKeys/graphql.js.map +1 -1
  78. package/ui/views/ApiKeys/index.js +2 -17
  79. package/ui/views/ApiKeys/index.js.map +1 -1
  80. package/ui/views/ApiKeys/utils.d.ts +1 -1
  81. package/ui/views/ApiKeys/utils.js +4 -16
  82. package/ui/views/ApiKeys/utils.js.map +1 -1
  83. package/ui/views/Groups/Groups.d.ts +3 -3
  84. package/ui/views/Groups/Groups.js +10 -24
  85. package/ui/views/Groups/Groups.js.map +1 -1
  86. package/ui/views/Groups/GroupsDataList.d.ts +1 -1
  87. package/ui/views/Groups/GroupsDataList.js +120 -210
  88. package/ui/views/Groups/GroupsDataList.js.map +1 -1
  89. package/ui/views/Groups/GroupsForm.d.ts +1 -1
  90. package/ui/views/Groups/GroupsForm.js +155 -236
  91. package/ui/views/Groups/GroupsForm.js.map +1 -1
  92. package/ui/views/Groups/graphql.d.ts +8 -0
  93. package/ui/views/Groups/graphql.js +84 -25
  94. package/ui/views/Groups/graphql.js.map +1 -1
  95. package/ui/views/Groups/index.js +2 -17
  96. package/ui/views/Groups/index.js.map +1 -1
  97. package/ui/views/Teams/Teams.d.ts +8 -0
  98. package/ui/views/Teams/Teams.js +12 -0
  99. package/ui/views/Teams/Teams.js.map +1 -0
  100. package/ui/views/Teams/TeamsDataList.d.ts +5 -0
  101. package/ui/views/Teams/TeamsDataList.js +151 -0
  102. package/ui/views/Teams/TeamsDataList.js.map +1 -0
  103. package/ui/views/Teams/TeamsForm.d.ts +5 -0
  104. package/ui/views/Teams/TeamsForm.js +173 -0
  105. package/ui/views/Teams/TeamsForm.js.map +1 -0
  106. package/ui/views/Teams/graphql.d.ts +13 -0
  107. package/ui/views/Teams/graphql.js +89 -0
  108. package/ui/views/Teams/graphql.js.map +1 -0
  109. package/ui/views/Teams/index.d.ts +1 -0
  110. package/ui/views/Teams/index.js +3 -0
  111. package/ui/views/Teams/index.js.map +1 -0
  112. package/ui/views/utils.d.ts +1 -1
  113. package/ui/views/utils.js +4 -20
  114. package/ui/views/utils.js.map +1 -1
package/README.md CHANGED
@@ -51,7 +51,7 @@ A simple `Authenticator` React component (uses Amazon Cognito and AWS Amplify's
51
51
 
52
52
  ```tsx
53
53
  import React, { useEffect } from "react";
54
- import Auth from "@aws-amplify/auth";
54
+ import { Auth } from "@aws-amplify/auth";
55
55
  import { useSecurity, SecurityIdentity } from "@webiny/app-security";
56
56
 
57
57
  // Apart from the React component, we also configure the Auth class here.
@@ -66,9 +66,11 @@ Auth.configure({
66
66
  responseType: "token"
67
67
  }
68
68
  });
69
-
69
+ interface AuthenticatorProps {
70
+ children: React.ReactNode;
71
+ }
70
72
  // The `Authenticator` component.
71
- const Authenticator: React.FC = props => {
73
+ const Authenticator = (props: AuthenticatorProps) => {
72
74
  const { setIdentity } = useSecurity();
73
75
 
74
76
  useEffect(() => {
@@ -101,7 +103,7 @@ Finally, use the `useSecurity` React hook in any of your components:
101
103
  import React from "react";
102
104
  import { useSecurity } from "@webiny/app-security";
103
105
 
104
- const MyComponent: React.FC = () => {
106
+ const MyComponent = () => {
105
107
  const { identity } = useSecurity();
106
108
 
107
109
  if (identity) {
@@ -1,17 +1,18 @@
1
- "use strict";
1
+ import gql from "graphql-tag";
2
+ export const LIST_GROUPS = gql`
3
+ query listGroups {
4
+ security {
5
+ groups: listGroups {
6
+ data {
7
+ id
8
+ slug
9
+ name
10
+ description
11
+ createdOn
12
+ }
13
+ }
14
+ }
15
+ }
16
+ `;
2
17
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.LIST_GROUPS = void 0;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
- var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
13
-
14
- var _templateObject;
15
-
16
- var LIST_GROUPS = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n"])));
17
- exports.LIST_GROUPS = LIST_GROUPS;
18
+ //# sourceMappingURL=graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LIST_GROUPS","gql"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;;;;AAAA;;;;AAEO,IAAMA,WAAW,OAAGC,mBAAH,4XAAjB"}
1
+ {"version":3,"names":["gql","LIST_GROUPS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,WAAW,GAAGD,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
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>;
2
+ import type { AutoCompleteProps } from "@webiny/ui/AutoComplete";
3
+ type GroupAutocompleteProps = Partial<AutoCompleteProps>;
4
+ export declare const GroupAutocomplete: (props: GroupAutocompleteProps) => React.JSX.Element;
5
5
  export {};
@@ -1,31 +1,18 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.GroupAutocomplete = void 0;
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _AutoComplete = require("@webiny/ui/AutoComplete");
13
-
14
- var _graphql = require("./graphql");
15
-
16
- var _reactHooks = require("@apollo/react-hooks");
17
-
18
- var GroupAutocomplete = function GroupAutocomplete(props) {
19
- var _useQuery = (0, _reactHooks.useQuery)(_graphql.LIST_GROUPS),
20
- data = _useQuery.data,
21
- loading = _useQuery.loading;
22
-
23
- var options = loading || !data ? [] : data.security.groups.data;
24
- return /*#__PURE__*/_react.default.createElement(_AutoComplete.AutoComplete, Object.assign({}, props, {
1
+ import React from "react";
2
+ import { AutoComplete } from "@webiny/ui/AutoComplete";
3
+ import { LIST_GROUPS } from "./graphql";
4
+ import { useQuery } from "@apollo/react-hooks";
5
+ export const GroupAutocomplete = props => {
6
+ const {
7
+ data,
8
+ loading
9
+ } = useQuery(LIST_GROUPS);
10
+ const options = loading || !data ? [] : data.security.groups.data;
11
+ return /*#__PURE__*/React.createElement(AutoComplete, Object.assign({}, props, {
25
12
  options: options,
26
13
  valueProp: "id",
27
14
  value: loading ? undefined : props.value
28
15
  }));
29
16
  };
30
17
 
31
- exports.GroupAutocomplete = GroupAutocomplete;
18
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["GroupAutocomplete","props","useQuery","LIST_GROUPS","data","loading","options","security","groups","undefined","value"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { AutoComplete, AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupAutocompleteProps = Partial<AutoCompleteProps>;\nexport const GroupAutocomplete: React.FC<GroupAutocompleteProps> = props => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAGO,IAAMA,iBAAmD,GAAG,SAAtDA,iBAAsD,CAAAC,KAAK,EAAI;EACxE,gBAA0B,IAAAC,oBAAA,EAASC,oBAAT,CAA1B;EAAA,IAAQC,IAAR,aAAQA,IAAR;EAAA,IAAcC,OAAd,aAAcA,OAAd;;EAEA,IAAMC,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAZ,GAAmB,EAAnB,GAAwBA,IAAI,CAACG,QAAL,CAAcC,MAAd,CAAqBJ,IAA7D;EAEA,oBACI,6BAAC,0BAAD,oBACQH,KADR;IAEI,OAAO,EAAEK,OAFb;IAGI,SAAS,EAAE,IAHf;IAII,KAAK,EAAED,OAAO,GAAGI,SAAH,GAAeR,KAAK,CAACS;EAJvC,GADJ;AAQH,CAbM"}
1
+ {"version":3,"names":["React","AutoComplete","LIST_GROUPS","useQuery","GroupAutocomplete","props","data","loading","options","security","groups","createElement","Object","assign","valueProp","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { AutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupAutocompleteProps = Partial<AutoCompleteProps>;\nexport const GroupAutocomplete = (props: GroupAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,WAAW;AACpB,SAASC,QAAQ,QAAQ,qBAAqB;AAG9C,OAAO,MAAMC,iBAAiB,GAAIC,KAA6B,IAAK;EAChE,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,WAAW,CAAC;EAE/C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACIN,KAAA,CAAAW,aAAA,CAACV,YAAY,EAAAW,MAAA,CAAAC,MAAA,KACLR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,KAAK,EAAER,OAAO,GAAGS,SAAS,GAAGX,KAAK,CAACU;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const LIST_GROUPS: import("graphql").DocumentNode;
@@ -0,0 +1,23 @@
1
+ import gql from "graphql-tag";
2
+ export const LIST_GROUPS = gql`
3
+ query listGroups {
4
+ security {
5
+ groups: listGroups {
6
+ data {
7
+ id
8
+ slug
9
+ name
10
+ description
11
+ createdOn
12
+ }
13
+ error {
14
+ data
15
+ message
16
+ code
17
+ }
18
+ }
19
+ }
20
+ }
21
+ `;
22
+
23
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["gql","LIST_GROUPS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n error {\n data\n message\n code\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,WAAW,GAAGD,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { MultiAutoCompleteProps } from "@webiny/ui/AutoComplete";
3
+ type GroupsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;
4
+ export declare const GroupsMultiAutocomplete: (props: GroupsMultiAutocompleteProps) => React.JSX.Element;
5
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { MultiAutoComplete } from "@webiny/ui/AutoComplete";
3
+ import { LIST_GROUPS } from "./graphql";
4
+ import { useQuery } from "@apollo/react-hooks";
5
+ export const GroupsMultiAutocomplete = props => {
6
+ const {
7
+ data,
8
+ loading
9
+ } = useQuery(LIST_GROUPS);
10
+ const options = loading || !data ? [] : data.security.groups.data;
11
+ return /*#__PURE__*/React.createElement(MultiAutoComplete, Object.assign({}, props, {
12
+ options: options,
13
+ valueProp: "id",
14
+ unique: true,
15
+ value: loading ? undefined : props.value
16
+ }));
17
+ };
18
+
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","MultiAutoComplete","LIST_GROUPS","useQuery","GroupsMultiAutocomplete","props","data","loading","options","security","groups","createElement","Object","assign","valueProp","unique","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { MultiAutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { MultiAutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;\n\nexport const GroupsMultiAutocomplete = (props: GroupsMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n unique={true}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,WAAW;AACpB,SAASC,QAAQ,QAAQ,qBAAqB;AAI9C,OAAO,MAAMC,uBAAuB,GAAIC,KAAmC,IAAK;EAC5E,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,WAAW,CAAC;EAE/C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACIN,KAAA,CAAAW,aAAA,CAACV,iBAAiB,EAAAW,MAAA,CAAAC,MAAA,KACVR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,MAAM,EAAE,IAAK;IACbC,KAAK,EAAET,OAAO,GAAGU,SAAS,GAAGZ,KAAK,CAACW;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
1
  import * as React from "react";
2
- export declare const NotAuthorizedError: React.FC;
2
+ export declare const NotAuthorizedError: () => React.JSX.Element;
@@ -1,71 +1,23 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.NotAuthorizedError = void 0;
11
-
12
- var React = _interopRequireWildcard(require("react"));
13
-
14
- var _reactRouter = require("@webiny/react-router");
15
-
16
- var _emotion = require("emotion");
17
-
18
- var _styled = _interopRequireDefault(require("@emotion/styled"));
19
-
20
- var _reactHelmet = _interopRequireDefault(require("react-helmet"));
21
-
22
- var _SecureRouteError = _interopRequireDefault(require("./SecureRouteError.svg"));
23
-
24
- var _Typography = require("@webiny/ui/Typography");
25
-
26
- var ContentWrapper = /*#__PURE__*/(0, _styled.default)("div", {
27
- target: "e18nns4o0",
28
- label: "ContentWrapper"
29
- })({
30
- display: "block",
31
- paddingTop: "15%",
32
- textAlign: "center",
33
- margin: "auto"
34
- });
35
- var styles = {
36
- authErrorImgStyle: /*#__PURE__*/(0, _emotion.css)({
37
- width: "192px",
38
- paddingBottom: "24px"
39
- }, "label:authErrorImgStyle;"),
40
- bodyStyle: /*#__PURE__*/(0, _emotion.css)({
41
- color: "var(--mdc-theme-text-primary-on-background)",
42
- display: "block"
43
- }, "label:bodyStyle;"),
44
- linkStyle: /*#__PURE__*/(0, _emotion.css)({
45
- textDecoration: "none",
46
- "&:hover": {
47
- textDecoration: "none"
48
- }
49
- }, "label:linkStyle;")
50
- };
51
-
52
- var NotAuthorizedError = function NotAuthorizedError() {
53
- return /*#__PURE__*/React.createElement(ContentWrapper, null, /*#__PURE__*/React.createElement(_reactHelmet.default, {
1
+ import * as React from "react";
2
+ import Helmet from "react-helmet";
3
+ import authErrorImg from "./SecureRouteError.svg";
4
+ import { Link, Text } from "@webiny/admin-ui";
5
+ export const NotAuthorizedError = () => {
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: "wby-flex-1"
8
+ }, /*#__PURE__*/React.createElement("div", {
9
+ className: "wby-h-full wby-flex wby-flex-col wby-items-center wby-justify-center wby-text-center wby-gap-xs"
10
+ }, /*#__PURE__*/React.createElement(Helmet, {
54
11
  title: "Not authorized"
55
12
  }), /*#__PURE__*/React.createElement("img", {
56
- className: styles.authErrorImgStyle,
57
- src: _SecureRouteError.default,
58
- alt: "Not Authorized"
59
- }), /*#__PURE__*/React.createElement(_Typography.Typography, {
60
- use: "body1",
61
- className: styles.bodyStyle
62
- }, "You are not authorized to view this route."), /*#__PURE__*/React.createElement(_Typography.Typography, {
63
- use: "body1",
64
- className: styles.bodyStyle
65
- }, "Please contact your administrator to request access."), /*#__PURE__*/React.createElement(_reactRouter.Link, {
66
- to: "/",
67
- className: styles.linkStyle
68
- }, "Take me back."));
13
+ width: 200,
14
+ height: 200,
15
+ src: authErrorImg,
16
+ alt: "Not Authorized",
17
+ className: "wby-mb-xl"
18
+ }), /*#__PURE__*/React.createElement(Text, null, "You are not authorized to view this route."), /*#__PURE__*/React.createElement(Text, null, "Please contact your administrator to request access."), /*#__PURE__*/React.createElement(Link, {
19
+ to: "/"
20
+ }, "Take me back.")));
69
21
  };
70
22
 
71
- exports.NotAuthorizedError = NotAuthorizedError;
23
+ //# sourceMappingURL=NotAuthorizedError.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ContentWrapper","styled","display","paddingTop","textAlign","margin","styles","authErrorImgStyle","css","width","paddingBottom","bodyStyle","color","linkStyle","textDecoration","NotAuthorizedError","authErrorImg"],"sources":["NotAuthorizedError.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Link } from \"@webiny/react-router\";\nimport { css } from \"emotion\";\nimport styled from \"@emotion/styled\";\nimport Helmet from \"react-helmet\";\nimport authErrorImg from \"./SecureRouteError.svg\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nconst ContentWrapper = styled(\"div\")({\n display: \"block\",\n paddingTop: \"15%\",\n textAlign: \"center\",\n margin: \"auto\"\n});\n\nconst styles = {\n authErrorImgStyle: css({\n width: \"192px\",\n paddingBottom: \"24px\"\n }),\n bodyStyle: css({\n color: \"var(--mdc-theme-text-primary-on-background)\",\n display: \"block\"\n }),\n linkStyle: css({\n textDecoration: \"none\",\n \"&:hover\": {\n textDecoration: \"none\"\n }\n })\n};\n\nexport const NotAuthorizedError: React.FC = () => {\n return (\n <ContentWrapper>\n <Helmet title={\"Not authorized\"} />\n\n <img className={styles.authErrorImgStyle} src={authErrorImg} alt=\"Not Authorized\" />\n\n <Typography use={\"body1\"} className={styles.bodyStyle}>\n You are not authorized to view this route.\n </Typography>\n\n <Typography use={\"body1\"} className={styles.bodyStyle}>\n Please contact your administrator to request access.\n </Typography>\n\n <Link to=\"/\" className={styles.linkStyle}>\n Take me back.\n </Link>\n </ContentWrapper>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,cAAc,oBAAGC,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EACjCC,OAAO,EAAE,OADwB;EAEjCC,UAAU,EAAE,KAFqB;EAGjCC,SAAS,EAAE,QAHsB;EAIjCC,MAAM,EAAE;AAJyB,CAAjB,CAApB;AAOA,IAAMC,MAAM,GAAG;EACXC,iBAAiB,eAAE,IAAAC,YAAA,EAAI;IACnBC,KAAK,EAAE,OADY;IAEnBC,aAAa,EAAE;EAFI,CAAJ,6BADR;EAKXC,SAAS,eAAE,IAAAH,YAAA,EAAI;IACXI,KAAK,EAAE,6CADI;IAEXV,OAAO,EAAE;EAFE,CAAJ,qBALA;EASXW,SAAS,eAAE,IAAAL,YAAA,EAAI;IACXM,cAAc,EAAE,MADL;IAEX,WAAW;MACPA,cAAc,EAAE;IADT;EAFA,CAAJ;AATA,CAAf;;AAiBO,IAAMC,kBAA4B,GAAG,SAA/BA,kBAA+B,GAAM;EAC9C,oBACI,oBAAC,cAAD,qBACI,oBAAC,oBAAD;IAAQ,KAAK,EAAE;EAAf,EADJ,eAGI;IAAK,SAAS,EAAET,MAAM,CAACC,iBAAvB;IAA0C,GAAG,EAAES,yBAA/C;IAA6D,GAAG,EAAC;EAAjE,EAHJ,eAKI,oBAAC,sBAAD;IAAY,GAAG,EAAE,OAAjB;IAA0B,SAAS,EAAEV,MAAM,CAACK;EAA5C,gDALJ,eASI,oBAAC,sBAAD;IAAY,GAAG,EAAE,OAAjB;IAA0B,SAAS,EAAEL,MAAM,CAACK;EAA5C,0DATJ,eAaI,oBAAC,iBAAD;IAAM,EAAE,EAAC,GAAT;IAAa,SAAS,EAAEL,MAAM,CAACO;EAA/B,mBAbJ,CADJ;AAmBH,CApBM"}
1
+ {"version":3,"names":["React","Helmet","authErrorImg","Link","Text","NotAuthorizedError","createElement","className","title","width","height","src","alt","to"],"sources":["NotAuthorizedError.tsx"],"sourcesContent":["import * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport authErrorImg from \"./SecureRouteError.svg\";\nimport { Link, Text } from \"@webiny/admin-ui\";\n\nexport const NotAuthorizedError = () => {\n return (\n <div className={\"wby-flex-1\"}>\n <div\n className={\n \"wby-h-full wby-flex wby-flex-col wby-items-center wby-justify-center wby-text-center wby-gap-xs\"\n }\n >\n <Helmet title={\"Not authorized\"} />\n\n <img\n width={200}\n height={200}\n src={authErrorImg}\n alt=\"Not Authorized\"\n className={\"wby-mb-xl\"}\n />\n <Text>You are not authorized to view this route.</Text>\n <Text>Please contact your administrator to request access.</Text>\n <Link to=\"/\">Take me back.</Link>\n </div>\n </div>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,YAAY;AACnB,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAE7C,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EACpC,oBACIL,KAAA,CAAAM,aAAA;IAAKC,SAAS,EAAE;EAAa,gBACzBP,KAAA,CAAAM,aAAA;IACIC,SAAS,EACL;EACH,gBAEDP,KAAA,CAAAM,aAAA,CAACL,MAAM;IAACO,KAAK,EAAE;EAAiB,CAAE,CAAC,eAEnCR,KAAA,CAAAM,aAAA;IACIG,KAAK,EAAE,GAAI;IACXC,MAAM,EAAE,GAAI;IACZC,GAAG,EAAET,YAAa;IAClBU,GAAG,EAAC,gBAAgB;IACpBL,SAAS,EAAE;EAAY,CAC1B,CAAC,eACFP,KAAA,CAAAM,aAAA,CAACF,IAAI,QAAC,4CAAgD,CAAC,eACvDJ,KAAA,CAAAM,aAAA,CAACF,IAAI,QAAC,sDAA0D,CAAC,eACjEJ,KAAA,CAAAM,aAAA,CAACH,IAAI;IAACU,EAAE,EAAC;EAAG,GAAC,eAAmB,CAC/B,CACJ,CAAC;AAEd,CAAC","ignoreList":[]}
@@ -1,13 +1,3 @@
1
- "use strict";
1
+ export { NotAuthorizedError } from "./NotAuthorizedError";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "NotAuthorizedError", {
7
- enumerable: true,
8
- get: function get() {
9
- return _NotAuthorizedError.NotAuthorizedError;
10
- }
11
- });
12
-
13
- var _NotAuthorizedError = require("./NotAuthorizedError");
3
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { NotAuthorizedError } from \"./NotAuthorizedError\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
1
+ {"version":3,"names":["NotAuthorizedError"],"sources":["index.ts"],"sourcesContent":["export { NotAuthorizedError } from \"./NotAuthorizedError\";\n"],"mappings":"AAAA,SAASA,kBAAkB","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const LIST_TEAMS: import("graphql").DocumentNode;
@@ -0,0 +1,18 @@
1
+ import gql from "graphql-tag";
2
+ export const LIST_TEAMS = gql`
3
+ query listTeams {
4
+ security {
5
+ teams: listTeams {
6
+ data {
7
+ id
8
+ slug
9
+ name
10
+ description
11
+ createdOn
12
+ }
13
+ }
14
+ }
15
+ }
16
+ `;
17
+
18
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["gql","LIST_TEAMS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_TEAMS = gql`\n query listTeams {\n security {\n teams: listTeams {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,UAAU,GAAGD,GAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { AutoCompleteProps } from "@webiny/ui/AutoComplete";
3
+ type TeamAutocompleteProps = Partial<AutoCompleteProps>;
4
+ export declare const TeamAutocomplete: (props: TeamAutocompleteProps) => React.JSX.Element;
5
+ export {};
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { AutoComplete } from "@webiny/ui/AutoComplete";
3
+ import { LIST_TEAMS } from "./graphql";
4
+ import { useQuery } from "@apollo/react-hooks";
5
+ export const TeamAutocomplete = props => {
6
+ const {
7
+ data,
8
+ loading
9
+ } = useQuery(LIST_TEAMS);
10
+ const options = loading || !data ? [] : data.security.teams.data;
11
+ return /*#__PURE__*/React.createElement(AutoComplete, Object.assign({}, props, {
12
+ options: options,
13
+ valueProp: "id",
14
+ value: loading ? undefined : props.value
15
+ }));
16
+ };
17
+
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","AutoComplete","LIST_TEAMS","useQuery","TeamAutocomplete","props","data","loading","options","security","teams","createElement","Object","assign","valueProp","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { AutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_TEAMS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamAutocompleteProps = Partial<AutoCompleteProps>;\nexport const TeamAutocomplete = (props: TeamAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_TEAMS);\n\n const options = loading || !data ? [] : data.security.teams.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,UAAU;AACnB,SAASC,QAAQ,QAAQ,qBAAqB;AAG9C,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAC9D,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,UAAU,CAAC;EAE9C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,KAAK,CAACJ,IAAI;EAEhE,oBACIN,KAAA,CAAAW,aAAA,CAACV,YAAY,EAAAW,MAAA,CAAAC,MAAA,KACLR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,KAAK,EAAER,OAAO,GAAGS,SAAS,GAAGX,KAAK,CAACU;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const LIST_TEAMS: import("graphql").DocumentNode;
@@ -0,0 +1,23 @@
1
+ import gql from "graphql-tag";
2
+ export const LIST_TEAMS = gql`
3
+ query listTeams {
4
+ security {
5
+ teams: listTeams {
6
+ data {
7
+ id
8
+ slug
9
+ name
10
+ description
11
+ createdOn
12
+ }
13
+ error {
14
+ data
15
+ message
16
+ code
17
+ }
18
+ }
19
+ }
20
+ }
21
+ `;
22
+
23
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["gql","LIST_TEAMS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_TEAMS = gql`\n query listTeams {\n security {\n teams: listTeams {\n data {\n id\n slug\n name\n description\n createdOn\n }\n error {\n data\n message\n code\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,OAAO,MAAMC,UAAU,GAAGD,GAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { MultiAutoCompleteProps } from "@webiny/ui/AutoComplete";
3
+ type TeamsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;
4
+ export declare const TeamsMultiAutocomplete: (props: TeamsMultiAutocompleteProps) => React.JSX.Element;
5
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { MultiAutoComplete } from "@webiny/ui/AutoComplete";
3
+ import { LIST_TEAMS } from "./graphql";
4
+ import { useQuery } from "@apollo/react-hooks";
5
+ export const TeamsMultiAutocomplete = props => {
6
+ const {
7
+ data,
8
+ loading
9
+ } = useQuery(LIST_TEAMS);
10
+ const options = loading || !data ? [] : data.security.teams.data;
11
+ return /*#__PURE__*/React.createElement(MultiAutoComplete, Object.assign({}, props, {
12
+ options: options,
13
+ valueProp: "id",
14
+ unique: true,
15
+ value: loading ? undefined : props.value
16
+ }));
17
+ };
18
+
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","MultiAutoComplete","LIST_TEAMS","useQuery","TeamsMultiAutocomplete","props","data","loading","options","security","teams","createElement","Object","assign","valueProp","unique","value","undefined"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { MultiAutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { MultiAutoComplete } from \"@webiny/ui/AutoComplete\";\nimport { LIST_TEAMS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;\n\nexport const TeamsMultiAutocomplete = (props: TeamsMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_TEAMS);\n\n const options = loading || !data ? [] : data.security.teams.data;\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n unique={true}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,UAAU;AACnB,SAASC,QAAQ,QAAQ,qBAAqB;AAI9C,OAAO,MAAMC,sBAAsB,GAAIC,KAAkC,IAAK;EAC1E,MAAM;IAAEC,IAAI;IAAEC;EAAQ,CAAC,GAAGJ,QAAQ,CAACD,UAAU,CAAC;EAE9C,MAAMM,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,KAAK,CAACJ,IAAI;EAEhE,oBACIN,KAAA,CAAAW,aAAA,CAACV,iBAAiB,EAAAW,MAAA,CAAAC,MAAA,KACVR,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBM,SAAS,EAAE,IAAK;IAChBC,MAAM,EAAE,IAAK;IACbC,KAAK,EAAET,OAAO,GAAGU,SAAS,GAAGZ,KAAK,CAACW;EAAM,EAC5C,CAAC;AAEV,CAAC","ignoreList":[]}
package/index.d.ts CHANGED
@@ -1,9 +1,2 @@
1
1
  import React from "react";
2
- /**
3
- * TODO @ts-refactor
4
- * Find out why is there empty default export
5
- */
6
- declare const _default: () => never[];
7
- export default _default;
8
- export declare const AccessManagementExtension: () => JSX.Element;
9
- export declare const AccessManagement: React.MemoExoticComponent<() => JSX.Element>;
2
+ export declare const AccessManagement: React.MemoExoticComponent<() => React.JSX.Element>;