@things-factory/oauth2-client 10.1.27 → 10.1.29
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.
- package/dist-client/pages/oauth2-client/oauth2-client-list-page.d.ts +4 -0
- package/dist-client/pages/oauth2-client/oauth2-client-list-page.js +19 -13
- package/dist-client/pages/oauth2-client/oauth2-client-list-page.js.map +1 -1
- package/dist-client/pages/oauth2-client-register.d.ts +16 -3
- package/dist-client/pages/oauth2-client-register.js +83 -99
- package/dist-client/pages/oauth2-client-register.js.map +1 -1
- package/dist-client/pages/oauth2-client.d.ts +26 -2
- package/dist-client/pages/oauth2-client.js +151 -137
- package/dist-client/pages/oauth2-client.js.map +1 -1
- package/dist-client/pages/oauth2-clients.d.ts +1 -2
- package/dist-client/pages/oauth2-clients.js +85 -92
- package/dist-client/pages/oauth2-clients.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -4
- package/translations/en.json +7 -1
- package/translations/ja.json +7 -1
- package/translations/ko.json +7 -1
- package/translations/ms.json +7 -1
- package/translations/zh.json +7 -1
|
@@ -1,60 +1,40 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/web/button/elevated-button.js';
|
|
3
|
-
import '@material/web/button/outlined-button.js';
|
|
4
2
|
import gql from 'graphql-tag';
|
|
5
3
|
import { css, html } from 'lit';
|
|
6
4
|
import { customElement, property } from 'lit/decorators.js';
|
|
7
5
|
import { client } from '@operato/graphql';
|
|
8
6
|
import { notify } from '@operato/layout';
|
|
9
7
|
import { navigate, PageView } from '@operato/shell';
|
|
10
|
-
|
|
8
|
+
import { i18next, localize } from '@operato/i18n';
|
|
9
|
+
import { CommonButtonStyles, DocumentPageStyles } from '@operato/styles';
|
|
10
|
+
let Oauth2Clients = class Oauth2Clients extends localize(i18next)(PageView) {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.clients = [];
|
|
14
14
|
}
|
|
15
15
|
static { this.styles = [
|
|
16
|
+
/* Read and edited down one column (ADR-0060 decision 8) - the frame owns width, padding, spacing. */
|
|
17
|
+
DocumentPageStyles,
|
|
16
18
|
css `
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
background-color: var(--md-sys-color-background);
|
|
20
|
-
padding: var(--spacing-large);
|
|
21
|
-
|
|
22
|
-
overflow: auto;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
md-elevated-button { text-transform: capitalize;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
md-outlined-button { float: right;
|
|
29
|
-
margin-top: var(--spacing-medium);
|
|
30
|
-
text-transform: capitalize;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
h2 { margin: var(--title-margin);
|
|
34
|
-
font: var(--title-font);
|
|
35
|
-
color: var(--title-text-color);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[page-description] { margin: var(--page-description-margin);
|
|
39
|
-
font: var(--page-description-font);
|
|
40
|
-
color: var(--page-description-color);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
table { width: 100%;
|
|
44
|
-
margin: var(--spacing-large) 0;
|
|
19
|
+
table {
|
|
20
|
+
width: 100%;
|
|
45
21
|
border-collapse: collapse;
|
|
46
|
-
|
|
22
|
+
}
|
|
47
23
|
|
|
48
|
-
tr {
|
|
49
|
-
|
|
24
|
+
tr {
|
|
25
|
+
background-color: var(--tr-background-color);
|
|
26
|
+
}
|
|
50
27
|
|
|
51
|
-
tr:nth-child(odd) {
|
|
52
|
-
|
|
28
|
+
tr:nth-child(odd) {
|
|
29
|
+
background-color: var(--tr-background-odd-color);
|
|
30
|
+
}
|
|
53
31
|
|
|
54
|
-
tr:hover {
|
|
55
|
-
|
|
32
|
+
tr:hover {
|
|
33
|
+
background-color: var(--tr-background-hover-color);
|
|
34
|
+
}
|
|
56
35
|
|
|
57
|
-
th {
|
|
36
|
+
th {
|
|
37
|
+
border-top: var(--th-border-top);
|
|
58
38
|
border-bottom: var(--td-border-bottom);
|
|
59
39
|
padding: var(--th-padding);
|
|
60
40
|
|
|
@@ -62,71 +42,82 @@ let Oauth2Clients = class Oauth2Clients extends PageView {
|
|
|
62
42
|
color: var(--th-color);
|
|
63
43
|
text-transform: var(--th-text-transform);
|
|
64
44
|
text-align: left;
|
|
65
|
-
|
|
45
|
+
}
|
|
66
46
|
|
|
67
|
-
td {
|
|
47
|
+
td {
|
|
48
|
+
padding: var(--td-padding);
|
|
68
49
|
border-bottom: var(--border-dim-color);
|
|
69
50
|
line-height: 1.1;
|
|
70
|
-
|
|
51
|
+
}
|
|
71
52
|
|
|
72
|
-
td a {
|
|
53
|
+
td a {
|
|
54
|
+
font: var(--td-font);
|
|
73
55
|
text-decoration: none;
|
|
74
56
|
color: var(--md-sys-color-on-surface);
|
|
75
|
-
|
|
57
|
+
}
|
|
76
58
|
|
|
77
|
-
td a strong {
|
|
59
|
+
td a strong {
|
|
60
|
+
font: bold 16px var(--theme-font);
|
|
78
61
|
|
|
79
62
|
display: block;
|
|
80
63
|
text-decoration: none;
|
|
81
|
-
|
|
64
|
+
}
|
|
82
65
|
|
|
83
|
-
.text-align-center {
|
|
84
|
-
|
|
66
|
+
.text-align-center {
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
85
69
|
|
|
86
|
-
.text-align-right {
|
|
87
|
-
|
|
70
|
+
.text-align-right {
|
|
71
|
+
text-align: right;
|
|
72
|
+
}
|
|
88
73
|
`
|
|
89
74
|
]; }
|
|
90
75
|
get context() {
|
|
91
|
-
|
|
76
|
+
/* The action goes to the page action bar, where every other screen keeps its actions. */
|
|
77
|
+
return {
|
|
78
|
+
/*
|
|
79
|
+
* 이 화면이 어떤 틀인가 — 동작 줄이 이것을 읽고 자기 오른쪽 끝을 내용에 맞춘다
|
|
80
|
+
* (ADR-0060 결정 9 보탬). 안 적으면 창 폭이고, 그것은 작업면의 모양이다.
|
|
81
|
+
*/
|
|
82
|
+
frame: 'document',
|
|
83
|
+
title: i18next.t('text.oauth2-clients'),
|
|
84
|
+
actions: [
|
|
85
|
+
{
|
|
86
|
+
title: i18next.t('button.register'),
|
|
87
|
+
action: () => navigate('oauth2-client-register'),
|
|
88
|
+
...CommonButtonStyles.submit
|
|
89
|
+
}
|
|
90
|
+
]
|
|
92
91
|
};
|
|
93
92
|
}
|
|
94
93
|
render() {
|
|
95
94
|
var clients = this.clients || [];
|
|
95
|
+
/* The screen name is in the title bar; the h2 that used to sit here said it a second time. */
|
|
96
96
|
return html `
|
|
97
|
-
<div>
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
${client.description}
|
|
122
|
-
</a>
|
|
123
|
-
</td>
|
|
124
|
-
<td class="text-align-center">OK</td>
|
|
125
|
-
<td class="text-align-right">1</td>
|
|
126
|
-
<td class="text-align-center">draft</td>
|
|
127
|
-
</tr>
|
|
128
|
-
`)}
|
|
129
|
-
</table>
|
|
97
|
+
<div class="page">
|
|
98
|
+
<section class="page-section">
|
|
99
|
+
<table class="page-card">
|
|
100
|
+
<tr>
|
|
101
|
+
<th>app name</th>
|
|
102
|
+
<th>API health</th>
|
|
103
|
+
<th>Installs</th>
|
|
104
|
+
<th>status</th>
|
|
105
|
+
</tr>
|
|
106
|
+
${clients.map(client => html `
|
|
107
|
+
<tr>
|
|
108
|
+
<td>
|
|
109
|
+
<a href=${`oauth2-client/${client.id}`}>
|
|
110
|
+
<strong>${client.name}</strong>
|
|
111
|
+
${client.description}
|
|
112
|
+
</a>
|
|
113
|
+
</td>
|
|
114
|
+
<td class="text-align-center">OK</td>
|
|
115
|
+
<td class="text-align-right">1</td>
|
|
116
|
+
<td class="text-align-center">draft</td>
|
|
117
|
+
</tr>
|
|
118
|
+
`)}
|
|
119
|
+
</table>
|
|
120
|
+
</section>
|
|
130
121
|
</div>
|
|
131
122
|
`;
|
|
132
123
|
}
|
|
@@ -136,20 +127,22 @@ let Oauth2Clients = class Oauth2Clients extends PageView {
|
|
|
136
127
|
}
|
|
137
128
|
}
|
|
138
129
|
async fetchOauth2Clients() {
|
|
139
|
-
const response = await client.query({
|
|
140
|
-
|
|
130
|
+
const response = await client.query({
|
|
131
|
+
query: gql `
|
|
132
|
+
query {
|
|
133
|
+
oauth2Clients {
|
|
134
|
+
items {
|
|
135
|
+
id
|
|
141
136
|
name
|
|
142
137
|
description
|
|
143
|
-
|
|
138
|
+
}
|
|
144
139
|
total
|
|
145
|
-
|
|
146
|
-
|
|
140
|
+
}
|
|
141
|
+
}
|
|
147
142
|
`
|
|
148
143
|
});
|
|
149
144
|
if (response.errors) {
|
|
150
|
-
notify({ level: 'error',
|
|
151
|
-
message: 'fetch oauth2 clients fail'
|
|
152
|
-
});
|
|
145
|
+
notify({ level: 'error', message: 'fetch oauth2 clients fail' });
|
|
153
146
|
}
|
|
154
147
|
else {
|
|
155
148
|
return response.data.oauth2Clients;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2-clients.js","sourceRoot":"","sources":["../../client/pages/oauth2-clients.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"oauth2-clients.js","sourceRoot":"","sources":["../../client/pages/oauth2-clients.ts"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,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AC,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM;QAC1C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC,EAAE,KAAK,IAAI,EAAE,CAAA;QAC/D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;OAWT;SACF,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CAAA;QAClE,CAAC;aAAM,CAAC;YACN,OAAO,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAA;QACpC,CAAC;IACH,CAAC;;AAnF0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;8CAAoB;AA9D1C,aAAa;IADlB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,aAAa,CAkJlB","sourcesContent":["\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport { navigate, PageView } from '@operato/shell'\nimport { i18next, localize } from '@operato/i18n'\nimport { CommonButtonStyles, DocumentPageStyles } from '@operato/styles'\n\n@customElement('oauth2-clients')\nclass Oauth2Clients extends localize(i18next)(PageView) {\n static styles = [\n /* Read and edited down one column (ADR-0060 decision 8) - the frame owns width, padding, spacing. */\n DocumentPageStyles,\n css`\n table {\n width: 100%;\n border-collapse: collapse;\n }\n\n tr {\n background-color: var(--tr-background-color);\n }\n\n tr:nth-child(odd) {\n background-color: var(--tr-background-odd-color);\n }\n\n tr:hover {\n background-color: var(--tr-background-hover-color);\n }\n\n th {\n border-top: var(--th-border-top);\n border-bottom: var(--td-border-bottom);\n padding: var(--th-padding);\n\n font: var(--th-font);\n color: var(--th-color);\n text-transform: var(--th-text-transform);\n text-align: left;\n }\n\n td {\n padding: var(--td-padding);\n border-bottom: var(--border-dim-color);\n line-height: 1.1;\n }\n\n td a {\n font: var(--td-font);\n text-decoration: none;\n color: var(--md-sys-color-on-surface);\n }\n\n td a strong {\n font: bold 16px var(--theme-font);\n\n display: block;\n text-decoration: none;\n }\n\n .text-align-center {\n text-align: center;\n }\n\n .text-align-right {\n text-align: right;\n }\n `\n ]\n\n @property({ type: Array }) clients: any[] = []\n\n get context() {\n /* The action goes to the page action bar, where every other screen keeps its actions. */\n return {\n /*\n * 이 화면이 어떤 틀인가 — 동작 줄이 이것을 읽고 자기 오른쪽 끝을 내용에 맞춘다\n * (ADR-0060 결정 9 보탬). 안 적으면 창 폭이고, 그것은 작업면의 모양이다.\n */\n frame: 'document',\n title: i18next.t('text.oauth2-clients'),\n actions: [\n {\n title: i18next.t('button.register'),\n action: () => navigate('oauth2-client-register'),\n ...CommonButtonStyles.submit\n }\n ]\n }\n }\n\n render() {\n var clients = this.clients || []\n\n /* The screen name is in the title bar; the h2 that used to sit here said it a second time. */\n return html`\n <div class=\"page\">\n <section class=\"page-section\">\n <table class=\"page-card\">\n <tr>\n <th>app name</th>\n <th>API health</th>\n <th>Installs</th>\n <th>status</th>\n </tr>\n ${clients.map(\n client => html`\n <tr>\n <td>\n <a href=${`oauth2-client/${client.id}`}>\n <strong>${client.name}</strong>\n ${client.description}\n </a>\n </td>\n <td class=\"text-align-center\">OK</td>\n <td class=\"text-align-right\">1</td>\n <td class=\"text-align-center\">draft</td>\n </tr>\n `\n )}\n </table>\n </section>\n </div>\n `\n }\n\n async pageUpdated(changes, lifecycle, before) {\n if (this.active) {\n this.clients = (await this.fetchOauth2Clients())?.items || []\n }\n }\n\n async fetchOauth2Clients() {\n const response = await client.query({\n query: gql`\n query {\n oauth2Clients {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n if (response.errors) {\n notify({ level: 'error', message: 'fetch oauth2 clients fail' })\n } else {\n return response.data.oauth2Clients\n }\n }\n}\n"]}
|