@things-factory/auth-ui 8.0.37 → 9.0.0-9.0.0-beta.59.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.
Files changed (142) hide show
  1. package/dist-client/components/abstract-auth-page.d.ts +1 -1
  2. package/dist-client/components/abstract-auth-page.js +2 -0
  3. package/dist-client/components/abstract-auth-page.js.map +1 -1
  4. package/dist-client/components/abstract-password-reset.d.ts +2 -2
  5. package/dist-client/components/abstract-password-reset.js +5 -5
  6. package/dist-client/components/abstract-password-reset.js.map +1 -1
  7. package/dist-client/components/change-password.js +1 -1
  8. package/dist-client/components/change-password.js.map +1 -1
  9. package/dist-client/components/invite-user.d.ts +1 -1
  10. package/dist-client/components/invite-user.js +1 -2
  11. package/dist-client/components/invite-user.js.map +1 -1
  12. package/dist-client/components/partner-role-editor.js +1 -1
  13. package/dist-client/components/partner-role-editor.js.map +1 -1
  14. package/dist-client/components/profile-component.d.ts +3 -3
  15. package/dist-client/components/profile-component.js +3 -3
  16. package/dist-client/components/profile-component.js.map +1 -1
  17. package/dist-client/components/role-privilege-editor.js +2 -1
  18. package/dist-client/components/role-privilege-editor.js.map +1 -1
  19. package/dist-client/components/user-role-editor.d.ts +2 -2
  20. package/dist-client/components/user-role-editor.js +2 -2
  21. package/dist-client/components/user-role-editor.js.map +1 -1
  22. package/dist-client/constants/index.d.ts +1 -1
  23. package/dist-client/constants/index.js +1 -1
  24. package/dist-client/constants/index.js.map +1 -1
  25. package/dist-client/entries/auth/activate.d.ts +1 -1
  26. package/dist-client/entries/auth/activate.js +1 -1
  27. package/dist-client/entries/auth/activate.js.map +1 -1
  28. package/dist-client/entries/auth/checkin.js +2 -2
  29. package/dist-client/entries/auth/checkin.js.map +1 -1
  30. package/dist-client/entries/auth/forgot-password.d.ts +2 -2
  31. package/dist-client/entries/auth/forgot-password.js +11 -3
  32. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  33. package/dist-client/entries/auth/reset-password.d.ts +1 -1
  34. package/dist-client/entries/auth/reset-password.js +1 -1
  35. package/dist-client/entries/auth/reset-password.js.map +1 -1
  36. package/dist-client/entries/auth/result.d.ts +1 -1
  37. package/dist-client/entries/auth/result.js +1 -1
  38. package/dist-client/entries/auth/result.js.map +1 -1
  39. package/dist-client/entries/auth/signin.d.ts +1 -1
  40. package/dist-client/entries/auth/signin.js +1 -1
  41. package/dist-client/entries/auth/signin.js.map +1 -1
  42. package/dist-client/entries/auth/signup.d.ts +3 -1
  43. package/dist-client/entries/auth/signup.js +32 -2
  44. package/dist-client/entries/auth/signup.js.map +1 -1
  45. package/dist-client/entries/auth/unlock-user.d.ts +1 -1
  46. package/dist-client/entries/auth/unlock-user.js +1 -1
  47. package/dist-client/entries/auth/unlock-user.js.map +1 -1
  48. package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
  49. package/dist-client/entries/oauth2/oauth2-decision-page.js +1 -1
  50. package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
  51. package/dist-client/entries/public/home.js +2 -2
  52. package/dist-client/entries/public/home.js.map +1 -1
  53. package/dist-client/pages/application/application.js +1 -1
  54. package/dist-client/pages/application/application.js.map +1 -1
  55. package/dist-client/pages/domain/domain-management.d.ts +1 -1
  56. package/dist-client/pages/domain/domain-management.js +1 -1
  57. package/dist-client/pages/domain/domain-management.js.map +1 -1
  58. package/dist-client/pages/domain-link/domain-link-management.d.ts +53 -0
  59. package/dist-client/pages/domain-link/domain-link-management.js +353 -0
  60. package/dist-client/pages/domain-link/domain-link-management.js.map +1 -0
  61. package/dist-client/pages/partner/partner-management.d.ts +3 -3
  62. package/dist-client/pages/partner/partner-management.js +3 -3
  63. package/dist-client/pages/partner/partner-management.js.map +1 -1
  64. package/dist-client/pages/profile.d.ts +1 -1
  65. package/dist-client/pages/profile.js +1 -1
  66. package/dist-client/pages/profile.js.map +1 -1
  67. package/dist-client/pages/role/role-management.d.ts +3 -3
  68. package/dist-client/pages/role/role-management.js +3 -3
  69. package/dist-client/pages/role/role-management.js.map +1 -1
  70. package/dist-client/pages/user/user-management.d.ts +4 -4
  71. package/dist-client/pages/user/user-management.js +4 -4
  72. package/dist-client/pages/user/user-management.js.map +1 -1
  73. package/dist-client/route.js +3 -0
  74. package/dist-client/route.js.map +1 -1
  75. package/dist-client/tsconfig.tsbuildinfo +1 -1
  76. package/dist-server/tsconfig.tsbuildinfo +1 -1
  77. package/helps/auth/domain-link.md +178 -0
  78. package/package.json +12 -12
  79. package/things-factory.config.js +2 -1
  80. package/translations/en.json +7 -0
  81. package/translations/ja.json +7 -0
  82. package/translations/ko.json +7 -0
  83. package/translations/ms.json +7 -0
  84. package/translations/zh.json +7 -0
  85. package/client/auth-style-sign.ts +0 -194
  86. package/client/bootstrap.ts +0 -55
  87. package/client/components/abstract-auth-page.ts +0 -301
  88. package/client/components/abstract-password-reset.ts +0 -163
  89. package/client/components/abstract-sign.ts +0 -127
  90. package/client/components/change-password.ts +0 -153
  91. package/client/components/contact-us.ts +0 -116
  92. package/client/components/create-domain-popup.ts +0 -141
  93. package/client/components/create-role.ts +0 -123
  94. package/client/components/create-user.ts +0 -117
  95. package/client/components/credential-manager.ts +0 -64
  96. package/client/components/delete-user-popup.ts +0 -117
  97. package/client/components/domain-switch.ts +0 -127
  98. package/client/components/invite-customer.ts +0 -104
  99. package/client/components/invite-user.ts +0 -104
  100. package/client/components/my-login-history.ts +0 -101
  101. package/client/components/ownership-transfer-popup.ts +0 -110
  102. package/client/components/partner-info-card.ts +0 -89
  103. package/client/components/partner-role-editor.ts +0 -153
  104. package/client/components/profile-component.ts +0 -392
  105. package/client/components/role-edit-form.ts +0 -92
  106. package/client/components/role-privilege-editor.ts +0 -267
  107. package/client/components/role-selector.ts +0 -102
  108. package/client/components/user-role-editor.ts +0 -499
  109. package/client/constants/application.ts +0 -9
  110. package/client/constants/index.ts +0 -1
  111. package/client/entries/auth/activate.ts +0 -272
  112. package/client/entries/auth/checkin.ts +0 -183
  113. package/client/entries/auth/forgot-password.ts +0 -104
  114. package/client/entries/auth/reset-password.ts +0 -22
  115. package/client/entries/auth/result.ts +0 -193
  116. package/client/entries/auth/signin.ts +0 -18
  117. package/client/entries/auth/signup.ts +0 -115
  118. package/client/entries/auth/unlock-user.ts +0 -22
  119. package/client/entries/oauth2/oauth2-decision-error-page.ts +0 -50
  120. package/client/entries/oauth2/oauth2-decision-page.ts +0 -196
  121. package/client/entries/public/home.ts +0 -246
  122. package/client/index.ts +0 -124
  123. package/client/pages/app-binding/app-binding.ts +0 -423
  124. package/client/pages/app-binding/app-bindings.ts +0 -171
  125. package/client/pages/appliance/appliance.ts +0 -452
  126. package/client/pages/appliance/home.ts +0 -177
  127. package/client/pages/appliance/register.ts +0 -183
  128. package/client/pages/application/application.ts +0 -428
  129. package/client/pages/application/applications.ts +0 -182
  130. package/client/pages/application/register.ts +0 -211
  131. package/client/pages/attribute/attribute-set-item-list.ts +0 -237
  132. package/client/pages/attribute/attribute-set-management.ts +0 -282
  133. package/client/pages/auth-provider/auth-provider-management.ts +0 -381
  134. package/client/pages/domain/domain-management.ts +0 -431
  135. package/client/pages/partner/partner-management.ts +0 -112
  136. package/client/pages/profile.ts +0 -32
  137. package/client/pages/role/role-management.ts +0 -134
  138. package/client/pages/user/user-management.ts +0 -223
  139. package/client/route.ts +0 -67
  140. package/client/themes/auth-theme.css +0 -65
  141. package/client/utils/password-rule.ts +0 -37
  142. 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