@tonyclaw/llm-inspector 1.10.0 → 1.11.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/.output/nitro.json +1 -1
- package/.output/public/assets/index-BIZeMR5N.js +105 -0
- package/.output/public/assets/index-SmtLx1lM.css +1 -0
- package/.output/public/assets/main-QfbQ5oBP.js +17 -0
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +1 -1
- package/.output/server/_libs/ajv-formats.mjs +18 -18
- package/.output/server/_libs/ajv.mjs +6306 -942
- package/.output/server/_libs/cookie-es.mjs +21 -7
- package/.output/server/_libs/diff.mjs +320 -0
- package/.output/server/_libs/floating-ui__core.mjs +17 -18
- package/.output/server/_libs/floating-ui__dom.mjs +20 -24
- package/.output/server/_libs/floating-ui__react-dom.mjs +28 -55
- package/.output/server/_libs/floating-ui__utils.mjs +36 -36
- package/.output/server/_libs/h3-v2.mjs +9 -20
- package/.output/server/_libs/isbot.mjs +2 -3
- package/.output/server/_libs/json-schema-traverse.mjs +90 -1
- package/.output/server/_libs/jszip.mjs +28 -28
- package/.output/server/_libs/lucide-react.mjs +103 -80
- package/.output/server/_libs/mdast-util-from-markdown.mjs +1 -1
- package/.output/server/_libs/pako.mjs +13 -13
- package/.output/server/_libs/property-information.mjs +1 -13
- package/.output/server/_libs/radix-ui__react-collection.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-id.mjs +1 -1
- package/.output/server/_libs/react-dom.mjs +10 -10
- package/.output/server/_libs/react.mjs +44 -44
- package/.output/server/_libs/readable-stream.mjs +15 -15
- package/.output/server/_libs/rou3.mjs +7 -1
- package/.output/server/_libs/safe-buffer.mjs +3 -3
- package/.output/server/_libs/semver.mjs +10 -10
- package/.output/server/_libs/seroval-plugins.mjs +5 -5
- package/.output/server/_libs/seroval.mjs +596 -606
- package/.output/server/_libs/srvx.mjs +245 -10
- package/.output/server/_libs/swr.mjs +1 -1
- package/.output/server/_libs/tailwind-merge.mjs +41 -286
- package/.output/server/_libs/tanstack__history.mjs +44 -31
- package/.output/server/_libs/tanstack__react-router.mjs +1089 -780
- package/.output/server/_libs/tanstack__react-store.mjs +1 -1
- package/.output/server/_libs/tanstack__react-virtual.mjs +7 -82
- package/.output/server/_libs/tanstack__router-core.mjs +2331 -2226
- package/.output/server/_libs/tanstack__virtual-core.mjs +17 -58
- package/.output/server/_libs/tiny-invariant.mjs +12 -0
- package/.output/server/_libs/tiny-warning.mjs +5 -0
- package/.output/server/_libs/ungap__structured-clone.mjs +2 -14
- package/.output/server/_libs/use-sync-external-store.mjs +1 -1
- package/.output/server/_libs/zod.mjs +207 -505
- package/.output/server/_ssr/{index-XyU4WVWt.mjs → index-I_Nx8QEB.mjs} +532 -79
- package/.output/server/_ssr/index.mjs +776 -1098
- package/.output/server/_ssr/{router-BR4XO8XJ.mjs → router-BVxfVFsb.mjs} +98 -53
- package/.output/server/_tanstack-start-manifest_v-Cm2Owszu.mjs +4 -0
- package/.output/server/index.mjs +28 -28
- package/README.md +1 -1
- package/package.json +2 -1
- package/src/components/ProxyViewer.tsx +10 -3
- package/src/components/ProxyViewerContainer.tsx +6 -0
- package/src/components/proxy-viewer/ConversationGroup.tsx +10 -1
- package/src/components/proxy-viewer/LogEntry.tsx +114 -5
- package/src/components/proxy-viewer/diff/DiffView.tsx +319 -0
- package/src/components/proxy-viewer/diff/computeDiff.ts +178 -0
- package/src/components/proxy-viewer/diff/index.ts +3 -0
- package/src/components/ui/crab-logo.tsx +45 -0
- package/src/proxy/config.ts +3 -17
- package/src/proxy/dataDir.ts +56 -0
- package/src/proxy/formats/anthropic/stream.ts +5 -2
- package/src/proxy/formats/jsonSchema.ts +12 -0
- package/src/proxy/formats/openai/stream.ts +21 -16
- package/src/proxy/handler.ts +15 -5
- package/src/proxy/providers.ts +61 -1
- package/src/proxy/schemas.ts +42 -0
- package/src/proxy/store.ts +6 -23
- package/.output/public/assets/index-BFuUQkWu.js +0 -11
- package/.output/public/assets/index-F2ojFPJp.css +0 -1
- package/.output/public/assets/index-nKnhyW4Y.js +0 -122
- package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +0 -6
- package/.output/server/_tanstack-start-manifest_v-DFoSjBkb.mjs +0 -4
|
@@ -13,6 +13,10 @@ const oppositeSideMap = {
|
|
|
13
13
|
bottom: "top",
|
|
14
14
|
top: "bottom"
|
|
15
15
|
};
|
|
16
|
+
const oppositeAlignmentMap = {
|
|
17
|
+
start: "end",
|
|
18
|
+
end: "start"
|
|
19
|
+
};
|
|
16
20
|
function clamp(start, value, end) {
|
|
17
21
|
return max(start, min(value, end));
|
|
18
22
|
}
|
|
@@ -31,9 +35,9 @@ function getOppositeAxis(axis) {
|
|
|
31
35
|
function getAxisLength(axis) {
|
|
32
36
|
return axis === "y" ? "height" : "width";
|
|
33
37
|
}
|
|
38
|
+
const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
34
39
|
function getSideAxis(placement) {
|
|
35
|
-
|
|
36
|
-
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
40
|
+
return yAxisSides.has(getSide(placement)) ? "y" : "x";
|
|
37
41
|
}
|
|
38
42
|
function getAlignmentAxis(placement) {
|
|
39
43
|
return getOppositeAxis(getSideAxis(placement));
|
|
@@ -56,7 +60,7 @@ function getExpandedPlacements(placement) {
|
|
|
56
60
|
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
57
61
|
}
|
|
58
62
|
function getOppositeAlignmentPlacement(placement) {
|
|
59
|
-
return placement.
|
|
63
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
60
64
|
}
|
|
61
65
|
const lrPlacement = ["left", "right"];
|
|
62
66
|
const rlPlacement = ["right", "left"];
|
|
@@ -87,8 +91,7 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
|
87
91
|
return list;
|
|
88
92
|
}
|
|
89
93
|
function getOppositePlacement(placement) {
|
|
90
|
-
|
|
91
|
-
return oppositeSideMap[side] + placement.slice(side.length);
|
|
94
|
+
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
92
95
|
}
|
|
93
96
|
function expandPaddingObject(padding) {
|
|
94
97
|
return {
|
|
@@ -166,6 +169,7 @@ function isShadowRoot(value) {
|
|
|
166
169
|
}
|
|
167
170
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
168
171
|
}
|
|
172
|
+
const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
169
173
|
function isOverflowElement(element) {
|
|
170
174
|
const {
|
|
171
175
|
overflow,
|
|
@@ -173,31 +177,29 @@ function isOverflowElement(element) {
|
|
|
173
177
|
overflowY,
|
|
174
178
|
display
|
|
175
179
|
} = getComputedStyle(element);
|
|
176
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display
|
|
180
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
177
181
|
}
|
|
182
|
+
const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
178
183
|
function isTableElement(element) {
|
|
179
|
-
return
|
|
184
|
+
return tableElements.has(getNodeName(element));
|
|
180
185
|
}
|
|
186
|
+
const topLayerSelectors = [":popover-open", ":modal"];
|
|
181
187
|
function isTopLayer(element) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return
|
|
188
|
+
return topLayerSelectors.some((selector) => {
|
|
189
|
+
try {
|
|
190
|
+
return element.matches(selector);
|
|
191
|
+
} catch (_e) {
|
|
192
|
+
return false;
|
|
185
193
|
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
try {
|
|
189
|
-
return element.matches(":modal");
|
|
190
|
-
} catch (_e) {
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
194
|
+
});
|
|
193
195
|
}
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
let isWebKitValue;
|
|
196
|
+
const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
|
|
197
|
+
const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
|
|
198
|
+
const containValues = ["paint", "layout", "strict", "content"];
|
|
198
199
|
function isContainingBlock(elementOrCss) {
|
|
200
|
+
const webkit = isWebKit();
|
|
199
201
|
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
200
|
-
return
|
|
202
|
+
return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
|
|
201
203
|
}
|
|
202
204
|
function getContainingBlock(element) {
|
|
203
205
|
let currentNode = getParentNode(element);
|
|
@@ -212,13 +214,12 @@ function getContainingBlock(element) {
|
|
|
212
214
|
return null;
|
|
213
215
|
}
|
|
214
216
|
function isWebKit() {
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
return isWebKitValue;
|
|
217
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
218
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
219
219
|
}
|
|
220
|
+
const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
220
221
|
function isLastTraversableNode(node) {
|
|
221
|
-
return
|
|
222
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
222
223
|
}
|
|
223
224
|
function getComputedStyle(element) {
|
|
224
225
|
return getWindow(element).getComputedStyle(element);
|
|
@@ -272,9 +273,8 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
272
273
|
if (isBody) {
|
|
273
274
|
const frameElement = getFrameElement(win);
|
|
274
275
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
275
|
-
} else {
|
|
276
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
277
276
|
}
|
|
277
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
278
278
|
}
|
|
279
279
|
function getFrameElement(win) {
|
|
280
280
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
@@ -296,15 +296,15 @@ export {
|
|
|
296
296
|
getAlignment as c,
|
|
297
297
|
getPaddingObject as d,
|
|
298
298
|
evaluate as e,
|
|
299
|
-
|
|
299
|
+
clamp as f,
|
|
300
300
|
getSideAxis as g,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
301
|
+
getOppositePlacement as h,
|
|
302
|
+
getExpandedPlacements as i,
|
|
303
|
+
getOppositeAxisPlacements as j,
|
|
304
|
+
getAlignmentSides as k,
|
|
305
|
+
max as l,
|
|
306
306
|
min as m,
|
|
307
|
-
|
|
307
|
+
getAxisLength as n,
|
|
308
308
|
getOppositeAxis as o,
|
|
309
309
|
isElement as p,
|
|
310
310
|
getDocumentElement as q,
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function decodePathname(pathname) {
|
|
4
|
-
return decodeURI(pathname.includes("%25") ? pathname.replace(/%25/g, "%2525") : pathname);
|
|
5
|
-
}
|
|
1
|
+
import { a as NullProtoObj } from "./rou3.mjs";
|
|
2
|
+
import { a as FastURL, b as NodeResponse } from "./srvx.mjs";
|
|
6
3
|
const kEventNS = "h3.internal.event.";
|
|
7
4
|
const kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
|
|
8
5
|
const kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
|
|
9
|
-
const kEventResErrHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.err.headers`);
|
|
10
6
|
var H3Event = class {
|
|
11
7
|
app;
|
|
12
8
|
req;
|
|
@@ -18,9 +14,7 @@ var H3Event = class {
|
|
|
18
14
|
this.req = req;
|
|
19
15
|
this.app = app;
|
|
20
16
|
const _url = req._url;
|
|
21
|
-
|
|
22
|
-
if (url.pathname.includes("%")) url.pathname = decodePathname(url.pathname);
|
|
23
|
-
this.url = url;
|
|
17
|
+
this.url = _url && _url instanceof URL ? _url : new FastURL(req.url);
|
|
24
18
|
}
|
|
25
19
|
get res() {
|
|
26
20
|
return this[kEventRes] ||= new H3EventResponse();
|
|
@@ -56,9 +50,6 @@ var H3EventResponse = class {
|
|
|
56
50
|
get headers() {
|
|
57
51
|
return this[kEventResHeaders] ||= new Headers();
|
|
58
52
|
}
|
|
59
|
-
get errHeaders() {
|
|
60
|
-
return this[kEventResErrHeaders] ||= new Headers();
|
|
61
|
-
}
|
|
62
53
|
};
|
|
63
54
|
const DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g;
|
|
64
55
|
function sanitizeStatusMessage(statusMessage = "") {
|
|
@@ -98,8 +89,8 @@ var HTTPError = class HTTPError2 extends Error {
|
|
|
98
89
|
messageInput = arg1;
|
|
99
90
|
details = arg2;
|
|
100
91
|
} else details = arg1;
|
|
101
|
-
const status = sanitizeStatusCode(details?.status || details?.
|
|
102
|
-
const statusText = sanitizeStatusMessage(details?.statusText || details?.
|
|
92
|
+
const status = sanitizeStatusCode(details?.status || details?.cause?.status || details?.status || details?.statusCode, 500);
|
|
93
|
+
const statusText = sanitizeStatusMessage(details?.statusText || details?.cause?.statusText || details?.statusText || details?.statusMessage);
|
|
103
94
|
const message = messageInput || details?.message || details?.cause?.message || details?.statusText || details?.statusMessage || [
|
|
104
95
|
"HTTPError",
|
|
105
96
|
status,
|
|
@@ -185,8 +176,7 @@ function prepareResponse(val, event, config, nested) {
|
|
|
185
176
|
}
|
|
186
177
|
if (error.unhandled && !config.silent) console.error(error);
|
|
187
178
|
const { onError } = config;
|
|
188
|
-
|
|
189
|
-
return onError && !nested ? Promise.resolve(onError(error, event)).catch((error2) => error2).then((newVal) => prepareResponse(newVal ?? val, event, config, true)) : errorResponse(error, config.debug, errHeaders);
|
|
179
|
+
return onError && !nested ? Promise.resolve(onError(error, event)).catch((error2) => error2).then((newVal) => prepareResponse(newVal ?? val, event, config, true)) : errorResponse(error, config.debug);
|
|
190
180
|
}
|
|
191
181
|
const preparedRes = event[kEventRes];
|
|
192
182
|
const preparedHeaders = preparedRes?.[kEventResHeaders];
|
|
@@ -269,18 +259,17 @@ function prepareResponseBody(val, event, config) {
|
|
|
269
259
|
function nullBody(method, status) {
|
|
270
260
|
return method === "HEAD" || status === 100 || status === 101 || status === 102 || status === 204 || status === 205 || status === 304;
|
|
271
261
|
}
|
|
272
|
-
function errorResponse(error, debug
|
|
273
|
-
let headers = error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders);
|
|
274
|
-
if (errHeaders) headers = mergeHeaders$1(headers, errHeaders);
|
|
262
|
+
function errorResponse(error, debug) {
|
|
275
263
|
return new NodeResponse(JSON.stringify({
|
|
276
264
|
...error.toJSON(),
|
|
277
265
|
stack: debug && error.stack ? error.stack.split("\n").map((l) => l.trim()) : void 0
|
|
278
266
|
}, void 0, debug ? 2 : void 0), {
|
|
279
267
|
status: error.status,
|
|
280
268
|
statusText: error.statusText,
|
|
281
|
-
headers
|
|
269
|
+
headers: error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders)
|
|
282
270
|
});
|
|
283
271
|
}
|
|
272
|
+
new TextEncoder();
|
|
284
273
|
export {
|
|
285
274
|
H3Event as H,
|
|
286
275
|
toResponse as t
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var fullPattern = " daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+\\.ai|\\
|
|
1
|
+
var fullPattern = " daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+\\.ai|\\bmanus-user/|\\bort/|\\bperl\\b|\\bsecurityheaders\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^\\w+/\\d\\.\\d\\s\\([\\w@]+\\)$|^active|^ad muncher|^amaya|^apache/|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s[\\w\\d-.]+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|advisor|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|monitor\\b|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/";
|
|
2
2
|
var naivePattern = /bot|crawl|http|lighthouse|scan|search|spider/i;
|
|
3
3
|
var pattern;
|
|
4
4
|
function getPattern() {
|
|
@@ -12,9 +12,8 @@ function getPattern() {
|
|
|
12
12
|
}
|
|
13
13
|
return pattern;
|
|
14
14
|
}
|
|
15
|
-
var isNonEmptyString = (value) => typeof value === "string" && value !== "";
|
|
16
15
|
function isbot(userAgent) {
|
|
17
|
-
return
|
|
16
|
+
return Boolean(userAgent) && getPattern().test(userAgent);
|
|
18
17
|
}
|
|
19
18
|
export {
|
|
20
19
|
isbot as i
|
|
@@ -1,3 +1,91 @@
|
|
|
1
|
+
var jsonSchemaTraverse$1 = { exports: {} };
|
|
2
|
+
var hasRequiredJsonSchemaTraverse$1;
|
|
3
|
+
function requireJsonSchemaTraverse$1() {
|
|
4
|
+
if (hasRequiredJsonSchemaTraverse$1) return jsonSchemaTraverse$1.exports;
|
|
5
|
+
hasRequiredJsonSchemaTraverse$1 = 1;
|
|
6
|
+
var traverse = jsonSchemaTraverse$1.exports = function(schema, opts, cb) {
|
|
7
|
+
if (typeof opts == "function") {
|
|
8
|
+
cb = opts;
|
|
9
|
+
opts = {};
|
|
10
|
+
}
|
|
11
|
+
cb = opts.cb || cb;
|
|
12
|
+
var pre = typeof cb == "function" ? cb : cb.pre || function() {
|
|
13
|
+
};
|
|
14
|
+
var post = cb.post || function() {
|
|
15
|
+
};
|
|
16
|
+
_traverse(opts, pre, post, schema, "", schema);
|
|
17
|
+
};
|
|
18
|
+
traverse.keywords = {
|
|
19
|
+
additionalItems: true,
|
|
20
|
+
items: true,
|
|
21
|
+
contains: true,
|
|
22
|
+
additionalProperties: true,
|
|
23
|
+
propertyNames: true,
|
|
24
|
+
not: true,
|
|
25
|
+
if: true,
|
|
26
|
+
then: true,
|
|
27
|
+
else: true
|
|
28
|
+
};
|
|
29
|
+
traverse.arrayKeywords = {
|
|
30
|
+
items: true,
|
|
31
|
+
allOf: true,
|
|
32
|
+
anyOf: true,
|
|
33
|
+
oneOf: true
|
|
34
|
+
};
|
|
35
|
+
traverse.propsKeywords = {
|
|
36
|
+
$defs: true,
|
|
37
|
+
definitions: true,
|
|
38
|
+
properties: true,
|
|
39
|
+
patternProperties: true,
|
|
40
|
+
dependencies: true
|
|
41
|
+
};
|
|
42
|
+
traverse.skipKeywords = {
|
|
43
|
+
default: true,
|
|
44
|
+
enum: true,
|
|
45
|
+
const: true,
|
|
46
|
+
required: true,
|
|
47
|
+
maximum: true,
|
|
48
|
+
minimum: true,
|
|
49
|
+
exclusiveMaximum: true,
|
|
50
|
+
exclusiveMinimum: true,
|
|
51
|
+
multipleOf: true,
|
|
52
|
+
maxLength: true,
|
|
53
|
+
minLength: true,
|
|
54
|
+
pattern: true,
|
|
55
|
+
format: true,
|
|
56
|
+
maxItems: true,
|
|
57
|
+
minItems: true,
|
|
58
|
+
uniqueItems: true,
|
|
59
|
+
maxProperties: true,
|
|
60
|
+
minProperties: true
|
|
61
|
+
};
|
|
62
|
+
function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
63
|
+
if (schema && typeof schema == "object" && !Array.isArray(schema)) {
|
|
64
|
+
pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
65
|
+
for (var key in schema) {
|
|
66
|
+
var sch = schema[key];
|
|
67
|
+
if (Array.isArray(sch)) {
|
|
68
|
+
if (key in traverse.arrayKeywords) {
|
|
69
|
+
for (var i = 0; i < sch.length; i++)
|
|
70
|
+
_traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i);
|
|
71
|
+
}
|
|
72
|
+
} else if (key in traverse.propsKeywords) {
|
|
73
|
+
if (sch && typeof sch == "object") {
|
|
74
|
+
for (var prop in sch)
|
|
75
|
+
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
|
|
76
|
+
}
|
|
77
|
+
} else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) {
|
|
78
|
+
_traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function escapeJsonPtr(str) {
|
|
85
|
+
return str.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
86
|
+
}
|
|
87
|
+
return jsonSchemaTraverse$1.exports;
|
|
88
|
+
}
|
|
1
89
|
var jsonSchemaTraverse = { exports: {} };
|
|
2
90
|
var hasRequiredJsonSchemaTraverse;
|
|
3
91
|
function requireJsonSchemaTraverse() {
|
|
@@ -87,5 +175,6 @@ function requireJsonSchemaTraverse() {
|
|
|
87
175
|
return jsonSchemaTraverse.exports;
|
|
88
176
|
}
|
|
89
177
|
export {
|
|
90
|
-
requireJsonSchemaTraverse as
|
|
178
|
+
requireJsonSchemaTraverse as a,
|
|
179
|
+
requireJsonSchemaTraverse$1 as r
|
|
91
180
|
};
|
|
@@ -195,7 +195,7 @@ var hasRequiredUtils;
|
|
|
195
195
|
function requireUtils() {
|
|
196
196
|
if (hasRequiredUtils) return utils;
|
|
197
197
|
hasRequiredUtils = 1;
|
|
198
|
-
(function(exports) {
|
|
198
|
+
(function(exports$1) {
|
|
199
199
|
var support2 = requireSupport();
|
|
200
200
|
var base642 = requireBase64();
|
|
201
201
|
var nodejsUtils2 = requireNodejsUtils();
|
|
@@ -210,8 +210,8 @@ function requireUtils() {
|
|
|
210
210
|
}
|
|
211
211
|
return stringToArrayLike(str, result);
|
|
212
212
|
}
|
|
213
|
-
exports.newBlob = function(part, type) {
|
|
214
|
-
exports.checkSupport("blob");
|
|
213
|
+
exports$1.newBlob = function(part, type) {
|
|
214
|
+
exports$1.checkSupport("blob");
|
|
215
215
|
try {
|
|
216
216
|
return new Blob([part], {
|
|
217
217
|
type
|
|
@@ -299,7 +299,7 @@ function requireUtils() {
|
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
301
|
function arrayLikeToString(array) {
|
|
302
|
-
var chunk = 65536, type = exports.getTypeOf(array), canUseApply = true;
|
|
302
|
+
var chunk = 65536, type = exports$1.getTypeOf(array), canUseApply = true;
|
|
303
303
|
if (type === "uint8array") {
|
|
304
304
|
canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array;
|
|
305
305
|
} else if (type === "nodebuffer") {
|
|
@@ -316,7 +316,7 @@ function requireUtils() {
|
|
|
316
316
|
}
|
|
317
317
|
return arrayToStringHelper.stringifyByChar(array);
|
|
318
318
|
}
|
|
319
|
-
exports.applyFromCharCode = arrayLikeToString;
|
|
319
|
+
exports$1.applyFromCharCode = arrayLikeToString;
|
|
320
320
|
function arrayLikeToArrayLike(arrayFrom, arrayTo) {
|
|
321
321
|
for (var i = 0; i < arrayFrom.length; i++) {
|
|
322
322
|
arrayTo[i] = arrayFrom[i];
|
|
@@ -393,19 +393,19 @@ function requireUtils() {
|
|
|
393
393
|
},
|
|
394
394
|
"nodebuffer": identity
|
|
395
395
|
};
|
|
396
|
-
exports.transformTo = function(outputType, input) {
|
|
396
|
+
exports$1.transformTo = function(outputType, input) {
|
|
397
397
|
if (!input) {
|
|
398
398
|
input = "";
|
|
399
399
|
}
|
|
400
400
|
if (!outputType) {
|
|
401
401
|
return input;
|
|
402
402
|
}
|
|
403
|
-
exports.checkSupport(outputType);
|
|
404
|
-
var inputType = exports.getTypeOf(input);
|
|
403
|
+
exports$1.checkSupport(outputType);
|
|
404
|
+
var inputType = exports$1.getTypeOf(input);
|
|
405
405
|
var result = transform[inputType][outputType](input);
|
|
406
406
|
return result;
|
|
407
407
|
};
|
|
408
|
-
exports.resolve = function(path) {
|
|
408
|
+
exports$1.resolve = function(path) {
|
|
409
409
|
var parts = path.split("/");
|
|
410
410
|
var result = [];
|
|
411
411
|
for (var index = 0; index < parts.length; index++) {
|
|
@@ -420,7 +420,7 @@ function requireUtils() {
|
|
|
420
420
|
}
|
|
421
421
|
return result.join("/");
|
|
422
422
|
};
|
|
423
|
-
exports.getTypeOf = function(input) {
|
|
423
|
+
exports$1.getTypeOf = function(input) {
|
|
424
424
|
if (typeof input === "string") {
|
|
425
425
|
return "string";
|
|
426
426
|
}
|
|
@@ -437,15 +437,15 @@ function requireUtils() {
|
|
|
437
437
|
return "arraybuffer";
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
exports.checkSupport = function(type) {
|
|
440
|
+
exports$1.checkSupport = function(type) {
|
|
441
441
|
var supported = support2[type.toLowerCase()];
|
|
442
442
|
if (!supported) {
|
|
443
443
|
throw new Error(type + " is not supported by this platform");
|
|
444
444
|
}
|
|
445
445
|
};
|
|
446
|
-
exports.MAX_VALUE_16BITS = 65535;
|
|
447
|
-
exports.MAX_VALUE_32BITS = -1;
|
|
448
|
-
exports.pretty = function(str) {
|
|
446
|
+
exports$1.MAX_VALUE_16BITS = 65535;
|
|
447
|
+
exports$1.MAX_VALUE_32BITS = -1;
|
|
448
|
+
exports$1.pretty = function(str) {
|
|
449
449
|
var res = "", code, i;
|
|
450
450
|
for (i = 0; i < (str || "").length; i++) {
|
|
451
451
|
code = str.charCodeAt(i);
|
|
@@ -453,18 +453,18 @@ function requireUtils() {
|
|
|
453
453
|
}
|
|
454
454
|
return res;
|
|
455
455
|
};
|
|
456
|
-
exports.delay = function(callback, args, self2) {
|
|
456
|
+
exports$1.delay = function(callback, args, self2) {
|
|
457
457
|
setImmediate(function() {
|
|
458
458
|
callback.apply(self2 || null, args || []);
|
|
459
459
|
});
|
|
460
460
|
};
|
|
461
|
-
exports.inherits = function(ctor, superCtor) {
|
|
461
|
+
exports$1.inherits = function(ctor, superCtor) {
|
|
462
462
|
var Obj = function() {
|
|
463
463
|
};
|
|
464
464
|
Obj.prototype = superCtor.prototype;
|
|
465
465
|
ctor.prototype = new Obj();
|
|
466
466
|
};
|
|
467
|
-
exports.extend = function() {
|
|
467
|
+
exports$1.extend = function() {
|
|
468
468
|
var result = {}, i, attr;
|
|
469
469
|
for (i = 0; i < arguments.length; i++) {
|
|
470
470
|
for (attr in arguments[i]) {
|
|
@@ -475,7 +475,7 @@ function requireUtils() {
|
|
|
475
475
|
}
|
|
476
476
|
return result;
|
|
477
477
|
};
|
|
478
|
-
exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {
|
|
478
|
+
exports$1.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) {
|
|
479
479
|
var promise = external2.Promise.resolve(inputData).then(function(data) {
|
|
480
480
|
var isBlob = support2.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1);
|
|
481
481
|
if (isBlob && typeof FileReader !== "undefined") {
|
|
@@ -494,14 +494,14 @@ function requireUtils() {
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
return promise.then(function(data) {
|
|
497
|
-
var dataType = exports.getTypeOf(data);
|
|
497
|
+
var dataType = exports$1.getTypeOf(data);
|
|
498
498
|
if (!dataType) {
|
|
499
499
|
return external2.Promise.reject(
|
|
500
500
|
new Error("Can't read the data of '" + name + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
503
|
if (dataType === "arraybuffer") {
|
|
504
|
-
data = exports.transformTo("uint8array", data);
|
|
504
|
+
data = exports$1.transformTo("uint8array", data);
|
|
505
505
|
} else if (dataType === "string") {
|
|
506
506
|
if (isBase64) {
|
|
507
507
|
data = base642.decode(data);
|
|
@@ -748,7 +748,7 @@ var hasRequiredUtf8;
|
|
|
748
748
|
function requireUtf8() {
|
|
749
749
|
if (hasRequiredUtf8) return utf8;
|
|
750
750
|
hasRequiredUtf8 = 1;
|
|
751
|
-
(function(exports) {
|
|
751
|
+
(function(exports$1) {
|
|
752
752
|
var utils2 = requireUtils();
|
|
753
753
|
var support2 = requireSupport();
|
|
754
754
|
var nodejsUtils2 = requireNodejsUtils();
|
|
@@ -863,13 +863,13 @@ function requireUtf8() {
|
|
|
863
863
|
}
|
|
864
864
|
return utils2.applyFromCharCode(utf16buf);
|
|
865
865
|
};
|
|
866
|
-
exports.utf8encode = function utf8encode(str) {
|
|
866
|
+
exports$1.utf8encode = function utf8encode(str) {
|
|
867
867
|
if (support2.nodebuffer) {
|
|
868
868
|
return nodejsUtils2.newBufferFrom(str, "utf-8");
|
|
869
869
|
}
|
|
870
870
|
return string2buf(str);
|
|
871
871
|
};
|
|
872
|
-
exports.utf8decode = function utf8decode(buf) {
|
|
872
|
+
exports$1.utf8decode = function utf8decode(buf) {
|
|
873
873
|
if (support2.nodebuffer) {
|
|
874
874
|
return utils2.transformTo("nodebuffer", buf).toString("utf-8");
|
|
875
875
|
}
|
|
@@ -906,31 +906,31 @@ function requireUtf8() {
|
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
908
|
this.push({
|
|
909
|
-
data: exports.utf8decode(usableData),
|
|
909
|
+
data: exports$1.utf8decode(usableData),
|
|
910
910
|
meta: chunk.meta
|
|
911
911
|
});
|
|
912
912
|
};
|
|
913
913
|
Utf8DecodeWorker.prototype.flush = function() {
|
|
914
914
|
if (this.leftOver && this.leftOver.length) {
|
|
915
915
|
this.push({
|
|
916
|
-
data: exports.utf8decode(this.leftOver),
|
|
916
|
+
data: exports$1.utf8decode(this.leftOver),
|
|
917
917
|
meta: {}
|
|
918
918
|
});
|
|
919
919
|
this.leftOver = null;
|
|
920
920
|
}
|
|
921
921
|
};
|
|
922
|
-
exports.Utf8DecodeWorker = Utf8DecodeWorker;
|
|
922
|
+
exports$1.Utf8DecodeWorker = Utf8DecodeWorker;
|
|
923
923
|
function Utf8EncodeWorker() {
|
|
924
924
|
GenericWorker.call(this, "utf-8 encode");
|
|
925
925
|
}
|
|
926
926
|
utils2.inherits(Utf8EncodeWorker, GenericWorker);
|
|
927
927
|
Utf8EncodeWorker.prototype.processChunk = function(chunk) {
|
|
928
928
|
this.push({
|
|
929
|
-
data: exports.utf8encode(chunk.data),
|
|
929
|
+
data: exports$1.utf8encode(chunk.data),
|
|
930
930
|
meta: chunk.meta
|
|
931
931
|
});
|
|
932
932
|
};
|
|
933
|
-
exports.Utf8EncodeWorker = Utf8EncodeWorker;
|
|
933
|
+
exports$1.Utf8EncodeWorker = Utf8EncodeWorker;
|
|
934
934
|
})(utf8);
|
|
935
935
|
return utf8;
|
|
936
936
|
}
|