@viaalink/caddy-api-client 0.10.0 → 0.10.2
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 +20 -1
- package/dist/caddy/index.d.ts +4 -4
- package/dist/caddy/index.js +3 -3
- package/dist/{caddy-http-DLxwstYo.d.ts → caddy-http-jhg7B7CZ.d.ts} +1 -1
- package/dist/{caddy-http.zod-Cx-dcFkE.d.ts → caddy-http.zod-T9FvybMd.d.ts} +1 -1
- package/dist/caddy-types.d.ts +2 -2
- package/dist/{client-Bf2QoSWQ.d.ts → client--uI2vvWr.d.ts} +103 -13
- package/dist/generated/extension-assets.d.ts +4 -4
- package/dist/generated/extension-assets.js +132 -37
- package/dist/{index-BmimANG7.d.ts → index-Bgl6uVxd.d.ts} +4 -4
- package/dist/{index-BijF7qR9.d.ts → index-CwQ-g5nn.d.ts} +1 -1
- package/dist/{index-Q5Jc47QL.d.ts → index-DNBQR_yL.d.ts} +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +4 -4
- package/dist/mitm/index.d.ts +4 -4
- package/dist/mitm/index.js +2 -2
- package/dist/plugins/caddy-dns/index.d.ts +1 -1
- package/dist/plugins/caddy-security/index.d.ts +2 -2
- package/dist/plugins/index.d.ts +3 -3
- package/dist/{types-DIjkvykh.d.ts → types-WSyYaJZ9.d.ts} +2 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as CaddyClientOptions,
|
|
3
|
-
import {
|
|
2
|
+
import { C as CaddyClientOptions, e as CaddyRoute, a2 as UpstreamStatus } from './types-WSyYaJZ9.js';
|
|
3
|
+
import { s as Config, aA as Server } from './caddy-http-jhg7B7CZ.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Zod schemas for runtime validation
|
|
@@ -48,22 +48,30 @@ import { a7 as Config, S as Server } from './caddy-http-DLxwstYo.js';
|
|
|
48
48
|
*/
|
|
49
49
|
declare const DomainSchema: z.ZodString;
|
|
50
50
|
/**
|
|
51
|
-
* Dial address schema
|
|
51
|
+
* Dial address schema: a Caddy network address for an upstream.
|
|
52
|
+
*
|
|
53
|
+
* Accepts the forms Caddy's `reverse_proxy` dials:
|
|
54
|
+
* - `host:port`, `[ipv6]:port`
|
|
55
|
+
* - `tcp/host:port` (also `tcp4`, `tcp6`, `udp`, `udp4`, `udp6`)
|
|
56
|
+
* - `unix//abs/path.sock` (also `unix+h2c/`, `unixgram/`, `unixpacket/`); a unix
|
|
57
|
+
* address is a socket path and has no port
|
|
58
|
+
* - anything with a `{placeholder}`, which Caddy resolves per request
|
|
52
59
|
*
|
|
53
60
|
* @example
|
|
54
61
|
* ```typescript
|
|
55
62
|
* import { DialAddressSchema } from "@viaalink/caddy-api-client";
|
|
56
63
|
*
|
|
57
64
|
* // Valid addresses
|
|
58
|
-
* DialAddressSchema.parse("localhost:3000");
|
|
59
|
-
* DialAddressSchema.parse("192.168.1.1:8080");
|
|
60
|
-
* DialAddressSchema.parse("
|
|
65
|
+
* DialAddressSchema.parse("localhost:3000"); // OK
|
|
66
|
+
* DialAddressSchema.parse("192.168.1.1:8080"); // OK
|
|
67
|
+
* DialAddressSchema.parse("unix//run/app/web.sock"); // OK
|
|
68
|
+
* DialAddressSchema.parse("tcp6/[::1]:8080"); // OK
|
|
61
69
|
*
|
|
62
70
|
* // Invalid - missing port
|
|
63
71
|
* DialAddressSchema.parse("localhost"); // throws
|
|
64
72
|
* ```
|
|
65
73
|
*/
|
|
66
|
-
declare const DialAddressSchema: z.ZodString
|
|
74
|
+
declare const DialAddressSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
67
75
|
/**
|
|
68
76
|
* HTTP method schema, for Caddy's method matcher (`match.method`).
|
|
69
77
|
*
|
|
@@ -790,7 +798,7 @@ declare const ServiceRouteOptionsSchema: z.ZodObject<{
|
|
|
790
798
|
host: z.ZodOptional<z.ZodString>;
|
|
791
799
|
path: z.ZodOptional<z.ZodString>;
|
|
792
800
|
pathRouteHost: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
793
|
-
dial: z.ZodString
|
|
801
|
+
dial: z.ZodEffects<z.ZodString, string, string>;
|
|
794
802
|
serviceId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
795
803
|
enableHostRoute: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
796
804
|
enablePathRoute: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -929,7 +937,7 @@ declare const HealthCheckRouteOptionsSchema: z.ZodObject<{
|
|
|
929
937
|
*/
|
|
930
938
|
declare const HostRouteOptionsSchema: z.ZodObject<{
|
|
931
939
|
host: z.ZodString;
|
|
932
|
-
dial: z.ZodString
|
|
940
|
+
dial: z.ZodEffects<z.ZodString, string, string>;
|
|
933
941
|
securityHeaders: z.ZodOptional<z.ZodObject<{
|
|
934
942
|
enableHsts: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
935
943
|
hstsMaxAge: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -1028,7 +1036,7 @@ declare const HostRouteOptionsSchema: z.ZodObject<{
|
|
|
1028
1036
|
declare const PathRouteOptionsSchema: z.ZodObject<{
|
|
1029
1037
|
path: z.ZodString;
|
|
1030
1038
|
host: z.ZodString;
|
|
1031
|
-
dial: z.ZodString
|
|
1039
|
+
dial: z.ZodEffects<z.ZodString, string, string>;
|
|
1032
1040
|
stripPrefix: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1033
1041
|
securityHeaders: z.ZodOptional<z.ZodObject<{
|
|
1034
1042
|
enableHsts: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -1131,7 +1139,7 @@ declare const PathRouteOptionsSchema: z.ZodObject<{
|
|
|
1131
1139
|
*/
|
|
1132
1140
|
declare const LoadBalancerRouteOptionsSchema: z.ZodObject<{
|
|
1133
1141
|
host: z.ZodString;
|
|
1134
|
-
upstreams: z.ZodArray<z.ZodString, "many">;
|
|
1142
|
+
upstreams: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
1135
1143
|
healthCheckPath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1136
1144
|
healthCheckInterval: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1137
1145
|
policy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["first", "random", "least_conn", "round_robin"]>>>;
|
|
@@ -2220,7 +2228,11 @@ declare const StaticResponseHandlerSchema: z.ZodObject<{
|
|
|
2220
2228
|
abort?: boolean | undefined;
|
|
2221
2229
|
}>;
|
|
2222
2230
|
/**
|
|
2223
|
-
* Authentication handler schema - HTTP basic auth
|
|
2231
|
+
* Authentication handler schema - HTTP basic auth, or caddy-security's
|
|
2232
|
+
* `authorizer` provider (`http.authentication.providers.authorizer`), which
|
|
2233
|
+
* plugs into this same core handler. Without `authorizer` here, a route built
|
|
2234
|
+
* by `buildProtectedRoute()` failed the route JSON schema the VS Code
|
|
2235
|
+
* extension applies to `*.caddy.json`.
|
|
2224
2236
|
*
|
|
2225
2237
|
* @example
|
|
2226
2238
|
* ```typescript
|
|
@@ -2276,7 +2288,21 @@ declare const AuthenticationHandlerSchema: z.ZodObject<{
|
|
|
2276
2288
|
algorithm?: string | undefined;
|
|
2277
2289
|
} | undefined;
|
|
2278
2290
|
}>>;
|
|
2291
|
+
authorizer: z.ZodOptional<z.ZodObject<{
|
|
2292
|
+
gatekeeper_name: z.ZodOptional<z.ZodString>;
|
|
2293
|
+
route_matcher: z.ZodOptional<z.ZodString>;
|
|
2294
|
+
}, "strip", z.ZodTypeAny, {
|
|
2295
|
+
route_matcher?: string | undefined;
|
|
2296
|
+
gatekeeper_name?: string | undefined;
|
|
2297
|
+
}, {
|
|
2298
|
+
route_matcher?: string | undefined;
|
|
2299
|
+
gatekeeper_name?: string | undefined;
|
|
2300
|
+
}>>;
|
|
2279
2301
|
}, "strip", z.ZodTypeAny, {
|
|
2302
|
+
authorizer?: {
|
|
2303
|
+
route_matcher?: string | undefined;
|
|
2304
|
+
gatekeeper_name?: string | undefined;
|
|
2305
|
+
} | undefined;
|
|
2280
2306
|
http_basic?: {
|
|
2281
2307
|
realm?: string | undefined;
|
|
2282
2308
|
accounts?: {
|
|
@@ -2288,6 +2314,10 @@ declare const AuthenticationHandlerSchema: z.ZodObject<{
|
|
|
2288
2314
|
} | undefined;
|
|
2289
2315
|
} | undefined;
|
|
2290
2316
|
}, {
|
|
2317
|
+
authorizer?: {
|
|
2318
|
+
route_matcher?: string | undefined;
|
|
2319
|
+
gatekeeper_name?: string | undefined;
|
|
2320
|
+
} | undefined;
|
|
2291
2321
|
http_basic?: {
|
|
2292
2322
|
realm?: string | undefined;
|
|
2293
2323
|
accounts?: {
|
|
@@ -2302,6 +2332,10 @@ declare const AuthenticationHandlerSchema: z.ZodObject<{
|
|
|
2302
2332
|
}, "strip", z.ZodTypeAny, {
|
|
2303
2333
|
handler: "authentication";
|
|
2304
2334
|
providers?: {
|
|
2335
|
+
authorizer?: {
|
|
2336
|
+
route_matcher?: string | undefined;
|
|
2337
|
+
gatekeeper_name?: string | undefined;
|
|
2338
|
+
} | undefined;
|
|
2305
2339
|
http_basic?: {
|
|
2306
2340
|
realm?: string | undefined;
|
|
2307
2341
|
accounts?: {
|
|
@@ -2316,6 +2350,10 @@ declare const AuthenticationHandlerSchema: z.ZodObject<{
|
|
|
2316
2350
|
}, {
|
|
2317
2351
|
handler: "authentication";
|
|
2318
2352
|
providers?: {
|
|
2353
|
+
authorizer?: {
|
|
2354
|
+
route_matcher?: string | undefined;
|
|
2355
|
+
gatekeeper_name?: string | undefined;
|
|
2356
|
+
} | undefined;
|
|
2319
2357
|
http_basic?: {
|
|
2320
2358
|
realm?: string | undefined;
|
|
2321
2359
|
accounts?: {
|
|
@@ -4003,7 +4041,21 @@ declare const KnownCaddyHandlerSchema: z.ZodDiscriminatedUnion<"handler", [z.Zod
|
|
|
4003
4041
|
algorithm?: string | undefined;
|
|
4004
4042
|
} | undefined;
|
|
4005
4043
|
}>>;
|
|
4044
|
+
authorizer: z.ZodOptional<z.ZodObject<{
|
|
4045
|
+
gatekeeper_name: z.ZodOptional<z.ZodString>;
|
|
4046
|
+
route_matcher: z.ZodOptional<z.ZodString>;
|
|
4047
|
+
}, "strip", z.ZodTypeAny, {
|
|
4048
|
+
route_matcher?: string | undefined;
|
|
4049
|
+
gatekeeper_name?: string | undefined;
|
|
4050
|
+
}, {
|
|
4051
|
+
route_matcher?: string | undefined;
|
|
4052
|
+
gatekeeper_name?: string | undefined;
|
|
4053
|
+
}>>;
|
|
4006
4054
|
}, "strip", z.ZodTypeAny, {
|
|
4055
|
+
authorizer?: {
|
|
4056
|
+
route_matcher?: string | undefined;
|
|
4057
|
+
gatekeeper_name?: string | undefined;
|
|
4058
|
+
} | undefined;
|
|
4007
4059
|
http_basic?: {
|
|
4008
4060
|
realm?: string | undefined;
|
|
4009
4061
|
accounts?: {
|
|
@@ -4015,6 +4067,10 @@ declare const KnownCaddyHandlerSchema: z.ZodDiscriminatedUnion<"handler", [z.Zod
|
|
|
4015
4067
|
} | undefined;
|
|
4016
4068
|
} | undefined;
|
|
4017
4069
|
}, {
|
|
4070
|
+
authorizer?: {
|
|
4071
|
+
route_matcher?: string | undefined;
|
|
4072
|
+
gatekeeper_name?: string | undefined;
|
|
4073
|
+
} | undefined;
|
|
4018
4074
|
http_basic?: {
|
|
4019
4075
|
realm?: string | undefined;
|
|
4020
4076
|
accounts?: {
|
|
@@ -4029,6 +4085,10 @@ declare const KnownCaddyHandlerSchema: z.ZodDiscriminatedUnion<"handler", [z.Zod
|
|
|
4029
4085
|
}, "strip", z.ZodTypeAny, {
|
|
4030
4086
|
handler: "authentication";
|
|
4031
4087
|
providers?: {
|
|
4088
|
+
authorizer?: {
|
|
4089
|
+
route_matcher?: string | undefined;
|
|
4090
|
+
gatekeeper_name?: string | undefined;
|
|
4091
|
+
} | undefined;
|
|
4032
4092
|
http_basic?: {
|
|
4033
4093
|
realm?: string | undefined;
|
|
4034
4094
|
accounts?: {
|
|
@@ -4043,6 +4103,10 @@ declare const KnownCaddyHandlerSchema: z.ZodDiscriminatedUnion<"handler", [z.Zod
|
|
|
4043
4103
|
}, {
|
|
4044
4104
|
handler: "authentication";
|
|
4045
4105
|
providers?: {
|
|
4106
|
+
authorizer?: {
|
|
4107
|
+
route_matcher?: string | undefined;
|
|
4108
|
+
gatekeeper_name?: string | undefined;
|
|
4109
|
+
} | undefined;
|
|
4046
4110
|
http_basic?: {
|
|
4047
4111
|
realm?: string | undefined;
|
|
4048
4112
|
accounts?: {
|
|
@@ -5489,7 +5553,21 @@ declare const CaddyHandlerSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"handler",
|
|
|
5489
5553
|
algorithm?: string | undefined;
|
|
5490
5554
|
} | undefined;
|
|
5491
5555
|
}>>;
|
|
5556
|
+
authorizer: z.ZodOptional<z.ZodObject<{
|
|
5557
|
+
gatekeeper_name: z.ZodOptional<z.ZodString>;
|
|
5558
|
+
route_matcher: z.ZodOptional<z.ZodString>;
|
|
5559
|
+
}, "strip", z.ZodTypeAny, {
|
|
5560
|
+
route_matcher?: string | undefined;
|
|
5561
|
+
gatekeeper_name?: string | undefined;
|
|
5562
|
+
}, {
|
|
5563
|
+
route_matcher?: string | undefined;
|
|
5564
|
+
gatekeeper_name?: string | undefined;
|
|
5565
|
+
}>>;
|
|
5492
5566
|
}, "strip", z.ZodTypeAny, {
|
|
5567
|
+
authorizer?: {
|
|
5568
|
+
route_matcher?: string | undefined;
|
|
5569
|
+
gatekeeper_name?: string | undefined;
|
|
5570
|
+
} | undefined;
|
|
5493
5571
|
http_basic?: {
|
|
5494
5572
|
realm?: string | undefined;
|
|
5495
5573
|
accounts?: {
|
|
@@ -5501,6 +5579,10 @@ declare const CaddyHandlerSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"handler",
|
|
|
5501
5579
|
} | undefined;
|
|
5502
5580
|
} | undefined;
|
|
5503
5581
|
}, {
|
|
5582
|
+
authorizer?: {
|
|
5583
|
+
route_matcher?: string | undefined;
|
|
5584
|
+
gatekeeper_name?: string | undefined;
|
|
5585
|
+
} | undefined;
|
|
5504
5586
|
http_basic?: {
|
|
5505
5587
|
realm?: string | undefined;
|
|
5506
5588
|
accounts?: {
|
|
@@ -5515,6 +5597,10 @@ declare const CaddyHandlerSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"handler",
|
|
|
5515
5597
|
}, "strip", z.ZodTypeAny, {
|
|
5516
5598
|
handler: "authentication";
|
|
5517
5599
|
providers?: {
|
|
5600
|
+
authorizer?: {
|
|
5601
|
+
route_matcher?: string | undefined;
|
|
5602
|
+
gatekeeper_name?: string | undefined;
|
|
5603
|
+
} | undefined;
|
|
5518
5604
|
http_basic?: {
|
|
5519
5605
|
realm?: string | undefined;
|
|
5520
5606
|
accounts?: {
|
|
@@ -5529,6 +5615,10 @@ declare const CaddyHandlerSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"handler",
|
|
|
5529
5615
|
}, {
|
|
5530
5616
|
handler: "authentication";
|
|
5531
5617
|
providers?: {
|
|
5618
|
+
authorizer?: {
|
|
5619
|
+
route_matcher?: string | undefined;
|
|
5620
|
+
gatekeeper_name?: string | undefined;
|
|
5621
|
+
} | undefined;
|
|
5532
5622
|
http_basic?: {
|
|
5533
5623
|
realm?: string | undefined;
|
|
5534
5624
|
accounts?: {
|
|
@@ -6709,4 +6799,4 @@ declare class CaddyClient {
|
|
|
6709
6799
|
applyConfig(config: Config | (Config & Record<string, unknown>)): Promise<void>;
|
|
6710
6800
|
}
|
|
6711
6801
|
|
|
6712
|
-
export {
|
|
6802
|
+
export { TlsIssuerSchema as $, ActiveHealthChecksSchema as A, BasicAuthOptionsSchema as B, CaddyAdapterSchema as C, DeleteDomainOptionsSchema as D, EncodeHandlerSchema as E, FileServerHandlerSchema as F, MatchHeaderSchema as G, HeaderRegexpSchema as H, InterceptHandlerSchema as I, MatchQuerySchema as J, KnownCaddyHandlerSchema as K, LoadBalancerRouteOptionsSchema as L, MapHandlerSchema as M, MitmwebOptionsSchema as N, PathRouteOptionsSchema as O, PassiveHealthChecksSchema as P, PushHandlerSchema as Q, RedirectModeSchema as R, RedirectStatusCodeSchema as S, RequestBodyHandlerSchema as T, ReverseProxyHandlerSchema as U, RewriteHandlerSchema as V, SecurityHeadersSchema as W, ServiceRouteOptionsSchema as X, StaticResponseHandlerSchema as Y, SubrouteHandlerSchema as Z, TemplatesHandlerSchema as _, AdaptOptionsSchema as a, TracingHandlerSchema as a0, UpdateDomainOptionsSchema as a1, UpstreamSchema as a2, UpstreamStatusArraySchema as a3, UpstreamStatusSchema as a4, VarsHandlerSchema as a5, validate as a6, AddDomainWithAutoTlsOptionsSchema as b, AddDomainWithTlsOptionsSchema as c, AuthenticationHandlerSchema as d, CaddyClient as e, CaddyClientOptionsSchema as f, CaddyDurationSchema as g, CaddyHandlerSchema as h, CaddyRouteHandlerSchema as i, CaddyRouteMatcherSchema as j, CaddyRouteSchema as k, CopyResponseHandlerSchema as l, CopyResponseHeadersHandlerSchema as m, DialAddressSchema as n, DomainSchema as o, ErrorHandlerSchema as p, ExtendedRouteMatcherSchema as q, FrameOptionsSchema as r, HeadersHandlerSchema as s, HealthCheckRouteOptionsSchema as t, HealthChecksSchema as u, HostRouteOptionsSchema as v, HttpMethodSchema as w, InvokeHandlerSchema as x, LoadBalancingSchema as y, LogAppendHandlerSchema as z };
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Run: npm run generate:extension
|
|
7
7
|
*
|
|
8
8
|
* @generated
|
|
9
|
-
* @version 0.
|
|
10
|
-
* @generatedAt 2026-
|
|
9
|
+
* @version 0.10.1
|
|
10
|
+
* @generatedAt 2026-10-31T23:06:36.575Z
|
|
11
11
|
*/
|
|
12
12
|
interface ParamMetadata {
|
|
13
13
|
name: string;
|
|
@@ -41,11 +41,11 @@ interface HandlerMetadata {
|
|
|
41
41
|
/**
|
|
42
42
|
* Library version this metadata was generated from
|
|
43
43
|
*/
|
|
44
|
-
declare const METADATA_VERSION = "0.
|
|
44
|
+
declare const METADATA_VERSION = "0.10.1";
|
|
45
45
|
/**
|
|
46
46
|
* Timestamp when this metadata was generated
|
|
47
47
|
*/
|
|
48
|
-
declare const GENERATED_AT = "2026-
|
|
48
|
+
declare const GENERATED_AT = "2026-10-31T23:06:36.575Z";
|
|
49
49
|
/**
|
|
50
50
|
* Builder function metadata extracted from JSDoc and type definitions
|
|
51
51
|
*
|