@homeflare/alchemy 0.24.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/linux/fake-linux-host.d.ts.map +1 -1
- package/dist/linux/fake-systemd.d.ts +15 -0
- package/dist/linux/fake-systemd.d.ts.map +1 -1
- package/dist/linux/index.js +18 -7
- package/dist/linux/index.js.map +5 -5
- package/dist/linux/unit-form.d.ts +41 -0
- package/dist/linux/unit-form.d.ts.map +1 -1
- package/dist/linux/unit-lifecycle.d.ts.map +1 -1
- package/dist/linux/unit-settle.d.ts.map +1 -1
- package/dist/paperless/client.d.ts +37 -0
- package/dist/paperless/client.d.ts.map +1 -0
- package/dist/paperless/constraint-guard.d.ts +19 -0
- package/dist/paperless/constraint-guard.d.ts.map +1 -0
- package/dist/paperless/constraints.d.ts +50 -0
- package/dist/paperless/constraints.d.ts.map +1 -0
- package/dist/paperless/credentials.d.ts +40 -0
- package/dist/paperless/credentials.d.ts.map +1 -0
- package/dist/paperless/custom-field.d.ts +75 -0
- package/dist/paperless/custom-field.d.ts.map +1 -0
- package/dist/paperless/document-type.d.ts +30 -0
- package/dist/paperless/document-type.d.ts.map +1 -0
- package/dist/paperless/errors.d.ts +49 -0
- package/dist/paperless/errors.d.ts.map +1 -0
- package/dist/paperless/fake-paperless.d.ts +39 -0
- package/dist/paperless/fake-paperless.d.ts.map +1 -0
- package/dist/paperless/generated/constraints/index.d.ts +13 -0
- package/dist/paperless/generated/constraints/index.d.ts.map +1 -0
- package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts +21 -0
- package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts.map +1 -0
- package/dist/paperless/generated/constraints/paperless-document_types.d.ts +21 -0
- package/dist/paperless/generated/constraints/paperless-document_types.d.ts.map +1 -0
- package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts +21 -0
- package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts.map +1 -0
- package/dist/paperless/generated/constraints/paperless-tags.d.ts +21 -0
- package/dist/paperless/generated/constraints/paperless-tags.d.ts.map +1 -0
- package/dist/paperless/generated/types/custom-fields.d.ts +23 -0
- package/dist/paperless/generated/types/custom-fields.d.ts.map +1 -0
- package/dist/paperless/generated/types/document-types.d.ts +39 -0
- package/dist/paperless/generated/types/document-types.d.ts.map +1 -0
- package/dist/paperless/generated/types/index.d.ts +10 -0
- package/dist/paperless/generated/types/index.d.ts.map +1 -0
- package/dist/paperless/generated/types/storage-paths.d.ts +31 -0
- package/dist/paperless/generated/types/storage-paths.d.ts.map +1 -0
- package/dist/paperless/generated/types/tags.d.ts +37 -0
- package/dist/paperless/generated/types/tags.d.ts.map +1 -0
- package/dist/paperless/index.d.ts +19 -0
- package/dist/paperless/index.d.ts.map +1 -0
- package/dist/paperless/index.js +524 -0
- package/dist/paperless/index.js.map +26 -0
- package/dist/paperless/matching-locate.d.ts +33 -0
- package/dist/paperless/matching-locate.d.ts.map +1 -0
- package/dist/paperless/matching-types.d.ts +60 -0
- package/dist/paperless/matching-types.d.ts.map +1 -0
- package/dist/paperless/matching.d.ts +61 -0
- package/dist/paperless/matching.d.ts.map +1 -0
- package/dist/paperless/providers.d.ts +15 -0
- package/dist/paperless/providers.d.ts.map +1 -0
- package/dist/paperless/storage-path.d.ts +32 -0
- package/dist/paperless/storage-path.d.ts.map +1 -0
- package/dist/paperless/tag.d.ts +47 -0
- package/dist/paperless/tag.d.ts.map +1 -0
- package/docs/linux-host.md +2 -0
- package/docs/paperless.md +115 -0
- package/package.json +5 -1
- package/src/linux/fake-linux-host.ts +2 -0
- package/src/linux/fake-systemd.ts +36 -2
- package/src/linux/unit-activating.test.ts +164 -0
- package/src/linux/unit-form.ts +51 -0
- package/src/linux/unit-lifecycle.ts +9 -2
- package/src/linux/unit-settle.ts +8 -4
- package/src/paperless/client.ts +88 -0
- package/src/paperless/constraint-guard.ts +50 -0
- package/src/paperless/constraints.test.ts +74 -0
- package/src/paperless/constraints.ts +111 -0
- package/src/paperless/credentials.ts +69 -0
- package/src/paperless/custom-field.test.ts +74 -0
- package/src/paperless/custom-field.ts +95 -0
- package/src/paperless/document-type.ts +74 -0
- package/src/paperless/errors.ts +62 -0
- package/src/paperless/fake-paperless.ts +156 -0
- package/src/paperless/generated/constraints/index.ts +23 -0
- package/src/paperless/generated/constraints/paperless-custom_fields.ts +29 -0
- package/src/paperless/generated/constraints/paperless-document_types.ts +32 -0
- package/src/paperless/generated/constraints/paperless-storage_paths.ts +34 -0
- package/src/paperless/generated/constraints/paperless-tags.ts +34 -0
- package/src/paperless/generated/types/custom-fields.ts +23 -0
- package/src/paperless/generated/types/document-types.ts +30 -0
- package/src/paperless/generated/types/index.ts +9 -0
- package/src/paperless/generated/types/storage-paths.ts +31 -0
- package/src/paperless/generated/types/tags.ts +37 -0
- package/src/paperless/index.ts +56 -0
- package/src/paperless/matching-identity.test.ts +194 -0
- package/src/paperless/matching-locate.ts +104 -0
- package/src/paperless/matching-types.ts +61 -0
- package/src/paperless/matching.test.ts +128 -0
- package/src/paperless/matching.ts +239 -0
- package/src/paperless/providers.ts +27 -0
- package/src/paperless/storage-path.ts +78 -0
- package/src/paperless/tag.ts +91 -0
|
@@ -62,6 +62,47 @@ export declare const UNIT_WRITE: {
|
|
|
62
62
|
export declare const digestOf: (text: string) => string;
|
|
63
63
|
/** The digests of everything outside the unit file that should restart it, as one value. */
|
|
64
64
|
export declare const configDigest: (restartOn: readonly string[] | undefined) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Whether `activeState`/`subState` count as "the unit is running" against a declared `started` —
|
|
67
|
+
* the ONE place this decision is made, so `diffUnit` (unit-lifecycle.ts) and `settle`
|
|
68
|
+
* (unit-settle.ts) can never disagree about it.
|
|
69
|
+
*
|
|
70
|
+
* ⛔ WHY THIS EXISTS: a `Type=oneshot` service driven by a `.timer` (no `[Install]`, declared
|
|
71
|
+
* `started: false, enabled: false` — its timer starts it, not this resource) reports
|
|
72
|
+
* `ActiveState=activating` for the run's whole duration, not an instant. Written for the PVE
|
|
73
|
+
* node-check unit that first hit this: ~1.2s, every 60s. A plan taken mid-run must not read that
|
|
74
|
+
* run as drift, and a deploy must not `systemctl stop` a check that is already in flight.
|
|
75
|
+
* ★ systemd.service(5) §`Type=`, `oneshot` (man7.org mirror, read 2026-09-23): with no
|
|
76
|
+
* `RemainAfterExit=`, the service manager holds the unit `activating` for as long as
|
|
77
|
+
* `ExecStart=` runs, then moves it straight to `dead`/`inactive` (or `failed`) — it never passes
|
|
78
|
+
* through `active`. So for `started: false`, `activating` is exactly a run in progress, and
|
|
79
|
+
* `active` is the one state a oneshot never reaches on its own: that is the drift, and the only
|
|
80
|
+
* thing settle stops.
|
|
81
|
+
* ⛔ CRASH-LOOP GUARD, added on adversarial review: `ActiveState=activating` is not only "starting
|
|
82
|
+
* for the first time" — a service with `Restart=` waiting out its `RestartSec=` backoff between
|
|
83
|
+
* crash attempts is ALSO `activating`, with `SubState=auto-restart` (or `auto-restart-queued`).
|
|
84
|
+
* A unit declared `started: false` that is crash-looping sits there for nearly all of its
|
|
85
|
+
* wall-clock time. Without this guard the oneshot exemption above would read that loop as
|
|
86
|
+
* converged forever, and a deploy would never again issue the `stop` that ends it — silently
|
|
87
|
+
* defeating `started: false` on exactly the unit that most needs it enforced. So only a genuine
|
|
88
|
+
* start (`SubState` anything else — `start`, `start-pre`, `start-post`, …) gets the exemption;
|
|
89
|
+
* an auto-restart substate counts as running regardless of `started`, same as `active` does.
|
|
90
|
+
* ★ SOURCE, not measured against a live host: systemd's own `service.c`
|
|
91
|
+
* `state_translation_table` (github.com/systemd/systemd, read 2026-09-23) maps both
|
|
92
|
+
* `SERVICE_AUTO_RESTART` and `SERVICE_AUTO_RESTART_QUEUED` to `UNIT_ACTIVATING`, and
|
|
93
|
+
* `unit-def.c`'s `service_state_table` names their `SubState` strings `"auto-restart"` and
|
|
94
|
+
* `"auto-restart-queued"`. ⚠️ REASONED NOT MEASURED: no unit was actually crash-looped and read
|
|
95
|
+
* back with `systemctl show` for this change — the systemd source is the citation, unlike
|
|
96
|
+
* systemctl.ts's own header, which is a live-host trace.
|
|
97
|
+
* ⚠️ THE TRADE-OFF THIS ACCEPTS: a `Type=notify` (or other long-running type) unit stuck in a
|
|
98
|
+
* genuine `activating`/`start` with `started: false` — never reaching `active` and never
|
|
99
|
+
* crash-looping either — reads as converged, not drift, until it reaches `active`. A unit hung
|
|
100
|
+
* like that is exactly the case a human should look at, not one this predicate auto-corrects by
|
|
101
|
+
* stopping it out from under whatever else depends on it.
|
|
102
|
+
* ★ `started: true` (the default, when omitted) is unchanged: `active` or `activating` (any
|
|
103
|
+
* `subState`) both count as running, so a start already in flight is never started twice.
|
|
104
|
+
*/
|
|
105
|
+
export declare const isUnitRunning: (activeState: string, subState: string | undefined, started: boolean) => boolean;
|
|
65
106
|
/** Sections → an INI unit file. ★ Keys and values pass through untouched; see the file header. */
|
|
66
107
|
export declare const renderUnit: (sections: readonly UnitSection[]) => string;
|
|
67
108
|
export declare const unitText: (props: SystemdUnitProps) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-form.d.ts","sourceRoot":"","sources":["../../src/linux/unit-form.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,WAAW,GAAG;IACxB,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CACpE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAClC,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,YAClC,qBAAqB,EACrB,qBAAqB,EACrB,+BAA+B,EAC/B,yBAAyB,EACzB,qBAAqB,CACb,CAAC;AAEX,mGAAmG;AACnG,eAAO,MAAM,UAAU;aAAK,GAAG,EAAE,CAAC;aAAE,IAAI,EAAE,GAAK;aAAE,GAAG,EAAE,CAAC;CAAW,CAAC;AAEnE,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,MAAmD,CAAC;AAE5F,4FAA4F;AAC5F,eAAO,MAAM,YAAY,cAAe,SAAS,MAAM,EAAE,GAAG,SAAS,KAAG,MAChC,CAAC;AAEzC,kGAAkG;AAClG,eAAO,MAAM,UAAU,aAAc,SAAS,WAAW,EAAE,KAAG,MAKzC,CAAC;AAEtB,eAAO,MAAM,QAAQ,UAAW,gBAAgB,KAAG,MACA,CAAC;AAEpD,eAAO,MAAM,WAAW,UAAW,gBAAgB,KAAG,MACQ,CAAC;AAoB/D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,UAAW,gBAAgB,WAAW,MAAM,KAAG,MAAM,EAmC7E,CAAC"}
|
|
1
|
+
{"version":3,"file":"unit-form.d.ts","sourceRoot":"","sources":["../../src/linux/unit-form.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,WAAW,GAAG;IACxB,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CACpE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAClC,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,YAClC,qBAAqB,EACrB,qBAAqB,EACrB,+BAA+B,EAC/B,yBAAyB,EACzB,qBAAqB,CACb,CAAC;AAEX,mGAAmG;AACnG,eAAO,MAAM,UAAU;aAAK,GAAG,EAAE,CAAC;aAAE,IAAI,EAAE,GAAK;aAAE,GAAG,EAAE,CAAC;CAAW,CAAC;AAEnE,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,MAAmD,CAAC;AAE5F,4FAA4F;AAC5F,eAAO,MAAM,YAAY,cAAe,SAAS,MAAM,EAAE,GAAG,SAAS,KAAG,MAChC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,aAAa,gBACX,MAAM,YACT,MAAM,GAAG,SAAS,WACnB,OAAO,KACf,OAKF,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,UAAU,aAAc,SAAS,WAAW,EAAE,KAAG,MAKzC,CAAC;AAEtB,eAAO,MAAM,QAAQ,UAAW,gBAAgB,KAAG,MACA,CAAC;AAEpD,eAAO,MAAM,WAAW,UAAW,gBAAgB,KAAG,MACQ,CAAC;AAoB/D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,UAAW,gBAAgB,WAAW,MAAM,KAAG,MAAM,EAmC7E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-lifecycle.d.ts","sourceRoot":"","sources":["../../src/linux/unit-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"unit-lifecycle.d.ts","sourceRoot":"","sources":["../../src/linux/unit-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAOtB,MAAM,gBAAgB,CAAC;AAOxB,oGAAoG;AACpG,eAAO,MAAM,QAAQ,WACX,UAAU,SACX,gBAAgB,KACtB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAK3C,CAAC;AAEF,eAAO,MAAM,QAAQ,WACX,UAAU,QACZ,gBAAgB,UACd,qBAAqB,WACpB,MAAM,KACd,OAAO,CAAC,IAAI,CAkCd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,WAChB,UAAU,SACX,gBAAgB,UACf,qBAAqB,GAAG,SAAS,4BAEhC,MAAM,KACd,OAAO,CAAC,qBAAqB,CAqD/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,WACb,UAAU,UACV,qBAAqB,KAC5B,OAAO,CAAC,IAAI,CAed,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-settle.d.ts","sourceRoot":"","sources":["../../src/linux/unit-settle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"unit-settle.d.ts","sourceRoot":"","sources":["../../src/linux/unit-settle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAItB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,UAAU,EAQhB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,MAAM,SAAU,MAAM,WAAW,MAAM,KAAG,KACR,CAAC;AAEhD,eAAO,MAAM,YAAY,UAChB,gBAAgB,cACX,MAAM,UACV,UAAU,KACjB,qBAUD,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IACxC,mFAAmF;IACnF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM,WACT,UAAU,SACX,gBAAgB,QACjB,MAAM,KACX,OAAO,CAAC,qBAAqB,CA8C/B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One authenticated call to the Paperless-ngx REST API at `/api`.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ `Authorization: Token <value>`, NOT `Bearer`. Paperless-ngx's `securitySchemes.tokenAuth`
|
|
5
|
+
* (the v3.1.1 served schema) states the "Token" prefix explicitly — the same DRF
|
|
6
|
+
* `TokenAuthentication` NetBox uses (netbox/client.ts), a different vendor, same convention.
|
|
7
|
+
*
|
|
8
|
+
* ⛔ `Accept: application/json; version=10` ON EVERY CALL. Paperless-ngx versions its API with
|
|
9
|
+
* DRF's `AcceptHeaderVersioning` (`REST_FRAMEWORK.DEFAULT_VERSION = '10'`, measured against the
|
|
10
|
+
* v3.1.1 source). Omitting the header still answers — DRF falls back to `DEFAULT_VERSION` — but
|
|
11
|
+
* pinning it here means an estate upgrade that moves the default cannot silently change what
|
|
12
|
+
* this package receives without a version bump of its own noticing.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ A LIST IS WRAPPED, A DETAIL IS NOT: `{count, next, previous, results: […]}` vs. the bare
|
|
15
|
+
* object — the same DRF pagination shape NetBox uses.
|
|
16
|
+
*/
|
|
17
|
+
import * as Effect from 'effect/Effect';
|
|
18
|
+
import * as HttpClient from 'effect/unstable/http/HttpClient';
|
|
19
|
+
import { PaperlessCredentials, type PaperlessCredentialsError } from './credentials.ts';
|
|
20
|
+
import { type PaperlessError } from './errors.ts';
|
|
21
|
+
export interface PaperlessList<T> {
|
|
22
|
+
readonly count: number;
|
|
23
|
+
readonly next: string | null;
|
|
24
|
+
readonly previous: string | null;
|
|
25
|
+
readonly results: readonly T[];
|
|
26
|
+
}
|
|
27
|
+
export type PaperlessRow = Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* ⚠️ `PaperlessCredentials` IS PART OF THIS, NOT JUST `HttpClient`. `paperless()` reads the lazy
|
|
30
|
+
* credentials service (`yield* yield* PaperlessCredentials`), so a stack that wires the
|
|
31
|
+
* providers without also providing a credentials layer should fail to TYPECHECK, not fail at
|
|
32
|
+
* the first call. `providers.ts` supplies `environmentLayer` by default for exactly this.
|
|
33
|
+
*/
|
|
34
|
+
export type PaperlessRequirements = HttpClient.HttpClient | PaperlessCredentials;
|
|
35
|
+
/** One JSON call. Returns the parsed body, or `undefined` for an empty response (DELETE). */
|
|
36
|
+
export declare const paperless: <T>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, body?: Record<string, unknown>) => Effect.Effect<T, PaperlessError | PaperlessCredentialsError, PaperlessRequirements>;
|
|
37
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/paperless/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,KAAK,cAAc,EAAuC,MAAM,aAAa,CAAC;AAKvF,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;CAChC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,UAAU,GAAG,oBAAoB,CAAC;AAEjF,6FAA6F;AAC7F,eAAO,MAAM,SAAS,GAAI,CAAC,UACjB,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,QAC7C,MAAM,SACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,GAAG,yBAAyB,EAAE,qBAAqB,CAwCjF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generated tables, looked up by endpoint, and the refusal that stops a plan.
|
|
3
|
+
*
|
|
4
|
+
* ⛔ AN UNKNOWN KEY IS A DEFECT, NOT A REASON TO SKIP THE CHECK — the generator resolves every key
|
|
5
|
+
* in its source scan against the vendor document, so a key absent here means the tables were
|
|
6
|
+
* not regenerated, which the message says. Same posture as `../netbox/constraint-guard.ts`.
|
|
7
|
+
*/
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import { type EndpointConstraints, type EndpointKey, type PaperlessBody } from './constraints.ts';
|
|
10
|
+
import { PAPERLESS_CONSTRAINTS } from './generated/constraints/index.ts';
|
|
11
|
+
export { PAPERLESS_CONSTRAINTS };
|
|
12
|
+
export declare const constraintsFor: (key: EndpointKey) => EndpointConstraints;
|
|
13
|
+
export declare const bodyViolations: (key: EndpointKey, body: PaperlessBody, presence: boolean) => readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* ⛔ `Effect.die`, NOT `Effect.fail`. A declaration the vendor would reject is a DEFECT in the
|
|
16
|
+
* stack file, not a recoverable condition.
|
|
17
|
+
*/
|
|
18
|
+
export declare const guardBody: (key: EndpointKey | undefined, body: PaperlessBody, presence: boolean) => Effect.Effect<void>;
|
|
19
|
+
//# sourceMappingURL=constraint-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraint-guard.d.ts","sourceRoot":"","sources":["../../src/paperless/constraint-guard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,aAAa,EAGnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,eAAO,MAAM,cAAc,QAAS,WAAW,KAAG,mBASjD,CAAC;AAEF,eAAO,MAAM,cAAc,QACpB,WAAW,QACV,aAAa,YACT,OAAO,KAChB,SAAS,MAAM,EAAyD,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,SAAS,QACf,WAAW,GAAG,SAAS,QACtB,aAAa,YACT,OAAO,KAChB,MAAM,CAAC,MAAM,CAAC,IAAI,CAKjB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paperless-ngx's own rules, checked here, before the request is built.
|
|
3
|
+
*
|
|
4
|
+
* ★ THE SAME READER SHAPE AS `../netbox/constraints.ts`, AND FOR THE SAME REASON: both vendors
|
|
5
|
+
* send a JSON body where a number stays a number and a boolean stays a boolean, so `String(v)`
|
|
6
|
+
* at the door would be the exact mangling that incident (codegen/README.md) exists to prevent.
|
|
7
|
+
* The table itself is generated by `bun codegen/paperless.ts` from the vendor's own OpenAPI
|
|
8
|
+
* document — nothing here is hand-typed.
|
|
9
|
+
*
|
|
10
|
+
* ⚠️ WHAT THIS DELIBERATELY DOES NOT ENFORCE: a `format` name (a DRF validator run server-side); a
|
|
11
|
+
* pattern the generator could not carry faithfully (codegen/py-pattern.ts), recorded verbatim as
|
|
12
|
+
* `patternSource`; the `(name, owner)` uniqueness constraint (models.py) — that is `matching.ts`'s
|
|
13
|
+
* job, not a per-field rule; and `CustomField.select_options`, which is not in the schema at all
|
|
14
|
+
* (groundTruth: the serializer's own rule is unverified at 3.1.1 and this table cannot state a
|
|
15
|
+
* rule the vendor document does not carry).
|
|
16
|
+
*/
|
|
17
|
+
export interface ParamConstraint {
|
|
18
|
+
readonly type?: string;
|
|
19
|
+
/** From the schema's `required` array. ⚠️ Checked on CREATE only. */
|
|
20
|
+
readonly required?: boolean;
|
|
21
|
+
readonly maxLength?: number;
|
|
22
|
+
readonly minLength?: number;
|
|
23
|
+
readonly minimum?: number;
|
|
24
|
+
readonly maximum?: number;
|
|
25
|
+
/** ⚠️ `(string | number)[]` — `matching_algorithm`'s enum is numeric (`DataTypeEnum`'s is not). */
|
|
26
|
+
readonly enum?: readonly (string | number)[];
|
|
27
|
+
readonly pattern?: string;
|
|
28
|
+
readonly patternSource?: string;
|
|
29
|
+
readonly format?: string;
|
|
30
|
+
readonly default?: string;
|
|
31
|
+
}
|
|
32
|
+
export type EndpointConstraints = Readonly<Record<string, ParamConstraint>>;
|
|
33
|
+
/** `paperless:POST /api/tags/` — exactly how the generated tables key an endpoint. */
|
|
34
|
+
export type EndpointKey = string;
|
|
35
|
+
export type PaperlessBody = Record<string, unknown>;
|
|
36
|
+
export interface ViolationOptions {
|
|
37
|
+
/** ⛔ CREATE ONLY. A PATCH is deliberately partial, so presence there refuses every ordinary edit. */
|
|
38
|
+
readonly presence?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Every vendor rule this body breaks. Pure — no network, no clock, no environment.
|
|
42
|
+
*
|
|
43
|
+
* ⚠️ `null` IS A VALUE, NOT AN ABSENCE — Paperless uses explicit `null` to clear a nullable
|
|
44
|
+
* foreign key (`owner`, `parent`), so it must not trip the presence check, and no string/number
|
|
45
|
+
* rule applies to it.
|
|
46
|
+
*/
|
|
47
|
+
export declare const violations: (table: EndpointConstraints, body: PaperlessBody, options?: ViolationOptions) => readonly string[];
|
|
48
|
+
/** The message a plan dies with. */
|
|
49
|
+
export declare const refusal: (endpoint: EndpointKey, found: readonly string[]) => string;
|
|
50
|
+
//# sourceMappingURL=constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../src/paperless/constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,mGAAmG;IACnG,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AAE5E,sFAAsF;AACtF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAsCD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,UACd,mBAAmB,QACpB,aAAa,YACV,gBAAgB,KACxB,SAAS,MAAM,EAYjB,CAAC;AAEF,oCAAoC;AACpC,eAAO,MAAM,OAAO,aAAc,WAAW,SAAS,SAAS,MAAM,EAAE,KAAG,MAGM,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the Paperless URL and token come from — S24's shape (alchemy-provider-standard): a lazy
|
|
3
|
+
* `Context.Service` whose VALUE is itself an `Effect`, resolved inside each operation with
|
|
4
|
+
* `yield* yield* PaperlessCredentials`. Resolving twice, not once at layer build, is what keeps a
|
|
5
|
+
* token out of any state the engine might persist and lets a consumer swap the source (an env var
|
|
6
|
+
* today, an OpenBao mint tomorrow) without touching a resource file.
|
|
7
|
+
*
|
|
8
|
+
* ⛔ NO DEFAULT HOST, AND NO DEFAULT TOKEN. A published package that fell back to a loopback
|
|
9
|
+
* address would let a consumer who forgot the variable watch every call fail against a machine
|
|
10
|
+
* that is not theirs, instead of being told which variable is missing.
|
|
11
|
+
* ⛔ THE TOKEN IS NEVER A PROP, NEVER AN ATTRIBUTE. Alchemy persists attributes unencrypted
|
|
12
|
+
* (S25); nothing this family returns from `read`/`reconcile` may carry it.
|
|
13
|
+
*/
|
|
14
|
+
import * as Context from 'effect/Context';
|
|
15
|
+
import * as Effect from 'effect/Effect';
|
|
16
|
+
import * as Layer from 'effect/Layer';
|
|
17
|
+
declare const PaperlessCredentialsError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
18
|
+
readonly _tag: "PaperlessCredentialsError";
|
|
19
|
+
} & Readonly<A>;
|
|
20
|
+
export declare class PaperlessCredentialsError extends PaperlessCredentialsError_base<{
|
|
21
|
+
readonly message: string;
|
|
22
|
+
}> {
|
|
23
|
+
}
|
|
24
|
+
export interface PaperlessCredentialValue {
|
|
25
|
+
/** Trailing slash stripped, e.g. `https://paperless.example.com`. */
|
|
26
|
+
readonly url: string;
|
|
27
|
+
readonly token: string;
|
|
28
|
+
}
|
|
29
|
+
declare const PaperlessCredentials_base: Context.ServiceClass<PaperlessCredentials, "PaperlessCredentials", Effect.Effect<PaperlessCredentialValue, PaperlessCredentialsError, never>>;
|
|
30
|
+
/**
|
|
31
|
+
* The lazy service. ⚠️ `Layer.succeed` registers the EFFECT, not its result — `readEnvironment`
|
|
32
|
+
* runs once per `yield* yield*`, so a call after the variables are exported sees them even if
|
|
33
|
+
* the layer itself was built before that (true in `fake-paperless.test.ts`, which sets the env
|
|
34
|
+
* vars right before each call).
|
|
35
|
+
*/
|
|
36
|
+
export declare class PaperlessCredentials extends PaperlessCredentials_base {
|
|
37
|
+
}
|
|
38
|
+
export declare const environmentLayer: Layer.Layer<PaperlessCredentials>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/paperless/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;;;;AAEtC,qBAAa,yBAA0B,SAAQ,+BAA8C;IAC3F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;CAAG;AAEL,MAAM,WAAW,wBAAwB;IACvC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;;AA4BD;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,yBAGf;CAAG;AAE9B,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAG9D,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Paperless.CustomField` — a Paperless-ngx custom field, create-or-update and never deleted.
|
|
3
|
+
*
|
|
4
|
+
* ⛔ `dataType` IS CREATE-ONLY, ENFORCED AT PLAN TIME, NEVER A PATCH AND NEVER A REPLACE. A
|
|
5
|
+
* replace would delete this id and create a new one — and Paperless deletes the field's VALUE
|
|
6
|
+
* on every document when its custom field is deleted. `matching.ts`'s `immutable` hook carries
|
|
7
|
+
* this refusal generically; `dataType` is simply never listed in `fields`, so nothing in
|
|
8
|
+
* `matching.ts` ever builds a PATCH body that includes it.
|
|
9
|
+
*
|
|
10
|
+
* ⛔ NO `owner` FIELD. Unlike `Tag`/`DocumentType`/`StoragePath`, `CustomField` does not extend
|
|
11
|
+
* Paperless-ngx's `OwnedObjectSerializer` — its wire body is exactly `{name, data_type,
|
|
12
|
+
* extra_data}` (measured against the v3.1.1 schema). `owned: false` stops `matching.ts`
|
|
13
|
+
* sending a field the vendor's serializer does not declare.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ `CustomField.select_options` (the vendor's own rule for a `select` field's option list) is
|
|
16
|
+
* not in the served schema at all, so it is recorded here and NOT enforced (groundTruth).
|
|
17
|
+
*/
|
|
18
|
+
import { Resource } from 'alchemy';
|
|
19
|
+
import * as Provider from 'alchemy/Provider';
|
|
20
|
+
import * as Effect from 'effect/Effect';
|
|
21
|
+
import type { PaperlessCustomFieldRequest } from './generated/types/custom-fields.ts';
|
|
22
|
+
import type { PaperlessRow } from './client.ts';
|
|
23
|
+
import { type MatchingRequirements } from './matching.ts';
|
|
24
|
+
export interface CustomFieldProps {
|
|
25
|
+
/** ⚠️ maxLength 128 (generated constraint table). The locate key — CustomField's name is globally unique (models.py:1169), with no owner to further scope it. */
|
|
26
|
+
name: string;
|
|
27
|
+
/**
|
|
28
|
+
* ⛔ CREATE-ONLY — see this file's header. `select`'s own option list
|
|
29
|
+
* (`select_options`) is not in the vendor schema and is unenforced here.
|
|
30
|
+
*/
|
|
31
|
+
dataType: PaperlessCustomFieldRequest['data_type'];
|
|
32
|
+
/** Arbitrary JSON the vendor attaches no schema to (e.g. a `select` field's option list). */
|
|
33
|
+
extraData?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface CustomFieldAttributes {
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
dataType: string;
|
|
39
|
+
extraData: unknown;
|
|
40
|
+
}
|
|
41
|
+
export interface CustomField extends Resource<'Paperless.CustomField', CustomFieldProps, CustomFieldAttributes, never, MatchingRequirements> {
|
|
42
|
+
}
|
|
43
|
+
export declare const CustomField: import("alchemy").ResourceClass<CustomField>;
|
|
44
|
+
/**
|
|
45
|
+
* ⛔ EXTRACTED SO IT CAN BE TESTED WITHOUT A SERVER (custom-field.test.ts) — the same reason
|
|
46
|
+
* `../netbox/prefix-form.ts` pulls its body/matches functions out of `prefix.ts`.
|
|
47
|
+
*/
|
|
48
|
+
export declare const dataTypeImmutable: (live: PaperlessRow, props: CustomFieldProps) => string | undefined;
|
|
49
|
+
/** ⚠️ Exported (not through index.ts) so custom-field.test.ts can drive the real lifecycle. */
|
|
50
|
+
export declare const customFieldHandlers: {
|
|
51
|
+
list: () => Effect.Effect<never[], never, never>;
|
|
52
|
+
read: ({ olds }: {
|
|
53
|
+
olds: CustomFieldProps;
|
|
54
|
+
}) => Effect.Effect<CustomFieldAttributes | undefined, import("./credentials.ts").PaperlessCredentialsError | import("./errors.ts").PaperlessUnauthorized | import("./errors.ts").PaperlessUnavailable | import("./errors.ts").PaperlessValidation, import("./client.ts").PaperlessRequirements>;
|
|
55
|
+
diff: ({ news, output }: {
|
|
56
|
+
news: import("alchemy").Input<CustomFieldProps>;
|
|
57
|
+
output: CustomFieldAttributes | undefined;
|
|
58
|
+
}) => Effect.Effect<{
|
|
59
|
+
readonly action: 'update';
|
|
60
|
+
} | {
|
|
61
|
+
readonly action: 'noop';
|
|
62
|
+
} | {
|
|
63
|
+
readonly action: 'replace';
|
|
64
|
+
} | undefined, import("./credentials.ts").PaperlessCredentialsError | import("./errors.ts").PaperlessUnauthorized | import("./errors.ts").PaperlessUnavailable | import("./errors.ts").PaperlessValidation, import("./client.ts").PaperlessRequirements>;
|
|
65
|
+
reconcile: ({ news, output }: {
|
|
66
|
+
news: CustomFieldProps;
|
|
67
|
+
output?: CustomFieldAttributes | undefined;
|
|
68
|
+
}) => Effect.Effect<CustomFieldAttributes, import("./credentials.ts").PaperlessCredentialsError | import("./errors.ts").PaperlessError, import("./client.ts").PaperlessRequirements>;
|
|
69
|
+
delete: ({ olds, output }: {
|
|
70
|
+
olds: CustomFieldProps;
|
|
71
|
+
output?: CustomFieldAttributes | undefined;
|
|
72
|
+
}) => Effect.Effect<void, import("./credentials.ts").PaperlessCredentialsError | import("./errors.ts").PaperlessUnauthorized | import("./errors.ts").PaperlessUnavailable | import("./errors.ts").PaperlessValidation, import("./client.ts").PaperlessRequirements>;
|
|
73
|
+
};
|
|
74
|
+
export declare const CustomFieldProvider: () => import("effect/Layer").Layer<Provider.Provider<CustomField>, never, import("./client.ts").PaperlessRequirements>;
|
|
75
|
+
//# sourceMappingURL=custom-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-field.d.ts","sourceRoot":"","sources":["../../src/paperless/custom-field.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,KAAK,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,iKAAiK;IACjK,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,2BAA2B,CAAC,WAAW,CAAC,CAAC;IACnD,6FAA6F;IAC7F,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,QAAQ,CAC3C,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,EACL,oBAAoB,CACrB;CAAG;AAEJ,eAAO,MAAM,WAAW,8CAEtB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SACtB,YAAY,SACX,gBAAgB,KACtB,MAAM,GAAG,SAKG,CAAC;AAEhB,+FAA+F;AAC/F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAC;AAEH,eAAO,MAAM,mBAAmB,wHAC4D,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Paperless.DocumentType` — a Paperless-ngx document type, create-or-update and never deleted.
|
|
3
|
+
* Same shape as `tag.ts` minus `color`/`isInboxTag`/`parent` — see that file's header for why
|
|
4
|
+
* `matchingAlgorithm`'s type comes off the generated request type rather than being retyped.
|
|
5
|
+
*/
|
|
6
|
+
import { Resource } from 'alchemy';
|
|
7
|
+
import * as Provider from 'alchemy/Provider';
|
|
8
|
+
import type { PaperlessDocumentTypeRequest } from './generated/types/document-types.ts';
|
|
9
|
+
import { type MatchingProps, type MatchingRequirements } from './matching.ts';
|
|
10
|
+
export interface DocumentTypeProps extends MatchingProps {
|
|
11
|
+
/** ⚠️ maxLength 128 (generated constraint table). The locate key. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** ⚠️ maxLength 256. */
|
|
14
|
+
match?: string;
|
|
15
|
+
matchingAlgorithm?: PaperlessDocumentTypeRequest['matching_algorithm'];
|
|
16
|
+
isInsensitive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface DocumentTypeAttributes {
|
|
19
|
+
id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
match: string;
|
|
22
|
+
matchingAlgorithm: number;
|
|
23
|
+
isInsensitive: boolean;
|
|
24
|
+
owner: number | undefined;
|
|
25
|
+
}
|
|
26
|
+
export interface DocumentType extends Resource<'Paperless.DocumentType', DocumentTypeProps, DocumentTypeAttributes, never, MatchingRequirements> {
|
|
27
|
+
}
|
|
28
|
+
export declare const DocumentType: import("alchemy").ResourceClass<DocumentType>;
|
|
29
|
+
export declare const DocumentTypeProvider: () => import("effect/Layer").Layer<Provider.Provider<DocumentType>, never, import("./client.ts").PaperlessRequirements>;
|
|
30
|
+
//# sourceMappingURL=document-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-type.d.ts","sourceRoot":"","sources":["../../src/paperless/document-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAEhG,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,4BAA4B,CAAC,oBAAoB,CAAC,CAAC;IACvE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ,CAC5C,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,EACL,oBAAoB,CACrB;CAAG;AAEJ,eAAO,MAAM,YAAY,+CAEvB,CAAC;AAiCH,eAAO,MAAM,oBAAoB,yHACkD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare const PaperlessNotFound_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2
|
+
readonly _tag: "PaperlessNotFound";
|
|
3
|
+
} & Readonly<A>;
|
|
4
|
+
/** No object at that path. The only tag `matching.ts` folds to "absent". */
|
|
5
|
+
export declare class PaperlessNotFound extends PaperlessNotFound_base<{
|
|
6
|
+
readonly method: string;
|
|
7
|
+
readonly path: string;
|
|
8
|
+
}> {
|
|
9
|
+
}
|
|
10
|
+
declare const PaperlessUnauthorized_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
11
|
+
readonly _tag: "PaperlessUnauthorized";
|
|
12
|
+
} & Readonly<A>;
|
|
13
|
+
/** 401 (no/bad token) or 403 (token valid, forbidden) — NEVER read as "the object is absent". */
|
|
14
|
+
export declare class PaperlessUnauthorized extends PaperlessUnauthorized_base<{
|
|
15
|
+
readonly status: 401 | 403;
|
|
16
|
+
readonly method: string;
|
|
17
|
+
readonly path: string;
|
|
18
|
+
}> {
|
|
19
|
+
}
|
|
20
|
+
declare const PaperlessValidation_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
21
|
+
readonly _tag: "PaperlessValidation";
|
|
22
|
+
} & Readonly<A>;
|
|
23
|
+
/** 400 — the vendor rejected the body. Carries it, so the message quotes Paperless's own words. */
|
|
24
|
+
export declare class PaperlessValidation extends PaperlessValidation_base<{
|
|
25
|
+
readonly method: string;
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly body: string;
|
|
28
|
+
}> {
|
|
29
|
+
}
|
|
30
|
+
declare const PaperlessUnavailable_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
31
|
+
readonly _tag: "PaperlessUnavailable";
|
|
32
|
+
} & Readonly<A>;
|
|
33
|
+
/** 5xx, or a status this family's endpoints do not otherwise document. */
|
|
34
|
+
export declare class PaperlessUnavailable extends PaperlessUnavailable_base<{
|
|
35
|
+
readonly status: number;
|
|
36
|
+
readonly method: string;
|
|
37
|
+
readonly path: string;
|
|
38
|
+
readonly detail: string;
|
|
39
|
+
}> {
|
|
40
|
+
}
|
|
41
|
+
export type PaperlessError = PaperlessNotFound | PaperlessUnauthorized | PaperlessValidation | PaperlessUnavailable;
|
|
42
|
+
/**
|
|
43
|
+
* The one place a status code is read. ⚠️ Anything outside {400,401,403,404,5xx} — 405, 409, 429
|
|
44
|
+
* — is not documented for these four endpoints, so it falls to `PaperlessValidation` rather than
|
|
45
|
+
* inventing a fifth tag for a case that was never measured.
|
|
46
|
+
*/
|
|
47
|
+
export declare const statusToError: (status: number, method: string, path: string, body: string) => PaperlessError;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/paperless/errors.ts"],"names":[],"mappings":";;;AAYA,4EAA4E;AAC5E,qBAAa,iBAAkB,SAAQ,uBAAsC;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;CAAG;;;;AAEL,iGAAiG;AACjG,qBAAa,qBAAsB,SAAQ,2BAA0C;IACnF,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;CAAG;;;;AAEL,mGAAmG;AACnG,qBAAa,mBAAoB,SAAQ,yBAAwC;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;CAAG;;;;AAEL,0EAA0E;AAC1E,qBAAa,oBAAqB,SAAQ,0BAAyC;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;CAAG;AAEL,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,CAAC;AAEzB;;;;GAIG;AACH,eAAO,MAAM,aAAa,WAChB,MAAM,UACN,MAAM,QACR,MAAM,QACN,MAAM,KACX,cAKF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fake Paperless-ngx for the tests beside it — `Bun.serve` on an ephemeral 127.0.0.1 port, the
|
|
3
|
+
* same shape `../openbao/fake-bao.ts` and `../caddy/fake-caddy.ts` use.
|
|
4
|
+
*
|
|
5
|
+
* ⛔ TEST-ONLY. No provider imports this file. It stores rows in memory for exactly the four
|
|
6
|
+
* taxonomy collections and answers `name__iexact` the way Django does — case-insensitive,
|
|
7
|
+
* never collapsing two differently-cased rows into one.
|
|
8
|
+
*/
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
import type { PaperlessRequirements } from './client.ts';
|
|
11
|
+
import { type PaperlessCredentialsError } from './credentials.ts';
|
|
12
|
+
import type { PaperlessError } from './errors.ts';
|
|
13
|
+
export declare const FAKE_TOKEN = "fake-token-not-real";
|
|
14
|
+
export interface Seen {
|
|
15
|
+
readonly method: string;
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly headers: Headers;
|
|
18
|
+
readonly body: string;
|
|
19
|
+
}
|
|
20
|
+
export type Row = Record<string, unknown> & {
|
|
21
|
+
id: number;
|
|
22
|
+
};
|
|
23
|
+
declare const COLLECTIONS: readonly ['tags', 'document_types', 'storage_paths', 'custom_fields'];
|
|
24
|
+
export interface FakePaperless {
|
|
25
|
+
readonly url: string;
|
|
26
|
+
readonly seen: Seen[];
|
|
27
|
+
readonly rows: (collection: (typeof COLLECTIONS)[number]) => readonly Row[];
|
|
28
|
+
/** `undefined` to answer normally; a status to force it once per subsequent call. */
|
|
29
|
+
forceStatus: number | undefined;
|
|
30
|
+
stop(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const fakePaperless: () => FakePaperless;
|
|
33
|
+
/** Run `body` against a fresh fake, `PAPERLESS_URL`/`PAPERLESS_TOKEN` set only for its duration. */
|
|
34
|
+
export declare const withFake: (body: (fake: FakePaperless) => Promise<void>) => Promise<void>;
|
|
35
|
+
/** Run an effect through the real `FetchHttpClient` and the real environment credentials layer. */
|
|
36
|
+
export declare const run: <A>(effect: Effect.Effect<A, PaperlessError | PaperlessCredentialsError, PaperlessRequirements>) => Promise<A>;
|
|
37
|
+
export declare const runFailure: <A>(effect: Effect.Effect<A, PaperlessError | PaperlessCredentialsError, PaperlessRequirements>) => Promise<PaperlessCredentialsError | PaperlessError>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=fake-paperless.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-paperless.d.ts","sourceRoot":"","sources":["../../src/paperless/fake-paperless.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,KAAK,yBAAyB,EAAoB,MAAM,kBAAkB,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,UAAU,wBAAwB,CAAC;AAEhD,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,QAAA,MAAM,WAAW,YAAI,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,CAAU,CAAC;AAE1F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,SAAS,GAAG,EAAE,CAAC;IAC5E,qFAAqF;IACrF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,IAAI,IAAI,IAAI,CAAC;CACd;AAKD,eAAO,MAAM,aAAa,QAAO,aA0EhC,CAAC;AAQF,oGAAoG;AACpG,eAAO,MAAM,QAAQ,SAAgB,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,KAAG,OAAO,CAAC,IAAI,CAezF,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,GAAG,GAAI,CAAC,UACX,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,GAAG,yBAAyB,EAAE,qBAAqB,CAAC,eAI1F,CAAC;AAEJ,eAAO,MAAM,UAAU,GAAI,CAAC,UAClB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,GAAG,yBAAyB,EAAE,qBAAqB,CAAC,wDAO1F,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every generated Paperless constraint table, merged — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/paperless.ts
|
|
5
|
+
*
|
|
6
|
+
* ⚠️ EVERY KEY IS PREFIXED `paperless:`, so one estate running several vendors' readers cannot
|
|
7
|
+
* collide on an unprefixed `POST /api/…`.
|
|
8
|
+
*/
|
|
9
|
+
import type { EndpointConstraints } from '../../constraints.ts';
|
|
10
|
+
export declare const PAPERLESS_CONSTRAINTS: Readonly<Record<string, EndpointConstraints>>;
|
|
11
|
+
/** sha256 of the merged table, truncated — a digest of the DATA, not the file text. */
|
|
12
|
+
export declare const PAPERLESS_CONSTRAINTS_DIGEST = "66e61dce8c099d7d";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/constraints/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAMhE,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAK/E,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,4BAA4B,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated Paperless-ngx REST API (OpenAPI 3.0.3) request-body constraints for `/api/custom_fields/` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/paperless.ts
|
|
5
|
+
* Manifest entry: `paperless-openapi` — Paperless-ngx REST API (OpenAPI 3.0.3) 3.1.1
|
|
6
|
+
* sha256 d0fe550d2135e37b, Paperless-ngx web service, loopback
|
|
7
|
+
* /api/schema/?format=json
|
|
8
|
+
*
|
|
9
|
+
* 8 of this product's 100 POST/PUT/PATCH/DELETE endpoints are tabled across all
|
|
10
|
+
* areas: the ones this package writes to, named in its own source. Every other vendor write
|
|
11
|
+
* endpoint is UNTABLED and therefore unchecked at plan time.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ A `patternSource` with no `pattern` beside it could NOT be carried into a JavaScript
|
|
14
|
+
* RegExp faithfully — Django/DRF's `\w` is Unicode and JavaScript's is ASCII
|
|
15
|
+
* (codegen/py-pattern.ts). It is recorded and NOT enforced.
|
|
16
|
+
* ⚠️ `data_type` on a custom field is CREATE-ONLY: enforced here as a value rule, never as a
|
|
17
|
+
* reason to allow a PATCH — the refusal on change lives in the provider (custom-field.ts).
|
|
18
|
+
*/
|
|
19
|
+
import type { EndpointConstraints } from '../../constraints.ts';
|
|
20
|
+
export declare const PAPERLESS_CUSTOM_FIELDS_CONSTRAINTS: Readonly<Record<string, EndpointConstraints>>;
|
|
21
|
+
//# sourceMappingURL=paperless-custom_fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paperless-custom_fields.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/constraints/paperless-custom_fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAQ7F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated Paperless-ngx REST API (OpenAPI 3.0.3) request-body constraints for `/api/document_types/` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/paperless.ts
|
|
5
|
+
* Manifest entry: `paperless-openapi` — Paperless-ngx REST API (OpenAPI 3.0.3) 3.1.1
|
|
6
|
+
* sha256 d0fe550d2135e37b, Paperless-ngx web service, loopback
|
|
7
|
+
* /api/schema/?format=json
|
|
8
|
+
*
|
|
9
|
+
* 8 of this product's 100 POST/PUT/PATCH/DELETE endpoints are tabled across all
|
|
10
|
+
* areas: the ones this package writes to, named in its own source. Every other vendor write
|
|
11
|
+
* endpoint is UNTABLED and therefore unchecked at plan time.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ A `patternSource` with no `pattern` beside it could NOT be carried into a JavaScript
|
|
14
|
+
* RegExp faithfully — Django/DRF's `\w` is Unicode and JavaScript's is ASCII
|
|
15
|
+
* (codegen/py-pattern.ts). It is recorded and NOT enforced.
|
|
16
|
+
* ⚠️ `data_type` on a custom field is CREATE-ONLY: enforced here as a value rule, never as a
|
|
17
|
+
* reason to allow a PATCH — the refusal on change lives in the provider (custom-field.ts).
|
|
18
|
+
*/
|
|
19
|
+
import type { EndpointConstraints } from '../../constraints.ts';
|
|
20
|
+
export declare const PAPERLESS_DOCUMENT_TYPES_CONSTRAINTS: Readonly<Record<string, EndpointConstraints>>;
|
|
21
|
+
//# sourceMappingURL=paperless-document_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paperless-document_types.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/constraints/paperless-document_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAW9F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated Paperless-ngx REST API (OpenAPI 3.0.3) request-body constraints for `/api/storage_paths/` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/paperless.ts
|
|
5
|
+
* Manifest entry: `paperless-openapi` — Paperless-ngx REST API (OpenAPI 3.0.3) 3.1.1
|
|
6
|
+
* sha256 d0fe550d2135e37b, Paperless-ngx web service, loopback
|
|
7
|
+
* /api/schema/?format=json
|
|
8
|
+
*
|
|
9
|
+
* 8 of this product's 100 POST/PUT/PATCH/DELETE endpoints are tabled across all
|
|
10
|
+
* areas: the ones this package writes to, named in its own source. Every other vendor write
|
|
11
|
+
* endpoint is UNTABLED and therefore unchecked at plan time.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ A `patternSource` with no `pattern` beside it could NOT be carried into a JavaScript
|
|
14
|
+
* RegExp faithfully — Django/DRF's `\w` is Unicode and JavaScript's is ASCII
|
|
15
|
+
* (codegen/py-pattern.ts). It is recorded and NOT enforced.
|
|
16
|
+
* ⚠️ `data_type` on a custom field is CREATE-ONLY: enforced here as a value rule, never as a
|
|
17
|
+
* reason to allow a PATCH — the refusal on change lives in the provider (custom-field.ts).
|
|
18
|
+
*/
|
|
19
|
+
import type { EndpointConstraints } from '../../constraints.ts';
|
|
20
|
+
export declare const PAPERLESS_STORAGE_PATHS_CONSTRAINTS: Readonly<Record<string, EndpointConstraints>>;
|
|
21
|
+
//# sourceMappingURL=paperless-storage_paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paperless-storage_paths.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/constraints/paperless-storage_paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAa7F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated Paperless-ngx REST API (OpenAPI 3.0.3) request-body constraints for `/api/tags/` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/paperless.ts
|
|
5
|
+
* Manifest entry: `paperless-openapi` — Paperless-ngx REST API (OpenAPI 3.0.3) 3.1.1
|
|
6
|
+
* sha256 d0fe550d2135e37b, Paperless-ngx web service, loopback
|
|
7
|
+
* /api/schema/?format=json
|
|
8
|
+
*
|
|
9
|
+
* 8 of this product's 100 POST/PUT/PATCH/DELETE endpoints are tabled across all
|
|
10
|
+
* areas: the ones this package writes to, named in its own source. Every other vendor write
|
|
11
|
+
* endpoint is UNTABLED and therefore unchecked at plan time.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ A `patternSource` with no `pattern` beside it could NOT be carried into a JavaScript
|
|
14
|
+
* RegExp faithfully — Django/DRF's `\w` is Unicode and JavaScript's is ASCII
|
|
15
|
+
* (codegen/py-pattern.ts). It is recorded and NOT enforced.
|
|
16
|
+
* ⚠️ `data_type` on a custom field is CREATE-ONLY: enforced here as a value rule, never as a
|
|
17
|
+
* reason to allow a PATCH — the refusal on change lives in the provider (custom-field.ts).
|
|
18
|
+
*/
|
|
19
|
+
import type { EndpointConstraints } from '../../constraints.ts';
|
|
20
|
+
export declare const PAPERLESS_TAGS_CONSTRAINTS: Readonly<Record<string, EndpointConstraints>>;
|
|
21
|
+
//# sourceMappingURL=paperless-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paperless-tags.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/constraints/paperless-tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAapF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated Paperless-ngx REST API (OpenAPI 3.0.3) request/response types for `/api/custom_fields/` — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Run: bun codegen/paperless.ts
|
|
5
|
+
* Manifest entry: `paperless-openapi` — Paperless-ngx REST API (OpenAPI 3.0.3) 3.1.1, sha256 d0fe550d2135e37b
|
|
6
|
+
*
|
|
7
|
+
* 8 of Paperless-ngx REST API (OpenAPI 3.0.3)'s 100 write endpoints are used by this family; this file covers only /api/custom_fields/.
|
|
8
|
+
*
|
|
9
|
+
* ⛔ `set_permissions` (writeOnly) is not modelled in this slice — no property here writes it.
|
|
10
|
+
*/
|
|
11
|
+
export interface PaperlessCustomFieldRequest {
|
|
12
|
+
name: string;
|
|
13
|
+
data_type: "string" | "url" | "date" | "boolean" | "integer" | "float" | "monetary" | "documentlink" | "select" | "longtext";
|
|
14
|
+
extra_data?: unknown | null;
|
|
15
|
+
}
|
|
16
|
+
export interface PaperlessCustomField {
|
|
17
|
+
readonly id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
data_type: "string" | "url" | "date" | "boolean" | "integer" | "float" | "monetary" | "documentlink" | "select" | "longtext";
|
|
20
|
+
extra_data?: unknown | null;
|
|
21
|
+
readonly document_count: number;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=custom-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-fields.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/types/custom-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7H,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7H,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC"}
|