@homeflare/alchemy 0.28.0 → 0.29.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.
Files changed (221) hide show
  1. package/README.md +2 -0
  2. package/dist/caddy/admin-address.d.ts +27 -0
  3. package/dist/caddy/admin-address.d.ts.map +1 -0
  4. package/dist/caddy/admin-calls.d.ts +25 -28
  5. package/dist/caddy/admin-calls.d.ts.map +1 -1
  6. package/dist/caddy/admin.d.ts +28 -38
  7. package/dist/caddy/admin.d.ts.map +1 -1
  8. package/dist/caddy/caddy-http-client.d.ts +25 -0
  9. package/dist/caddy/caddy-http-client.d.ts.map +1 -0
  10. package/dist/caddy/config-errors.d.ts +24 -0
  11. package/dist/caddy/config-errors.d.ts.map +1 -0
  12. package/dist/caddy/config-lifecycle.d.ts +20 -49
  13. package/dist/caddy/config-lifecycle.d.ts.map +1 -1
  14. package/dist/caddy/config-reconcile.d.ts +45 -0
  15. package/dist/caddy/config-reconcile.d.ts.map +1 -0
  16. package/dist/caddy/config.d.ts +4 -3
  17. package/dist/caddy/config.d.ts.map +1 -1
  18. package/dist/caddy/fake-caddy.d.ts +10 -2
  19. package/dist/caddy/fake-caddy.d.ts.map +1 -1
  20. package/dist/caddy/index.d.ts +3 -3
  21. package/dist/caddy/index.d.ts.map +1 -1
  22. package/dist/caddy/index.js +487 -444
  23. package/dist/caddy/index.js.map +16 -12
  24. package/dist/caddy/local-admin.d.ts +20 -34
  25. package/dist/caddy/local-admin.d.ts.map +1 -1
  26. package/dist/caddy/providers.d.ts +19 -3
  27. package/dist/caddy/providers.d.ts.map +1 -1
  28. package/dist/cloudflare/mesh-node-token.d.ts +1 -1
  29. package/dist/cloudflare/mesh-node-token.d.ts.map +1 -1
  30. package/dist/forgejo/branch-protection.d.ts +4 -4
  31. package/dist/forgejo/org-actions-secrets.d.ts +4 -4
  32. package/dist/forgejo/org-label.d.ts +4 -4
  33. package/dist/forgejo/org-team.d.ts +4 -4
  34. package/dist/forgejo/repo-webhook.d.ts +4 -4
  35. package/dist/forgejo/repository.d.ts +4 -4
  36. package/dist/forgejo/team-member.d.ts +4 -4
  37. package/dist/github/declare-repo-baseline.d.ts +1 -1
  38. package/dist/github/declare-repo-baseline.d.ts.map +1 -1
  39. package/dist/github/index.d.ts +8 -4
  40. package/dist/github/index.d.ts.map +1 -1
  41. package/dist/github/index.js +83 -24
  42. package/dist/github/index.js.map +14 -12
  43. package/dist/github/repo-apply-order-fake-providers.d.ts +48 -0
  44. package/dist/github/repo-apply-order-fake-providers.d.ts.map +1 -0
  45. package/dist/github/repo-apply-order-fake-stack.d.ts +13 -0
  46. package/dist/github/repo-apply-order-fake-stack.d.ts.map +1 -0
  47. package/dist/github/repo-auto-merge-gate.d.ts +54 -0
  48. package/dist/github/repo-auto-merge-gate.d.ts.map +1 -0
  49. package/dist/github/repo-baseline-data.d.ts +10 -1
  50. package/dist/github/repo-baseline-data.d.ts.map +1 -1
  51. package/dist/github/repo-policy.d.ts +1 -1
  52. package/dist/github/repo-policy.d.ts.map +1 -1
  53. package/dist/github/repository-ruleset-errors.d.ts +3 -2
  54. package/dist/github/repository-ruleset-errors.d.ts.map +1 -1
  55. package/dist/github/repository-ruleset-form.d.ts.map +1 -1
  56. package/dist/github/repository-ruleset-guards.d.ts +3 -2
  57. package/dist/github/repository-ruleset-guards.d.ts.map +1 -1
  58. package/dist/github/repository-ruleset-octokit.d.ts +49 -0
  59. package/dist/github/repository-ruleset-octokit.d.ts.map +1 -1
  60. package/dist/github/repository-ruleset-probe.d.ts +2 -1
  61. package/dist/github/repository-ruleset-probe.d.ts.map +1 -1
  62. package/dist/github/repository-ruleset-props.d.ts +7 -4
  63. package/dist/github/repository-ruleset-props.d.ts.map +1 -1
  64. package/dist/github/repository-ruleset-providers.d.ts +42 -0
  65. package/dist/github/repository-ruleset-providers.d.ts.map +1 -0
  66. package/dist/github/repository-ruleset.d.ts +26 -4
  67. package/dist/github/repository-ruleset.d.ts.map +1 -1
  68. package/dist/litellm/fake-litellm.d.ts +27 -16
  69. package/dist/litellm/fake-litellm.d.ts.map +1 -1
  70. package/dist/litellm/fake-stack.d.ts +9 -4
  71. package/dist/litellm/fake-stack.d.ts.map +1 -1
  72. package/dist/litellm/index.d.ts +7 -5
  73. package/dist/litellm/index.d.ts.map +1 -1
  74. package/dist/litellm/index.js +53 -123
  75. package/dist/litellm/index.js.map +8 -8
  76. package/dist/litellm/operations.d.ts +60 -0
  77. package/dist/litellm/operations.d.ts.map +1 -0
  78. package/dist/litellm/pass-through-endpoint.d.ts +10 -28
  79. package/dist/litellm/pass-through-endpoint.d.ts.map +1 -1
  80. package/dist/litellm/pass-through-errors.d.ts +37 -0
  81. package/dist/litellm/pass-through-errors.d.ts.map +1 -0
  82. package/dist/litellm/pass-through-form.d.ts +11 -4
  83. package/dist/litellm/pass-through-form.d.ts.map +1 -1
  84. package/dist/litellm/providers.d.ts +7 -5
  85. package/dist/litellm/providers.d.ts.map +1 -1
  86. package/dist/netbox/prefix.d.ts +4 -4
  87. package/dist/paperless/custom-field.d.ts +21 -21
  88. package/dist/paperless/custom-field.d.ts.map +1 -1
  89. package/dist/paperless/document-type.d.ts +34 -4
  90. package/dist/paperless/document-type.d.ts.map +1 -1
  91. package/dist/paperless/fake-paperless.d.ts +36 -19
  92. package/dist/paperless/fake-paperless.d.ts.map +1 -1
  93. package/dist/paperless/index.d.ts +7 -2
  94. package/dist/paperless/index.d.ts.map +1 -1
  95. package/dist/paperless/index.js +164 -228
  96. package/dist/paperless/index.js.map +10 -13
  97. package/dist/paperless/matching-locate.d.ts +42 -20
  98. package/dist/paperless/matching-locate.d.ts.map +1 -1
  99. package/dist/paperless/matching-types.d.ts +47 -18
  100. package/dist/paperless/matching-types.d.ts.map +1 -1
  101. package/dist/paperless/matching.d.ts +30 -27
  102. package/dist/paperless/matching.d.ts.map +1 -1
  103. package/dist/paperless/providers.d.ts +13 -7
  104. package/dist/paperless/providers.d.ts.map +1 -1
  105. package/dist/paperless/storage-path.d.ts +34 -4
  106. package/dist/paperless/storage-path.d.ts.map +1 -1
  107. package/dist/paperless/tag.d.ts +43 -8
  108. package/dist/paperless/tag.d.ts.map +1 -1
  109. package/dist/proxmox/acl.d.ts +30 -23
  110. package/dist/proxmox/acl.d.ts.map +1 -1
  111. package/dist/proxmox/distilled-pve.d.ts +89 -0
  112. package/dist/proxmox/distilled-pve.d.ts.map +1 -0
  113. package/dist/proxmox/index.js +663 -609
  114. package/dist/proxmox/index.js.map +12 -11
  115. package/dist/proxmox/members.d.ts +29 -10
  116. package/dist/proxmox/members.d.ts.map +1 -1
  117. package/docs/caddy-admin.md +1 -1
  118. package/docs/caddy.md +3 -2
  119. package/docs/credentials.md +16 -0
  120. package/docs/litellm.md +21 -13
  121. package/docs/paperless.md +12 -0
  122. package/docs/peers.md +5 -0
  123. package/docs/repo-policy.md +16 -1
  124. package/docs/repository-ruleset.md +53 -13
  125. package/docs/upstream-conformance.md +126 -10
  126. package/package.json +5 -2
  127. package/src/caddy/admin-address.ts +71 -0
  128. package/src/caddy/admin-calls.ts +48 -100
  129. package/src/caddy/admin.ts +37 -41
  130. package/src/caddy/adopt-scope.test.ts +1 -1
  131. package/src/caddy/caddy-http-client.ts +229 -0
  132. package/src/caddy/config-adopt-provider.test.ts +139 -0
  133. package/src/caddy/config-adopt.test.ts +60 -126
  134. package/src/caddy/config-errors.ts +47 -0
  135. package/src/caddy/config-lifecycle.test.ts +55 -42
  136. package/src/caddy/config-lifecycle.ts +72 -162
  137. package/src/caddy/config-reconcile.ts +138 -0
  138. package/src/caddy/config.ts +36 -42
  139. package/src/caddy/fake-caddy.ts +20 -2
  140. package/src/caddy/index.ts +3 -8
  141. package/src/caddy/local-admin.test.ts +35 -21
  142. package/src/caddy/local-admin.ts +60 -167
  143. package/src/caddy/providers.test.ts +14 -6
  144. package/src/caddy/providers.ts +20 -4
  145. package/src/github/declare-repo-baseline-apply-order.test.ts +86 -0
  146. package/src/github/declare-repo-baseline.ts +40 -7
  147. package/src/github/index.ts +8 -4
  148. package/src/github/repo-apply-order-fake-providers.ts +119 -0
  149. package/src/github/repo-apply-order-fake-stack.ts +74 -0
  150. package/src/github/repo-auto-merge-gate.ts +57 -0
  151. package/src/github/repo-baseline-data.test.ts +13 -0
  152. package/src/github/repo-baseline-data.ts +11 -2
  153. package/src/github/repo-policy-apply-order.test.ts +72 -0
  154. package/src/github/repo-policy-stack.test.ts +59 -0
  155. package/src/github/repo-policy.ts +31 -3
  156. package/src/github/repository-ruleset-errors.ts +6 -4
  157. package/src/github/repository-ruleset-exact-adopt-k1.test.ts +109 -0
  158. package/src/github/repository-ruleset-exact-adopt.test.ts +14 -9
  159. package/src/github/repository-ruleset-form.ts +7 -3
  160. package/src/github/repository-ruleset-guards.ts +3 -2
  161. package/src/github/repository-ruleset-octokit.test.ts +141 -0
  162. package/src/github/repository-ruleset-octokit.ts +121 -30
  163. package/src/github/repository-ruleset-probe.ts +2 -1
  164. package/src/github/repository-ruleset-props.ts +7 -4
  165. package/src/github/repository-ruleset-providers.ts +46 -0
  166. package/src/github/repository-ruleset-wire.test.ts +38 -27
  167. package/src/github/repository-ruleset.ts +27 -3
  168. package/src/litellm/fake-litellm.ts +83 -78
  169. package/src/litellm/fake-stack.ts +13 -5
  170. package/src/litellm/index.ts +7 -21
  171. package/src/litellm/operations.ts +149 -0
  172. package/src/litellm/pass-through-endpoint-delete-swallow.test.ts +17 -20
  173. package/src/litellm/pass-through-endpoint-replace.test.ts +3 -4
  174. package/src/litellm/pass-through-endpoint.test.ts +8 -8
  175. package/src/litellm/pass-through-endpoint.ts +21 -31
  176. package/src/litellm/pass-through-errors.ts +37 -0
  177. package/src/litellm/pass-through-form.ts +20 -10
  178. package/src/litellm/providers.ts +8 -7
  179. package/src/paperless/custom-field.test.ts +49 -40
  180. package/src/paperless/custom-field.ts +57 -33
  181. package/src/paperless/document-type.test.ts +48 -0
  182. package/src/paperless/document-type.ts +51 -22
  183. package/src/paperless/fake-paperless.ts +63 -72
  184. package/src/paperless/index.ts +7 -13
  185. package/src/paperless/matching-locate.test.ts +102 -0
  186. package/src/paperless/matching-locate.ts +80 -86
  187. package/src/paperless/matching-types.ts +49 -16
  188. package/src/paperless/matching.ts +77 -90
  189. package/src/paperless/providers.ts +14 -10
  190. package/src/paperless/storage-path.test.ts +56 -0
  191. package/src/paperless/storage-path.ts +53 -24
  192. package/src/paperless/tag-identity.test.ts +127 -0
  193. package/src/paperless/tag.test.ts +100 -0
  194. package/src/paperless/tag.ts +62 -32
  195. package/src/proxmox/acl.test.ts +145 -0
  196. package/src/proxmox/acl.ts +128 -150
  197. package/src/proxmox/distilled-pve.test.ts +231 -0
  198. package/src/proxmox/distilled-pve.ts +147 -0
  199. package/src/proxmox/members-timeout.test.ts +161 -0
  200. package/src/proxmox/members.test.ts +9 -0
  201. package/src/proxmox/members.ts +36 -2
  202. package/dist/litellm/client.d.ts +0 -76
  203. package/dist/litellm/client.d.ts.map +0 -1
  204. package/dist/litellm/credentials.d.ts +0 -48
  205. package/dist/litellm/credentials.d.ts.map +0 -1
  206. package/dist/litellm/generated/pass-through.d.ts +0 -71
  207. package/dist/litellm/generated/pass-through.d.ts.map +0 -1
  208. package/dist/paperless/client.d.ts +0 -37
  209. package/dist/paperless/client.d.ts.map +0 -1
  210. package/dist/paperless/credentials.d.ts +0 -40
  211. package/dist/paperless/credentials.d.ts.map +0 -1
  212. package/dist/paperless/errors.d.ts +0 -49
  213. package/dist/paperless/errors.d.ts.map +0 -1
  214. package/src/litellm/client.ts +0 -195
  215. package/src/litellm/credentials.ts +0 -73
  216. package/src/litellm/generated/pass-through.ts +0 -73
  217. package/src/paperless/client.ts +0 -88
  218. package/src/paperless/credentials.ts +0 -69
  219. package/src/paperless/errors.ts +0 -62
  220. package/src/paperless/matching-identity.test.ts +0 -194
  221. package/src/paperless/matching.test.ts +0 -128
