@jskit-ai/connectors-web 0.2.11 → 0.2.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.
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/connectors-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Shared Vue fields for portable application integration configuration.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "jskit test test/*.test.js"
|
|
8
|
+
},
|
|
6
9
|
"files": [
|
|
7
10
|
"src",
|
|
8
11
|
"locales"
|
|
@@ -12,10 +15,10 @@
|
|
|
12
15
|
"./locales/en.json": "./locales/en.json"
|
|
13
16
|
},
|
|
14
17
|
"dependencies": {
|
|
15
|
-
"@jskit-ai/connectors-core": "0.2.
|
|
18
|
+
"@jskit-ai/connectors-core": "0.2.12"
|
|
16
19
|
},
|
|
17
20
|
"peerDependencies": {
|
|
18
|
-
"@jskit-ai/kernel": "0.2.
|
|
21
|
+
"@jskit-ai/kernel": "0.2.11",
|
|
19
22
|
"vue": "^3.5.13",
|
|
20
23
|
"vuetify": "^4.0.0"
|
|
21
24
|
},
|
|
@@ -98,139 +98,152 @@ function settingErrors(field) {
|
|
|
98
98
|
|
|
99
99
|
<template>
|
|
100
100
|
<v-sheet v-if="integration" class="integration-fields" :aria-label="t('jskit.connectors.configurationFields.ariaLabel', { provider: definition.name })">
|
|
101
|
+
<!-- Each panel's fields take the app's own Vuetify defaults (root), not the panel's: a v-expansion-panel gives its
|
|
102
|
+
content new defaults on each re-render, as every edit causes, and under any VMenu default in the app, Vuetify
|
|
103
|
+
4.2.1 to 4.3.2 then makes a select's menu lose the match typed into it
|
|
104
|
+
(https://github.com/vuetifyjs/vuetify/issues/23366; material-web's README, Upstream workarounds). Defaults an
|
|
105
|
+
app scopes around this form with its own v-defaults-provider do not reach them either. -->
|
|
101
106
|
<v-expansion-panels v-model="panels" multiple variant="accordion" :disabled="disabled">
|
|
102
107
|
<v-expansion-panel value="details" :title="t('jskit.connectors.configurationFields.panels.details')">
|
|
103
108
|
<v-expansion-panel-text>
|
|
104
|
-
<v-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
<v-defaults-provider root>
|
|
110
|
+
<v-text-field
|
|
111
|
+
:label="t('jskit.connectors.configurationFields.displayName.label')" :model-value="integration.displayName || ''" :disabled="disabled"
|
|
112
|
+
:placeholder="definition.name" :error-messages="errors[`${integrationPath}.displayName`]"
|
|
113
|
+
@update:model-value="editIntegration({ displayName: $event || undefined })"
|
|
114
|
+
/>
|
|
115
|
+
<v-select
|
|
116
|
+
:label="t('jskit.connectors.configurationFields.accountMode.label')" :items="modes" :model-value="integration.accountMode" :disabled="disabled"
|
|
117
|
+
:error-messages="errors[`${integrationPath}.accountMode`]"
|
|
118
|
+
@update:model-value="editIntegration({ accountMode: $event })"
|
|
119
|
+
/>
|
|
120
|
+
</v-defaults-provider>
|
|
114
121
|
</v-expansion-panel-text>
|
|
115
122
|
</v-expansion-panel>
|
|
116
123
|
|
|
117
124
|
<v-expansion-panel value="credentials" :title="t('jskit.connectors.configurationFields.panels.credentials')">
|
|
118
125
|
<v-expansion-panel-text>
|
|
119
|
-
<v-
|
|
120
|
-
v-if="authenticationOptions.length > 1"
|
|
121
|
-
:label="t('jskit.connectors.configurationFields.authentication.label')" :items="authenticationOptions" :model-value="integration.authentication.method" :disabled="disabled"
|
|
122
|
-
:hint="text(definition.authenticationHint)" :persistent-hint="Boolean(definition.authenticationHint)"
|
|
123
|
-
:error-messages="errors[`${integrationPath}.authentication.method`]"
|
|
124
|
-
@update:model-value="editAuthentication"
|
|
125
|
-
/>
|
|
126
|
-
<template v-for="field in visibleSettings" :key="field.name">
|
|
127
|
-
<v-autocomplete
|
|
128
|
-
v-if="field.searchable"
|
|
129
|
-
:label="text(field.label)" :items="settingItems(field)" :disabled="disabled" auto-select-first
|
|
130
|
-
:model-value="settingValue(field)"
|
|
131
|
-
:hint="settingHint(field)" persistent-hint :error-messages="settingErrors(field)"
|
|
132
|
-
@update:model-value="editSetting(field.name, $event)"
|
|
133
|
-
/>
|
|
126
|
+
<v-defaults-provider root>
|
|
134
127
|
<v-select
|
|
135
|
-
v-
|
|
136
|
-
:label="
|
|
137
|
-
:
|
|
138
|
-
:
|
|
139
|
-
@update:model-value="
|
|
140
|
-
/>
|
|
141
|
-
<v-text-field
|
|
142
|
-
v-else
|
|
143
|
-
:label="text(field.label)" :disabled="disabled" :placeholder="text(field.placeholder)"
|
|
144
|
-
:model-value="settingValue(field) ?? ''"
|
|
145
|
-
:hint="settingHint(field)" persistent-hint :error-messages="settingErrors(field)"
|
|
146
|
-
@update:model-value="editSetting(field.name, $event)"
|
|
128
|
+
v-if="authenticationOptions.length > 1"
|
|
129
|
+
:label="t('jskit.connectors.configurationFields.authentication.label')" :items="authenticationOptions" :model-value="integration.authentication.method" :disabled="disabled"
|
|
130
|
+
:hint="text(definition.authenticationHint)" :persistent-hint="Boolean(definition.authenticationHint)"
|
|
131
|
+
:error-messages="errors[`${integrationPath}.authentication.method`]"
|
|
132
|
+
@update:model-value="editAuthentication"
|
|
147
133
|
/>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
:
|
|
153
|
-
:hint="
|
|
154
|
-
|
|
155
|
-
@update:model-value="editSecretReference"
|
|
134
|
+
<template v-for="field in visibleSettings" :key="field.name">
|
|
135
|
+
<v-autocomplete
|
|
136
|
+
v-if="field.searchable"
|
|
137
|
+
:label="text(field.label)" :items="settingItems(field)" :disabled="disabled" auto-select-first
|
|
138
|
+
:model-value="settingValue(field)"
|
|
139
|
+
:hint="settingHint(field)" persistent-hint :error-messages="settingErrors(field)"
|
|
140
|
+
@update:model-value="editSetting(field.name, $event)"
|
|
156
141
|
/>
|
|
157
|
-
</slot>
|
|
158
|
-
</template>
|
|
159
|
-
<template v-else-if="integration.authentication.method === 'oauth2'">
|
|
160
|
-
<v-select
|
|
161
|
-
:label="t('jskit.connectors.configurationFields.registration.label')" :items="registrationOptions" :model-value="registrationId" :disabled="disabled"
|
|
162
|
-
:error-messages="errors[`${integrationPath}.authentication.registrationRef`]"
|
|
163
|
-
@update:model-value="editIntegration({ authentication: { ...integration.authentication, registrationRef: $event } })"
|
|
164
|
-
/>
|
|
165
|
-
<template v-if="registration?.source === 'own'">
|
|
166
142
|
<v-select
|
|
167
|
-
v-if="
|
|
168
|
-
:label="
|
|
169
|
-
:
|
|
170
|
-
:error-messages="
|
|
171
|
-
@update:model-value="
|
|
143
|
+
v-else-if="field.items"
|
|
144
|
+
:label="text(field.label)" :items="settingItems(field)" :disabled="disabled"
|
|
145
|
+
:model-value="settingValue(field)"
|
|
146
|
+
:hint="settingHint(field)" persistent-hint :error-messages="settingErrors(field)"
|
|
147
|
+
@update:model-value="editSetting(field.name, $event)"
|
|
172
148
|
/>
|
|
173
149
|
<v-text-field
|
|
174
|
-
|
|
175
|
-
:
|
|
176
|
-
|
|
150
|
+
v-else
|
|
151
|
+
:label="text(field.label)" :disabled="disabled" :placeholder="text(field.placeholder)"
|
|
152
|
+
:model-value="settingValue(field) ?? ''"
|
|
153
|
+
:hint="settingHint(field)" persistent-hint :error-messages="settingErrors(field)"
|
|
154
|
+
@update:model-value="editSetting(field.name, $event)"
|
|
177
155
|
/>
|
|
178
|
-
|
|
156
|
+
</template>
|
|
157
|
+
<template v-if="['api-key', 'service-account'].includes(integration.authentication.method)">
|
|
158
|
+
<slot name="credential" :reference="integration.authentication.secretRef" :disabled="disabled">
|
|
179
159
|
<v-text-field
|
|
180
|
-
:label="
|
|
181
|
-
:hint="
|
|
182
|
-
persistent-hint :error-messages="errors[`${
|
|
183
|
-
@update:model-value="
|
|
160
|
+
:label="credentialReference.label" :model-value="integration.authentication.secretRef" :disabled="disabled"
|
|
161
|
+
:hint="credentialReference.hint"
|
|
162
|
+
persistent-hint :error-messages="errors[`${integrationPath}.authentication.secretRef`]"
|
|
163
|
+
@update:model-value="editSecretReference"
|
|
184
164
|
/>
|
|
185
165
|
</slot>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
:error-messages="errors[`${
|
|
191
|
-
@update:model-value="
|
|
166
|
+
</template>
|
|
167
|
+
<template v-else-if="integration.authentication.method === 'oauth2'">
|
|
168
|
+
<v-select
|
|
169
|
+
:label="t('jskit.connectors.configurationFields.registration.label')" :items="registrationOptions" :model-value="registrationId" :disabled="disabled"
|
|
170
|
+
:error-messages="errors[`${integrationPath}.authentication.registrationRef`]"
|
|
171
|
+
@update:model-value="editIntegration({ authentication: { ...integration.authentication, registrationRef: $event } })"
|
|
192
172
|
/>
|
|
193
|
-
<
|
|
173
|
+
<template v-if="registration?.source === 'own'">
|
|
174
|
+
<v-select
|
|
175
|
+
v-if="grantOptions.length > 1"
|
|
176
|
+
:label="t('jskit.connectors.configurationFields.grantType.label')" :items="grantOptions" :model-value="grantType" :disabled="disabled"
|
|
177
|
+
:hint="text(definition.oauthGrantHint)" :persistent-hint="Boolean(definition.oauthGrantHint)"
|
|
178
|
+
:error-messages="errors[`${registrationPath}.grantType`]"
|
|
179
|
+
@update:model-value="editGrantType"
|
|
180
|
+
/>
|
|
181
|
+
<v-text-field
|
|
182
|
+
:label="text(definition.clientIdLabel) || t('jskit.connectors.configurationFields.clientId.label')" :hint="text(definition.clientIdHint)" :persistent-hint="Boolean(definition.clientIdHint)" :model-value="registration.clientId" autocomplete="off" :disabled="disabled"
|
|
183
|
+
:error-messages="errors[`${registrationPath}.clientId`]"
|
|
184
|
+
@update:model-value="editRegistration('clientId', $event)"
|
|
185
|
+
/>
|
|
186
|
+
<slot v-if="registration.tokenEndpointAuthMethod !== 'none'" name="credential" :reference="registration.clientSecretRef" :disabled="disabled">
|
|
187
|
+
<v-text-field
|
|
188
|
+
:label="t('jskit.connectors.configurationFields.clientSecretReference.label')" :model-value="registration.clientSecretRef" :disabled="disabled"
|
|
189
|
+
:hint="clientSecretHint"
|
|
190
|
+
persistent-hint :error-messages="errors[`${registrationPath}.clientSecretRef`]"
|
|
191
|
+
@update:model-value="editRegistration('clientSecretRef', $event)"
|
|
192
|
+
/>
|
|
193
|
+
</slot>
|
|
194
|
+
<v-text-field
|
|
195
|
+
v-if="grantType === 'authorization_code'"
|
|
196
|
+
:hint="t('jskit.connectors.configurationFields.callbackUrlReference.hint')" persistent-hint
|
|
197
|
+
class="mt-4" :label="t('jskit.connectors.configurationFields.callbackUrlReference.label')" :model-value="registration.callbackUrlRef" :disabled="disabled"
|
|
198
|
+
:error-messages="errors[`${registrationPath}.callbackUrlRef`]"
|
|
199
|
+
@update:model-value="editRegistration('callbackUrlRef', $event)"
|
|
200
|
+
/>
|
|
201
|
+
<v-text-field v-if="callbackUrl && grantType === 'authorization_code'" :label="t('jskit.connectors.configurationFields.callbackUrl.label')" :model-value="callbackUrl" readonly />
|
|
202
|
+
</template>
|
|
194
203
|
</template>
|
|
195
|
-
</
|
|
204
|
+
</v-defaults-provider>
|
|
196
205
|
</v-expansion-panel-text>
|
|
197
206
|
</v-expansion-panel>
|
|
198
207
|
|
|
199
208
|
<v-expansion-panel v-if="visibleScopes.length && (definition.scopes.length || definition.permissionsHint || ['oauth2', 'service-account'].includes(integration.authentication.method))" value="permissions" :title="t('jskit.connectors.configurationFields.panels.permissions')">
|
|
200
209
|
<v-expansion-panel-text>
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
v-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
<v-defaults-provider root>
|
|
211
|
+
<p class="text-body-medium mb-3">{{ text(definition.permissionsHint) || t('jskit.connectors.configurationFields.permissions.hint') }}</p>
|
|
212
|
+
<v-checkbox
|
|
213
|
+
v-for="permission in visibleScopes" :key="permission.value"
|
|
214
|
+
:label="text(permission.label)" :value="permission.value" :model-value="integration.scopes" :disabled="disabled || permission.required"
|
|
215
|
+
hide-details @update:model-value="editIntegration({ scopes: $event })"
|
|
216
|
+
/>
|
|
217
|
+
<p v-if="errors[`${integrationPath}.scopes`]" role="alert" class="text-error text-body-small mt-2">
|
|
218
|
+
{{ errors[`${integrationPath}.scopes`] }}
|
|
219
|
+
</p>
|
|
220
|
+
</v-defaults-provider>
|
|
210
221
|
</v-expansion-panel-text>
|
|
211
222
|
</v-expansion-panel>
|
|
212
223
|
<v-expansion-panel v-if="definition.assistantActions?.length" value="assistant" :title="t('jskit.connectors.configurationFields.panels.assistant')">
|
|
213
224
|
<v-expansion-panel-text>
|
|
214
|
-
<
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
v-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
<v-defaults-provider root>
|
|
226
|
+
<p class="text-body-medium mb-3">{{ t('jskit.connectors.configurationFields.assistant.hint') }}</p>
|
|
227
|
+
<v-switch
|
|
228
|
+
:label="t('jskit.connectors.configurationFields.assistant.enabled.label')" :model-value="integration.assistantPolicy?.enabled ?? true" :disabled="disabled"
|
|
229
|
+
:error-messages="errors[`${integrationPath}.assistantPolicy.enabled`]"
|
|
230
|
+
@update:model-value="editAssistantPolicy({ enabled: $event })"
|
|
231
|
+
/>
|
|
232
|
+
<v-select
|
|
233
|
+
:label="t('jskit.connectors.configurationFields.assistant.defaultPermission.label')" :items="assistantPermissions" :model-value="integration.assistantPolicy?.defaultPermission || 'ask'"
|
|
234
|
+
:disabled="disabled || integration.assistantPolicy?.enabled === false"
|
|
235
|
+
:hint="t('jskit.connectors.configurationFields.assistant.defaultPermission.hint')" persistent-hint
|
|
236
|
+
:error-messages="errors[`${integrationPath}.assistantPolicy.defaultPermission`]"
|
|
237
|
+
@update:model-value="editAssistantPolicy({ defaultPermission: $event, actions: {} })"
|
|
238
|
+
/>
|
|
239
|
+
<v-select
|
|
240
|
+
v-for="action in definition.assistantActions" :key="action.value" :label="text(action.label)" :items="assistantPermissions"
|
|
241
|
+
:model-value="integration.assistantPolicy?.actions?.[action.value] || integration.assistantPolicy?.defaultPermission || 'ask'"
|
|
242
|
+
:disabled="disabled || integration.assistantPolicy?.enabled === false"
|
|
243
|
+
:error-messages="errors[`${integrationPath}.assistantPolicy.actions.${action.value}`]"
|
|
244
|
+
@update:model-value="editAssistantPolicy({ actions: { ...integration.assistantPolicy?.actions, [action.value]: $event } })"
|
|
245
|
+
/>
|
|
246
|
+
</v-defaults-provider>
|
|
234
247
|
</v-expansion-panel-text>
|
|
235
248
|
</v-expansion-panel>
|
|
236
249
|
</v-expansion-panels>
|