@things-factory/auth-ui 8.0.0-beta.1 → 8.0.0-beta.4

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 (59) hide show
  1. package/package.json +4 -4
  2. package/client/auth-style-sign.ts +0 -194
  3. package/client/bootstrap.ts +0 -51
  4. package/client/components/abstract-auth-page.ts +0 -301
  5. package/client/components/abstract-password-reset.ts +0 -163
  6. package/client/components/abstract-sign.ts +0 -127
  7. package/client/components/change-password.ts +0 -153
  8. package/client/components/contact-us.ts +0 -116
  9. package/client/components/create-domain-popup.ts +0 -141
  10. package/client/components/create-role.ts +0 -123
  11. package/client/components/create-user.ts +0 -117
  12. package/client/components/credential-manager.ts +0 -64
  13. package/client/components/delete-user-popup.ts +0 -117
  14. package/client/components/domain-switch.ts +0 -127
  15. package/client/components/invite-customer.ts +0 -104
  16. package/client/components/invite-user.ts +0 -104
  17. package/client/components/my-login-history.ts +0 -101
  18. package/client/components/ownership-transfer-popup.ts +0 -110
  19. package/client/components/partner-info-card.ts +0 -89
  20. package/client/components/partner-role-editor.ts +0 -153
  21. package/client/components/profile-component.ts +0 -392
  22. package/client/components/role-edit-form.ts +0 -92
  23. package/client/components/role-privilege-editor.ts +0 -268
  24. package/client/components/role-selector.ts +0 -102
  25. package/client/components/user-role-editor.ts +0 -499
  26. package/client/constants/application.ts +0 -9
  27. package/client/constants/index.ts +0 -1
  28. package/client/entries/auth/activate.ts +0 -272
  29. package/client/entries/auth/checkin.ts +0 -190
  30. package/client/entries/auth/forgot-password.ts +0 -112
  31. package/client/entries/auth/reset-password.ts +0 -22
  32. package/client/entries/auth/result.ts +0 -193
  33. package/client/entries/auth/signin.ts +0 -18
  34. package/client/entries/auth/signup.ts +0 -115
  35. package/client/entries/auth/unlock-user.ts +0 -22
  36. package/client/entries/oauth2/oauth2-decision-error-page.ts +0 -50
  37. package/client/entries/oauth2/oauth2-decision-page.ts +0 -196
  38. package/client/entries/public/home.ts +0 -246
  39. package/client/index.ts +0 -124
  40. package/client/pages/app-binding/app-binding.ts +0 -423
  41. package/client/pages/app-binding/app-bindings.ts +0 -171
  42. package/client/pages/appliance/appliance.ts +0 -452
  43. package/client/pages/appliance/home.ts +0 -177
  44. package/client/pages/appliance/register.ts +0 -183
  45. package/client/pages/application/application.ts +0 -428
  46. package/client/pages/application/applications.ts +0 -182
  47. package/client/pages/application/register.ts +0 -211
  48. package/client/pages/attribute/attribute-set-item-list.ts +0 -237
  49. package/client/pages/attribute/attribute-set-management.ts +0 -282
  50. package/client/pages/auth-provider/auth-provider-management.ts +0 -381
  51. package/client/pages/domain/domain-management.ts +0 -410
  52. package/client/pages/partner/partner-management.ts +0 -112
  53. package/client/pages/profile.ts +0 -32
  54. package/client/pages/role/role-management.ts +0 -134
  55. package/client/pages/user/user-management.ts +0 -223
  56. package/client/route.ts +0 -67
  57. package/client/themes/auth-theme.css +0 -65
  58. package/client/utils/password-rule.ts +0 -37
  59. package/server/index.ts +0 -0