@@ -18,39 +18,21 @@
18
18
  * ADDRESSED by the id-keyed update/delete calls this provider uses, so it is refused rather than
19
19
  * silently adopted into an id-based lifecycle it cannot actually manage — see docs/litellm.md.
20
20
  * ⛔ NO CREDENTIAL IS A PROP (S25). `LITELLM_PROXY_URL`/`LITELLM_PROXY_API_KEY` are read at call
21
- * time by credentials.ts.
21
+ * time by `@distilled.cloud/litellm`'s own `CredentialsFromEnv` (providers.ts) — the same two
22
+ * variable names the retired hand-rolled `credentials.ts` read.
22
23
  */
23
24
  import { Resource } from 'alchemy';
24
25
  import type { Input } from 'alchemy/Input';
25
26
  import * as Provider from 'alchemy/Provider';
26
27
  import type { Stack } from 'alchemy/Stack';
27
28
  import type { Stage } from 'alchemy/Stage';
29
+ import type * as misc from '@distilled.cloud/litellm/misc';
28
30
  import * as Effect from 'effect/Effect';
29
- import { type LitellmError, type LitellmRequirements } from './client.ts';
31
+ import { type LitellmRequirements } from './operations.ts';
32
+ import { LitellmConfigPathConflictError, LitellmLiteralSecretHeaderError, LitellmUnaddressableRowError } from './pass-through-errors.ts';
30
33
  import { type PassThroughEndpointAttributes, type PassThroughEndpointProps } from './pass-through-form.ts';
