@basiq/connect-auth 0.1.7 → 0.1.10

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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -1
  3. package/dist/App.d.ts +3 -0
  4. package/dist/actions/actions.d.ts +40 -0
  5. package/dist/components/BasiqConnect.d.ts +5 -0
  6. package/dist/components/modals/LoadingModal.d.ts +7 -0
  7. package/{src/components/modals/index.ts → dist/components/modals/index.d.ts} +1 -1
  8. package/dist/components/pages/AuthScreen.d.ts +9 -0
  9. package/dist/components/pages/NotFound.d.ts +5 -0
  10. package/dist/components/pages/Page.d.ts +18 -0
  11. package/dist/components/pages/StartScreen.d.ts +10 -0
  12. package/{src/components/pages/index.ts → dist/components/pages/index.d.ts} +4 -4
  13. package/dist/components/ui/Button.d.ts +9 -0
  14. package/dist/components/ui/Modal.d.ts +9 -0
  15. package/dist/components/ui/icon.d.ts +6 -0
  16. package/{src/components/ui/index.ts → dist/components/ui/index.d.ts} +1 -1
  17. package/dist/connect-auth.cjs.development.js +1566 -0
  18. package/dist/connect-auth.cjs.development.js.map +1 -0
  19. package/dist/connect-auth.cjs.production.min.js +2 -0
  20. package/dist/connect-auth.cjs.production.min.js.map +1 -0
  21. package/dist/connect-auth.esm.js +1558 -0
  22. package/dist/connect-auth.esm.js.map +1 -0
  23. package/dist/helpers/constants.d.ts +2 -0
  24. package/dist/helpers/hookUtils.d.ts +2 -0
  25. package/{src/helpers/index.ts → dist/helpers/index.d.ts} +3 -3
  26. package/dist/helpers/utils.d.ts +4 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +8 -0
  29. package/dist/locales/i18n.d.ts +36 -0
  30. package/dist/setupTests.d.ts +1 -0
  31. package/dist/styledComponents/base.d.ts +4 -0
  32. package/dist/styledComponents/breakpoints.d.ts +15 -0
  33. package/{src/styledComponents/index.ts → dist/styledComponents/index.d.ts} +4 -4
  34. package/dist/styledComponents/pages/auth.d.ts +10 -0
  35. package/dist/styledComponents/pages/basic.d.ts +23 -0
  36. package/{src/styledComponents/pages/index.ts → dist/styledComponents/pages/index.d.ts} +4 -4
  37. package/dist/styledComponents/pages/notFound.d.ts +9 -0
  38. package/dist/styledComponents/pages/start.d.ts +1 -0
  39. package/dist/styledComponents/styles.d.ts +2 -0
  40. package/dist/styledComponents/theme.d.ts +45 -0
  41. package/dist/styledComponents/ui/basic.d.ts +10 -0
  42. package/dist/styledComponents/ui/button.d.ts +9 -0
  43. package/{src/styledComponents/ui/index.ts → dist/styledComponents/ui/index.d.ts} +3 -3
  44. package/dist/styledComponents/ui/modals.d.ts +7 -0
  45. package/package.json +56 -89
  46. package/.babelrc +0 -3
  47. package/.eslintrc.json +0 -47
  48. package/.prettierrc +0 -12
  49. package/config-overrides.js +0 -12
  50. package/index.js +0 -1
  51. package/public/favicon.ico +0 -0
  52. package/public/index.html +0 -43
  53. package/public/logo192.png +0 -0
  54. package/public/logo512.png +0 -0
  55. package/public/manifest.json +0 -25
  56. package/public/robots.txt +0 -3
  57. package/src/App.css +0 -38
  58. package/src/App.test.tsx +0 -9
  59. package/src/App.tsx +0 -81
  60. package/src/actions/actions.ts +0 -71
  61. package/src/components/modals/LoadingModal.tsx +0 -28
  62. package/src/components/pages/AuthScreen.tsx +0 -94
  63. package/src/components/pages/NotFound.tsx +0 -44
  64. package/src/components/pages/Page.tsx +0 -46
  65. package/src/components/pages/StartScreen.tsx +0 -77
  66. package/src/components/ui/Button.tsx +0 -24
  67. package/src/components/ui/Modal.tsx +0 -29
  68. package/src/components/ui/icon.tsx +0 -18
  69. package/src/fonts/Mark-W1G-Bold.otf +0 -0
  70. package/src/fonts/Mark-W1G-Book.otf +0 -0
  71. package/src/fonts.d.ts +0 -1
  72. package/src/helpers/constants.ts +0 -3
  73. package/src/helpers/hookUtils.ts +0 -8
  74. package/src/helpers/utils.ts +0 -12
  75. package/src/images/back.svg +0 -8
  76. package/src/images/error.svg +0 -10
  77. package/src/images/loading_indicator.svg +0 -14
  78. package/src/index.css +0 -11
  79. package/src/index.tsx +0 -28
  80. package/src/locales/en/translation.json +0 -28
  81. package/src/locales/i18n.ts +0 -27
  82. package/src/logo.svg +0 -1
  83. package/src/react-app-env.d.ts +0 -1
  84. package/src/react-i18next.d.ts +0 -9
  85. package/src/reportWebVitals.ts +0 -15
  86. package/src/setupTests.ts +0 -5
  87. package/src/styled.d.ts +0 -6
  88. package/src/styledComponents/base.ts +0 -73
  89. package/src/styledComponents/breakpoints.ts +0 -32
  90. package/src/styledComponents/pages/auth.ts +0 -49
  91. package/src/styledComponents/pages/basic.ts +0 -126
  92. package/src/styledComponents/pages/notFound.ts +0 -70
  93. package/src/styledComponents/pages/start.ts +0 -6
  94. package/src/styledComponents/styles.ts +0 -25
  95. package/src/styledComponents/theme.ts +0 -58
  96. package/src/styledComponents/ui/basic.ts +0 -96
  97. package/src/styledComponents/ui/button.ts +0 -112
  98. package/src/styledComponents/ui/modals.ts +0 -48
  99. package/tsconfig.json +0 -21
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 dushajni
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,2 +1,60 @@
1
- # BASIQ CONNECT AUTH
1
+ # BASIQ CONNECT COMPONENT
2
2
 
