@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,101 +0,0 @@
1
- import '@operato/data-grist'
2
-
3
- import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
-
7
- import { client } from '@operato/graphql'
8
- import { i18next } from '@operato/i18n'
9
- import { isMobileDevice } from '@operato/utils'
10
-
11
- @customElement('my-login-history')
12
- class MyLoginHistory extends LitElement {
13
- static styles = css`
14
- :host {
15
- display: flex;
16
- flex-direction: column;
17
- background-color: var(--md-sys-color-background);
18
- padding: var(--spacing-large);
19
- overflow: auto;
20
- }
21
- ox-grist {
22
- flex: 1;
23
- }
24
- `
25
-
26
- @property({ type: Array }) histories: any[] = []
27
- @property({ type: Number }) limit?: number
28
-
29
- render() {
30
- if (!this.histories?.length) return html``
31
-
32
- const config = {
33
- rows: { appendable: false },
34
- pagination: { infinite: true },
35
- columns: [
36
- { type: 'gutter', gutterName: 'sequence' },
37
- {
38
- type: 'object',
39
- name: 'accessDomain',
40
- header: i18next.t('field.domain'),
41
- record: { editable: false },
42
- width: 200
43
- },
44
- {
45
- type: 'datetime',
46
- name: 'accessedAt',
47
- header: i18next.t('field.accessed-at'),
48
- record: { editable: false },
49
- width: 200
50
- },
51
- {
52
- type: 'string',
53
- name: 'accessorIp',
54
- header: i18next.t('field.ip_address'),
55
- record: { editable: false },
56
- width: 200
57
- }
58
- ]
59
- }
60
-
61
- return html`
62
- <ox-grist
63
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
64
- .config=${config}
65
- .data="${{ records: this.histories }}"
66
- ></ox-grist>
67
- `
68
- }
69
-
70
- firstUpdated() {
71
- this.fetchLoginHistories()
72
- }
73
-
74
- async fetchLoginHistories() {
75
- try {
76
- const response = await client.query({
77
- query: gql`
78
- query myLoginHistories($limit: Float!) {
79
- myLoginHistories(limit: $limit) {
80
- accessDomain {
81
- name
82
- }
83
- accessorIp
84
- accessedAt
85
- }
86
- }
87
- `,
88
- variables: { limit: this.limit || 10 }
89
- })
90
-
91
- if (response.errors?.length) return
92
- this.histories = response.data.myLoginHistories
93
- } catch (e: any) {
94
- this.showToast('message' in e ? e.message : e)
95
- }
96
- }
97
-
98
- showToast(message) {
99
- document.dispatchEvent(new CustomEvent('notify', { detail: { message } }))
100
- }
101
- }
@@ -1,110 +0,0 @@
1
- import '@material/web/button/elevated-button.js'
2
-
3
- import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property, query } from 'lit/decorators.js'
6
-
7
- import { client, gqlContext } from '@operato/graphql'
8
- import { i18next, localize } from '@operato/i18n'
9
- import { OxPrompt } from '@operato/popup/ox-prompt.js'
10
-
11
- @customElement('ownership-transfer-popup')
12
- class OwnershipTransferPopup extends localize(i18next)(LitElement) {
13
- static styles = [
14
- css`
15
- :host {
16
- display: flex;
17
- flex-direction: column;
18
- background-color: var(--md-sys-color-background);
19
- padding: var(--spacing-large);
20
- overflow: auto;
21
- }
22
- .container {
23
- display: flex;
24
- flex-direction: column;
25
- flex: 1;
26
- }
27
- input {
28
- border: var(--border-dim-color);
29
- border-radius: var(--border-radius);
30
- margin: var(--input-margin);
31
- padding: var(--input-padding);
32
- min-width: 250px;
33
- font: var(--input-font);
34
- }
35
- .input-container {
36
- margin: auto;
37
- display: flex;
38
- }
39
- .input-container md-elevated-button {
40
- margin: auto 0px auto var(--spacing-large);
41
- }
42
- `
43
- ]
44
-
45
- @property({ type: Object }) user: any
46
-
47
- @query('input[name=email]') emailInput!: HTMLInputElement
48
-
49
- render() {
50
- return html`
51
- <div class="container">
52
- <div>${i18next.t('text.please enter the email of the user you want to transfer owner')}</div>
53
- <div class="input-container">
54
- <input name="email" />
55
- <md-elevated-button @click=${this.transferOwnership}>${i18next.t('button.confirm')}</md-elevated-button>
56
- </div>
57
- </div>
58
- `
59
- }
60
-
61
- async transferOwnership() {
62
- if (!this.doubleCheckEmail()) {
63
- this.showToast(i18next.t('text.email is not matched'))
64
-
65
- return
66
- }
67
-
68
- if (
69
- await OxPrompt.open({
70
- title: i18next.t('text.are_you_sure'),
71
- text: i18next.t('text.are_you_sure_to_transfer_owner'),
72
- confirmButton: { text: i18next.t('button.confirm') },
73
- cancelButton: { text: i18next.t('button.cancel') }
74
- })
75
- ) {
76
- const response = await client.mutate({
77
- mutation: gql`
78
- mutation transferOwner($username: String!) {
79
- transferOwner(username: $username)
80
- }
81
- `,
82
- variables: { username: this.user.username || this.user.email },
83
- context: gqlContext()
84
- })
85
-
86
- if (!response.errors?.length) {
87
- await OxPrompt.open({
88
- type: 'success',
89
- title: i18next.t('text.completed'),
90
- text: i18next.t('text.owner_transfer_completed'),
91
- confirmButton: { text: i18next.t('button.confirm') }
92
- })
93
-
94
- history.back()
95
-
96
- this.dispatchEvent(new CustomEvent('ownershipTransferred', { bubbles: true, composed: true }))
97
- }
98
- } else {
99
- history.back()
100
- }
101
- }
102
-
103
- doubleCheckEmail() {
104
- return this.emailInput.value === this.user.email
105
- }
106
-
107
- showToast(message) {
108
- document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))
109
- }
110
- }
@@ -1,89 +0,0 @@
1
- import { css, html, LitElement } from 'lit'
2
- import { customElement, property } from 'lit/decorators.js'
3
-
4
- import { i18next } from '@operato/i18n'
5
-
6
- @customElement('partner-info-card')
7
- export class PartnerInfoCard extends LitElement {
8
- static styles = [
9
- css`
10
- input {
11
- border: var(--border-dim-color);
12
- border-radius: var(--border-radius);
13
- margin: var(--input-margin);
14
- padding: var(--input-padding);
15
- background-color: transparent;
16
- font: var(--input-font);
17
-
18
- flex: 1;
19
- }
20
- #vendors {
21
- display: flex;
22
- max-height: 45vh;
23
- flex-direction: row;
24
- background-color: var(--md-sys-color-surface-variant);
25
- margin: 0;
26
- padding: 0;
27
- border-radius: var(--border-radius);
28
- box-shadow: var(--box-shadow);
29
- overflow: hidden;
30
- }
31
- [field-2column] {
32
- overflow: auto;
33
- flex: 1;
34
- background-color: var(--md-sys-color-surface-variant);
35
- padding: var(--spacing-medium);
36
- border-radius: var(--border-radius);
37
- display: grid;
38
- grid-template-columns: 1fr 1fr;
39
- gap: 5px 15px;
40
- clear: both;
41
- max-width: var(--input-container-max-width);
42
- }
43
- [field] {
44
- display: flex;
45
- flex-direction: column;
46
- padding-bottom: var(--spacing-medium);
47
- }
48
- label {
49
- display: flex;
50
- flex-direction: column;
51
-
52
- font: var(--label-font);
53
- color: var(--label-color, var(--md-sys-color-on-surface));
54
- text-transform: var(--label-text-transform);
55
- }
56
- @media screen and (max-width: 480px) {
57
- [field] {
58
- grid-column: span 2;
59
- }
60
- }
61
- `
62
- ]
63
-
64
- @property({ type: Object }) partner: any
65
-
66
- render() {
67
- const partner = this.partner || {}
68
-
69
- return html`
70
- <div id="vendors">
71
- <div field-2column>
72
- <div field>
73
- <label
74
- >${i18next.t('label.name')}
75
- <input type="text" name="name" readonly .value=${partner.name || ''} />
76
- </label>
77
- </div>
78
-
79
- <div field>
80
- <label
81
- >${i18next.t('label.description')}
82
- <input type="text" name="description" readonly .value=${partner.description || ''} />
83
- </label>
84
- </div>
85
- </div>
86
- </div>
87
- `
88
- }
89
- }
@@ -1,153 +0,0 @@
1
- import '@material/web/button/elevated-button.js'
2
- import './role-selector.js'
3
-
4
- import gql from 'graphql-tag'
5
- import { css, html, LitElement } from 'lit'
6
- import { customElement, property, query } from 'lit/decorators.js'
7
-
8
- import { client, gqlContext } from '@operato/graphql'
9
- import { i18next, localize } from '@operato/i18n'
10
- import { OxPrompt } from '@operato/popup/ox-prompt.js'
11
- import { ButtonContainerStyles } from '@operato/styles'
12
-
13
- import { RoleSelector } from './role-selector'
14
-
15
- @customElement('partner-role-editor')
16
- class PartnerRoleEditor extends localize(i18next)(LitElement) {
17
- static styles = [
18
- ButtonContainerStyles,
19
- css`
20
- :host {
21
- display: flex;
22
- flex-direction: column;
23
-
24
- border: 1px solid var(--md-sys-color-primary);
25
- padding: var(--spacing-medium);
26
- font: normal 15px var(--theme-font);
27
- color: var(--md-sys-color-secondary);
28
- }
29
-
30
- md-elevated-button {
31
- margin-right: var(--spacing-small);
32
- }
33
- `
34
- ]
35
-
36
- @property({ type: Object }) customer: any
37
- @property({ type: Array }) roles: any[] = []
38
- @property({ type: Array }) grantingRoles: any[] = []
39
-
40
- @query('role-selector') roleSelector!: RoleSelector
41
-
42
- render() {
43
- const roles = this.roles || []
44
- const grantingRoles = this.grantingRoles || []
45
-
46
- return html`
47
- <role-selector .roles="${roles}" .userRoles="${grantingRoles}"></role-selector>
48
-
49
- <div class="button-container">
50
- <md-elevated-button @click=${this.onSave}>${i18next.t('button.save')}</md-elevated-button>
51
- <md-elevated-button @click=${this.onTerminateContract} danger
52
- >${i18next.t('button.terminate contract')}</md-elevated-button
53
- >
54
- </div>
55
- `
56
- }
57
-
58
- updated(changes) {
59
- if (changes.has('customer')) {
60
- this.refreshRoles()
61
- }
62
- }
63
-
64
- async refreshRoles() {
65
- const response = await client.query({
66
- query: gql`
67
- query roles($customerId: String!) {
68
- roles {
69
- items {
70
- id
71
- name
72
- description
73
- }
74
- total
75
- }
76
- grantingRoles(customerId: $customerId) {
77
- id
78
- role {
79
- id
80
- name
81
- description
82
- }
83
- }
84
- }
85
- `,
86
- variables: { customerId: this.customer.id },
87
- context: gqlContext()
88
- })
89
-
90
- if (!response.errors?.length) {
91
- this.roles = response.data.roles.items
92
- this.grantingRoles = response.data.grantingRoles.map(grantingRole => grantingRole.role)
93
- } else {
94
- this.roles = []
95
- this.grantingRoles = []
96
- }
97
- }
98
-
99
- async onSave() {
100
- const roles = this.roleSelector.selectedRoles()
101
-
102
- const response = await client.mutate({
103
- mutation: gql`
104
- mutation grantRoles($customerId: String!, $roles: [RolePatch!]!) {
105
- grantRoles(customerId: $customerId, roles: $roles)
106
- }
107
- `,
108
- variables: { customerId: this.customer.id, roles },
109
- context: gqlContext()
110
- })
111
-
112
- if (!response.errors?.length) {
113
- this.showToast(i18next.t('text.data_updated_successfully'))
114
- }
115
- }
116
-
117
- async onTerminateContract() {
118
- if (
119
- await OxPrompt.open({
120
- title: i18next.t('text.are_you_sure'),
121
- text: i18next.t('text.are_you_sure_to_terminate_contract'),
122
- confirmButton: { text: i18next.t('button.terminate contract') },
123
- cancelButton: { text: i18next.t('button.cancel') }
124
- })
125
- ) {
126
- const response = await client.mutate({
127
- mutation: gql`
128
- mutation terminateContract($partnerName: String!) {
129
- terminateContract(partnerName: $partnerName)
130
- }
131
- `,
132
- variables: { partnerName: this.customer.name },
133
- context: gqlContext()
134
- })
135
-
136
- if (!response.errors?.length) {
137
- const answer = this.dispatchEvent(new CustomEvent('contractTerminated'))
138
-
139
- if (answer) {
140
- await OxPrompt.open({
141
- type: 'success',
142
- title: i18next.t('text.completed'),
143
- confirmButton: { text: i18next.t('button.confirm') }
144
- })
145
- }
146
- }
147
- }
148
- }
149
-
150
- showToast(message) {
151
- document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))
152
- }
153
- }