31
34
  export type { PassThroughEndpointAttributes, PassThroughEndpointProps };
32
- declare const LitellmConfigPathConflictError_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 & {
33
- readonly _tag: "LitellmConfigPathConflictError";
34
- } & Readonly<A>;
35
- export declare class LitellmConfigPathConflictError extends LitellmConfigPathConflictError_base<{
36
- readonly path: string;
37
- }> {
38
- }
39
- declare const LitellmUnaddressableRowError_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 & {
40
- readonly _tag: "LitellmUnaddressableRowError";
41
- } & Readonly<A>;
42
- export declare class LitellmUnaddressableRowError extends LitellmUnaddressableRowError_base<{
43
- readonly path: string;
44
- }> {
45
- }
46
- declare const LitellmLiteralSecretHeaderError_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 & {
47
- readonly _tag: "LitellmLiteralSecretHeaderError";
48
- } & Readonly<A>;
49
- export declare class LitellmLiteralSecretHeaderError extends LitellmLiteralSecretHeaderError_base<{
50
- readonly headers: readonly string[];
51
- }> {
52
- }
53
- export type PassThroughEndpointError = LitellmError | LitellmConfigPathConflictError | LitellmUnaddressableRowError | LitellmLiteralSecretHeaderError;
35
+ export { LitellmConfigPathConflictError, LitellmLiteralSecretHeaderError, LitellmUnaddressableRowError, type PassThroughEndpointError, } from './pass-through-errors.ts';
54
36
  export interface LiteLLMPassThroughEndpoint extends Resource<'LiteLLM.PassThroughEndpoint', PassThroughEndpointProps, PassThroughEndpointAttributes, never, LitellmRequirements | Stack | Stage> {
55
37
  }
56
38
  export declare const LiteLLMPassThroughEndpoint: import("alchemy").ResourceClass<LiteLLMPassThroughEndpoint>;
@@ -62,7 +44,7 @@ export declare const passThroughHandlers: {
62
44
  instanceId: string;
63
45
  olds: PassThroughEndpointProps;
64
46
  output: PassThroughEndpointAttributes | undefined;
65
- }) => Effect.Effect<PassThroughEndpointAttributes | undefined, LitellmConfigPathConflictError | LitellmUnaddressableRowError | LitellmError, import("alchemy").InstanceId | Stack | Stage | LitellmRequirements>;
47
+ }) => Effect.Effect<PassThroughEndpointAttributes | undefined, LitellmConfigPathConflictError | LitellmUnaddressableRowError | misc.GetPassThroughEndpointsConfigPassThroughEndpointGetError, import("alchemy").InstanceId | Stack | Stage | misc.LitellmOpContext>;
66
48
  diff: ({ news, output, }: {
67
49
  news: Input<PassThroughEndpointProps>;
68
50
  output: PassThroughEndpointAttributes | undefined;
@@ -81,14 +63,14 @@ export declare const passThroughHandlers: {
81
63
  instanceId: string;
82
64
  news: PassThroughEndpointProps;
83
65
  output: PassThroughEndpointAttributes | undefined;
84
- }) => Effect.Effect<PassThroughEndpointAttributes, LitellmConfigPathConflictError | LitellmLiteralSecretHeaderError | LitellmUnaddressableRowError | LitellmError, import("alchemy").InstanceId | Stack | Stage | LitellmRequirements>;
66
+ }) => Effect.Effect<PassThroughEndpointAttributes, LitellmConfigPathConflictError | LitellmLiteralSecretHeaderError | LitellmUnaddressableRowError | misc.UpdatePassThroughEndpointsConfigPassThroughEndpointEndpointIdPostError, import("alchemy").InstanceId | Stack | Stage | misc.LitellmOpContext>;
85
67
  delete: ({ id, instanceId, olds, output, }: {
86
68
  id: string;
87
69
  instanceId: string;
88
70
  olds: PassThroughEndpointProps;
89
71
  output: PassThroughEndpointAttributes;
90
- }) => Effect.Effect<void, LitellmError, import("alchemy").InstanceId | Stack | Stage | LitellmRequirements>;
72
+ }) => Effect.Effect<void, misc.DeletePassThroughEndpointsConfigPassThroughEndpointDeleteError, import("alchemy").InstanceId | Stack | Stage | misc.LitellmOpContext>;
91
73
  list: () => Effect.Effect<never[], never, never>;
