@things-factory/auth-ui 8.0.5 → 9.0.0-beta.12

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 (146) hide show
  1. package/dist-client/components/abstract-auth-page.d.ts +1 -1
  2. package/dist-client/components/abstract-auth-page.js +12 -10
  3. package/dist-client/components/abstract-auth-page.js.map +1 -1
  4. package/dist-client/components/abstract-password-reset.d.ts +2 -3
  5. package/dist-client/components/abstract-password-reset.js +10 -17
  6. package/dist-client/components/abstract-password-reset.js.map +1 -1
  7. package/dist-client/components/abstract-sign.js +12 -11
  8. package/dist-client/components/abstract-sign.js.map +1 -1
  9. package/dist-client/components/change-password.js +1 -1
  10. package/dist-client/components/change-password.js.map +1 -1
  11. package/dist-client/components/contact-us.d.ts +1 -1
  12. package/dist-client/components/contact-us.js +10 -7
  13. package/dist-client/components/contact-us.js.map +1 -1
  14. package/dist-client/components/create-user.js +28 -5
  15. package/dist-client/components/create-user.js.map +1 -1
  16. package/dist-client/components/invite-user.d.ts +1 -1
  17. package/dist-client/components/invite-user.js +19 -12
  18. package/dist-client/components/invite-user.js.map +1 -1
  19. package/dist-client/components/ownership-transfer-popup.js +3 -3
  20. package/dist-client/components/ownership-transfer-popup.js.map +1 -1
  21. package/dist-client/components/partner-role-editor.js +1 -1
  22. package/dist-client/components/partner-role-editor.js.map +1 -1
  23. package/dist-client/components/profile-component.d.ts +8 -4
  24. package/dist-client/components/profile-component.js +67 -7
  25. package/dist-client/components/profile-component.js.map +1 -1
  26. package/dist-client/components/role-privilege-editor.js +2 -1
  27. package/dist-client/components/role-privilege-editor.js.map +1 -1
  28. package/dist-client/components/user-role-editor.d.ts +2 -2
  29. package/dist-client/components/user-role-editor.js +20 -20
  30. package/dist-client/components/user-role-editor.js.map +1 -1
  31. package/dist-client/constants/index.d.ts +1 -1
  32. package/dist-client/constants/index.js +1 -1
  33. package/dist-client/constants/index.js.map +1 -1
  34. package/dist-client/entries/auth/activate.d.ts +1 -1
  35. package/dist-client/entries/auth/activate.js +1 -1
  36. package/dist-client/entries/auth/activate.js.map +1 -1
  37. package/dist-client/entries/auth/checkin.js +2 -2
  38. package/dist-client/entries/auth/checkin.js.map +1 -1
  39. package/dist-client/entries/auth/forgot-password.d.ts +2 -2
  40. package/dist-client/entries/auth/forgot-password.js +13 -4
  41. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  42. package/dist-client/entries/auth/reset-password.d.ts +1 -1
  43. package/dist-client/entries/auth/reset-password.js +1 -1
  44. package/dist-client/entries/auth/reset-password.js.map +1 -1
  45. package/dist-client/entries/auth/result.d.ts +1 -1
  46. package/dist-client/entries/auth/result.js +1 -1
  47. package/dist-client/entries/auth/result.js.map +1 -1
  48. package/dist-client/entries/auth/signin.d.ts +1 -1
  49. package/dist-client/entries/auth/signin.js +1 -1
  50. package/dist-client/entries/auth/signin.js.map +1 -1
  51. package/dist-client/entries/auth/signup.d.ts +3 -1
  52. package/dist-client/entries/auth/signup.js +45 -9
  53. package/dist-client/entries/auth/signup.js.map +1 -1
  54. package/dist-client/entries/auth/unlock-user.d.ts +1 -1
  55. package/dist-client/entries/auth/unlock-user.js +1 -1
  56. package/dist-client/entries/auth/unlock-user.js.map +1 -1
  57. package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
  58. package/dist-client/entries/oauth2/oauth2-decision-page.js +1 -1
  59. package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
  60. package/dist-client/entries/public/home.js +2 -2
  61. package/dist-client/entries/public/home.js.map +1 -1
  62. package/dist-client/index.js +1 -1
  63. package/dist-client/index.js.map +1 -1
  64. package/dist-client/pages/application/application.js +1 -1
  65. package/dist-client/pages/application/application.js.map +1 -1
  66. package/dist-client/pages/domain/domain-management.d.ts +1 -1
  67. package/dist-client/pages/domain/domain-management.js +1 -1
  68. package/dist-client/pages/domain/domain-management.js.map +1 -1
  69. package/dist-client/pages/partner/partner-management.d.ts +3 -3
  70. package/dist-client/pages/partner/partner-management.js +3 -3
  71. package/dist-client/pages/partner/partner-management.js.map +1 -1
  72. package/dist-client/pages/profile.d.ts +1 -1
  73. package/dist-client/pages/profile.js +1 -1
  74. package/dist-client/pages/profile.js.map +1 -1
  75. package/dist-client/pages/role/role-management.d.ts +3 -3
  76. package/dist-client/pages/role/role-management.js +3 -3
  77. package/dist-client/pages/role/role-management.js.map +1 -1
  78. package/dist-client/pages/user/user-management.d.ts +9 -5
  79. package/dist-client/pages/user/user-management.js +10 -11
  80. package/dist-client/pages/user/user-management.js.map +1 -1
  81. package/dist-client/tsconfig.tsbuildinfo +1 -1
  82. package/dist-server/tsconfig.tsbuildinfo +1 -1
  83. package/package.json +12 -12
  84. package/translations/en.json +6 -2
  85. package/translations/ja.json +6 -2
  86. package/translations/ko.json +6 -2
  87. package/translations/ms.json +6 -2
  88. package/translations/zh.json +6 -2
  89. package/client/auth-style-sign.ts +0 -194
  90. package/client/bootstrap.ts +0 -51
  91. package/client/components/abstract-auth-page.ts +0 -301
  92. package/client/components/abstract-password-reset.ts +0 -168
  93. package/client/components/abstract-sign.ts +0 -127
  94. package/client/components/change-password.ts +0 -153
  95. package/client/components/contact-us.ts +0 -113
  96. package/client/components/create-domain-popup.ts +0 -141
  97. package/client/components/create-role.ts +0 -123
  98. package/client/components/create-user.ts +0 -95
  99. package/client/components/credential-manager.ts +0 -64
  100. package/client/components/delete-user-popup.ts +0 -117
  101. package/client/components/domain-switch.ts +0 -127
  102. package/client/components/invite-customer.ts +0 -104
  103. package/client/components/invite-user.ts +0 -96
  104. package/client/components/my-login-history.ts +0 -101
  105. package/client/components/ownership-transfer-popup.ts +0 -110
  106. package/client/components/partner-info-card.ts +0 -89
  107. package/client/components/partner-role-editor.ts +0 -153
  108. package/client/components/profile-component.ts +0 -332
  109. package/client/components/role-edit-form.ts +0 -92
  110. package/client/components/role-privilege-editor.ts +0 -267
  111. package/client/components/role-selector.ts +0 -102
  112. package/client/components/user-role-editor.ts +0 -499
  113. package/client/constants/application.ts +0 -9
  114. package/client/constants/index.ts +0 -1
  115. package/client/entries/auth/activate.ts +0 -272
  116. package/client/entries/auth/checkin.ts +0 -190
  117. package/client/entries/auth/forgot-password.ts +0 -103
  118. package/client/entries/auth/reset-password.ts +0 -22
  119. package/client/entries/auth/result.ts +0 -193
  120. package/client/entries/auth/signin.ts +0 -18
  121. package/client/entries/auth/signup.ts +0 -109
  122. package/client/entries/auth/unlock-user.ts +0 -22
  123. package/client/entries/oauth2/oauth2-decision-error-page.ts +0 -50
  124. package/client/entries/oauth2/oauth2-decision-page.ts +0 -196
  125. package/client/entries/public/home.ts +0 -246
  126. package/client/index.ts +0 -124
  127. package/client/pages/app-binding/app-binding.ts +0 -423
  128. package/client/pages/app-binding/app-bindings.ts +0 -171
  129. package/client/pages/appliance/appliance.ts +0 -452
  130. package/client/pages/appliance/home.ts +0 -177
  131. package/client/pages/appliance/register.ts +0 -183
  132. package/client/pages/application/application.ts +0 -428
  133. package/client/pages/application/applications.ts +0 -182
  134. package/client/pages/application/register.ts +0 -211
  135. package/client/pages/attribute/attribute-set-item-list.ts +0 -237
  136. package/client/pages/attribute/attribute-set-management.ts +0 -282
  137. package/client/pages/auth-provider/auth-provider-management.ts +0 -381
  138. package/client/pages/domain/domain-management.ts +0 -410
  139. package/client/pages/partner/partner-management.ts +0 -112
  140. package/client/pages/profile.ts +0 -32
  141. package/client/pages/role/role-management.ts +0 -134
  142. package/client/pages/user/user-management.ts +0 -224
  143. package/client/route.ts +0 -67
  144. package/client/themes/auth-theme.css +0 -65
  145. package/client/utils/password-rule.ts +0 -37
  146. package/server/index.ts +0 -0
