@homeflare/alchemy 0.27.4 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/caddy/admin-address.d.ts +27 -0
- package/dist/caddy/admin-address.d.ts.map +1 -0
- package/dist/caddy/admin-calls.d.ts +25 -28
- package/dist/caddy/admin-calls.d.ts.map +1 -1
- package/dist/caddy/admin.d.ts +28 -38
- package/dist/caddy/admin.d.ts.map +1 -1
- package/dist/caddy/caddy-http-client.d.ts +25 -0
- package/dist/caddy/caddy-http-client.d.ts.map +1 -0
- package/dist/caddy/config-errors.d.ts +24 -0
- package/dist/caddy/config-errors.d.ts.map +1 -0
- package/dist/caddy/config-lifecycle.d.ts +20 -49
- package/dist/caddy/config-lifecycle.d.ts.map +1 -1
- package/dist/caddy/config-reconcile.d.ts +45 -0
- package/dist/caddy/config-reconcile.d.ts.map +1 -0
- package/dist/caddy/config.d.ts +4 -3
- package/dist/caddy/config.d.ts.map +1 -1
- package/dist/caddy/fake-caddy.d.ts +10 -2
- package/dist/caddy/fake-caddy.d.ts.map +1 -1
- package/dist/caddy/index.d.ts +3 -3
- package/dist/caddy/index.d.ts.map +1 -1
- package/dist/caddy/index.js +487 -444
- package/dist/caddy/index.js.map +16 -12
- package/dist/caddy/local-admin.d.ts +20 -34
- package/dist/caddy/local-admin.d.ts.map +1 -1
- package/dist/caddy/providers.d.ts +19 -3
- package/dist/caddy/providers.d.ts.map +1 -1
- package/dist/cloudflare/mesh-node-token.d.ts +1 -1
- package/dist/cloudflare/mesh-node-token.d.ts.map +1 -1
- package/dist/forgejo/branch-protection.d.ts +4 -4
- package/dist/forgejo/org-actions-secrets.d.ts +4 -4
- package/dist/forgejo/org-label.d.ts +4 -4
- package/dist/forgejo/org-team.d.ts +4 -4
- package/dist/forgejo/repo-webhook.d.ts +4 -4
- package/dist/forgejo/repository.d.ts +4 -4
- package/dist/forgejo/team-member.d.ts +4 -4
- package/dist/github/declare-repo-baseline.d.ts +1 -1
- package/dist/github/declare-repo-baseline.d.ts.map +1 -1
- package/dist/github/index.d.ts +9 -5
- package/dist/github/index.d.ts.map +1 -1
- package/dist/github/index.js +161 -25
- package/dist/github/index.js.map +15 -13
- package/dist/github/repo-baseline-data.d.ts +10 -1
- package/dist/github/repo-baseline-data.d.ts.map +1 -1
- package/dist/github/repo-policy.d.ts +1 -1
- package/dist/github/repo-policy.d.ts.map +1 -1
- package/dist/github/repository-ruleset-errors.d.ts +37 -3
- package/dist/github/repository-ruleset-errors.d.ts.map +1 -1
- package/dist/github/repository-ruleset-form.d.ts.map +1 -1
- package/dist/github/repository-ruleset-guards.d.ts +15 -2
- package/dist/github/repository-ruleset-guards.d.ts.map +1 -1
- package/dist/github/repository-ruleset-narrowing-guards.d.ts +39 -0
- package/dist/github/repository-ruleset-narrowing-guards.d.ts.map +1 -0
- package/dist/github/repository-ruleset-octokit.d.ts +49 -0
- package/dist/github/repository-ruleset-octokit.d.ts.map +1 -1
- package/dist/github/repository-ruleset-probe.d.ts +2 -1
- package/dist/github/repository-ruleset-probe.d.ts.map +1 -1
- package/dist/github/repository-ruleset-props.d.ts +91 -0
- package/dist/github/repository-ruleset-props.d.ts.map +1 -0
- package/dist/github/repository-ruleset-providers.d.ts +42 -0
- package/dist/github/repository-ruleset-providers.d.ts.map +1 -0
- package/dist/github/repository-ruleset-reconcile.d.ts.map +1 -1
- package/dist/github/repository-ruleset.d.ts +28 -34
- package/dist/github/repository-ruleset.d.ts.map +1 -1
- package/dist/litellm/fake-litellm.d.ts +27 -16
- package/dist/litellm/fake-litellm.d.ts.map +1 -1
- package/dist/litellm/fake-stack.d.ts +9 -4
- package/dist/litellm/fake-stack.d.ts.map +1 -1
- package/dist/litellm/index.d.ts +7 -5
- package/dist/litellm/index.d.ts.map +1 -1
- package/dist/litellm/index.js +53 -123
- package/dist/litellm/index.js.map +8 -8
- package/dist/litellm/operations.d.ts +60 -0
- package/dist/litellm/operations.d.ts.map +1 -0
- package/dist/litellm/pass-through-endpoint.d.ts +10 -28
- package/dist/litellm/pass-through-endpoint.d.ts.map +1 -1
- package/dist/litellm/pass-through-errors.d.ts +37 -0
- package/dist/litellm/pass-through-errors.d.ts.map +1 -0
- package/dist/litellm/pass-through-form.d.ts +11 -4
- package/dist/litellm/pass-through-form.d.ts.map +1 -1
- package/dist/litellm/providers.d.ts +7 -5
- package/dist/litellm/providers.d.ts.map +1 -1
- package/dist/netbox/prefix.d.ts +4 -4
- package/dist/paperless/custom-field.d.ts +21 -21
- package/dist/paperless/custom-field.d.ts.map +1 -1
- package/dist/paperless/document-type.d.ts +34 -4
- package/dist/paperless/document-type.d.ts.map +1 -1
- package/dist/paperless/fake-paperless.d.ts +36 -19
- package/dist/paperless/fake-paperless.d.ts.map +1 -1
- package/dist/paperless/index.d.ts +7 -2
- package/dist/paperless/index.d.ts.map +1 -1
- package/dist/paperless/index.js +164 -228
- package/dist/paperless/index.js.map +10 -13
- package/dist/paperless/matching-locate.d.ts +42 -20
- package/dist/paperless/matching-locate.d.ts.map +1 -1
- package/dist/paperless/matching-types.d.ts +47 -18
- package/dist/paperless/matching-types.d.ts.map +1 -1
- package/dist/paperless/matching.d.ts +30 -27
- package/dist/paperless/matching.d.ts.map +1 -1
- package/dist/paperless/providers.d.ts +13 -7
- package/dist/paperless/providers.d.ts.map +1 -1
- package/dist/paperless/storage-path.d.ts +34 -4
- package/dist/paperless/storage-path.d.ts.map +1 -1
- package/dist/paperless/tag.d.ts +43 -8
- package/dist/paperless/tag.d.ts.map +1 -1
- package/dist/proxmox/acl.d.ts +30 -23
- package/dist/proxmox/acl.d.ts.map +1 -1
- package/dist/proxmox/distilled-pve.d.ts +89 -0
- package/dist/proxmox/distilled-pve.d.ts.map +1 -0
- package/dist/proxmox/index.js +663 -609
- package/dist/proxmox/index.js.map +12 -11
- package/dist/proxmox/members.d.ts +29 -10
- package/dist/proxmox/members.d.ts.map +1 -1
- package/docs/caddy-admin.md +1 -1
- package/docs/caddy.md +3 -2
- package/docs/credentials.md +16 -0
- package/docs/litellm.md +21 -13
- package/docs/paperless.md +12 -0
- package/docs/peers.md +5 -0
- package/docs/repo-policy.md +16 -1
- package/docs/repository-ruleset.md +53 -13
- package/docs/upstream-conformance.md +126 -10
- package/package.json +9 -2
- package/src/caddy/admin-address.ts +71 -0
- package/src/caddy/admin-calls.ts +48 -100
- package/src/caddy/admin.ts +37 -41
- package/src/caddy/adopt-scope.test.ts +1 -1
- package/src/caddy/caddy-http-client.ts +229 -0
- package/src/caddy/config-adopt-provider.test.ts +139 -0
- package/src/caddy/config-adopt.test.ts +60 -126
- package/src/caddy/config-errors.ts +47 -0
- package/src/caddy/config-lifecycle.test.ts +55 -42
- package/src/caddy/config-lifecycle.ts +72 -162
- package/src/caddy/config-reconcile.ts +138 -0
- package/src/caddy/config.ts +36 -42
- package/src/caddy/fake-caddy.ts +20 -2
- package/src/caddy/index.ts +3 -8
- package/src/caddy/local-admin.test.ts +35 -21
- package/src/caddy/local-admin.ts +60 -167
- package/src/caddy/providers.test.ts +14 -6
- package/src/caddy/providers.ts +20 -4
- package/src/github/declare-repo-baseline.ts +6 -6
- package/src/github/index.ts +10 -4
- package/src/github/repo-baseline-data.test.ts +13 -0
- package/src/github/repo-baseline-data.ts +11 -2
- package/src/github/repo-policy-stack.test.ts +59 -0
- package/src/github/repo-policy.ts +3 -2
- package/src/github/repository-ruleset-errors.ts +51 -4
- package/src/github/repository-ruleset-exact-adopt-k1.test.ts +109 -0
- package/src/github/repository-ruleset-exact-adopt.test.ts +184 -0
- package/src/github/repository-ruleset-form.ts +7 -3
- package/src/github/repository-ruleset-guards.ts +11 -4
- package/src/github/repository-ruleset-narrowing-guards.ts +141 -0
- package/src/github/repository-ruleset-narrowing.test.ts +210 -0
- package/src/github/repository-ruleset-octokit.test.ts +141 -0
- package/src/github/repository-ruleset-octokit.ts +121 -30
- package/src/github/repository-ruleset-probe.ts +2 -1
- package/src/github/repository-ruleset-props.ts +95 -0
- package/src/github/repository-ruleset-providers.ts +46 -0
- package/src/github/repository-ruleset-reconcile.ts +35 -0
- package/src/github/repository-ruleset-wire.test.ts +38 -27
- package/src/github/repository-ruleset-write-refusals.test.ts +6 -26
- package/src/github/repository-ruleset.ts +53 -43
- package/src/litellm/fake-litellm.ts +83 -78
- package/src/litellm/fake-stack.ts +13 -5
- package/src/litellm/index.ts +7 -21
- package/src/litellm/operations.ts +149 -0
- package/src/litellm/pass-through-endpoint-delete-swallow.test.ts +17 -20
- package/src/litellm/pass-through-endpoint-replace.test.ts +3 -4
- package/src/litellm/pass-through-endpoint.test.ts +8 -8
- package/src/litellm/pass-through-endpoint.ts +21 -31
- package/src/litellm/pass-through-errors.ts +37 -0
- package/src/litellm/pass-through-form.ts +20 -10
- package/src/litellm/providers.ts +8 -7
- package/src/paperless/custom-field.test.ts +49 -40
- package/src/paperless/custom-field.ts +57 -33
- package/src/paperless/document-type.test.ts +48 -0
- package/src/paperless/document-type.ts +51 -22
- package/src/paperless/fake-paperless.ts +63 -72
- package/src/paperless/index.ts +7 -13
- package/src/paperless/matching-locate.test.ts +102 -0
- package/src/paperless/matching-locate.ts +80 -86
- package/src/paperless/matching-types.ts +49 -16
- package/src/paperless/matching.ts +77 -90
- package/src/paperless/providers.ts +14 -10
- package/src/paperless/storage-path.test.ts +56 -0
- package/src/paperless/storage-path.ts +53 -24
- package/src/paperless/tag-identity.test.ts +127 -0
- package/src/paperless/tag.test.ts +100 -0
- package/src/paperless/tag.ts +62 -32
- package/src/proxmox/acl.test.ts +145 -0
- package/src/proxmox/acl.ts +128 -150
- package/src/proxmox/distilled-pve.test.ts +231 -0
- package/src/proxmox/distilled-pve.ts +147 -0
- package/src/proxmox/members-timeout.test.ts +161 -0
- package/src/proxmox/members.test.ts +9 -0
- package/src/proxmox/members.ts +36 -2
- package/dist/litellm/client.d.ts +0 -76
- package/dist/litellm/client.d.ts.map +0 -1
- package/dist/litellm/credentials.d.ts +0 -48
- package/dist/litellm/credentials.d.ts.map +0 -1
- package/dist/litellm/generated/pass-through.d.ts +0 -71
- package/dist/litellm/generated/pass-through.d.ts.map +0 -1
- package/dist/paperless/client.d.ts +0 -37
- package/dist/paperless/client.d.ts.map +0 -1
- package/dist/paperless/credentials.d.ts +0 -40
- package/dist/paperless/credentials.d.ts.map +0 -1
- package/dist/paperless/errors.d.ts +0 -49
- package/dist/paperless/errors.d.ts.map +0 -1
- package/src/litellm/client.ts +0 -195
- package/src/litellm/credentials.ts +0 -73
- package/src/litellm/generated/pass-through.ts +0 -73
- package/src/paperless/client.ts +0 -88
- package/src/paperless/credentials.ts +0 -69
- package/src/paperless/errors.ts +0 -62
- package/src/paperless/matching-identity.test.ts +0 -194
- package/src/paperless/matching.test.ts +0 -128
|
@@ -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`,
|
|
11
|
-
* Paperless-ngx's `OwnedObjectSerializer` — its wire body is
|
|
12
|
-
* extra_data}` (measured against the v3.1.1 schema
|
|
13
|
-
*
|
|
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
|
|
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).
|
|
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)
|
|
46
|
-
*
|
|
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:
|
|
49
|
-
/**
|
|
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("
|
|
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("
|
|
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("
|
|
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("
|
|
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("
|
|
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
|
|
1
|
+
{"version":3,"file":"custom-field.d.ts","sourceRoot":"","sources":["../../src/paperless/custom-field.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,YAAY,MAAM,8CAA8C,CAAC;AAC7E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAElB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,gBAAgB;IAC/B,gJAAgJ;IAChJ,IAAI,EAAE,MAAM,CAAC;IACb,gJAAgJ;IAChJ,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,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,WAAW,CAAC,SAC1C,gBAAgB,KACtB,MAAM,GAAG,SAKG,CAAC;AAEhB,0EAA0E;AAC1E,eAAO,MAAM,IAAI,EAAE,YAAY,CAC7B,gBAAgB,EAChB,YAAY,CAAC,WAAW,EACxB,qBAAqB,EACnB,YAAY,CAAC,sBAAsB,GACnC,YAAY,CAAC,mBAAmB,GAChC,YAAY,CAAC,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
|
|
10
|
-
export interface DocumentTypeProps
|
|
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
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"document-type.d.ts","sourceRoot":"","sources":["../../src/paperless/document-type.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,aAAa,MAAM,+CAA+C,CAAC;AAC/E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAElB,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
|
|
3
|
-
*
|
|
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.
|
|
6
|
-
* taxonomy collections and answers `name__iexact` the way Django does — case-insensitive,
|
|
7
|
-
*
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
34
|
+
readonly fetch: typeof globalThis.fetch;
|
|
26
35
|
readonly seen: Seen[];
|
|
27
|
-
readonly rows: (collection:
|
|
28
|
-
/** `undefined` to answer normally; a status to force it once
|
|
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
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"fake-paperless.d.ts","sourceRoot":"","sources":["../../src/paperless/fake-paperless.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,4CAA4C,CAAC;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,eAAO,MAAM,SAAS,kCAAkC,CAAC;AACzD,eAAO,MAAM,UAAU,gCAAgC,CAAC;AAExD,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,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;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
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/paperless/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,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,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|