92
74
  };
93
- export declare const LiteLLMPassThroughEndpointProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMPassThroughEndpoint>, never, Stack | Stage | LitellmRequirements>;
75
+ export declare const LiteLLMPassThroughEndpointProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMPassThroughEndpoint>, never, Stack | Stage | misc.LitellmOpContext>;
94
76
  //# sourceMappingURL=pass-through-endpoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pass-through-endpoint.d.ts","sourceRoot":"","sources":["../../src/litellm/pass-through-endpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAA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B,+BAA+B,EAC/B,4BAA4B,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,0BAA2B,SAAQ,QAAQ,CAC1D,6BAA6B,EAC7B,wBAAwB,EACxB,6BAA6B,EAC7B,KAAK,EACL,mBAAmB,GAAG,KAAK,GAAG,KAAK,CACpC;CAAG;AAEJ,eAAO,MAAM,0BAA0B,6DAEtC,CAAC;AAEF,eAAO,MAAM,4BAA4B,UAAW,OAAO,KAAG,KAAK,IAAI,0BACe,CAAC;AAkDvF,6GAA6G;AAC7G,eAAO,MAAM,mBAAmB;IAC9B,IAAI,sCAKD;QACD,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,wBAAwB,CAAC;QAC/B,MAAM,EAAE,6BAA6B,GAAG,SAAS,CAAC;KACnD;IAUD,IAAI,sBAGD;QACD,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACtC,MAAM,EAAE,6BAA6B,GAAG,SAAS,CAAC;KACnD;yBAQoD,SAAS;;;;yBAE3C,MAAM;;;yBACN,QAAQ;;IAG3B,SAAS,sCAKN;QACD,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,wBAAwB,CAAC;QAC/B,MAAM,EAAE,6BAA6B,GAAG,SAAS,CAAC;KACnD;IAwCD,MAAM,sCAKH;QACD,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,wBAAwB,CAAC;QAC/B,MAAM,EAAE,6BAA6B,CAAC;KACvC;IAWD,IAAI;CACL,CAAC;AAEF,eAAO,MAAM,kCAAkC,iIAI5C,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The typed refusals `LiteLLM.PassThroughEndpoint` raises on top of `@distilled.cloud/litellm`'s
3
+ * own SDK errors — split out of pass-through-endpoint.ts to keep that file under the house's
4
+ * 250-line cap once this migration added the four named SDK error-union re-exports.
5
+ */
6
+ import type * as misc from '@distilled.cloud/litellm/misc';
7
+ declare const LitellmConfigPathConflictError_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 & {
8
+ readonly _tag: "LitellmConfigPathConflictError";
9
+ } & Readonly<A>;
10
+ export declare class LitellmConfigPathConflictError extends LitellmConfigPathConflictError_base<{
11
+ readonly path: string;
12
+ }> {
13
+ }
14
+ declare const LitellmUnaddressableRowError_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 & {
15
+ readonly _tag: "LitellmUnaddressableRowError";
16
+ } & Readonly<A>;
17
+ export declare class LitellmUnaddressableRowError extends LitellmUnaddressableRowError_base<{
18
+ readonly path: string;
19
+ }> {
20
+ }
21
+ declare const LitellmLiteralSecretHeaderError_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 & {
22
+ readonly _tag: "LitellmLiteralSecretHeaderError";
23
+ } & Readonly<A>;
24
+ export declare class LitellmLiteralSecretHeaderError extends LitellmLiteralSecretHeaderError_base<{
25
+ readonly headers: readonly string[];
26
+ }> {
27
+ }
28
+ /**
29
+ * ⛔ THE FOUR SDK ERROR UNIONS, NAMED, NOT `LitellmOpError` ALONE. `catchTag`'s tag-literal
30
+ * inference needs a concrete union to resolve `"BadRequest"`/`"NotFound"` against (the same
31
+ * reason `netbox/resource.ts` leaves `NotFound` folding to each resource file, not its shared
32
+ * engine) — `operations.ts` already returns each call's own precise per-operation error type, so
33
+ * this is just their union, not a re-widening.
34
+ */
35
+ export type PassThroughEndpointError = misc.GetPassThroughEndpointsConfigPassThroughEndpointGetError | misc.CreatePassThroughEndpointsConfigPassThroughEndpointPostError | misc.UpdatePassThroughEndpointsConfigPassThroughEndpointEndpointIdPostError | misc.DeletePassThroughEndpointsConfigPassThroughEndpointDeleteError | LitellmConfigPathConflictError | LitellmUnaddressableRowError | LitellmLiteralSecretHeaderError;
36
+ export {};
37
+ //# sourceMappingURL=pass-through-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pass-through-errors.d.ts","sourceRoot":"","sources":["../../src/litellm/pass-through-errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,KAAK,IAAI,MAAM,+BAA+B,CAAC;;;;AAG3D,qBAAa,8BAA+B,SAAQ,oCAElD;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;CAAG;;;;AACL,qBAAa,4BAA6B,SAAQ,kCAAiD;IACjG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;CAAG;;;;AACL,qBAAa,+BAAgC,SAAQ,qCAEnD;IACA,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;CAAG;AAEL;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC,IAAI,CAAC,wDAAwD,GAC7D,IAAI,CAAC,4DAA4D,GACjE,IAAI,CAAC,sEAAsE,GAC3E,IAAI,CAAC,8DAA8D,GACnE,8BAA8B,GAC9B,4BAA4B,GAC5B,+BAA+B,CAAC"}
@@ -1,4 +1,4 @@
1
- import type * as Generated from './generated/pass-through.ts';
1
+ import type * as Generated from '@distilled.cloud/litellm/misc';
2
2
  export type PassThroughEndpointProps = Omit<Generated.PassThroughGenericEndpoint, 'id' | 'is_from_config'>;
3
3
  /** What `read` returns: the props plus the two vendor-owned fields, `id` now guaranteed present. */
