@numa-tech/numa 1.25.0 → 1.26.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.
- package/dist/business-issuer.js +3 -1
- package/dist/business-issuer.js.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/kb/catalog.js +33 -2
- package/dist/kb/catalog.js.map +1 -1
- package/dist/kb/chat-stream.d.ts +5 -0
- package/dist/kb/chat-stream.js +61 -0
- package/dist/kb/chat-stream.js.map +1 -0
- package/dist/kb/client.d.ts +75 -6
- package/dist/kb/client.js +104 -7
- package/dist/kb/client.js.map +1 -1
- package/dist/kb/commands.js +92 -7
- package/dist/kb/commands.js.map +1 -1
- package/dist/kb/config.d.ts +14 -2
- package/dist/kb/config.js +21 -7
- package/dist/kb/config.js.map +1 -1
- package/dist/kb/management-commands.d.ts +7 -0
- package/dist/kb/management-commands.js +86 -0
- package/dist/kb/management-commands.js.map +1 -0
- package/dist/kb/management-schemas.d.ts +106 -0
- package/dist/kb/management-schemas.js +33 -0
- package/dist/kb/management-schemas.js.map +1 -0
- package/dist/kb/transfers.d.ts +4 -0
- package/dist/kb/transfers.js +11 -4
- package/dist/kb/transfers.js.map +1 -1
- package/dist/kb/upload-decisions.d.ts +28 -0
- package/dist/kb/upload-decisions.js +23 -0
- package/dist/kb/upload-decisions.js.map +1 -0
- package/dist/kb/upload-state.d.ts +1 -0
- package/dist/kb/upload-state.js +1 -0
- package/dist/kb/upload-state.js.map +1 -1
- package/dist/kb/web-login.d.ts +10 -0
- package/dist/kb/web-login.js +25 -0
- package/dist/kb/web-login.js.map +1 -0
- package/dist/kb/web-page.d.ts +3 -0
- package/dist/kb/web-page.js +114 -0
- package/dist/kb/web-page.js.map +1 -0
- package/dist/kb/web-queue.d.ts +61 -0
- package/dist/kb/web-queue.js +101 -0
- package/dist/kb/web-queue.js.map +1 -0
- package/dist/kb/web.d.ts +26 -0
- package/dist/kb/web.js +234 -0
- package/dist/kb/web.js.map +1 -0
- package/dist/local-web/context-menu.d.ts +2 -0
- package/dist/local-web/context-menu.js +53 -0
- package/dist/local-web/context-menu.js.map +1 -0
- package/dist/local-web/file-workspace-style.d.ts +2 -0
- package/dist/local-web/file-workspace-style.js +58 -0
- package/dist/local-web/file-workspace-style.js.map +1 -0
- package/dist/local-web/file-workspace.d.ts +2 -0
- package/dist/local-web/file-workspace.js +39 -0
- package/dist/local-web/file-workspace.js.map +1 -0
- package/dist/local-web/security.d.ts +6 -0
- package/dist/local-web/security.js +51 -0
- package/dist/local-web/security.js.map +1 -0
- package/dist/login-recovery.js +7 -2
- package/dist/login-recovery.js.map +1 -1
- package/dist/oss/transfer-queue.d.ts +7 -51
- package/dist/oss/transfer-queue.js +15 -308
- package/dist/oss/transfer-queue.js.map +1 -1
- package/dist/oss/web-page.js +21 -103
- package/dist/oss/web-page.js.map +1 -1
- package/dist/oss/web.js +4 -45
- package/dist/oss/web.js.map +1 -1
- package/dist/platform-profile.d.ts +25 -1
- package/dist/platform-profile.js +44 -1
- package/dist/platform-profile.js.map +1 -1
- package/dist/transfers/persistent-queue.d.ts +65 -0
- package/dist/transfers/persistent-queue.js +312 -0
- package/dist/transfers/persistent-queue.js.map +1 -0
- package/docs/design/kb-capability-upgrade.md +36 -0
- package/docs/design/kb-web-workspace.md +97 -0
- package/docs/kb-access.md +72 -0
- package/package.json +9 -7
- package/scripts/export-kb-contract.py +25 -6
- package/src/kb/openapi-contract.json +2297 -566
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** Embedded in both local workspaces; actions remain owned by their business adapters. */
|
|
2
|
+
export const LOCAL_CONTEXT_MENU_JS = String.raw `
|
|
3
|
+
function createLocalContextMenu(menu, onClose = () => {}) {
|
|
4
|
+
let owner = null;
|
|
5
|
+
function close(restore = false) {
|
|
6
|
+
onClose(); menu.hidden = true;
|
|
7
|
+
if (restore) owner?.focus();
|
|
8
|
+
}
|
|
9
|
+
function begin(event, anchor, parent = document.body) {
|
|
10
|
+
event.preventDefault(); close();
|
|
11
|
+
owner = anchor || event.currentTarget;
|
|
12
|
+
parent.append(menu); menu.replaceChildren();
|
|
13
|
+
}
|
|
14
|
+
function item(label, action, options = {}) {
|
|
15
|
+
const button = document.createElement('button');
|
|
16
|
+
button.textContent = label;
|
|
17
|
+
button.setAttribute('role', 'menuitem');
|
|
18
|
+
button.setAttribute('aria-disabled', String(Boolean(options.disabled)));
|
|
19
|
+
if (options.danger) button.className = 'danger';
|
|
20
|
+
button.onclick = () => {
|
|
21
|
+
if (options.disabled) { options.onDisabled?.(button); return; }
|
|
22
|
+
close(); action();
|
|
23
|
+
};
|
|
24
|
+
menu.append(button); return button;
|
|
25
|
+
}
|
|
26
|
+
function show(event, anchor) {
|
|
27
|
+
menu.hidden = false;
|
|
28
|
+
const bounds = anchor?.getBoundingClientRect();
|
|
29
|
+
menu.style.left = Math.max(8, Math.min(bounds ? bounds.left : event.clientX, window.innerWidth - menu.offsetWidth - 8)) + 'px';
|
|
30
|
+
menu.style.top = Math.max(8, Math.min(bounds ? bounds.bottom : event.clientY, window.innerHeight - menu.offsetHeight - 8)) + 'px';
|
|
31
|
+
[...menu.children].find(button => !button.disabled)?.focus();
|
|
32
|
+
}
|
|
33
|
+
document.addEventListener('click', event => { if (!menu.contains(event.target)) close(); });
|
|
34
|
+
document.addEventListener('keydown', event => {
|
|
35
|
+
if (menu.hidden) return;
|
|
36
|
+
if (event.key === 'Escape' || event.key === 'Tab') {
|
|
37
|
+
if (event.key === 'Escape') event.preventDefault();
|
|
38
|
+
close(true); return;
|
|
39
|
+
}
|
|
40
|
+
if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
const buttons = [...menu.children].filter(button => !button.disabled);
|
|
43
|
+
const index = buttons.indexOf(document.activeElement);
|
|
44
|
+
const next = event.key === 'Home' ? 0 : event.key === 'End' ? buttons.length - 1
|
|
45
|
+
: (index + (event.key === 'ArrowDown' ? 1 : buttons.length - 1)) % buttons.length;
|
|
46
|
+
buttons[next]?.focus();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
document.addEventListener('scroll', () => close(), true);
|
|
50
|
+
return { begin, item, show, close };
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../../src/local-web/context-menu.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD9C,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Shared local file workspace styling; OSS-specific controls are optional slots. */
|
|
2
|
+
export const FILE_WORKSPACE_CSS = String.raw `
|
|
3
|
+
.file-menu{position:fixed;z-index:20;min-width:175px;padding:5px;background:white;border:1px solid #d4ded6;border-radius:8px;box-shadow:0 8px 28px #20372e26}.file-menu button{display:block;width:100%;border:0;text-align:left;padding:9px 12px}.file-menu button:focus{background:#eff5f1}.file-menu button[aria-disabled=true]{color:#99a49e}.permission-tip{position:fixed;z-index:30;max-width:min(330px,calc(100vw - 16px));padding:10px 12px;background:#263c31;color:#fff;border-radius:6px;box-shadow:0 6px 24px #20372e26;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
|
|
4
|
+
#statistics-result{display:grid;grid-template-columns:100px 1fr;gap:12px;margin:20px 0;font-variant-numeric:tabular-nums}#statistics-result dd{margin:0;font-weight:600}#statistics-status{margin-top:10px}
|
|
5
|
+
#statistics-dialog{width:min(640px,90vw);max-width:90vw;max-height:90vh;overflow:auto}#statistics-result dd{overflow-wrap:anywhere}.statistics-table{margin:22px 0 10px}.statistics-table caption{text-align:left;font-weight:600;margin-bottom:6px}.statistics-table th:first-child,.statistics-table td:first-child{width:44%;overflow-wrap:anywhere}.statistics-table th:not(:first-child),.statistics-table td:not(:first-child){text-align:right;font-variant-numeric:tabular-nums}.statistics-table td{color:#4a6554}#statistics-dialog .dialog-actions{position:sticky;bottom:-26px;background:#fff;padding:14px 0;margin-top:10px}
|
|
6
|
+
#links-dialog{width:min(680px,90vw);max-width:90vw;max-height:90vh;overflow:auto}#links-expires{margin-left:12px;max-width:100%}.links-renew{margin-top:12px;white-space:normal}#links-session-hint{margin:8px 0 12px}#links-result article{border-top:1px solid #dbe3de;padding:14px 0}#links-result h3{font-size:13px;overflow-wrap:anywhere;margin:0 0 8px}#links-result textarea{width:100%;font:11px/1.6 ui-monospace,monospace;resize:vertical;overflow-wrap:anywhere;min-height:72px}#links-result .link-copy{display:flex;align-items:center;gap:8px}#links-status{overflow-wrap:anywhere}#links-dialog .dialog-actions{position:sticky;bottom:-26px;background:white;padding:14px 0}
|
|
7
|
+
#operation-dialog{max-height:90vh;overflow:auto;width:min(520px,90vw)}
|
|
8
|
+
#destination-picker{margin-top:16px}#destination-hint{font-size:12px;margin-bottom:8px}.destination-tree{max-height:260px;overflow:auto;border:1px solid #dbe3de;border-radius:6px;padding:6px;background:#fafcfb}.destination-children{padding-left:18px}.destination-line{display:flex;align-items:center;gap:4px;min-height:34px;border-radius:4px}.destination-line button{border:0;background:transparent;padding:6px;color:#344b41}.destination-toggle{width:28px;flex-shrink:0}.destination-name{display:flex;align-items:center;gap:8px;flex:1;min-width:0;text-align:left;white-space:normal;overflow-wrap:anywhere}.destination-name .folder-icon{flex-shrink:0}.destination-item[aria-selected=true]>.destination-line{background:#dfede3}.destination-item:focus{outline:none}.destination-item:focus-visible>.destination-line{outline:2px solid #16805a;outline-offset:-2px}.destination-status{font-size:11px;color:#7b8d81;margin-left:32px}.destination-more{font-size:12px;margin:4px 0 4px 32px}.destination-editor{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 6px 32px}.destination-editor input{width:100%;min-width:0;padding:7px;border:1px solid #cbd9cf;border-radius:4px;background:white;color:#23322e}.destination-editor button{font-size:12px;padding:6px 9px}
|
|
9
|
+
#operation-dialog label{display:block;font-size:12px;margin:16px 0 8px}#operation-value{width:100%;border:1px solid #cbd9cf;padding:10px;border-radius:5px;color:#23322e}#operation-source{overflow-wrap:anywhere}#operation-help{margin-top:10px}#operation-error{color:#a7473d}
|
|
10
|
+
.operations-panel{flex-shrink:0;background:#f0f6f2;border-top:1px solid #cbd9cf;max-height:24vh;overflow:auto;padding:10px 26px;font-size:12px}.operations-panel>p{font-size:11px;color:#74867b;margin-top:5px}.operation-row{display:flex;align-items:center;gap:12px;padding:5px 0}.operation-row span{flex:1;overflow-wrap:anywhere}.operation-row button{font-size:12px;padding:5px 10px}.upload-actions{flex-wrap:wrap;justify-content:flex-end}
|
|
11
|
+
|
|
12
|
+
.icon-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-width:34px;min-height:34px}
|
|
13
|
+
:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;color:#23322e;background:#f5f7f5;font-size:14px;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,select{cursor:pointer}button{border:1px solid #d8e0db;background:white;color:#344b41;border-radius:6px;padding:8px 12px;white-space:nowrap}button:hover:not(:disabled){background:#eff5f1;border-color:#a5bcae}button:disabled{opacity:.4;cursor:not-allowed}input:focus-visible,button:focus-visible,select:focus-visible{outline:2px solid #16805a;outline-offset:2px}input[type=checkbox]{accent-color:#197854;width:15px;height:15px;cursor:pointer}input[type=search]{border:1px solid #dbe3de;border-radius:6px;padding:9px 12px;min-width:160px;background:#fafcfb;color:#23322e}select{border:0;background:transparent;color:#263d31;max-width:100%;padding:6px 24px 6px 0;font-weight:550}h1,h2,p{margin:0}h1{font-size:27px;letter-spacing:-.7px;font-weight:600}h2{font-size:15px;font-weight:600}.topbar{height:62px;padding:0 26px;background:#20372e;color:#ecf4ed;display:flex;align-items:center;gap:20px}.brand{font-size:24px;letter-spacing:-1px;font-weight:650;color:inherit;text-decoration:none}.brand span{font-size:16px;font-weight:400;letter-spacing:.5px;color:#a9c0b0;margin-left:12px}.local{font-size:11px;color:#cee0d5;display:flex;align-items:center;gap:6px}.local i{height:6px;width:6px;background:#8edaac;border-radius:50%}.topnote{margin-left:auto;color:#aac0b2;font-size:12px;letter-spacing:2px}.authorization{display:flex;align-items:center;justify-content:space-between;gap:24px;background:#fff;border-bottom:1px solid #dbe3de;padding:16px 26px}.grant-field{min-width:0;display:flex;align-items:center;gap:12px;flex:1}.grant-field label{font-size:12px;color:#7a8c80;white-space:nowrap}.session-controls{display:flex;align-items:center;gap:18px;flex-shrink:0}.expiry{display:flex;align-items:center;gap:10px;font-size:11px;color:#718076}.expiry strong{font-family:ui-monospace,SFMono-Regular,monospace;color:#2b674c;font-size:20px;font-weight:500;min-width:62px}.expiry strong.warning{color:#b45309}.expiry strong.expired{color:#bf403d}.check{display:flex;align-items:center;gap:5px;font-size:12px;white-space:nowrap}.quiet{background:transparent;border-color:transparent;color:#718577;padding:6px 8px}.primary{color:white;background:#227b54;border-color:#227b54}.primary:hover:not(:disabled){background:#196140;color:white}.danger{color:#9f4b40}.destructive{color:white;background:#a7473d;border-color:#a7473d}.notice{margin:0;padding:10px 26px;background:#fff4df;border-bottom:1px solid #ead9b8;color:#845422;font-size:13px;line-height:1.6}.notice.success{background:#e9f6ec;color:#266342;border-color:#c9e3d0}.workspace{display:grid;grid-template-columns:205px minmax(420px,1fr) 310px;min-height:calc(100vh - 137px)}.sidebar{border-right:1px solid #dbe3de;padding:30px 16px;display:flex;flex-direction:column;background:#f0f4f0;min-width:0}.eyebrow{font-size:10px;letter-spacing:1.7px;color:#89988d;font-weight:600}.sidebar .eyebrow{padding-left:10px}.root-button{display:flex;align-items:center;gap:10px;margin-top:18px;white-space:normal;text-align:left;overflow-wrap:anywhere;background:#e1ebe2;border:0;color:#24573d;font-size:13px}.folder-icon{display:inline-block;width:16px;height:11px;background:#9fbba1;border-radius:2px;position:relative;flex-shrink:0;margin-top:3px}.folder-icon:before{content:"";position:absolute;left:0;top:-3px;width:7px;height:4px;border-radius:2px 2px 0 0;background:inherit}.scope-label{font-size:11px;color:#86978a;margin:23px 10px 9px}.scope{font-family:ui-monospace,SFMono-Regular,monospace;font-size:12px;color:#637c6a;overflow-wrap:anywhere;line-height:1.7}.sidebar>.scope{padding:0 10px}.sidebar-bottom{margin-top:auto;padding:40px 10px 0;color:#607e68;font-size:12px}.sidebar-bottom p{margin-top:12px;line-height:1.8;color:#8b9b8e;font-size:11px}.files{background:white;min-width:0;padding:30px 28px 0;display:flex;flex-direction:column}.page-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.page-heading .eyebrow{margin-bottom:8px}.location{display:flex;align-items:center;gap:6px;border-top:1px solid #e8ede9;border-bottom:1px solid #e8ede9;padding:9px 0;min-width:0}.location nav{display:flex;align-items:center;flex-wrap:wrap;flex:1;gap:2px;min-width:0}.location nav button{padding:4px 7px;border:0;font-size:12px;max-width:220px;overflow:hidden;text-overflow:ellipsis}.location nav span{color:#c1ccc4}.toolbar{display:flex;gap:8px;align-items:center;margin:18px 0}.toolbar input[type=search]{flex:1;min-width:0}.toolbar button{font-size:12px;padding:7px 9px}#selection-count{font-size:11px;color:#819286;white-space:nowrap}.table-wrap{overflow-x:auto;min-height:290px}table{width:100%;border-collapse:collapse;table-layout:fixed}th{text-align:left;font-size:11px;color:#8a978e;font-weight:500;border-bottom:1px solid #e3e9e4;padding:11px 9px}td{padding:12px 9px;border-bottom:1px solid #f0f3f0;font-size:12px;color:#79897e}.check-cell{width:30px;padding-left:0}.size-cell{width:82px;text-align:right;font-variant-numeric:tabular-nums}.date-cell{width:145px;text-align:right}tr:hover td{background:#f7faf7}tr.active td{background:#edf5ee}td .entry{border:0;background:transparent;padding:0;display:flex;align-items:center;gap:10px;max-width:100%;color:#354e3e;font-size:13px;text-align:left}td .entry span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-icon{display:inline-block;width:13px;height:16px;border:1px solid #a8b8ad;background:#f5f8f5;border-radius:2px;flex-shrink:0}.empty{text-align:center;padding:65px 20px;color:#8b9b8f;line-height:1.9}.list-footer{border-top:1px solid #e9eee9;display:flex;align-items:center;justify-content:space-between;color:#92a095;font-size:11px;padding:13px 0;margin-top:auto;min-height:48px}.preview-panel{border-left:1px solid #dbe3de;display:flex;flex-direction:column;padding:29px 20px 20px;background:#f8faf7;min-width:0}.preview-heading{display:flex;justify-content:space-between;align-items:center}.preview-heading h2{font-size:13px;color:#61776a}.preview-body{padding-top:25px;flex:1;min-width:0}.preview-empty{text-align:center;color:#859889;padding:80px 0;line-height:2}.preview-empty small{color:#a0aca2;font-size:11px}.preview-body h3{font-size:15px;line-height:1.7;overflow-wrap:anywhere;font-weight:500;margin:0 0 18px}.preview-body dl{font-size:11px;display:grid;grid-template-columns:60px minmax(0,1fr);gap:10px;margin:20px 0;color:#91a094}.preview-body dd{margin:0;color:#607968;overflow-wrap:anywhere}.preview-body pre{font:11px/1.8 ui-monospace,SFMono-Regular,monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-height:50vh;overflow:auto;background:#edf2ec;padding:12px;border-radius:5px;color:#48654e}.preview-body img{max-width:100%;max-height:40vh;object-fit:contain;border-radius:4px}.preview-body p{font-size:12px;line-height:1.8;color:#8c9a8f}.preview-actions{display:flex;gap:8px;padding-top:20px}.preview-actions button{flex:1;font-size:12px}.transfer{border-top:1px solid #dce8df;padding:14px 0;font-size:12px}.transfer>div{display:flex;align-items:center;justify-content:space-between}.transfer progress{width:100%;height:5px;accent-color:#227b54;margin:10px 0}.transfer span{font-size:11px;color:#7b9082}dialog{border:1px solid #d4ded6;border-radius:10px;padding:26px;max-width:min(480px,90vw);color:#344c3c;box-shadow:0 20px 80px #182c2530}dialog::backdrop{background:#1c322747}dialog h2{font-size:19px;margin-bottom:15px}dialog p{font-size:13px;line-height:1.8;color:#879489}dialog ul{max-height:180px;overflow:auto;padding-left:20px;font-size:12px;line-height:1.9;overflow-wrap:anywhere}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}[hidden]{display:none!important}@media(min-width:1500px){.workspace{grid-template-columns:235px minmax(500px,1fr) 370px}.files{padding-left:38px;padding-right:38px}}@media(max-width:1100px){.workspace{grid-template-columns:160px minmax(360px,1fr) 260px}.files{padding:24px 18px 0}.authorization{flex-wrap:wrap;gap:10px}.grant-field{flex-basis:100%}.session-controls{margin-left:auto}.date-cell{width:110px}.toolbar{flex-wrap:wrap}.toolbar input[type=search]{flex-basis:100%}}@media(max-width:820px){.workspace{grid-template-columns:1fr}.sidebar{display:none}.preview-panel{border-left:0;border-top:1px solid #dbe3de}.preview-empty{padding:20px}.files{min-height:60vh}.authorization{padding:14px 18px}.grant-field{gap:7px;flex-wrap:wrap}.grant-field select{flex:1;min-width:180px}.session-controls{width:100%;justify-content:space-between;gap:8px}.expiry{gap:6px}.topbar{padding:0 18px}.topnote{display:none}.date-cell{width:110px}.preview-body pre{max-height:280px}.preview-actions{max-width:360px}}
|
|
14
|
+
/* Independent scrolling keeps file actions within the current viewport. */
|
|
15
|
+
body{height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
|
|
16
|
+
.topbar,.authorization,.notice{flex-shrink:0}.notice{max-height:20vh;overflow:auto}
|
|
17
|
+
.workspace{flex:1;min-height:0;overflow:hidden}.sidebar{min-height:0;overflow:auto}
|
|
18
|
+
.files{min-height:0;overflow:hidden}.files>:not(.table-wrap){flex-shrink:0}
|
|
19
|
+
.table-wrap{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
|
|
20
|
+
.table-wrap thead{position:sticky;top:0;background:#fff;z-index:1}
|
|
21
|
+
.list-footer{margin-top:0;flex-shrink:0}.preview-panel{min-height:0;overflow:hidden}
|
|
22
|
+
.preview-heading,.preview-actions{flex-shrink:0}.preview-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:6px}
|
|
23
|
+
.preview-actions{border-top:1px solid #dbe3de;margin-top:16px;padding-top:16px;background:#f8faf7}
|
|
24
|
+
.preview-body h4{font-size:12px;font-weight:600;margin:24px 0 12px;color:#496553}
|
|
25
|
+
.preview-body dl{grid-template-columns:78px minmax(0,1fr)}.preview-body dt{overflow-wrap:anywhere}
|
|
26
|
+
.preview-body .metadata-list{grid-template-columns:minmax(0,1fr);gap:5px}.metadata-list dd{padding-bottom:9px}
|
|
27
|
+
.copy-field{display:flex;align-items:flex-start;gap:6px;min-width:0}.copy-field>span{min-width:0;overflow-wrap:anywhere}
|
|
28
|
+
.copy-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:2px;width:24px;height:24px;margin-top:-3px}
|
|
29
|
+
.copy-button svg{width:15px;height:15px}.copy-button.copied{color:#18764e;background:#e1f2e7}
|
|
30
|
+
.copy-field a{color:#197854;text-underline-offset:3px;line-height:1.7}.copy-manual{width:100%;font:inherit}
|
|
31
|
+
.clipboard-fallback{position:fixed;left:0;top:0;opacity:0;pointer-events:none}
|
|
32
|
+
.icon-button{color:#526f5e}.icon-button svg{display:block}.is-loading svg{animation:oss-refresh-spin .8s linear infinite}
|
|
33
|
+
@keyframes oss-refresh-spin{to{transform:rotate(360deg)}}
|
|
34
|
+
@media(prefers-reduced-motion:reduce){.is-loading svg{animation:none}.is-loading{opacity:.55}}
|
|
35
|
+
@media(max-width:820px){.workspace{display:flex;flex-direction:column;overflow:auto}.files{flex:none;height:58dvh;min-height:330px}.preview-panel{flex:none;height:45dvh;min-height:270px}.preview-body pre{max-height:none}}
|
|
36
|
+
|
|
37
|
+
.topbar{height:auto;min-height:62px;flex-wrap:wrap;gap:12px;padding-top:10px;padding-bottom:10px}#service-stop{font-size:12px;background:transparent;border-color:#82958a;color:#edf5ef}.upload-actions{display:flex;gap:8px}.tasks-panel{position:fixed;right:20px;bottom:20px;top:155px;width:min(480px,calc(100vw - 32px));z-index:5;background:#fff;border:1px solid #cbd9cf;border-radius:10px;box-shadow:0 12px 50px #20372e30;display:flex;flex-direction:column;overflow:hidden}.tasks-heading{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid #e4ebe5}.tasks-note{font-size:12px;line-height:1.8;color:#718577;padding:12px 18px}.tasks-list{overflow:auto;overscroll-behavior:contain;flex:1;min-height:0}.task-card{padding:15px 18px;border-top:1px solid #e8eee9}.task-card h3{font-size:13px;margin:0 0 7px;overflow-wrap:anywhere;font-weight:550}.task-meta,.task-path,.task-stats{font-size:11px;color:#738a7b;line-height:1.7;overflow-wrap:anywhere}.task-path{font-family:ui-monospace,SFMono-Regular,monospace}.task-card progress{width:100%;height:6px;accent-color:#227b54;margin:10px 0 6px}.task-actions{display:flex;gap:7px;margin-top:10px}.task-actions button{font-size:12px;padding:5px 10px}.task-error,#tasks-connection{font-size:12px;color:#9f4b40;line-height:1.7;overflow-wrap:anywhere}.task-error{margin-top:8px}#tasks-connection{padding:0 18px 10px}#tasks-toggle{font-size:12px;background:#2f4b3e;border-color:#607969;color:#edf5ef}#tasks-count{font-variant-numeric:tabular-nums;margin-left:5px}@media(max-width:820px){.tasks-panel{top:140px;right:16px;bottom:16px}.upload-actions{gap:5px}.upload-actions button{font-size:12px;padding:7px 9px}}
|
|
38
|
+
|
|
39
|
+
/* Collapsed rails keep both expand buttons visible and give space back to the file list. */
|
|
40
|
+
.workspace{--sidebar-width:205px;--preview-width:310px;grid-template-columns:var(--sidebar-width) minmax(0,1fr) var(--preview-width)}
|
|
41
|
+
.sidebar-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-shrink:0}.sidebar-heading .eyebrow{letter-spacing:1px;font-size:11px}
|
|
42
|
+
.panel-toggle{width:28px;height:28px;padding:0;flex-shrink:0;font-size:24px;line-height:1}
|
|
43
|
+
.sidebar-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:auto}.sidebar-content>.scope{padding:0 10px}.sidebar-content .root-button{flex-shrink:0}
|
|
44
|
+
.preview-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
|
|
45
|
+
@media(min-width:1500px){.workspace{--sidebar-width:235px;--preview-width:370px}}
|
|
46
|
+
@media(min-width:821px) and (max-width:1100px){.workspace{--sidebar-width:160px;--preview-width:260px}}
|
|
47
|
+
.workspace[data-sidebar-collapsed=true]{--sidebar-width:44px}.workspace[data-preview-collapsed=true]{--preview-width:44px}
|
|
48
|
+
.workspace[data-sidebar-collapsed=true] .sidebar,.workspace[data-preview-collapsed=true] .preview-panel{padding:20px 7px;overflow:hidden}
|
|
49
|
+
.workspace[data-sidebar-collapsed=true] .sidebar-heading,.workspace[data-preview-collapsed=true] .preview-heading{flex-direction:column-reverse;gap:16px}
|
|
50
|
+
.workspace[data-sidebar-collapsed=true] .sidebar-heading h2,.workspace[data-preview-collapsed=true] .preview-heading h2{writing-mode:vertical-rl;letter-spacing:2px;font-size:11px;padding:0;font-weight:500}
|
|
51
|
+
@media(max-width:820px){
|
|
52
|
+
.sidebar{display:flex;flex:none;padding:12px 18px;max-height:38dvh;border-right:0;border-bottom:1px solid #dbe3de}.sidebar-content{flex:auto}.sidebar-bottom{padding-top:16px}.sidebar-heading .eyebrow{padding-left:0}
|
|
53
|
+
.workspace[data-sidebar-collapsed=true] .sidebar,.workspace[data-preview-collapsed=true] .preview-panel{height:auto;min-height:0;max-height:none;padding:8px 18px}
|
|
54
|
+
.workspace[data-sidebar-collapsed=true] .sidebar-heading,.workspace[data-preview-collapsed=true] .preview-heading{flex-direction:row;gap:8px}
|
|
55
|
+
.workspace[data-sidebar-collapsed=true] .sidebar-heading h2,.workspace[data-preview-collapsed=true] .preview-heading h2{writing-mode:horizontal-tb;letter-spacing:1px}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
//# sourceMappingURL=file-workspace-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-workspace-style.js","sourceRoot":"","sources":["../../src/local-web/file-workspace-style.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuD3C,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Shared file-list and transfer-card components. Business adapters supply labels and actions. */
|
|
2
|
+
export const FILE_WORKSPACE_JS = String.raw `
|
|
3
|
+
function workspaceNode(tag, text, className) {
|
|
4
|
+
const element=document.createElement(tag);
|
|
5
|
+
if(text!==undefined)element.textContent=String(text);
|
|
6
|
+
if(className)element.className=className;
|
|
7
|
+
return element;
|
|
8
|
+
}
|
|
9
|
+
function workspaceFileRow(options) {
|
|
10
|
+
const row=workspaceNode('tr');row.tabIndex=0;
|
|
11
|
+
if(options.selected)row.className='active';
|
|
12
|
+
row.oncontextmenu=event=>options.onMenu(event);
|
|
13
|
+
row.onkeydown=event=>{if(event.key==='ContextMenu'||event.shiftKey&&event.key==='F10')options.onMenu(event,row);};
|
|
14
|
+
if(options.leading)row.append(options.leading);
|
|
15
|
+
const cell=workspaceNode('td'),button=workspaceNode('button',undefined,'entry');button.title=options.title||options.name;
|
|
16
|
+
button.append(workspaceNode('span',undefined,options.icon||'file-icon'),workspaceNode('span',options.name));
|
|
17
|
+
button.onclick=options.onOpen;cell.append(button);row.append(cell);
|
|
18
|
+
for(const [text,className] of options.cells)row.append(workspaceNode('td',text,className));
|
|
19
|
+
return row;
|
|
20
|
+
}
|
|
21
|
+
function createWorkspaceTransferCard(id, onAction, labels={pause:'暂停',resume:'恢复',cancel:'取消'}) {
|
|
22
|
+
const root=workspaceNode('article',undefined,'task-card'),title=workspaceNode('h3'),meta=workspaceNode('p',undefined,'task-meta'),path=workspaceNode('p',undefined,'task-path'),progress=workspaceNode('progress'),stats=workspaceNode('p',undefined,'task-stats'),error=workspaceNode('p',undefined,'task-error'),buttons=workspaceNode('div',undefined,'task-actions'),extra=workspaceNode('div',undefined,'task-ingestion');
|
|
23
|
+
progress.max=100;progress.setAttribute('aria-label','文件传输进度');
|
|
24
|
+
const actions=new Map();
|
|
25
|
+
for(const action of ['pause','resume','cancel']){const button=workspaceNode('button',labels[action]);button.onclick=()=>onAction(id,action);actions.set(action,button);buttons.append(button);}
|
|
26
|
+
root.append(title,meta,path,progress,stats,error,extra,buttons);
|
|
27
|
+
return {root,title,meta,path,progress,stats,error,extra,actions};
|
|
28
|
+
}
|
|
29
|
+
function updateWorkspaceTransferCard(card, job, presentation, busy=false) {
|
|
30
|
+
const text=(element,value)=>{if(element.textContent!==value)element.textContent=value;};
|
|
31
|
+
text(card.title,presentation.title);text(card.meta,presentation.meta);text(card.path,job.localPath||'');card.path.title=job.localPath||'';
|
|
32
|
+
card.progress.value=job.size>0?Math.min(100,job.transferred/job.size*100):job.status==='completed'?100:0;
|
|
33
|
+
card.progress.setAttribute('aria-valuetext',presentation.progress);
|
|
34
|
+
text(card.stats,presentation.stats);text(card.error,job.error||'');card.error.hidden=!job.error;
|
|
35
|
+
const available={pause:['queued','running'].includes(job.status),resume:['paused','failed'].includes(job.status),cancel:['queued','running','paused','failed'].includes(job.status)};
|
|
36
|
+
for(const [action,button] of card.actions){button.hidden=!available[action];button.disabled=busy;}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
//# sourceMappingURL=file-workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-workspace.js","sourceRoot":"","sources":["../../src/local-web/file-workspace.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC1C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ServerResponse, IncomingMessage } from 'node:http';
|
|
2
|
+
import type { Readable } from 'node:stream';
|
|
3
|
+
export declare function localWebHeaders(res: ServerResponse, contentType: string): void;
|
|
4
|
+
export declare function strictLocalJson(req: Readable, allowedKeys: readonly string[]): Promise<Record<string, unknown>>;
|
|
5
|
+
export declare function requireLocalOrigin(req: IncomingMessage, origin: string, allowDocumentNavigation?: boolean): void;
|
|
6
|
+
export declare function requireLocalAuthorization(req: IncomingMessage, origin: string, token: string): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { OssError } from '../oss/errors.js';
|
|
3
|
+
export function localWebHeaders(res, contentType) {
|
|
4
|
+
res.setHeader("Content-Type", contentType);
|
|
5
|
+
res.setHeader("Cache-Control", "no-store");
|
|
6
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
7
|
+
res.setHeader("Referrer-Policy", "no-referrer");
|
|
8
|
+
res.setHeader("X-Frame-Options", "DENY");
|
|
9
|
+
res.setHeader("Content-Security-Policy", "default-src 'none'; script-src 'self'; style-src 'self'; connect-src 'self'; img-src 'self' data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'");
|
|
10
|
+
}
|
|
11
|
+
export async function strictLocalJson(req, allowedKeys) {
|
|
12
|
+
const chunks = [];
|
|
13
|
+
let size = 0;
|
|
14
|
+
for await (const value of req) {
|
|
15
|
+
const chunk = Buffer.isBuffer(value) ? value : Buffer.from(value);
|
|
16
|
+
size += chunk.length;
|
|
17
|
+
if (size > 64 * 1024)
|
|
18
|
+
throw new OssError("Request body too large", "oss_input_invalid", 400);
|
|
19
|
+
chunks.push(chunk);
|
|
20
|
+
}
|
|
21
|
+
let value;
|
|
22
|
+
try {
|
|
23
|
+
value = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
throw new OssError("Invalid JSON", "oss_input_invalid", 400);
|
|
27
|
+
}
|
|
28
|
+
if (!value || typeof value !== "object" || Array.isArray(value)
|
|
29
|
+
|| Object.keys(value).some(key => !allowedKeys.includes(key))) {
|
|
30
|
+
throw new OssError("Invalid request fields", "oss_input_invalid", 400);
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
export function requireLocalOrigin(req, origin, allowDocumentNavigation = false) {
|
|
35
|
+
if (req.headers.host !== new URL(origin).host)
|
|
36
|
+
throw new OssError('Host', 'oss_web_host', 421);
|
|
37
|
+
// An OIDC redirect is a cross-site document navigation. Only callers serving
|
|
38
|
+
// the public HTML shell may opt in; API requests retain the strict check.
|
|
39
|
+
const documentNavigation = allowDocumentNavigation && req.method === 'GET'
|
|
40
|
+
&& req.headers['sec-fetch-mode'] === 'navigate' && req.headers['sec-fetch-dest'] === 'document';
|
|
41
|
+
if ((req.headers.origin && req.headers.origin !== origin) || (req.headers['sec-fetch-site'] === 'cross-site' && !documentNavigation))
|
|
42
|
+
throw new OssError('Origin', 'oss_web_origin', 403);
|
|
43
|
+
}
|
|
44
|
+
export function requireLocalAuthorization(req, origin, token) {
|
|
45
|
+
const bearer = req.headers.authorization ?? '', expected = `Bearer ${token}`;
|
|
46
|
+
if (Buffer.byteLength(bearer) !== Buffer.byteLength(expected) || !timingSafeEqual(Buffer.from(bearer), Buffer.from(expected)))
|
|
47
|
+
throw new OssError('Token', 'oss_web_unauthorized', 401);
|
|
48
|
+
if (!['GET', 'HEAD'].includes(req.method ?? '') && req.headers.origin !== origin)
|
|
49
|
+
throw new OssError('Origin', 'oss_web_origin', 403);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=security.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/local-web/security.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,MAAM,UAAU,eAAe,CAAC,GAAmB,EAAE,WAAmB;IACtE,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC3C,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AG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,KAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAE,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAAC,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAC,sBAAsB,EAAC,GAAG,CAAC,CAAC;IAC/K,IAAG,CAAC,CAAC,KAAK,EAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,IAAE,EAAE,CAAC,IAAE,GAAG,CAAC,OAAO,CAAC,MAAM,KAAG,MAAM;QAAC,MAAM,IAAI,QAAQ,CAAC,QAAQ,EAAC,gBAAgB,EAAC,GAAG,CAAC,CAAC;AAC5H,CAAC"}
|
package/dist/login-recovery.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Keep recovery in the same explicitly selected identity source. */
|
|
2
2
|
export function loginRecoveryCommand(args) {
|
|
3
|
+
let environment;
|
|
3
4
|
let issuer;
|
|
4
5
|
let service;
|
|
5
6
|
let root;
|
|
@@ -7,7 +8,11 @@ export function loginRecoveryCommand(args) {
|
|
|
7
8
|
for (let i = 0; i < args.length; i++) {
|
|
8
9
|
if (args[i] === "--")
|
|
9
10
|
break;
|
|
10
|
-
if (args[i] === "--
|
|
11
|
+
if (args[i] === "--environment")
|
|
12
|
+
environment = args[++i];
|
|
13
|
+
else if (args[i]?.startsWith("--environment="))
|
|
14
|
+
environment = args[i].slice("--environment=".length);
|
|
15
|
+
else if (args[i] === "--issuer")
|
|
11
16
|
issuer = args[++i];
|
|
12
17
|
else if (args[i]?.startsWith("--issuer="))
|
|
13
18
|
issuer = args[i].slice("--issuer=".length);
|
|
@@ -22,7 +27,7 @@ export function loginRecoveryCommand(args) {
|
|
|
22
27
|
}
|
|
23
28
|
const quote = (value) => /^[A-Za-z0-9_.:/-]+$/u.test(value) ? value : "'" + value.replace(/'/gu, "'\\''") + "'";
|
|
24
29
|
if (root === "kb" || service === "kb") {
|
|
25
|
-
return "numa login --service kb --no-console --no-config" + (issuer ? ` --issuer ${quote(issuer)}` : "");
|
|
30
|
+
return "numa login --service kb --no-console --no-config" + (issuer ? ` --issuer ${quote(issuer)}` : "") + (environment ? ` --environment ${quote(environment)}` : "");
|
|
26
31
|
}
|
|
27
32
|
return "numa login --no-console --no-config" + (issuer ? ` --issuer ${quote(issuer)}` : platform ? " --platform" : "");
|
|
28
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-recovery.js","sourceRoot":"","sources":["../src/login-recovery.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,UAAU,oBAAoB,CAAC,IAAc;IACjD,IAAI,MAA0B,CAAC;IAC/B,IAAI,OAA2B,CAAC;IAChC,IAAI,IAAwB,CAAC;IAC7B,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAC,CAAC,GAAC,IAAI,CAAC,MAAM,EAAC,CAAC,EAAE,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI;YAAE,MAAM;QAC5B,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU;YAAE,MAAM,GAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"login-recovery.js","sourceRoot":"","sources":["../src/login-recovery.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,UAAU,oBAAoB,CAAC,IAAc;IACjD,IAAI,WAA+B,CAAC;IACpC,IAAI,MAA0B,CAAC;IAC/B,IAAI,OAA2B,CAAC;IAChC,IAAI,IAAwB,CAAC;IAC7B,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAC,CAAC,GAAC,IAAI,CAAC,MAAM,EAAC,CAAC,EAAE,EAAE,CAAC;Q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AC,OAAO,CAAC,KAAK,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC;IACtH,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACtC,OAAO,kDAAkD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACzK,CAAC;IACD,OAAO,qCAAqC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACzH,CAAC"}
|
|
@@ -1,62 +1,18 @@
|
|
|
1
|
+
import { PersistentTransferQueue } from '../transfers/persistent-queue.js';
|
|
1
2
|
import type { AccessSession } from './schemas.js';
|
|
2
3
|
import { type PlannedFile } from './transfer-paths.js';
|
|
3
|
-
import type { TransferJob, TransferWorker } from './transfer-types.js';
|
|
4
|
+
import type { TransferContext, TransferJob, TransferWorker } from './transfer-types.js';
|
|
4
5
|
export interface TransferQueueOptions {
|
|
5
6
|
directory: string;
|
|
6
7
|
session(grantId: number): Promise<AccessSession>;
|
|
7
8
|
worker?: TransferWorker;
|
|
8
9
|
maxConcurrent?: number;
|
|
9
10
|
}
|
|
10
|
-
type Action = 'pause' | 'resume' | 'cancel';
|
|
11
11
|
export declare function createTransferQueue(options: TransferQueueOptions): Promise<TransferQueue>;
|
|
12
|
-
export declare class TransferQueue {
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private readonly actions;
|
|
17
|
-
private saving;
|
|
18
|
-
private closing;
|
|
19
|
-
private closed?;
|
|
20
|
-
private lock?;
|
|
21
|
-
private worker;
|
|
22
|
-
private maximum;
|
|
23
|
-
private storageError;
|
|
24
|
-
constructor(options: TransferQueueOptions);
|
|
25
|
-
initialize(): Promise<void>;
|
|
26
|
-
list(): {
|
|
27
|
-
id: string;
|
|
28
|
-
direction: 'upload' | 'download';
|
|
29
|
-
grantId: number;
|
|
30
|
-
key: string;
|
|
31
|
-
localPath: string;
|
|
32
|
-
size: number;
|
|
33
|
-
transferred: number;
|
|
34
|
-
status: import("./transfer-types.js").TransferStatus;
|
|
35
|
-
createdAt: string;
|
|
36
|
-
updatedAt: string;
|
|
37
|
-
error?: string;
|
|
12
|
+
export declare class TransferQueue extends PersistentTransferQueue<TransferJob, TransferContext> {
|
|
13
|
+
private readonly adapter;
|
|
14
|
+
constructor(adapter: TransferQueueOptions);
|
|
15
|
+
add(direction: TransferJob['direction'], session: AccessSession, files: PlannedFile[]): Promise<(import("../transfers/persistent-queue.js").PersistentJob & Record<string, unknown> & {
|
|
38
16
|
bytesPerSecond: number;
|
|
39
|
-
}[]
|
|
40
|
-
add(direction: TransferJob['direction'], session: AccessSession, files: PlannedFile[]): Promise<{
|
|
41
|
-
id: string;
|
|
42
|
-
direction: 'upload' | 'download';
|
|
43
|
-
grantId: number;
|
|
44
|
-
key: string;
|
|
45
|
-
localPath: string;
|
|
46
|
-
size: number;
|
|
47
|
-
transferred: number;
|
|
48
|
-
status: import("./transfer-types.js").TransferStatus;
|
|
49
|
-
createdAt: string;
|
|
50
|
-
updatedAt: string;
|
|
51
|
-
error?: string;
|
|
52
|
-
bytesPerSecond: number;
|
|
53
|
-
}[]>;
|
|
54
|
-
private context;
|
|
55
|
-
private schedule;
|
|
56
|
-
action(id: string, action: Action): Promise<void>;
|
|
57
|
-
private performAction;
|
|
58
|
-
private save;
|
|
59
|
-
close(): Promise<void>;
|
|
60
|
-
private unlock;
|
|
17
|
+
})[]>;
|
|
61
18
|
}
|
|
62
|
-
export {};
|