@voltro/protocol 0.80.0 → 0.81.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/CHANGELOG.md +90 -0
- package/dist/apikey.d.ts +8 -0
- package/dist/index.d.ts +342 -11
- package/dist/index.js +590 -557
- package/dist/jwt.d.ts +8 -0
- package/dist/rest.d.ts +81 -16
- package/dist/rest.js +228 -219
- package/dist/{restFormat-ChSVyufA.js → restFormat-CzdGVkuB.js} +72 -60
- package/dist/{scopes-BbIyym8y.js → scopes-CvU5QBQ4.js} +110 -79
- package/dist/session.d.ts +20 -0
- package/dist/session.js +6 -6
- package/package.json +3 -3
package/dist/rest.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as n,
|
|
3
|
-
import { Effect as
|
|
4
|
-
import * as
|
|
1
|
+
import { B as e, z as t } from "./scopes-CvU5QBQ4.js";
|
|
2
|
+
import { C as n, D as r, O as i, T as a, _ as o, a as s, c, d as l, f as u, i as d, l as f, n as p, o as m, r as h, s as g, t as _, u as v, v as y, w as b } from "./restFormat-CzdGVkuB.js";
|
|
3
|
+
import { Effect as x, ParseResult as S, Schema as C } from "effect";
|
|
4
|
+
import * as w from "effect/SchemaAST";
|
|
5
5
|
//#region src/publicApi.ts
|
|
6
|
-
var
|
|
6
|
+
var T = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? k("", t, n).method : void 0) ?? (e === "query" ? "GET" : "POST"), E = (e, t, n) => A(t.path ?? (t.resource !== void 0 && n !== void 0 ? k(e, t, n).path : `/${t.version ?? "v1"}/${e.replace(/\./g, "/")}`)), D = (e) => {
|
|
7
7
|
let t = e.split("/").pop() ?? e;
|
|
8
8
|
return t.endsWith("ies") ? `${t.slice(0, -3)}y` : t.endsWith("ses") || t.endsWith("xes") ? t.slice(0, -2) : t.endsWith("s") ? t.slice(0, -1) : t;
|
|
9
|
-
},
|
|
10
|
-
let n = t != null && (typeof t == "object" || typeof t == "function") && "ast" in t ?
|
|
9
|
+
}, O = (e, t) => {
|
|
10
|
+
let n = t != null && (typeof t == "object" || typeof t == "function") && "ast" in t ? re(t) : void 0;
|
|
11
11
|
if (n === void 0) return;
|
|
12
|
-
let r = `${
|
|
12
|
+
let r = `${D(e)}Id`;
|
|
13
13
|
return n.has(r) ? r : n.has("id") ? "id" : void 0;
|
|
14
|
-
},
|
|
15
|
-
let r = (t.resource ?? "").replace(/^\/+|\/+$/g, ""), i = `/${t.version ?? "v1"}/${r}`, a =
|
|
14
|
+
}, k = (e, t, n) => {
|
|
15
|
+
let r = (t.resource ?? "").replace(/^\/+|\/+$/g, ""), i = `/${t.version ?? "v1"}/${r}`, a = O(r, n.input), o = a === void 0 ? i : `${i}/:${a}`, s = e.split(".").pop() ?? e, c = n.target?.op;
|
|
16
16
|
return n.kind === "query" || n.kind === "stream" ? {
|
|
17
17
|
method: "GET",
|
|
18
18
|
path: o
|
|
@@ -29,72 +29,72 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
29
29
|
method: "POST",
|
|
30
30
|
path: `${o}/${s}`
|
|
31
31
|
};
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
34
|
-
let t = e.types.filter((e) => !
|
|
32
|
+
}, A = (e) => e.replace(/\{([A-Za-z0-9_]+)\}/g, ":$1"), ee = (e) => [...e.matchAll(/:([A-Za-z0-9_]+)/g)].map((e) => e[1]), j = (e) => {
|
|
33
|
+
if (w.isUnion(e)) {
|
|
34
|
+
let t = e.types.filter((e) => !w.isUndefinedKeyword(e));
|
|
35
35
|
if (t.length === 1) return t[0];
|
|
36
|
-
if (t.length !== e.types.length) return
|
|
36
|
+
if (t.length !== e.types.length) return w.Union.make(t);
|
|
37
37
|
}
|
|
38
38
|
return e;
|
|
39
|
-
},
|
|
40
|
-
let n =
|
|
41
|
-
if (
|
|
42
|
-
if (
|
|
39
|
+
}, M = /^-?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i, N = (e, t) => {
|
|
40
|
+
let n = j(t);
|
|
41
|
+
if (w.isRefinement(n) || w.isTransformation(n)) return N(e, n.from);
|
|
42
|
+
if (w.isUnion(n)) {
|
|
43
43
|
for (let t of n.types) {
|
|
44
|
-
let n =
|
|
44
|
+
let n = N(e, t);
|
|
45
45
|
if (n !== e) return n;
|
|
46
46
|
}
|
|
47
47
|
return e;
|
|
48
48
|
}
|
|
49
|
-
if (
|
|
49
|
+
if (w.isTupleType(n)) {
|
|
50
50
|
let t = Array.isArray(e) ? e : e === void 0 ? void 0 : [e];
|
|
51
51
|
if (t === void 0) return e;
|
|
52
52
|
let r = n.rest[0]?.type ?? n.elements[0]?.type;
|
|
53
|
-
return r === void 0 ? t : t.map((e) =>
|
|
53
|
+
return r === void 0 ? t : t.map((e) => N(e, r));
|
|
54
54
|
}
|
|
55
55
|
if (typeof e != "string") return e;
|
|
56
|
-
if (
|
|
57
|
-
if (
|
|
58
|
-
if (
|
|
56
|
+
if (w.isNumberKeyword(n)) return M.test(e.trim()) ? Number(e) : e;
|
|
57
|
+
if (w.isBooleanKeyword(n)) return e === "true" || e !== "false" && e;
|
|
58
|
+
if (w.isLiteral(n)) {
|
|
59
59
|
let t = n.literal;
|
|
60
|
-
return typeof t == "number" &&
|
|
60
|
+
return typeof t == "number" && M.test(e.trim()) && Number(e) === t || typeof t == "boolean" && String(t) === e ? t : e;
|
|
61
61
|
}
|
|
62
62
|
return e;
|
|
63
|
-
},
|
|
63
|
+
}, P = (e, t) => {
|
|
64
64
|
if (typeof e != "object" || !e || Array.isArray(e)) return e;
|
|
65
|
-
let n =
|
|
66
|
-
if (!
|
|
65
|
+
let n = j(w.encodedAST(t.ast));
|
|
66
|
+
if (!w.isTypeLiteral(n)) return e;
|
|
67
67
|
let r = { ...e };
|
|
68
68
|
for (let e of n.propertySignatures) {
|
|
69
69
|
let t = String(e.name);
|
|
70
|
-
t in r && (r[t] =
|
|
70
|
+
t in r && (r[t] = N(r[t], e.type));
|
|
71
71
|
}
|
|
72
72
|
return r;
|
|
73
|
-
},
|
|
73
|
+
}, F = (e) => {
|
|
74
74
|
let t = /* @__PURE__ */ new Set();
|
|
75
75
|
if (e === void 0) return t;
|
|
76
76
|
let n = (e) => {
|
|
77
|
-
if (
|
|
77
|
+
if (w.isUnion(e)) {
|
|
78
78
|
for (let t of e.types) n(t);
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
81
|
+
if (w.isTransformation(e)) {
|
|
82
82
|
n(e.from), n(e.to);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
85
|
+
if (w.isRefinement(e)) {
|
|
86
86
|
n(e.from);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
89
|
+
if (w.isTypeLiteral(e)) {
|
|
90
90
|
let n = e.propertySignatures.find((e) => e.name === "_tag");
|
|
91
|
-
n !== void 0 &&
|
|
91
|
+
n !== void 0 && w.isLiteral(n.type) && typeof n.type.literal == "string" && t.add(n.type.literal);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
return n(e.ast), t;
|
|
95
|
-
},
|
|
95
|
+
}, I = (e, t, n) => {
|
|
96
96
|
if (n !== void 0) try {
|
|
97
|
-
let r =
|
|
97
|
+
let r = C.encodeUnknownSync(n)(e);
|
|
98
98
|
if (typeof r == "object" && r) return {
|
|
99
99
|
error: t,
|
|
100
100
|
...r
|
|
@@ -103,106 +103,106 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
103
103
|
let r = { error: t };
|
|
104
104
|
for (let [t, n] of Object.entries(e)) t !== "stack" && t !== "_tag" && (r[t] = n);
|
|
105
105
|
return r;
|
|
106
|
-
},
|
|
106
|
+
}, L = (e, t, n, r = []) => {
|
|
107
107
|
if (typeof e != "object" || !e) return e;
|
|
108
108
|
let i = e._tag;
|
|
109
109
|
if (typeof i != "string" || i === "ScopeError") return e;
|
|
110
|
-
if (
|
|
111
|
-
let a = r.find((e) =>
|
|
110
|
+
if (F(t.error).has(i)) return new J(n.errorStatus?.[i] ?? 422, I(e, i, t.error));
|
|
111
|
+
let a = r.find((e) => F(e.schema).has(i));
|
|
112
112
|
if (a === void 0) return e;
|
|
113
113
|
let o = n.errorStatus?.[i] ?? a.rest?.status ?? 422, s = a.rest?.headers?.(e);
|
|
114
|
-
return new
|
|
114
|
+
return new J(o, I(e, i, a.schema), s);
|
|
115
115
|
}, te = (e, t, n, r, i, a) => {
|
|
116
|
-
let o =
|
|
117
|
-
if (!(o instanceof
|
|
118
|
-
let { error: s, _tag: c, ...l } = o.body,
|
|
116
|
+
let o = L(e, t, n, r);
|
|
117
|
+
if (!(o instanceof J) || i.errors === "tagged" && i.encodeError === void 0) return o;
|
|
118
|
+
let { error: s, _tag: c, ...l } = o.body, u = typeof l.message == "string" ? l.message : typeof l.reason == "string" ? l.reason : "", f = d(i, {
|
|
119
119
|
status: o.status,
|
|
120
120
|
tag: s,
|
|
121
|
-
message:
|
|
121
|
+
message: u,
|
|
122
122
|
fields: l
|
|
123
123
|
}, {
|
|
124
124
|
...a,
|
|
125
125
|
status: o.status
|
|
126
126
|
});
|
|
127
|
-
return new
|
|
127
|
+
return new J(o.status, f.body, {
|
|
128
128
|
...o.headers ?? {},
|
|
129
129
|
...f.headers ?? {}
|
|
130
130
|
}, f.contentType);
|
|
131
|
-
},
|
|
131
|
+
}, R = (e, t) => {
|
|
132
132
|
if (e === void 0) return;
|
|
133
|
-
let n =
|
|
133
|
+
let n = w.isUnion(e.ast) ? e.ast.types : [e.ast];
|
|
134
134
|
for (let e of n) {
|
|
135
|
-
let n =
|
|
136
|
-
if (
|
|
135
|
+
let n = C.make(e);
|
|
136
|
+
if (F(n).has(t)) return n;
|
|
137
137
|
}
|
|
138
|
-
},
|
|
139
|
-
let t =
|
|
140
|
-
return
|
|
141
|
-
},
|
|
142
|
-
let n =
|
|
138
|
+
}, ne = (e) => e.split(".").map((e, t) => t === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_"), re = (e) => {
|
|
139
|
+
let t = j(w.encodedAST(e.ast));
|
|
140
|
+
return w.isTypeLiteral(t) && t.indexSignatures.length === 0 ? new Set(t.propertySignatures.map((e) => String(e.name))) : void 0;
|
|
141
|
+
}, ie = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t), ae = (e, t) => {
|
|
142
|
+
let n = j(w.encodedAST(t.ast)), r = {}, i = w.isTypeLiteral(n) ? new Map(n.propertySignatures.map((e) => [String(e.name), e.type])) : /* @__PURE__ */ new Map();
|
|
143
143
|
for (let [t, n] of Object.entries(e)) {
|
|
144
144
|
let e = i.get(t);
|
|
145
|
-
r[t] = e === void 0 ? n :
|
|
145
|
+
r[t] = e === void 0 ? n : N(n, e);
|
|
146
146
|
}
|
|
147
147
|
return r;
|
|
148
|
-
},
|
|
148
|
+
}, z = (e, t) => {
|
|
149
149
|
if (e !== void 0) {
|
|
150
150
|
try {
|
|
151
|
-
return
|
|
151
|
+
return C.encodeUnknownSync(t)(e);
|
|
152
152
|
} catch {}
|
|
153
153
|
try {
|
|
154
|
-
return
|
|
154
|
+
return C.decodeUnknownSync(t)(e), e;
|
|
155
155
|
} catch {}
|
|
156
156
|
return e;
|
|
157
157
|
}
|
|
158
|
-
},
|
|
159
|
-
...e.request === void 0 ? {} : { request:
|
|
160
|
-
...e.response === void 0 ? {} : { response:
|
|
161
|
-
}),
|
|
158
|
+
}, oe = (e, t, n) => ({
|
|
159
|
+
...e.request === void 0 ? {} : { request: z(e.request, t) },
|
|
160
|
+
...e.response === void 0 ? {} : { response: z(e.response, n) }
|
|
161
|
+
}), se = () => (e) => {
|
|
162
162
|
if (e.subject.type !== "anonymous") return;
|
|
163
163
|
let t = e.subject.credentialRejected;
|
|
164
164
|
return t === void 0 ? void 0 : {
|
|
165
165
|
status: 401,
|
|
166
166
|
message: t
|
|
167
167
|
};
|
|
168
|
-
},
|
|
168
|
+
}, B = (e, t, n, r = {}) => {
|
|
169
169
|
let i = e.publicApi;
|
|
170
170
|
if (i === void 0) throw Error(`publicApiRoute: descriptor '${e.name}' has no publicApi annotation`);
|
|
171
|
-
let a =
|
|
171
|
+
let a = f(r.profile, i.format), o = r.pluginErrors ?? [], c = {
|
|
172
172
|
kind: e.kind,
|
|
173
173
|
input: e.input,
|
|
174
174
|
target: e.target
|
|
175
|
-
}, u =
|
|
176
|
-
if (
|
|
177
|
-
for (let t of h) if (!
|
|
175
|
+
}, u = T(e.kind, i, c), d = (e) => a.naming === "snake_case" ? l(e) : e, p = E(e.name, i, c), m = p.replace(/:([A-Za-z0-9_]+)/g, (e, t) => `:${d(t)}`), h = ee(m), g = v(e.input, a), _ = re(g);
|
|
176
|
+
if (_ !== void 0) {
|
|
177
|
+
for (let t of h) if (!_.has(t)) throw Error(`publicApi: descriptor '${e.name}' — path '${p}' binds ':${t}', and the input declares no field of that name` + (_.size > 0 ? ` (fields: ${[..._].join(", ")})` : " (the input declares no fields)"));
|
|
178
178
|
}
|
|
179
|
-
let y =
|
|
180
|
-
query:
|
|
181
|
-
params:
|
|
182
|
-
form:
|
|
183
|
-
},
|
|
184
|
-
...
|
|
185
|
-
body:
|
|
186
|
-
}) :
|
|
179
|
+
let y = v(e.output, a), b = C.Struct({ value: g }), w = u !== "GET" && (_ === void 0 || [..._].some((e) => !h.includes(e))), D = {
|
|
180
|
+
query: C.Unknown,
|
|
181
|
+
params: C.Unknown,
|
|
182
|
+
form: C.Boolean
|
|
183
|
+
}, O = w ? C.Struct({
|
|
184
|
+
...D,
|
|
185
|
+
body: C.Unknown
|
|
186
|
+
}) : C.Struct(D), k = C.transformOrFail(O, b, {
|
|
187
187
|
strict: !1,
|
|
188
188
|
decode: (e, t, n) => {
|
|
189
|
-
let r = "body" in e ? e.body : void 0, i = u === "GET" ?
|
|
190
|
-
if (typeof i != "object" || !i || Array.isArray(i)) return
|
|
191
|
-
let o = i, s = Object.keys(a).filter((e) => e in o && !
|
|
189
|
+
let r = "body" in e ? e.body : void 0, i = u === "GET" ? P(e.query, g) : e.form ? P(r ?? {}, g) : r ?? {}, a = typeof e.params == "object" && e.params !== null ? ae(e.params, g) : {};
|
|
190
|
+
if (typeof i != "object" || !i || Array.isArray(i)) return S.succeed({ value: i });
|
|
191
|
+
let o = i, s = Object.keys(a).filter((e) => e in o && !ie(o[e], a[e]));
|
|
192
192
|
if (s.length > 0) {
|
|
193
193
|
let t = u === "GET" ? "query string" : "body";
|
|
194
|
-
return
|
|
194
|
+
return S.fail(new S.Type(n, e, `${s.map((e) => `'${e}'`).join(", ")} ${s.length === 1 ? "is" : "are"} bound by the path and sent with another value in the ${t}`));
|
|
195
195
|
}
|
|
196
|
-
return
|
|
196
|
+
return S.succeed({ value: {
|
|
197
197
|
...o,
|
|
198
198
|
...a
|
|
199
199
|
} });
|
|
200
200
|
},
|
|
201
|
-
encode: (e) =>
|
|
201
|
+
encode: (e) => S.succeed(e)
|
|
202
202
|
}), A = [
|
|
203
|
-
|
|
204
|
-
...e.openAccess === void 0 ? [
|
|
205
|
-
...(i.scopes ?? []).map((e) =>
|
|
203
|
+
se(),
|
|
204
|
+
...e.openAccess === void 0 ? [U()] : [],
|
|
205
|
+
...(i.scopes ?? []).map((e) => W(e))
|
|
206
206
|
], j = (() => {
|
|
207
207
|
let t = e.source;
|
|
208
208
|
return typeof t == "string" ? t : Array.isArray(t) ? t[0] : void 0;
|
|
@@ -213,72 +213,72 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
213
213
|
query: t.query,
|
|
214
214
|
source: j,
|
|
215
215
|
status: n
|
|
216
|
-
}),
|
|
217
|
-
r(
|
|
216
|
+
}), N = i.stream === "sse" && e.kind === "query" && n !== void 0, I = C.encodeUnknown(y), L = N ? (e, t) => Y((r) => n(e.value, t, (e) => {
|
|
217
|
+
r(ue(String(e._tag ?? "message"), e));
|
|
218
218
|
})) : async (n, r) => {
|
|
219
219
|
let c;
|
|
220
220
|
try {
|
|
221
221
|
c = await t(n.value, r);
|
|
222
222
|
} catch (t) {
|
|
223
|
-
throw te(t, e, i,
|
|
223
|
+
throw te(t, e, i, o, a, M(r));
|
|
224
224
|
}
|
|
225
|
-
let l = await
|
|
226
|
-
return
|
|
225
|
+
let l = await x.runPromise(I(c)), u = s(a, l, M(r));
|
|
226
|
+
return K(u.body, {
|
|
227
227
|
...u.headers === void 0 ? {} : { headers: u.headers },
|
|
228
228
|
...u.contentType === void 0 ? {} : { contentType: u.contentType }
|
|
229
229
|
});
|
|
230
|
-
},
|
|
231
|
-
for (let e of
|
|
232
|
-
let t =
|
|
233
|
-
t !== void 0 &&
|
|
230
|
+
}, z = e.error, B = [...F(z)], V = [];
|
|
231
|
+
for (let e of B) {
|
|
232
|
+
let t = R(z, e);
|
|
233
|
+
t !== void 0 && V.push({
|
|
234
234
|
status: i.errorStatus?.[e] ?? 422,
|
|
235
235
|
tag: e,
|
|
236
236
|
schema: t
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
for (let e of
|
|
240
|
-
if (
|
|
239
|
+
for (let e of o) for (let t of F(e.schema)) {
|
|
240
|
+
if (B.includes(t)) continue;
|
|
241
241
|
let n = i.errorStatus?.[t] ?? e.rest?.status;
|
|
242
242
|
if (n === void 0) continue;
|
|
243
|
-
let r =
|
|
244
|
-
|
|
243
|
+
let r = R(e.schema, t) ?? e.schema;
|
|
244
|
+
V.push({
|
|
245
245
|
status: n,
|
|
246
246
|
tag: t,
|
|
247
247
|
schema: r
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
let
|
|
250
|
+
let H = i.security === !1 ? "none" : i.security ?? (e.openAccess === void 0 ? "required" : "optional"), G = {
|
|
251
251
|
tag: e.name,
|
|
252
252
|
kind: e.kind,
|
|
253
253
|
version: i.version ?? "v1",
|
|
254
|
-
security:
|
|
254
|
+
security: H,
|
|
255
255
|
idempotent: i.idempotent === !0,
|
|
256
256
|
input: g,
|
|
257
257
|
pathParams: h,
|
|
258
258
|
output: y,
|
|
259
259
|
source: j,
|
|
260
|
-
errorResponses:
|
|
260
|
+
errorResponses: V,
|
|
261
261
|
format: a
|
|
262
262
|
};
|
|
263
|
-
return
|
|
263
|
+
return le({
|
|
264
264
|
method: u,
|
|
265
265
|
path: m,
|
|
266
|
-
input:
|
|
267
|
-
output:
|
|
268
|
-
handler:
|
|
269
|
-
...
|
|
266
|
+
input: k,
|
|
267
|
+
output: C.Unknown,
|
|
268
|
+
handler: L,
|
|
269
|
+
...N ? { streaming: !0 } : {},
|
|
270
270
|
guards: A,
|
|
271
|
-
operationId: i.operationId ??
|
|
271
|
+
operationId: i.operationId ?? ne(e.name),
|
|
272
272
|
tags: i.tags ?? [e.name.split(".")[0] ?? e.name],
|
|
273
|
-
projection:
|
|
274
|
-
...a.etag && u === "GET" && !
|
|
275
|
-
...i.example === void 0 ? {} : { example:
|
|
273
|
+
projection: G,
|
|
274
|
+
...a.etag && u === "GET" && !N ? { etag: !0 } : {},
|
|
275
|
+
...i.example === void 0 ? {} : { example: oe(i.example, g, y) },
|
|
276
276
|
...i.summary === void 0 ? {} : { summary: i.summary },
|
|
277
277
|
...i.description === void 0 ? {} : { description: i.description },
|
|
278
278
|
...i.deprecated === void 0 ? {} : { deprecated: i.deprecated },
|
|
279
279
|
...i.sunset === void 0 ? {} : { sunset: i.sunset }
|
|
280
280
|
});
|
|
281
|
-
},
|
|
281
|
+
}, V = (e, t = {}) => e.filter((e) => e.descriptor.publicApi !== void 0).map((e) => B(e.descriptor, e.invoke, e.subscribe, t)).sort((e, t) => e.path.localeCompare(t.path)), H = (e) => y(e.filter((e) => e.projection !== void 0).map((e) => {
|
|
282
282
|
let t = e.projection, n = {
|
|
283
283
|
tag: t.tag,
|
|
284
284
|
method: e.method,
|
|
@@ -288,31 +288,31 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
288
288
|
security: t.security,
|
|
289
289
|
errors: [...t.errorResponses].map((e) => `${e.status}:${e.tag}`).sort()
|
|
290
290
|
};
|
|
291
|
-
return `${JSON.stringify(n)} ${
|
|
292
|
-
}).sort().join("\n")),
|
|
291
|
+
return `${JSON.stringify(n)} ${o(t.input.ast)} ${o(t.output.ast)}`;
|
|
292
|
+
}).sort().join("\n")), U = () => (e) => {
|
|
293
293
|
if (e.subject.type === "anonymous") return {
|
|
294
294
|
status: 401,
|
|
295
295
|
message: e.subject.credentialRejected ?? "Authentication required"
|
|
296
296
|
};
|
|
297
|
-
},
|
|
297
|
+
}, W = (e) => (t) => {
|
|
298
298
|
let n = t.subject.scopes;
|
|
299
299
|
if (!(n && (n.includes(e) || n.includes("admin:full")))) return {
|
|
300
300
|
status: 403,
|
|
301
301
|
message: `Missing required scope: ${e}`
|
|
302
302
|
};
|
|
303
|
-
},
|
|
303
|
+
}, G = (e) => (t) => {
|
|
304
304
|
let n = t.subject.scopes;
|
|
305
305
|
if (!(n && (n.includes("admin:full") || e.some((e) => n.includes(e))))) return {
|
|
306
306
|
status: 403,
|
|
307
307
|
message: `Missing required scope: one of ${e.join(", ")}`
|
|
308
308
|
};
|
|
309
|
-
},
|
|
309
|
+
}, K = (e, t = {}) => ({
|
|
310
310
|
__voltroRestResponse: !0,
|
|
311
311
|
status: t.status ?? 200,
|
|
312
312
|
body: e,
|
|
313
313
|
...t.headers === void 0 ? {} : { headers: t.headers },
|
|
314
314
|
...t.contentType === void 0 ? {} : { contentType: t.contentType }
|
|
315
|
-
}),
|
|
315
|
+
}), q = (e) => typeof e == "object" && !!e && e.__voltroRestResponse === !0, J = class extends Error {
|
|
316
316
|
status;
|
|
317
317
|
body;
|
|
318
318
|
headers;
|
|
@@ -320,7 +320,7 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
320
320
|
constructor(e, t, n, r) {
|
|
321
321
|
super(`REST ${e}`), this.name = "RestRouteError", this.status = e, this.body = t, this.headers = n, this.contentType = r;
|
|
322
322
|
}
|
|
323
|
-
},
|
|
323
|
+
}, ce = (e, t, n) => new J(e, t, n), le = (e) => {
|
|
324
324
|
if (e.version === void 0) return e;
|
|
325
325
|
if (!/^v\d+$/.test(e.version)) throw Error(`defineRestRoute(${e.method} ${e.path}): version "${e.version}" must be 'v' followed by digits — 'v1', 'v2', …`);
|
|
326
326
|
if ((/* @__PURE__ */ RegExp("^/v\\d+(/|$)")).test(e.path)) throw Error(`defineRestRoute(${e.method} ${e.path}): the path already starts with a version segment AND declares version: '${e.version}'. Pick one spelling — either bake the version into the path, or declare version: and keep the path bare ('/customers'). Both would mount '/${e.version}${e.path}', which is never what the author meant.`);
|
|
@@ -328,13 +328,13 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
328
328
|
...e,
|
|
329
329
|
path: `/${e.version}${e.path}`
|
|
330
330
|
};
|
|
331
|
-
},
|
|
331
|
+
}, Y = (e, t = {}) => ({
|
|
332
332
|
__voltroRestStream: !0,
|
|
333
333
|
stream: {
|
|
334
334
|
subscribe: e,
|
|
335
335
|
...t.keepAliveMs === void 0 ? {} : { keepAliveMs: t.keepAliveMs }
|
|
336
336
|
}
|
|
337
|
-
}),
|
|
337
|
+
}), ue = (e, t) => `event: ${e}\n${(typeof t == "string" ? t : JSON.stringify(t)).split("\n").map((e) => `data: ${e}`).join("\n")}\n\n`, de = (e) => typeof e == "object" && !!e && e.__voltroRestStream === !0, fe = (e, t = {}) => ({
|
|
338
338
|
__voltroRestBytes: !0,
|
|
339
339
|
byteStream: {
|
|
340
340
|
stream: e,
|
|
@@ -344,7 +344,7 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
344
344
|
...t.contentType === void 0 ? {} : { contentType: t.contentType },
|
|
345
345
|
...t.status === void 0 ? {} : { status: t.status },
|
|
346
346
|
...t.headers === void 0 ? {} : { headers: t.headers }
|
|
347
|
-
}), X = (e) => typeof e == "object" && !!e && e.__voltroRestBytes === !0,
|
|
347
|
+
}), X = (e) => typeof e == "object" && !!e && e.__voltroRestBytes === !0, pe = async (e) => {
|
|
348
348
|
let t = await globalThis.crypto.subtle.digest("SHA-1", new TextEncoder().encode(e));
|
|
349
349
|
return [...new Uint8Array(t)].map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
350
350
|
}, Z = (e, t, n, r = "application/json; charset=utf-8") => ({
|
|
@@ -365,7 +365,7 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
365
365
|
query: t.query,
|
|
366
366
|
source: s.source,
|
|
367
367
|
status: n
|
|
368
|
-
}, l =
|
|
368
|
+
}, l = d(s.format, {
|
|
369
369
|
status: n,
|
|
370
370
|
tag: r,
|
|
371
371
|
message: i,
|
|
@@ -375,7 +375,7 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
375
375
|
...o,
|
|
376
376
|
...l.headers ?? {}
|
|
377
377
|
}, l.contentType);
|
|
378
|
-
},
|
|
378
|
+
}, me = (e) => (e.headers["content-type"] ?? "application/json").split(";")[0].trim().toLowerCase(), he = (e, t) => {
|
|
379
379
|
if (e.length === 0) return;
|
|
380
380
|
let n = t === "application/x-www-form-urlencoded";
|
|
381
381
|
if (!n && t !== "application/json" && !/^application\/[^/;\s]+\+json$/.test(t)) return;
|
|
@@ -383,21 +383,21 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
383
383
|
if (r.trim() !== "") {
|
|
384
384
|
if (n) {
|
|
385
385
|
let e = (e) => decodeURIComponent(e.replace(/\+/g, " "));
|
|
386
|
-
return
|
|
386
|
+
return _e(r.split("&").filter(Boolean).map((t) => {
|
|
387
387
|
let n = t.indexOf("=");
|
|
388
388
|
return n < 0 ? [e(t), ""] : [e(t.slice(0, n)), e(t.slice(n + 1))];
|
|
389
389
|
}));
|
|
390
390
|
}
|
|
391
391
|
return JSON.parse(r);
|
|
392
392
|
}
|
|
393
|
-
},
|
|
393
|
+
}, ge = (e) => _e(new URLSearchParams(e)), _e = (e) => {
|
|
394
394
|
let t = /* @__PURE__ */ new Map();
|
|
395
395
|
for (let [n, r] of e) {
|
|
396
396
|
let e = t.get(n);
|
|
397
397
|
e === void 0 ? t.set(n, r) : Array.isArray(e) ? e.push(r) : t.set(n, [e, r]);
|
|
398
398
|
}
|
|
399
399
|
return Object.fromEntries(t);
|
|
400
|
-
},
|
|
400
|
+
}, ve = (e, t) => {
|
|
401
401
|
let n = e.split("/").filter((e) => e.length > 0), r = t.split("/").filter((e) => e.length > 0), i = {};
|
|
402
402
|
for (let e = 0; e < n.length; e++) {
|
|
403
403
|
let t = n[e];
|
|
@@ -411,7 +411,7 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
return i;
|
|
414
|
-
},
|
|
414
|
+
}, ye = (e, t) => {
|
|
415
415
|
let n = e.path.split("/"), r = n[n.length - 1] === "*", i = r ? n.slice(0, -1) : n, a = t.split("/");
|
|
416
416
|
if (a.length < i.length) return !1;
|
|
417
417
|
for (let e = 0; e < i.length; e++) {
|
|
@@ -421,173 +421,182 @@ var w = (e, t, n) => t.method ?? (t.resource !== void 0 && n !== void 0 ? D("",
|
|
|
421
421
|
} else if (t !== n) return !1;
|
|
422
422
|
}
|
|
423
423
|
return a.length === i.length ? !0 : e.match === "exact" && !r ? !1 : a.slice(i.length).some((e) => e.length > 0);
|
|
424
|
-
},
|
|
425
|
-
query:
|
|
424
|
+
}, be = (e, t, n) => ({
|
|
425
|
+
query: ge(e.query),
|
|
426
426
|
params: t,
|
|
427
|
-
body: n ?
|
|
428
|
-
form:
|
|
427
|
+
body: n ? he(e.rawBody, me(e)) : void 0,
|
|
428
|
+
form: me(e) === "application/x-www-form-urlencoded"
|
|
429
429
|
}), $ = /* @__PURE__ */ new Set([
|
|
430
430
|
"POST",
|
|
431
431
|
"PUT",
|
|
432
432
|
"PATCH",
|
|
433
433
|
"DELETE"
|
|
434
|
-
]),
|
|
435
|
-
if (
|
|
434
|
+
]), xe = (e, n, r, i, a) => {
|
|
435
|
+
if (e instanceof J) return Z(e.status, e.body, {
|
|
436
436
|
...i,
|
|
437
|
-
...
|
|
438
|
-
},
|
|
439
|
-
if (typeof
|
|
440
|
-
let o =
|
|
437
|
+
...e.headers
|
|
438
|
+
}, e.contentType);
|
|
439
|
+
if (typeof e == "object" && e) {
|
|
440
|
+
let o = e;
|
|
441
441
|
if (typeof o.status == "number") return Q(r, a, o.status, typeof o._tag == "string" ? o._tag : "Error", typeof o.message == "string" ? o.message : "Error", {}, { ...i });
|
|
442
|
-
if (o._tag === "Unauthenticated" ||
|
|
442
|
+
if (o._tag === "Unauthenticated" || e instanceof t) return Q(r, a, 401, "Unauthorized", typeof o.reason == "string" ? o.reason : "Authentication required", {}, { ...i });
|
|
443
443
|
if (o._tag === "ScopeError") {
|
|
444
444
|
let e = n.type === "anonymous" ? 401 : 403;
|
|
445
445
|
return Q(r, a, e, e === 401 ? "Unauthorized" : "Forbidden", typeof o.message == "string" ? o.message : "Forbidden", {}, { ...i });
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
return
|
|
449
|
-
error:
|
|
448
|
+
return u({
|
|
449
|
+
error: e,
|
|
450
450
|
source: "rest",
|
|
451
451
|
name: `${r.method} ${r.path}`,
|
|
452
452
|
fields: { status: 500 }
|
|
453
453
|
}), {
|
|
454
454
|
...Q(r, a, 500, "InternalServerError", "Internal Server Error", {}, { ...i }),
|
|
455
|
-
cause:
|
|
455
|
+
cause: e
|
|
456
456
|
};
|
|
457
|
-
},
|
|
458
|
-
let
|
|
459
|
-
|
|
460
|
-
let
|
|
461
|
-
return
|
|
462
|
-
method:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
457
|
+
}, Se = (o, s, c) => {
|
|
458
|
+
let l = o.input ? C.decodeUnknown(o.input) : void 0, u = C.encode(o.output), d = o.input === void 0 ? void 0 : w.encodedAST(o.input.ast), f = d !== void 0 && (!w.isTypeLiteral(d) || d.indexSignatures.length > 0 || d.propertySignatures.some((e) => e.name === "body")), p = {};
|
|
459
|
+
o.projection !== void 0 && (p["x-voltro-rest-profile"] = o.projection.format.name);
|
|
460
|
+
let m = (e) => e.replace(/\/$/, "").split("/").length, h = m(o.path);
|
|
461
|
+
return o.deprecated !== void 0 && (p.Deprecation = "true"), o.sunset !== void 0 && (p.Sunset = o.sunset), {
|
|
462
|
+
method: o.method,
|
|
463
|
+
answersOtherMethods: !0,
|
|
464
|
+
path: o.path,
|
|
465
|
+
match: o.path.endsWith("/*") ? "prefix" : "exact",
|
|
466
|
+
...o.maxBodyBytes === void 0 ? {} : { maxBodyBytes: o.maxBodyBytes },
|
|
467
|
+
handle: async (d) => {
|
|
468
|
+
if (!o.path.endsWith("/*") && m(d.path) !== h) return Q(o, d, 404, "NotFound", "Not Found", {}, { ...p });
|
|
469
|
+
let g = d.method.toUpperCase();
|
|
470
|
+
if (!(g === o.method || g === "HEAD" && o.method === "GET")) return Q(o, d, 405, "MethodNotAllowed", "Method Not Allowed", { allow: c }, {
|
|
471
|
+
...p,
|
|
472
|
+
Allow: c
|
|
472
473
|
});
|
|
473
|
-
if (
|
|
474
|
-
let e = Date.parse(
|
|
475
|
-
if (!Number.isNaN(e) && Date.now() >= e) return Q(
|
|
476
|
-
...
|
|
477
|
-
...
|
|
478
|
-
}, { ...
|
|
474
|
+
if (o.sunset !== void 0) {
|
|
475
|
+
let e = Date.parse(o.sunset);
|
|
476
|
+
if (!Number.isNaN(e) && Date.now() >= e) return Q(o, d, 410, "Gone", "Gone", {
|
|
477
|
+
...o.version === void 0 ? {} : { version: o.version },
|
|
478
|
+
...o.deprecated === void 0 ? {} : { replacement: o.deprecated }
|
|
479
|
+
}, { ...p });
|
|
479
480
|
}
|
|
480
|
-
let
|
|
481
|
-
if (
|
|
481
|
+
let _;
|
|
482
|
+
if (l) {
|
|
482
483
|
let e;
|
|
483
484
|
try {
|
|
484
|
-
e =
|
|
485
|
+
e = be(d, ve(o.path, d.path), f);
|
|
485
486
|
} catch {
|
|
486
|
-
return Q(
|
|
487
|
+
return Q(o, d, 400, "InvalidRequest", "Malformed request body", {}, { ...p });
|
|
487
488
|
}
|
|
488
|
-
let t = await
|
|
489
|
+
let t = await x.runPromise(l(e).pipe(x.map((e) => ({
|
|
489
490
|
ok: !0,
|
|
490
491
|
value: e
|
|
491
|
-
})),
|
|
492
|
+
})), x.catchAll((e) => x.succeed({
|
|
492
493
|
ok: !1,
|
|
493
494
|
cause: e
|
|
494
495
|
}))));
|
|
495
|
-
if (!t.ok) return Q(
|
|
496
|
-
|
|
496
|
+
if (!t.ok) return Q(o, d, 400, "InvalidRequest", "Invalid request", { detail: String(t.cause) }, { ...p });
|
|
497
|
+
_ = t.value;
|
|
497
498
|
}
|
|
498
|
-
let
|
|
499
|
+
let v;
|
|
499
500
|
try {
|
|
500
|
-
|
|
501
|
-
} catch (
|
|
502
|
-
if (
|
|
503
|
-
let
|
|
504
|
-
return Q(
|
|
501
|
+
v = s.resolveSubject ? await s.resolveSubject(d.headers) : e(d.headers["x-tenant"] ?? null);
|
|
502
|
+
} catch (e) {
|
|
503
|
+
if (e instanceof t || typeof e == "object" && e && e._tag === "Unauthenticated") {
|
|
504
|
+
let t = e.reason;
|
|
505
|
+
return Q(o, d, 401, "Unauthorized", t ?? "Authentication required", {}, { ...p });
|
|
505
506
|
}
|
|
506
|
-
throw
|
|
507
|
+
throw e;
|
|
507
508
|
}
|
|
508
|
-
let
|
|
509
|
+
let y;
|
|
509
510
|
try {
|
|
510
|
-
|
|
511
|
+
y = s.buildContext ? await s.buildContext(v, d.headers) : void 0;
|
|
511
512
|
} catch (e) {
|
|
512
|
-
return
|
|
513
|
+
return xe(e, v, o, p, d);
|
|
513
514
|
}
|
|
514
|
-
let
|
|
515
|
-
subject:
|
|
516
|
-
headers:
|
|
517
|
-
store:
|
|
518
|
-
method:
|
|
519
|
-
path:
|
|
520
|
-
query:
|
|
521
|
-
rawBody:
|
|
522
|
-
...
|
|
523
|
-
...
|
|
515
|
+
let S = typeof y == "object" && y && "store" in y ? y.store : s.store, C = {
|
|
516
|
+
subject: v,
|
|
517
|
+
headers: d.headers,
|
|
518
|
+
store: S,
|
|
519
|
+
method: g,
|
|
520
|
+
path: d.path,
|
|
521
|
+
query: d.query,
|
|
522
|
+
rawBody: d.rawBody,
|
|
523
|
+
...y === void 0 ? {} : { app: y },
|
|
524
|
+
...d.remoteAddr === void 0 ? {} : { remoteAddr: d.remoteAddr }
|
|
524
525
|
};
|
|
525
|
-
if (
|
|
526
|
-
let t = await e(
|
|
527
|
-
if (t) return Q(
|
|
526
|
+
if (o.guards) for (let e of o.guards) {
|
|
527
|
+
let t = await e(C);
|
|
528
|
+
if (t) return Q(o, d, t.status, t.status === 401 ? "Unauthorized" : t.status === 403 ? "Forbidden" : "GuardRejected", t.message, {}, { ...p });
|
|
528
529
|
}
|
|
529
|
-
let
|
|
530
|
-
if (
|
|
531
|
-
let e = await
|
|
530
|
+
let w = s.idempotency, T = w && $.has(o.method) ? d.headers[w.header.toLowerCase()] : void 0, E = w && T ? i(v.tenantId, o.method, o.path) : "", D;
|
|
531
|
+
if (w && T) {
|
|
532
|
+
let e = await n(w.store, E, T, w.ttlMs, Date.now());
|
|
532
533
|
if (e.kind === "replay") return Z(e.response.status, e.response.body, {
|
|
533
|
-
...
|
|
534
|
+
...p,
|
|
534
535
|
"Idempotency-Replayed": "true"
|
|
535
536
|
});
|
|
536
|
-
if (e.kind === "conflict") return Q(
|
|
537
|
+
if (e.kind === "conflict") return Q(o, d, 409, "Conflict", "A request with this Idempotency-Key is already being processed", {}, { ...p });
|
|
538
|
+
D = r(w.store, E, T);
|
|
537
539
|
}
|
|
538
540
|
try {
|
|
539
|
-
let e = await
|
|
540
|
-
if (
|
|
541
|
+
let e = await o.handler(_, C);
|
|
542
|
+
if (de(e) || X(e)) return w && T && await b(w.store, E, T), X(e) ? {
|
|
541
543
|
status: e.status ?? 200,
|
|
542
544
|
headers: {
|
|
543
|
-
...
|
|
545
|
+
...p,
|
|
544
546
|
...e.headers
|
|
545
547
|
},
|
|
546
548
|
byteStream: e.byteStream,
|
|
547
549
|
...e.contentType === void 0 ? {} : { contentType: e.contentType }
|
|
548
550
|
} : {
|
|
549
551
|
status: 200,
|
|
550
|
-
headers:
|
|
552
|
+
headers: p,
|
|
551
553
|
stream: e.stream
|
|
552
554
|
};
|
|
553
|
-
let t =
|
|
554
|
-
...
|
|
555
|
+
let t = q(e) ? e : K(e), n = await x.runPromise(u(t.body)), r = {
|
|
556
|
+
...p,
|
|
555
557
|
...t.headers
|
|
556
558
|
};
|
|
557
|
-
if (
|
|
559
|
+
if (w && T && await a(w.store, E, T, {
|
|
558
560
|
status: t.status,
|
|
559
|
-
body:
|
|
560
|
-
}, Date.now()),
|
|
561
|
-
let e = `W/"${await
|
|
562
|
-
return
|
|
561
|
+
body: n
|
|
562
|
+
}, Date.now()), o.etag === !0 && o.method === "GET") {
|
|
563
|
+
let e = `W/"${await pe(JSON.stringify(n))}"`, i = d.headers["if-none-match"];
|
|
564
|
+
return i !== void 0 && i.split(",").some((t) => t.trim() === e) ? {
|
|
563
565
|
status: 304,
|
|
564
566
|
headers: {
|
|
565
|
-
...
|
|
567
|
+
...p,
|
|
566
568
|
ETag: e
|
|
567
569
|
}
|
|
568
|
-
} : Z(t.status,
|
|
569
|
-
...
|
|
570
|
+
} : Z(t.status, n, {
|
|
571
|
+
...r,
|
|
570
572
|
ETag: e
|
|
571
573
|
}, t.contentType);
|
|
572
574
|
}
|
|
573
575
|
return t.status === 204 || t.status === 304 ? {
|
|
574
576
|
status: t.status,
|
|
575
|
-
headers:
|
|
576
|
-
} : Z(t.status,
|
|
577
|
+
headers: r
|
|
578
|
+
} : Z(t.status, n, r, t.contentType);
|
|
577
579
|
} catch (e) {
|
|
578
|
-
return
|
|
580
|
+
return w && T && await b(w.store, E, T), xe(e, v, o, p, d);
|
|
581
|
+
} finally {
|
|
582
|
+
D?.();
|
|
579
583
|
}
|
|
580
584
|
}
|
|
581
585
|
};
|
|
582
|
-
},
|
|
586
|
+
}, Ce = (e, t = {}) => {
|
|
583
587
|
if (t.idempotency !== void 0) {
|
|
584
588
|
for (let t of e) if (t.streaming === !0 && $.has(t.method)) throw Error(`REST route ${t.method} ${t.path} declares \`streaming: true\` on a method the idempotency binding claims (${[...$].join("/")}). A stream cannot complete an idempotency claim — there is no replayable body to cache — so a retried request would 409 until the claim's TTL. Either serve the stream on GET, or scope the idempotency binding away from this app's streaming routes.`);
|
|
585
589
|
}
|
|
586
|
-
|
|
587
|
-
|
|
590
|
+
let n = (e) => e.split("/").map((e) => e.startsWith(":") ? ":" : e).join("/"), r = /* @__PURE__ */ new Map();
|
|
591
|
+
for (let t of e) {
|
|
592
|
+
let e = r.get(n(t.path)) ?? [];
|
|
593
|
+
e.includes(t.method) || e.push(t.method), r.set(n(t.path), e);
|
|
594
|
+
}
|
|
595
|
+
return e.map((e) => Se(e, t, r.get(n(e.path)).join(", ")));
|
|
596
|
+
}, we = async (e, t) => {
|
|
588
597
|
let n = await e[0].handle(t);
|
|
589
598
|
for (let r = 1; r < e.length && n.status === 405; r++) n = await e[r].handle(t);
|
|
590
599
|
return n;
|
|
591
600
|
};
|
|
592
601
|
//#endregion
|
|
593
|
-
export {
|
|
602
|
+
export { _ as JSONAPI_MEDIA_TYPE, p as PROBLEM_JSON, h as REST_PROFILE_NAMES, J as RestRouteError, fe as bytes, P as coerceQueryObject, N as coerceQueryValue, V as collectPublicApiRoutes, F as declaredErrorTags, le as defineRestRoute, T as derivePublicMethod, E as derivePublicPath, k as deriveResource, we as dispatchSharedPath, d as encodeRestError, s as encodeRestSuccess, R as errorMemberSchema, X as isRestByteResponse, q as isRestResponse, de as isRestStreamResponse, ve as matchPathParams, m as nextLink, A as normalizePathParams, ne as operationIdOf, ee as pathParamNames, g as problemDetails, c as problemTypeOf, L as projectedFailure, B as publicApiRoute, H as publicSurfaceDigest, G as requireAnyScope, U as requireAuthenticated, W as requireScope, f as resolveRestFormat, O as resourceIdField, K as response, ce as restError, Ce as restRoutesToHttpRoutes, v as restViewSchema, ye as routeAcceptsPath, Y as sse, ue as sseFrame, l as toSnakeCase, oe as wireExample };
|