4
4
  export type PassThroughEndpointAttributes = Omit<Generated.PassThroughGenericEndpoint, 'id'> & {
@@ -8,8 +8,8 @@ export type PassThroughEndpointAttributes = Omit<Generated.PassThroughGenericEnd
8
8
  export declare const settled: (props: PassThroughEndpointProps) => {
9
9
  auth: boolean;
10
10
  cost_per_request: number;
11
- default_query_params: Record<string, unknown>;
12
- headers: Record<string, unknown>;
11
+ default_query_params: Generated.PassThroughGenericEndpointDefaultQueryParamsMap;
12
+ headers: Generated.PassThroughGenericEndpointHeadersMap;
13
13
  include_subpath: boolean;
14
14
  };
15
15
  /** The three fields whose absence the vendor's `exclude_none` update can never write (see client.ts). */
@@ -25,8 +25,15 @@ export declare const createBody: (props: PassThroughEndpointProps, id: string) =
25
25
  * `undefined` OR an explicit `null` here would be dropped by the server anyway; sending neither is
26
26
  * the same outcome with no request made when nothing changed (`Object.keys(body).length === 0`
27
27
  * checked by the caller in pass-through-endpoint.ts).
28
+ *
29
+ * ⛔ `path`/`target` ARE NOT `Partial` HERE, UNLIKE EVERY OTHER FIELD. The SDK's own update
30
+ * request type requires both non-optionally (the vendor's PATCH route still wants the full
31
+ * route/target pair on every call, unlike the other fields' `exclude_none` merge) — typing them
32
+ * as always-present here is what lets `operations.ts`'s `updatePassThroughEndpoint` pass this
33
+ * straight to the SDK without an unsafe cast.
28
34
  */
29
- export declare const updateBody: (props: PassThroughEndpointProps) => Partial<Generated.PassThroughGenericEndpoint>;
35
+ export type UpdateBody = Partial<Omit<Generated.PassThroughGenericEndpoint, 'path' | 'target'>> & Pick<Generated.PassThroughGenericEndpoint, 'path' | 'target'>;
36
+ export declare const updateBody: (props: PassThroughEndpointProps) => UpdateBody;
30
37
  /**
31
38
  * Whether ANY of the three nullable fields went from set (in `live`) to unset (in `props`) — the
32
39
  * one case `updateBody` cannot express, because the vendor's `exclude_none` merge silently keeps
@@ -1 +1 @@
1
- {"version":3,"file":"pass-through-form.d.ts","sourceRoot":"","sources":["../../src/litellm/pass-through-form.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,SAAS,MAAM,6BAA6B,CAAC;AAE9D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,SAAS,CAAC,0BAA0B,EACpC,IAAI,GAA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,EAAE,IAAI,CAAC,GAAG;IAC7F,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wHAAwH;AACxH,eAAO,MAAM,OAAO,UAAW,wBAAwB;IACrD,IAAI;IACJ,gBAAgB;IAChB,oBAAoB;IACpB,OAAO;IACP,eAAe;CACf,CAAC;AAEH,yGAAyG;AACzG,eAAO,MAAM,eAAe,YAAI,SAAS,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;AAa7E;;;GAGG;AACH,eAAO,MAAM,UAAU,UACd,wBAAwB,MAC3B,MAAM,KACT,SAAS,CAAC,0BAS0C,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,GAC7F,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEhE,eAAO,MAAM,UAAU,UAAW,wBAAwB,KAAG,UAQ3C,CAAC;AAEnB;;;;;GAKG;AACH,eAAO,MAAM,YAAY,SACjB,6BAA6B,SAC5B,wBAAwB,KAC9B,OAA0F,CAAC;AAE9F,+FAA+F;AAC/F,eAAO,MAAM,OAAO,SACZ,6BAA6B,SAC5B,wBAAwB,KAC9B,OAeF,CAAC;AAWF,eAAO,MAAM,oBAAoB,YACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,KACrD,SAAS,MAAM,EAMQ,CAAC"}
@@ -3,14 +3,16 @@
3
3
  *
4
4
  * Layer.mergeAll(litellmProviders(), …the stack's other providers)
5
5
  *
6
- * ★ THE DEFAULT READS `LITELLM_PROXY_URL`/`LITELLM_PROXY_API_KEY` AT CALL TIME (credentials.ts),
7
- * never at layer build — pass another `Layer.Layer<LitellmCredentials>` (see
8
- * `litellmCredentialsLayerFor` in a test) to source them another way.
6
+ * ★ THE DEFAULT READS `LITELLM_PROXY_URL`/`LITELLM_PROXY_API_KEY` AT CALL TIME, through
7
+ * `@distilled.cloud/litellm`'s own `CredentialsFromEnv` — the same two variable names the
8
+ * retired hand-rolled `credentials.ts` read — never at layer build. Pass another
9
+ * `Layer.Layer<Credentials>` (see the SDK's own `credentials({ apiKey, baseUrl })` in a test) to
10
+ * source them another way.
9
11
  * ⚠️ `HttpClient` is NOT provided here. It is ambient in every Alchemy runtime the same way it is
10
12
  * for `netboxProviders`-style families in this kit; a stack that already deploys anything over
11
13
  * HTTP already has one.
12
14
  */
15
+ import { type Credentials } from '@distilled.cloud/litellm/Credentials';
13
16
  import * as Layer from 'effect/Layer';
14
- import { type LitellmCredentials } from './credentials.ts';
15
- export declare const litellmProviders: (creds?: Layer.Layer<LitellmCredentials>) => Layer.Layer<import("alchemy").Provider<import("./pass-through-endpoint.ts").LiteLLMPassThroughEndpoint>, never, import("effect/unstable/http/HttpClient").HttpClient | import("alchemy").Stack | import("alchemy").Stage>;
17
+ export declare const litellmProviders: (creds?: Layer.Layer<Credentials>) => Layer.Layer<import("alchemy").Provider<import("./pass-through-endpoint.ts").LiteLLMPassThroughEndpoint>, never, import("effect/unstable/http/HttpClient").HttpClient | import("alchemy").Stack | import("alchemy").Stage>;
16
18
  //# sourceMappingURL=providers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/litellm/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,kBAAkB,EAA2B,MAAM,kBAAkB,CAAC;AAGpF,eAAO,MAAM,gBAAgB,WACpB,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,8NAC4B,CAAC"}
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/litellm/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,eAAO,MAAM,gBAAgB,WAAW,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,8NACC,CAAC"}
@@ -89,7 +89,7 @@ export declare const handlers: {
89
89
  list: () => Effect.Effect<never[], never, never>;
90
90
  read: ({ olds }: {
91
91
  olds: PrefixProps;
92
- }) => Effect.Effect<PrefixAttributes | undefined, import("@distilled.cloud/core/errors").BadGateway | ipam.BadRequest | import("@distilled.cloud/core/errors").ConfigError | ipam.Forbidden | import("@distilled.cloud/core/errors").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/core/errors").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/core/errors").ServiceUnavailable | import("@distilled.cloud/core/errors").TooManyRequests | import("@distilled.cloud/core/errors").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
92
+ }) => Effect.Effect<PrefixAttributes | undefined, import("@distilled.cloud/caddy").BadGateway | ipam.BadRequest | import("@distilled.cloud/caddy").ConfigError | ipam.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
93
93
  diff: ({ news, output }: {
94
94
  news: import("alchemy").Input<PrefixProps>;
95
95
  output: PrefixAttributes | undefined;
@@ -99,13 +99,13 @@ export declare const handlers: {
99
99
  readonly action: 'noop';
100
100
  } | {
101
101
  readonly action: 'replace';
102
- } | undefined, import("@distilled.cloud/core/errors").BadGateway | ipam.BadRequest | import("@distilled.cloud/core/errors").ConfigError | ipam.Forbidden | import("@distilled.cloud/core/errors").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/core/errors").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/core/errors").ServiceUnavailable | import("@distilled.cloud/core/errors").TooManyRequests | import("@distilled.cloud/core/errors").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
102
+ } | undefined, import("@distilled.cloud/caddy").BadGateway | ipam.BadRequest | import("@distilled.cloud/caddy").ConfigError | ipam.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
103
103
  reconcile: ({ news }: {
104
104
  news: PrefixProps;
105
- }) => Effect.Effect<PrefixAttributes, import("@distilled.cloud/core/errors").BadGateway | ipam.BadRequest | import("@distilled.cloud/core/errors").ConfigError | ipam.Forbidden | import("@distilled.cloud/core/errors").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/core/errors").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/core/errors").ServiceUnavailable | import("@distilled.cloud/core/errors").TooManyRequests | import("@distilled.cloud/core/errors").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
105
+ }) => Effect.Effect<PrefixAttributes, import("@distilled.cloud/caddy").BadGateway | ipam.BadRequest | import("@distilled.cloud/caddy").ConfigError | ipam.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
106
106
  delete: ({ olds }: {
107
107
  olds: PrefixProps;
108
- }) => Effect.Effect<void, import("@distilled.cloud/core/errors").BadGateway | ipam.BadRequest | import("@distilled.cloud/core/errors").ConfigError | ipam.Forbidden | import("@distilled.cloud/core/errors").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/core/errors").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/core/errors").ServiceUnavailable | import("@distilled.cloud/core/errors").TooManyRequests | import("@distilled.cloud/core/errors").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
108
+ }) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | ipam.BadRequest | import("@distilled.cloud/caddy").ConfigError | ipam.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/netbox/Errors").NetboxParseError | ipam.NotFound | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/netbox/Errors").UnknownNetboxError, import("effect/unstable/http/HttpClient").HttpClient>;
109
109
  };