@@ -1,223 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
-
3
- import '@things-factory/component-ui'
4
- import '../../components/invite-user'
5
- import '../../components/ownership-transfer-popup'
6
- import '../../components/user-role-editor'
7
- import '../../components/create-user'
8
-
9
- import gql from 'graphql-tag'
10
- import { css, html } from 'lit'
11
- import { customElement, property, query } from 'lit/decorators.js'
12
-
13
- import { client, gqlContext } from '@operato/graphql'
14
- import { i18next, localize } from '@operato/i18n'
15
- import { PageView } from '@operato/shell'
16
- import { OxPrompt } from '@operato/popup/ox-prompt.js'
17
-
18
- @customElement('user-management')
19
- export class UserManagement extends localize(i18next)(PageView) {
20
- static styles = [
21
- css`
22
- :host {
23
- display: flex;
24
- flex-direction: column;
25
- background-color: var(--md-sys-color-background);
26
- padding: var(--spacing-large);
27
- overflow: auto;
28
- }
29
-
30
- @media screen and (max-width: 600px) {
31
- :host {
32
- padding: var(--spacing-small);
33
- }
34
- }
35
- `
36
- ]
37
-
38
- @property({ type: Array }) domainUsers: any[] = []
39
- @property({ type: Object }) owner: any
40
- @property({ type: String }) currentTab: string = ''
41
- @property({ type: Boolean }) passwordResettable: boolean = false
42
- @property({ type: Boolean }) userCreatable: boolean = false
43
-
44
- @query('#user-list') userListElement!: HTMLElement & { close: () => void }
45
-
46
- get context() {
47
- return {
48
- title: i18next.t('text.user management'),
49
- help: 'auth/users'
50
- }
51
- }
52
-
53
- render() {
54
- const groupingUser = (this.domainUsers || []).reduce(
55
- (groupingUser, user) => {
56
- const userType = user.userType
57
- if (!groupingUser[userType]) {
58
- groupingUser[userType] = []
59
- }
60
- user.activated = user.status === 'activated'
61
- groupingUser[userType].push(user)
62
-
63
- return groupingUser
64
- },
65
- {
66
- admin: [],
67
- user: [],
68
- application: [],
69
- appliance: []
70
- }
71
- )
72
-
73
- const USER_TYPES = {
74
- USER: i18next.t('label.user'),
75
- APPLICATION: i18next.t('label.application'),
76
- APPLIANCE: i18next.t('text.appliance')
77
- }
78
-
79
- const userSet = {
80
- [USER_TYPES.USER]: [...groupingUser.user, ...groupingUser.admin],
81
- [USER_TYPES.APPLICATION]: groupingUser.application,
82
- [USER_TYPES.APPLIANCE]: groupingUser.appliance
83
- }
84
-
85
- return html`
86
- ${this.userCreatable
87
- ? html`<create-user
88
- @create-user=${async event => {
89
- const user = event.detail
90
- user.userType = 'user'
91
-
92
- await this.createUser(user)
93
- }}
94
- ></create-user>`
95
- : ''}
96
- <quick-find-list
97
- id="user-list"
98
- .data=${userSet}
99
- @tabChanged=${e => (this.currentTab = e.detail.currentTabKey)}
100
- .headerRenderer=${user => {
101
- return !user.activated
102
- ? html`
103
- <md-icon>do_disturb</md-icon>
104
- ${user.name}
105
- `
106
- : html` ${user.owner ? html` <md-icon>supervisor_account</md-icon> ` : ''} ${user.name} `
107
- }}
108
- .contentRenderer=${user =>
109
- html` <user-role-editor
110
- .user=${user}
111
- .domainOwner=${this.owner}
112
- .activate=${user.activated}
113
- @userUpdated=${this.refreshUsers.bind(this)}
114
- @ownershipTransferred=${this.refreshUsers.bind(this)}
115
- .passwordResettable=${this.passwordResettable}
116
- ></user-role-editor>`}
117
- ></quick-find-list>
118
-
119
- ${this.currentTab === USER_TYPES.USER
120
- ? html`<invite-user @invitationCompleted=${this.refreshUsers.bind(this)}></invite-user>`
121
- : ''}
122
- `
123
- }
124
-
125
- async pageUpdated(changes, lifecycle, before) {
126
- if (this.active) {
127
- this.refreshUsers()
128
- this.checkPasswordResettable()
129
- this.checkUserCreatable()
130
- }
131
- }
132
-
133
- async refreshUsers() {
134
- const domainUsersResp = await client.query({
135
- query: gql`
136
- query {
137
- users {
138
- items {
139
- id
140
- username
141
- name
142
- email
143
- userType
144
- status
145
- owner
146
- }
147
- }
148
- }
149
- `,
150
- context: gqlContext()
151
- })
152
-
153
- if (!domainUsersResp.errors?.length) {
154
- this.domainUsers = domainUsersResp.data.users.items || []
155
- this.owner = this.domainUsers.filter(user => user.owner)[0] || {}
156
- this.userListElement?.close()
157
- }
158
- }
159
-
160
- async checkPasswordResettable() {
161
- const response = await client.query({
162
- query: gql`
163
- query {
164
- checkResettablePasswordToDefault
165
- }
166
- `
167
- })
168
-
169
- if (!response.errors) {
170
- this.passwordResettable = response.data.checkResettablePasswordToDefault
171
- }
172
- }
173
-
174
- async checkUserCreatable() {
175
- const response = await client.query({
176
- query: gql`
177
- query {
178
- checkDefaultPassword
179
- }
180
- `
181
- })
182
-
183
- if (!response.errors) {
184
- this.userCreatable = response.data.checkDefaultPassword
185
- }
186
- }
187
-
188
- async createUser(user: { username: string; name: string; email: string }) {
189
- if (
190
- await OxPrompt.open({
191
- title: i18next.t('text.are_you_sure'),
192
- text: i18next.t('text.are_you_sure_to_x_user', { x: i18next.t('button.create') }),
193
- confirmButton: { text: i18next.t('button.confirm') },
194
- cancelButton: { text: i18next.t('button.cancel') }
195
- })
196
- ) {
197
- const response = await client.mutate({
198
- mutation: gql`
199
- mutation createUser($user: NewUser!) {
200
- createUser(user: $user) {
201
- name
202
- }
203
- }
204
- `,
205
- variables: { user },
206
- context: gqlContext()
207
- })
208
-
209
- if (!response.errors) {
210
- await OxPrompt.open({
211
- title: i18next.t('text.completed'),
212
- confirmButton: { text: i18next.t('button.confirm') }
213
- })
214
-
215
- await this.refreshUsers()
216
- }
217
- }
218
- }
219
-
220
- showToast(message) {
221
- document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))
222
- }
223
- }
package/client/route.ts DELETED
@@ -1,67 +0,0 @@
1
- export default function route(page) {
2
- switch (page) {
3
- case 'profile':
4
- import(
5
- /* webpackPrefetch: true */
6
- /* webpackChunkName: "profile" */
7
- './pages/profile.js'
8
- )
9
- return page
10
-
11
- case 'appliance-register':
12
- import('./pages/appliance/register')
13
- return page
14
-
15
- case 'application':
16
- import('./pages/application/application')
17
- return page
18
-
19
- case 'applications':
20
- import('./pages/application/applications')
21
- return page
22
-
23
- case 'application-register':
24
- import('./pages/application/register')
25
- return page
26
-
27
- case 'app-bindings':
28
- import('./pages/app-binding/app-bindings')
29
- return page
30
-
31
- case 'app-binding':
32
- import('./pages/app-binding/app-binding')
33
- return page
34
-
35
- case 'appliance-home':
36
- import('./pages/appliance/home')
37
- return page
38
-
39
- case 'appliance':
40
- import('./pages/appliance/appliance')
41
- return page
42
-
43
- case 'roles':
44
- import('./pages/role/role-management')
45
- return page
46
-
47
- case 'users':
48
- import('./pages/user/user-management')
49
- return page
50
-
51
- case 'partners':
52
- import('./pages/partner/partner-management')
53
- return page
54
-
55
- case 'domains':
56
- import('./pages/domain/domain-management')
57
- return page
58
-
59
- case 'attributes':
60
- import('./pages/attribute/attribute-set-management.js')
61
- return page
62
-
63
- case 'auth-providers':
64
- import('./pages/auth-provider/auth-provider-management.js')
65
- return page
66
- }
67
- }
@@ -1,65 +0,0 @@
1
- body {
2
- /* login page style*/
3
- --auth-brand-name: bold 20px var(--theme-font);
4
- --auth-brand-name-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
5
- --auth-brand-welcome-msg: normal 12px var(--theme-font);
6
-
7
- --auth-title-font: bold 32px var(--theme-font);
8
- --auth-description-font: normal 12px var(--theme-font);
9
- --auth-description-padding: 5px 5px 15px 5px;
10
-
11
- --auth-input-font: normal 18px/24px var(--theme-font);
12
- --auth-input-border: 1px solid rgba(0, 0, 0, 0.4);
13
- --auth-input-border-light: 1px solid rgba(255, 255, 255, 0.8);
14
- --auth-input-color: var(--md-sys-color-on-primary);
15
-
16
- --auth-button-background-color: var(--md-sys-color-surface-variant);
17
- --auth-button-background-focus-color: var(--status-success-color);
18
- --auth-button-font: bold 20px var(--theme-font);
19
- --auth-button-padding: 9px 12px 7px 12px;
20
-
21
- /* profile page style*/
22
- --profile-brand-width: 150px;
23
- --profile-brand-height: 45px;
24
- --profile-brand-padding: 30px auto 20px auto;
25
-
26
- --profile-wrap-max-width: 550px;
27
- --profile-icon-margin: 7% 0 0 0;
28
-
29
- --auth-input-field-width: 100%;
30
- --auth-input-field-font: normal 16px var(--theme-font);
31
-
32
- --change-password-field-font: var(--auth-input-field-font);
33
- --change-password-field-border: 1px solid rgba(0, 0, 0, 0.2);
34
- --change-password-field-border-radius: var(--border-radius);
35
- --change-password-field-margin: var(--margin-narrow) 0;
36
- --change-password-field-padding: var(--padding-default);
37
- --change-password-field-width: var(--auth-input-field-width);
38
-
39
- --auth-special-page-padding: 250px 0 100px 0;
40
-
41
- /* domain select page style*/
42
- --checkin-background-color: var(--md-sys-color-background);
43
- --checkin-header-height: 45px;
44
- --checkin-header-background-color: var(--md-sys-color-primary);
45
- --checkin-header-title-font: bold 19px var(--theme-font);
46
- --checkin-header-title-color: var(--md-sys-color-on-primary);
47
- --checkin-wrap-max-width: 500px;
48
- --checkin-wrap-padding: var(--padding-wide);
49
- }
50
-
51
- @media only screen and (max-width: 460px) {
52
- body {
53
- /* profile page style*/
54
- --profile-wrap-max-width: 85vw;
55
-
56
- --auth-input-field-font: normal 20px var(--theme-font);
57
- }
58
- }
59
-
60
- @media (min-width: 461px) and (max-width: 1024px) {
61
- body {
62
- /* profile page style*/
63
- --auth-input-field-font: normal 20px var(--theme-font);
64
- }
65
- }
@@ -1,37 +0,0 @@
1
- import { i18next } from '@operato/i18n'
2
-
3
- export { generatePasswordPatternRegExp } from '@operato/utils'
4
-
5
- export function generatePasswordPatternHelp({
6
- lowerCase = true,
7
- upperCase = true,
8
- digit = true,
9
- specialCharacter = true,
10
- allowRepeat = false,
11
- useTightPattern = true,
12
- useLoosePattern = false,
13
- tightCharacterLength = 8,
14
- looseCharacterLength = 15
15
- } = {}) {
16
- var descriptions: string[] = []
17
-
18
- if (useLoosePattern) {
19
- descriptions.push(`more than ${looseCharacterLength} characters`)
20
- }
21
-
22
- if (useTightPattern) {
23
- !useLoosePattern &&
24
- descriptions.push(
25
- i18next.t('text.pattern_minimum_charaters', {
26
- length: tightCharacterLength
27
- })
28
- )
29
- lowerCase && descriptions.push(i18next.t('text.pattern_atleast_1_lowercase'))
30
- upperCase && descriptions.push(i18next.t('text.pattern_atleast_1_uppercase'))
31
- digit && descriptions.push(i18next.t('text.pattern_atleast_1_digit'))
32
- specialCharacter && descriptions.push(i18next.t('text.pattern_atleast_1_special'))
33
- !allowRepeat && descriptions.push(i18next.t('text.pattern_not_allowed'))
34
- }
35
-
36
- return descriptions.join(', ')
37
- }
package/server/index.ts DELETED
File without changes