3
+ The Basiq Connect Auth is a ReactJS UI component exposed to partners who prefer to implement the auth flow as an external component with an SMS OTP built in. When rendered, it will take the user through an SMS OTP flow and then proceed to redirect them to the [Basiq Consent UI](https://api.basiq.io/docs/consent-ui) flow to connect their accounts.
4
+
5
+ Note: This has been offered as interim solution for partners who require access to v3 of the API before we have released the upgrades to `https://connect.basiq.io/`. If you have any questions regarding this please reach out to support@basiq.io.
6
+
7
+ ## Setup
8
+
9
+ 1. Install `@basiq/connect-auth` and import the component
10
+
11
+ ```
12
+ $ npm install @basiq/basiq-connect-control
13
+ ```
14
+
15
+ ```js
16
+ import { BasiqConnect } from "@basiq/connect-auth";
17
+ ```
18
+
19
+ 2. Generate a new Auth Link, and retrieve the auth link ID from the public URL that is returned.
20
+
21
+ ```js
22
+
23
+ try {
24
+ const { data } = await axios.get(
25
+ `https://au-api.basiq.io/users/{userId}/auth_link`,
26
+ {
27
+ method: 'post',
28
+ headers: {
29
+ Authorization: `Bearer ${YOUR_SERVER_ACCESS_TOKEN}`,
30
+ Accept: 'application/json',
31
+ 'Content-Type': 'application/json',
32
+ },
33
+ }
34
+ );
35
+
36
+ let auth_id = data.links.public.replace('https://connect.basiq.io/','');
37
+
38
+ return auth_id;
39
+
40
+ } catch (error) {
41
+ console.log(error)
42
+ }
43
+
44
+ ```
45
+
46
+ 3. Drop the component in your code on the page you wish to call it. The component will retrieve the auth_id from the URL so failing to include it there will result in an error. **Note** that the component is full page and will eventually handle the redirect to the Basiq Consent UI, so it should be rendered on it's own page (or conditionally, after appending an auth_link ID)
47
+
48
+
49
+ ```jsx
50
+
51
+ // Component rendered at /auth-link/:auth_id
52
+
53
+ export default function Auth() {
54
+ return (
55
+ <main>
56
+ <BasiqConnect />
57
+ </main>
58
+ );
59
+ }
60
+ ```
package/dist/App.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { IBCProps } from "./components/BasiqConnect";
2
+ declare function App(props: IBCProps): JSX.Element;
3
+ export default App;
@@ -0,0 +1,40 @@
1
+ export declare const verifySmsCode: ({ authRequestId, smsCode, test }: {
2
+ authRequestId: string;
3
+ smsCode: string;
4
+ test?: boolean;
5
+ }) => Promise<{
6
+ data: any;
7
+ headers: Headers;
8
+ statusCode: number;
9
+ ok: boolean;
10
+ error?: undefined;
11
+ } | {
12
+ headers: Headers;
13
+ statusCode: number;
14
+ error: string;
15
+ ok: boolean;
16
+ data?: undefined;
17
+ }>;
18
+ export declare const authUser: ({ authRequestId, method, test }: {
19
+ authRequestId: string;
20
+ method?: 'POST' | 'GET';
21
+ test?: boolean;
22
+ }) => Promise<{
23
+ data: any;
24
+ headers: Headers;
25
+ statusCode: number;
26
+ ok: boolean;
27
+ error?: undefined;
28
+ } | {
29
+ headers: Headers;
30
+ statusCode: number;
31
+ error: any;
32
+ ok: boolean;
33
+ data?: undefined;
34
+ } | {
35
+ statusCode: number;
36
+ error: string;
37
+ ok: boolean;
38
+ data?: undefined;
39
+ headers?: undefined;
40
+ }>;
@@ -0,0 +1,5 @@
1
+ import '../locales/i18n';
2
+ export interface IBCProps {
3
+ test?: boolean;
4
+ }
5
+ export declare function BasiqConnect(props: IBCProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ interface IProps {
2
+ isOpen: boolean;
3
+ disableTransparency?: boolean;
4
+ loadingText?: string;
5
+ }
6
+ declare function LoadingModal(props: IProps): JSX.Element;
7
+ export default LoadingModal;
@@ -1 +1 @@
1
- export { default as LoadingModal } from './LoadingModal';
1
+ export { default as LoadingModal } from './LoadingModal';
@@ -0,0 +1,9 @@
1
+ interface IProps {
2
+ shadow: boolean;
3
+ onBack: () => void;
4
+ number: string;
5
+ authRequestId: string;
6
+ test?: boolean;
7
+ }
8
+ declare function AuthScreen({ onBack, number, authRequestId, shadow, test }: IProps): JSX.Element;
9
+ export default AuthScreen;
@@ -0,0 +1,5 @@
1
+ interface IProps {
2
+ messageCode?: string;
3
+ }
4
+ declare function NotFound({ messageCode }: IProps): JSX.Element;
5
+ export default NotFound;
@@ -0,0 +1,18 @@
1
+ import { ReactElement } from 'react';
2
+ import { ButtonType } from '../ui/Button';
3
+ interface IProps {
4
+ buttons?: IButton[];
5
+ children: ReactElement;
6
+ title?: string | ReactElement;
7
+ subTitle?: string;
8
+ shadow: boolean;
9
+ onBack?: () => void;
10
+ }
11
+ export interface IButton {
12
+ label: string;
13
+ onClick: () => void;
14
+ buttonType?: ButtonType;
15
+ disabled?: boolean;
16
+ }
17
+ declare function Page(props: IProps): JSX.Element;
18
+ export default Page;
@@ -0,0 +1,10 @@
1
+ interface IProps {
2
+ onContinue: () => void;
3
+ showErrorScreen: (code: string) => void;
4
+ shadow: boolean;
5
+ appName: string;
6
+ authRequestId?: string;
7
+ test?: boolean;
8
+ }
9
+ declare function StartScreen(props: IProps): JSX.Element;
10
+ export default StartScreen;
@@ -1,4 +1,4 @@
1
- export { default as Page } from './Page';
2
- export { default as NotFound } from './NotFound';
3
- export { default as StartScreen } from './StartScreen';
4
- export { default as AuthScreen } from './AuthScreen';
1
+ export { default as Page } from './Page';
2
+ export { default as NotFound } from './NotFound';
3
+ export { default as StartScreen } from './StartScreen';
4
+ export { default as AuthScreen } from './AuthScreen';
@@ -0,0 +1,9 @@
1
+ export declare type ButtonType = 'secondary' | 'tiny' | 'link' | 'back';
2
+ interface Props {
3
+ onClick: () => void;
4
+ label: string;
5
+ buttonType?: ButtonType;
6
+ disabled?: boolean;
7
+ }
8
+ declare function Button(props: Props): JSX.Element;
9
+ export default Button;
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ interface IProps {
3
+ children: ReactElement;
4
+ onClose?: () => void;
5
+ isOpen: boolean;
6
+ disableTransparency: boolean;
7
+ }
8
+ declare function Modal(props: IProps): JSX.Element;
9
+ export default Modal;
@@ -0,0 +1,6 @@
1
+ interface IProps {
2
+ rotating: boolean;
3
+ img: string;
4
+ }
5
+ declare function Icon(props: IProps): JSX.Element;
6
+ export default Icon;
@@ -1 +1 @@
1
- export { default as Button } from './Button';
1
+ export { default as Button } from './Button';