110
110
  export declare const NetboxPrefixProvider: () => import("effect/Layer").Layer<Provider.Provider<NetboxPrefix>, never, import("effect/unstable/http/HttpClient").HttpClient>;
111
111
  //# sourceMappingURL=prefix.d.ts.map
@@ -7,27 +7,26 @@
7
7
  * this refusal generically; `dataType` is simply never listed in `fields`, so nothing in
8
8
  * `matching.ts` ever builds a PATCH body that includes it.
9
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.
10
+ * ⛔ NO `owner` FIELD, AND NO `ownerOf` SPEC ENTRY. Unlike `Tag`/`DocumentType`/`StoragePath`,
11
+ * `CustomField` does not extend Paperless-ngx's `OwnedObjectSerializer` — its wire body is
12
+ * exactly `{name, data_type, extra_data}` (measured against the v3.1.1 schema, and confirmed
13
+ * again in `@distilled.cloud/paperless-ngx`'s generated `custom_fields.ts`, which has no
14
+ * `owner` field either). `owned: false` stops `matching.ts` sending or comparing one.
14
15
  *
15
16
  * ⚠️ `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
+ * not in the served schema at all, so it is recorded here and NOT enforced (groundTruth). See
18
+ * `tag.ts`'s header for the 2026-09-24 transport migration this file follows.
17
19
  */
18
20
  import { Resource } from 'alchemy';
19
21
  import * as Provider from 'alchemy/Provider';
22
+ import * as customFields from '@distilled.cloud/paperless-ngx/custom_fields';
20
23
  import * as Effect from 'effect/Effect';
21
24
  import type { PaperlessCustomFieldRequest } from './generated/types/custom-fields.ts';
22
- import type { PaperlessRow } from './client.ts';
23
- import { type MatchingRequirements } from './matching.ts';
25
+ import { type MatchingRequirements, type MatchingSpec } from './matching.ts';
24
26
  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. */
27
+ /** ⚠️ maxLength 128 (generated constraint table). CustomField's name is globally unique (models.py:1169), with no owner to further scope it. */
26
28
  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
- */
29
+ /** ⛔ CREATE-ONLY — see this file's header. `select`'s own option list (`select_options`) is not in the vendor schema and is unenforced here. */
31
30
  dataType: PaperlessCustomFieldRequest['data_type'];
32
31
  /** Arbitrary JSON the vendor attaches no schema to (e.g. a `select` field's option list). */
33
32
  extraData?: unknown;
@@ -42,16 +41,17 @@ export interface CustomField extends Resource<'Paperless.CustomField', CustomFie
42
41
  }
43
42
  export declare const CustomField: import("alchemy").ResourceClass<CustomField>;
44
43
  /**
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`.
44
+ * ⛔ EXTRACTED SO IT CAN BE TESTED WITHOUT A SERVER (custom-field.test.ts). `Pick<…, 'data_type'>`
45
+ * rather than the full `CustomField`, so a test fixture need not spell out `name`/`document_count`.
47
46
  */
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. */
47
+ export declare const dataTypeImmutable: (live: Pick<customFields.CustomField, 'data_type'>, props: CustomFieldProps) => string | undefined;
48
+ /** ★ Exported for direct testing — see tag.ts's own note on this seam. */
49
+ export declare const spec: MatchingSpec<CustomFieldProps, customFields.CustomField, CustomFieldAttributes, customFields.CreateCustomFieldError | customFields.GetCustomFieldError | customFields.ListCustomFieldsError | customFields.UpdateCustomFieldsPartialError | customFields.CustomFieldsDestroyError>;
50
50
  export declare const customFieldHandlers: {
51
51
  list: () => Effect.Effect<never[], never, never>;
52
52
  read: ({ olds }: {
53
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>;
54
+ }) => Effect.Effect<CustomFieldAttributes | undefined, import("@distilled.cloud/caddy").BadGateway | customFields.BadRequest | import("@distilled.cloud/caddy").ConfigError | customFields.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | customFields.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
55
55
  diff: ({ news, output }: {
56
56
  news: import("alchemy").Input<CustomFieldProps>;
57
57
  output: CustomFieldAttributes | undefined;
@@ -61,15 +61,15 @@ export declare const customFieldHandlers: {
61
61
  readonly action: 'noop';
62
62
  } | {
63
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>;
64
+ } | undefined, import("@distilled.cloud/caddy").BadGateway | customFields.BadRequest | import("@distilled.cloud/caddy").ConfigError | customFields.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | customFields.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
65
65
  reconcile: ({ news, output }: {
66
66
  news: CustomFieldProps;
67
67
  output?: CustomFieldAttributes | undefined;
68
- }) => Effect.Effect<CustomFieldAttributes, import("./credentials.ts").PaperlessCredentialsError | import("./errors.ts").PaperlessError, import("./client.ts").PaperlessRequirements>;
68
+ }) => Effect.Effect<CustomFieldAttributes, import("@distilled.cloud/caddy").BadGateway | customFields.BadRequest | import("@distilled.cloud/caddy").ConfigError | customFields.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | customFields.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
69
69
  delete: ({ olds, output }: {
70
70
  olds: CustomFieldProps;
71
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>;
72
+ }) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | customFields.BadRequest | import("@distilled.cloud/caddy").ConfigError | customFields.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | customFields.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
73
73
  };
