mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-24 06:07:42 +00:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b27c21b91d | ||
|
|
9cf8346fc4 | ||
|
|
7947bb128e | ||
|
|
8787f70991 | ||
|
|
f722730db7 | ||
|
|
8866538369 | ||
|
|
245e819cb5 | ||
|
|
40fed2c70f | ||
|
|
40598db447 | ||
|
|
d1e574ff8f | ||
|
|
94ee54e4a6 | ||
|
|
51499afa5a | ||
|
|
d00da2b2ee | ||
|
|
4973be8499 | ||
|
|
14252054a1 |
No files matched your search
@@ -8,7 +8,7 @@ ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG TARGETARCH
|
||||
|
||||
# Can be workflow provided, defaults set for manual building
|
||||
ARG JBIG2ENC_VERSION=0.30
|
||||
ARG JBIG2ENC_VERSION=0.32
|
||||
|
||||
# Set Python environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG TARGETARCH
|
||||
|
||||
# Can be workflow provided, defaults set for manual building
|
||||
ARG JBIG2ENC_VERSION=0.30
|
||||
ARG JBIG2ENC_VERSION=0.32
|
||||
|
||||
# Set Python environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
|
||||
@@ -510,9 +510,9 @@ You can read more about this in [the Django project's documentation](https://doc
|
||||
|
||||
- With neither setting configured, Paperless accepts any host.
|
||||
- With only `PAPERLESS_URL` set, Paperless accepts the hostname from that URL
|
||||
and `localhost` (used by the Docker health check).
|
||||
- `PAPERLESS_ALLOWED_HOSTS` adds hosts to `localhost` and the hostname from
|
||||
`PAPERLESS_URL`, if set. A blank list adds no hosts.
|
||||
and the loopback hosts `localhost`, `127.0.0.1`, and `[::1]`.
|
||||
- `PAPERLESS_ALLOWED_HOSTS` adds hosts to those loopback hosts and the hostname
|
||||
from `PAPERLESS_URL`, if set. A blank list adds no hosts.
|
||||
- With `PAPERLESS_ALLOWED_HOSTS=*`, Paperless accepts any host, even when
|
||||
`PAPERLESS_URL` is set.
|
||||
|
||||
|
||||
+6
-6
@@ -86,9 +86,9 @@ mariadb = [
|
||||
"mysqlclient>=2.2.7,<2.4",
|
||||
]
|
||||
postgres = [
|
||||
"psycopg[c,pool]==3.3.4",
|
||||
"psycopg[c,pool]==3.3.8",
|
||||
# Direct dependency for proper resolution of the pre-built wheels
|
||||
"psycopg-c==3.3.4",
|
||||
"psycopg-c==3.3.8",
|
||||
"psycopg-pool==3.3.3",
|
||||
]
|
||||
webserver = [
|
||||
@@ -159,10 +159,10 @@ package = false
|
||||
[tool.uv.sources]
|
||||
# Markers are chosen to select these almost exclusively when building the Docker image
|
||||
psycopg-c = [
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.12'" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.12'" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.14'" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.14'" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.12'" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.12'" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_x86_64.whl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64' and python_version == '3.14'" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl", marker = "sys_platform == 'linux' and platform_machine == 'aarch64' and python_version == '3.14'" },
|
||||
]
|
||||
torch = [
|
||||
{ index = "pytorch-cpu" },
|
||||
|
||||
+308
-146
File diff suppressed because it is too large.
Load diff
@@ -227,6 +227,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<pngx-input-check i18n-title title="Show nested tags with their parents" i18n-hint hint="Child tags are shown together with their parent tags, instead of separately." formControlName="tagsShowHierarchy"></pngx-input-check>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="mt-3" i18n>Document editing</h5>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
||||
@@ -305,7 +305,7 @@ describe('SettingsComponent', () => {
|
||||
expect(toastErrorSpy).toHaveBeenCalled()
|
||||
expect(storeSpy).toHaveBeenCalled()
|
||||
expect(appearanceSettingsSpy).not.toHaveBeenCalled()
|
||||
expect(setSpy).toHaveBeenCalledTimes(33)
|
||||
expect(setSpy).toHaveBeenCalledTimes(34)
|
||||
expect(setSpy).toHaveBeenCalledWith(SETTINGS_KEYS.SIDEBAR_HIDDEN_ITEMS, [
|
||||
HideableSidebarItemID.Workflows,
|
||||
])
|
||||
|
||||
@@ -163,6 +163,7 @@ export class SettingsComponent
|
||||
bulkEditConfirmationDialogs: new FormControl(null),
|
||||
bulkEditApplyOnClose: new FormControl(null),
|
||||
documentListItemPerPage: new FormControl(null),
|
||||
tagsShowHierarchy: new FormControl(null),
|
||||
slimSidebarEnabled: new FormControl(null),
|
||||
sidebarHiddenItems: new FormControl<HideableSidebarItemID[]>([]),
|
||||
darkModeUseSystem: new FormControl(null),
|
||||
@@ -342,6 +343,7 @@ export class SettingsComponent
|
||||
bulkEditApplyOnClose: this.settings.get(
|
||||
SETTINGS_KEYS.BULK_EDIT_APPLY_ON_CLOSE
|
||||
),
|
||||
tagsShowHierarchy: this.settings.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY),
|
||||
documentListItemPerPage: this.settings.get(
|
||||
SETTINGS_KEYS.DOCUMENT_LIST_SIZE
|
||||
),
|
||||
@@ -607,6 +609,10 @@ export class SettingsComponent
|
||||
SETTINGS_KEYS.DEFAULT_PERMS_EDIT_GROUPS,
|
||||
this.settingsForm.value.defaultPermsEditGroups
|
||||
)
|
||||
this.settings.set(
|
||||
SETTINGS_KEYS.TAGS_SHOW_HIERARCHY,
|
||||
this.settingsForm.value.tagsShowHierarchy
|
||||
)
|
||||
this.settings.set(
|
||||
SETTINGS_KEYS.DOCUMENT_EDITING_REMOVE_INBOX_TAGS,
|
||||
this.settingsForm.value.documentEditingRemoveInboxTags
|
||||
|
||||
@@ -361,8 +361,9 @@
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li class="nav-item mt-2 position-relative" [class.d-none]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation) && !settingsService.organizingSidebarItems()" tourAnchor="tour.outro">
|
||||
<a class="text-muted small d-flex align-items-center flex-wrap text-decoration-none nav-anchor" [class.opacity-50]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation)" [class.pe-5]="settingsService.organizingSidebarItems() && !slimSidebarEnabled && !slimSidebarAnimating()"
|
||||
<li class="nav-item mt-2 position-relative" [class.d-none]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation) && !settingsService.organizingSidebarItems()"
|
||||
[class.d-md-block]="slimSidebarEnabled && settingsService.unseenReleasesSince()" tourAnchor="tour.outro">
|
||||
<a class="text-muted small d-flex align-items-center flex-wrap text-decoration-none nav-anchor" [class.d-md-none]="slimSidebarEnabled && settingsService.unseenReleasesSince()" [class.opacity-50]="settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation)" [class.pe-5]="settingsService.organizingSidebarItems() && !slimSidebarEnabled && !slimSidebarAnimating()"
|
||||
target="_blank" rel="noopener noreferrer" href="https://docs.paperless-ngx.com" ngbPopover="Documentation"
|
||||
i18n-ngbPopover [disablePopover]="!slimSidebarPopoversEnabled" placement="end" container="body"
|
||||
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
|
||||
@@ -371,23 +372,35 @@
|
||||
@if (settingsService.organizingSidebarItems()) {
|
||||
<pngx-input-switch class="position-absolute top-50 end-0 translate-middle-y me-1" [class.d-none]="slimSidebarEnabled || slimSidebarAnimating()" [compact]="true" title="Documentation" i18n-title [ngModel]="!settingsService.sidebarItemIsHidden(HideableSidebarItemID.Documentation)" (ngModelChange)="toggleSidebarItem(HideableSidebarItemID.Documentation, $event)"></pngx-input-switch>
|
||||
}
|
||||
@if (slimSidebarEnabled && settingsService.unseenReleasesSince()) {
|
||||
<button type="button" class="btn btn-link border-0 w-100 text-muted small d-none d-md-flex align-items-center nav-anchor position-relative" (click)="showReleaseNotes()"
|
||||
aria-label="See what's new in this version" i18n-aria-label
|
||||
ngbPopover="What's new" i18n-ngbPopover placement="end" container="body"
|
||||
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
|
||||
<pngx-bs-icon class="d-flex" name="info-circle"></pngx-bs-icon>
|
||||
<div class="position-absolute top-0 start-50 ms-1 p-1 bg-success rounded-circle"></div>
|
||||
</button>
|
||||
}
|
||||
</li>
|
||||
<li class="nav-item" [class.visually-hidden]="slimSidebarEnabled">
|
||||
<div class="text-muted small d-flex align-items-center flex-wrap nav-label">
|
||||
<div class="me-2">
|
||||
<a class="text-muted text-decoration-none" target="_blank" rel="noopener noreferrer"
|
||||
href="https://github.com/paperless-ngx/paperless-ngx" ngbPopover="GitHub" i18n-ngbPopover
|
||||
[disablePopover]="!slimSidebarPopoversEnabled" placement="end" container="body"
|
||||
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
|
||||
<button type="button" class="bg-transparent border-0 p-0 text-muted" (click)="showReleaseNotes()" title="See what's new in this version" i18n-title>
|
||||
{{ versionString }}
|
||||
</a>
|
||||
</button>
|
||||
@if (settingsService.unseenReleasesSince()) {
|
||||
<div class="btn-group ms-2 align-baseline">
|
||||
<button type="button" class="btn btn-whats-new rounded-start-pill smaller py-1 px-2 fw-bold lh-sm" (click)="showReleaseNotes()"
|
||||
title="See what's new in this version" i18n-title i18n>New</button>
|
||||
<button type="button" class="btn btn-whats-new rounded-end-pill smaller py-1 px-1 lh-sm d-flex align-items-center" (click)="dismissReleaseNotes()"
|
||||
title="Dismiss" i18n-title aria-label="Dismiss" i18n-aria-label>
|
||||
<pngx-bs-icon name="x" class="d-flex" width="1em" height="1em"></pngx-bs-icon>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if (!settingsService.updateCheckingIsSet || appRemoteVersion()) {
|
||||
<div class="version-check d-flex align-items-center">
|
||||
<ng-template #updateAvailablePopContent>
|
||||
<span class="small">Paperless-ngx {{ appRemoteVersion().version }} <ng-container i18n>is
|
||||
available.</ng-container><br /><ng-container i18n>Click to view.</ng-container></span>
|
||||
</ng-template>
|
||||
<ng-template #updateCheckingNotEnabledPopContent>
|
||||
<p class="small mb-2">
|
||||
<ng-container i18n>Paperless-ngx can automatically check for updates</ng-container>
|
||||
@@ -404,15 +417,13 @@
|
||||
</ng-template>
|
||||
@if (settingsService.updateCheckingIsSet) {
|
||||
@if (appRemoteVersion().update_available) {
|
||||
<a class="small text-decoration-none" target="_blank" rel="noopener noreferrer"
|
||||
href="https://github.com/paperless-ngx/paperless-ngx/releases"
|
||||
[ngbPopover]="updateAvailablePopContent" popoverClass="shadow" triggers="mouseenter:mouseleave"
|
||||
container="body">
|
||||
<button type="button" class="bg-transparent border-0 p-0 small text-primary" (click)="showAvailableReleaseNotes()"
|
||||
title="Paperless-ngx {{ appRemoteVersion().version }} is available" i18n-title>
|
||||
<pngx-bs-icon width="1.2em" height="1.2em" name="info-circle" class="me-1"></pngx-bs-icon>
|
||||
@if (appRemoteVersion()?.update_available) {
|
||||
<ng-container i18n>Update available</ng-container>
|
||||
}
|
||||
</a>
|
||||
</button>
|
||||
}
|
||||
} @else {
|
||||
<a *pngxIfPermissions="{ action: PermissionAction.Change, type: PermissionType.UISettings }" class="small text-decoration-none" routerLink="/settings" fragment="update-checking" aria-label="Configure update checking" i18n-aria-label
|
||||
|
||||
@@ -700,3 +700,15 @@ main {
|
||||
.smaller {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
// From active / hover of sidebar nav links
|
||||
.btn-whats-new {
|
||||
--bs-btn-color: var(--bs-primary);
|
||||
--bs-btn-bg: color-mix(in srgb, var(--bs-primary) 13%, transparent);
|
||||
--bs-btn-border-width: 0;
|
||||
--bs-btn-font-weight: 600;
|
||||
--bs-btn-hover-color: var(--bs-primary);
|
||||
--bs-btn-hover-bg: color-mix(in srgb, var(--bs-primary) 20%, transparent);
|
||||
--bs-btn-active-color: var(--bs-primary);
|
||||
--bs-btn-active-bg: color-mix(in srgb, var(--bs-primary) 20%, transparent);
|
||||
}
|
||||
@@ -42,6 +42,7 @@ import { environment } from 'src/environments/environment'
|
||||
import { ProfileEditDialogComponent } from '../common/profile-edit-dialog/profile-edit-dialog.component'
|
||||
import { UploadStatusTrayComponent } from '../common/upload-status-tray/upload-status-tray.component'
|
||||
import { DocumentDetailComponent } from '../document-detail/document-detail.component'
|
||||
import { ReleaseNotesDialogComponent } from '../common/release-notes-dialog/release-notes-dialog.component'
|
||||
import { AppFrameComponent } from './app-frame.component'
|
||||
import { GlobalSearchComponent } from './global-search/global-search.component'
|
||||
|
||||
@@ -695,6 +696,131 @@ describe('AppFrameComponent', () => {
|
||||
expect(maybeRefreshSpy).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should show new release pill and mark releases seen on click', () => {
|
||||
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
|
||||
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
|
||||
fixture.detectChanges()
|
||||
|
||||
const pill = fixture.debugElement
|
||||
.queryAll(By.css('button'))
|
||||
.find((b) => b.nativeElement.textContent.trim() === 'New')
|
||||
expect(pill).toBeTruthy()
|
||||
|
||||
pill.nativeElement.click()
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}ui_settings/`
|
||||
)
|
||||
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
|
||||
'3.5.1'
|
||||
)
|
||||
req.flush({ success: true })
|
||||
fixture.detectChanges()
|
||||
|
||||
expect(
|
||||
fixture.debugElement
|
||||
.queryAll(By.css('button'))
|
||||
.find((b) => b.nativeElement.textContent.trim() === 'New')
|
||||
).toBeUndefined()
|
||||
})
|
||||
|
||||
it('should dismiss new release pill without opening release notes', () => {
|
||||
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
|
||||
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
|
||||
fixture.detectChanges()
|
||||
const modalSpy = jest.spyOn(modalService, 'open')
|
||||
|
||||
fixture.debugElement
|
||||
.query(By.css('button[aria-label="Dismiss"]'))
|
||||
.nativeElement.click()
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}ui_settings/`
|
||||
)
|
||||
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
|
||||
'3.5.1'
|
||||
)
|
||||
req.flush({ success: true })
|
||||
fixture.detectChanges()
|
||||
|
||||
expect(modalSpy).not.toHaveBeenCalled()
|
||||
expect(
|
||||
fixture.debugElement.query(By.css('button[aria-label="Dismiss"]'))
|
||||
).toBeNull()
|
||||
})
|
||||
|
||||
it('should open current release notes from the version without marking seen', () => {
|
||||
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
|
||||
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.5.1')
|
||||
fixture.detectChanges()
|
||||
const modalSpy = jest.spyOn(modalService, 'open')
|
||||
|
||||
const versionButton = fixture.debugElement
|
||||
.queryAll(By.css('button'))
|
||||
.find((b) => b.nativeElement.textContent.includes('3.5.1'))
|
||||
versionButton.nativeElement.click()
|
||||
|
||||
expect(modalSpy).toHaveBeenCalledWith(
|
||||
ReleaseNotesDialogComponent,
|
||||
expect.anything()
|
||||
)
|
||||
httpTestingController.expectNone(`${environment.apiBaseUrl}ui_settings/`)
|
||||
})
|
||||
|
||||
it('should open available release notes from update available', () => {
|
||||
jest
|
||||
.spyOn(remoteVersionService, 'checkForUpdates')
|
||||
.mockReturnValue(of({ version: '3.6.0', update_available: true }))
|
||||
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
|
||||
settingsService.set(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED, true)
|
||||
component.ngOnInit()
|
||||
fixture.detectChanges()
|
||||
const modalSpy = jest.spyOn(modalService, 'open')
|
||||
const saveSpy = jest.spyOn(settingsService, 'markReleasesSeen')
|
||||
|
||||
const updateButton = fixture.debugElement
|
||||
.queryAll(By.css('button'))
|
||||
.find((b) => b.nativeElement.textContent.includes('Update available'))
|
||||
expect(updateButton.nativeElement.title).toEqual(
|
||||
'Paperless-ngx 3.6.0 is available'
|
||||
)
|
||||
updateButton.nativeElement.click()
|
||||
|
||||
const dialog = modalSpy.mock.results[0].value
|
||||
.componentInstance as ReleaseNotesDialogComponent
|
||||
expect(dialog.since()).toEqual('3.5.1')
|
||||
expect(dialog.until()).toEqual('3.6.0')
|
||||
expect(saveSpy).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should save update checking chosen in the release notes dialog', () => {
|
||||
const setUpdateCheckingSpy = jest
|
||||
.spyOn(component, 'setUpdateChecking')
|
||||
.mockImplementation(() => {})
|
||||
const modalSpy = jest.spyOn(modalService, 'open')
|
||||
component.showReleaseNotes()
|
||||
|
||||
const dialog = modalSpy.mock.results[0].value
|
||||
.componentInstance as ReleaseNotesDialogComponent
|
||||
dialog.updateCheckingChosen.emit(true)
|
||||
expect(setUpdateCheckingSpy).toHaveBeenCalledWith(true)
|
||||
})
|
||||
|
||||
it('should show new release dot instead of documentation in slim sidebar', () => {
|
||||
settingsService.set(SETTINGS_KEYS.SLIM_SIDEBAR, true)
|
||||
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
|
||||
settingsService.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, '3.4.2')
|
||||
fixture.detectChanges()
|
||||
|
||||
const whatsNew = fixture.debugElement.query(
|
||||
By.css('button[aria-label="See what\'s new in this version"]')
|
||||
).nativeElement
|
||||
const docs = fixture.debugElement.query(
|
||||
By.css('a[href="https://docs.paperless-ngx.com"].nav-anchor')
|
||||
).nativeElement
|
||||
expect(docs.classList).toContain('d-md-none')
|
||||
// both share one li so the tour anchor points at whichever is shown
|
||||
expect(whatsNew.closest('li')).toBe(docs.closest('li'))
|
||||
})
|
||||
|
||||
it('should show tasks badge for needs-attention tasks', () => {
|
||||
jest
|
||||
.spyOn(tasksService, 'needsAttentionTasksCount', 'get')
|
||||
|
||||
@@ -68,6 +68,7 @@ import { SwitchComponent } from '../common/input/switch/switch.component'
|
||||
import { BrandMarkComponent } from '../common/logo/brand-mark/brand-mark.component'
|
||||
import { LogoComponent } from '../common/logo/logo.component'
|
||||
import { ProfileEditDialogComponent } from '../common/profile-edit-dialog/profile-edit-dialog.component'
|
||||
import { ReleaseNotesDialogComponent } from '../common/release-notes-dialog/release-notes-dialog.component'
|
||||
import { UploadStatusTrayComponent } from '../common/upload-status-tray/upload-status-tray.component'
|
||||
import { DocumentDetailComponent } from '../document-detail/document-detail.component'
|
||||
import { ComponentWithPermissions } from '../with-permissions/with-permissions.component'
|
||||
@@ -551,6 +552,44 @@ export class AppFrameComponent
|
||||
})
|
||||
}
|
||||
|
||||
private openReleaseNotes(
|
||||
since: string | null,
|
||||
until: string | null = null
|
||||
): void {
|
||||
const modal = this.modalService.open(ReleaseNotesDialogComponent, {
|
||||
size: 'lg',
|
||||
scrollable: true,
|
||||
})
|
||||
modal.componentInstance.load(since, until)
|
||||
modal.componentInstance.updateCheckingChosen.subscribe((enable: boolean) =>
|
||||
this.setUpdateChecking(enable)
|
||||
)
|
||||
}
|
||||
|
||||
showReleaseNotes() {
|
||||
const since = this.settingsService.unseenReleasesSince()
|
||||
this.openReleaseNotes(since)
|
||||
if (since) {
|
||||
this.dismissReleaseNotes()
|
||||
}
|
||||
}
|
||||
|
||||
/** Mark the running version's release notes seen, hiding "New" */
|
||||
dismissReleaseNotes() {
|
||||
this.settingsService
|
||||
.markReleasesSeen()
|
||||
.pipe(first())
|
||||
.subscribe({ error: () => {} })
|
||||
}
|
||||
|
||||
/** Notes for releases newer than the running version, not yet installed */
|
||||
showAvailableReleaseNotes() {
|
||||
this.openReleaseNotes(
|
||||
this.settingsService.get(SETTINGS_KEYS.VERSION),
|
||||
this.appRemoteVersion()?.version
|
||||
)
|
||||
}
|
||||
|
||||
setUpdateChecking(enable: boolean) {
|
||||
this.settingsService.set(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED, enable)
|
||||
this.settingsService
|
||||
|
||||
@@ -87,6 +87,7 @@ import folderFill from 'bootstrap-icons/icons/folder-fill.svg'
|
||||
import folder from 'bootstrap-icons/icons/folder.svg'
|
||||
import funnel from 'bootstrap-icons/icons/funnel.svg'
|
||||
import gear from 'bootstrap-icons/icons/gear.svg'
|
||||
import github from 'bootstrap-icons/icons/github.svg'
|
||||
import globe2 from 'bootstrap-icons/icons/globe2.svg'
|
||||
import google from 'bootstrap-icons/icons/google.svg'
|
||||
import grid from 'bootstrap-icons/icons/grid.svg'
|
||||
@@ -249,6 +250,7 @@ export const icons: Record<string, string> = {
|
||||
folderFill,
|
||||
funnel,
|
||||
gear,
|
||||
github,
|
||||
globe2,
|
||||
google,
|
||||
grid,
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
import { provideHttpClient } from '@angular/common/http'
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing'
|
||||
import { Component } from '@angular/core'
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
||||
import { FormControl, ReactiveFormsModule } from '@angular/forms'
|
||||
import { NumberComponent } from './number/number.component'
|
||||
import { TextComponent } from './text/text.component'
|
||||
import { TextAreaComponent } from './textarea/textarea.component'
|
||||
import { UrlComponent } from './url/url.component'
|
||||
|
||||
@Component({
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
TextComponent,
|
||||
NumberComponent,
|
||||
TextAreaComponent,
|
||||
UrlComponent,
|
||||
],
|
||||
template: `
|
||||
<pngx-input-text [formControl]="control" />
|
||||
<pngx-input-number [formControl]="control" [showAdd]="false" />
|
||||
<pngx-input-textarea [formControl]="control" />
|
||||
<pngx-input-url [formControl]="control" />
|
||||
`,
|
||||
})
|
||||
class InputEventsHostComponent {
|
||||
control = new FormControl<string | number | null>(null)
|
||||
}
|
||||
|
||||
describe.each([
|
||||
['text', 'pngx-input-text input', 'Edited text', 'Edited text'],
|
||||
['number', 'pngx-input-number input', '42', 42],
|
||||
['textarea', 'pngx-input-textarea textarea', 'Edited\ntext', 'Edited\ntext'],
|
||||
['url', 'pngx-input-url input', 'https://example.com', 'https://example.com'],
|
||||
])(
|
||||
'%s input events',
|
||||
(_type, selector: string, text: string, value: string | number) => {
|
||||
let fixture: ComponentFixture<InputEventsHostComponent>
|
||||
let control: FormControl<string | number | null>
|
||||
let input: HTMLInputElement | HTMLTextAreaElement
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [InputEventsHostComponent],
|
||||
providers: [provideHttpClient(), provideHttpClientTesting()],
|
||||
})
|
||||
fixture = TestBed.createComponent(InputEventsHostComponent)
|
||||
control = fixture.componentInstance.control
|
||||
})
|
||||
|
||||
async function render() {
|
||||
fixture.detectChanges()
|
||||
await fixture.whenStable()
|
||||
input = fixture.nativeElement.querySelector(selector)
|
||||
}
|
||||
|
||||
it('updates the form while typing and marks it touched only on blur', async () => {
|
||||
await render()
|
||||
const changed = jest.fn()
|
||||
control.valueChanges.subscribe(changed)
|
||||
input.value = text
|
||||
input.dispatchEvent(new Event('input'))
|
||||
expect(control.value).toBe(value)
|
||||
expect(control.dirty).toBe(true)
|
||||
expect(control.touched).toBe(false)
|
||||
|
||||
input.dispatchEvent(new Event('change'))
|
||||
input.dispatchEvent(new Event('blur'))
|
||||
expect(control.touched).toBe(true)
|
||||
expect(changed).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('honors an explicit updateOn blur strategy', async () => {
|
||||
control = new FormControl<string | number | null>(null, {
|
||||
updateOn: 'blur',
|
||||
})
|
||||
fixture.componentInstance.control = control
|
||||
await render()
|
||||
input.value = text
|
||||
input.dispatchEvent(new Event('input'))
|
||||
expect(control.value).toBeNull()
|
||||
expect(control.pristine).toBe(true)
|
||||
|
||||
input.dispatchEvent(new Event('blur'))
|
||||
expect(control.value).toBe(value)
|
||||
expect(control.dirty).toBe(true)
|
||||
expect(control.touched).toBe(true)
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<div class="position-relative" [class.col-md-9]="horizontal">
|
||||
<div class="input-group" [class.is-invalid]="error">
|
||||
<input #inputField type="number" class="form-control" [step]="step" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [class.is-invalid]="error" [disabled]="disabled">
|
||||
<input #inputField type="number" class="form-control" [step]="step" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [class.is-invalid]="error" [disabled]="disabled">
|
||||
@if (showAdd) {
|
||||
<button class="btn btn-outline-secondary" type="button" id="button-addon1" (click)="nextAsn()" [disabled]="disabled">+1</button>
|
||||
}
|
||||
|
||||
@@ -17,16 +17,21 @@
|
||||
[searchFn]="searchFn"
|
||||
addTagText="Add tag"
|
||||
i18n-addTagText
|
||||
[keyDownFn]="onKeyDown"
|
||||
(add)="onAdd($event)"
|
||||
(change)="onChange(value)">
|
||||
|
||||
<ng-template ng-label-tmp let-item="item">
|
||||
<button class="tag-wrap btn p-0 d-flex align-items-center" (click)="removeTag(item.id)" (mousedown)="$event.stopImmediatePropagation()" type="button" title="Remove tag" i18n-title>
|
||||
<pngx-bs-icon name="x" style="margin-inline-end: 1px;"></pngx-bs-icon>
|
||||
@if (item.id && tags) {
|
||||
<pngx-tag style="background-color: none;" [tag]="getTag(item.id)"></pngx-tag>
|
||||
}
|
||||
</button>
|
||||
@if (isImplied(item.id)) {
|
||||
<span class="implied-tag"></span>
|
||||
} @else {
|
||||
<button class="tag-wrap btn p-0 d-flex align-items-center mw-100" (click)="removeBadge(item.id)" (mousedown)="$event.stopImmediatePropagation()" type="button" title="Remove tag" i18n-title>
|
||||
<pngx-bs-icon name="x" style="margin-inline-end: 1px;"></pngx-bs-icon>
|
||||
@if (item.id && tags) {
|
||||
<pngx-tag class="mw-100 overflow-hidden" [tag]="getTag(item.id)" [split]="preserveHierarchy" (click)="removeTag(item.id); $event.stopPropagation()" (parentClick)="removeTag($event)"></pngx-tag>
|
||||
}
|
||||
</button>
|
||||
}
|
||||
</ng-template>
|
||||
<ng-template ng-option-tmp let-item="item" let-index="index" let-search="searchTerm">
|
||||
<div class="tag-option-row d-flex align-items-center" [class.w-auto]="!getTag(item.id)?.parent">
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
// ancestors of another selected tag render inside that tag's badge
|
||||
::ng-deep .paperless-input-tags .ng-value:has(> .implied-tag) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
// let a long (nowrap) split badge shrink to the field instead of widening it
|
||||
ng-select,
|
||||
::ng-deep .paperless-input-tags .ng-value-container {
|
||||
min-width: 0 !important;
|
||||
}
|
||||
|
||||
::ng-deep .paperless-input-tags .ng-value {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.paperless-input-select.disabled {
|
||||
.input-group {
|
||||
cursor: not-allowed;
|
||||
|
||||
@@ -278,4 +278,59 @@ describe('TagsComponent', () => {
|
||||
component.tags = [lone]
|
||||
expect(component.getParentChain(5)).toEqual([])
|
||||
})
|
||||
|
||||
describe('hierarchy', () => {
|
||||
const root: Tag = { id: 1, name: 'root' }
|
||||
const mid: Tag = { id: 2, name: 'mid', parent: 1 }
|
||||
const leaf: Tag = { id: 3, name: 'leaf', parent: 2 }
|
||||
const other: Tag = { id: 4, name: 'other' }
|
||||
|
||||
beforeEach(() => {
|
||||
component.tags = [root, mid, leaf, other]
|
||||
component.value = [3, 2, 1, 4]
|
||||
})
|
||||
|
||||
it('should treat ancestors of another selected tag as implied', () => {
|
||||
expect([1, 2, 3, 4].map((id) => component.isImplied(id))).toEqual([
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
])
|
||||
component.preserveHierarchy = false
|
||||
expect(component.isImplied(1)).toBe(false)
|
||||
})
|
||||
|
||||
it('should remove a whole badge, keeping ancestors other tags still need', () => {
|
||||
component.removeBadge(3)
|
||||
expect(component.value).toEqual([4])
|
||||
|
||||
const sibling: Tag = { id: 5, name: 'sibling', parent: 1 }
|
||||
component.tags = [root, mid, leaf, other, sibling]
|
||||
component.value = [3, 2, 1, 5, 4]
|
||||
component.removeBadge(3)
|
||||
expect(component.value).toEqual([1, 5, 4])
|
||||
})
|
||||
|
||||
it('should remove only the tag itself from a badge when hierarchy is not shown', () => {
|
||||
component.preserveHierarchy = false
|
||||
component.removeBadge(3)
|
||||
expect(component.value).toEqual([2, 1, 4])
|
||||
})
|
||||
|
||||
it('should remove the last visible tag on backspace, not a hidden ancestor', () => {
|
||||
const backspace = new KeyboardEvent('keydown', { key: 'Backspace' })
|
||||
expect(component.onKeyDown(backspace)).toBe(false)
|
||||
expect(component.value).toEqual([3, 2, 1])
|
||||
expect(component.onKeyDown(backspace)).toBe(false)
|
||||
expect(component.value).toEqual([2, 1])
|
||||
|
||||
// nothing hidden: leave it to ng-select
|
||||
component.value = [4]
|
||||
expect(component.onKeyDown(backspace)).toBe(true)
|
||||
expect(
|
||||
component.onKeyDown(new KeyboardEvent('keydown', { key: 'a' }))
|
||||
).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -21,7 +21,13 @@ import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select'
|
||||
import { first, firstValueFrom, tap } from 'rxjs'
|
||||
import { BootstrapIconComponent } from 'src/app/components/common/bootstrap-icon/bootstrap-icon.component'
|
||||
import { Tag } from 'src/app/data/tag'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import { TagService } from 'src/app/services/rest/tag.service'
|
||||
import { SettingsService } from 'src/app/services/settings.service'
|
||||
import {
|
||||
collapseImpliedAncestors,
|
||||
getTagAncestors,
|
||||
} from 'src/app/utils/collapse-tags'
|
||||
import { matchesSearchText } from 'src/app/utils/text-search'
|
||||
import { EditDialogMode } from '../../edit-dialog/edit-dialog.component'
|
||||
import { TagEditDialogComponent } from '../../edit-dialog/tag-edit-dialog/tag-edit-dialog.component'
|
||||
@@ -50,6 +56,7 @@ import { TagComponent } from '../../tag/tag.component'
|
||||
export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
private tagService = inject(TagService)
|
||||
private modalService = inject(NgbModal)
|
||||
private readonly settingsService = inject(SettingsService)
|
||||
private readonly changeDetector = inject(ChangeDetectorRef)
|
||||
|
||||
constructor() {
|
||||
@@ -131,6 +138,33 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
term
|
||||
)
|
||||
|
||||
/**
|
||||
* Selected tags that are ancestors of another selected tag which are shown
|
||||
* as segments of their descendant's badge.
|
||||
*/
|
||||
isImplied(id: number): boolean {
|
||||
if (!this.showsHierarchy || !this.tags || !this.value) return false
|
||||
return !collapseImpliedAncestors(this.value, this.tagsById).includes(id)
|
||||
}
|
||||
|
||||
private get showsHierarchy(): boolean {
|
||||
return (
|
||||
this.preserveHierarchy &&
|
||||
!!this.settingsService.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the last visible tag (in case its actually a hidden ancestor)
|
||||
*/
|
||||
readonly onKeyDown = (event: KeyboardEvent): boolean => {
|
||||
if (event.key !== 'Backspace' || this.select?.searchTerm) return true
|
||||
const visible = this.value?.filter((id) => !this.isImplied(id)) ?? []
|
||||
if (visible.length === (this.value?.length ?? 0)) return true
|
||||
this.removeTag(visible.at(-1))
|
||||
return false
|
||||
}
|
||||
|
||||
getTag(id: number) {
|
||||
if (this.tags) {
|
||||
return this.tags.find((tag) => tag.id == id)
|
||||
@@ -139,6 +173,26 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a whole badge i.e. the tag plus any ancestors that no other selected
|
||||
* tag still needs.
|
||||
*/
|
||||
removeBadge(tagID: number) {
|
||||
if (this.disabled) return
|
||||
if (!this.showsHierarchy) return this.removeTag(tagID)
|
||||
|
||||
const ancestors = new Set(this.getParentChain(tagID).map((t) => t.id))
|
||||
const needed = new Set(
|
||||
this.value
|
||||
.filter((id) => id !== tagID && !ancestors.has(id))
|
||||
.flatMap((id) => this.getParentChain(id).map((t) => t.id))
|
||||
)
|
||||
this.value = this.value.filter(
|
||||
(id) => id !== tagID && (!ancestors.has(id) || needed.has(id))
|
||||
)
|
||||
this.onChange(this.value)
|
||||
}
|
||||
|
||||
removeTag(tagID: number) {
|
||||
if (this.disabled) return
|
||||
|
||||
@@ -235,18 +289,17 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
}
|
||||
|
||||
getParentChain(id: number): Tag[] {
|
||||
// Returns ancestors from root → immediate parent for a tag id
|
||||
const chain: Tag[] = []
|
||||
let current = this.getTag(id)
|
||||
const guard = new Set<number>()
|
||||
while (current?.parent) {
|
||||
if (guard.has(current.parent)) break
|
||||
guard.add(current.parent)
|
||||
const parent = this.getTag(current.parent)
|
||||
if (!parent) break
|
||||
chain.unshift(parent)
|
||||
current = parent
|
||||
return getTagAncestors(id, this.tagsById)
|
||||
}
|
||||
|
||||
private tagsByIdSource: Tag[]
|
||||
private tagsByIdCache: Map<number, Tag>
|
||||
|
||||
private get tagsById(): Map<number, Tag> {
|
||||
if (this.tagsByIdSource !== this.tags) {
|
||||
this.tagsByIdSource = this.tags
|
||||
this.tagsByIdCache = new Map(this.tags?.map((t) => [t.id, t]))
|
||||
}
|
||||
return chain
|
||||
return this.tagsByIdCache
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="position-relative" [class.col-md-9]="horizontal">
|
||||
<input #inputField type="text" class="form-control" [class.is-invalid]="error" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [disabled]="disabled" [autocomplete]="autocomplete" [placeholder]="placeholder">
|
||||
<input #inputField type="text" class="form-control" [class.is-invalid]="error" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [disabled]="disabled" [autocomplete]="autocomplete" [placeholder]="placeholder">
|
||||
@if (hint) {
|
||||
<small class="form-text text-muted" [innerHTML]="hint"></small>
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
[class.font-monospace]="monospace"
|
||||
[(ngModel)]="value"
|
||||
[ngModelOptions]="{standalone: true}"
|
||||
(change)="onChange(value)"
|
||||
(ngModelChange)="onChange($event)"
|
||||
(blur)="onTouched()"
|
||||
[disabled]="disabled"
|
||||
[placeholder]="placeholder"
|
||||
rows="4">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div [class.col-md-9]="horizontal">
|
||||
<div class="input-group" [class.is-invalid]="error">
|
||||
<input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [disabled]="disabled">
|
||||
<input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [disabled]="disabled">
|
||||
<a class="btn btn-outline-secondary rounded-end" title="Open link" i18n-title [href]="value" target="_blank">
|
||||
<pngx-bs-icon width="1.2em" height="1.2em" name="box-arrow-up-right"></pngx-bs-icon>
|
||||
</a>
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
<div class="modal-header">
|
||||
<div>
|
||||
@if (until()) {
|
||||
<h4 class="modal-title" i18n>Paperless-ngx {{ until() }} is available</h4>
|
||||
<p class="text-muted small mb-0" i18n>You are running {{ version }}</p>
|
||||
} @else {
|
||||
<h4 class="modal-title" i18n>What's new in Paperless-ngx</h4>
|
||||
@if (since()) {
|
||||
<p class="text-muted small mb-0" i18n>Updated from {{ since() }} to {{ version }}</p>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-3 ms-auto">
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
<a tabindex="-1" class="btn btn-dark border-dark-subtle d-flex align-items-center" [href]="repoUrl" target="_blank" rel="noopener noreferrer"
|
||||
title="Star Paperless-ngx on GitHub" i18n-title>
|
||||
<pngx-bs-icon name="github" class="me-1 d-flex" width="12" height="12"></pngx-bs-icon><span class="small" i18n>Star</span>
|
||||
</a>
|
||||
@if (stars() !== null) {
|
||||
<a tabindex="-1" class="btn btn-dark border-dark-subtle d-flex align-items-center" [href]="repoUrl + '/stargazers'" target="_blank" rel="noopener noreferrer"
|
||||
title="Stargazers" i18n-title>
|
||||
<span class="small">{{ stars() | number }}</span>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
<button type="button" class="btn-close m-0" aria-label="Close" i18n-aria-label (click)="close()"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if (!updateCheckingEnabled()) {
|
||||
@if (!updateCheckingIsSet() && canChangeUpdateChecking) {
|
||||
<p class="mb-2" i18n>Paperless-ngx can automatically check for updates and show release notes here, fetched from GitHub.</p>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button type="button" class="btn btn-outline-primary" (click)="setUpdateChecking(true)" i18n>Enable</button>
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="setUpdateChecking(false)" i18n>Disable</button>
|
||||
</div>
|
||||
} @else {
|
||||
<p class="mb-0" i18n>Release notes are fetched from GitHub when update checking is enabled.</p>
|
||||
<ng-container *ngTemplateOutlet="githubLink"></ng-container>
|
||||
}
|
||||
} @else if (loading()) {
|
||||
<div class="d-flex align-items-center gap-2 text-muted">
|
||||
<output class="spinner-border spinner-border-sm"></output>
|
||||
<ng-container i18n>Loading release notes...</ng-container>
|
||||
</div>
|
||||
} @else if (!releases()?.length) {
|
||||
<p class="mb-0" i18n>Release notes could not be loaded.</p>
|
||||
<ng-container *ngTemplateOutlet="githubLink"></ng-container>
|
||||
} @else {
|
||||
@for (release of releases(); track release.version) {
|
||||
<section class="release-notes" [class.border-top]="!$first" [class.pt-3]="!$first" [class.mt-3]="!$first">
|
||||
<div class="d-flex align-items-baseline gap-2 mb-2">
|
||||
<h5 class="mb-0">{{ release.version }}</h5>
|
||||
<a class="d-flex flex-row align-items-center text-secondary btn-link" [href]="release.html_url" target="_blank" rel="noopener noreferrer"
|
||||
title="View on GitHub" i18n-title>
|
||||
@if (release.published_at) {
|
||||
<span class="text-muted small me-2">{{ release.published_at | customDate }}</span>
|
||||
}
|
||||
<pngx-bs-icon name="box-arrow-up-right" class="mt-n1" width=".7rem"></pngx-bs-icon>
|
||||
</a>
|
||||
</div>
|
||||
<div class="release-notes-body" [innerHTML]="release.body_html"></div>
|
||||
</section>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<div class="d-flex flex-wrap gap-3 small">
|
||||
<a class="link-secondary text-decoration-none d-flex align-items-center" [href]="releasesUrl" target="_blank" rel="noopener noreferrer">
|
||||
<pngx-bs-icon name="clock-history" class="me-1"></pngx-bs-icon><ng-container i18n>All releases</ng-container>
|
||||
</a>
|
||||
<a class="link-secondary text-decoration-none d-flex align-items-center" [href]="discussionsUrl" target="_blank" rel="noopener noreferrer">
|
||||
<pngx-bs-icon name="chat-left-text" class="me-1"></pngx-bs-icon><ng-container i18n>Need support? Ask in Discussions</ng-container>
|
||||
</a>
|
||||
</div>
|
||||
<div class="d-flex gap-3">
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="close()" i18n>Close</button>
|
||||
@if (until()) {
|
||||
<a class="btn btn-primary d-flex align-items-center" [href]="updatingDocsUrl" target="_blank" rel="noopener noreferrer">
|
||||
<ng-container i18n>How to update</ng-container>
|
||||
<pngx-bs-icon name="box-arrow-up-right" class="ms-2" width=".8rem"></pngx-bs-icon>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #githubLink>
|
||||
<a class="small" [href]="releaseUrl" target="_blank" rel="noopener noreferrer">
|
||||
<ng-container i18n>View on GitHub</ng-container>
|
||||
<pngx-bs-icon name="box-arrow-up-right" class="ms-1"></pngx-bs-icon>
|
||||
</a>
|
||||
</ng-template>
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
// Styles for GitHub-rendered release notes (body_html)
|
||||
:host ::ng-deep .release-notes-body {
|
||||
// Repeats the version heading
|
||||
> h2:first-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Section labels e.g. "Bug Fixes"
|
||||
> h3 {
|
||||
color: var(--bs-secondary-color);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 0.375rem;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 1.25rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: 0.25rem;
|
||||
|
||||
&::marker {
|
||||
color: var(--bs-secondary-color);
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
a.user-mention {
|
||||
color: var(--bs-secondary-color);
|
||||
}
|
||||
|
||||
details {
|
||||
margin-bottom: 0.75rem;
|
||||
|
||||
> summary {
|
||||
color: var(--bs-secondary-color);
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
margin-bottom: 0.375rem;
|
||||
}
|
||||
}
|
||||
|
||||
// Keep the link underline off code, where it hides underscores
|
||||
// e.g. PAPERLESS_ALLOWED_HOSTS
|
||||
a code {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// GitHub alerts, e.g. > [!NOTE]
|
||||
.markdown-alert {
|
||||
background-color: color-mix(in srgb, var(--bs-primary) 8%, transparent);
|
||||
border-left: 0.25rem solid var(--bs-primary);
|
||||
border-radius: var(--bs-border-radius);
|
||||
padding: 0.75rem 1rem;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
> :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.markdown-alert-title {
|
||||
color: var(--bs-primary);
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
import { DatePipe } from '@angular/common'
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
|
||||
import {
|
||||
HttpTestingController,
|
||||
provideHttpClientTesting,
|
||||
} from '@angular/common/http/testing'
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import { PermissionsService } from 'src/app/services/permissions.service'
|
||||
import { SettingsService } from 'src/app/services/settings.service'
|
||||
import { environment } from 'src/environments/environment'
|
||||
import {
|
||||
prepareReleaseHtml,
|
||||
ReleaseNotesDialogComponent,
|
||||
} from './release-notes-dialog.component'
|
||||
|
||||
describe('ReleaseNotesDialogComponent', () => {
|
||||
let component: ReleaseNotesDialogComponent
|
||||
let fixture: ComponentFixture<ReleaseNotesDialogComponent>
|
||||
let httpTestingController: HttpTestingController
|
||||
let settingsService: SettingsService
|
||||
|
||||
function create(updateCheckingEnabled?: boolean, canChangeSettings = true) {
|
||||
settingsService = TestBed.inject(SettingsService)
|
||||
settingsService.set(SETTINGS_KEYS.VERSION, '3.5.1')
|
||||
if (updateCheckingEnabled !== undefined) {
|
||||
settingsService.set(
|
||||
SETTINGS_KEYS.UPDATE_CHECKING_ENABLED,
|
||||
updateCheckingEnabled
|
||||
)
|
||||
}
|
||||
jest
|
||||
.spyOn(TestBed.inject(PermissionsService), 'currentUserCan')
|
||||
.mockReturnValue(canChangeSettings)
|
||||
fixture = TestBed.createComponent(ReleaseNotesDialogComponent)
|
||||
component = fixture.componentInstance
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ReleaseNotesDialogComponent],
|
||||
providers: [
|
||||
DatePipe,
|
||||
NgbActiveModal,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
],
|
||||
})
|
||||
httpTestingController = TestBed.inject(HttpTestingController)
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
httpTestingController.verify()
|
||||
})
|
||||
|
||||
it('should load and render release notes since a version', () => {
|
||||
create(true)
|
||||
component.load('3.4.2')
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}release_notes/?since=3.4.2`
|
||||
)
|
||||
req.flush({
|
||||
version: '3.5.1',
|
||||
releases: [
|
||||
{
|
||||
version: '3.5.1',
|
||||
name: 'Paperless-ngx v3.5.1',
|
||||
body_html:
|
||||
'<h2>paperless-ngx 3.5.1</h2><h3>Bug Fixes</h3><ul><li>Fix: a thing</li></ul>' +
|
||||
'<h3>All App Changes</h3><details><summary>1 change</summary><ul><li>Fix: a thing</li></ul></details>',
|
||||
html_url: '',
|
||||
published_at: '2026-11-18T05:22:01Z',
|
||||
},
|
||||
],
|
||||
})
|
||||
fixture.detectChanges()
|
||||
|
||||
const text = fixture.nativeElement.textContent
|
||||
expect(text).toContain('Updated from 3.4.2 to 3.5.1')
|
||||
expect(text).toContain('Bug Fixes')
|
||||
expect(
|
||||
fixture.nativeElement.querySelector('.modal-footer a.btn-primary')
|
||||
).toBeNull()
|
||||
expect(
|
||||
fixture.nativeElement.querySelector('.release-notes-body details summary')
|
||||
.textContent
|
||||
).toEqual('1 change')
|
||||
})
|
||||
|
||||
it('should load release notes for an available update', () => {
|
||||
create(true)
|
||||
component.load('3.5.1', '3.6.0')
|
||||
httpTestingController
|
||||
.expectOne(
|
||||
`${environment.apiBaseUrl}release_notes/?since=3.5.1&until=3.6.0`
|
||||
)
|
||||
.flush({ version: '3.5.1', releases: [] })
|
||||
fixture.detectChanges()
|
||||
|
||||
const text = fixture.nativeElement.textContent
|
||||
expect(text).toContain('Paperless-ngx 3.6.0 is available')
|
||||
expect(text).toContain('You are running 3.5.1')
|
||||
expect(component.releaseUrl).toEqual(
|
||||
'https://github.com/paperless-ngx/paperless-ngx/releases/tag/v3.6.0'
|
||||
)
|
||||
expect(
|
||||
fixture.nativeElement
|
||||
.querySelector('.modal-footer a.btn-primary')
|
||||
.getAttribute('href')
|
||||
).toEqual('https://docs.paperless-ngx.com/administration/#updating')
|
||||
})
|
||||
|
||||
it('should open release note links safely and drop svg icons', () => {
|
||||
const html = prepareReleaseHtml(
|
||||
'<div class="markdown-alert"><p class="markdown-alert-title"><svg><path d="M0"></path></svg>Note</p></div>' +
|
||||
'<p><a href="https://github.com/paperless-ngx/paperless-ngx/pull/1" data-hovercard-type="pull_request">#1</a></p>'
|
||||
)
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html')
|
||||
expect(doc.querySelector('svg')).toBeNull()
|
||||
expect(doc.querySelector('.markdown-alert-title').textContent).toEqual(
|
||||
'Note'
|
||||
)
|
||||
const link = doc.querySelector('a')
|
||||
expect(link.getAttribute('target')).toEqual('_blank')
|
||||
expect(link.getAttribute('rel')).toEqual('noopener noreferrer nofollow')
|
||||
expect(link.hasAttribute('data-hovercard-type')).toBe(false)
|
||||
})
|
||||
|
||||
it('should show a message if release notes could not be loaded', () => {
|
||||
create(true)
|
||||
component.load(null)
|
||||
httpTestingController
|
||||
.expectOne(`${environment.apiBaseUrl}release_notes/`)
|
||||
.flush('error', { status: 500, statusText: 'error' })
|
||||
fixture.detectChanges()
|
||||
|
||||
expect(fixture.nativeElement.textContent).toContain(
|
||||
'Release notes could not be loaded'
|
||||
)
|
||||
})
|
||||
|
||||
it('should not fetch release notes if update checking is disabled', () => {
|
||||
create(false)
|
||||
component.load('3.4.2')
|
||||
fixture.detectChanges()
|
||||
|
||||
httpTestingController.expectNone(`${environment.apiBaseUrl}release_notes/`)
|
||||
expect(fixture.nativeElement.textContent).toContain(
|
||||
'when update checking is enabled'
|
||||
)
|
||||
expect(component.releaseUrl).toEqual(
|
||||
'https://github.com/paperless-ngx/paperless-ngx/releases/tag/v3.5.1'
|
||||
)
|
||||
})
|
||||
|
||||
it('should offer to enable update checking if never chosen', () => {
|
||||
create()
|
||||
const chosen = jest.fn()
|
||||
component.updateCheckingChosen.subscribe(chosen)
|
||||
component.load('3.4.2')
|
||||
fixture.detectChanges()
|
||||
|
||||
const enable = Array.from(
|
||||
fixture.nativeElement.querySelectorAll('.modal-body button')
|
||||
).find((b: HTMLButtonElement) => b.textContent.trim() === 'Enable') as
|
||||
HTMLButtonElement | undefined
|
||||
expect(enable).toBeTruthy()
|
||||
httpTestingController.expectNone(`${environment.apiBaseUrl}release_notes/`)
|
||||
|
||||
enable.click()
|
||||
expect(chosen).toHaveBeenCalledWith(true)
|
||||
httpTestingController
|
||||
.expectOne(`${environment.apiBaseUrl}release_notes/?since=3.4.2`)
|
||||
.flush({ version: '3.5.1', releases: [] })
|
||||
})
|
||||
|
||||
it('should show the disabled message after choosing disable', () => {
|
||||
create()
|
||||
const chosen = jest.fn()
|
||||
component.updateCheckingChosen.subscribe(chosen)
|
||||
component.load(null)
|
||||
component.setUpdateChecking(false)
|
||||
fixture.detectChanges()
|
||||
|
||||
expect(chosen).toHaveBeenCalledWith(false)
|
||||
httpTestingController.expectNone(`${environment.apiBaseUrl}release_notes/`)
|
||||
expect(fixture.nativeElement.textContent).toContain(
|
||||
'when update checking is enabled'
|
||||
)
|
||||
})
|
||||
|
||||
it('should not offer to enable update checking without permission', () => {
|
||||
create(undefined, false)
|
||||
component.load(null)
|
||||
fixture.detectChanges()
|
||||
|
||||
expect(fixture.nativeElement.textContent).not.toContain('Enable')
|
||||
expect(fixture.nativeElement.textContent).toContain(
|
||||
'when update checking is enabled'
|
||||
)
|
||||
})
|
||||
|
||||
it('should support close', () => {
|
||||
create(false)
|
||||
const closeSpy = jest.spyOn(component.activeModal, 'close')
|
||||
component.close()
|
||||
expect(closeSpy).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
import { DecimalPipe, NgTemplateOutlet } from '@angular/common'
|
||||
import { Component, inject, output, signal } from '@angular/core'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { first } from 'rxjs'
|
||||
import { BootstrapIconComponent } from 'src/app/components/common/bootstrap-icon/bootstrap-icon.component'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
|
||||
import {
|
||||
PermissionAction,
|
||||
PermissionsService,
|
||||
PermissionType,
|
||||
} from 'src/app/services/permissions.service'
|
||||
import {
|
||||
AppRelease,
|
||||
RemoteVersionService,
|
||||
} from 'src/app/services/rest/remote-version.service'
|
||||
import { SettingsService } from 'src/app/services/settings.service'
|
||||
|
||||
const REPO_URL = 'https://github.com/paperless-ngx/paperless-ngx'
|
||||
const RELEASES_URL = `${REPO_URL}/releases`
|
||||
const DISCUSSIONS_URL = `${REPO_URL}/discussions/new/choose`
|
||||
const UPDATING_DOCS_URL =
|
||||
'https://docs.paperless-ngx.com/administration/#updating'
|
||||
|
||||
/**
|
||||
* Tweak GitHub release HTML: open links in a new tab, add no referrer etc,
|
||||
* drop inline svgs and GH `data-*` attributes. Angular sanitizes all of this anyway.
|
||||
*/
|
||||
export function prepareReleaseHtml(html: string): string {
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html')
|
||||
doc.querySelectorAll('svg').forEach((svg) => svg.remove())
|
||||
doc.body.querySelectorAll('*').forEach((el) => {
|
||||
for (const attr of Array.from(el.attributes)) {
|
||||
if (attr.name.startsWith('data-')) el.removeAttribute(attr.name)
|
||||
}
|
||||
})
|
||||
doc.querySelectorAll('a').forEach((a) => {
|
||||
a.setAttribute('target', '_blank')
|
||||
a.setAttribute('rel', 'noopener noreferrer nofollow')
|
||||
})
|
||||
return doc.body.innerHTML
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'pngx-release-notes-dialog',
|
||||
templateUrl: './release-notes-dialog.component.html',
|
||||
styleUrls: ['./release-notes-dialog.component.scss'],
|
||||
imports: [
|
||||
BootstrapIconComponent,
|
||||
CustomDatePipe,
|
||||
NgTemplateOutlet,
|
||||
DecimalPipe,
|
||||
],
|
||||
})
|
||||
export class ReleaseNotesDialogComponent {
|
||||
readonly activeModal = inject(NgbActiveModal)
|
||||
private readonly remoteVersionService = inject(RemoteVersionService)
|
||||
private readonly settingsService = inject(SettingsService)
|
||||
private readonly permissionsService = inject(PermissionsService)
|
||||
|
||||
readonly since = signal<string | null>(null)
|
||||
readonly until = signal<string | null>(null)
|
||||
readonly releases = signal<AppRelease[] | null>(null)
|
||||
readonly stars = signal<number | null>(null)
|
||||
readonly loading = signal(false)
|
||||
|
||||
readonly version: string = this.settingsService.get(SETTINGS_KEYS.VERSION)
|
||||
readonly updateCheckingEnabled = signal<boolean>(
|
||||
this.settingsService.get(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED)
|
||||
)
|
||||
readonly updateCheckingIsSet = signal(
|
||||
this.settingsService.updateCheckingIsSet
|
||||
)
|
||||
readonly canChangeUpdateChecking = this.permissionsService.currentUserCan(
|
||||
PermissionAction.Change,
|
||||
PermissionType.UISettings
|
||||
)
|
||||
|
||||
readonly updateCheckingChosen = output<boolean>()
|
||||
|
||||
readonly repoUrl = REPO_URL
|
||||
readonly releasesUrl = RELEASES_URL
|
||||
readonly discussionsUrl = DISCUSSIONS_URL
|
||||
readonly updatingDocsUrl = UPDATING_DOCS_URL
|
||||
|
||||
get releaseUrl(): string {
|
||||
const version = this.until() ?? this.version
|
||||
return version ? `${RELEASES_URL}/tag/v${version}` : RELEASES_URL
|
||||
}
|
||||
|
||||
/**
|
||||
* Load notes for releases after `since` up to `until` (default: the
|
||||
* running version), or just the `until` version's notes if `since` is null.
|
||||
*/
|
||||
load(since: string | null, until: string | null = null): void {
|
||||
this.since.set(since)
|
||||
this.until.set(until)
|
||||
if (!this.updateCheckingEnabled()) return
|
||||
this.loading.set(true)
|
||||
this.remoteVersionService
|
||||
.getReleaseNotes(since ?? undefined, until ?? undefined)
|
||||
.pipe(first())
|
||||
.subscribe({
|
||||
next: (notes) => {
|
||||
this.releases.set(
|
||||
notes.releases.map((release) => ({
|
||||
...release,
|
||||
body_html: prepareReleaseHtml(release.body_html),
|
||||
}))
|
||||
)
|
||||
this.stars.set(notes.stars ?? null)
|
||||
this.loading.set(false)
|
||||
},
|
||||
error: () => {
|
||||
this.releases.set([])
|
||||
this.loading.set(false)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
setUpdateChecking(enable: boolean): void {
|
||||
this.updateCheckingIsSet.set(true)
|
||||
this.updateCheckingEnabled.set(enable)
|
||||
this.updateCheckingChosen.emit(enable)
|
||||
if (enable) this.load(this.since(), this.until())
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.activeModal.close()
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,18 @@
|
||||
@if (tag()) {
|
||||
@if (showParents() && tag().parent) {
|
||||
<pngx-tag [tagID]="tag().parent" [clickable]="clickable()" [linkTitle]="linkTitle()"></pngx-tag>
|
||||
>
|
||||
}
|
||||
@if (!clickable()) {
|
||||
<span class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</span>
|
||||
}
|
||||
@if (clickable()) {
|
||||
<a [title]="linkTitle()" class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</a>
|
||||
@if (ancestorSegments.length) {
|
||||
<span #pill class="split-pill d-inline-flex mw-100" [title]="path()" (mouseleave)="setFocus(pill, null)">
|
||||
@for (ancestor of ancestorSegments; track ancestor.id; let first = $first) {
|
||||
<span #segment class="badge split-parent" [class.rounded-end-0]="first" [class.rounded-0]="!first" [style.background]="ancestor.color" [style.color]="ancestor.text_color" (mouseenter)="setFocus(pill, segment)" (click)="onParentClick($event, ancestor.id)">{{ancestor.name}}</span>
|
||||
}
|
||||
<span #leaf class="badge rounded-start-0 split-child" [style.background]="tag().color" [style.color]="tag().text_color" (mouseenter)="setFocus(pill, leaf)">{{tag().name}}</span>
|
||||
</span>
|
||||
} @else {
|
||||
@if (!clickable()) {
|
||||
<span class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</span>
|
||||
}
|
||||
@if (clickable()) {
|
||||
<a [title]="linkTitle()" class="badge" [style.background]="tag().color" [style.color]="tag().text_color">{{tag().name}}</a>
|
||||
}
|
||||
}
|
||||
} @else if (loading) {
|
||||
<span class="placeholder-glow">
|
||||
|
||||
@@ -11,3 +11,46 @@ a, span {
|
||||
opacity: .5;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.split-parent,
|
||||
.split-child {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
transition: color .2s ease;
|
||||
}
|
||||
|
||||
.split-parent {
|
||||
min-width: 1.5em;
|
||||
max-width: 10em;
|
||||
padding-inline: .4em;
|
||||
text-overflow: clip;
|
||||
|
||||
&:nth-last-child(2) { flex-shrink: 1e12; }
|
||||
&:nth-last-child(3) { flex-shrink: 1e18; }
|
||||
&:nth-last-child(4) { flex-shrink: 1e24; }
|
||||
&:nth-last-child(5) { flex-shrink: 1e30; }
|
||||
|
||||
&.collapsed {
|
||||
color: transparent !important;
|
||||
}
|
||||
}
|
||||
|
||||
.split-child {
|
||||
flex-shrink: 1e6;
|
||||
min-width: 2em;
|
||||
max-width: 20em; // nowrap, so very long names would otherwise widen e.g. table columns
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
// Hovered segment gets priority, other parents can shrink to a sliver
|
||||
.split-pill {
|
||||
> .split-parent.focused,
|
||||
> .split-child.focused {
|
||||
flex-shrink: 1;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
&:has(> .focused) > .split-parent:not(.focused) {
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { of } from 'rxjs'
|
||||
import { Tag } from 'src/app/data/tag'
|
||||
import { PermissionsService } from 'src/app/services/permissions.service'
|
||||
import { TagService } from 'src/app/services/rest/tag.service'
|
||||
import { SettingsService } from 'src/app/services/settings.service'
|
||||
import { TagComponent } from './tag.component'
|
||||
|
||||
const tag: Tag = {
|
||||
@@ -69,4 +70,88 @@ describe('TagComponent', () => {
|
||||
expect(getCachedSpy).toHaveBeenCalledWith(1)
|
||||
expect(component.tag()).toEqual(tag)
|
||||
})
|
||||
describe('split badge', () => {
|
||||
const root: Tag = { id: 1, name: 'Root', color: '#000000' }
|
||||
const mid: Tag = { id: 2, name: 'Mid', color: '#111111', parent: 1 }
|
||||
const leaf: Tag = { id: 3, name: 'Leaf', color: '#222222', parent: 2 }
|
||||
|
||||
const segments = (): HTMLElement[] =>
|
||||
fixture.debugElement
|
||||
.queryAll(By.css('.split-pill > .badge'))
|
||||
.map((d) => d.nativeElement)
|
||||
|
||||
beforeEach(() => {
|
||||
jest.spyOn(permissionsService, 'currentUserCan').mockReturnValue(true)
|
||||
jest.spyOn(tagService, 'getCached').mockReturnValue(of(leaf))
|
||||
jest
|
||||
.spyOn(tagService, 'listAll')
|
||||
.mockReturnValue(
|
||||
of({ count: 3, all: [1, 2, 3], results: [root, mid, leaf] })
|
||||
)
|
||||
fixture.componentRef.setInput('tagID', 3)
|
||||
fixture.componentRef.setInput('split', true)
|
||||
fixture.detectChanges()
|
||||
})
|
||||
|
||||
it('should render ancestors as segments with the full path as title', () => {
|
||||
expect(segments().map((s) => s.textContent.trim())).toEqual([
|
||||
'Root',
|
||||
'Mid',
|
||||
'Leaf',
|
||||
])
|
||||
expect(
|
||||
fixture.debugElement.query(By.css('.split-pill')).nativeElement.title
|
||||
).toEqual('Root › Mid › Leaf')
|
||||
})
|
||||
|
||||
it('should render a plain badge when the setting is off', () => {
|
||||
jest.spyOn(TestBed.inject(SettingsService), 'get').mockReturnValue(false)
|
||||
fixture.componentRef.setInput('split', false)
|
||||
fixture.detectChanges()
|
||||
fixture.componentRef.setInput('split', true)
|
||||
fixture.detectChanges()
|
||||
expect(fixture.debugElement.query(By.css('.split-pill'))).toBeNull()
|
||||
expect(component.ancestorSegments).toEqual([])
|
||||
})
|
||||
|
||||
it('should emit the ancestor id when an ancestor segment is clicked', () => {
|
||||
const emitSpy = jest.spyOn(component.parentClick, 'emit')
|
||||
const event = new MouseEvent('click', { bubbles: true })
|
||||
const stopSpy = jest.spyOn(event, 'stopImmediatePropagation')
|
||||
segments()[1].dispatchEvent(event)
|
||||
expect(emitSpy).toHaveBeenCalledWith(2)
|
||||
expect(stopSpy).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should focus the hovered segment and animate width changes', () => {
|
||||
const [rootSeg, midSeg, leafSeg] = segments()
|
||||
const pill = rootSeg.parentElement
|
||||
// before / after widths per segment, as measured by setFocus
|
||||
const widths = new Map<HTMLElement, number[]>([
|
||||
[rootSeg, [20, 4]],
|
||||
[midSeg, [20, 60]],
|
||||
[leafSeg, [40, 40]],
|
||||
])
|
||||
const animate = jest.fn()
|
||||
for (const [seg, [before, after]] of widths) {
|
||||
seg.getAnimations = jest.fn(() => [])
|
||||
seg.animate = animate
|
||||
jest
|
||||
.spyOn(seg, 'getBoundingClientRect')
|
||||
.mockReturnValueOnce({ width: before } as DOMRect)
|
||||
.mockReturnValueOnce({ width: after } as DOMRect)
|
||||
}
|
||||
|
||||
midSeg.dispatchEvent(new MouseEvent('mouseenter'))
|
||||
expect(midSeg.classList).toContain('focused')
|
||||
expect(rootSeg.classList).not.toContain('focused')
|
||||
// only the segments whose width changed are animated
|
||||
expect(animate).toHaveBeenCalledTimes(2)
|
||||
|
||||
pill.dispatchEvent(new MouseEvent('mouseleave'))
|
||||
expect(segments().some((s) => s.classList.contains('focused'))).toBe(
|
||||
false
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -1,11 +1,27 @@
|
||||
import { Component, effect, inject, input, model } from '@angular/core'
|
||||
import {
|
||||
Component,
|
||||
computed,
|
||||
effect,
|
||||
inject,
|
||||
input,
|
||||
model,
|
||||
output,
|
||||
signal,
|
||||
} from '@angular/core'
|
||||
import { Tag } from 'src/app/data/tag'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import {
|
||||
PermissionAction,
|
||||
PermissionsService,
|
||||
PermissionType,
|
||||
} from 'src/app/services/permissions.service'
|
||||
import { TagService } from 'src/app/services/rest/tag.service'
|
||||
import { SettingsService } from 'src/app/services/settings.service'
|
||||
import { getTagAncestors } from 'src/app/utils/collapse-tags'
|
||||
|
||||
const FOCUS_ANIMATION_MS = 200
|
||||
// matches the .split-parent min-width in tag.component.scss
|
||||
const COLLAPSE_BELOW_EM = 1.5
|
||||
|
||||
@Component({
|
||||
selector: 'pngx-tag',
|
||||
@@ -13,8 +29,9 @@ import { TagService } from 'src/app/services/rest/tag.service'
|
||||
styleUrls: ['./tag.component.scss'],
|
||||
})
|
||||
export class TagComponent {
|
||||
private permissionsService = inject(PermissionsService)
|
||||
private tagService = inject(TagService)
|
||||
private readonly permissionsService = inject(PermissionsService)
|
||||
private readonly tagService = inject(TagService)
|
||||
private readonly settingsService = inject(SettingsService)
|
||||
|
||||
readonly tag = model<Tag>(null)
|
||||
readonly tagID = input<number>(undefined)
|
||||
@@ -23,27 +40,101 @@ export class TagComponent {
|
||||
transform: (value: boolean | string) =>
|
||||
value === '' || value === true || value === 'true',
|
||||
})
|
||||
readonly showParents = input(false)
|
||||
|
||||
readonly split = input(false)
|
||||
|
||||
readonly parentClick = output<number>()
|
||||
|
||||
private readonly ancestors = signal<Tag[]>([])
|
||||
|
||||
public get ancestorSegments(): Tag[] {
|
||||
return this.split() &&
|
||||
this.settingsService.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY)
|
||||
? this.ancestors()
|
||||
: []
|
||||
}
|
||||
|
||||
public readonly path = computed(() =>
|
||||
[...this.ancestors(), this.tag()]
|
||||
.filter(Boolean)
|
||||
.map((t) => t.name)
|
||||
.join(' › ')
|
||||
)
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const tagID = this.tagID()
|
||||
if (tagID) {
|
||||
if (
|
||||
this.permissionsService.currentUserCan(
|
||||
PermissionAction.View,
|
||||
PermissionType.Tag
|
||||
)
|
||||
) {
|
||||
this.tagService.getCached(tagID).subscribe((tag) => {
|
||||
this.tag.set(tag)
|
||||
})
|
||||
}
|
||||
if (tagID && this.canViewTags) {
|
||||
this.tagService.getCached(tagID).subscribe((tag) => {
|
||||
this.tag.set(tag)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// ancestors for split badges, from either tagID or a passed-in tag
|
||||
effect(() => {
|
||||
const id = this.tagID() || this.tag()?.id
|
||||
if (!this.split() || !id || !this.canViewTags) {
|
||||
this.ancestors.set([])
|
||||
return
|
||||
}
|
||||
this.tagService.listAll().subscribe((tags) => {
|
||||
this.ancestors.set(
|
||||
getTagAncestors(
|
||||
id,
|
||||
new Map<number, Tag>(tags.results.map((t) => [t.id, t]))
|
||||
)
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
private get canViewTags(): boolean {
|
||||
return this.permissionsService.currentUserCan(
|
||||
PermissionAction.View,
|
||||
PermissionType.Tag
|
||||
)
|
||||
}
|
||||
|
||||
public get loading(): boolean {
|
||||
return this.tagService.loading
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives the hovered segment priority (.focused class, see scss)
|
||||
* and animates each from old width to new
|
||||
*/
|
||||
setFocus(segment: HTMLElement, focused: HTMLElement | null) {
|
||||
const segments = Array.from(segment.children) as HTMLElement[]
|
||||
const before = segments.map((s) => s.getBoundingClientRect().width)
|
||||
for (const segment of segments) {
|
||||
segment.getAnimations().forEach((a) => a.cancel())
|
||||
segment.classList.toggle('focused', segment === focused)
|
||||
}
|
||||
const after = segments.map((s) => s.getBoundingClientRect().width)
|
||||
|
||||
segments.forEach((segment, i) => {
|
||||
const em = Number.parseFloat(getComputedStyle(segment).fontSize)
|
||||
segment.classList.toggle(
|
||||
'collapsed',
|
||||
!!focused &&
|
||||
segment.classList.contains('split-parent') &&
|
||||
after[i] < COLLAPSE_BELOW_EM * em
|
||||
)
|
||||
if (Math.abs(after[i] - before[i]) < 0.5) return
|
||||
segment.animate(
|
||||
[
|
||||
{ flex: `0 0 ${before[i]}px`, minWidth: 0 },
|
||||
{ flex: `0 0 ${after[i]}px`, minWidth: 0 },
|
||||
],
|
||||
{ duration: FOCUS_ANIMATION_MS, easing: 'ease' }
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
onParentClick(event: MouseEvent, id: number) {
|
||||
event.preventDefault()
|
||||
event.stopImmediatePropagation()
|
||||
this.parentClick.emit(id)
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -76,8 +76,8 @@
|
||||
}
|
||||
}
|
||||
@case (DisplayField.TAGS) {
|
||||
@for (tagID of doc.tags; track tagID) {
|
||||
<pngx-tag [tagID]="tagID" class="ms-1 fs-6" (click)="clickTag(tagID, $event)" [clickable]="true" linkTitle="Filter by tag" i18n-title></pngx-tag>
|
||||
@for (tagID of doc.tags | collapseTags | async; track tagID) {
|
||||
<pngx-tag [tagID]="tagID" [split]="true" class="ms-1 fs-6" (click)="clickTag(tagID, $event)" (parentClick)="clickTag($event)" [clickable]="true" linkTitle="Filter by tag" i18n-title></pngx-tag>
|
||||
}
|
||||
}
|
||||
@case (DisplayField.DOCUMENT_TYPE) {
|
||||
|
||||
+2
@@ -38,6 +38,7 @@ import {
|
||||
} from 'src/app/data/filter-rule-type'
|
||||
import { SavedView } from 'src/app/data/saved-view'
|
||||
import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive'
|
||||
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
|
||||
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
|
||||
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
|
||||
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
|
||||
@@ -75,6 +76,7 @@ import { WidgetFrameComponent } from '../widget-frame/widget-frame.component'
|
||||
DocumentTypeNamePipe,
|
||||
StoragePathNamePipe,
|
||||
AsyncPipe,
|
||||
CollapseTagsPipe,
|
||||
DocumentTitlePipe,
|
||||
CustomDatePipe,
|
||||
NgClass,
|
||||
|
||||
@@ -497,7 +497,7 @@
|
||||
(loadError)="onError($event)"
|
||||
(afterLoadComplete)="pdfPreviewLoaded($event)">
|
||||
</pngx-pdf-viewer>
|
||||
<div class="preview-controls position-absolute bottom-0 start-50 translate-middle-x z-1 mb-3 d-flex gap-2 p-1 bg-body border rounded shadow">
|
||||
<div class="preview-controls position-absolute bottom-0 start-50 translate-middle-x z-1 mb-5 d-flex gap-2 p-1 bg-body border rounded shadow">
|
||||
@if (previewNumPages()) {
|
||||
<div class="input-group input-group-sm w-auto flex-nowrap">
|
||||
<input class="form-control flex-grow-0 w-auto" type="number" min="1" [max]="previewNumPages()" [ngModelOptions]="{standalone: true}" [ngModel]="previewCurrentPage()" (ngModelChange)="previewCurrentPage.set($event)" aria-label="Page" i18n-aria-label />
|
||||
|
||||
@@ -390,14 +390,12 @@ describe('DocumentDetailComponent', () => {
|
||||
expect(component.documentForm.get('title').value).toEqual('Foo Bar')
|
||||
})
|
||||
|
||||
it('should update title before doc change if was not updated via debounce', () => {
|
||||
it('should update the title form value without waiting for debounce or blur', () => {
|
||||
jest.useFakeTimers()
|
||||
initNormally()
|
||||
component.titleInput.value = 'Foo Bar'
|
||||
component.titleInput.inputField.nativeElement.dispatchEvent(
|
||||
new Event('change')
|
||||
)
|
||||
jest.advanceTimersByTime(1000)
|
||||
const input = component.titleInput.inputField.nativeElement
|
||||
input.value = 'Foo Bar'
|
||||
input.dispatchEvent(new Event('input'))
|
||||
expect(component.documentForm.get('title').value).toEqual('Foo Bar')
|
||||
})
|
||||
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@
|
||||
{{document().title | documentTitle}}
|
||||
}
|
||||
@if (displayFields().includes(DisplayField.TAGS)) {
|
||||
@for (tagID of document().tags; track tagID) {
|
||||
<pngx-tag [tagID]="tagID" linkTitle="Filter by tag" i18n-linkTitle class="ms-1" (click)="clickTag.emit(tagID);$event.stopPropagation()" [clickable]="clickTag.observers.length"></pngx-tag>
|
||||
@for (tagID of document().tags | collapseTags | async; track tagID) {
|
||||
<pngx-tag [tagID]="tagID" [split]="true" linkTitle="Filter by tag" i18n-linkTitle class="ms-1" (click)="clickTag.emit(tagID);$event.stopPropagation()" (parentClick)="clickTag.emit($event)" [clickable]="clickTag.observers.length"></pngx-tag>
|
||||
}
|
||||
}
|
||||
} @else {
|
||||
|
||||
+2
@@ -20,6 +20,7 @@ import {
|
||||
Document,
|
||||
} from 'src/app/data/document'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
|
||||
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
|
||||
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
|
||||
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
|
||||
@@ -45,6 +46,7 @@ import { LoadingComponentWithPermissions } from '../../loading-component/loading
|
||||
TagComponent,
|
||||
CustomFieldDisplayComponent,
|
||||
AsyncPipe,
|
||||
CollapseTagsPipe,
|
||||
NgOptimizedImage,
|
||||
UsernamePipe,
|
||||
CorrespondentNamePipe,
|
||||
|
||||
+5
-4
@@ -19,11 +19,12 @@
|
||||
}
|
||||
|
||||
@if (document() && displayFields().includes(DisplayField.TAGS)) {
|
||||
<div class="tags d-flex flex-column text-end position-absolute me-1 fs-6" [class.tags-no-wrap]="document().tags.length > 3">
|
||||
@for (tagID of tagIDs; track tagID) {
|
||||
<pngx-tag [tagID]="tagID" (click)="clickTag.emit(tagID);$event.stopPropagation()" [clickable]="true" linkTitle="Toggle tag filter" i18n-linkTitle></pngx-tag>
|
||||
@let visibleTagIDs = document().tags | collapseTags | async;
|
||||
<div class="tags d-flex flex-column text-end position-absolute me-1 fs-6" [class.tags-no-wrap]="visibleTagIDs?.length > 3">
|
||||
@for (tagID of getTagIDs(visibleTagIDs); track tagID) {
|
||||
<pngx-tag [tagID]="tagID" [split]="true" (click)="clickTag.emit(tagID);$event.stopPropagation()" (parentClick)="clickTag.emit($event)" [clickable]="true" linkTitle="Toggle tag filter" i18n-linkTitle></pngx-tag>
|
||||
}
|
||||
@if (moreTags) {
|
||||
@if (getMoreTags(visibleTagIDs); as moreTags) {
|
||||
<div>
|
||||
<span class="badge text-dark">+ {{moreTags}}</span>
|
||||
</div>
|
||||
|
||||
+2
-1
@@ -103,7 +103,8 @@ a {
|
||||
line-height: 1;
|
||||
|
||||
&.tags-no-wrap {
|
||||
::ng-deep .badge {
|
||||
// split-pill parents clip to a stub instead (see TagComponent)
|
||||
::ng-deep .badge:not(.split-parent) {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
white-space: nowrap;
|
||||
|
||||
+33
-2
@@ -4,6 +4,9 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
||||
import { By } from '@angular/platform-browser'
|
||||
import { RouterTestingModule } from '@angular/router/testing'
|
||||
import { of } from 'rxjs'
|
||||
import { PermissionsService } from 'src/app/services/permissions.service'
|
||||
import { TagService } from 'src/app/services/rest/tag.service'
|
||||
import { TagComponent } from '../../common/tag/tag.component'
|
||||
import { DocumentCardSmallComponent } from './document-card-small.component'
|
||||
|
||||
@@ -97,8 +100,36 @@ describe('DocumentCardSmallComponent', () => {
|
||||
).toHaveLength(6)
|
||||
})
|
||||
|
||||
it('should hide parent tags implied by a child and count pills for the hidden tag counter', () => {
|
||||
jest
|
||||
.spyOn(TestBed.inject(PermissionsService), 'currentUserCan')
|
||||
.mockReturnValue(true)
|
||||
jest.spyOn(TestBed.inject(TagService), 'listAll').mockReturnValue(
|
||||
of({
|
||||
count: 8,
|
||||
all: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
results: [
|
||||
{ id: 1, name: 'Parent' },
|
||||
{ id: 2, name: 'Child', parent: 1 },
|
||||
...[3, 4, 5, 6, 7, 8].map((id) => ({ id, name: `Tag ${id}` })),
|
||||
],
|
||||
})
|
||||
)
|
||||
fixture.componentRef.setInput('document', {
|
||||
...component.document(),
|
||||
tags: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
})
|
||||
fixture.detectChanges()
|
||||
|
||||
const tags = fixture.debugElement.queryAll(By.directive(TagComponent))
|
||||
expect(tags.map((t) => t.componentInstance.tagID())).toEqual([
|
||||
2, 3, 4, 5, 6,
|
||||
])
|
||||
expect(fixture.nativeElement.textContent).toContain('+ 2')
|
||||
})
|
||||
|
||||
it('should clear hidden tag counter when tag count falls below the limit', () => {
|
||||
expect(component.moreTags).toEqual(3)
|
||||
expect(component.getMoreTags(component.document().tags)).toEqual(3)
|
||||
|
||||
fixture.componentRef.setInput('document', {
|
||||
...component.document(),
|
||||
@@ -106,7 +137,7 @@ describe('DocumentCardSmallComponent', () => {
|
||||
})
|
||||
fixture.detectChanges()
|
||||
|
||||
expect(component.moreTags).toBeNull()
|
||||
expect(component.getMoreTags(component.document().tags)).toBeNull()
|
||||
expect(fixture.nativeElement.textContent).not.toContain('+ 3')
|
||||
})
|
||||
|
||||
|
||||
+12
-14
@@ -20,6 +20,7 @@ import {
|
||||
Document,
|
||||
} from 'src/app/data/document'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
|
||||
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
|
||||
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
|
||||
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
|
||||
@@ -45,6 +46,7 @@ import { LoadingComponentWithPermissions } from '../../loading-component/loading
|
||||
TagComponent,
|
||||
CustomFieldDisplayComponent,
|
||||
AsyncPipe,
|
||||
CollapseTagsPipe,
|
||||
NgOptimizedImage,
|
||||
UsernamePipe,
|
||||
CorrespondentNamePipe,
|
||||
@@ -90,12 +92,13 @@ export class DocumentCardSmallComponent
|
||||
@Output()
|
||||
clickStoragePath = new EventEmitter<number>()
|
||||
|
||||
get moreTags(): number {
|
||||
const document = this.document()
|
||||
const limit = document?.notes.length > 0 ? 6 : 7
|
||||
return document?.tags.length > limit
|
||||
? document.tags.length - (limit - 1)
|
||||
: null
|
||||
private get tagLimit(): number {
|
||||
return this.document()?.notes.length > 0 ? 6 : 7
|
||||
}
|
||||
|
||||
getMoreTags(tagIDs: number[]): number {
|
||||
const limit = this.tagLimit
|
||||
return tagIDs?.length > limit ? tagIDs.length - (limit - 1) : null
|
||||
}
|
||||
|
||||
@ViewChild('popupPreview') popupPreview: PreviewPopupComponent
|
||||
@@ -116,14 +119,9 @@ export class DocumentCardSmallComponent
|
||||
return this.documentService.getDownloadUrl(this.document().id)
|
||||
}
|
||||
|
||||
get tagIDs() {
|
||||
const document = this.document()
|
||||
const limit = document.notes.length > 0 ? 6 : 7
|
||||
if (document.tags.length > limit) {
|
||||
return document.tags.slice(0, limit - 1)
|
||||
} else {
|
||||
return document.tags
|
||||
}
|
||||
getTagIDs(tagIDs: number[]): number[] {
|
||||
const limit = this.tagLimit
|
||||
return tagIDs?.length > limit ? tagIDs.slice(0, limit - 1) : tagIDs
|
||||
}
|
||||
|
||||
mouseLeaveCard() {
|
||||
|
||||
@@ -335,8 +335,8 @@
|
||||
<a routerLink="/documents/{{d.id}}" title="Edit document" i18n-title style="overflow-wrap: anywhere;">{{d.title | documentTitle}}</a>
|
||||
}
|
||||
@if (activeDisplayFields.includes(DisplayField.TAGS)) {
|
||||
@for (tagID of d.tags; track tagID) {
|
||||
<pngx-tag [tagID]="tagID" class="ms-1 fs-6" clickable="true" linkTitle="Filter by tag" i18n-linkTitle (click)="clickTag(tagID);$event.stopPropagation()"></pngx-tag>
|
||||
@for (tagID of d.tags | collapseTags | async; track tagID) {
|
||||
<pngx-tag [tagID]="tagID" [split]="true" class="ms-1 fs-6" clickable="true" linkTitle="Filter by tag" i18n-linkTitle (click)="clickTag(tagID);$event.stopPropagation()" (parentClick)="clickTag($event)"></pngx-tag>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
SortableDirective,
|
||||
SortEvent,
|
||||
} from 'src/app/directives/sortable.directive'
|
||||
import { CollapseTagsPipe } from 'src/app/pipes/collapse-tags.pipe'
|
||||
import { CorrespondentNamePipe } from 'src/app/pipes/correspondent-name.pipe'
|
||||
import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe'
|
||||
import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'
|
||||
@@ -96,6 +97,7 @@ import { SaveViewConfigDialogComponent } from './save-view-config-dialog/save-vi
|
||||
StoragePathNamePipe,
|
||||
BootstrapIconComponent,
|
||||
AsyncPipe,
|
||||
CollapseTagsPipe,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
NgTemplateOutlet,
|
||||
|
||||
@@ -75,6 +75,7 @@ export const SETTINGS_KEYS = {
|
||||
UPDATE_CHECKING_ENABLED: 'general-settings:update-checking:enabled',
|
||||
UPDATE_CHECKING_BACKEND_SETTING:
|
||||
'general-settings:update-checking:backend-setting',
|
||||
WHATS_NEW_LAST_SEEN_VERSION: 'general-settings:whats-new:last-seen-version',
|
||||
SAVED_VIEWS_WARN_ON_UNSAVED_CHANGE:
|
||||
'general-settings:saved-views:warn-on-unsaved-change',
|
||||
DASHBOARD_VIEWS_VISIBLE_IDS:
|
||||
@@ -94,6 +95,7 @@ export const SETTINGS_KEYS = {
|
||||
DEFAULT_PERMS_VIEW_GROUPS: 'general-settings:permissions:default-view-groups',
|
||||
DEFAULT_PERMS_EDIT_USERS: 'general-settings:permissions:default-edit-users',
|
||||
DEFAULT_PERMS_EDIT_GROUPS: 'general-settings:permissions:default-edit-groups',
|
||||
TAGS_SHOW_HIERARCHY: 'general-settings:tags:show-hierarchy',
|
||||
DOCUMENT_EDITING_REMOVE_INBOX_TAGS:
|
||||
'general-settings:document-editing:remove-inbox-tags',
|
||||
DOCUMENT_EDITING_OVERLAY_THUMBNAIL:
|
||||
@@ -223,6 +225,11 @@ export const SETTINGS: UiSetting[] = [
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
key: SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION,
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
key: SETTINGS_KEYS.SAVED_VIEWS_WARN_ON_UNSAVED_CHANGE,
|
||||
type: 'boolean',
|
||||
@@ -305,6 +312,11 @@ export const SETTINGS: UiSetting[] = [
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
key: SETTINGS_KEYS.TAGS_SHOW_HIERARCHY,
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
key: SETTINGS_KEYS.DOCUMENT_EDITING_REMOVE_INBOX_TAGS,
|
||||
type: 'boolean',
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing'
|
||||
import { TestBed } from '@angular/core/testing'
|
||||
import { firstValueFrom, of, throwError } from 'rxjs'
|
||||
import { Tag } from '../data/tag'
|
||||
import { PermissionsService } from '../services/permissions.service'
|
||||
import { TagService } from '../services/rest/tag.service'
|
||||
import { SettingsService } from '../services/settings.service'
|
||||
import { CollapseTagsPipe } from './collapse-tags.pipe'
|
||||
|
||||
const tags: Tag[] = [
|
||||
{ id: 1, name: 'Parent' },
|
||||
{ id: 2, name: 'Child', parent: 1 },
|
||||
{ id: 3, name: 'Other' },
|
||||
]
|
||||
|
||||
describe('CollapseTagsPipe', () => {
|
||||
let pipe: CollapseTagsPipe
|
||||
let tagService: TagService
|
||||
let settingsService: SettingsService
|
||||
let permissionsService: PermissionsService
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
CollapseTagsPipe,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
],
|
||||
})
|
||||
pipe = TestBed.inject(CollapseTagsPipe)
|
||||
tagService = TestBed.inject(TagService)
|
||||
settingsService = TestBed.inject(SettingsService)
|
||||
permissionsService = TestBed.inject(PermissionsService)
|
||||
jest.spyOn(permissionsService, 'currentUserCan').mockReturnValue(true)
|
||||
jest.spyOn(settingsService, 'get').mockReturnValue(true)
|
||||
jest
|
||||
.spyOn(tagService, 'listAll')
|
||||
.mockReturnValue(of({ count: 3, all: [1, 2, 3], results: tags }))
|
||||
})
|
||||
|
||||
it('should drop parents implied by a selected child', async () => {
|
||||
expect(await firstValueFrom(pipe.transform([1, 2, 3]))).toEqual([2, 3])
|
||||
})
|
||||
|
||||
it('should pass ids through when hierarchy display is off or not permitted', async () => {
|
||||
jest.spyOn(settingsService, 'get').mockReturnValue(false)
|
||||
expect(await firstValueFrom(pipe.transform([1, 2]))).toEqual([1, 2])
|
||||
|
||||
jest.spyOn(settingsService, 'get').mockReturnValue(true)
|
||||
jest.spyOn(permissionsService, 'currentUserCan').mockReturnValue(false)
|
||||
expect(await firstValueFrom(pipe.transform([1, 2]))).toEqual([1, 2])
|
||||
expect(tagService.listAll).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should handle empty input', async () => {
|
||||
expect(await firstValueFrom(pipe.transform(null))).toEqual([])
|
||||
expect(await firstValueFrom(pipe.transform([]))).toEqual([])
|
||||
})
|
||||
|
||||
it('should fall back to the original ids if tags fail to load', async () => {
|
||||
jest
|
||||
.spyOn(tagService, 'listAll')
|
||||
.mockReturnValue(throwError(() => new Error('failed')))
|
||||
expect(await firstValueFrom(pipe.transform([1, 2]))).toEqual([1, 2])
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,47 @@
|
||||
import { inject, Pipe, PipeTransform } from '@angular/core'
|
||||
import { catchError, map, Observable, of } from 'rxjs'
|
||||
import { Tag } from '../data/tag'
|
||||
import { SETTINGS_KEYS } from '../data/ui-settings'
|
||||
import {
|
||||
PermissionAction,
|
||||
PermissionsService,
|
||||
PermissionType,
|
||||
} from '../services/permissions.service'
|
||||
import { TagService } from '../services/rest/tag.service'
|
||||
import { SettingsService } from '../services/settings.service'
|
||||
import { collapseImpliedAncestors } from '../utils/collapse-tags'
|
||||
|
||||
/**
|
||||
* Drops tag IDs whose descendant is also in the list for when the child's
|
||||
* Tag badge already shows its parent.
|
||||
*/
|
||||
@Pipe({
|
||||
name: 'collapseTags',
|
||||
})
|
||||
export class CollapseTagsPipe implements PipeTransform {
|
||||
private readonly permissionsService = inject(PermissionsService)
|
||||
private readonly tagService = inject(TagService)
|
||||
private readonly settingsService = inject(SettingsService)
|
||||
|
||||
transform(ids: number[]): Observable<number[]> {
|
||||
if (
|
||||
!ids?.length ||
|
||||
!this.settingsService.get(SETTINGS_KEYS.TAGS_SHOW_HIERARCHY) ||
|
||||
!this.permissionsService.currentUserCan(
|
||||
PermissionAction.View,
|
||||
PermissionType.Tag
|
||||
)
|
||||
) {
|
||||
return of(ids ?? [])
|
||||
}
|
||||
return this.tagService.listAll().pipe(
|
||||
map((tags) =>
|
||||
collapseImpliedAncestors(
|
||||
ids,
|
||||
new Map<number, Tag>(tags.results.map((t) => [t.id, t]))
|
||||
)
|
||||
),
|
||||
catchError(() => of(ids))
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -40,4 +40,28 @@ describe('RemoteVersionService', () => {
|
||||
)
|
||||
expect(req.request.method).toEqual('GET')
|
||||
})
|
||||
|
||||
it('should call release notes endpoint without since', () => {
|
||||
subscription = service.getReleaseNotes().subscribe()
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}release_notes/`
|
||||
)
|
||||
expect(req.request.method).toEqual('GET')
|
||||
expect(req.request.params.has('since')).toBe(false)
|
||||
})
|
||||
|
||||
it('should pass since to release notes endpoint', () => {
|
||||
subscription = service.getReleaseNotes('3.4.2').subscribe()
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}release_notes/?since=3.4.2`
|
||||
)
|
||||
expect(req.request.method).toEqual('GET')
|
||||
})
|
||||
|
||||
it('should pass until to release notes endpoint', () => {
|
||||
subscription = service.getReleaseNotes('3.5.1', '3.6.0').subscribe()
|
||||
httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}release_notes/?since=3.5.1&until=3.6.0`
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http'
|
||||
import { HttpClient, HttpParams } from '@angular/common/http'
|
||||
import { Injectable, inject } from '@angular/core'
|
||||
import { Observable } from 'rxjs'
|
||||
import { environment } from 'src/environments/environment'
|
||||
@@ -8,6 +8,20 @@ export interface AppRemoteVersion {
|
||||
update_available: boolean
|
||||
}
|
||||
|
||||
export interface AppRelease {
|
||||
version: string
|
||||
name: string
|
||||
body_html: string
|
||||
html_url: string
|
||||
published_at: string
|
||||
}
|
||||
|
||||
export interface AppReleaseNotes {
|
||||
version: string
|
||||
releases: AppRelease[]
|
||||
stars: number | null
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
@@ -19,4 +33,21 @@ export class RemoteVersionService {
|
||||
`${environment.apiBaseUrl}remote_version/`
|
||||
)
|
||||
}
|
||||
|
||||
public getReleaseNotes(
|
||||
since?: string,
|
||||
until?: string
|
||||
): Observable<AppReleaseNotes> {
|
||||
let params = new HttpParams()
|
||||
if (since) {
|
||||
params = params.set('since', since)
|
||||
}
|
||||
if (until) {
|
||||
params = params.set('until', until)
|
||||
}
|
||||
return this.http.get<AppReleaseNotes>(
|
||||
`${environment.apiBaseUrl}release_notes/`,
|
||||
{ params }
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -398,6 +398,60 @@ describe('SettingsService', () => {
|
||||
expect(req.request.method).toEqual('POST')
|
||||
})
|
||||
|
||||
it('seeds last seen version on first load', () => {
|
||||
const settings = {
|
||||
...ui_settings,
|
||||
user: { ...ui_settings.user, is_superuser: true },
|
||||
settings: {
|
||||
...ui_settings.settings,
|
||||
documentListSize: 50,
|
||||
update_checking: { enabled: false, backend_setting: 'default' },
|
||||
},
|
||||
}
|
||||
settings.settings['version'] = '3.5.1'
|
||||
httpTestingController
|
||||
.expectOne(`${environment.apiBaseUrl}ui_settings/`)
|
||||
.flush(settings)
|
||||
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}ui_settings/`
|
||||
)
|
||||
expect(req.request.method).toEqual('POST')
|
||||
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
|
||||
'3.5.1'
|
||||
)
|
||||
expect(settingsService.unseenReleasesSince()).toBeNull()
|
||||
})
|
||||
|
||||
it('reports unseen releases and marks them seen', () => {
|
||||
const settings = {
|
||||
...ui_settings,
|
||||
user: { ...ui_settings.user, is_superuser: true },
|
||||
settings: {
|
||||
...ui_settings.settings,
|
||||
documentListSize: 50,
|
||||
update_checking: { enabled: false, backend_setting: 'default' },
|
||||
},
|
||||
}
|
||||
settings.settings['version'] = '3.5.1'
|
||||
settings.settings['whats_new'] = { last_seen_version: '3.4.2' }
|
||||
httpTestingController
|
||||
.expectOne(`${environment.apiBaseUrl}ui_settings/`)
|
||||
.flush(settings)
|
||||
httpTestingController.expectNone(`${environment.apiBaseUrl}ui_settings/`)
|
||||
|
||||
expect(settingsService.unseenReleasesSince()).toEqual('3.4.2')
|
||||
|
||||
subscription = settingsService.markReleasesSeen().subscribe()
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}ui_settings/`
|
||||
)
|
||||
expect(req.request.body.settings.whats_new.last_seen_version).toEqual(
|
||||
'3.5.1'
|
||||
)
|
||||
expect(settingsService.unseenReleasesSince()).toBeNull()
|
||||
})
|
||||
|
||||
it('updates settings on complete tour', () => {
|
||||
let req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}ui_settings/`
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
hexToHsl,
|
||||
} from 'src/app/utils/color'
|
||||
import { DEFAULT_APP_TITLE, environment } from 'src/environments/environment'
|
||||
import { compareVersions } from 'src/app/utils/version'
|
||||
import { DEFAULT_DISPLAY_FIELDS, DisplayField } from '../data/document'
|
||||
import { RemoteOCRModeConfig } from '../data/paperless-config'
|
||||
import { SavedView } from '../data/saved-view'
|
||||
@@ -327,6 +328,18 @@ export class SettingsService {
|
||||
SETTINGS_KEYS.SIDEBAR_HIDDEN_ITEMS
|
||||
)
|
||||
|
||||
/**
|
||||
* The last version the user saw release notes for, if the running
|
||||
* version is newer, or null.
|
||||
*/
|
||||
readonly unseenReleasesSince = computed<string | null>(() => {
|
||||
this.settingsVersion()
|
||||
const currentVersion = this.get(SETTINGS_KEYS.VERSION)
|
||||
const lastSeen = this.get(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION)
|
||||
if (!currentVersion || !lastSeen) return null
|
||||
return compareVersions(currentVersion, lastSeen) > 0 ? lastSeen : null
|
||||
})
|
||||
|
||||
readonly allDisplayFields = signal<Array<{ id: DisplayField; name: string }>>(
|
||||
DEFAULT_DISPLAY_FIELDS
|
||||
)
|
||||
@@ -384,6 +397,7 @@ export class SettingsService {
|
||||
uisettings.permissions,
|
||||
this.currentUser()
|
||||
)
|
||||
this.maybeSeedLastSeenVersion()
|
||||
|
||||
this.initializeDisplayFields()
|
||||
})
|
||||
@@ -713,6 +727,34 @@ export class SettingsService {
|
||||
return this.settingIsSet(SETTINGS_KEYS.UPDATE_CHECKING_ENABLED)
|
||||
}
|
||||
|
||||
/**
|
||||
* Record the baseline version for "what's new" tracking.
|
||||
*/
|
||||
private maybeSeedLastSeenVersion() {
|
||||
const currentVersion = this.get(SETTINGS_KEYS.VERSION)
|
||||
if (
|
||||
!currentVersion ||
|
||||
this.get(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION) ||
|
||||
!this.permissionsService.currentUserCan(
|
||||
PermissionAction.Change,
|
||||
PermissionType.UISettings
|
||||
)
|
||||
)
|
||||
return
|
||||
this.set(SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION, currentVersion)
|
||||
this.storeSettings()
|
||||
.pipe(first())
|
||||
.subscribe({ error: () => {} })
|
||||
}
|
||||
|
||||
public markReleasesSeen(): Observable<any> {
|
||||
this.set(
|
||||
SETTINGS_KEYS.WHATS_NEW_LAST_SEEN_VERSION,
|
||||
this.get(SETTINGS_KEYS.VERSION)
|
||||
)
|
||||
return this.storeSettings()
|
||||
}
|
||||
|
||||
/**
|
||||
* Offering remote OCR as a choice only makes sense when an engine
|
||||
* is configured but is not already handling every document.
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Tag } from '../data/tag'
|
||||
import { collapseImpliedAncestors, getTagAncestors } from './collapse-tags'
|
||||
|
||||
const tags: Tag[] = [
|
||||
{ id: 1, name: 'Finance' },
|
||||
{ id: 2, name: 'Account', parent: 1 },
|
||||
{ id: 3, name: 'Mortgage', parent: 2 },
|
||||
{ id: 4, name: 'Taxes', parent: 1 },
|
||||
{ id: 5, name: 'Inbox' },
|
||||
]
|
||||
const tagsById = new Map(tags.map((t) => [t.id, t]))
|
||||
|
||||
describe('collapseImpliedAncestors', () => {
|
||||
it('drops ancestors that are implied by a descendant in the list', () => {
|
||||
expect(collapseImpliedAncestors([1, 2, 3, 4, 5], tagsById)).toEqual([
|
||||
3, 4, 5,
|
||||
])
|
||||
})
|
||||
|
||||
it('keeps a parent with none of its children present', () => {
|
||||
expect(collapseImpliedAncestors([1, 5], tagsById)).toEqual([1, 5])
|
||||
})
|
||||
|
||||
it('keeps unknown (private) ids and handles empty input', () => {
|
||||
expect(collapseImpliedAncestors([99, 2], tagsById)).toEqual([99, 2])
|
||||
expect(collapseImpliedAncestors([], tagsById)).toEqual([])
|
||||
expect(collapseImpliedAncestors(null, tagsById)).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('getTagAncestors', () => {
|
||||
it('returns ancestors root first', () => {
|
||||
expect(getTagAncestors(3, tagsById).map((t) => t.id)).toEqual([1, 2])
|
||||
expect(getTagAncestors(5, tagsById)).toEqual([])
|
||||
})
|
||||
|
||||
it('stops at a parent that is not visible or forms a cycle', () => {
|
||||
const hidden = new Map<number, Tag>([[6, { id: 6, name: 'x', parent: 99 }]])
|
||||
expect(getTagAncestors(6, hidden)).toEqual([])
|
||||
|
||||
const cyclic = new Map<number, Tag>([
|
||||
[7, { id: 7, name: 'a', parent: 8 }],
|
||||
[8, { id: 8, name: 'b', parent: 7 }],
|
||||
])
|
||||
expect(getTagAncestors(7, cyclic).map((t) => t.id)).toEqual([7, 8])
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,43 @@
|
||||
import { Tag } from '../data/tag'
|
||||
|
||||
/**
|
||||
* Collapses implied ancestor tags from a list of tag IDs such that if a tag's
|
||||
* ancestor is also present in the list, the ancestor is removed. For example
|
||||
* [Finance, Account, Mortgage] -> [Mortgage]
|
||||
*/
|
||||
export function collapseImpliedAncestors(
|
||||
ids: number[],
|
||||
tagsById: Map<number, Tag>
|
||||
): number[] {
|
||||
if (!ids?.length) return ids ?? []
|
||||
const present = new Set(ids)
|
||||
const implied = new Set<number>()
|
||||
for (const id of ids) {
|
||||
const seen = new Set<number>()
|
||||
let parentId = tagsById.get(id)?.parent
|
||||
while (parentId && !seen.has(parentId)) {
|
||||
seen.add(parentId)
|
||||
if (present.has(parentId)) implied.add(parentId)
|
||||
parentId = tagsById.get(parentId)?.parent
|
||||
}
|
||||
}
|
||||
return ids.filter((id) => !implied.has(id))
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of ancestor tags for the given tag ID, starting from the
|
||||
* root and ending with the immediate parent.
|
||||
*/
|
||||
export function getTagAncestors(id: number, tagsById: Map<number, Tag>): Tag[] {
|
||||
const chain: Tag[] = []
|
||||
const seen = new Set<number>()
|
||||
let parentId = tagsById.get(id)?.parent
|
||||
while (parentId && !seen.has(parentId)) {
|
||||
seen.add(parentId)
|
||||
const parent = tagsById.get(parentId)
|
||||
if (!parent) break
|
||||
chain.unshift(parent)
|
||||
parentId = parent.parent
|
||||
}
|
||||
return chain
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { compareVersions } from './version'
|
||||
|
||||
describe('compareVersions', () => {
|
||||
it('should compare versions numerically', () => {
|
||||
expect(compareVersions('3.5.1', '3.5.0')).toBeGreaterThan(0)
|
||||
expect(compareVersions('3.10.0', '3.9.9')).toBeGreaterThan(0)
|
||||
expect(compareVersions('3.4.2', '3.5.0')).toBeLessThan(0)
|
||||
expect(compareVersions('3.5.0', '3.5.0')).toEqual(0)
|
||||
expect(compareVersions('3.5', '3.5.0')).toEqual(0)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Compare two X.Y.Z version strings numerically.
|
||||
* Returns a positive number if a > b, negative if a < b, 0 if equal.
|
||||
*/
|
||||
export function compareVersions(a: string, b: string): number {
|
||||
const partsA = a.split('.').map((p) => Number.parseInt(p, 10) || 0)
|
||||
const partsB = b.split('.').map((p) => Number.parseInt(p, 10) || 0)
|
||||
for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
|
||||
const diff = (partsA[i] ?? 0) - (partsB[i] ?? 0)
|
||||
if (diff !== 0) return diff
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -13,6 +13,9 @@ $form-file-button-hover-bg: var(--pngx-bg-alt);
|
||||
@include meta.load-css("print");
|
||||
|
||||
// re-created bootstrap styles
|
||||
.mt-n1 {
|
||||
margin-top: -0.25rem;
|
||||
}
|
||||
.mt-n2 {
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,11 @@ from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from documents.views import _iterate_in_sync_thread
|
||||
from paperless_testing.factories import UserFactory
|
||||
from paperless_testing.permissions import grant_global
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Generator
|
||||
from collections.abc import AsyncIterator
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from pytest_mock import MockerFixture
|
||||
@@ -59,6 +58,11 @@ class TestChatStreamingViewInputValidation(APITestCase):
|
||||
reaches the Django request the middleware sees.
|
||||
"""
|
||||
chunks = [f"token{i} " for i in range(40)]
|
||||
|
||||
async def answer() -> AsyncIterator[str]:
|
||||
for chunk in chunks:
|
||||
yield chunk
|
||||
|
||||
with (
|
||||
mock.patch(
|
||||
"documents.views.AIConfig",
|
||||
@@ -66,7 +70,7 @@ class TestChatStreamingViewInputValidation(APITestCase):
|
||||
),
|
||||
mock.patch(
|
||||
"paperless_ai.chat.stream_chat_with_documents",
|
||||
return_value=(c for c in chunks),
|
||||
return_value=answer(),
|
||||
),
|
||||
):
|
||||
resp = self.client.post(
|
||||
@@ -163,74 +167,3 @@ class TestChatStreamingViewUnrestrictedFlag:
|
||||
assert (
|
||||
mocked_stream_chat.call_args.kwargs["unrestricted"] is expected_unrestricted
|
||||
)
|
||||
|
||||
|
||||
class TestIterateInSyncThread:
|
||||
@pytest.fixture
|
||||
def events(self) -> list[str]:
|
||||
return []
|
||||
|
||||
@pytest.fixture
|
||||
def chunks(self, events: list[str]) -> Generator[str, None, None]:
|
||||
def generate() -> Generator[str, None, None]:
|
||||
try:
|
||||
for chunk in ("first", "second"):
|
||||
events.append(f"produced {chunk}")
|
||||
yield chunk
|
||||
finally:
|
||||
events.append("closed")
|
||||
|
||||
return generate()
|
||||
|
||||
def test_yields_each_chunk_before_pulling_the_next(
|
||||
self,
|
||||
chunks: Generator[str, None, None],
|
||||
events: list[str],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A sync generator wrapped for async iteration
|
||||
WHEN:
|
||||
- The wrapper is consumed
|
||||
THEN:
|
||||
- Each chunk is delivered before the next one is generated,
|
||||
rather than the whole generator being drained up front
|
||||
"""
|
||||
|
||||
async def consume() -> None:
|
||||
async for chunk in _iterate_in_sync_thread(chunks):
|
||||
events.append(f"received {chunk}")
|
||||
|
||||
async_to_sync(consume)()
|
||||
|
||||
assert events == [
|
||||
"produced first",
|
||||
"received first",
|
||||
"produced second",
|
||||
"received second",
|
||||
"closed",
|
||||
]
|
||||
|
||||
def test_closing_early_closes_the_source_generator(
|
||||
self,
|
||||
chunks: Generator[str, None, None],
|
||||
events: list[str],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A sync generator wrapped for async iteration
|
||||
WHEN:
|
||||
- The consumer closes the wrapper after the first chunk, as
|
||||
happens when the client disconnects
|
||||
THEN:
|
||||
- The source generator is closed, so its cleanup runs
|
||||
"""
|
||||
|
||||
async def consume_one() -> None:
|
||||
wrapper = _iterate_in_sync_thread(chunks)
|
||||
await anext(wrapper)
|
||||
await wrapper.aclose()
|
||||
|
||||
async_to_sync(consume_one)()
|
||||
|
||||
assert events == ["produced first", "closed"]
|
||||
@@ -0,0 +1,341 @@
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from django.core.cache import cache
|
||||
from pytest_httpx import HTTPXMock
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from paperless import version
|
||||
|
||||
REPO_URL = "https://api.github.com/repos/paperless-ngx/paperless-ngx"
|
||||
RELEASES_URL = f"{REPO_URL}/releases?per_page=10&page=1"
|
||||
|
||||
|
||||
def _page_url(page: int) -> str:
|
||||
return f"{REPO_URL}/releases?per_page=10&page={page}"
|
||||
|
||||
|
||||
def _tag_url(version_str: str) -> str:
|
||||
return f"{REPO_URL}/releases/tags/v{version_str}"
|
||||
|
||||
|
||||
def _release(tag: str, **kwargs) -> dict:
|
||||
return {
|
||||
"tag_name": tag,
|
||||
"name": f"Paperless-ngx {tag}",
|
||||
"body_html": f"<h2>paperless-ngx {tag}</h2>",
|
||||
"html_url": f"https://github.com/paperless-ngx/paperless-ngx/releases/tag/{tag}",
|
||||
"published_at": "2026-11-17T03:36:20Z",
|
||||
"draft": False,
|
||||
"prerelease": False,
|
||||
**kwargs,
|
||||
}
|
||||
|
||||
|
||||
def _bump(minor: int = 0, patch: int = 0) -> str:
|
||||
major, cur_minor, cur_patch = version.__version__
|
||||
return f"{major}.{cur_minor + minor}.{cur_patch + patch}"
|
||||
|
||||
|
||||
CURRENT = version.__full_version_str__
|
||||
PREVIOUS = f"{version.__version__[0]}.{version.__version__[1] - 1}.0"
|
||||
OLDER = f"{version.__version__[0]}.{version.__version__[1] - 2}.0"
|
||||
|
||||
|
||||
class TestApiReleaseNotes:
|
||||
ENDPOINT = "/api/release_notes/"
|
||||
|
||||
def setup_method(self) -> None:
|
||||
cache.clear()
|
||||
|
||||
@pytest.fixture
|
||||
def releases(self, httpx_mock: HTTPXMock) -> HTTPXMock:
|
||||
httpx_mock.add_response(
|
||||
url=RELEASES_URL,
|
||||
match_headers={"Accept": "application/vnd.github.html+json"},
|
||||
json=[
|
||||
_release(f"v{_bump(patch=1)}"),
|
||||
_release(f"v{_bump(minor=1)}-beta.1", prerelease=True),
|
||||
_release(f"v{CURRENT}"),
|
||||
_release(f"v{PREVIOUS}"),
|
||||
_release(f"ngx-{OLDER}"),
|
||||
],
|
||||
)
|
||||
return httpx_mock
|
||||
|
||||
@pytest.fixture
|
||||
def current_release(self, httpx_mock: HTTPXMock) -> HTTPXMock:
|
||||
httpx_mock.add_response(
|
||||
url=_tag_url(CURRENT),
|
||||
match_headers={"Accept": "application/vnd.github.html+json"},
|
||||
json=_release(f"v{CURRENT}"),
|
||||
)
|
||||
return httpx_mock
|
||||
|
||||
@pytest.fixture
|
||||
def stars(self, httpx_mock: HTTPXMock) -> HTTPXMock:
|
||||
httpx_mock.add_response(url=REPO_URL, json={"stargazers_count": 1234})
|
||||
return httpx_mock
|
||||
|
||||
@pytest.mark.usefixtures("stars")
|
||||
def test_since_returns_newer_up_to_current(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
releases: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- GitHub releases older, equal to, and newer than the running version
|
||||
WHEN:
|
||||
- Release notes are requested since an older version
|
||||
THEN:
|
||||
- Only releases after `since` up to the running version are returned,
|
||||
newest first, excluding prereleases and the `since` release itself
|
||||
"""
|
||||
response = rest_api_client.get(self.ENDPOINT, {"since": OLDER})
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["version"] == CURRENT
|
||||
assert [r["version"] for r in response.data["releases"]] == [
|
||||
CURRENT,
|
||||
PREVIOUS,
|
||||
]
|
||||
assert response.data["releases"][0]["html_url"].endswith(f"v{CURRENT}")
|
||||
assert (
|
||||
response.data["releases"][0]["body_html"]
|
||||
== f"<h2>paperless-ngx v{CURRENT}</h2>"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("stars")
|
||||
def test_without_since_fetches_current_only(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
current_release: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A GitHub release for the running version
|
||||
WHEN:
|
||||
- Release notes are requested without `since`
|
||||
THEN:
|
||||
- Only that release is fetched, by tag, and returned
|
||||
"""
|
||||
response = rest_api_client.get(self.ENDPOINT)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert [r["version"] for r in response.data["releases"]] == [CURRENT]
|
||||
assert len(current_release.get_requests(url=_tag_url(CURRENT))) == 1
|
||||
|
||||
@pytest.mark.usefixtures("stars")
|
||||
def test_since_pages_back_to_since(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
httpx_mock: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- More releases since `since` than fit on one page
|
||||
WHEN:
|
||||
- Release notes are requested since that version
|
||||
THEN:
|
||||
- GitHub is paged until `since` is reached and all releases are returned
|
||||
"""
|
||||
major, minor, _ = version.__version__
|
||||
page_one = [f"{major}.{minor - 1}.{patch}" for patch in range(10, 0, -1)]
|
||||
httpx_mock.add_response(
|
||||
url=_page_url(1),
|
||||
json=[_release(f"v{v}") for v in page_one],
|
||||
)
|
||||
httpx_mock.add_response(
|
||||
url=_page_url(2),
|
||||
json=[_release(f"v{PREVIOUS}"), _release(f"v{OLDER}")],
|
||||
)
|
||||
|
||||
response = rest_api_client.get(self.ENDPOINT, {"since": OLDER})
|
||||
|
||||
assert [r["version"] for r in response.data["releases"]] == [
|
||||
*page_one,
|
||||
PREVIOUS,
|
||||
]
|
||||
|
||||
@pytest.mark.usefixtures("stars")
|
||||
def test_since_paging_is_capped(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
httpx_mock: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Full pages of releases that never reach `since`
|
||||
WHEN:
|
||||
- Release notes are requested since a very old version
|
||||
THEN:
|
||||
- Paging stops after the page cap
|
||||
"""
|
||||
major, minor, _ = version.__version__
|
||||
for page in range(1, 4):
|
||||
httpx_mock.add_response(
|
||||
url=_page_url(page),
|
||||
json=[
|
||||
_release(f"v{major}.{minor}.{page * 100 + patch}")
|
||||
for patch in range(10)
|
||||
],
|
||||
)
|
||||
|
||||
rest_api_client.get(self.ENDPOINT, {"since": "0.1.0"})
|
||||
|
||||
assert len(httpx_mock.get_requests()) == 4 # 3 pages + stars
|
||||
|
||||
@pytest.mark.usefixtures("stars")
|
||||
@pytest.mark.usefixtures("current_release")
|
||||
def test_releases_are_cached(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
releases: HTTPXMock,
|
||||
) -> None:
|
||||
for _ in range(2):
|
||||
rest_api_client.get(self.ENDPOINT, {"since": OLDER})
|
||||
rest_api_client.get(self.ENDPOINT)
|
||||
|
||||
assert len(releases.get_requests(url=RELEASES_URL)) == 1
|
||||
assert len(releases.get_requests(url=_tag_url(CURRENT))) == 1
|
||||
assert len(releases.get_requests(url=REPO_URL)) == 1
|
||||
|
||||
@pytest.mark.usefixtures("stars")
|
||||
def test_new_running_version_refetches_releases(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
releases: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- GitHub releases cached for the running version
|
||||
WHEN:
|
||||
- The running version changes (i.e. paperless was upgraded)
|
||||
THEN:
|
||||
- The cached releases are not reused and GitHub is queried again
|
||||
"""
|
||||
upgraded = _bump(patch=1)
|
||||
releases.add_response(url=RELEASES_URL, json=[_release(f"v{upgraded}")])
|
||||
|
||||
rest_api_client.get(self.ENDPOINT, {"since": OLDER})
|
||||
with mock.patch.object(version, "__full_version_str__", upgraded):
|
||||
response = rest_api_client.get(self.ENDPOINT, {"since": CURRENT})
|
||||
|
||||
assert len(releases.get_requests(url=RELEASES_URL)) == 2
|
||||
assert [r["version"] for r in response.data["releases"]] == [upgraded]
|
||||
|
||||
@pytest.mark.usefixtures("stars")
|
||||
def test_until_returns_newer_releases(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
releases: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A GitHub release newer than the running version
|
||||
WHEN:
|
||||
- Release notes are requested from the running version until the newer one
|
||||
THEN:
|
||||
- Only the newer release is returned, excluding prereleases
|
||||
"""
|
||||
response = rest_api_client.get(
|
||||
self.ENDPOINT,
|
||||
{"since": CURRENT, "until": _bump(minor=1)},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert [r["version"] for r in response.data["releases"]] == [
|
||||
_bump(patch=1),
|
||||
]
|
||||
|
||||
@pytest.mark.parametrize("param", ["since", "until"])
|
||||
def test_invalid_version(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
param: str,
|
||||
) -> None:
|
||||
response = rest_api_client.get(self.ENDPOINT, {param: "not-a-version"})
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mock_kwargs",
|
||||
[
|
||||
pytest.param({"status_code": 503}, id="http-error"),
|
||||
pytest.param(
|
||||
{
|
||||
"content": b'{ "blah":',
|
||||
"headers": {"Content-Type": "application/json"},
|
||||
},
|
||||
id="bad-json",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_github_failure_returns_empty_and_is_not_cached(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
httpx_mock: HTTPXMock,
|
||||
mock_kwargs: dict,
|
||||
) -> None:
|
||||
httpx_mock.add_response(url=_tag_url(CURRENT), **mock_kwargs)
|
||||
httpx_mock.add_response(url=_tag_url(CURRENT), json=_release(f"v{CURRENT}"))
|
||||
httpx_mock.add_response(
|
||||
url=REPO_URL,
|
||||
json={"stargazers_count": 1234},
|
||||
is_reusable=True,
|
||||
)
|
||||
|
||||
response = rest_api_client.get(self.ENDPOINT)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["releases"] == []
|
||||
|
||||
response = rest_api_client.get(self.ENDPOINT)
|
||||
assert [r["version"] for r in response.data["releases"]] == [CURRENT]
|
||||
|
||||
@pytest.mark.usefixtures("current_release", "stars")
|
||||
def test_stars_are_returned_and_cached(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
httpx_mock: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The GitHub repository reports a star count
|
||||
WHEN:
|
||||
- Release notes are requested twice
|
||||
THEN:
|
||||
- The star count is included and GitHub is only asked once
|
||||
"""
|
||||
response = rest_api_client.get(self.ENDPOINT)
|
||||
assert response.data["stars"] == 1234
|
||||
|
||||
response = rest_api_client.get(self.ENDPOINT)
|
||||
assert response.data["stars"] == 1234
|
||||
assert len(httpx_mock.get_requests(url=REPO_URL)) == 1
|
||||
|
||||
@pytest.mark.usefixtures("current_release")
|
||||
def test_stars_failure_returns_none_and_is_not_cached(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
httpx_mock: HTTPXMock,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The GitHub repository request fails, then succeeds
|
||||
WHEN:
|
||||
- Release notes are requested twice
|
||||
THEN:
|
||||
- Stars are null at first, then fetched again rather than cached
|
||||
"""
|
||||
httpx_mock.add_response(url=REPO_URL, status_code=503)
|
||||
httpx_mock.add_response(url=REPO_URL, json={"stargazers_count": 1234})
|
||||
|
||||
response = rest_api_client.get(self.ENDPOINT)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["stars"] is None
|
||||
assert len(response.data["releases"]) == 1
|
||||
|
||||
response = rest_api_client.get(self.ENDPOINT)
|
||||
assert response.data["stars"] == 1234
|
||||
+216
-35
@@ -7,9 +7,7 @@ import tempfile
|
||||
import zipfile
|
||||
from collections import Counter
|
||||
from collections import deque
|
||||
from collections.abc import AsyncIterator
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Generator
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
from http import HTTPStatus
|
||||
@@ -29,7 +27,6 @@ from urllib.parse import urlparse
|
||||
import httpx
|
||||
import magic
|
||||
import pathvalidate
|
||||
from asgiref.sync import sync_to_async
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import Group
|
||||
from django.contrib.auth.models import User
|
||||
@@ -2419,24 +2416,6 @@ class DocumentViewSet(
|
||||
)
|
||||
|
||||
|
||||
async def _iterate_in_sync_thread(
|
||||
chunks: Generator[str, None, None],
|
||||
) -> AsyncIterator[str]:
|
||||
"""Serve a blocking sync generator to an ASGI server chunk by chunk.
|
||||
|
||||
Under ASGI, Django drains a sync iterator with ``sync_to_async(list)``
|
||||
before sending anything. Pull each chunk in the request's sync thread
|
||||
instead, where the generator's ORM access belongs.
|
||||
"""
|
||||
sentinel = object() # StopIteration can't cross an asyncio Future
|
||||
next_chunk = sync_to_async(next)
|
||||
try:
|
||||
while (chunk := await next_chunk(chunks, sentinel)) is not sentinel:
|
||||
yield chunk
|
||||
finally:
|
||||
await sync_to_async(chunks.close)()
|
||||
|
||||
|
||||
class ChatStreamingSerializer(serializers.Serializer[dict[str, Any]]):
|
||||
q = serializers.CharField(required=True, max_length=4000)
|
||||
document_id = serializers.IntegerField(required=False, allow_null=True)
|
||||
@@ -2496,13 +2475,11 @@ class ChatStreamingView(GenericAPIView[Any]):
|
||||
)
|
||||
|
||||
return StreamingHttpResponse(
|
||||
_iterate_in_sync_thread(
|
||||
stream_chat_with_documents(
|
||||
query_str=question,
|
||||
documents=documents,
|
||||
unrestricted=unrestricted,
|
||||
output_language=output_language,
|
||||
),
|
||||
stream_chat_with_documents(
|
||||
query_str=question,
|
||||
documents=documents,
|
||||
unrestricted=unrestricted,
|
||||
output_language=output_language,
|
||||
),
|
||||
content_type="text/event-stream",
|
||||
)
|
||||
@@ -4314,6 +4291,139 @@ class UiSettingsView(GenericAPIView[Any]):
|
||||
)
|
||||
|
||||
|
||||
GITHUB_CACHE_KEY = "github_data:%s"
|
||||
GITHUB_RELEASES_CACHE_TIMEOUT = 60 * 60 * 12
|
||||
GITHUB_REQUEST_TIMEOUT = 5
|
||||
|
||||
|
||||
GITHUB_RELEASES_URL = (
|
||||
"https://api.github.com/repos/paperless-ngx/paperless-ngx/releases"
|
||||
)
|
||||
GITHUB_RELEASES_PER_PAGE = 10
|
||||
# Caps how far back a range can walk, e.g. for a bad `since`
|
||||
GITHUB_RELEASES_MAX_PAGES = 3
|
||||
|
||||
|
||||
def _fetch_github_releases_json(url: str, params: dict | None = None) -> Any | None:
|
||||
try:
|
||||
resp = httpx.get(
|
||||
url,
|
||||
params=params,
|
||||
# GitHub renders release bodies as HTML
|
||||
headers={"Accept": "application/vnd.github.html+json"},
|
||||
timeout=GITHUB_REQUEST_TIMEOUT,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
return resp.json()
|
||||
except ValueError as e:
|
||||
logger.debug(f"An error occurred parsing GitHub releases json: {e}")
|
||||
except httpx.HTTPError as e:
|
||||
logger.debug(f"An error occurred fetching GitHub releases: {e}")
|
||||
return None
|
||||
|
||||
|
||||
def _parse_github_release(release: dict[str, Any]) -> dict[str, Any] | None:
|
||||
if release.get("draft") or release.get("prerelease"):
|
||||
return None
|
||||
try:
|
||||
# Some early tags used ngx-x.y.z
|
||||
release_version = packaging_version.parse(
|
||||
release["tag_name"].removeprefix("ngx-"),
|
||||
)
|
||||
except packaging_version.InvalidVersion:
|
||||
return None
|
||||
return {
|
||||
"version": str(release_version),
|
||||
"name": release.get("name") or release["tag_name"],
|
||||
"body_html": release.get("body_html") or "",
|
||||
"html_url": release["html_url"],
|
||||
"published_at": release.get("published_at"),
|
||||
}
|
||||
|
||||
|
||||
def get_github_release(version_str: str) -> dict[str, Any] | None:
|
||||
"""
|
||||
Fetch a single pngx release from GitHub by version.
|
||||
"""
|
||||
cache_key = GITHUB_CACHE_KEY % f"release:{version_str}"
|
||||
release = cache.get(cache_key)
|
||||
if release is not None:
|
||||
return release
|
||||
data = _fetch_github_releases_json(f"{GITHUB_RELEASES_URL}/tags/v{version_str}")
|
||||
if data is None:
|
||||
return None
|
||||
try:
|
||||
release = _parse_github_release(data)
|
||||
except (KeyError, TypeError, AttributeError) as e:
|
||||
logger.debug(f"An error occurred parsing GitHub release json: {e}")
|
||||
return None
|
||||
if release is not None:
|
||||
cache.set(cache_key, release, GITHUB_RELEASES_CACHE_TIMEOUT)
|
||||
return release
|
||||
|
||||
|
||||
def get_github_releases(
|
||||
since: packaging_version.Version,
|
||||
until: packaging_version.Version,
|
||||
) -> list[dict[str, Any]] | None:
|
||||
"""
|
||||
Fetch pngx releases from GitHub after `since` up to and including `until`,
|
||||
newest first.
|
||||
"""
|
||||
# Keyed on the range so an upgrade (pill) or a newly detected release
|
||||
# (update available) changes `until` and gets a fresh fetch
|
||||
cache_key = GITHUB_CACHE_KEY % f"releases:{since}:{until}"
|
||||
releases = cache.get(cache_key)
|
||||
if releases is not None:
|
||||
return releases
|
||||
releases = []
|
||||
# Releases are listed newest first, so stop paging once we reach `since`
|
||||
for page in range(1, GITHUB_RELEASES_MAX_PAGES + 1):
|
||||
data = _fetch_github_releases_json(
|
||||
GITHUB_RELEASES_URL,
|
||||
params={"per_page": GITHUB_RELEASES_PER_PAGE, "page": page},
|
||||
)
|
||||
if data is None:
|
||||
return None
|
||||
try:
|
||||
batch = [r for r in map(_parse_github_release, data) if r is not None]
|
||||
except (KeyError, TypeError, AttributeError) as e:
|
||||
logger.debug(f"An error occurred parsing GitHub releases json: {e}")
|
||||
return None
|
||||
releases.extend(batch)
|
||||
if len(data) < GITHUB_RELEASES_PER_PAGE or any(
|
||||
packaging_version.parse(r["version"]) <= since for r in batch
|
||||
):
|
||||
break
|
||||
releases = [
|
||||
r for r in releases if since < packaging_version.parse(r["version"]) <= until
|
||||
]
|
||||
cache.set(cache_key, releases, GITHUB_RELEASES_CACHE_TIMEOUT)
|
||||
return releases
|
||||
|
||||
|
||||
def get_github_stars() -> int | None:
|
||||
"""
|
||||
Fetch the number of stars for the Paperless-NGX repository from GitHub.
|
||||
"""
|
||||
count = cache.get(GITHUB_CACHE_KEY % "stars")
|
||||
if count is not None:
|
||||
return count
|
||||
try:
|
||||
resp = httpx.get(
|
||||
"https://api.github.com/repos/paperless-ngx/paperless-ngx",
|
||||
headers={"Accept": "application/vnd.github+json"},
|
||||
timeout=GITHUB_REQUEST_TIMEOUT,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
count = resp.json()["stargazers_count"]
|
||||
except Exception as e:
|
||||
logger.debug(f"An error occurred fetching GitHub stars: {e}")
|
||||
return None
|
||||
cache.set(GITHUB_CACHE_KEY % "stars", count, 60 * 60)
|
||||
return count
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
description="Get the current version of the Paperless-NGX server",
|
||||
@@ -4361,6 +4471,61 @@ class RemoteVersionView(GenericAPIView[Any]):
|
||||
)
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
description=(
|
||||
"Get release notes from GitHub for releases newer than `since`, "
|
||||
"up to and including `until` (default: the running version). "
|
||||
"Without `since`, only the `until` version's notes are returned."
|
||||
),
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
name="since",
|
||||
type=OpenApiTypes.STR,
|
||||
location=OpenApiParameter.QUERY,
|
||||
required=False,
|
||||
),
|
||||
OpenApiParameter(
|
||||
name="until",
|
||||
type=OpenApiTypes.STR,
|
||||
location=OpenApiParameter.QUERY,
|
||||
required=False,
|
||||
),
|
||||
],
|
||||
responses={
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
},
|
||||
),
|
||||
)
|
||||
class ReleaseNotesView(GenericAPIView[Any]):
|
||||
def get(self, request, format=None):
|
||||
current_version = packaging_version.parse(version.__full_version_str__)
|
||||
since = until = None
|
||||
try:
|
||||
if since_param := request.query_params.get("since"):
|
||||
since = packaging_version.parse(since_param)
|
||||
if until_param := request.query_params.get("until"):
|
||||
until = packaging_version.parse(until_param)
|
||||
except packaging_version.InvalidVersion:
|
||||
return HttpResponseBadRequest("Invalid version")
|
||||
# Newer releases can be requested e.g. for "update available"
|
||||
until = until or current_version
|
||||
|
||||
if since is None:
|
||||
release = get_github_release(str(until))
|
||||
releases = [release] if release else []
|
||||
else:
|
||||
releases = get_github_releases(since, until) or []
|
||||
|
||||
return Response(
|
||||
{
|
||||
"version": version.__full_version_str__,
|
||||
"releases": releases,
|
||||
"stars": get_github_stars(),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class _TasksViewSetSchema(AutoSchema):
|
||||
_UNPAGINATED_ACTIONS = frozenset({"summary", "active", "status_counts"})
|
||||
|
||||
@@ -5318,6 +5483,8 @@ class CustomFieldViewSet(PermissionsAwareDocumentCountMixin, ModelViewSet[Custom
|
||||
class SystemStatusView(PassUserMixin):
|
||||
permission_classes = (IsAuthenticated,)
|
||||
TASK_SUMMARY_DAYS = 30
|
||||
# Seconds to wait on the broker before reporting it as unreachable
|
||||
BROKER_SOCKET_TIMEOUT = 5
|
||||
|
||||
def get(self, request, format=None):
|
||||
if not has_system_status_permission(request.user):
|
||||
@@ -5363,7 +5530,11 @@ class SystemStatusView(PassUserMixin):
|
||||
if redis_url_parsed.hostname is not None:
|
||||
redis_constructed_url += f":{redis_url_parsed.port}"
|
||||
redis_error = None
|
||||
with Redis.from_url(url=redis_url) as client:
|
||||
with Redis.from_url(
|
||||
url=redis_url,
|
||||
socket_timeout=self.BROKER_SOCKET_TIMEOUT,
|
||||
socket_connect_timeout=self.BROKER_SOCKET_TIMEOUT,
|
||||
) as client:
|
||||
try:
|
||||
client.ping()
|
||||
redis_status = "OK"
|
||||
@@ -5378,12 +5549,22 @@ class SystemStatusView(PassUserMixin):
|
||||
celery_url = None
|
||||
try:
|
||||
celery_ping = None
|
||||
for ping_attempt in range(3):
|
||||
celery_ping = celery_app.control.inspect().ping()
|
||||
if celery_ping:
|
||||
break
|
||||
if ping_attempt < 2:
|
||||
sleep(0.25)
|
||||
# Use a dedicated connection with socket timeouts. Without them a
|
||||
# stalled broker blocks this request (and its DB connection) forever
|
||||
with celery_app.connection_for_read(
|
||||
transport_options={
|
||||
"socket_timeout": self.BROKER_SOCKET_TIMEOUT,
|
||||
"socket_connect_timeout": self.BROKER_SOCKET_TIMEOUT,
|
||||
},
|
||||
) as celery_connection:
|
||||
for ping_attempt in range(3):
|
||||
celery_ping = celery_app.control.inspect(
|
||||
connection=celery_connection,
|
||||
).ping()
|
||||
if celery_ping:
|
||||
break
|
||||
if ping_attempt < 2:
|
||||
sleep(0.25)
|
||||
|
||||
if not celery_ping:
|
||||
celery_active = "WARNING"
|
||||
|
||||
@@ -2,7 +2,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ngx\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-11-17 20:48+0000\n"
|
||||
"POT-Creation-Date: 2026-11-22 16:50+0000\n"
|
||||
"PO-Revision-Date: 2022-02-17 04:17\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: English\n"
|
||||
@@ -1710,7 +1710,7 @@ msgstr ""
|
||||
msgid "Duplicate document identifiers are not allowed."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2979 documents/views.py:4770
|
||||
#: documents/serialisers.py:2979 documents/views.py:4958
|
||||
#, python-format
|
||||
msgid "Documents not found: %(ids)s"
|
||||
msgstr ""
|
||||
@@ -1981,20 +1981,20 @@ msgstr ""
|
||||
msgid "AI backend rejected the request. Check logs for details."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:4786
|
||||
#: documents/views.py:4974
|
||||
#, python-format
|
||||
msgid "Insufficient permissions to share document %(id)s."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:4833
|
||||
#: documents/views.py:5021
|
||||
msgid "Bundle is already being processed."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:4899
|
||||
#: documents/views.py:5087
|
||||
msgid "The share link bundle is still being prepared. Please try again later."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:4913
|
||||
#: documents/views.py:5101
|
||||
msgid "The share link bundle is unavailable."
|
||||
msgstr ""
|
||||
|
||||
@@ -2434,7 +2434,7 @@ msgstr ""
|
||||
msgid "Chinese Traditional"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:438
|
||||
#: paperless/urls.py:444
|
||||
msgid "Paperless-ngx administration"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import ipaddress
|
||||
import socket
|
||||
from collections.abc import Collection
|
||||
@@ -175,7 +176,9 @@ class PinnedHostAsyncHTTPTransport(httpx.AsyncHTTPTransport):
|
||||
self.allow_internal = allow_internal
|
||||
|
||||
async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
|
||||
request = _rewrite_request_to_pinned_ip(
|
||||
# Resolving the host blocks, so keep it off the event loop
|
||||
request = await asyncio.to_thread(
|
||||
_rewrite_request_to_pinned_ip,
|
||||
request,
|
||||
allow_internal=self.allow_internal,
|
||||
)
|
||||
|
||||
@@ -458,8 +458,8 @@ def _get_allowed_hosts() -> list[str]:
|
||||
else:
|
||||
allowed_hosts = ["*"]
|
||||
if allowed_hosts != ["*"]:
|
||||
# Always allow localhost for the Docker health check.
|
||||
allowed_hosts.append("localhost")
|
||||
# Allow local access and health checks via loopback hostnames and addresses.
|
||||
allowed_hosts.extend(["localhost", "127.0.0.1", "[::1]"])
|
||||
return allowed_hosts
|
||||
|
||||
|
||||
|
||||
@@ -177,11 +177,17 @@ class TestPaperlessURLSettings(TestCase):
|
||||
("url", "allowed_hosts", "expected", "accepted_host", "rejected_host"),
|
||||
[
|
||||
(None, None, ["*"], "other.example.com", None),
|
||||
(None, "", ["localhost"], "localhost:8000", "other.example.com"),
|
||||
(
|
||||
None,
|
||||
"",
|
||||
["localhost", "127.0.0.1", "[::1]"],
|
||||
"localhost:8000",
|
||||
"other.example.com",
|
||||
),
|
||||
(
|
||||
None,
|
||||
"lan.example.com",
|
||||
["lan.example.com", "localhost"],
|
||||
["lan.example.com", "localhost", "127.0.0.1", "[::1]"],
|
||||
"lan.example.com",
|
||||
"other.example.com",
|
||||
),
|
||||
@@ -189,29 +195,29 @@ class TestPaperlessURLSettings(TestCase):
|
||||
(
|
||||
"https://example.com:8443",
|
||||
None,
|
||||
["localhost", "example.com"],
|
||||
["localhost", "127.0.0.1", "[::1]", "example.com"],
|
||||
"example.com:8443",
|
||||
"other.example.com",
|
||||
),
|
||||
(
|
||||
"https://example.com.",
|
||||
"",
|
||||
["localhost", "example.com"],
|
||||
["localhost", "127.0.0.1", "[::1]", "example.com"],
|
||||
"example.com.",
|
||||
"other.example.com",
|
||||
),
|
||||
(
|
||||
"http://[::1]:8000",
|
||||
"http://[2001:db8::1]:8000",
|
||||
None,
|
||||
["localhost", "[::1]"],
|
||||
"[::1]:8000",
|
||||
["localhost", "127.0.0.1", "[::1]", "[2001:db8::1]"],
|
||||
"[2001:db8::1]:8000",
|
||||
"other.example.com",
|
||||
),
|
||||
("https://example.com", "*", ["*", "example.com"], "other.example.com", None),
|
||||
(
|
||||
"https://example.com",
|
||||
"lan.example.com",
|
||||
["lan.example.com", "localhost", "example.com"],
|
||||
["lan.example.com", "localhost", "127.0.0.1", "[::1]", "example.com"],
|
||||
"lan.example.com",
|
||||
"other.example.com",
|
||||
),
|
||||
@@ -241,9 +247,10 @@ def test_allowed_hosts_at_startup(
|
||||
assert expected == paperless_settings.ALLOWED_HOSTS
|
||||
|
||||
request = HttpRequest()
|
||||
with override_settings(ALLOWED_HOSTS=expected):
|
||||
request.META["HTTP_HOST"] = accepted_host
|
||||
assert request.get_host() == accepted_host
|
||||
with override_settings(ALLOWED_HOSTS=paperless_settings.ALLOWED_HOSTS):
|
||||
for host in (accepted_host, "localhost:8000", "127.0.0.1:30070", "[::1]:8000"):
|
||||
request.META["HTTP_HOST"] = host
|
||||
assert request.get_host() == host
|
||||
if rejected_host:
|
||||
request.META["HTTP_HOST"] = rejected_host
|
||||
with pytest.raises(DisallowedHost):
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest import mock
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from paperless.network import PinnedHostAsyncHTTPTransport
|
||||
from paperless.network import PinnedHostHTTPTransport
|
||||
from paperless.network import is_public_ip
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
|
||||
def test_pinned_host_transport_blocks_internal_rebinding():
|
||||
transport = PinnedHostHTTPTransport(allow_internal=False)
|
||||
@@ -51,6 +59,58 @@ def test_pinned_host_transport_rewrites_to_vetted_ip():
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
class TestPinnedHostAsyncHTTPTransport:
|
||||
def test_blocks_internal_rebinding(self, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A hostname that resolves to a loopback address
|
||||
WHEN:
|
||||
- The async transport sends a request to it
|
||||
THEN:
|
||||
- The request is refused as a non-public address
|
||||
"""
|
||||
mocker.patch(
|
||||
"paperless.network.resolve_hostname_ips",
|
||||
return_value=["127.0.0.1"],
|
||||
)
|
||||
transport = PinnedHostAsyncHTTPTransport(allow_internal=False)
|
||||
request = httpx.Request("GET", "http://example.com/test")
|
||||
|
||||
with pytest.raises(httpx.ConnectError, match="non-public address"):
|
||||
asyncio.run(transport.handle_async_request(request))
|
||||
|
||||
def test_rewrites_to_vetted_ip(self, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A hostname that resolves to a public address
|
||||
WHEN:
|
||||
- The async transport sends a request to it
|
||||
THEN:
|
||||
- The connection goes to that address, keeping the original Host
|
||||
header and TLS SNI hostname
|
||||
"""
|
||||
mocker.patch(
|
||||
"paperless.network.resolve_hostname_ips",
|
||||
return_value=["93.184.216.34"],
|
||||
)
|
||||
sent = mocker.patch.object(
|
||||
httpx.AsyncHTTPTransport,
|
||||
"handle_async_request",
|
||||
autospec=True,
|
||||
side_effect=lambda _self, req: httpx.Response(200, request=req),
|
||||
)
|
||||
transport = PinnedHostAsyncHTTPTransport(allow_internal=False)
|
||||
request = httpx.Request("GET", "https://example.com:8443/test")
|
||||
|
||||
response = asyncio.run(transport.handle_async_request(request))
|
||||
|
||||
assert response.status_code == 200
|
||||
rewritten = sent.call_args.args[1]
|
||||
assert str(rewritten.url) == "https://93.184.216.34:8443/test"
|
||||
assert rewritten.headers["Host"] == "example.com:8443"
|
||||
assert rewritten.extensions["sni_hostname"] == "example.com"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"address",
|
||||
[
|
||||
|
||||
@@ -31,6 +31,7 @@ from documents.views import LogViewSet
|
||||
from documents.views import MergeDocumentsAsVersionsView
|
||||
from documents.views import MergeDocumentsView
|
||||
from documents.views import PostDocumentView
|
||||
from documents.views import ReleaseNotesView
|
||||
from documents.views import RemoteVersionView
|
||||
from documents.views import RemovePasswordDocumentsView
|
||||
from documents.views import ReprocessDocumentsView
|
||||
@@ -219,6 +220,11 @@ urlpatterns = [
|
||||
RemoteVersionView.as_view(),
|
||||
name="remoteversion",
|
||||
),
|
||||
re_path(
|
||||
"^release_notes/",
|
||||
ReleaseNotesView.as_view(),
|
||||
name="release_notes",
|
||||
),
|
||||
re_path(
|
||||
"^ui_settings/",
|
||||
UiSettingsView.as_view(),
|
||||
|
||||
+150
-40
@@ -1,7 +1,12 @@
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
from collections.abc import AsyncIterator
|
||||
from contextlib import aclosing
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import NamedTuple
|
||||
|
||||
from asgiref.sync import sync_to_async
|
||||
from django.db import connections
|
||||
from django.db.models import QuerySet
|
||||
|
||||
from documents.models import Document
|
||||
@@ -17,6 +22,11 @@ from paperless_ai.prompts.context import ChatQaPromptContext
|
||||
from paperless_ai.prompts.context import ChatRefinePromptContext
|
||||
from paperless_ai.prompts.render import render_prompt
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from llama_index.core.llms import LLM
|
||||
from llama_index.core.response_synthesizers import BaseSynthesizer
|
||||
from llama_index.core.schema import NodeWithScore
|
||||
|
||||
logger = logging.getLogger("paperless_ai.chat")
|
||||
|
||||
CHAT_METADATA_DELIMITER = "\n\n__PAPERLESS_CHAT_METADATA__"
|
||||
@@ -103,38 +113,146 @@ def _format_chat_metadata_trailer(references: list[dict[str, int | str]]) -> str
|
||||
)
|
||||
|
||||
|
||||
def stream_chat_with_documents(
|
||||
async def stream_chat_with_documents(
|
||||
query_str: str,
|
||||
documents: QuerySet[Document],
|
||||
*,
|
||||
unrestricted: bool = False,
|
||||
output_language: str | None = None,
|
||||
):
|
||||
) -> AsyncIterator[str]:
|
||||
try:
|
||||
yield from _stream_chat_with_documents(
|
||||
query_str,
|
||||
documents,
|
||||
unrestricted=unrestricted,
|
||||
output_language=output_language,
|
||||
)
|
||||
async with aclosing(
|
||||
_stream_chat_with_documents(
|
||||
query_str,
|
||||
documents,
|
||||
unrestricted=unrestricted,
|
||||
output_language=output_language,
|
||||
),
|
||||
) as chunks:
|
||||
async for chunk in chunks:
|
||||
yield chunk
|
||||
except Exception as e:
|
||||
logger.exception("Failed to stream document chat response: %s", e)
|
||||
yield CHAT_ERROR_MESSAGE
|
||||
|
||||
|
||||
def _stream_chat_with_documents(
|
||||
async def _stream_chat_with_documents(
|
||||
query_str: str,
|
||||
documents: QuerySet[Document],
|
||||
*,
|
||||
unrestricted: bool = False,
|
||||
output_language: str | None = None,
|
||||
):
|
||||
if not documents.exists():
|
||||
) -> AsyncIterator[str]:
|
||||
prepared = await sync_to_async(_prepare_chat)(
|
||||
query_str,
|
||||
documents,
|
||||
unrestricted=unrestricted,
|
||||
output_language=output_language,
|
||||
)
|
||||
if prepared is None:
|
||||
yield CHAT_NO_CONTENT_MESSAGE
|
||||
return
|
||||
|
||||
logger.debug("Document chat query: %s", query_str)
|
||||
try:
|
||||
first_chunk, chunks, provider_stream = await _start_answer(
|
||||
prepared.synthesizer,
|
||||
query_str,
|
||||
prepared.top_nodes,
|
||||
)
|
||||
except Exception as e:
|
||||
if not _is_bad_request(e):
|
||||
raise
|
||||
logger.warning(
|
||||
"The LLM server rejected the prompt (%s). Retrying with smaller "
|
||||
"prompts. Set PAPERLESS_AI_LLM_CONTEXT_SIZE to the context size the "
|
||||
"LLM server actually uses to avoid the extra request.",
|
||||
e,
|
||||
)
|
||||
first_chunk, chunks, provider_stream = await _start_answer(
|
||||
prepared.fallback_synthesizer,
|
||||
query_str,
|
||||
prepared.top_nodes,
|
||||
)
|
||||
|
||||
# llama-index forwards chunks without closing what it reads from, so own
|
||||
# the provider stream here. Exit order closes the forwarder, then the
|
||||
# provider stream, so a disconnect releases the LLM request immediately.
|
||||
async with aclosing(provider_stream), aclosing(chunks):
|
||||
if first_chunk is not None:
|
||||
yield first_chunk
|
||||
async for chunk in chunks:
|
||||
yield chunk
|
||||
|
||||
if prepared.references:
|
||||
yield _format_chat_metadata_trailer(prepared.references)
|
||||
|
||||
|
||||
class _PreparedChat(NamedTuple):
|
||||
synthesizer: "BaseSynthesizer"
|
||||
# Packs the retrieved chunks by the embedding chunk size, as chat did before
|
||||
# it filled the context window. Used when the server rejects the larger prompt.
|
||||
fallback_synthesizer: "BaseSynthesizer"
|
||||
top_nodes: list["NodeWithScore"]
|
||||
references: list[dict[str, int | str]]
|
||||
|
||||
|
||||
def _is_bad_request(exc: Exception) -> bool:
|
||||
return getattr(exc, "status_code", None) == 400
|
||||
|
||||
|
||||
async def _start_answer(
|
||||
synthesizer: "BaseSynthesizer",
|
||||
query_str: str,
|
||||
top_nodes: list["NodeWithScore"],
|
||||
) -> tuple[str | None, AsyncIterator[str], AsyncIterator[str]]:
|
||||
"""Begin the answer and pull its first chunk, so a server rejecting the prompt
|
||||
surfaces here, before anything has been streamed to the user. Also returns the
|
||||
provider stream, which the caller must close."""
|
||||
response_stream = await synthesizer.asynthesize(query_str, top_nodes)
|
||||
chunks = response_stream.async_response_gen()
|
||||
return await anext(chunks, None), chunks, response_stream.response_gen
|
||||
|
||||
|
||||
def _build_synthesizer(
|
||||
config: AIConfig,
|
||||
llm: "LLM",
|
||||
output_language: str | None,
|
||||
*,
|
||||
chunk_size: int,
|
||||
) -> "BaseSynthesizer":
|
||||
from llama_index.core.prompts import PromptTemplate
|
||||
from llama_index.core.response_synthesizers import get_response_synthesizer
|
||||
|
||||
return get_response_synthesizer(
|
||||
llm=llm,
|
||||
prompt_helper=get_rag_prompt_helper(
|
||||
chunk_size=chunk_size,
|
||||
context_size=config.llm_context_size,
|
||||
),
|
||||
text_qa_template=PromptTemplate(template=_build_chat_prompt(output_language)),
|
||||
refine_template=PromptTemplate(
|
||||
template=_build_refine_prompt(output_language),
|
||||
),
|
||||
streaming=True,
|
||||
)
|
||||
|
||||
|
||||
def _prepare_chat(
|
||||
query_str: str,
|
||||
documents: QuerySet[Document],
|
||||
*,
|
||||
unrestricted: bool,
|
||||
output_language: str | None,
|
||||
) -> _PreparedChat | None:
|
||||
"""Everything before the answer streams, all of it blocking: ORM queries,
|
||||
the index read lock and its thread-bound sqlite connection, the query
|
||||
embedding, and building the LLM client. Returns None when there is no
|
||||
content to answer from.
|
||||
"""
|
||||
if not documents.exists():
|
||||
return None
|
||||
|
||||
from llama_index.core.retrievers import VectorIndexRetriever
|
||||
|
||||
config = AIConfig()
|
||||
@@ -150,8 +268,6 @@ def _stream_chat_with_documents(
|
||||
|
||||
# Hold the shared read lock only while reading the index, so the compaction
|
||||
# swap cannot replace the database file while this connection is open.
|
||||
# Everything after retrieval works on the nodes already in memory, so a slow
|
||||
# LLM stream never holds the lock.
|
||||
with read_store() as store:
|
||||
if permitted_ids is not None:
|
||||
filters = _permitted_documents_filter(store, permitted_ids)
|
||||
@@ -179,35 +295,29 @@ def _stream_chat_with_documents(
|
||||
|
||||
if not top_nodes:
|
||||
logger.warning("No nodes found for the given documents.")
|
||||
yield CHAT_NO_CONTENT_MESSAGE
|
||||
return
|
||||
|
||||
client = AIClient()
|
||||
return None
|
||||
|
||||
references = _get_document_references(documents, top_nodes)
|
||||
|
||||
prompt_template = PromptTemplate(template=_build_chat_prompt(output_language))
|
||||
refine_template = PromptTemplate(template=_build_refine_prompt(output_language))
|
||||
response_synthesizer = get_response_synthesizer(
|
||||
llm=client.llm,
|
||||
prompt_helper=get_rag_prompt_helper(
|
||||
chunk_size=config.llm_embedding_chunk_size,
|
||||
context_size=config.llm_context_size,
|
||||
),
|
||||
text_qa_template=prompt_template,
|
||||
refine_template=refine_template,
|
||||
streaming=True,
|
||||
client = AIClient()
|
||||
# Chunk size limit equal to the context size lets llama_index pack the retrieved
|
||||
# chunks into as few LLM calls as the window allows, instead of one call per
|
||||
# embedding-sized chunk.
|
||||
synthesizer = _build_synthesizer(
|
||||
config,
|
||||
client.llm,
|
||||
output_language,
|
||||
chunk_size=config.llm_context_size,
|
||||
)
|
||||
fallback_synthesizer = _build_synthesizer(
|
||||
config,
|
||||
client.llm,
|
||||
output_language,
|
||||
chunk_size=config.llm_embedding_chunk_size,
|
||||
)
|
||||
|
||||
logger.debug("Document chat query: %s", query_str)
|
||||
# Release the pooled DB connection for the slow streaming LLM response
|
||||
# so it is not pinned for the whole stream; see paperless_ai.db and
|
||||
# #12976.
|
||||
with db_connection_released():
|
||||
response_stream = response_synthesizer.synthesize(query_str, top_nodes)
|
||||
for chunk in response_stream.response_gen:
|
||||
yield chunk
|
||||
sys.stdout.flush()
|
||||
# No ORM access happens while the answer streams, so hand the pooled DB
|
||||
# connection back now rather than pin it for the whole stream. See #12976.
|
||||
connections.close_all()
|
||||
|
||||
if references:
|
||||
yield _format_chat_metadata_trailer(references)
|
||||
return _PreparedChat(synthesizer, fallback_synthesizer, top_nodes, references)
|
||||
@@ -4,10 +4,12 @@ import json
|
||||
from contextlib import contextmanager
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Any
|
||||
from unittest.mock import AsyncMock
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from asgiref.sync import async_to_sync
|
||||
from django.db.models.signals import post_init
|
||||
from django.utils import timezone
|
||||
from llama_index.core import settings as llama_settings
|
||||
@@ -26,6 +28,7 @@ from paperless_ai.chat import stream_chat_with_documents
|
||||
from paperless_testing.factories import DocumentFactory
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import AsyncIterator
|
||||
from collections.abc import Iterator
|
||||
from pathlib import Path
|
||||
|
||||
@@ -66,6 +69,32 @@ def assert_chat_output(
|
||||
}
|
||||
|
||||
|
||||
def collect(chunks: AsyncIterator[str]) -> list[str]:
|
||||
"""Drain the chat stream from sync test code. Its blocking setup then runs
|
||||
on the test's own thread, inside the test's DB transaction."""
|
||||
|
||||
async def drain() -> list[str]:
|
||||
return [chunk async for chunk in chunks]
|
||||
|
||||
return async_to_sync(drain)()
|
||||
|
||||
|
||||
def fake_response_stream(chunks: list[str]) -> MagicMock:
|
||||
"""An AsyncStreamingResponse stand-in yielding ``chunks``."""
|
||||
|
||||
async def response_gen() -> AsyncIterator[str]:
|
||||
for chunk in chunks:
|
||||
yield chunk
|
||||
|
||||
async def async_response_gen() -> AsyncIterator[str]:
|
||||
async for chunk in stream.response_gen:
|
||||
yield chunk
|
||||
|
||||
stream = MagicMock(async_response_gen=async_response_gen)
|
||||
stream.response_gen = response_gen()
|
||||
return stream
|
||||
|
||||
|
||||
def _fake_documents_queryset(pks: list[int]) -> MagicMock:
|
||||
qs = MagicMock()
|
||||
qs.exists.return_value = bool(pks)
|
||||
@@ -170,19 +199,19 @@ def test_stream_chat_with_one_document_retrieval(
|
||||
),
|
||||
]
|
||||
|
||||
mock_response_stream = MagicMock()
|
||||
mock_response_stream.response_gen = iter(["chunk1", "chunk2"])
|
||||
mock_synthesizer = mock_get_response_synthesizer.return_value
|
||||
mock_synthesizer.synthesize.return_value = mock_response_stream
|
||||
mock_synthesizer.asynthesize = AsyncMock(
|
||||
return_value=fake_response_stream(["chunk1", "chunk2"]),
|
||||
)
|
||||
|
||||
with patch(
|
||||
"llama_index.core.retrievers.VectorIndexRetriever",
|
||||
return_value=mock_retriever_instance,
|
||||
):
|
||||
output = list(stream_chat_with_documents("What is this?", documents))
|
||||
output = collect(stream_chat_with_documents("What is this?", documents))
|
||||
|
||||
mock_retriever_instance.retrieve.assert_called_once_with("What is this?")
|
||||
mock_synthesizer.synthesize.assert_called_once_with(
|
||||
mock_synthesizer.asynthesize.assert_awaited_once_with(
|
||||
"What is this?",
|
||||
mock_retriever_instance.retrieve.return_value,
|
||||
)
|
||||
@@ -236,20 +265,19 @@ def test_stream_chat_with_multiple_documents_retrieval(patch_embed_nodes) -> Non
|
||||
MagicMock(metadata={"document_id": str(doc2.pk), "title": "Document 2"}),
|
||||
]
|
||||
|
||||
mock_response_stream = MagicMock()
|
||||
mock_response_stream.response_gen = iter(["chunk1", "chunk2"])
|
||||
|
||||
mock_synthesizer = mock_get_response_synthesizer.return_value
|
||||
mock_synthesizer.synthesize.return_value = mock_response_stream
|
||||
mock_synthesizer.asynthesize = AsyncMock(
|
||||
return_value=fake_response_stream(["chunk1", "chunk2"]),
|
||||
)
|
||||
|
||||
with patch(
|
||||
"llama_index.core.retrievers.VectorIndexRetriever",
|
||||
return_value=mock_retriever_instance,
|
||||
):
|
||||
output = list(stream_chat_with_documents("What's up?", documents))
|
||||
output = collect(stream_chat_with_documents("What's up?", documents))
|
||||
|
||||
mock_retriever_instance.retrieve.assert_called_once_with("What's up?")
|
||||
mock_synthesizer.synthesize.assert_called_once_with(
|
||||
mock_synthesizer.asynthesize.assert_awaited_once_with(
|
||||
"What's up?",
|
||||
mock_retriever_instance.retrieve.return_value,
|
||||
)
|
||||
@@ -266,7 +294,9 @@ def test_stream_chat_with_multiple_documents_retrieval(patch_embed_nodes) -> Non
|
||||
|
||||
def test_stream_chat_empty_document_list() -> None:
|
||||
with patch("paperless_ai.chat.load_or_build_index") as mock_load_index:
|
||||
output = list(stream_chat_with_documents("Any info?", Document.objects.none()))
|
||||
output = collect(
|
||||
stream_chat_with_documents("Any info?", Document.objects.none()),
|
||||
)
|
||||
mock_load_index.assert_not_called()
|
||||
assert output == ["Sorry, I couldn't find any content to answer your question."]
|
||||
|
||||
@@ -286,7 +316,7 @@ def test_stream_chat_no_matching_nodes() -> None:
|
||||
mock_index.vector_store.get_nodes.return_value = []
|
||||
mock_load_index.return_value = mock_index
|
||||
|
||||
output = list(
|
||||
output = collect(
|
||||
stream_chat_with_documents("Any info?", _fake_documents_queryset([1])),
|
||||
)
|
||||
|
||||
@@ -317,7 +347,7 @@ def test_stream_chat_unexpected_failure_returns_generic_error(caplog) -> None:
|
||||
)
|
||||
mock_retriever_cls.return_value = mock_retriever
|
||||
|
||||
output = list(
|
||||
output = collect(
|
||||
stream_chat_with_documents("Any info?", _fake_documents_queryset([1])),
|
||||
)
|
||||
|
||||
@@ -367,7 +397,7 @@ class TestStreamChatRetrieval:
|
||||
) -> None:
|
||||
doc = DocumentFactory.create(content="hello world")
|
||||
# Nothing indexed for this document yet.
|
||||
out = list(
|
||||
out = collect(
|
||||
chat.stream_chat_with_documents(
|
||||
"question?",
|
||||
Document.objects.filter(pk=doc.pk),
|
||||
@@ -390,7 +420,7 @@ class TestStreamChatRetrieval:
|
||||
indexing.llm_index_add_or_update_document(included)
|
||||
indexing.llm_index_add_or_update_document(excluded)
|
||||
|
||||
list(
|
||||
collect(
|
||||
chat.stream_chat_with_documents(
|
||||
"question?",
|
||||
Document.objects.filter(pk=included.pk),
|
||||
@@ -419,7 +449,7 @@ class TestStreamChatRetrieval:
|
||||
document = DocumentFactory.create(content="indexed document content")
|
||||
indexing.llm_index_add_or_update_document(document)
|
||||
|
||||
list(
|
||||
collect(
|
||||
chat.stream_chat_with_documents(
|
||||
"question?",
|
||||
Document.objects.filter(pk=document.pk),
|
||||
@@ -455,7 +485,7 @@ class TestStreamChatRetrieval:
|
||||
deleted_at=timezone.now(),
|
||||
)
|
||||
|
||||
list(
|
||||
collect(
|
||||
chat.stream_chat_with_documents(
|
||||
"question?",
|
||||
Document.objects.filter(pk=kept.pk),
|
||||
@@ -487,7 +517,7 @@ class TestStreamChatRetrieval:
|
||||
indexing.llm_index_add_or_update_document(doc)
|
||||
permitted = Document.objects.filter(pk__in=[docs[0].pk, docs[1].pk])
|
||||
|
||||
list(chat.stream_chat_with_documents("question?", permitted))
|
||||
collect(chat.stream_chat_with_documents("question?", permitted))
|
||||
|
||||
metadata_filter = captured_filters[0].filters[0]
|
||||
assert metadata_filter.operator == FilterOperator.NIN
|
||||
@@ -520,16 +550,21 @@ class TestStreamChatRetrieval:
|
||||
synthesizer = mocker.patch(
|
||||
"llama_index.core.response_synthesizers.get_response_synthesizer",
|
||||
).return_value
|
||||
synthesizer.synthesize.return_value.response_gen = iter(["chunk"])
|
||||
synthesizer.asynthesize = AsyncMock(
|
||||
return_value=fake_response_stream(["chunk"]),
|
||||
)
|
||||
|
||||
list(
|
||||
collect(
|
||||
chat.stream_chat_with_documents(
|
||||
"question?",
|
||||
Document.objects.filter(pk=permitted_doc.pk),
|
||||
),
|
||||
)
|
||||
|
||||
synthesizer.synthesize.assert_called_once_with("question?", [permitted_node])
|
||||
synthesizer.asynthesize.assert_awaited_once_with(
|
||||
"question?",
|
||||
[permitted_node],
|
||||
)
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_get_document_references_only_queries_referenced_documents(
|
||||
@@ -612,9 +647,9 @@ class TestChatReadLock:
|
||||
]
|
||||
)
|
||||
|
||||
def synthesize(*_args: object) -> object:
|
||||
def asynthesize(*_args: object) -> MagicMock:
|
||||
events.append("synthesize")
|
||||
return mocker.MagicMock(response_gen=iter(["chunk"]))
|
||||
return fake_response_stream(["chunk"])
|
||||
|
||||
mocker.patch("paperless_ai.chat.read_store", fake_read_store)
|
||||
mocker.patch("paperless_ai.chat.AIClient")
|
||||
@@ -625,9 +660,9 @@ class TestChatReadLock:
|
||||
)
|
||||
mocker.patch(
|
||||
"llama_index.core.response_synthesizers.get_response_synthesizer",
|
||||
).return_value.synthesize.side_effect = synthesize
|
||||
).return_value.asynthesize = AsyncMock(side_effect=asynthesize)
|
||||
|
||||
list(
|
||||
collect(
|
||||
stream_chat_with_documents(
|
||||
"What is this?",
|
||||
Document.objects.filter(pk=document.pk),
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest.mock import AsyncMock
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from paperless_ai.chat import _PreparedChat
|
||||
from paperless_ai.chat import stream_chat_with_documents
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import AsyncIterator
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_closing_after_a_chunk_closes_the_provider_stream() -> None:
|
||||
provider_closed = False
|
||||
|
||||
async def provider_stream() -> AsyncIterator[str]:
|
||||
nonlocal provider_closed
|
||||
try:
|
||||
yield "first"
|
||||
yield "second"
|
||||
finally:
|
||||
provider_closed = True
|
||||
|
||||
provider = provider_stream()
|
||||
|
||||
# Like llama-index, forward chunks without closing the stream read from
|
||||
async def async_response_gen() -> AsyncIterator[str]:
|
||||
async for chunk in provider:
|
||||
yield chunk
|
||||
|
||||
response_stream = MagicMock(async_response_gen=async_response_gen)
|
||||
response_stream.response_gen = provider
|
||||
synthesizer = MagicMock(asynthesize=AsyncMock(return_value=response_stream))
|
||||
references = [{"id": 1, "title": "Doc"}]
|
||||
|
||||
with patch(
|
||||
"paperless_ai.chat._prepare_chat",
|
||||
return_value=_PreparedChat(synthesizer, synthesizer, [], references),
|
||||
):
|
||||
chunks = stream_chat_with_documents("Any info?", MagicMock())
|
||||
assert await anext(chunks) == "first"
|
||||
await chunks.aclose()
|
||||
|
||||
assert provider_closed
|
||||
with pytest.raises(StopAsyncIteration):
|
||||
await anext(chunks)
|
||||
@@ -0,0 +1,282 @@
|
||||
"""Chat answers are generated from all retrieved chunks in as few LLM calls as the
|
||||
configured context window allows, and fall back to the embedding chunk size when the
|
||||
server rejects the larger prompt."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from types import SimpleNamespace
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import httpx
|
||||
import openai
|
||||
import pytest
|
||||
from asgiref.sync import async_to_sync
|
||||
from llama_index.core.llms import CompletionResponse
|
||||
from llama_index.core.llms import MockLLM
|
||||
from llama_index.core.schema import NodeWithScore
|
||||
from llama_index.core.schema import TextNode
|
||||
from llama_index.core.utils import get_tokenizer
|
||||
from pydantic import PrivateAttr
|
||||
|
||||
from documents.models import Document
|
||||
from paperless_ai.chat import CHAT_ERROR_MESSAGE
|
||||
from paperless_ai.chat import stream_chat_with_documents
|
||||
from paperless_ai.indexing import RAG_NUM_OUTPUT
|
||||
from paperless_testing.factories import DocumentFactory
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Iterator
|
||||
|
||||
import pytest_mock
|
||||
|
||||
CHUNK_COUNT = 5
|
||||
# About 900 tokens for the estimator llama_index uses, so five of them fit in the
|
||||
# default 8192 window but not in the default 1024 token chunk size limit.
|
||||
CHUNK_TEXT = " ".join(["word"] * 900)
|
||||
|
||||
|
||||
def _bad_request() -> openai.BadRequestError:
|
||||
request = httpx.Request("POST", "http://llm.invalid/v1/completions")
|
||||
return openai.BadRequestError(
|
||||
"request exceeds the available context size",
|
||||
response=httpx.Response(400, request=request),
|
||||
body=None,
|
||||
)
|
||||
|
||||
|
||||
class ScriptedLLM(MockLLM):
|
||||
"""Records every prompt it is sent and fails on request, the way a real server
|
||||
does: eagerly for a plain completion, lazily on the first token of a stream."""
|
||||
|
||||
_prompts: list[str] = PrivateAttr(default_factory=list)
|
||||
_max_prompt_chars: int | None = PrivateAttr(default=None)
|
||||
_error: Exception | None = PrivateAttr(default=None)
|
||||
_tokens_before_error: int = PrivateAttr(default=0)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_prompt_chars: int | None = None,
|
||||
error: Exception | None = None,
|
||||
tokens_before_error: int = 0,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self._max_prompt_chars = max_prompt_chars
|
||||
self._error = error
|
||||
self._tokens_before_error = tokens_before_error
|
||||
|
||||
@property
|
||||
def prompts(self) -> list[str]:
|
||||
return self._prompts
|
||||
|
||||
def _failure(self, prompt: str) -> Exception | None:
|
||||
if self._max_prompt_chars is not None and len(prompt) > self._max_prompt_chars:
|
||||
return _bad_request()
|
||||
return self._error
|
||||
|
||||
def complete(
|
||||
self,
|
||||
prompt: str,
|
||||
formatted: bool = False, # noqa: FBT001, FBT002 (mirrors the base class)
|
||||
**kwargs: object,
|
||||
) -> CompletionResponse:
|
||||
self._prompts.append(prompt)
|
||||
failure = self._failure(prompt)
|
||||
if failure is not None:
|
||||
raise failure
|
||||
return CompletionResponse(text="answer")
|
||||
|
||||
def stream_complete(
|
||||
self,
|
||||
prompt: str,
|
||||
formatted: bool = False, # noqa: FBT001, FBT002 (mirrors the base class)
|
||||
**kwargs: object,
|
||||
) -> Iterator[CompletionResponse]:
|
||||
self._prompts.append(prompt)
|
||||
failure = self._failure(prompt)
|
||||
|
||||
def generate() -> Iterator[CompletionResponse]:
|
||||
for index in range(self._tokens_before_error):
|
||||
yield CompletionResponse(text="partial", delta=f"partial{index}")
|
||||
if failure is not None:
|
||||
raise failure
|
||||
yield CompletionResponse(text="answer", delta="answer")
|
||||
|
||||
return generate()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def run_chat(
|
||||
mocker: pytest_mock.MockerFixture,
|
||||
) -> Callable[..., list[str]]:
|
||||
"""Stream one chat question through the real synthesizer, with retrieval,
|
||||
the index and the AI configuration stubbed."""
|
||||
|
||||
def run(llm: ScriptedLLM, *, context_size: int = 8192) -> list[str]:
|
||||
document = DocumentFactory.create(title="Test Document", content="ignored")
|
||||
nodes = [
|
||||
NodeWithScore(
|
||||
node=TextNode(
|
||||
text=CHUNK_TEXT,
|
||||
metadata={"document_id": str(document.pk), "title": "Test"},
|
||||
),
|
||||
score=0.9,
|
||||
)
|
||||
for _ in range(CHUNK_COUNT)
|
||||
]
|
||||
retriever = mocker.MagicMock()
|
||||
retriever.retrieve.return_value = nodes
|
||||
|
||||
mocker.patch("paperless_ai.chat.read_store")
|
||||
mocker.patch("paperless_ai.chat.load_or_build_index")
|
||||
mocker.patch(
|
||||
"paperless_ai.chat.AIConfig",
|
||||
return_value=SimpleNamespace(
|
||||
llm_context_size=context_size,
|
||||
llm_embedding_chunk_size=1024,
|
||||
),
|
||||
)
|
||||
mocker.patch("paperless_ai.chat.AIClient").return_value.llm = llm
|
||||
mocker.patch(
|
||||
"llama_index.core.retrievers.VectorIndexRetriever",
|
||||
return_value=retriever,
|
||||
)
|
||||
|
||||
async def drain() -> list[str]:
|
||||
return [
|
||||
chunk
|
||||
async for chunk in stream_chat_with_documents(
|
||||
"What is this?",
|
||||
Document.objects.filter(pk=document.pk),
|
||||
)
|
||||
]
|
||||
|
||||
# Driven from sync test code so the blocking setup runs on the test's own
|
||||
# thread, inside the test's DB transaction.
|
||||
return async_to_sync(drain)()
|
||||
|
||||
return run
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
class TestChunkMerging:
|
||||
def test_retrieved_chunks_are_answered_in_a_single_llm_call(
|
||||
self,
|
||||
run_chat: Callable[..., list[str]],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN five retrieved chunks that together fit the configured context window
|
||||
WHEN a chat question is answered
|
||||
THEN the LLM is called once, with every chunk in the prompt
|
||||
"""
|
||||
llm = ScriptedLLM()
|
||||
|
||||
output = run_chat(llm, context_size=8192)
|
||||
|
||||
assert CHAT_ERROR_MESSAGE not in output
|
||||
assert len(llm.prompts) == 1
|
||||
assert llm.prompts[0].count(CHUNK_TEXT) == CHUNK_COUNT
|
||||
|
||||
def test_small_context_window_spreads_the_chunks_over_several_calls(
|
||||
self,
|
||||
run_chat: Callable[..., list[str]],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN a context window too small for all the retrieved chunks at once
|
||||
WHEN a chat question is answered
|
||||
THEN the chunks are spread over several LLM calls
|
||||
AND every prompt leaves room in the window for the answer
|
||||
"""
|
||||
context_size = 4096
|
||||
tokenize = get_tokenizer()
|
||||
llm = ScriptedLLM()
|
||||
|
||||
output = run_chat(llm, context_size=context_size)
|
||||
|
||||
assert CHAT_ERROR_MESSAGE not in output
|
||||
assert len(llm.prompts) > 1
|
||||
assert all(
|
||||
len(tokenize(prompt)) <= context_size - RAG_NUM_OUTPUT
|
||||
for prompt in llm.prompts
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
class TestContextWindowFallback:
|
||||
def test_rejected_prompt_is_retried_with_the_embedding_chunk_size(
|
||||
self,
|
||||
run_chat: Callable[..., list[str]],
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN a server whose real context window is smaller than the configured one
|
||||
WHEN the merged prompt is rejected with a bad request
|
||||
THEN the question is answered again from smaller prompts
|
||||
AND a warning names the context size setting
|
||||
"""
|
||||
max_prompt_chars = 12_000
|
||||
llm = ScriptedLLM(max_prompt_chars=max_prompt_chars)
|
||||
|
||||
with caplog.at_level(logging.WARNING, logger="paperless_ai.chat"):
|
||||
output = run_chat(llm, context_size=8192)
|
||||
|
||||
assert CHAT_ERROR_MESSAGE not in output
|
||||
assert "answer" in output
|
||||
assert len(llm.prompts[0]) > max_prompt_chars
|
||||
assert all(len(prompt) <= max_prompt_chars for prompt in llm.prompts[1:])
|
||||
assert "PAPERLESS_AI_LLM_CONTEXT_SIZE" in caplog.text
|
||||
|
||||
def test_a_rejection_of_the_retry_yields_the_generic_error(
|
||||
self,
|
||||
run_chat: Callable[..., list[str]],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN a server that rejects every prompt
|
||||
WHEN a chat question is answered
|
||||
THEN the merged prompt is retried exactly once
|
||||
AND the user gets the generic error message
|
||||
"""
|
||||
llm = ScriptedLLM(max_prompt_chars=0)
|
||||
|
||||
output = run_chat(llm)
|
||||
|
||||
assert output == [CHAT_ERROR_MESSAGE]
|
||||
assert len(llm.prompts) == 2
|
||||
|
||||
def test_other_errors_are_not_retried(
|
||||
self,
|
||||
run_chat: Callable[..., list[str]],
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN an LLM that fails with something other than a bad request
|
||||
WHEN a chat question is answered
|
||||
THEN there is no retry
|
||||
AND the user gets the generic error message
|
||||
"""
|
||||
llm = ScriptedLLM(error=RuntimeError("provider is down"))
|
||||
|
||||
with caplog.at_level(logging.WARNING, logger="paperless_ai.chat"):
|
||||
output = run_chat(llm)
|
||||
|
||||
assert output == [CHAT_ERROR_MESSAGE]
|
||||
assert len(llm.prompts) == 1
|
||||
assert "PAPERLESS_AI_LLM_CONTEXT_SIZE" not in caplog.text
|
||||
|
||||
def test_a_failure_after_tokens_were_streamed_is_not_retried(
|
||||
self,
|
||||
run_chat: Callable[..., list[str]],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN an answer that has started streaming to the user
|
||||
WHEN the stream then fails with a bad request
|
||||
THEN the answer is not started over
|
||||
"""
|
||||
llm = ScriptedLLM(error=_bad_request(), tokens_before_error=1)
|
||||
|
||||
output = run_chat(llm)
|
||||
|
||||
assert output == ["partial0", CHAT_ERROR_MESSAGE]
|
||||
assert len(llm.prompts) == 1
|
||||
@@ -3,14 +3,14 @@ revision = 5
|
||||
requires-python = ">=3.11"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.15' and platform_machine == 'arm64' and platform_python_implementation == 'CPython' and sys_platform == 'darwin'",
|
||||
"python_full_version < '3.15' and platform_machine == 'arm64' and platform_python_implementation == 'CPython' and sys_platform == 'darwin'",
|
||||
"python_full_version == '3.14.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version >= '3.15' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"(python_full_version < '3.12' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
"python_full_version == '3.14.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version >= '3.15' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.14.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.14.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version < '3.15' and platform_machine == 'arm64' and platform_python_implementation == 'CPython' and sys_platform == 'darwin'",
|
||||
"(python_full_version < '3.12' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
"(python_full_version < '3.12' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
]
|
||||
supported-markers = [
|
||||
@@ -220,7 +220,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "autobahn"
|
||||
version = "26.7.1"
|
||||
version = "26.11.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "cbor2" },
|
||||
@@ -231,31 +231,31 @@ dependencies = [
|
||||
{ name = "txaio" },
|
||||
{ name = "ujson" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/de/73/f109f563c27e048e45d135d81af19e6ca391e24905550b06bd1c9d674c57/autobahn-26.7.1.tar.gz", hash = "sha256:c6949a2c6eb95fb1c218837dbda0a59abbbebafb8b11098551c01a7061dfd245", size = 14056542, upload-time = "2026-07-15T19:14:01.246Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/08/15/694ed91f8f28d8c74b424a8a80208d4f221c12ae5d2fbee4d5041cdf1d0d/autobahn-26.11.1.tar.gz", hash = "sha256:1a081ca27ad5a0a04d3c7ca07b2caa6d324b8004383e36ae6eede1d5053e23b0", size = 14334101, upload-time = "2026-11-04T02:43:25.026Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/44/8c/381cdcab8016df2177adc93d25f84ca3a5fb8f8be4f9d784336416c7bee8/autobahn-26.7.1-cp311-cp311-macosx_15_0_arm64.whl", hash = "sha256:3fe80550707f0affb5cb10f3e0f66ec7e6e52abb29edc66dd76734c2d7d51bf4", size = 1997747, upload-time = "2026-07-15T19:13:21.998Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/79/a9/9293c6c6bc8970f42c9675942de78f306e18eafa47edba52fd27f9dc71bd/autobahn-26.7.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:00fb9acd8775eaa0e272f36b76db903f10de56478f6a72f0bd07ee882ae1f2b8", size = 2082284, upload-time = "2026-07-15T19:13:23.582Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a9/ba/7396cb42a9c59df20c350ea05f75e6f25f582b474dee82b8e32823b2711e/autobahn-26.7.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:97c9674eddd55ad3ebd733824789175e5fb90c88afd523de507569ba0fcd6853", size = 2254260, upload-time = "2026-07-15T19:13:24.894Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/64/19753442770662ff45c4fe48db6345ac6fa3100fbbd989241c074e38ea6f/autobahn-26.7.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:30fa714de5c9903ef64084d3a938d8a3bac0bb42f1532d5de22f34b04a1c4819", size = 3173653, upload-time = "2026-07-15T19:13:26.261Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/04/a4/b690f272427acf1e8ea03b146e559dc67ade10dd4e0cccacc1d4c011b141/autobahn-26.7.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c3362197f3b9d5b0df7f3365bd00dedba7ee8b649d652941377abe690d1c8b14", size = 3402880, upload-time = "2026-07-15T19:13:27.683Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6e/23/0769ef39e1cfb0bec15bacdd7f407aaedfda14c0ca3f7e818b856f2ed1a1/autobahn-26.7.1-cp312-cp312-macosx_15_0_arm64.whl", hash = "sha256:6c9013e9aa9ea8a561c89d7be2709546b51fc7ac8fdf6cd71bc12a634672d9a8", size = 2000605, upload-time = "2026-07-15T19:13:30.391Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/ef/26833f38ecf3aef3ff0aa09feb12f5d472f7370104148a6b78e3c7afc286/autobahn-26.7.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:abd9ebe577dd1030f9a0c41d20dc00eca90d5cf338531abcb510d978825feeea", size = 2082844, upload-time = "2026-07-15T19:13:31.559Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b2/4c/00553ee9d57ee11df47bc9867d120cfe721a73bec0b58fb3a3b91cd7c797/autobahn-26.7.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de491baa4cf52fb6d7f542e445c72d94ce52dc7aabb47b0b4d5191e452dd2c74", size = 2254852, upload-time = "2026-07-15T19:13:32.8Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c3/ca/7884f6ffb8410882df98cb939dea24225dd79e4f091ceb59f4b826e54f2f/autobahn-26.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9723561c820ed032fe5a8f1530cb6d5f91dc595eea6009f3b2de7044a3df892a", size = 3174235, upload-time = "2026-07-15T19:13:34.134Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/e7/c6704e8f6bef3aa552a851a34908a06d91317d35ca55ec04b5db14385c33/autobahn-26.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e81c86cf41adca8a56ca5621ecd9ba40037f6d90d338c334bd529c8ac94bd7b6", size = 3403687, upload-time = "2026-07-15T19:13:35.633Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/36/92/2f6e57d9f9e6b86b9db362f58aaa6cfeadc2f3a6901ec95aab27ef232b5c/autobahn-26.7.1-cp313-cp313-macosx_15_0_arm64.whl", hash = "sha256:2ce48214b28f73338fabe0c7fd13d222cfab9e1dd2ef11660293522f64e76727", size = 1987052, upload-time = "2026-07-15T19:13:38.543Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/38/6d/f170134468e276fa9ea57eb1ae41f9cc0dcd0228e9d501f370fa50c0ee31/autobahn-26.7.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a5f285dce9b3dff3eb2ef6c818ac8ede24d96bd1edac340855170fc9825c38a9", size = 2082813, upload-time = "2026-07-15T19:13:39.686Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/ce/b735fa933e9ba4fa8c3f9aa9ae68b4e2d4aadb0a92b38ade30e37a7d4795/autobahn-26.7.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:66ab6e034e54f8c473df1a6b8031a3db46c16deebaf0c9b66db3e9137d2fab5e", size = 2254818, upload-time = "2026-07-15T19:13:40.951Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/3e/57855f4f52aa0ee64c6d8210637d0d9847de4c1082e03ddd2ffafd853d2d/autobahn-26.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:20b3eab7d483e93278f9d7345592eb6b465883a6e88c2823aad13c3f943452db", size = 682494, upload-time = "2026-07-15T19:13:42.193Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3b/3c/3944f17dd2a06aee7d0d9f1c37b5a94518434d13ba2c38e738d33ca10daf/autobahn-26.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:cd840524ff190aee695a58e8acd8740ee66b4a0e6a58ccb41416ed2cbe48d43f", size = 3403666, upload-time = "2026-07-15T19:13:43.508Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/51/3e/200471878093a502f8e8078c1ca19fd82acc68ae9ac363e395170da6dbe2/autobahn-26.7.1-cp314-cp314-macosx_15_0_arm64.whl", hash = "sha256:f3d1be925e3fb33fff5280c1bd02027047519812c400d3efa5477d3968686c94", size = 1987070, upload-time = "2026-07-15T19:13:47.112Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/61/d1/704f881fd2c52b056dc0f14e6d0d640b1f3ff43f3b84cf85d3631e3243f4/autobahn-26.7.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44f8094b0c0fa29a4963ce12130b7932469f89afa0242ff858d2b26541a81005", size = 2082939, upload-time = "2026-07-15T19:13:48.569Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a8/27/84e76aec7abbcb502d4cd34ef5c859eaa19a3b707cda68ab7ce68478dd92/autobahn-26.7.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0fcf9c3ff6b9b2bc85d6e1814a94d1d941d62f7df36d350b523d77df85d66ea", size = 2254983, upload-time = "2026-07-15T19:13:49.802Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/81/a810732a10342c5d6b90d19f83fa2bc9b6126e7c0cda7c4df867e311aa2e/autobahn-26.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:4f82e5a113f6c1ff14cec99aa411f7da8fceec3dcd4647d7ebdfc0278811e14d", size = 3174295, upload-time = "2026-07-15T19:13:51.227Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/c6/4886fdaecfeda013e085288a9d83bad6f1ded9995b8088ca933d9ec37201/autobahn-26.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:919309cbe41b28b0a3028e7c6fed52aca9fd21639619f372d3270c44341b6bdc", size = 3403713, upload-time = "2026-07-15T19:13:52.744Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/94/14/6485c29ad06a6bd7b3017558f99f6f89dcaa6ef6641930b25d9247adba4c/autobahn-26.7.1-pp311-pypy311_pp73-macosx_15_0_arm64.whl", hash = "sha256:9088acf790caf8cfd86590cb2b749279256ee210198f41d9858a38d1346e56c9", size = 1981962, upload-time = "2026-07-15T19:13:55.79Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/46/cb6d09604417beacdf485b414a05efa18511b0e78ac5451b3655bee711fa/autobahn-26.7.1-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ea4548ee15c6bdf8aa0a1e81bf47b42db350f2bef69f83bace27a95ed0d21276", size = 655967, upload-time = "2026-07-15T19:13:57.19Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/00/d9/b846bc5a37f25ac147879d6451c466968a54efbf9d0467f0732f37c6f3f3/autobahn-26.7.1-pp311-pypy311_pp73-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4ee0fe13a5218831d60863becd8c3cf6558e6c5ccc5d9d0e722012bdb1459bf", size = 2207401, upload-time = "2026-07-15T19:13:58.392Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/8d/98d31f834b05e6461567467e48abe82e46f46abc7ba0861f29e7c87856d8/autobahn-26.11.1-cp311-cp311-macosx_15_0_arm64.whl", hash = "sha256:72d28d94d67f2b472909b88b96633c3bfa9c90dc2251ead9c65d65506a58e136", size = 2032098, upload-time = "2026-11-04T02:42:30.444Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/02/a2/95eac7953c8d4ca5a9ef131a7b0c6ccf703590481b3edaec0acf35a29283/autobahn-26.11.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee562672964ccaa3c750ed5f1e8414c8e7363acc54a974c6a9f16d72f67739c8", size = 2116109, upload-time = "2026-11-04T02:42:32.579Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4c/f0/b5c1c9184d4881faabddefa770301ba4857c0cd7d321ef9e677e3fbfcf52/autobahn-26.11.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0cc9c4dd15a3a40f121d1c6132aaff7cc790e66c0ba2bac7abcea314f5af590d", size = 2288028, upload-time = "2026-11-04T02:42:34.057Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/13/65/07708474fa2bc760668b3f7ea43f3d03c19e6b322719b1d4d5026e9fdddb/autobahn-26.11.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:20dfce803b8d33e9a12c2ec8f8c3a9869aad979483c8ac75d7daadc0c551c2e9", size = 3211161, upload-time = "2026-11-04T02:42:35.917Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d2/91/3f8e9e924f8fefe46f566ceb6c4ee22cfd42036e369825f3b3516815b0f3/autobahn-26.11.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:10a3616aaa02cbaef48029090b47a4e80dc9ca51592b166c5c4352f3116cec18", size = 3438480, upload-time = "2026-11-04T02:42:37.433Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/1f/c711e1f1182ce5e9652951e8d908d669209129dba526cd14d826b921b3b4/autobahn-26.11.1-cp312-cp312-macosx_15_0_arm64.whl", hash = "sha256:afd95b43fc1a307712bb2aba52a9e60e4d08ae5b1d26a648af3bc6b0facd7dce", size = 2034959, upload-time = "2026-11-04T02:42:42.234Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ea/be/bc34ada00a6f0769ad45d6106c523b03d4048dbadd51964cf14fd50beb3b/autobahn-26.11.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:45dcecf43b246af7ee6f6e4864902780e996ffe3d11717fe90ef1352ec68d36d", size = 2116666, upload-time = "2026-11-04T02:42:43.905Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/07/e8d0fe45f45b45408428989ba3440c1981b60919309109dcfd4be28207c1/autobahn-26.11.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:65cdbacf7bdc0e2f17dc166b7bf925b8c7e23e22131fd90baa9753c50cac7ad2", size = 2288620, upload-time = "2026-11-04T02:42:45.484Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/9e/c386ddf9f609d2a67e952faa11d0ddc43d896f7abf9e60f16a3b273defed/autobahn-26.11.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:40f09407fed54bd045babb810b9ea1ccbce2d6257b26774e22ba0651e4f39872", size = 3211744, upload-time = "2026-11-04T02:42:47.178Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/50/7f326eb844af42b48862fa65c7685b98f12bf7a0255e7272a87c12b7959d/autobahn-26.11.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1d43b415f232f8de7d6b16c17b76473254fb0496d9aa48204376f224609facaa", size = 3439287, upload-time = "2026-11-04T02:42:50.023Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/55/42/17f79d049f5d4e3cf3e22576f70b4055f0aa8eeae4e7bc6924bca82ba20e/autobahn-26.11.1-cp313-cp313-macosx_15_0_arm64.whl", hash = "sha256:b891aa0887bb13ee06f15e3a04f39286c08fb60b91de40cd5037f2fcaa3186cc", size = 2034963, upload-time = "2026-11-04T02:42:55.307Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/84/c0/628863f9983b24b4a00d4d38d19bf7a265e9be71d0e6ef239b76a78bd35e/autobahn-26.11.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6f29930410be8cf63fe74ae31e6006efbacc9ae3d8e7e88471629bd88914167a", size = 2116640, upload-time = "2026-11-04T02:42:57.009Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/44/b3/dd5755cfb1c1d7adeac05e5da41752d23060bc112f17f5c00038d4a6465f/autobahn-26.11.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:880b288af815fb87f0024b1a748022e452bf91d616d0d0299c028a18c2415f06", size = 2288592, upload-time = "2026-11-04T02:42:58.696Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/71/70/268c359ceb313856565570a2b4e4b3cd532014c388dc6bfdd4acc6ef9cdc/autobahn-26.11.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a41328dc9ce471921edee1b03543bb9e8abf486f125b5b7b85c64cc11666b9e4", size = 3211711, upload-time = "2026-11-04T02:43:00.233Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4f/54/d44d32696d92bc80e01b1fb1824cf83d798cf16217b00c4c36bc9fd4bccf/autobahn-26.11.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:213260b6bbf6c2845a9fa5c39ee4601836c31c64fcc3caadc6bc7751f259dfc8", size = 3439261, upload-time = "2026-11-04T02:43:01.836Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1b/e9/64180047377d45b9427e1f7978240de2e374f12fffe3b0fdcdd61cbfbc51/autobahn-26.11.1-cp314-cp314-macosx_15_0_arm64.whl", hash = "sha256:59d2356f68773d42cdc5ff998dcc24a2541c6670ddcd046f07973ab657a4e4f4", size = 2021428, upload-time = "2026-11-04T02:43:06.392Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/46/a86efaba2fb63b350e751cd2c97c462c796a93c7e9be6a44055125faba32/autobahn-26.11.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2f8d767a2505072a0781f415461d4acc89767b9f0bc2f86cf2945d371e175379", size = 2116770, upload-time = "2026-11-04T02:43:07.96Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/95/97/d700bf925f97fd7f1b35d5abd16f0f09949df9ad746eba179d7dd05731f7/autobahn-26.11.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d52950ba232c05aa3650ba161442ad90e505ad2827576b67e7e182584732e7b9", size = 2288758, upload-time = "2026-11-04T02:43:09.507Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b1/78/4c1d1b47ae3310bee9010a72e257ab0f2dbd6acf3986e4a71af2986a40c6/autobahn-26.11.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c04fa9b8e0737cdaa927585603026e2a7af170ad2c82f8ef35c82687ed000562", size = 3211922, upload-time = "2026-11-04T02:43:11.024Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/28/74/6e055799c98cbddc56212c294b4e2bff0e0d45ca4ce9470d076691f1fb41/autobahn-26.11.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:517487fd5656ae3cc78de86b466238097e8da56ad8fcb29be68ba2c969454b37", size = 3439330, upload-time = "2026-11-04T02:43:12.8Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b0/5f/52894b3f154eb2f1e1fb591b53c4524505a699aae40e9a5d28ae79066ac9/autobahn-26.11.1-pp311-pypy311_pp73-macosx_15_0_arm64.whl", hash = "sha256:526090d42adde868da16c631457ebd0275956882423a06c03d22667e600aae62", size = 2016315, upload-time = "2026-11-04T02:43:17.485Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/29/61/1f825bc2aa736859c4e1107ea686705684bad98bdc0cb1f46857f6ff3320/autobahn-26.11.1-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b124509121731a34bc63d7e75dd6e6de4f2c7625b456644080dd5956a9b7d784", size = 690324, upload-time = "2026-11-04T02:43:19.188Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/5a/9f296ad5f8ff6063b79e18501783b4f6472e18a9143402670b442687b620/autobahn-26.11.1-pp311-pypy311_pp73-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:42159614aacc78a207280c210e3f07993b8337348954f176d827e47f73dce551", size = 2241168, upload-time = "2026-11-04T02:43:21.119Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -370,31 +370,46 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "cbor2"
|
||||
version = "5.9.0"
|
||||
version = "6.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/bd/cb/09939728be094d155b5d4ac262e39877875f5f7e36eea66beb359f647bd0/cbor2-5.9.0.tar.gz", hash = "sha256:85c7a46279ac8f226e1059275221e6b3d0e370d2bb6bd0500f9780781615bcea", size = 111231, upload-time = "2026-03-22T15:56:50.638Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/df/61/be007e3421969a4a318b486e4eaf4205872bbc1baf063ea7e679f74015cf/cbor2-6.3.0.tar.gz", hash = "sha256:fd4d6b3533e966eec3fb33ce0f17e925fc09b512500ab7770867ebec7d7d5dc1", size = 105625, upload-time = "2026-11-13T22:58:56.425Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/43/aa/317c7118b8dda4c9563125c1a12c70c5b41e36677964a49c72b1aac061ec/cbor2-5.9.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0485d3372fc832c5e16d4eb45fa1a20fc53e806e6c29a1d2b0d3e176cedd52b9", size = 70578, upload-time = "2026-03-22T15:56:03.835Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/31/43/fe29b1f897770011a5e7497f4523c2712282ee4a6cbf775ea6383fb7afb9/cbor2-5.9.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a9d6e4e0f988b0e766509a8071975a8ee99f930e14a524620bf38083106158d2", size = 268738, upload-time = "2026-03-22T15:56:05.222Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/1a/e494568f3d8aafbcdfe361df44c3bcf5cdab5183e25ea08e3d3f9fcf4075/cbor2-5.9.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5326336f633cc89dfe543c78829c16c3a6449c2c03277d1ddba99086c3323363", size = 262571, upload-time = "2026-03-22T15:56:06.411Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/2e/92acd6f87382fd44a34d9d7e85cc45372e6ba664040b72d1d9df648b25d0/cbor2-5.9.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5e702b02d42a5ace45425b595ffe70fe35aebaf9a3cdfdc2c758b6189c744422", size = 262356, upload-time = "2026-03-22T15:56:08.236Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3f/68/52c039a28688baeeb78b0be7483855e6c66ea05884a937444deede0c87b8/cbor2-5.9.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:2372d357d403e7912f104ff085950ffc82a5854d6d717f1ca1ce16a40a0ef5a7", size = 257604, upload-time = "2026-03-22T15:56:09.835Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/39/72d8a5a4b06565561ec28f4fcb41aff7bb77f51705c01f00b8254a2aca4f/cbor2-5.9.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1f223dffb1bcdd2764665f04c1152943d9daa4bc124a576cd8dee1cad4264313", size = 71223, upload-time = "2026-03-22T15:56:13.68Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/fd/7ddf3d3153b54c69c3be77172b8d9aa3a9d74f62a7fbde614d53eaeed9a4/cbor2-5.9.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ae6c706ac1d85a0b3cb3395308fd0c4d55e3202b4760773675957e93cdff45fc", size = 287865, upload-time = "2026-03-22T15:56:14.813Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/db/9d/7ede2cc42f9bb4260492e7d29d2aab781eacbbcfb09d983de1e695077199/cbor2-5.9.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4cd43d8fc374b31643b2830910f28177a606a7bc84975a62675dd3f2e320fc7b", size = 288246, upload-time = "2026-03-22T15:56:16.113Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/9d/588ebc7c5bc5843f609b05fe07be8575c7dec987735b0bbc908ac9c1264a/cbor2-5.9.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4aa07b392cc3d76fb31c08a46a226b58c320d1c172ff3073e864409ced7bc50f", size = 280214, upload-time = "2026-03-22T15:56:17.519Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f7/a1/6fc8f4b15c6a27e7fbb7966c30c2b4b18c274a3221fa2f5e6235502d34bc/cbor2-5.9.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:971d425b3a23b75953d8853d5f9911bdeefa09d759ee3b5e6b07b5ff3cbd9073", size = 282162, upload-time = "2026-03-22T15:56:18.975Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/c5/4901e21a8afe9448fd947b11e8f383903207cd6dd0800e5f5a386838de5b/cbor2-5.9.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fbb06f34aa645b4deca66643bba3d400d20c15312d1fe88d429be60c1ab50f27", size = 71284, upload-time = "2026-03-22T15:56:22.836Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1b/10/df643a381aebc3f05486de4813662bc58accb640fc3275cb276a75e89694/cbor2-5.9.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ac684fe195c39821fca70d18afbf748f728aefbfbf88456018d299e559b8cae0", size = 287682, upload-time = "2026-03-22T15:56:24.024Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/0c/8aa6b766059ae4a0ca1ec3ff96fe3823a69a7be880dba2e249f7fbe2700b/cbor2-5.9.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2a54fbb32cb828c214f7f333a707e4aec61182e7efdc06ea5d9596d3ecee624a", size = 288009, upload-time = "2026-03-22T15:56:25.305Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/74/07/6236bc25c183a9cf7e8062e5dddf9eae9b0b14ebf14a58a69fe5a1e872c6/cbor2-5.9.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4753a6d1bc71054d9179557bc65740860f185095ccb401d46637fff028a5b3ec", size = 280437, upload-time = "2026-03-22T15:56:26.479Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/0a/84328d23c3c68874ac6497edb9b1900579a1028efa54734df3f1762bbc15/cbor2-5.9.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:380e534482b843e43442b87d8777a7bf9bed20cb7526f89b780c3400f617304b", size = 282247, upload-time = "2026-03-22T15:56:28.644Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/7d/9ccc36d10ef96e6038e48046ebe1ce35a1e7814da0e1e204d09e6ef09b8d/cbor2-5.9.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:23606d31ba1368bd1b6602e3020ee88fe9523ca80e8630faf6b2fc904fd84560", size = 71500, upload-time = "2026-03-22T15:56:31.876Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/e1/a6cca2cc72e13f00030c6a649f57ae703eb2c620806ab70c40db8eab33fa/cbor2-5.9.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0322296b9d52f55880e300ba8ba09ecf644303b99b51138bbb1c0fb644fa7c3e", size = 286953, upload-time = "2026-03-22T15:56:33.292Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/3c/24cd5ef488a957d90e016f200a3aad820e4c2f85edd61c9fe4523007a1ee/cbor2-5.9.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:422817286c1d0ce947fb2f7eca9212b39bddd7231e8b452e2d2cc52f15332dba", size = 285454, upload-time = "2026-03-22T15:56:34.703Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/35/dca96818494c0ba47cdd73e8d809b27fa91f8fa0ce32a068a09237687454/cbor2-5.9.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9a4907e0c3035bb8836116854ed8e56d8aef23909d601fa59706320897ec2551", size = 279441, upload-time = "2026-03-22T15:56:35.888Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/44/d3362378b16e53cf7e535a3f5aed8476e2109068154e24e31981ef5bde9e/cbor2-5.9.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:fb7afe77f8d269e42d7c4b515c6fd14f1ccc0625379fb6829b269f493d16eddd", size = 279673, upload-time = "2026-03-22T15:56:37.08Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/ff/b83492b096fbef26e9cb62c1a4bf2d3cef579ea7b33138c6c37c4ae66f67/cbor2-5.9.0-py3-none-any.whl", hash = "sha256:27695cbd70c90b8de5c4a284642c2836449b14e2c2e07e3ffe0744cb7669a01b", size = 24627, upload-time = "2026-03-22T15:56:48.847Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/87/505bcf5577e6ba16dbcc3727415ecd9545a7ec0fe998fc29320255328b2c/cbor2-6.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:397b1c6a6709f79ab1419dfeb586042fb995c12ccfd0cb5ea9f9001d99cad690", size = 425929, upload-time = "2026-11-13T22:57:28.021Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/30/c1/937ab39ca1ed18d71ecb3d857a2db771ea654f3186b52afae3fd8e5a5c24/cbor2-6.3.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:9253098c278540523cc27b9bedaf7d1d1655d2961b2ae1e6e43fc6592240016b", size = 470340, upload-time = "2026-11-13T22:57:29.55Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/aa/fde8c2765fc91ef632b2c44a255de8f4cd7c4af6267060068f6207ff6bed/cbor2-6.3.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:ebe634e9fe6ae36b3fe1c42d280c4ecb368397efbcd497f8d5826d48e9093f1b", size = 480102, upload-time = "2026-11-13T22:57:31.068Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/15/f1/f12f74b446b39e504f154ec3b6672ee88d417dd40d2ea735a2f72ce6000f/cbor2-6.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1533d5c1949a449ebc05dd8ebb85db097e26b479fd5b1634e765e4b8e8e3bc35", size = 536812, upload-time = "2026-11-13T22:57:33.858Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bd/65/6f10cecc5c731881bd3526a8ad661f5ba53fced49fd7506d8a482ab03a96/cbor2-6.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d724f0d6e8da9c13c9462da7de0e08ab8aabebb4badac2acc42ce55fc8d9fbd5", size = 548308, upload-time = "2026-11-13T22:57:35.397Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/38/6f/82721eee6930cc5383783053161f9df48754716dfa1104234ede9a6cc41c/cbor2-6.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:89512d266cdbb80cd4fae62672824b131c5d235e97f7490afcd0d47f7ff9ae6d", size = 418302, upload-time = "2026-11-13T22:57:41.64Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/58/be854c9ee7a22e342085bb08697d60ee141e9cc294bd2856cf1025e230fd/cbor2-6.3.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:ddeafc6f7f61cca8f276c7e3d9b5631a14f70f476ca9d03d099fd70021721c7f", size = 462318, upload-time = "2026-11-13T22:57:43.064Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/4a/5885d21ec7654f1261c6af07ad4103732400013cf023394659691042fb3c/cbor2-6.3.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:4f160b662059cc30ced4436fca332f4c27d0259698a5bde8373c9c6f829aabdf", size = 473147, upload-time = "2026-11-13T22:57:44.498Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/7d/a902bcf439e25fc72b53d432d64841afcdbf063c08d435e87fb27362056d/cbor2-6.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1335ecfed5bb0df37460f7dc4d2f3ce10ae242924b2a8e529c481330784acd82", size = 529917, upload-time = "2026-11-13T22:57:45.951Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/cd/9aeaa7c45839b854ad9d86adf80a6b0bbe73cdf47d84ffbe794b93e7e06c/cbor2-6.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:68faecfbeb247594b298cc0c79ccc00f2c7ad87c19430963032fdf424e740f4d", size = 541454, upload-time = "2026-11-13T22:57:47.333Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0c/cf/1297ed2a31423792937d21eee46e9481f4e7d1939e9ff057a8a3ed32f3ab/cbor2-6.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:988cd609e31a3f88ea29cea60cc87a09d214664bf1f101477bea8db5e7b0b8c3", size = 418776, upload-time = "2026-11-13T22:57:53.205Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/56/4d/1d44118262ee8e4ee6ff1c4bbd7ae73b3b98ada515e852866bd3dd97b057/cbor2-6.3.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:07bc75c65a843b0ac4f3bb15533c993fd60c2ee934c6fc57361ae6530636c7c6", size = 462159, upload-time = "2026-11-13T22:57:54.626Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/40/56e3d8e84f29438a360c4092b40fa76bf7d28ea9ec966ced4a4004674a58/cbor2-6.3.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:5f7c4e8cb1bdc3c138d6f0beb48762ae31c00cf4abae9fbfb41e76a941f2b0db", size = 473054, upload-time = "2026-11-13T22:57:56.302Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fe/52/3c0b180551c967e926ddffb6e93fd49a85a01323655b541445fcec0558f7/cbor2-6.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:449e98b5c0ac040bab58869f2ff70873d3bc13f9deb410502ca2a071ebc81eff", size = 529696, upload-time = "2026-11-13T22:57:58.078Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/98/3d/913a59379f88b7b42634b6661c682ff1495c1129f62d1782167e63354d45/cbor2-6.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9acae7ac21cca02b67082700adcfad611622bf452de9d5376cbf71e651b2f387", size = 541692, upload-time = "2026-11-13T22:57:59.754Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/97/c5/39d987e19221b5ff1b2423965e2cb294c72b4150127d774ba6681597a6bd/cbor2-6.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:8fb13bfca5df10b9b791a3d33d031c920e6b0d1d743abffd28e926585e2c40fc", size = 420915, upload-time = "2026-11-13T22:58:05.514Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/63/7e/4418c6403a8bd88655bd06d1c453be3e923a8104a46296a1a895d054e9ab/cbor2-6.3.0-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:2aded9db2335a7396956f991d5eca77046c355a5ab586f8c718c92c375d67840", size = 465197, upload-time = "2026-11-13T22:58:07.351Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d7/76/1aa318c7e0ffa296b6576e2e54b8a96746dfda2e3ea22a7363823561e6a7/cbor2-6.3.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:f82e4f891ffd297dd9a54ba34f556917f156b1dab1527640dfc74ae4c6562cf8", size = 477917, upload-time = "2026-11-13T22:58:08.749Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/95/4c5e83d088bba588f4b1fb0a9dae8a8a43d9c0a660587e4711e45827c1e2/cbor2-6.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:541fa487422ed69b85f395dcd8bd36da138f76aa0766d65aecac64c1e6851f4c", size = 533061, upload-time = "2026-11-13T22:58:10.231Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/71/a2/72e8633a043819f6d87b403abdc443d9765ac15917fcd3b0654bd24e46ce/cbor2-6.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:184d7526837d6435ed2f7c198df1fa0ce9c1ffcadf78fe7875f6be9321e892de", size = 546170, upload-time = "2026-11-13T22:58:12.029Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/e0/6e924583b8ade953731c3e2aa210a228758fe35cacf4e14bae7978fd35ae/cbor2-6.3.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:15c2e17287bd09cb30e1c534d32d6c9ef29b9eded18ebe4e6be9634cbe306834", size = 170665, upload-time = "2026-11-13T22:58:13.555Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/62/879f7e2dd1a9dee40c8dcdcc2789d8153135afa5349b401e20cad9df6163/cbor2-6.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e27a28cad25365cd93a7e6ff0da23c9bab30ebe2942d4c0ffd05683de7c661ae", size = 419221, upload-time = "2026-11-13T22:58:19.625Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/02/90/be3ae9af1e3188c0359723fe5615bc5242a0887923b6acf76e7914de0f78/cbor2-6.3.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:1f5c0c75c287d59a2ead3a05feecea1246d9c65d7324a59abb6935bfe7df9aef", size = 461664, upload-time = "2026-11-13T22:58:21.411Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2f/28/9b71e9592207499ce9aa7485d9bad43d863ae18585b0a2bdfd7833498f44/cbor2-6.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:92995bdfbde99e43a9ac173364042e835fd2ce729ad3f229e76eeac3f56d2e07", size = 477811, upload-time = "2026-11-13T22:58:22.862Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/c2/80e04599fea2553317a88364670ffa3fc19d4bd3c8e410bb996d6d13f474/cbor2-6.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2b821cd271723248901f9796bf3c63b2b724e78482df86b4210e8eb293c01a3a", size = 529847, upload-time = "2026-11-13T22:58:24.371Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/4b/626e66e84b1698b850de90bcdca054628864c897f520d71ab4b2d84a25da/cbor2-6.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:812cf7f2d59aca474eeeb09583821e7660d490ecb3f3a75b25aef773225aff9d", size = 546054, upload-time = "2026-11-13T22:58:26.036Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/81/6ac85a76a8ca7a4a8c55dc363b8d31b046c0da30f859b8020dbe64b56aea/cbor2-6.3.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:e4e36d190fb55072640ac77dd8259c4f3adecbfe43bfc4f6e567f2eac5e0c334", size = 413826, upload-time = "2026-11-13T22:58:31.949Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/b4/b87ee7d7d7c2b8c6b54fd08d8044ae308898010905fee6b7695eadde3997/cbor2-6.3.0-cp315-cp315-manylinux_2_28_aarch64.whl", hash = "sha256:fda2b6a74f73ce4d47a0252e726f6fb2dd30cb70ba39ded74979822d7fa1e1ce", size = 456280, upload-time = "2026-11-13T22:58:33.724Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/a1/ded213b748de46e1953c01dbdb71756ad234cd0277903bcdcdd7272cc3ba/cbor2-6.3.0-cp315-cp315-manylinux_2_28_x86_64.whl", hash = "sha256:58514b189113dad4c6192babd1a157bd45f6f6fb48b478ef5fc0d2a38c085b15", size = 468874, upload-time = "2026-11-13T22:58:35.144Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f3/ab/672888d32af0915492059f975db1b4bec7a8fb709593310bdda5ce3b6bde/cbor2-6.3.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:96f54a8900a0bb263916cb2064b4cbea9ba186c8a7519964ff2c74d00a001fc1", size = 523126, upload-time = "2026-11-13T22:58:36.621Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/ce/fbea667c514caa76fe50b097c8f70f0c4380da4beb4531bb7a5681669d9b/cbor2-6.3.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:49f02de4b57a139c3e7d0d114bd2f3131845afaec01a3d21df52b5b90b996572", size = 536584, upload-time = "2026-11-13T22:58:38.032Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/32/25/09886d8f544784496beac007fe10389ccac6d2976696b5c77e69bdcb5078/cbor2-6.3.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:bc85c16bcaed3bd6446509ac45a425877146437a608e9e867d4dbf40ea95072b", size = 412482, upload-time = "2026-11-13T22:58:43.908Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c4/0c/7ab759490bacedc5363a806a2573e485c1fbc847fc7681464cf967f714be/cbor2-6.3.0-cp315-cp315t-manylinux_2_28_aarch64.whl", hash = "sha256:561284712838fe517abfce73f71dc2c72b5b38fde4a42be5f509d0d586856a23", size = 452517, upload-time = "2026-11-13T22:58:45.373Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/15/4be4373d9f712ca04e2e17a55ed3be578ce7cb81f8e8cbfff11c3e3a998e/cbor2-6.3.0-cp315-cp315t-manylinux_2_28_x86_64.whl", hash = "sha256:188953a34ccb75aa8eda79d30a030cd684b87cabc8d22b8b0b12b26eebfcd522", size = 469133, upload-time = "2026-11-13T22:58:46.793Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3a/73/a265005dfd6c3d8df5be62b91075418672e9cf2b39e5d57ca24a40e6242d/cbor2-6.3.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:76ba2594041b90c29bae8d0079f29cbb3f86133b195e71ffecf1d8b3c40cd821", size = 518654, upload-time = "2026-11-13T22:58:48.591Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2e/28/3ec6b6496219e04424104d3fc9f9b2978b009fdc5dc1494d8a5be855d25a/cbor2-6.3.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:c578dcac82e3befeb79d0dc8909ea89eed809a57dc131c4f874ce77d469fe37a", size = 536482, upload-time = "2026-11-13T22:58:50.129Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2350,7 +2365,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "nltk"
|
||||
version = "3.10.3"
|
||||
version = "3.10.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "click" },
|
||||
@@ -2359,9 +2374,9 @@ dependencies = [
|
||||
{ name = "regex" },
|
||||
{ name = "tqdm" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e0/e6/fe51d2bb1a3b446f59c5c8165999a9fee208bc346af90a7cbf7657bc0d75/nltk-3.10.3.tar.gz", hash = "sha256:bb9327a461c3811c2fa4900e03840401f2126adfb30c0072827c433bd2444ea4", size = 5137152, upload-time = "2026-08-12T23:46:37.258Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/3a/cb/bbaa9be58e95d21729c6b9194376610230e0755f6de0bf38b6acc0dce079/nltk-3.10.4.tar.gz", hash = "sha256:44679f4e9220abfd496d2c8cdb22f8425ccbe557604f9aa5cacb1c44003dabc1", size = 4300570, upload-time = "2026-10-21T11:34:35.851Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b6/6d/ebd2af4640b12168fdf0cb74b6118df2f32a2f62ec7e0c06fbfd80706639/nltk-3.10.3-py3-none-any.whl", hash = "sha256:ff9598a8e20518ee0d557745890cc4435b9578489e2dcbc69c4f81fa060caf7c", size = 1798643, upload-time = "2026-08-12T23:44:13.478Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/04/e7816813e409ca874ba2fcc35455db0e4130b79eb277e1f9edd270ca3c69/nltk-3.10.4-py3-none-any.whl", hash = "sha256:769ba5413f265b7d3e87cd163cc28efa01e29eeef8bb6080bc907949d9fcfb51", size = 1722994, upload-time = "2026-10-21T11:34:27.975Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2414,11 +2429,11 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "oauthlib"
|
||||
version = "4.0.0"
|
||||
version = "4.0.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7a/d8/a1bcc8ba112a627f8ffbdc212a78ce18d3ac07e91a5ca65d27918eee25a1/oauthlib-4.0.0.tar.gz", hash = "sha256:efb274799819440f95b4ab3b818869f1ce9ae26c5beacba0201d1a1b76b54f86", size = 187232, upload-time = "2026-09-28T06:01:18.77Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/33/17/2bb072de0b990303c985f26869fd47bb179024a051f47e7f9d208eb92f8e/oauthlib-4.0.1.tar.gz", hash = "sha256:3d73febdb6faa00f277c81fb04be7b7586fb96fc3b7f0b9c772dada69a25ede7", size = 191219, upload-time = "2026-10-31T09:52:58.008Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/f4/78229a1066068ca14fc60fb26cf7381cabe4382261392b90e5f9552722d4/oauthlib-4.0.0-py3-none-any.whl", hash = "sha256:624c28c13a0a59cabf9747dfa52af63be3e512a7f2714df16e91b5b3a145e6cd", size = 159715, upload-time = "2026-09-28T06:01:17.008Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/ef/3b8adde1b32a6f540758bff734d3442c621734c83708e5f02b0ba2f43b84/oauthlib-4.0.1-py3-none-any.whl", hash = "sha256:498a298876e996301950a5b053d12c31628bb7b895db03666430c69ce182eb61", size = 161934, upload-time = "2026-10-31T09:52:56.206Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2565,11 +2580,11 @@ mariadb = [
|
||||
]
|
||||
postgres = [
|
||||
{ name = "psycopg", extra = ["c", "pool"] },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12' or python_full_version == '3.13.*' or python_full_version >= '3.15' or sys_platform != 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_aarch64.whl" }, marker = "python_full_version == '3.12.*' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_x86_64.whl" }, marker = "python_full_version == '3.12.*' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_aarch64.whl" }, marker = "python_full_version == '3.14.*' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_x86_64.whl" }, marker = "python_full_version == '3.14.*' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12' or python_full_version == '3.13.*' or python_full_version >= '3.15' or sys_platform != 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl" }, marker = "python_full_version == '3.12.*' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_x86_64.whl" }, marker = "python_full_version == '3.12.*' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl" }, marker = "python_full_version == '3.14.*' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_x86_64.whl" }, marker = "python_full_version == '3.14.*' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-pool" },
|
||||
]
|
||||
webserver = [
|
||||
@@ -2688,12 +2703,12 @@ requires-dist = [
|
||||
{ name = "openai", specifier = ">=2.48" },
|
||||
{ name = "pathvalidate", specifier = "~=3.3.1" },
|
||||
{ name = "pdf2image", specifier = "~=1.17.0" },
|
||||
{ name = "psycopg", extras = ["c", "pool"], marker = "extra == 'postgres'", specifier = "==3.3.4" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.12.*' and platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_aarch64.whl" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.14.*' and platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_aarch64.whl" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.12.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_x86_64.whl" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.14.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_x86_64.whl" },
|
||||
{ name = "psycopg-c", marker = "(python_full_version < '3.12' and extra == 'postgres') or (python_full_version == '3.13.*' and extra == 'postgres') or (python_full_version >= '3.15' and extra == 'postgres') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'postgres') or (sys_platform != 'linux' and extra == 'postgres')", specifier = "==3.3.4" },
|
||||
{ name = "psycopg", extras = ["c", "pool"], marker = "extra == 'postgres'", specifier = "==3.3.8" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.12.*' and platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.14.*' and platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.12.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_x86_64.whl" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.14.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_x86_64.whl" },
|
||||
{ name = "psycopg-c", marker = "(python_full_version < '3.12' and extra == 'postgres') or (python_full_version == '3.13.*' and extra == 'postgres') or (python_full_version >= '3.15' and extra == 'postgres') or (platform_machine != 'aarch64' and platform_machine != 'x86_64' and extra == 'postgres') or (sys_platform != 'linux' and extra == 'postgres')", specifier = "==3.3.8" },
|
||||
{ name = "psycopg-pool", marker = "extra == 'postgres'", specifier = "==3.3.3" },
|
||||
{ name = "python-dateutil", specifier = "~=2.9.0" },
|
||||
{ name = "python-dotenv", specifier = "~=1.2.1" },
|
||||
@@ -3079,23 +3094,23 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "psycopg"
|
||||
version = "3.3.4"
|
||||
version = "3.3.8"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/db/2f/cb91e5502ec9de1de6f1b76cfbf69531932725361168bb06963620c77e2e/psycopg-3.3.4.tar.gz", hash = "sha256:e21207764952cff81b6b8bdacad9a3939f2793367fdac2987b3aac36a651b5bc", size = 165799, upload-time = "2026-05-01T23:31:55.179Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/11/c8/3bd7e09770a5829eb26667df5e49f084d78bd106d5949ade9447288a8e18/psycopg-3.3.8.tar.gz", hash = "sha256:86c135a9a6f5e98404975c5787e620bf436a7807e088baebd1b20fa48d3b4b4f", size = 168902, upload-time = "2026-11-04T09:44:26.142Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/5c/e0/7b3dee031daae7743609ce3c746565d4a3ed7c2c186479eb48e34e838c64/psycopg-3.3.4-py3-none-any.whl", hash = "sha256:b6bbc25ccf05c8fad3b061d9db2ef0909a555171b84b07f29458a447253d679a", size = 213001, upload-time = "2026-05-01T23:20:50.816Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7b/5c/50a0b0796ccb69b11934f7c5758051c08019bda2fafb417501109fffd569/psycopg-3.3.8-py3-none-any.whl", hash = "sha256:ca50af6072ba9ea6866f33021975230c2555d7bfdb9d8f94ca3af5c3d1bf2167", size = 216209, upload-time = "2026-11-04T09:37:35.491Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
c = [
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.12' and implementation_name != 'pypy') or (python_full_version == '3.13.*' and implementation_name != 'pypy') or (python_full_version >= '3.15' and implementation_name != 'pypy') or (implementation_name != 'pypy' and sys_platform != 'linux')" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_aarch64.whl" }, marker = "python_full_version == '3.12.*' and implementation_name != 'pypy' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_x86_64.whl" }, marker = "python_full_version == '3.12.*' and implementation_name != 'pypy' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_aarch64.whl" }, marker = "python_full_version == '3.14.*' and implementation_name != 'pypy' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.4", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_x86_64.whl" }, marker = "python_full_version == '3.14.*' and implementation_name != 'pypy' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.12' and implementation_name != 'pypy') or (python_full_version == '3.13.*' and implementation_name != 'pypy') or (python_full_version >= '3.15' and implementation_name != 'pypy') or (implementation_name != 'pypy' and sys_platform != 'linux')" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl" }, marker = "python_full_version == '3.12.*' and implementation_name != 'pypy' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_x86_64.whl" }, marker = "python_full_version == '3.12.*' and implementation_name != 'pypy' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl" }, marker = "python_full_version == '3.14.*' and implementation_name != 'pypy' and platform_machine != 'x86_64' and sys_platform == 'linux'" },
|
||||
{ name = "psycopg-c", version = "3.3.8", source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_x86_64.whl" }, marker = "python_full_version == '3.14.*' and implementation_name != 'pypy' and platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||
]
|
||||
pool = [
|
||||
{ name = "psycopg-pool" },
|
||||
@@ -3103,60 +3118,60 @@ pool = [
|
||||
|
||||
[[package]]
|
||||
name = "psycopg-c"
|
||||
version = "3.3.4"
|
||||
version = "3.3.8"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.15' and platform_machine == 'arm64' and platform_python_implementation == 'CPython' and sys_platform == 'darwin'",
|
||||
"python_full_version < '3.15' and platform_machine == 'arm64' and platform_python_implementation == 'CPython' and sys_platform == 'darwin'",
|
||||
"python_full_version >= '3.15' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"(python_full_version < '3.12' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
"python_full_version >= '3.15' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version < '3.15' and platform_machine == 'arm64' and platform_python_implementation == 'CPython' and sys_platform == 'darwin'",
|
||||
"(python_full_version < '3.12' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
"(python_full_version < '3.12' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/21/7c/c08364f2eab2913e4068b3b955d963e7a3491986a85429990969525def30/psycopg_c-3.3.4.tar.gz", hash = "sha256:ed8106128b2d04359c185fc9641b4409abfce4d0b6fb1d1ff6800646e27f1a22", size = 647111, upload-time = "2026-05-01T23:31:58.032Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/5b/23/0074f50899d773aae857af496745cd898da868f8f2d9415591d51c391cec/psycopg_c-3.3.8.tar.gz", hash = "sha256:af81a99b02600e6c2cdf468509c04bb8208500ea60d63f70616e32ea9cb2758f", size = 700571, upload-time = "2026-11-04T09:44:27.694Z" }
|
||||
|
||||
[[package]]
|
||||
name = "psycopg-c"
|
||||
version = "3.3.4"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_aarch64.whl" }
|
||||
version = "3.3.8"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl" }
|
||||
resolution-markers = [
|
||||
"python_full_version == '3.12.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_aarch64.whl", hash = "sha256:44ea0e800dc2126a0d3ce23fac7b96b64db132ed67df3e9ceb011965351ae8dc" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl", hash = "sha256:be9f81019ec26eb09b8852ec9cb156a41d91067bbc2093cee93daabc935068e8" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg-c"
|
||||
version = "3.3.4"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_x86_64.whl" }
|
||||
version = "3.3.8"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_x86_64.whl" }
|
||||
resolution-markers = [
|
||||
"python_full_version == '3.12.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp312-cp312-linux_x86_64.whl", hash = "sha256:c66169fef7be6b46e701dd361036bd88e346e6b8b15dd25528287f807654f097" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_x86_64.whl", hash = "sha256:72a24b31600ec991cb75852038de012054b6031b355c95ccfc38680e439559cc" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg-c"
|
||||
version = "3.3.4"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_aarch64.whl" }
|
||||
version = "3.3.8"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl" }
|
||||
resolution-markers = [
|
||||
"python_full_version == '3.14.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_aarch64.whl", hash = "sha256:00d1cc7b82899046acd68e11c801bbb94d109313ab02333f76c2b59dd531cdc1" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl", hash = "sha256:dc22c1b4eeee9a2a5e20a8ffbd192e320a2da6fdef5a72f7fa76ed9792de4353" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg-c"
|
||||
version = "3.3.4"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_x86_64.whl" }
|
||||
version = "3.3.8"
|
||||
source = { url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_x86_64.whl" }
|
||||
resolution-markers = [
|
||||
"python_full_version == '3.14.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.4/psycopg_c-3.3.4-cp314-cp314-linux_x86_64.whl", hash = "sha256:d02a564c6a3e2c1957b3b5d2dff77e34a274f8551f6bdbcef47523eba59a627a" },
|
||||
{ url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_x86_64.whl", hash = "sha256:d6298166033ad1024d2ba6d0805352ba7042ccd7619771a0c164d1e370cf7976" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3173,11 +3188,11 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "pyasn1"
|
||||
version = "0.6.4"
|
||||
version = "0.6.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a4/9a/23310166d960def5897e91fe20e5b724601b02a22e84ba1f94232c0b7f67/pyasn1-0.6.4.tar.gz", hash = "sha256:9c447d8431c947fe4c8febc4ed9e760bc29011a5b01e5c74b67025bd9fb8ce81", size = 151262, upload-time = "2026-07-09T01:12:33.988Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/88/7e/3c0da41061a2021cac7cd524fd57092adbe5b515e8bf9005702e366802e2/pyasn1-0.6.5.tar.gz", hash = "sha256:6b11616a6bcf3a40e635f082bb232fa57b5e0dd7f517bd7ddd69ec3794508a47", size = 155152, upload-time = "2026-10-27T06:32:49.125Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9a/3b/6163796d69c3977d1e4287bea4a6979161cbbdd170ebb430511e8e1999ce/pyasn1-0.6.4-py3-none-any.whl", hash = "sha256:deda9277cfd454080ec40b207fb6df82206a3a2688735233cdcd8d3d565f088b", size = 84410, upload-time = "2026-07-09T01:12:32.92Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/1f/3eefd5c84c35cae44549ce1c7f7e58f7945b34f5a6bce07a135438522073/pyasn1-0.6.5-py3-none-any.whl", hash = "sha256:4017b0fce125096b8573b39c989fdb1a4b19cf761e683398184550fea0e66587", size = 84807, upload-time = "2026-10-27T06:32:48.045Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4362,13 +4377,13 @@ name = "torch"
|
||||
version = "2.14.0+cpu"
|
||||
source = { registry = "https://download.pytorch.org/whl/cpu" }
|
||||
resolution-markers = [
|
||||
"python_full_version == '3.14.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version >= '3.15' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"(python_full_version < '3.12' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
"python_full_version == '3.14.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version >= '3.15' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.14.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.14.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"python_full_version == '3.12.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
|
||||
"(python_full_version < '3.12' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
"(python_full_version < '3.12' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version == '3.13.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux')",
|
||||
]
|
||||
dependencies = [
|
||||
@@ -4399,15 +4414,25 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "tornado"
|
||||
version = "6.5.9"
|
||||
version = "6.6.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/22/15/ca7aaebb77f850493cba71ace508aeffb896d1ad8976417b48b79823dbd2/tornado-6.5.9.tar.gz", hash = "sha256:4d868544ebdf2fc155239a74397f65ebfea9b4d3635296c96b5dfb0701c354f5", size = 536145, upload-time = "2026-09-14T18:08:37.434Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/64/2b/8ff2b41620cbba0eeb0862fed21dcaa5a2ad36c6dd9bb465f9ff7a147be2/tornado-6.6.1.tar.gz", hash = "sha256:28e6311402af59c8b02e3fa0f5e7d8eb465b25081381803b127d97e6a4395d5a", size = 623388, upload-time = "2026-11-09T21:09:22.71Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/4a/4d3459fd2f360dd99233f69f22b36012a42856ace526da2c6da3cb0e6df2/tornado-6.5.9-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:dea3bee433b73d6312d993ce89ad5f2b8d3ed9fde56e79ba5342b9edb78d342a", size = 464279, upload-time = "2026-09-14T18:08:20.909Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/0f/38f8d16011de3b1ce2babb4c3bcefb126d2dc47d04878ae3ad5c39a00caa/tornado-6.5.9-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0cc0876a58eee9143476f24901b1b8eb4d52443283ade2b6bca650dd1da04f84", size = 465496, upload-time = "2026-09-14T18:08:24.407Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/e9/3888f265d1e287fc63cd61a6696f96a650024e32f9e89c0b1817ac5c40f4/tornado-6.5.9-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dc0d703cc7ec92b47ebfe236c97cd765c1f2e45744a2e156e6677e54c948274d", size = 466468, upload-time = "2026-09-14T18:08:25.928Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/8b/d2bcf417981fa6f7698ab84a52394a76cf608e6704d266e2e0e29f1fd9d0/tornado-6.5.9-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:93f9ab0226ef625b94cacb7981a5af104f1735ea02f92282abe5c389109fb31d", size = 466303, upload-time = "2026-09-14T18:08:27.566Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/a5/c5cfab11420c3f908238a6c861b8f3864fdbd2b2b87e30c9c16f36a11512/tornado-6.5.9-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:5801bbf94dfde8d21087b6aa0b17f3a5dab6110dfe44e7e4492df5de393ac15b", size = 465706, upload-time = "2026-09-14T18:08:29.182Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/77/d3/ef3a4d38d1a72c52ad07483ed760dbb93027d28f19c3a2d98148abdd63e1/tornado-6.6.1-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:a8d3e6acde5a80d13b13b5e4c7c226ca682f31d0a62b6c33cea038714bc2de1b", size = 533249, upload-time = "2026-11-09T21:08:22.475Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/38/4d/c65ea949a3cdc185f1afac8c337074d4f2d029b48293d2db4d2c3dea4849/tornado-6.6.1-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1b6ff57cc69b339f8feb9e7b567b0e0eacb16bfaf234159496623ef7a67ba640", size = 534470, upload-time = "2026-11-09T21:08:24.27Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/ff/20911f85dd399b56761496e8138810e8608ea25f0912377f4205d52af853/tornado-6.6.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:da6ce2da215810d56539fa6cac77d9e27f4d8139c6868c53436b2fe933f43c79", size = 535446, upload-time = "2026-11-09T21:08:25.625Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/bb/b733df2d487a78283080663bd6d96955121b58b6d445d9cb832607da9786/tornado-6.6.1-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:b62fded687e55acaf9e36c1230b006066a35b3f6df093ba1fd3b2ff592070e1d", size = 535289, upload-time = "2026-11-09T21:08:31.692Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/11/b5107ac6a278387635d73d283e7ab5a5c76fb8ccf402efa57006ea25852f/tornado-6.6.1-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6596f3e939962f13099ce8d1a96b83226e908ca369b193370a6efa84585a1601", size = 534676, upload-time = "2026-11-09T21:08:37.209Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/de/cfeae9e75c144ca22018ee3b858e343c1658d6edd2184f35d810ec1ef789/tornado-6.6.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:ed0bc5a1a9f6346e7bdadc106fa2d4c6e79d71d8b2df4366260ab3baf36a8399", size = 533356, upload-time = "2026-11-09T21:08:42.603Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/d8/7812a729c797fb8c15748c9a69faeaaa13630075cf9b76ba9f7fbcfb7f42/tornado-6.6.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:54c80f9bed0bf1533ecf5a90dc59651645622d62b0bcffa2692d108a1f794917", size = 537511, upload-time = "2026-11-09T21:08:43.84Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/47/ebef304487feea6d8efb6a7d2642964ecb1f5cc785f687628e1d7cac4326/tornado-6.6.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb67ba2cbf598e842f14684eab029a5a4ba7ab587e8c4e40940a77ed0596b31e", size = 538566, upload-time = "2026-11-09T21:08:45.203Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/95/66/78e7583ce69f66e5177c65988a98373be2ab25c1d22405d274e037acbc58/tornado-6.6.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ce5a18654f5d56d11400ab5d87103660e14deceab41818a06a42acc8dbbe427d", size = 538295, upload-time = "2026-11-09T21:08:51.221Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/5d/421168e62c8b80e3ef88f80d642e9a7e5b1d0c6e8cd136d99064f663951c/tornado-6.6.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:fbaa022a49a27b65668592cf43b898ff3978cbe4e6926fdfe24dbef59053bd26", size = 537632, upload-time = "2026-11-09T21:08:57.797Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/8b/96e460653f3e2ad83d70328414394132d73d5655047c692ce7b69ae2f6c0/tornado-6.6.1-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:01dc73e3697eb94d78c42e03931ab621da97d12fdfb6339e64ff5a934b220fcf", size = 533376, upload-time = "2026-11-09T21:09:03.097Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/1e/644bace0700e533235f01ffa68a7b5e3d6cc9eb7380e3929039d04b648b9/tornado-6.6.1-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95bd4751357bef52aa655e236b9667ff054885de4b118e4ce9ba5c06e12ef5d0", size = 537696, upload-time = "2026-11-09T21:09:04.519Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/0a/afccc23d1ed71bcb1ce4a5b6e0f61f82c7a0b275f3b377ee7aee6680a565/tornado-6.6.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:29bce3190c2973fcd2171c95eeab8bf06d2f7a7eb107455ce3e4662c704aecdb", size = 538796, upload-time = "2026-11-09T21:09:05.956Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/c7/e27f2a21e05d7c5aa9886db7368436e6436880b85349072988b4f62422e3/tornado-6.6.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:872249311539281c1e8a5d8d6f27f478bf705a9bd931bf374b6b31b05177dfda", size = 538491, upload-time = "2026-11-09T21:09:11.968Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/43/a37ec29b0f98c3c639da495e1d547d6c44c69a6727b9864cf149bf346433/tornado-6.6.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:a72f70b1aa630fa2106d39a025e2be75c272b7ec8233da94e2f407ea754cc32d", size = 537809, upload-time = "2026-11-09T21:09:17.265Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4490,7 +4515,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "twisted"
|
||||
version = "26.4.0"
|
||||
version = "26.10.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
@@ -4501,9 +4526,9 @@ dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "zope-interface" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/db/97/6e9beb1e78247ae6dc34114f27d538cf2cb183c4afcd3609dfdf2b0439c8/twisted-26.4.0.tar.gz", hash = "sha256:dbfd0fe1ee409d0243fdd7a6a6ff14f4948cec1fd78e0376291f805e1501fae9", size = 3575095, upload-time = "2026-05-11T11:24:51.861Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/fe/31/a5f99ae7f1550914b0702b8f78118d95a79da20525d26fbc1b2ab42bc8ae/twisted-26.10.0.tar.gz", hash = "sha256:5f0355403e507fc23ceea85e9dbb4bc59335aabde41dd324e8b8cea180dd38de", size = 3603405, upload-time = "2026-10-30T09:24:56.871Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/57/bcf4e2370dd218c9aa68a9140a65d86729c73f1d529f7e94786c2766fc72/twisted-26.4.0-py3-none-any.whl", hash = "sha256:dc25ea0ebf6511c24f03232ee9f4afa54b291c5d897990e3a39cc4d14a1ef4c0", size = 3230362, upload-time = "2026-05-11T11:24:49.5Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/93/fdfa79229fdc19a6542086d46b5c5d424ee62a6408d25657e8690e0a745f/twisted-26.10.0-py3-none-any.whl", hash = "sha256:3732f42af218925a0fe78d6668db55853f7fb532245a89a2669babe7d3000fa8", size = 3251703, upload-time = "2026-10-30T09:24:53.864Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
|
||||
Reference in new issue
Block a user