@homeflare/alchemy 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +10 -0
  2. package/dist/paperless/client.d.ts +37 -0
  3. package/dist/paperless/client.d.ts.map +1 -0
  4. package/dist/paperless/constraint-guard.d.ts +19 -0
  5. package/dist/paperless/constraint-guard.d.ts.map +1 -0
  6. package/dist/paperless/constraints.d.ts +50 -0
  7. package/dist/paperless/constraints.d.ts.map +1 -0
  8. package/dist/paperless/credentials.d.ts +40 -0
  9. package/dist/paperless/credentials.d.ts.map +1 -0
  10. package/dist/paperless/custom-field.d.ts +75 -0
  11. package/dist/paperless/custom-field.d.ts.map +1 -0
  12. package/dist/paperless/document-type.d.ts +30 -0
  13. package/dist/paperless/document-type.d.ts.map +1 -0
  14. package/dist/paperless/errors.d.ts +49 -0
  15. package/dist/paperless/errors.d.ts.map +1 -0
  16. package/dist/paperless/fake-paperless.d.ts +39 -0
  17. package/dist/paperless/fake-paperless.d.ts.map +1 -0
  18. package/dist/paperless/generated/constraints/index.d.ts +13 -0
  19. package/dist/paperless/generated/constraints/index.d.ts.map +1 -0
  20. package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts +21 -0
  21. package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts.map +1 -0
  22. package/dist/paperless/generated/constraints/paperless-document_types.d.ts +21 -0
  23. package/dist/paperless/generated/constraints/paperless-document_types.d.ts.map +1 -0
  24. package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts +21 -0
  25. package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts.map +1 -0
  26. package/dist/paperless/generated/constraints/paperless-tags.d.ts +21 -0
  27. package/dist/paperless/generated/constraints/paperless-tags.d.ts.map +1 -0
  28. package/dist/paperless/generated/types/custom-fields.d.ts +23 -0
  29. package/dist/paperless/generated/types/custom-fields.d.ts.map +1 -0
  30. package/dist/paperless/generated/types/document-types.d.ts +39 -0
  31. package/dist/paperless/generated/types/document-types.d.ts.map +1 -0
  32. package/dist/paperless/generated/types/index.d.ts +10 -0
  33. package/dist/paperless/generated/types/index.d.ts.map +1 -0
  34. package/dist/paperless/generated/types/storage-paths.d.ts +31 -0
  35. package/dist/paperless/generated/types/storage-paths.d.ts.map +1 -0
  36. package/dist/paperless/generated/types/tags.d.ts +37 -0
  37. package/dist/paperless/generated/types/tags.d.ts.map +1 -0
  38. package/dist/paperless/index.d.ts +19 -0
  39. package/dist/paperless/index.d.ts.map +1 -0
  40. package/dist/paperless/index.js +524 -0
  41. package/dist/paperless/index.js.map +26 -0
  42. package/dist/paperless/matching-locate.d.ts +33 -0
  43. package/dist/paperless/matching-locate.d.ts.map +1 -0
  44. package/dist/paperless/matching-types.d.ts +60 -0
  45. package/dist/paperless/matching-types.d.ts.map +1 -0
  46. package/dist/paperless/matching.d.ts +61 -0
  47. package/dist/paperless/matching.d.ts.map +1 -0
  48. package/dist/paperless/providers.d.ts +15 -0
  49. package/dist/paperless/providers.d.ts.map +1 -0
  50. package/dist/paperless/storage-path.d.ts +32 -0
  51. package/dist/paperless/storage-path.d.ts.map +1 -0
  52. package/dist/paperless/tag.d.ts +47 -0
  53. package/dist/paperless/tag.d.ts.map +1 -0
  54. package/docs/paperless.md +115 -0
  55. package/package.json +5 -1
  56. package/src/paperless/client.ts +88 -0
  57. package/src/paperless/constraint-guard.ts +50 -0
  58. package/src/paperless/constraints.test.ts +74 -0
  59. package/src/paperless/constraints.ts +111 -0
  60. package/src/paperless/credentials.ts +69 -0
  61. package/src/paperless/custom-field.test.ts +74 -0
  62. package/src/paperless/custom-field.ts +95 -0
  63. package/src/paperless/document-type.ts +74 -0
  64. package/src/paperless/errors.ts +62 -0
  65. package/src/paperless/fake-paperless.ts +156 -0
  66. package/src/paperless/generated/constraints/index.ts +23 -0
  67. package/src/paperless/generated/constraints/paperless-custom_fields.ts +29 -0
  68. package/src/paperless/generated/constraints/paperless-document_types.ts +32 -0
  69. package/src/paperless/generated/constraints/paperless-storage_paths.ts +34 -0
  70. package/src/paperless/generated/constraints/paperless-tags.ts +34 -0
  71. package/src/paperless/generated/types/custom-fields.ts +23 -0
  72. package/src/paperless/generated/types/document-types.ts +30 -0
  73. package/src/paperless/generated/types/index.ts +9 -0
  74. package/src/paperless/generated/types/storage-paths.ts +31 -0
  75. package/src/paperless/generated/types/tags.ts +37 -0
  76. package/src/paperless/index.ts +56 -0
  77. package/src/paperless/matching-identity.test.ts +194 -0
  78. package/src/paperless/matching-locate.ts +104 -0
  79. package/src/paperless/matching-types.ts +61 -0
  80. package/src/paperless/matching.test.ts +128 -0
  81. package/src/paperless/matching.ts +239 -0
  82. package/src/paperless/providers.ts +27 -0
  83. package/src/paperless/storage-path.ts +78 -0
  84. package/src/paperless/tag.ts +91 -0