74
- export declare const CustomFieldProvider: () => import("effect/Layer").Layer<Provider.Provider<CustomField>, never, import("./client.ts").PaperlessRequirements>;
74
+ export declare const CustomFieldProvider: () => import("effect/Layer").Layer<Provider.Provider<CustomField>, never, import("effect/unstable/http/HttpClient").HttpClient>;
75
75
  //# sourceMappingURL=custom-field.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"custom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AAC,qBAAqB,GAClC,YAAY,CAAC,8BAA8B,GAC3C,YAAY,CAAC,wBAAwB,CA+BxC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;CAAyB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,iIAC4D,CAAC"}
@@ -1,15 +1,19 @@
1
1
  /**
2
2
  * `Paperless.DocumentType` — a Paperless-ngx document type, create-or-update and never deleted.
3
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.
4
+ * `matchingAlgorithm`'s type comes off the generated request type rather than being retyped, and
5
+ * for the 2026-09-24 transport migration this file follows exactly.
5
6
  */
6
7
  import { Resource } from 'alchemy';
7
8
  import * as Provider from 'alchemy/Provider';
9
+ import * as documentTypes from '@distilled.cloud/paperless-ngx/document_types';
10
+ import * as Effect from 'effect/Effect';
8
11
  import type { PaperlessDocumentTypeRequest } from './generated/types/document-types.ts';
