@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,267 +0,0 @@
1
- import gql from 'graphql-tag'
2
- import { css, html, LitElement } from 'lit'
3
- import { customElement, property, state } from 'lit/decorators.js'
4
-
5
- import { client, gqlContext } from '@operato/graphql'
6
- import { i18next, localize } from '@operato/i18n'
7
- import { OxPrompt } from '@operato/popup/ox-prompt.js'
8
- import { ButtonContainerStyles } from '@operato/styles'
9
-
10
- @customElement('role-privilege-editor')
11
- class RolePrivilegeEditor extends localize(i18next)(LitElement) {
12
- static styles = [
13
- ButtonContainerStyles,
14
- css`
15
- :host {
16
- display: flex;
17
- flex-direction: column;
18
-
19
- border: 1px solid var(--md-sys-color-primary);
20
- font: normal 15px var(--theme-font);
21
- color: var(--md-sys-color-secondary);
22
- }
23
- div {
24
- margin: var(--spacing-medium);
25
- }
26
-
27
- div[users] {
28
- margin: 0;
29
- background-color: var(--md-sys-color-surface-variant);
30
- }
31
-
32
- div[titler] {
33
- color: var(--md-sys-color-secondary);
34
- font: bold 1.2em var(--theme-font);
35
- text-transform: capitalize;
36
- }
37
-
38
- ul {
39
- flex: 1;
40
- background-color: var(--md-sys-color-surface-variant);
41
- overflow: auto;
42
- display: grid;
43
- grid-template-columns: 1fr 1fr;
44
- margin-block-start: 0;
45
- margin-block-end: 0;
46
- padding: var(--spacing-medium);
47
- list-style: none;
48
- border: 1px dashed rgba(0, 0, 0, 0.1);
49
- border-width: 1px 0;
50
- }
51
-
52
- input[type='checkbox'] {
53
- display: inline;
54
- }
55
-
56
- li {
57
- padding: var(--spacing-small);
58
- }
59
-
60
- #checkAll,
61
- [for='checkAll'] {
62
- margin-bottom: var(--spacing-medium);
63
- padding-bottom: var(--spacing-small);
64
- font-weight: bold;
65
- }
66
-
67
- md-elevated-button {
68
- margin: 5px;
69
- background-color: var(--md-sys-color-surface-variant);
70
- }
71
-
72
- md-outlined-button {
73
- background-color: var(--md-sys-color-surface-variant);
74
- }
75
-
76
- @media screen and (max-width: 480px) {
77
- ul {
78
- grid-template-columns: 1fr;
79
- }
80
- }
81
- `
82
- ]
83
-
84
- @property({ type: Object }) role: any
85
- @property({ type: Array }) allPrivileges: any[] = []
86
- @property({ type: Object }) updateRoleObj: any
87
-
88
- @state() privileges: { id: string; description: string }[] = []
89
- @state() users: { /* id: string; username: string; */ name: string; email: string }[] = []
90
-
91
- render() {
92
- const allPrivileges = this.allPrivileges || []
93
- const privileges = this.privileges || []
94
- const users = this.users || []
95
-
96
- return html`
97
- <div titler>${String(i18next.t('label.user'))}</div>
98
-
99
- <div users>${users.map(user => html`<div>${user.name} (${user.email})</div>`)}</div>
100
-
101
- <div titler>${String(i18next.t('field.privileges'))}</div>
102
-
103
- <div>
104
- <input id="checkAll" type="checkbox" @change=${e => this.oncheckAll(e)} />
105
- <label for="checkAll">Check all</label>
106
- </div>
107
-
108
- <ul privileges>
109
- ${allPrivileges.map(
110
- privilege => html`
111
- <li>
112
- <input
113
- type="checkbox"
114
- id="${privilege.id}"
115
- .checked=${privileges.map(p => p.id).indexOf(privilege.id) > -1}
116
- .data-privilege=${privilege}
117
- />
118
- <label for="${privilege.id}">${privilege.description}</label>
119
- </li>
120
- `
121
- )}
122
- </ul>
123
-
124
- <div class="button-container">
125
- <md-elevated-button @click=${e => this.onSave()}>${String(i18next.t('button.save'))}</md-elevated-button>
126
- <md-elevated-button @click=${e => this.onDeleteRole()} danger
127
- >${String(i18next.t('button.delete role'))}</md-elevated-button
128
- >
129
- </div>
130
- `
131
- }
132
-
133
- async firstUpdated() {
134
- this.allPrivileges = await this.fetchPrivileges()
135
- }
136
-
137
- async updated(changes) {
138
- if (changes.has('role')) {
139
- await this.fetchPrivilegesOnRole(this.role.name)
140
- }
141
- }
142
-
143
- checkAll(checked) {
144
- Array.from(this.renderRoot.querySelectorAll('ul[privileges] input[type=checkbox]')).forEach(
145
- checkbox => ((checkbox as HTMLInputElement).checked = checked)
146
- )
147
- }
148
-
149
- oncheckAll(e) {
150
- this.checkAll(e.target.checked)
151
- }
152
-
153
- async onSave() {
154
- const updateRoleObj = this.updateRoleObj
155
- const privileges = Array.from(this.renderRoot.querySelectorAll('ul[privileges] input[type=checkbox]:checked')).map(
156
- e => e['data-privilege']
157
- )
158
-
159
- const patch = { ...updateRoleObj, privileges: privileges }
160
-
161
- if (this.role) {
162
- const response = await client.mutate({
163
- mutation: gql`
164
- mutation ($id: String!, $patch: RolePatch!) {
165
- updateRole(id: $id, patch: $patch) {
166
- id
167
- name
168
- description
169
- privileges {
170
- id
171
- description
172
- }
173
- }
174
- }
175
- `,
176
- variables: { id: this.role.id, patch },
177
- context: gqlContext()
178
- })
179
-
180
- if (!response.errors) {
181
- await this.dispatchEvent(new CustomEvent('fetch-roles'))
182
- this.showToast(i18next.t('text.data_updated_successfully'))
183
- }
184
- }
185
- }
186
-
187
- async onDeleteRole() {
188
- if (
189
- await OxPrompt.open({
190
- title: i18next.t('text.are_you_sure'),
191
- text: i18next.t('text.are_you_sure_to_delete_x', { x: i18next.t('label.role') }),
192
- confirmButton: { text: i18next.t('button.delete') },
193
- cancelButton: { text: i18next.t('button.cancel') }
194
- })
195
- ) {
196
- const response = await client.mutate({
197
- mutation: gql`
198
- mutation ($id: String!) {
199
- deleteRole(id: $id)
200
- }
201
- `,
202
- variables: { id: this.role.id },
203
- context: gqlContext()
204
- })
205
-
206
- if (!response.errors) {
207
- await this.dispatchEvent(new CustomEvent('fetch-roles'))
208
-
209
- await OxPrompt.open({
210
- type: 'success',
211
- title: i18next.t('text.completed'),
212
- text: i18next.t('text.x_deleted_successfully', { x: i18next.t('label.role') }),
213
- confirmButton: { text: i18next.t('button.confirm') }
214
- })
215
- }
216
- }
217
- }
218
-
219
- async fetchPrivileges() {
220
- const response = await client.query({
221
- query: gql`
222
- query privileges {
223
- privileges {
224
- items {
225
- id
226
- name
227
- description
228
- }
229
- total
230
- }
231
- }
232
- `
233
- })
234
-
235
- return response.data.privileges.items
236
- }
237
-
238
- async fetchPrivilegesOnRole(name) {
239
- const response = await client.query({
240
- query: gql`
241
- query ($name: String!) {
242
- role(name: $name) {
243
- id
244
- name
245
- privileges {
246
- id
247
- description
248
- }
249
- users {
250
- name
251
- email
252
- }
253
- }
254
- }
255
- `,
256
- variables: { name },
257
- context: gqlContext()
258
- })
259
-
260
- this.privileges = response.data.role?.privileges
261
- this.users = response.data.role?.users
262
- }
263
-
264
- showToast(message) {
265
- document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))
266
- }
267
- }
@@ -1,102 +0,0 @@
1
- import { css, html, LitElement, nothing } from 'lit'
2
- import { customElement, property } from 'lit/decorators.js'
3
-
4
- @customElement('role-selector')
5
- export class RoleSelector extends LitElement {
6
- static styles = [
7
- css`
8
- [subtitle] {
9
- margin: 0;
10
- padding: var(--subtitle-padding);
11
- font: var(--subtitle-font);
12
- color: var(--subtitle-text-color);
13
- }
14
- div {
15
- margin: 0 var(--spacing-medium) var(--spacing-medium) var(--spacing-medium);
16
- }
17
- ul {
18
- flex: 1;
19
- display: grid;
20
- grid-template-columns: 1fr 1fr;
21
- column-gap: 20px;
22
- overflow: auto;
23
- margin: 0;
24
- padding: var(--spacing-medium);
25
- list-style: none;
26
- border: 1px dashed rgba(0, 0, 0, 0.1);
27
- border-width: 1px 0;
28
- }
29
- input[type='checkbox'] {
30
- display: inline;
31
- }
32
- label {
33
- padding-left: var(--spacing-small);
34
- text-transform: capitalize;
35
- font: var(--label-font);
36
- color: var(--label-color, var(--md-sys-color-on-surface));
37
- }
38
- li {
39
- padding: var(--spacing-small);
40
- }
41
- #checkAll,
42
- [for='checkAll'] {
43
- margin-bottom: var(--spacing-medium);
44
- padding-bottom: var(--spacing-small);
45
- font-weight: bold;
46
- }
47
- `
48
- ]
49
-
50
- @property({ type: String }) roleCategory: string = 'Roles'
51
- @property({ type: Object }) user: any = {}
52
- @property({ type: Array }) roles: any[] = []
53
- @property({ type: Array }) userRoles: any[] = []
54
-
55
- render() {
56
- const userRoleIds = (this.userRoles || []).map(userRole => userRole.id)
57
-
58
- return html`
59
- ${this.roles.length
60
- ? html`
61
- <div>
62
- ${this.roleCategory ? html`<h3 subtitle>${this.roleCategory}</h3>` : nothing}
63
- <input id="checkAll" type="checkbox" @change=${this.checkAll.bind(this)} />
64
- <label for="checkAll">Check all</label>
65
- </div>
66
-
67
- <ul roles>
68
- ${this.roles.map(
69
- role => html`
70
- <li>
71
- <input
72
- id="${role.id}"
73
- type="checkbox"
74
- .checked=${userRoleIds.indexOf(role.id) >= 0}
75
- .data-role=${role}
76
- />
77
- <label for="${role.id}">${role.name}</label>
78
- </li>
79
- `
80
- )}
81
- </ul>
82
- `
83
- : ''}
84
- `
85
- }
86
-
87
- checkAll(e) {
88
- const checked = e.currentTarget.checked
89
- Array.from(this.renderRoot.querySelectorAll('ul[roles] input[type=checkbox]')).forEach(
90
- checkbox => ((checkbox as HTMLInputElement).checked = checked)
91
- )
92
- }
93
-
94
- selectedRoles() {
95
- return Array.from(this.renderRoot.querySelectorAll('ul[roles] input[type=checkbox]'))
96
- .filter(input => (input as HTMLInputElement).checked)
97
- .map(input => {
98
- const { id, name } = input['data-role']
99
- return { id, name }
100
- })
101
- }
102
- }