package/README.md CHANGED
@@ -224,6 +224,16 @@ every cluster needs first. What it never does to a guest, and why: [docs/proxmox
224
224
  against a table generated from NetBox's own OpenAPI document before the request is built.
225
225
  ⛔ Adopt-first, `retain` on removal, and read/write shapes that differ: [docs/netbox.md](./docs/netbox.md).
226
226
 
227
+ ## Paperless — `@homeflare/alchemy/paperless`
228
+
229
+ `Tag`, `DocumentType`, `StoragePath` and `CustomField` — the taxonomy Paperless-ngx writes
230
+ through Django's internal models, create-or-update and never deleted. Every write is checked
231
+ against a table generated from Paperless-ngx's own served OpenAPI document, and the request/
232
+ response types are generated from it too, not hand-typed. ⛔ Every create carries `owner`
233
+ (null when undeclared — omitting it lets the vendor default to the token user), `read` answers
234
+ `Unowned` on every match (never a silent adopt), and a custom field's `dataType` is refused at
235
+ plan time rather than PATCHed or replaced: [docs/paperless.md](./docs/paperless.md).
236
+
227
237
  ## LiteLLM — `@homeflare/alchemy/litellm`
228
238
 
229
239
  `LiteLLM.PassThroughEndpoint` declares one route on LiteLLM's proxy that forwards to an
@@ -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"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Generated Paperless-ngx REST API (OpenAPI 3.0.3) request/response types 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, 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/document_types/.
8
+ *
9
+ * ⛔ `set_permissions` (writeOnly) is not modelled in this slice — no property here writes it.
10
+ */
11
+ export interface PaperlessDocumentTypeRequest {
12
+ name: string;
13
+ match?: string;
14
+ matching_algorithm?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
15
+ is_insensitive?: boolean;
16
+ owner?: number | null;
17
+ }
18
+ export interface PaperlessDocumentType {
19
+ readonly id: number;
20
+ readonly slug: string;
21
+ name: string;
22
+ match?: string;
23
+ matching_algorithm?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
24
+ is_insensitive?: boolean;
25
+ readonly document_count: number;
26
+ owner?: number | null;
27
+ readonly permissions: {
28
+ view?: {
29
+ users?: number[];
30
+ groups?: number[];
31
+ };
32
+ change?: {
33
+ users?: number[];
34
+ groups?: number[];
35
+ };
36
+ };
37
+ readonly user_can_change: boolean;
38
+ }
39
+ //# sourceMappingURL=document-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-types.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/types/document-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;IAC3H,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Every generated Paperless taxonomy type, re-exported — DO NOT EDIT BY HAND.
3
+ *
4
+ * Run: bun codegen/paperless.ts
5
+ */
6
+ export * from './tags.ts';
7
+ export * from './document-types.ts';
8
+ export * from './storage-paths.ts';
9
+ export * from './custom-fields.ts';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/paperless/generated/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}