9
- import { type MatchingProps, type MatchingRequirements } from './matching.ts';
10
- export interface DocumentTypeProps extends MatchingProps {
12
+ import { type MatchingRequirements, type MatchingSpec } from './matching.ts';
13
+ export interface DocumentTypeProps {
11
14
  /** ⚠️ maxLength 128 (generated constraint table). The locate key. */
12
15
  name: string;
16
+ owner?: number;
13
17
  /** ⚠️ maxLength 256. */
14
18
  match?: string;
15
19
  matchingAlgorithm?: PaperlessDocumentTypeRequest['matching_algorithm'];
@@ -26,5 +30,31 @@ export interface DocumentTypeAttributes {
26
30
  export interface DocumentType extends Resource<'Paperless.DocumentType', DocumentTypeProps, DocumentTypeAttributes, never, MatchingRequirements> {
27
31
  }
28
32
  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>;
33
+ /** ★ Exported for direct testing — see tag.ts's own note on this seam. */
34
+ export declare const spec: MatchingSpec<DocumentTypeProps, documentTypes.DocumentType, DocumentTypeAttributes, documentTypes.CreateDocumentTypeError | documentTypes.GetDocumentTypeError | documentTypes.ListDocumentTypesError | documentTypes.UpdateDocumentTypesPartialError | documentTypes.DocumentTypesDestroyError>;
35
+ export declare const handlers: {
36
+ list: () => Effect.Effect<never[], never, never>;
37
+ read: ({ olds }: {
38
+ olds: DocumentTypeProps;
39
+ }) => Effect.Effect<DocumentTypeAttributes | undefined, import("@distilled.cloud/caddy").BadGateway | documentTypes.BadRequest | import("@distilled.cloud/caddy").ConfigError | documentTypes.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | documentTypes.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
40
+ diff: ({ news, output }: {
41
+ news: import("alchemy").Input<DocumentTypeProps>;
42
+ output: DocumentTypeAttributes | undefined;
43
+ }) => Effect.Effect<{
44
+ readonly action: 'update';
45
+ } | {
46
+ readonly action: 'noop';
47
+ } | {
48
+ readonly action: 'replace';
49
+ } | undefined, import("@distilled.cloud/caddy").BadGateway | documentTypes.BadRequest | import("@distilled.cloud/caddy").ConfigError | documentTypes.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | documentTypes.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
50
+ reconcile: ({ news, output }: {
51
+ news: DocumentTypeProps;
52
+ output?: DocumentTypeAttributes | undefined;
53
+ }) => Effect.Effect<DocumentTypeAttributes, import("@distilled.cloud/caddy").BadGateway | documentTypes.BadRequest | import("@distilled.cloud/caddy").ConfigError | documentTypes.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | documentTypes.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
54
+ delete: ({ olds, output }: {
55
+ olds: DocumentTypeProps;
56
+ output?: DocumentTypeAttributes | undefined;
57
+ }) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | documentTypes.BadRequest | import("@distilled.cloud/caddy").ConfigError | documentTypes.Forbidden | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | documentTypes.NotFound | import("@distilled.cloud/paperless-ngx/Errors").PaperlessNgxParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/paperless-ngx/Errors").UnknownPaperlessNgxError, import("effect/unstable/http/HttpClient").HttpClient>;
58
+ };
59
+ export declare const DocumentTypeProvider: () => import("effect/Layer").Layer<Provider.Provider<DocumentType>, never, import("effect/unstable/http/HttpClient").HttpClient>;
30
60
  //# sourceMappingURL=document-type.d.ts.map
@@ -1 +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;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AElB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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;AAEH,0EAA0E;AAC1E,eAAO,MAAM,IAAI,EAAE,YAAY,CAC7B,iBAAiB,EACjB,aAAa,CAAC,YAAY,EAC1B,sBAAsB,EACpB,aAAa,CAAC,uBAAuB,GACrC,aAAa,CAAC,oBAAoB,GAClC,aAAa,CAAC,sBAAsB,GACpC,aAAa,CAAC,+BAA+B,GAC7C,aAAa,CAAC,yBAAyB,CAuC1C,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;CAAyB,CAAC;AAE/C,eAAO,MAAM,oBAAoB,kIACkD,CAAC"}
@@ -1,39 +1,56 @@
1
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.
2
+ * A minimal in-memory Paperless-ngx REST API for this family's tests — an in-memory `fetch`
3
+ * handed to Effect's real `FetchHttpClient` through its `Fetch` reference, mirroring
4
+ * `../netbox/fake-netbox.ts` and `../forgejo/fake-forgejo.ts`. Tests exercise distilled's REAL
5
+ * path assembly, JSON encode/decode and status→typed-error matching (`404` → `NotFound`, `403` →
6
+ * `Forbidden`, `400` → `BadRequest`, …) — nothing about that matching is re-implemented here, only
7
+ * the wire responses and in-memory rows a scenario needs.
4
8
  *
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.
9
+ * ⛔ TEST-ONLY, AND NO NETWORK. No provider imports this file. Stores rows in memory for the four
10
+ * taxonomy collections and answers `name__iexact` the way Django does — case-insensitive, never
11
+ * collapsing two differently-cased rows into one. Ported from the pre-migration `Bun.serve`
12
+ * fake: production now goes through `@distilled.cloud/paperless-ngx`'s `CredentialsFromEnv`,
13
+ * which resolves through Effect `Config` and snapshots `process.env` once (measured in the
14
+ * forgejo migration, kit PR 180) — a test can no longer point production code at a fake server
15
+ * by mutating env vars, so this hands an explicit `credentials()` layer instead.
8
16
  */
17
+ import { type Credentials } from '@distilled.cloud/paperless-ngx/Credentials';
18
+ import type { PaperlessNgxOpContext } from '@distilled.cloud/paperless-ngx/Protocol';
9
19
  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";
20
+ import * as Layer from 'effect/Layer';
21
+ export declare const FAKE_BASE = "https://paperless.example.com";
22
+ export declare const FAKE_TOKEN = "placeholder-paperless-token";
14
23
  export interface Seen {
15
24
  readonly method: string;
16
25
  readonly path: string;
17
- readonly headers: Headers;
18
26
  readonly body: string;
19
27
  }
20
28
  export type Row = Record<string, unknown> & {
21
29
  id: number;
22
30
  };
23
31
  declare const COLLECTIONS: readonly ['tags', 'document_types', 'storage_paths', 'custom_fields'];
32
+ type Collection = (typeof COLLECTIONS)[number];
24
33
  export interface FakePaperless {
25
- readonly url: string;
34
+ readonly fetch: typeof globalThis.fetch;
26
35
  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. */
36
+ readonly rows: (collection: Collection) => readonly Row[];
37
+ /** `undefined` to answer normally; a status to force it once for the NEXT call only. */
29
38
  forceStatus: number | undefined;
30
- stop(): void;
31
39
  }
40
+ /**
41
+ * A stateful CRUD router across the four collections — this is what makes it possible to test
42
+ * `matching.ts`'s full create → read-back → PATCH → DELETE lifecycle, not just one canned
43
+ * response per test the way `fakeNetbox`/`fakeForgejo`'s simpler `route` callback does.
44
+ */
32
45
  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>;
46
+ /**
47
+ * distilled Credentials + the real FetchHttpClient over the fake — `PaperlessNgxOpContext`, what
48
+ * `matchingOperations(spec)` (matching.ts, unwrapped — not `matchingHandlers`, which bakes in
49
+ * `CredentialsFromEnv` and so cannot be pointed at a fake server, per this file's own header)
50
+ * needs to run against a fake.
51
+ */
52
+ export declare const fakePaperlessLayer: (fetchFn: typeof globalThis.fetch, creds?: Layer.Layer<Credentials>) => Layer.Layer<Credentials | import("effect/unstable/http/HttpClient").HttpClient, never, never>;
53
+ export declare const run: <A, E>(effect: Effect.Effect<A, E, PaperlessNgxOpContext>, fetchFn: typeof globalThis.fetch) => Promise<A>;
54
+ export declare const runFailure: <A, E>(effect: Effect.Effect<A, E, PaperlessNgxOpContext>, fetchFn: typeof globalThis.fetch) => Promise<E>;
38
55
  export {};
39
56
  //# sourceMappingURL=fake-paperless.d.ts.map
@@ -1 +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,IA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AU,CAAC;AAC1F,KAAK,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,SAAS,GAAG,EAAE,CAAC;IAC1D,wFAAwF;IACxF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAWD;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAAO,aAmEhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,YACpB,OAAO,UAAU,CAAC,KAAK,UACzB,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,kGAC+D,CAAC;AAEjG,eAAO,MAAM,GAAG,GAAI,CAAC,EAAE,CAAC,UACd,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,qBAAqB,CAAC,WACzC,OAAO,UAAU,CAAC,KAAK,eAC8C,CAAC;AAEjF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,CAAC,UACrB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,qBAAqB,CAAC,WACzC,OAAO,UAAU,CAAC,KAAK,eAC2D,CAAC"}
@@ -5,9 +5,14 @@
5
5
  * header. `matching.ts`'s internals and the raw generated modules are not re-exported; a
6
6
  * consumer wanting the same guard a Resource uses gets it through `constraintsFor`/
7
7
  * `bodyViolations`, not by importing `generated/` directly.
8
+ *
9
+ * 🔴 `PaperlessCredentials`/`PaperlessError` AND FRIENDS ARE GONE (2026-09-24, the
10
+ * `@distilled.cloud/paperless-ngx` migration — matching.ts's header), the same way
11
+ * `../netbox/index.ts` dropped `NetboxError`/`apiBase` in its own migration. A caller that
12
+ * needs the typed errors now imports them from `@distilled.cloud/paperless-ngx` directly (e.g.
13
+ * `@distilled.cloud/paperless-ngx/tags`'s `NotFound`); nothing in this estate imported the old
14
+ * names (measured 2026-09-24).
8
15
  */
9
- export { PaperlessCredentials, type PaperlessCredentialValue, PaperlessCredentialsError, environmentLayer as paperlessEnvironmentLayer, } from './credentials.ts';
10
- export { PaperlessNotFound, PaperlessUnauthorized, PaperlessValidation, PaperlessUnavailable, type PaperlessError, } from './errors.ts';
11
16
  export { PAPERLESS_CONSTRAINTS, bodyViolations, constraintsFor, guardBody, } from './constraint-guard.ts';
12
17
  export { type EndpointConstraints, type EndpointKey, type ParamConstraint, type PaperlessBody, refusal, violations, } from './constraints.ts';
13
18
  export { PAPERLESS_CONSTRAINTS_DIGEST } from './generated/constraints/index.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/paperless/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,gBAAgB,IAAI,yBAAyB,GAC9C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,OAAO,EACP,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,KA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