@@ -1,224 +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 html`
102
- ${!user.activated
103
- ? html`
104
- <md-icon>do_disturb</md-icon>
105
- ${user.name}
106
- `
107
- : html` ${user.owner ? html` <md-icon>supervisor_account</md-icon> ` : ''} ${user.name} `}
108
- `
109
- }}
110
- .contentRenderer=${user =>
111
- html` <user-role-editor
112
- .user=${user}
113
- .domainOwner=${this.owner}
114
- .activate=${user.activated}
115
- @userUpdated=${this.refreshUsers.bind(this)}
116
- @ownershipTransferred=${this.refreshUsers.bind(this)}
117
- .passwordResettable=${this.passwordResettable}
118
- ></user-role-editor>`}
119
- ></quick-find-list>
120
-
121
- ${this.currentTab === USER_TYPES.USER
122
- ? html`<invite-user @invitationCompleted=${this.refreshUsers.bind(this)}></invite-user>`
123
- : ''}
124
- `
125
- }
126
-
127
- async pageUpdated(changes, lifecycle, before) {
128
- if (this.active) {
129
- this.refreshUsers()
130
- this.checkPasswordResettable()
131
- this.checkUserCreatable()
132
- }
133
- }
134
-
135
- async refreshUsers() {
136
- const domainUsersResp = await client.query({
137
- query: gql`
138
- query {
139
- users {
140
- items {
141
- id
142
- name
143
- email
144
- userType
145
- status
146
- owner
147
- }
148
- }
149
- }
150
- `,
151
- context: gqlContext()
152
- })
153
-
154
- if (!domainUsersResp.errors?.length) {
155
- this.domainUsers = domainUsersResp.data.users.items || []
156
- this.owner = this.domainUsers.filter(user => user.owner)[0] || {}
157
- this.userListElement?.close()
158
- }
159
- }
160
-
161
- async checkPasswordResettable() {
162
- const response = await client.query({
163
- query: gql`
164
- query {
165
- checkResettablePasswordToDefault
166
- }
167
- `
168
- })
169
-
170
- if (!response.errors) {
171
- this.passwordResettable = response.data.checkResettablePasswordToDefault
172
- }
173
- }
174
-
175
- async checkUserCreatable() {
176
- const response = await client.query({
177
- query: gql`
178
- query {
179
- checkDefaultPassword
180
- }
181
- `
182
- })
183
-
184
- if (!response.errors) {
185
- this.userCreatable = response.data.checkDefaultPassword
186
- }
187
- }
188
-
189
- async createUser(user) {
190
- if (
191
- await OxPrompt.open({
192
- title: i18next.t('text.are_you_sure'),
193
- text: i18next.t('text.are_you_sure_to_x_user', { x: i18next.t('button.create') }),
194
- confirmButton: { text: i18next.t('button.confirm') },
195
- cancelButton: { text: i18next.t('button.cancel') }
196
- })
197
- ) {
198
- const response = await client.mutate({
199
- mutation: gql`
200
- mutation createUser($user: NewUser!) {
201
- createUser(user: $user) {
202
- name
203
- }
204
- }
205
- `,
206
- variables: { user },
207
- context: gqlContext()
208
- })
209
-
210
- if (!response.errors) {
211
- await OxPrompt.open({
212
- title: i18next.t('text.completed'),
213
- confirmButton: { text: i18next.t('button.confirm') }
214
- })
215
-
216
- await this.refreshUsers()
217
- }
218
- }
219
- }
220
-
221
- showToast(message) {
222
- document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))
223
- }
224
- }
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