dsh-hello 0.1.2 → 0.1.4
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/LICENSE +21 -21
- package/README.md +8 -7
- package/cordis.patch.yml +3 -3
- package/lib/client.js +89 -35
- package/lib/config.d.ts +9 -7
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +2 -2
- package/lib/config.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4696 -112
- package/lib/index.js.map +4 -4
- package/lib/interactions.d.ts +4 -0
- package/lib/interactions.d.ts.map +1 -1
- package/lib/interactions.js +20 -9
- package/lib/interactions.js.map +1 -1
- package/lib/routes.d.ts +4 -0
- package/lib/routes.d.ts.map +1 -1
- package/lib/routes.js +23 -3
- package/lib/routes.js.map +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 xdnote
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xdnote
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -248,7 +248,7 @@ the app probes `/dsh-hello/health`, and pairings live under `dsh-hello/*`.
|
|
|
248
248
|
pairingTtlMs: 300000
|
|
249
249
|
pairingCodeLength: 4
|
|
250
250
|
pairingMaxAttempts: 8
|
|
251
|
-
interactionTarget: browser-
|
|
251
|
+
interactionTarget: browser-only # browser-only | browser-first | phone-first (Default | DSH first | Device first)
|
|
252
252
|
approvalWaitTimeoutMs: 120000
|
|
253
253
|
questionWaitTimeoutMs: 120000
|
|
254
254
|
allowSessionWideGrants: true
|
|
@@ -378,13 +378,14 @@ watermarks are shared across paired devices.
|
|
|
378
378
|
### Approval policy
|
|
379
379
|
|
|
380
380
|
dsh hands an approval or a question to **one** answerer: the first listener that
|
|
381
|
-
does not call `next()`. `interactionTarget` decides who that is
|
|
381
|
+
does not call `next()`. `interactionTarget` decides who that is; the admin page
|
|
382
|
+
calls the same three choices Default, DSH first and Device first.
|
|
382
383
|
|
|
383
|
-
| Value | Who answers |
|
|
384
|
-
|
|
385
|
-
|
|
|
386
|
-
| `
|
|
387
|
-
| `
|
|
384
|
+
| Admin label | Value | Who answers |
|
|
385
|
+
|---|---|---|
|
|
386
|
+
| Default (default) | `browser-only` | Nobody here: the plugin registers no listener, so dsh behaves exactly as if it were not installed. The app shows a read-only prompt and hands the decision to the Web UI. |
|
|
387
|
+
| DSH first | `browser-first` | A live web UI always answers. With no browser connected the app holds the request, even in the background. |
|
|
388
|
+
| Device first | `phone-first` | A foreground app answers, even when a browser is connected; otherwise dsh's own listeners do. |
|
|
388
389
|
|
|
389
390
|
The plugin registers unscoped (`global`) waterfall listeners ahead of the
|
|
390
391
|
browser's answerer, so the policy rather than listener order decides. dsh 0.2.2
|
package/cordis.patch.yml
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
- insert:
|
|
2
|
-
- id: dsh-hello
|
|
3
|
-
name: dsh-hello
|
|
1
|
+
- insert:
|
|
2
|
+
- id: dsh-hello
|
|
3
|
+
name: dsh-hello
|
package/lib/client.js
CHANGED
|
@@ -36,6 +36,7 @@ window.__ModuleLoader__.load({
|
|
|
36
36
|
.dd-head{padding:0 0 18px}
|
|
37
37
|
.dd-title{font-size:18px;font-weight:600;margin:0 0 4px;color:var(--dsw-alias-label-primary)}
|
|
38
38
|
.dd-desc{margin:0;font-size:13px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
|
|
39
|
+
.dd-oneLine{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
39
40
|
.dd-row{display:flex;gap:24px;align-items:center;justify-content:space-between;padding:16px 0;border-bottom:0.5px solid var(--dsw-alias-border-l3,rgba(127,127,127,.22))}
|
|
40
41
|
.dd-rowTop{flex-wrap:wrap;row-gap:10px}
|
|
41
42
|
.dd-rowTop .dd-rowText{flex:1 1 240px}
|
|
@@ -94,6 +95,13 @@ window.__ModuleLoader__.load({
|
|
|
94
95
|
lockHintOn: '已锁定:新设备无法配对,已连接的设备照常使用',
|
|
95
96
|
oneTimeMode: '一次性',
|
|
96
97
|
fixedMode: '永久性',
|
|
98
|
+
interactionTitle: '审批与提问',
|
|
99
|
+
interactionDefault: '默认',
|
|
100
|
+
interactionDshFirst: 'DSH 优先',
|
|
101
|
+
interactionDeviceFirst: '设备优先',
|
|
102
|
+
interactionHintDefault: '不发给手机,只在网页处理',
|
|
103
|
+
interactionHintDshFirst: '网页开着时由网页作答',
|
|
104
|
+
interactionHintDeviceFirst: '优先发给正在使用的设备',
|
|
97
105
|
remaining: '剩余 {time}',
|
|
98
106
|
reset: '重置',
|
|
99
107
|
modify: '修改',
|
|
@@ -105,8 +113,6 @@ window.__ModuleLoader__.load({
|
|
|
105
113
|
passwordInvalid: '请输入 4 位数字',
|
|
106
114
|
confirm: '确定',
|
|
107
115
|
cancel: '取消',
|
|
108
|
-
resetTitle: '恢复为一次性配对码?',
|
|
109
|
-
resetDesc: '当前永久码会立即失效,并生成新的一次性码。',
|
|
110
116
|
qrTitle: '扫码/输入',
|
|
111
117
|
qrLoading: '二维码加载中…',
|
|
112
118
|
qrHint: '请用手机打开 DSH Hello,连接 → 添加服务器 → 使用插件配对 → 扫描二维码。',
|
|
@@ -135,6 +141,13 @@ window.__ModuleLoader__.load({
|
|
|
135
141
|
lockHintOn: 'Locked: new devices cannot pair, while paired devices keep working',
|
|
136
142
|
oneTimeMode: 'One-time',
|
|
137
143
|
fixedMode: 'Permanent',
|
|
144
|
+
interactionTitle: 'Approvals & questions',
|
|
145
|
+
interactionDefault: 'Default',
|
|
146
|
+
interactionDshFirst: 'DSH first',
|
|
147
|
+
interactionDeviceFirst: 'Device first',
|
|
148
|
+
interactionHintDefault: 'Web UI only; nothing reaches devices',
|
|
149
|
+
interactionHintDshFirst: 'The open web UI answers first',
|
|
150
|
+
interactionHintDeviceFirst: 'The device in use answers first',
|
|
138
151
|
remaining: '{time} left',
|
|
139
152
|
reset: 'Reset',
|
|
140
153
|
modify: 'Change',
|
|
@@ -146,8 +159,6 @@ window.__ModuleLoader__.load({
|
|
|
146
159
|
passwordInvalid: 'Enter four digits',
|
|
147
160
|
confirm: 'Confirm',
|
|
148
161
|
cancel: 'Cancel',
|
|
149
|
-
resetTitle: 'Restore one-time pairing?',
|
|
150
|
-
resetDesc: 'The permanent code stops working immediately and a fresh one-time code is generated.',
|
|
151
162
|
qrTitle: 'Scan or type',
|
|
152
163
|
qrLoading: 'Loading QR…',
|
|
153
164
|
qrHint: 'Open DSH Hello on your phone, then Connection → Add server → Plugin pairing → Scan QR code.',
|
|
@@ -268,6 +279,9 @@ window.__ModuleLoader__.load({
|
|
|
268
279
|
|
|
269
280
|
const fixed = data?.fixed === true
|
|
270
281
|
const locked = data?.locked === true
|
|
282
|
+
const interaction = data?.interactionTarget === 'phone-first' || data?.interactionTarget === 'browser-only'
|
|
283
|
+
? data.interactionTarget
|
|
284
|
+
: 'browser-first'
|
|
271
285
|
const remaining = !fixed && data ? Math.max(0, data.expiresAt - now) : null
|
|
272
286
|
const left = remaining === null
|
|
273
287
|
? ''
|
|
@@ -295,15 +309,33 @@ window.__ModuleLoader__.load({
|
|
|
295
309
|
}
|
|
296
310
|
}
|
|
297
311
|
|
|
312
|
+
async function setInteractionTarget(target) {
|
|
313
|
+
setBusy(true)
|
|
314
|
+
setError(null)
|
|
315
|
+
try {
|
|
316
|
+
const response = await fetch(BASE + '/admin/interaction' + adminBaseQuery(), {
|
|
317
|
+
method: 'POST',
|
|
318
|
+
credentials: 'same-origin',
|
|
319
|
+
headers: { 'content-type': 'application/json' },
|
|
320
|
+
body: JSON.stringify({ target }),
|
|
321
|
+
})
|
|
322
|
+
if (!response.ok) {
|
|
323
|
+
const body = await response.json().catch(() => null)
|
|
324
|
+
throw new Error(body?.error?.message || t('operationFailed'))
|
|
325
|
+
}
|
|
326
|
+
setData(await response.json())
|
|
327
|
+
} catch (failure) {
|
|
328
|
+
setError(failure instanceof Error ? failure.message : String(failure))
|
|
329
|
+
} finally {
|
|
330
|
+
setBusy(false)
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
298
334
|
const openPermanent = () => {
|
|
299
335
|
setPassword('')
|
|
300
336
|
setDialogError(null)
|
|
301
337
|
setDialog('permanent')
|
|
302
338
|
}
|
|
303
|
-
const openReset = () => {
|
|
304
|
-
setDialogError(null)
|
|
305
|
-
setDialog('reset')
|
|
306
|
-
}
|
|
307
339
|
/**
|
|
308
340
|
* One three-way switch: Lock, One-time, Permanent. Unlocking restores
|
|
309
341
|
* whichever code mode was in force, so switching from Lock to another
|
|
@@ -316,7 +348,9 @@ window.__ModuleLoader__.load({
|
|
|
316
348
|
return
|
|
317
349
|
}
|
|
318
350
|
if (locked) await setLocked(false)
|
|
319
|
-
|
|
351
|
+
// Picking One-time drops the permanent code on the spot: the switch
|
|
352
|
+
// states the intent, so it must not ask a second time.
|
|
353
|
+
if (next === 'one-time' && fixed) { await perform({ action: 'auto' }); return }
|
|
320
354
|
if (next === 'permanent' && !fixed) openPermanent()
|
|
321
355
|
}
|
|
322
356
|
const confirmPermanent = async () => {
|
|
@@ -333,14 +367,6 @@ window.__ModuleLoader__.load({
|
|
|
333
367
|
setDialog(null)
|
|
334
368
|
setPassword('')
|
|
335
369
|
}
|
|
336
|
-
const confirmReset = async () => {
|
|
337
|
-
const failure = await perform({ action: 'auto' })
|
|
338
|
-
if (failure !== null) {
|
|
339
|
-
setDialogError(failure)
|
|
340
|
-
return
|
|
341
|
-
}
|
|
342
|
-
setDialog(null)
|
|
343
|
-
}
|
|
344
370
|
|
|
345
371
|
const revokeDevice = async (device) => {
|
|
346
372
|
const name = device.deviceName || String(device.deviceId || '').slice(0, 12)
|
|
@@ -445,7 +471,7 @@ window.__ModuleLoader__.load({
|
|
|
445
471
|
h('div', { className: 'dd-control' },
|
|
446
472
|
fixed
|
|
447
473
|
? h(Button, {
|
|
448
|
-
variant: '
|
|
474
|
+
variant: 'primary',
|
|
449
475
|
size: 'sm',
|
|
450
476
|
disabled: busy,
|
|
451
477
|
onClick: openPermanent,
|
|
@@ -462,6 +488,40 @@ window.__ModuleLoader__.load({
|
|
|
462
488
|
),
|
|
463
489
|
],
|
|
464
490
|
|
|
491
|
+
h('div', { className: 'dd-row dd-rowTop' },
|
|
492
|
+
h('div', { className: 'dd-rowText' },
|
|
493
|
+
h('span', { className: 'dd-label' }, t('interactionTitle')),
|
|
494
|
+
h('span', { className: 'dd-desc dd-oneLine' },
|
|
495
|
+
interaction === 'phone-first'
|
|
496
|
+
? t('interactionHintDeviceFirst')
|
|
497
|
+
: interaction === 'browser-first'
|
|
498
|
+
? t('interactionHintDshFirst')
|
|
499
|
+
: t('interactionHintDefault')),
|
|
500
|
+
),
|
|
501
|
+
h('div', { className: 'dd-control' },
|
|
502
|
+
h('div', { className: 'dd-segment' },
|
|
503
|
+
h('button', {
|
|
504
|
+
type: 'button',
|
|
505
|
+
className: 'dd-segmentButton' + (interaction === 'browser-only' ? ' is-active' : ''),
|
|
506
|
+
disabled: busy || data === null,
|
|
507
|
+
onClick: () => { void setInteractionTarget('browser-only') },
|
|
508
|
+
}, t('interactionDefault')),
|
|
509
|
+
h('button', {
|
|
510
|
+
type: 'button',
|
|
511
|
+
className: 'dd-segmentButton' + (interaction === 'browser-first' ? ' is-active' : ''),
|
|
512
|
+
disabled: busy || data === null,
|
|
513
|
+
onClick: () => { void setInteractionTarget('browser-first') },
|
|
514
|
+
}, t('interactionDshFirst')),
|
|
515
|
+
h('button', {
|
|
516
|
+
type: 'button',
|
|
517
|
+
className: 'dd-segmentButton' + (interaction === 'phone-first' ? ' is-active' : ''),
|
|
518
|
+
disabled: busy || data === null,
|
|
519
|
+
onClick: () => { void setInteractionTarget('phone-first') },
|
|
520
|
+
}, t('interactionDeviceFirst')),
|
|
521
|
+
),
|
|
522
|
+
),
|
|
523
|
+
),
|
|
524
|
+
|
|
465
525
|
h('div', { className: 'dd-block' },
|
|
466
526
|
h('span', { className: 'dd-label' }, t('devices')),
|
|
467
527
|
h('div', { className: 'dd-devices' },
|
|
@@ -506,23 +566,17 @@ window.__ModuleLoader__.load({
|
|
|
506
566
|
},
|
|
507
567
|
h('div', { className: 'dd-modal', role: 'dialog', 'aria-modal': 'true' },
|
|
508
568
|
h('h3', { className: 'dd-modalTitle' },
|
|
509
|
-
|
|
510
|
-
? (fixed ? t('modifyTitle') : t('setPermanentTitle'))
|
|
511
|
-
: t('resetTitle')),
|
|
569
|
+
fixed ? t('modifyTitle') : t('setPermanentTitle')),
|
|
512
570
|
h('p', { className: 'dd-desc' },
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
autoComplete: 'off',
|
|
523
|
-
onChange: event => setPassword(event.target.value.replace(/\D/g, '').slice(0, 4)),
|
|
524
|
-
})
|
|
525
|
-
: null,
|
|
571
|
+
fixed ? t('modifyDesc') : t('setPermanentDesc')),
|
|
572
|
+
h(Input, {
|
|
573
|
+
className: 'dd-modalInput',
|
|
574
|
+
value: password,
|
|
575
|
+
placeholder: t('passwordPlaceholder'),
|
|
576
|
+
autoFocus: true,
|
|
577
|
+
autoComplete: 'off',
|
|
578
|
+
onChange: event => setPassword(event.target.value.replace(/\D/g, '').slice(0, 4)),
|
|
579
|
+
}),
|
|
526
580
|
dialogError === null ? null : h('p', { className: 'dd-error' }, dialogError),
|
|
527
581
|
h('div', { className: 'dd-modalActions' },
|
|
528
582
|
h(Button, {
|
|
@@ -535,7 +589,7 @@ window.__ModuleLoader__.load({
|
|
|
535
589
|
variant: 'primary',
|
|
536
590
|
size: 'sm',
|
|
537
591
|
disabled: busy,
|
|
538
|
-
onClick: () => { void
|
|
592
|
+
onClick: () => { void confirmPermanent() },
|
|
539
593
|
}, t('confirm')),
|
|
540
594
|
),
|
|
541
595
|
)),
|
package/lib/config.d.ts
CHANGED
|
@@ -68,13 +68,15 @@ export interface Config {
|
|
|
68
68
|
*
|
|
69
69
|
* dsh dispatches both through one agent-scoped waterfall, so exactly one
|
|
70
70
|
* answerer sees a request: whoever holds it first. This switch decides who
|
|
71
|
-
* that is.
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* - `browser-
|
|
77
|
-
*
|
|
71
|
+
* that is. The admin page offers the same three choices as Default, DSH
|
|
72
|
+
* first and Device first.
|
|
73
|
+
* - `browser-only` (Default): this plugin never answers - dsh behaves as if
|
|
74
|
+
* it were not installed - and the app only shows a prompt that opens the
|
|
75
|
+
* Web UI.
|
|
76
|
+
* - `browser-first` (DSH first): a live web UI always answers; the app holds
|
|
77
|
+
* only when no browser is connected (phone-only, on the go).
|
|
78
|
+
* - `phone-first` (Device first): the app holds requests while it is in the
|
|
79
|
+
* foreground; anything else falls through to dsh's own listeners.
|
|
78
80
|
*/
|
|
79
81
|
interactionTarget: InteractionTarget;
|
|
80
82
|
/** How long an approval request is held for the app before delegation. */
|
package/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAE7C,MAAM,WAAW,UAAU;IACzB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,GAAG,KAAK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M,CAAA;IACpB,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAA;IACvB;;;;;;;;;;;;;;OAcG;IACH,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,0EAA0E;IAC1E,qBAAqB,EAAE,MAAM,CAAA;IAC7B,sEAAsE;IACtE,qBAAqB,EAAE,MAAM,CAAA;IAC7B;;;;OAIG;IACH,sBAAsB,EAAE,OAAO,CAAA;IAC/B;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAA;IAC1B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,iBAAiB,EAAE,MAAM,CAAA;IACzB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,eAAe,EAAE,MAAM,CAAA;IACvB,0BAA0B;IAC1B,IAAI,EAAE,UAAU,CAAA;CACjB;AAED,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CAsChC,CAAA;AAEF,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,CAmD1E;AAUD,eAAO,MAAM,iBAAiB,EAAE,UAM/B,CAAA"}
|
package/lib/config.js
CHANGED
|
@@ -13,7 +13,7 @@ export const Config = Schema.object({
|
|
|
13
13
|
pairingMaxAttempts: Schema.number().default(8),
|
|
14
14
|
pairingCode: Schema.string(),
|
|
15
15
|
logPairingCode: Schema.boolean().default(true),
|
|
16
|
-
interactionTarget: Schema.union(['phone-first', 'browser-first', 'browser-only']).default('browser-
|
|
16
|
+
interactionTarget: Schema.union(['phone-first', 'browser-first', 'browser-only']).default('browser-only'),
|
|
17
17
|
approvalWaitTimeoutMs: Schema.number().default(2 * 60 * 1000),
|
|
18
18
|
questionWaitTimeoutMs: Schema.number().default(2 * 60 * 1000),
|
|
19
19
|
allowSessionWideGrants: Schema.boolean().default(true),
|
|
@@ -55,7 +55,7 @@ export function normalizeConfig(input) {
|
|
|
55
55
|
pairingCodeLength: raw.pairingCodeLength ?? 4,
|
|
56
56
|
pairingMaxAttempts: raw.pairingMaxAttempts ?? 8,
|
|
57
57
|
logPairingCode: raw.logPairingCode ?? true,
|
|
58
|
-
interactionTarget: raw.interactionTarget ?? 'browser-
|
|
58
|
+
interactionTarget: raw.interactionTarget ?? 'browser-only',
|
|
59
59
|
approvalWaitTimeoutMs: raw.approvalWaitTimeoutMs ?? 2 * 60 * 1000,
|
|
60
60
|
questionWaitTimeoutMs: raw.questionWaitTimeoutMs ?? 2 * 60 * 1000,
|
|
61
61
|
allowSessionWideGrants: raw.allowSessionWideGrants ?? true,
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,0BAA0B,CAAA;AA4G7C,MAAM,CAAC,MAAM,MAAM,GAAmB,MAAM,CAAC,MAAM,CAAC;IAClD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;IAC/C,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACvD,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC9C,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAChD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;IACpD,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC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AyC,CAAC,CAAA;IACxF,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACnD,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAA;IACvF,OAAO,eAAe,CAAA;AACxB,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAe;IAC3C,QAAQ,EAAE,MAAM;IAChB,eAAe,EAAE,YAAY;IAC7B,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,IAAI;CACrB,CAAA"}
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAmB,KAAK,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAGlF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAK5C,OAAO,EAAuB,eAAe,EAAE,MAAM,eAAe,CAAA;AAMpE,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,YAAY,EAAE,MAAM,IAAI,YAAY,EAAE,CAAA;AACtC,eAAO,MAAM,IAAI,cAAc,CAAA;AAE/B;;;;GAIG;AACH,eAAO,MAAM,MAAM,UAAoD,CAAA;AAIvE;;;;GAIG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAmB,KAAK,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAGlF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAK5C,OAAO,EAAuB,eAAe,EAAE,MAAM,eAAe,CAAA;AAMpE,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,YAAY,EAAE,MAAM,IAAI,YAAY,EAAE,CAAA;AACtC,eAAO,MAAM,IAAI,cAAc,CAAA;AAE/B;;;;GAIG;AACH,eAAO,MAAM,MAAM,UAAoD,CAAA;AAIvE;;;;GAIG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmJ9F;AAmGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|