@plume-canvas/plugin-agent 0.1.9 → 0.1.11
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/dist/plugin-agent.js +18 -18
- package/dist/plugin-agent.js.map +1 -1
- package/dist/server.js +868 -824
- package/package.json +4 -9
package/dist/server.js
CHANGED
|
@@ -2868,17 +2868,17 @@ var require_visit = __commonJS({
|
|
|
2868
2868
|
visit.BREAK = BREAK;
|
|
2869
2869
|
visit.SKIP = SKIP;
|
|
2870
2870
|
visit.REMOVE = REMOVE;
|
|
2871
|
-
function visit_(key, node2, visitor,
|
|
2872
|
-
const ctrl = callVisitor(key, node2, visitor,
|
|
2871
|
+
function visit_(key, node2, visitor, path37) {
|
|
2872
|
+
const ctrl = callVisitor(key, node2, visitor, path37);
|
|
2873
2873
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
2874
|
-
replaceNode(key,
|
|
2875
|
-
return visit_(key, ctrl, visitor,
|
|
2874
|
+
replaceNode(key, path37, ctrl);
|
|
2875
|
+
return visit_(key, ctrl, visitor, path37);
|
|
2876
2876
|
}
|
|
2877
2877
|
if (typeof ctrl !== "symbol") {
|
|
2878
2878
|
if (identity.isCollection(node2)) {
|
|
2879
|
-
|
|
2879
|
+
path37 = Object.freeze(path37.concat(node2));
|
|
2880
2880
|
for (let i7 = 0; i7 < node2.items.length; ++i7) {
|
|
2881
|
-
const ci = visit_(i7, node2.items[i7], visitor,
|
|
2881
|
+
const ci = visit_(i7, node2.items[i7], visitor, path37);
|
|
2882
2882
|
if (typeof ci === "number")
|
|
2883
2883
|
i7 = ci - 1;
|
|
2884
2884
|
else if (ci === BREAK)
|
|
@@ -2889,13 +2889,13 @@ var require_visit = __commonJS({
|
|
|
2889
2889
|
}
|
|
2890
2890
|
}
|
|
2891
2891
|
} else if (identity.isPair(node2)) {
|
|
2892
|
-
|
|
2893
|
-
const ck = visit_("key", node2.key, visitor,
|
|
2892
|
+
path37 = Object.freeze(path37.concat(node2));
|
|
2893
|
+
const ck = visit_("key", node2.key, visitor, path37);
|
|
2894
2894
|
if (ck === BREAK)
|
|
2895
2895
|
return BREAK;
|
|
2896
2896
|
else if (ck === REMOVE)
|
|
2897
2897
|
node2.key = null;
|
|
2898
|
-
const cv = visit_("value", node2.value, visitor,
|
|
2898
|
+
const cv = visit_("value", node2.value, visitor, path37);
|
|
2899
2899
|
if (cv === BREAK)
|
|
2900
2900
|
return BREAK;
|
|
2901
2901
|
else if (cv === REMOVE)
|
|
@@ -2916,17 +2916,17 @@ var require_visit = __commonJS({
|
|
|
2916
2916
|
visitAsync.BREAK = BREAK;
|
|
2917
2917
|
visitAsync.SKIP = SKIP;
|
|
2918
2918
|
visitAsync.REMOVE = REMOVE;
|
|
2919
|
-
async function visitAsync_(key, node2, visitor,
|
|
2920
|
-
const ctrl = await callVisitor(key, node2, visitor,
|
|
2919
|
+
async function visitAsync_(key, node2, visitor, path37) {
|
|
2920
|
+
const ctrl = await callVisitor(key, node2, visitor, path37);
|
|
2921
2921
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
2922
|
-
replaceNode(key,
|
|
2923
|
-
return visitAsync_(key, ctrl, visitor,
|
|
2922
|
+
replaceNode(key, path37, ctrl);
|
|
2923
|
+
return visitAsync_(key, ctrl, visitor, path37);
|
|
2924
2924
|
}
|
|
2925
2925
|
if (typeof ctrl !== "symbol") {
|
|
2926
2926
|
if (identity.isCollection(node2)) {
|
|
2927
|
-
|
|
2927
|
+
path37 = Object.freeze(path37.concat(node2));
|
|
2928
2928
|
for (let i7 = 0; i7 < node2.items.length; ++i7) {
|
|
2929
|
-
const ci = await visitAsync_(i7, node2.items[i7], visitor,
|
|
2929
|
+
const ci = await visitAsync_(i7, node2.items[i7], visitor, path37);
|
|
2930
2930
|
if (typeof ci === "number")
|
|
2931
2931
|
i7 = ci - 1;
|
|
2932
2932
|
else if (ci === BREAK)
|
|
@@ -2937,13 +2937,13 @@ var require_visit = __commonJS({
|
|
|
2937
2937
|
}
|
|
2938
2938
|
}
|
|
2939
2939
|
} else if (identity.isPair(node2)) {
|
|
2940
|
-
|
|
2941
|
-
const ck = await visitAsync_("key", node2.key, visitor,
|
|
2940
|
+
path37 = Object.freeze(path37.concat(node2));
|
|
2941
|
+
const ck = await visitAsync_("key", node2.key, visitor, path37);
|
|
2942
2942
|
if (ck === BREAK)
|
|
2943
2943
|
return BREAK;
|
|
2944
2944
|
else if (ck === REMOVE)
|
|
2945
2945
|
node2.key = null;
|
|
2946
|
-
const cv = await visitAsync_("value", node2.value, visitor,
|
|
2946
|
+
const cv = await visitAsync_("value", node2.value, visitor, path37);
|
|
2947
2947
|
if (cv === BREAK)
|
|
2948
2948
|
return BREAK;
|
|
2949
2949
|
else if (cv === REMOVE)
|
|
@@ -2970,23 +2970,23 @@ var require_visit = __commonJS({
|
|
|
2970
2970
|
}
|
|
2971
2971
|
return visitor;
|
|
2972
2972
|
}
|
|
2973
|
-
function callVisitor(key, node2, visitor,
|
|
2973
|
+
function callVisitor(key, node2, visitor, path37) {
|
|
2974
2974
|
if (typeof visitor === "function")
|
|
2975
|
-
return visitor(key, node2,
|
|
2975
|
+
return visitor(key, node2, path37);
|
|
2976
2976
|
if (identity.isMap(node2))
|
|
2977
|
-
return visitor.Map?.(key, node2,
|
|
2977
|
+
return visitor.Map?.(key, node2, path37);
|
|
2978
2978
|
if (identity.isSeq(node2))
|
|
2979
|
-
return visitor.Seq?.(key, node2,
|
|
2979
|
+
return visitor.Seq?.(key, node2, path37);
|
|
2980
2980
|
if (identity.isPair(node2))
|
|
2981
|
-
return visitor.Pair?.(key, node2,
|
|
2981
|
+
return visitor.Pair?.(key, node2, path37);
|
|
2982
2982
|
if (identity.isScalar(node2))
|
|
2983
|
-
return visitor.Scalar?.(key, node2,
|
|
2983
|
+
return visitor.Scalar?.(key, node2, path37);
|
|
2984
2984
|
if (identity.isAlias(node2))
|
|
2985
|
-
return visitor.Alias?.(key, node2,
|
|
2985
|
+
return visitor.Alias?.(key, node2, path37);
|
|
2986
2986
|
return void 0;
|
|
2987
2987
|
}
|
|
2988
|
-
function replaceNode(key,
|
|
2989
|
-
const parent =
|
|
2988
|
+
function replaceNode(key, path37, node2) {
|
|
2989
|
+
const parent = path37[path37.length - 1];
|
|
2990
2990
|
if (identity.isCollection(parent)) {
|
|
2991
2991
|
parent.items[key] = node2;
|
|
2992
2992
|
} else if (identity.isPair(parent)) {
|
|
@@ -3598,10 +3598,10 @@ var require_Collection = __commonJS({
|
|
|
3598
3598
|
var createNode = require_createNode();
|
|
3599
3599
|
var identity = require_identity();
|
|
3600
3600
|
var Node3 = require_Node();
|
|
3601
|
-
function collectionFromPath(schema,
|
|
3601
|
+
function collectionFromPath(schema, path37, value) {
|
|
3602
3602
|
let v = value;
|
|
3603
|
-
for (let i7 =
|
|
3604
|
-
const k6 =
|
|
3603
|
+
for (let i7 = path37.length - 1; i7 >= 0; --i7) {
|
|
3604
|
+
const k6 = path37[i7];
|
|
3605
3605
|
if (typeof k6 === "number" && Number.isInteger(k6) && k6 >= 0) {
|
|
3606
3606
|
const a6 = [];
|
|
3607
3607
|
a6[k6] = v;
|
|
@@ -3620,7 +3620,7 @@ var require_Collection = __commonJS({
|
|
|
3620
3620
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
3621
3621
|
});
|
|
3622
3622
|
}
|
|
3623
|
-
var isEmptyPath = (
|
|
3623
|
+
var isEmptyPath = (path37) => path37 == null || typeof path37 === "object" && !!path37[Symbol.iterator]().next().done;
|
|
3624
3624
|
var Collection = class extends Node3.NodeBase {
|
|
3625
3625
|
constructor(type, schema) {
|
|
3626
3626
|
super(type);
|
|
@@ -3650,11 +3650,11 @@ var require_Collection = __commonJS({
|
|
|
3650
3650
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
3651
3651
|
* that already exists in the map.
|
|
3652
3652
|
*/
|
|
3653
|
-
addIn(
|
|
3654
|
-
if (isEmptyPath(
|
|
3653
|
+
addIn(path37, value) {
|
|
3654
|
+
if (isEmptyPath(path37))
|
|
3655
3655
|
this.add(value);
|
|
3656
3656
|
else {
|
|
3657
|
-
const [key, ...rest] =
|
|
3657
|
+
const [key, ...rest] = path37;
|
|
3658
3658
|
const node2 = this.get(key, true);
|
|
3659
3659
|
if (identity.isCollection(node2))
|
|
3660
3660
|
node2.addIn(rest, value);
|
|
@@ -3668,8 +3668,8 @@ var require_Collection = __commonJS({
|
|
|
3668
3668
|
* Removes a value from the collection.
|
|
3669
3669
|
* @returns `true` if the item was found and removed.
|
|
3670
3670
|
*/
|
|
3671
|
-
deleteIn(
|
|
3672
|
-
const [key, ...rest] =
|
|
3671
|
+
deleteIn(path37) {
|
|
3672
|
+
const [key, ...rest] = path37;
|
|
3673
3673
|
if (rest.length === 0)
|
|
3674
3674
|
return this.delete(key);
|
|
3675
3675
|
const node2 = this.get(key, true);
|
|
@@ -3683,8 +3683,8 @@ var require_Collection = __commonJS({
|
|
|
3683
3683
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3684
3684
|
* `true` (collections are always returned intact).
|
|
3685
3685
|
*/
|
|
3686
|
-
getIn(
|
|
3687
|
-
const [key, ...rest] =
|
|
3686
|
+
getIn(path37, keepScalar) {
|
|
3687
|
+
const [key, ...rest] = path37;
|
|
3688
3688
|
const node2 = this.get(key, true);
|
|
3689
3689
|
if (rest.length === 0)
|
|
3690
3690
|
return !keepScalar && identity.isScalar(node2) ? node2.value : node2;
|
|
@@ -3702,8 +3702,8 @@ var require_Collection = __commonJS({
|
|
|
3702
3702
|
/**
|
|
3703
3703
|
* Checks if the collection includes a value with the key `key`.
|
|
3704
3704
|
*/
|
|
3705
|
-
hasIn(
|
|
3706
|
-
const [key, ...rest] =
|
|
3705
|
+
hasIn(path37) {
|
|
3706
|
+
const [key, ...rest] = path37;
|
|
3707
3707
|
if (rest.length === 0)
|
|
3708
3708
|
return this.has(key);
|
|
3709
3709
|
const node2 = this.get(key, true);
|
|
@@ -3713,8 +3713,8 @@ var require_Collection = __commonJS({
|
|
|
3713
3713
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
3714
3714
|
* boolean to add/remove the item from the set.
|
|
3715
3715
|
*/
|
|
3716
|
-
setIn(
|
|
3717
|
-
const [key, ...rest] =
|
|
3716
|
+
setIn(path37, value) {
|
|
3717
|
+
const [key, ...rest] = path37;
|
|
3718
3718
|
if (rest.length === 0) {
|
|
3719
3719
|
this.set(key, value);
|
|
3720
3720
|
} else {
|
|
@@ -6229,9 +6229,9 @@ var require_Document = __commonJS({
|
|
|
6229
6229
|
this.contents.add(value);
|
|
6230
6230
|
}
|
|
6231
6231
|
/** Adds a value to the document. */
|
|
6232
|
-
addIn(
|
|
6232
|
+
addIn(path37, value) {
|
|
6233
6233
|
if (assertCollection(this.contents))
|
|
6234
|
-
this.contents.addIn(
|
|
6234
|
+
this.contents.addIn(path37, value);
|
|
6235
6235
|
}
|
|
6236
6236
|
/**
|
|
6237
6237
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -6306,14 +6306,14 @@ var require_Document = __commonJS({
|
|
|
6306
6306
|
* Removes a value from the document.
|
|
6307
6307
|
* @returns `true` if the item was found and removed.
|
|
6308
6308
|
*/
|
|
6309
|
-
deleteIn(
|
|
6310
|
-
if (Collection.isEmptyPath(
|
|
6309
|
+
deleteIn(path37) {
|
|
6310
|
+
if (Collection.isEmptyPath(path37)) {
|
|
6311
6311
|
if (this.contents == null)
|
|
6312
6312
|
return false;
|
|
6313
6313
|
this.contents = null;
|
|
6314
6314
|
return true;
|
|
6315
6315
|
}
|
|
6316
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
6316
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path37) : false;
|
|
6317
6317
|
}
|
|
6318
6318
|
/**
|
|
6319
6319
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -6328,10 +6328,10 @@ var require_Document = __commonJS({
|
|
|
6328
6328
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
6329
6329
|
* `true` (collections are always returned intact).
|
|
6330
6330
|
*/
|
|
6331
|
-
getIn(
|
|
6332
|
-
if (Collection.isEmptyPath(
|
|
6331
|
+
getIn(path37, keepScalar) {
|
|
6332
|
+
if (Collection.isEmptyPath(path37))
|
|
6333
6333
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
6334
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
6334
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path37, keepScalar) : void 0;
|
|
6335
6335
|
}
|
|
6336
6336
|
/**
|
|
6337
6337
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -6342,10 +6342,10 @@ var require_Document = __commonJS({
|
|
|
6342
6342
|
/**
|
|
6343
6343
|
* Checks if the document includes a value at `path`.
|
|
6344
6344
|
*/
|
|
6345
|
-
hasIn(
|
|
6346
|
-
if (Collection.isEmptyPath(
|
|
6345
|
+
hasIn(path37) {
|
|
6346
|
+
if (Collection.isEmptyPath(path37))
|
|
6347
6347
|
return this.contents !== void 0;
|
|
6348
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
6348
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path37) : false;
|
|
6349
6349
|
}
|
|
6350
6350
|
/**
|
|
6351
6351
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -6362,13 +6362,13 @@ var require_Document = __commonJS({
|
|
|
6362
6362
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
6363
6363
|
* boolean to add/remove the item from the set.
|
|
6364
6364
|
*/
|
|
6365
|
-
setIn(
|
|
6366
|
-
if (Collection.isEmptyPath(
|
|
6365
|
+
setIn(path37, value) {
|
|
6366
|
+
if (Collection.isEmptyPath(path37)) {
|
|
6367
6367
|
this.contents = value;
|
|
6368
6368
|
} else if (this.contents == null) {
|
|
6369
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
6369
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path37), value);
|
|
6370
6370
|
} else if (assertCollection(this.contents)) {
|
|
6371
|
-
this.contents.setIn(
|
|
6371
|
+
this.contents.setIn(path37, value);
|
|
6372
6372
|
}
|
|
6373
6373
|
}
|
|
6374
6374
|
/**
|
|
@@ -8329,9 +8329,9 @@ var require_cst_visit = __commonJS({
|
|
|
8329
8329
|
visit.BREAK = BREAK;
|
|
8330
8330
|
visit.SKIP = SKIP;
|
|
8331
8331
|
visit.REMOVE = REMOVE;
|
|
8332
|
-
visit.itemAtPath = (cst,
|
|
8332
|
+
visit.itemAtPath = (cst, path37) => {
|
|
8333
8333
|
let item = cst;
|
|
8334
|
-
for (const [field, index] of
|
|
8334
|
+
for (const [field, index] of path37) {
|
|
8335
8335
|
const tok = item?.[field];
|
|
8336
8336
|
if (tok && "items" in tok) {
|
|
8337
8337
|
item = tok.items[index];
|
|
@@ -8340,23 +8340,23 @@ var require_cst_visit = __commonJS({
|
|
|
8340
8340
|
}
|
|
8341
8341
|
return item;
|
|
8342
8342
|
};
|
|
8343
|
-
visit.parentCollection = (cst,
|
|
8344
|
-
const parent = visit.itemAtPath(cst,
|
|
8345
|
-
const field =
|
|
8343
|
+
visit.parentCollection = (cst, path37) => {
|
|
8344
|
+
const parent = visit.itemAtPath(cst, path37.slice(0, -1));
|
|
8345
|
+
const field = path37[path37.length - 1][0];
|
|
8346
8346
|
const coll = parent?.[field];
|
|
8347
8347
|
if (coll && "items" in coll)
|
|
8348
8348
|
return coll;
|
|
8349
8349
|
throw new Error("Parent collection not found");
|
|
8350
8350
|
};
|
|
8351
|
-
function _visit(
|
|
8352
|
-
let ctrl = visitor(item,
|
|
8351
|
+
function _visit(path37, item, visitor) {
|
|
8352
|
+
let ctrl = visitor(item, path37);
|
|
8353
8353
|
if (typeof ctrl === "symbol")
|
|
8354
8354
|
return ctrl;
|
|
8355
8355
|
for (const field of ["key", "value"]) {
|
|
8356
8356
|
const token = item[field];
|
|
8357
8357
|
if (token && "items" in token) {
|
|
8358
8358
|
for (let i7 = 0; i7 < token.items.length; ++i7) {
|
|
8359
|
-
const ci = _visit(Object.freeze(
|
|
8359
|
+
const ci = _visit(Object.freeze(path37.concat([[field, i7]])), token.items[i7], visitor);
|
|
8360
8360
|
if (typeof ci === "number")
|
|
8361
8361
|
i7 = ci - 1;
|
|
8362
8362
|
else if (ci === BREAK)
|
|
@@ -8367,10 +8367,10 @@ var require_cst_visit = __commonJS({
|
|
|
8367
8367
|
}
|
|
8368
8368
|
}
|
|
8369
8369
|
if (typeof ctrl === "function" && field === "key")
|
|
8370
|
-
ctrl = ctrl(item,
|
|
8370
|
+
ctrl = ctrl(item, path37);
|
|
8371
8371
|
}
|
|
8372
8372
|
}
|
|
8373
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
8373
|
+
return typeof ctrl === "function" ? ctrl(item, path37) : ctrl;
|
|
8374
8374
|
}
|
|
8375
8375
|
exports.visit = visit;
|
|
8376
8376
|
}
|
|
@@ -9672,14 +9672,14 @@ var require_parser = __commonJS({
|
|
|
9672
9672
|
case "scalar":
|
|
9673
9673
|
case "single-quoted-scalar":
|
|
9674
9674
|
case "double-quoted-scalar": {
|
|
9675
|
-
const
|
|
9675
|
+
const fs20 = this.flowScalar(this.type);
|
|
9676
9676
|
if (atNextItem || it.value) {
|
|
9677
|
-
map3.items.push({ start, key:
|
|
9677
|
+
map3.items.push({ start, key: fs20, sep: [] });
|
|
9678
9678
|
this.onKeyLine = true;
|
|
9679
9679
|
} else if (it.sep) {
|
|
9680
|
-
this.stack.push(
|
|
9680
|
+
this.stack.push(fs20);
|
|
9681
9681
|
} else {
|
|
9682
|
-
Object.assign(it, { key:
|
|
9682
|
+
Object.assign(it, { key: fs20, sep: [] });
|
|
9683
9683
|
this.onKeyLine = true;
|
|
9684
9684
|
}
|
|
9685
9685
|
return;
|
|
@@ -9807,13 +9807,13 @@ var require_parser = __commonJS({
|
|
|
9807
9807
|
case "scalar":
|
|
9808
9808
|
case "single-quoted-scalar":
|
|
9809
9809
|
case "double-quoted-scalar": {
|
|
9810
|
-
const
|
|
9810
|
+
const fs20 = this.flowScalar(this.type);
|
|
9811
9811
|
if (!it || it.value)
|
|
9812
|
-
fc.items.push({ start: [], key:
|
|
9812
|
+
fc.items.push({ start: [], key: fs20, sep: [] });
|
|
9813
9813
|
else if (it.sep)
|
|
9814
|
-
this.stack.push(
|
|
9814
|
+
this.stack.push(fs20);
|
|
9815
9815
|
else
|
|
9816
|
-
Object.assign(it, { key:
|
|
9816
|
+
Object.assign(it, { key: fs20, sep: [] });
|
|
9817
9817
|
return;
|
|
9818
9818
|
}
|
|
9819
9819
|
case "flow-map-end":
|
|
@@ -12601,8 +12601,8 @@ var require_node = __commonJS({
|
|
|
12601
12601
|
}
|
|
12602
12602
|
break;
|
|
12603
12603
|
case "FILE":
|
|
12604
|
-
var
|
|
12605
|
-
stream3 = new
|
|
12604
|
+
var fs20 = __require("fs");
|
|
12605
|
+
stream3 = new fs20.SyncWriteStream(fd2, { autoClose: false });
|
|
12606
12606
|
stream3._type = "fs";
|
|
12607
12607
|
break;
|
|
12608
12608
|
case "PIPE":
|
|
@@ -25389,11 +25389,11 @@ var require_mime_types = __commonJS({
|
|
|
25389
25389
|
}
|
|
25390
25390
|
return exts[0];
|
|
25391
25391
|
}
|
|
25392
|
-
function lookup(
|
|
25393
|
-
if (!
|
|
25392
|
+
function lookup(path37) {
|
|
25393
|
+
if (!path37 || typeof path37 !== "string") {
|
|
25394
25394
|
return false;
|
|
25395
25395
|
}
|
|
25396
|
-
var extension2 = extname("x." +
|
|
25396
|
+
var extension2 = extname("x." + path37).toLowerCase().substr(1);
|
|
25397
25397
|
if (!extension2) {
|
|
25398
25398
|
return false;
|
|
25399
25399
|
}
|
|
@@ -29006,7 +29006,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
29006
29006
|
"../../../node_modules/.pnpm/path-to-regexp@0.1.13/node_modules/path-to-regexp/index.js"(exports, module) {
|
|
29007
29007
|
module.exports = pathToRegexp;
|
|
29008
29008
|
var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g;
|
|
29009
|
-
function pathToRegexp(
|
|
29009
|
+
function pathToRegexp(path37, keys, options) {
|
|
29010
29010
|
options = options || {};
|
|
29011
29011
|
keys = keys || [];
|
|
29012
29012
|
var strict = options.strict;
|
|
@@ -29020,8 +29020,8 @@ var require_path_to_regexp = __commonJS({
|
|
|
29020
29020
|
var pos2 = 0;
|
|
29021
29021
|
var backtrack = "";
|
|
29022
29022
|
var m5;
|
|
29023
|
-
if (
|
|
29024
|
-
while (m5 = MATCHING_GROUP_REGEXP.exec(
|
|
29023
|
+
if (path37 instanceof RegExp) {
|
|
29024
|
+
while (m5 = MATCHING_GROUP_REGEXP.exec(path37.source)) {
|
|
29025
29025
|
if (m5[0][0] === "\\") continue;
|
|
29026
29026
|
keys.push({
|
|
29027
29027
|
name: m5[1] || name2++,
|
|
@@ -29029,18 +29029,18 @@ var require_path_to_regexp = __commonJS({
|
|
|
29029
29029
|
offset: m5.index
|
|
29030
29030
|
});
|
|
29031
29031
|
}
|
|
29032
|
-
return
|
|
29032
|
+
return path37;
|
|
29033
29033
|
}
|
|
29034
|
-
if (Array.isArray(
|
|
29035
|
-
|
|
29034
|
+
if (Array.isArray(path37)) {
|
|
29035
|
+
path37 = path37.map(function(value) {
|
|
29036
29036
|
return pathToRegexp(value, keys, options).source;
|
|
29037
29037
|
});
|
|
29038
|
-
return new RegExp(
|
|
29038
|
+
return new RegExp(path37.join("|"), flags);
|
|
29039
29039
|
}
|
|
29040
|
-
if (typeof
|
|
29040
|
+
if (typeof path37 !== "string") {
|
|
29041
29041
|
throw new TypeError("path must be a string, array of strings, or regular expression");
|
|
29042
29042
|
}
|
|
29043
|
-
|
|
29043
|
+
path37 = path37.replace(
|
|
29044
29044
|
/\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g,
|
|
29045
29045
|
function(match2, slash2, format2, key, capture, star, optional2, offset) {
|
|
29046
29046
|
if (match2[0] === "\\") {
|
|
@@ -29057,7 +29057,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
29057
29057
|
if (slash2 || format2) {
|
|
29058
29058
|
backtrack = "";
|
|
29059
29059
|
} else {
|
|
29060
|
-
backtrack +=
|
|
29060
|
+
backtrack += path37.slice(pos2, offset);
|
|
29061
29061
|
}
|
|
29062
29062
|
pos2 = offset + match2.length;
|
|
29063
29063
|
if (match2 === "*") {
|
|
@@ -29087,7 +29087,7 @@ var require_path_to_regexp = __commonJS({
|
|
|
29087
29087
|
return result;
|
|
29088
29088
|
}
|
|
29089
29089
|
);
|
|
29090
|
-
while (m5 = MATCHING_GROUP_REGEXP.exec(
|
|
29090
|
+
while (m5 = MATCHING_GROUP_REGEXP.exec(path37)) {
|
|
29091
29091
|
if (m5[0][0] === "\\") continue;
|
|
29092
29092
|
if (keysOffset + i7 === keys.length || keys[keysOffset + i7].offset > m5.index) {
|
|
29093
29093
|
keys.splice(keysOffset + i7, 0, {
|
|
@@ -29099,13 +29099,13 @@ var require_path_to_regexp = __commonJS({
|
|
|
29099
29099
|
}
|
|
29100
29100
|
i7++;
|
|
29101
29101
|
}
|
|
29102
|
-
|
|
29102
|
+
path37 += strict ? "" : path37[path37.length - 1] === "/" ? "?" : "/?";
|
|
29103
29103
|
if (end2) {
|
|
29104
|
-
|
|
29105
|
-
} else if (
|
|
29106
|
-
|
|
29104
|
+
path37 += "$";
|
|
29105
|
+
} else if (path37[path37.length - 1] !== "/") {
|
|
29106
|
+
path37 += lookahead ? "(?=/|$)" : "(?:/|$)";
|
|
29107
29107
|
}
|
|
29108
|
-
return new RegExp("^" +
|
|
29108
|
+
return new RegExp("^" + path37, flags);
|
|
29109
29109
|
}
|
|
29110
29110
|
}
|
|
29111
29111
|
});
|
|
@@ -29118,19 +29118,19 @@ var require_layer = __commonJS({
|
|
|
29118
29118
|
var debug = require_src()("express:router:layer");
|
|
29119
29119
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
29120
29120
|
module.exports = Layer;
|
|
29121
|
-
function Layer(
|
|
29121
|
+
function Layer(path37, options, fn) {
|
|
29122
29122
|
if (!(this instanceof Layer)) {
|
|
29123
|
-
return new Layer(
|
|
29123
|
+
return new Layer(path37, options, fn);
|
|
29124
29124
|
}
|
|
29125
|
-
debug("new %o",
|
|
29125
|
+
debug("new %o", path37);
|
|
29126
29126
|
var opts = options || {};
|
|
29127
29127
|
this.handle = fn;
|
|
29128
29128
|
this.name = fn.name || "<anonymous>";
|
|
29129
29129
|
this.params = void 0;
|
|
29130
29130
|
this.path = void 0;
|
|
29131
|
-
this.regexp = pathRegexp(
|
|
29132
|
-
this.regexp.fast_star =
|
|
29133
|
-
this.regexp.fast_slash =
|
|
29131
|
+
this.regexp = pathRegexp(path37, this.keys = [], opts);
|
|
29132
|
+
this.regexp.fast_star = path37 === "*";
|
|
29133
|
+
this.regexp.fast_slash = path37 === "/" && opts.end === false;
|
|
29134
29134
|
}
|
|
29135
29135
|
Layer.prototype.handle_error = function handle_error(error3, req, res, next) {
|
|
29136
29136
|
var fn = this.handle;
|
|
@@ -29154,20 +29154,20 @@ var require_layer = __commonJS({
|
|
|
29154
29154
|
next(err);
|
|
29155
29155
|
}
|
|
29156
29156
|
};
|
|
29157
|
-
Layer.prototype.match = function match2(
|
|
29157
|
+
Layer.prototype.match = function match2(path37) {
|
|
29158
29158
|
var match3;
|
|
29159
|
-
if (
|
|
29159
|
+
if (path37 != null) {
|
|
29160
29160
|
if (this.regexp.fast_slash) {
|
|
29161
29161
|
this.params = {};
|
|
29162
29162
|
this.path = "";
|
|
29163
29163
|
return true;
|
|
29164
29164
|
}
|
|
29165
29165
|
if (this.regexp.fast_star) {
|
|
29166
|
-
this.params = { "0": decode_param(
|
|
29167
|
-
this.path =
|
|
29166
|
+
this.params = { "0": decode_param(path37) };
|
|
29167
|
+
this.path = path37;
|
|
29168
29168
|
return true;
|
|
29169
29169
|
}
|
|
29170
|
-
match3 = this.regexp.exec(
|
|
29170
|
+
match3 = this.regexp.exec(path37);
|
|
29171
29171
|
}
|
|
29172
29172
|
if (!match3) {
|
|
29173
29173
|
this.params = void 0;
|
|
@@ -29260,10 +29260,10 @@ var require_route = __commonJS({
|
|
|
29260
29260
|
var slice = Array.prototype.slice;
|
|
29261
29261
|
var toString = Object.prototype.toString;
|
|
29262
29262
|
module.exports = Route;
|
|
29263
|
-
function Route(
|
|
29264
|
-
this.path =
|
|
29263
|
+
function Route(path37) {
|
|
29264
|
+
this.path = path37;
|
|
29265
29265
|
this.stack = [];
|
|
29266
|
-
debug("new %o",
|
|
29266
|
+
debug("new %o", path37);
|
|
29267
29267
|
this.methods = {};
|
|
29268
29268
|
}
|
|
29269
29269
|
Route.prototype._handles_method = function _handles_method(method) {
|
|
@@ -29475,8 +29475,8 @@ var require_router = __commonJS({
|
|
|
29475
29475
|
if (++sync > 100) {
|
|
29476
29476
|
return setImmediate(next, err);
|
|
29477
29477
|
}
|
|
29478
|
-
var
|
|
29479
|
-
if (
|
|
29478
|
+
var path37 = getPathname(req);
|
|
29479
|
+
if (path37 == null) {
|
|
29480
29480
|
return done(layerError);
|
|
29481
29481
|
}
|
|
29482
29482
|
var layer;
|
|
@@ -29484,7 +29484,7 @@ var require_router = __commonJS({
|
|
|
29484
29484
|
var route;
|
|
29485
29485
|
while (match2 !== true && idx < stack.length) {
|
|
29486
29486
|
layer = stack[idx++];
|
|
29487
|
-
match2 = matchLayer(layer,
|
|
29487
|
+
match2 = matchLayer(layer, path37);
|
|
29488
29488
|
route = layer.route;
|
|
29489
29489
|
if (typeof match2 !== "boolean") {
|
|
29490
29490
|
layerError = layerError || match2;
|
|
@@ -29522,18 +29522,18 @@ var require_router = __commonJS({
|
|
|
29522
29522
|
} else if (route) {
|
|
29523
29523
|
layer.handle_request(req, res, next);
|
|
29524
29524
|
} else {
|
|
29525
|
-
trim_prefix(layer, layerError, layerPath,
|
|
29525
|
+
trim_prefix(layer, layerError, layerPath, path37);
|
|
29526
29526
|
}
|
|
29527
29527
|
sync = 0;
|
|
29528
29528
|
});
|
|
29529
29529
|
}
|
|
29530
|
-
function trim_prefix(layer, layerError, layerPath,
|
|
29530
|
+
function trim_prefix(layer, layerError, layerPath, path37) {
|
|
29531
29531
|
if (layerPath.length !== 0) {
|
|
29532
|
-
if (layerPath !==
|
|
29532
|
+
if (layerPath !== path37.slice(0, layerPath.length)) {
|
|
29533
29533
|
next(layerError);
|
|
29534
29534
|
return;
|
|
29535
29535
|
}
|
|
29536
|
-
var c6 =
|
|
29536
|
+
var c6 = path37[layerPath.length];
|
|
29537
29537
|
if (c6 && c6 !== "/" && c6 !== ".") return next(layerError);
|
|
29538
29538
|
debug("trim prefix (%s) from url %s", layerPath, req.url);
|
|
29539
29539
|
removed = layerPath;
|
|
@@ -29611,7 +29611,7 @@ var require_router = __commonJS({
|
|
|
29611
29611
|
};
|
|
29612
29612
|
proto.use = function use(fn) {
|
|
29613
29613
|
var offset = 0;
|
|
29614
|
-
var
|
|
29614
|
+
var path37 = "/";
|
|
29615
29615
|
if (typeof fn !== "function") {
|
|
29616
29616
|
var arg = fn;
|
|
29617
29617
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -29619,7 +29619,7 @@ var require_router = __commonJS({
|
|
|
29619
29619
|
}
|
|
29620
29620
|
if (typeof arg !== "function") {
|
|
29621
29621
|
offset = 1;
|
|
29622
|
-
|
|
29622
|
+
path37 = fn;
|
|
29623
29623
|
}
|
|
29624
29624
|
}
|
|
29625
29625
|
var callbacks = flatten(slice.call(arguments, offset));
|
|
@@ -29631,8 +29631,8 @@ var require_router = __commonJS({
|
|
|
29631
29631
|
if (typeof fn !== "function") {
|
|
29632
29632
|
throw new TypeError("Router.use() requires a middleware function but got a " + gettype(fn));
|
|
29633
29633
|
}
|
|
29634
|
-
debug("use %o %s",
|
|
29635
|
-
var layer = new Layer(
|
|
29634
|
+
debug("use %o %s", path37, fn.name || "<anonymous>");
|
|
29635
|
+
var layer = new Layer(path37, {
|
|
29636
29636
|
sensitive: this.caseSensitive,
|
|
29637
29637
|
strict: false,
|
|
29638
29638
|
end: false
|
|
@@ -29642,9 +29642,9 @@ var require_router = __commonJS({
|
|
|
29642
29642
|
}
|
|
29643
29643
|
return this;
|
|
29644
29644
|
};
|
|
29645
|
-
proto.route = function route(
|
|
29646
|
-
var route2 = new Route(
|
|
29647
|
-
var layer = new Layer(
|
|
29645
|
+
proto.route = function route(path37) {
|
|
29646
|
+
var route2 = new Route(path37);
|
|
29647
|
+
var layer = new Layer(path37, {
|
|
29648
29648
|
sensitive: this.caseSensitive,
|
|
29649
29649
|
strict: this.strict,
|
|
29650
29650
|
end: true
|
|
@@ -29654,8 +29654,8 @@ var require_router = __commonJS({
|
|
|
29654
29654
|
return route2;
|
|
29655
29655
|
};
|
|
29656
29656
|
methods.concat("all").forEach(function(method) {
|
|
29657
|
-
proto[method] = function(
|
|
29658
|
-
var route = this.route(
|
|
29657
|
+
proto[method] = function(path37) {
|
|
29658
|
+
var route = this.route(path37);
|
|
29659
29659
|
route[method].apply(route, slice.call(arguments, 1));
|
|
29660
29660
|
return this;
|
|
29661
29661
|
};
|
|
@@ -29691,9 +29691,9 @@ var require_router = __commonJS({
|
|
|
29691
29691
|
}
|
|
29692
29692
|
return toString.call(obj).replace(objectRegExp, "$1");
|
|
29693
29693
|
}
|
|
29694
|
-
function matchLayer(layer,
|
|
29694
|
+
function matchLayer(layer, path37) {
|
|
29695
29695
|
try {
|
|
29696
|
-
return layer.match(
|
|
29696
|
+
return layer.match(path37);
|
|
29697
29697
|
} catch (err) {
|
|
29698
29698
|
return err;
|
|
29699
29699
|
}
|
|
@@ -29811,13 +29811,13 @@ var require_view = __commonJS({
|
|
|
29811
29811
|
"../../../node_modules/.pnpm/express@4.22.3/node_modules/express/lib/view.js"(exports, module) {
|
|
29812
29812
|
"use strict";
|
|
29813
29813
|
var debug = require_src()("express:view");
|
|
29814
|
-
var
|
|
29815
|
-
var
|
|
29816
|
-
var dirname2 =
|
|
29817
|
-
var basename2 =
|
|
29818
|
-
var extname =
|
|
29819
|
-
var join6 =
|
|
29820
|
-
var resolve =
|
|
29814
|
+
var path37 = __require("path");
|
|
29815
|
+
var fs20 = __require("fs");
|
|
29816
|
+
var dirname2 = path37.dirname;
|
|
29817
|
+
var basename2 = path37.basename;
|
|
29818
|
+
var extname = path37.extname;
|
|
29819
|
+
var join6 = path37.join;
|
|
29820
|
+
var resolve = path37.resolve;
|
|
29821
29821
|
module.exports = View;
|
|
29822
29822
|
function View(name2, options) {
|
|
29823
29823
|
var opts = options || {};
|
|
@@ -29846,17 +29846,17 @@ var require_view = __commonJS({
|
|
|
29846
29846
|
this.path = this.lookup(fileName);
|
|
29847
29847
|
}
|
|
29848
29848
|
View.prototype.lookup = function lookup(name2) {
|
|
29849
|
-
var
|
|
29849
|
+
var path38;
|
|
29850
29850
|
var roots = [].concat(this.root);
|
|
29851
29851
|
debug('lookup "%s"', name2);
|
|
29852
|
-
for (var i7 = 0; i7 < roots.length && !
|
|
29852
|
+
for (var i7 = 0; i7 < roots.length && !path38; i7++) {
|
|
29853
29853
|
var root6 = roots[i7];
|
|
29854
29854
|
var loc = resolve(root6, name2);
|
|
29855
29855
|
var dir = dirname2(loc);
|
|
29856
29856
|
var file = basename2(loc);
|
|
29857
|
-
|
|
29857
|
+
path38 = this.resolve(dir, file);
|
|
29858
29858
|
}
|
|
29859
|
-
return
|
|
29859
|
+
return path38;
|
|
29860
29860
|
};
|
|
29861
29861
|
View.prototype.render = function render(options, callback) {
|
|
29862
29862
|
debug('render "%s"', this.path);
|
|
@@ -29864,21 +29864,21 @@ var require_view = __commonJS({
|
|
|
29864
29864
|
};
|
|
29865
29865
|
View.prototype.resolve = function resolve2(dir, file) {
|
|
29866
29866
|
var ext = this.ext;
|
|
29867
|
-
var
|
|
29868
|
-
var stat6 = tryStat(
|
|
29867
|
+
var path38 = join6(dir, file);
|
|
29868
|
+
var stat6 = tryStat(path38);
|
|
29869
29869
|
if (stat6 && stat6.isFile()) {
|
|
29870
|
-
return
|
|
29870
|
+
return path38;
|
|
29871
29871
|
}
|
|
29872
|
-
|
|
29873
|
-
stat6 = tryStat(
|
|
29872
|
+
path38 = join6(dir, basename2(file, ext), "index" + ext);
|
|
29873
|
+
stat6 = tryStat(path38);
|
|
29874
29874
|
if (stat6 && stat6.isFile()) {
|
|
29875
|
-
return
|
|
29875
|
+
return path38;
|
|
29876
29876
|
}
|
|
29877
29877
|
};
|
|
29878
|
-
function tryStat(
|
|
29879
|
-
debug('stat "%s"',
|
|
29878
|
+
function tryStat(path38) {
|
|
29879
|
+
debug('stat "%s"', path38);
|
|
29880
29880
|
try {
|
|
29881
|
-
return
|
|
29881
|
+
return fs20.statSync(path38);
|
|
29882
29882
|
} catch (e7) {
|
|
29883
29883
|
return void 0;
|
|
29884
29884
|
}
|
|
@@ -30232,8 +30232,8 @@ var require_types = __commonJS({
|
|
|
30232
30232
|
// ../../../node_modules/.pnpm/mime@1.6.0/node_modules/mime/mime.js
|
|
30233
30233
|
var require_mime = __commonJS({
|
|
30234
30234
|
"../../../node_modules/.pnpm/mime@1.6.0/node_modules/mime/mime.js"(exports, module) {
|
|
30235
|
-
var
|
|
30236
|
-
var
|
|
30235
|
+
var path37 = __require("path");
|
|
30236
|
+
var fs20 = __require("fs");
|
|
30237
30237
|
function Mime() {
|
|
30238
30238
|
this.types = /* @__PURE__ */ Object.create(null);
|
|
30239
30239
|
this.extensions = /* @__PURE__ */ Object.create(null);
|
|
@@ -30254,7 +30254,7 @@ var require_mime = __commonJS({
|
|
|
30254
30254
|
};
|
|
30255
30255
|
Mime.prototype.load = function(file) {
|
|
30256
30256
|
this._loading = file;
|
|
30257
|
-
var map3 = {}, content =
|
|
30257
|
+
var map3 = {}, content = fs20.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
|
|
30258
30258
|
lines.forEach(function(line) {
|
|
30259
30259
|
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
|
|
30260
30260
|
map3[fields.shift()] = fields;
|
|
@@ -30262,8 +30262,8 @@ var require_mime = __commonJS({
|
|
|
30262
30262
|
this.define(map3);
|
|
30263
30263
|
this._loading = null;
|
|
30264
30264
|
};
|
|
30265
|
-
Mime.prototype.lookup = function(
|
|
30266
|
-
var ext =
|
|
30265
|
+
Mime.prototype.lookup = function(path38, fallback2) {
|
|
30266
|
+
var ext = path38.replace(/^.*[\.\/\\]/, "").toLowerCase();
|
|
30267
30267
|
return this.types[ext] || fallback2 || this.default_type;
|
|
30268
30268
|
};
|
|
30269
30269
|
Mime.prototype.extension = function(mimeType) {
|
|
@@ -30492,33 +30492,33 @@ var require_send = __commonJS({
|
|
|
30492
30492
|
var escapeHtml = require_escape_html();
|
|
30493
30493
|
var etag = require_etag();
|
|
30494
30494
|
var fresh = require_fresh();
|
|
30495
|
-
var
|
|
30495
|
+
var fs20 = __require("fs");
|
|
30496
30496
|
var mime = require_mime();
|
|
30497
30497
|
var ms = require_ms2();
|
|
30498
30498
|
var onFinished = require_on_finished();
|
|
30499
30499
|
var parseRange = require_range_parser();
|
|
30500
|
-
var
|
|
30500
|
+
var path37 = __require("path");
|
|
30501
30501
|
var statuses = require_statuses();
|
|
30502
30502
|
var Stream3 = __require("stream");
|
|
30503
30503
|
var util = __require("util");
|
|
30504
|
-
var extname =
|
|
30505
|
-
var join6 =
|
|
30506
|
-
var normalize =
|
|
30507
|
-
var resolve =
|
|
30508
|
-
var sep2 =
|
|
30504
|
+
var extname = path37.extname;
|
|
30505
|
+
var join6 = path37.join;
|
|
30506
|
+
var normalize = path37.normalize;
|
|
30507
|
+
var resolve = path37.resolve;
|
|
30508
|
+
var sep2 = path37.sep;
|
|
30509
30509
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
30510
30510
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
30511
30511
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
30512
30512
|
module.exports = send;
|
|
30513
30513
|
module.exports.mime = mime;
|
|
30514
|
-
function send(req,
|
|
30515
|
-
return new SendStream(req,
|
|
30514
|
+
function send(req, path38, options) {
|
|
30515
|
+
return new SendStream(req, path38, options);
|
|
30516
30516
|
}
|
|
30517
|
-
function SendStream(req,
|
|
30517
|
+
function SendStream(req, path38, options) {
|
|
30518
30518
|
Stream3.call(this);
|
|
30519
30519
|
var opts = options || {};
|
|
30520
30520
|
this.options = opts;
|
|
30521
|
-
this.path =
|
|
30521
|
+
this.path = path38;
|
|
30522
30522
|
this.req = req;
|
|
30523
30523
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
30524
30524
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -30564,8 +30564,8 @@ var require_send = __commonJS({
|
|
|
30564
30564
|
this._index = index2;
|
|
30565
30565
|
return this;
|
|
30566
30566
|
}, "send.index: pass index as option");
|
|
30567
|
-
SendStream.prototype.root = function root6(
|
|
30568
|
-
this._root = resolve(String(
|
|
30567
|
+
SendStream.prototype.root = function root6(path38) {
|
|
30568
|
+
this._root = resolve(String(path38));
|
|
30569
30569
|
debug("root %s", this._root);
|
|
30570
30570
|
return this;
|
|
30571
30571
|
};
|
|
@@ -30678,10 +30678,10 @@ var require_send = __commonJS({
|
|
|
30678
30678
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
30679
30679
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
30680
30680
|
};
|
|
30681
|
-
SendStream.prototype.redirect = function redirect(
|
|
30681
|
+
SendStream.prototype.redirect = function redirect(path38) {
|
|
30682
30682
|
var res = this.res;
|
|
30683
30683
|
if (hasListeners(this, "directory")) {
|
|
30684
|
-
this.emit("directory", res,
|
|
30684
|
+
this.emit("directory", res, path38);
|
|
30685
30685
|
return;
|
|
30686
30686
|
}
|
|
30687
30687
|
if (this.hasTrailingSlash()) {
|
|
@@ -30701,42 +30701,42 @@ var require_send = __commonJS({
|
|
|
30701
30701
|
SendStream.prototype.pipe = function pipe2(res) {
|
|
30702
30702
|
var root6 = this._root;
|
|
30703
30703
|
this.res = res;
|
|
30704
|
-
var
|
|
30705
|
-
if (
|
|
30704
|
+
var path38 = decode2(this.path);
|
|
30705
|
+
if (path38 === -1) {
|
|
30706
30706
|
this.error(400);
|
|
30707
30707
|
return res;
|
|
30708
30708
|
}
|
|
30709
|
-
if (~
|
|
30709
|
+
if (~path38.indexOf("\0")) {
|
|
30710
30710
|
this.error(400);
|
|
30711
30711
|
return res;
|
|
30712
30712
|
}
|
|
30713
30713
|
var parts;
|
|
30714
30714
|
if (root6 !== null) {
|
|
30715
|
-
if (
|
|
30716
|
-
|
|
30715
|
+
if (path38) {
|
|
30716
|
+
path38 = normalize("." + sep2 + path38);
|
|
30717
30717
|
}
|
|
30718
|
-
if (UP_PATH_REGEXP.test(
|
|
30719
|
-
debug('malicious path "%s"',
|
|
30718
|
+
if (UP_PATH_REGEXP.test(path38)) {
|
|
30719
|
+
debug('malicious path "%s"', path38);
|
|
30720
30720
|
this.error(403);
|
|
30721
30721
|
return res;
|
|
30722
30722
|
}
|
|
30723
|
-
parts =
|
|
30724
|
-
|
|
30723
|
+
parts = path38.split(sep2);
|
|
30724
|
+
path38 = normalize(join6(root6, path38));
|
|
30725
30725
|
} else {
|
|
30726
|
-
if (UP_PATH_REGEXP.test(
|
|
30727
|
-
debug('malicious path "%s"',
|
|
30726
|
+
if (UP_PATH_REGEXP.test(path38)) {
|
|
30727
|
+
debug('malicious path "%s"', path38);
|
|
30728
30728
|
this.error(403);
|
|
30729
30729
|
return res;
|
|
30730
30730
|
}
|
|
30731
|
-
parts = normalize(
|
|
30732
|
-
|
|
30731
|
+
parts = normalize(path38).split(sep2);
|
|
30732
|
+
path38 = resolve(path38);
|
|
30733
30733
|
}
|
|
30734
30734
|
if (containsDotFile(parts)) {
|
|
30735
30735
|
var access = this._dotfiles;
|
|
30736
30736
|
if (access === void 0) {
|
|
30737
30737
|
access = parts[parts.length - 1][0] === "." ? this._hidden ? "allow" : "ignore" : "allow";
|
|
30738
30738
|
}
|
|
30739
|
-
debug('%s dotfile "%s"', access,
|
|
30739
|
+
debug('%s dotfile "%s"', access, path38);
|
|
30740
30740
|
switch (access) {
|
|
30741
30741
|
case "allow":
|
|
30742
30742
|
break;
|
|
@@ -30750,13 +30750,13 @@ var require_send = __commonJS({
|
|
|
30750
30750
|
}
|
|
30751
30751
|
}
|
|
30752
30752
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
30753
|
-
this.sendIndex(
|
|
30753
|
+
this.sendIndex(path38);
|
|
30754
30754
|
return res;
|
|
30755
30755
|
}
|
|
30756
|
-
this.sendFile(
|
|
30756
|
+
this.sendFile(path38);
|
|
30757
30757
|
return res;
|
|
30758
30758
|
};
|
|
30759
|
-
SendStream.prototype.send = function send2(
|
|
30759
|
+
SendStream.prototype.send = function send2(path38, stat6) {
|
|
30760
30760
|
var len = stat6.size;
|
|
30761
30761
|
var options = this.options;
|
|
30762
30762
|
var opts = {};
|
|
@@ -30768,9 +30768,9 @@ var require_send = __commonJS({
|
|
|
30768
30768
|
this.headersAlreadySent();
|
|
30769
30769
|
return;
|
|
30770
30770
|
}
|
|
30771
|
-
debug('pipe "%s"',
|
|
30772
|
-
this.setHeader(
|
|
30773
|
-
this.type(
|
|
30771
|
+
debug('pipe "%s"', path38);
|
|
30772
|
+
this.setHeader(path38, stat6);
|
|
30773
|
+
this.type(path38);
|
|
30774
30774
|
if (this.isConditionalGET()) {
|
|
30775
30775
|
if (this.isPreconditionFailure()) {
|
|
30776
30776
|
this.error(412);
|
|
@@ -30819,28 +30819,28 @@ var require_send = __commonJS({
|
|
|
30819
30819
|
res.end();
|
|
30820
30820
|
return;
|
|
30821
30821
|
}
|
|
30822
|
-
this.stream(
|
|
30822
|
+
this.stream(path38, opts);
|
|
30823
30823
|
};
|
|
30824
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
30824
|
+
SendStream.prototype.sendFile = function sendFile(path38) {
|
|
30825
30825
|
var i7 = 0;
|
|
30826
30826
|
var self2 = this;
|
|
30827
|
-
debug('stat "%s"',
|
|
30828
|
-
|
|
30829
|
-
if (err && err.code === "ENOENT" && !extname(
|
|
30827
|
+
debug('stat "%s"', path38);
|
|
30828
|
+
fs20.stat(path38, function onstat(err, stat6) {
|
|
30829
|
+
if (err && err.code === "ENOENT" && !extname(path38) && path38[path38.length - 1] !== sep2) {
|
|
30830
30830
|
return next(err);
|
|
30831
30831
|
}
|
|
30832
30832
|
if (err) return self2.onStatError(err);
|
|
30833
|
-
if (stat6.isDirectory()) return self2.redirect(
|
|
30834
|
-
self2.emit("file",
|
|
30835
|
-
self2.send(
|
|
30833
|
+
if (stat6.isDirectory()) return self2.redirect(path38);
|
|
30834
|
+
self2.emit("file", path38, stat6);
|
|
30835
|
+
self2.send(path38, stat6);
|
|
30836
30836
|
});
|
|
30837
30837
|
function next(err) {
|
|
30838
30838
|
if (self2._extensions.length <= i7) {
|
|
30839
30839
|
return err ? self2.onStatError(err) : self2.error(404);
|
|
30840
30840
|
}
|
|
30841
|
-
var p3 =
|
|
30841
|
+
var p3 = path38 + "." + self2._extensions[i7++];
|
|
30842
30842
|
debug('stat "%s"', p3);
|
|
30843
|
-
|
|
30843
|
+
fs20.stat(p3, function(err2, stat6) {
|
|
30844
30844
|
if (err2) return next(err2);
|
|
30845
30845
|
if (stat6.isDirectory()) return next();
|
|
30846
30846
|
self2.emit("file", p3, stat6);
|
|
@@ -30848,7 +30848,7 @@ var require_send = __commonJS({
|
|
|
30848
30848
|
});
|
|
30849
30849
|
}
|
|
30850
30850
|
};
|
|
30851
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
30851
|
+
SendStream.prototype.sendIndex = function sendIndex(path38) {
|
|
30852
30852
|
var i7 = -1;
|
|
30853
30853
|
var self2 = this;
|
|
30854
30854
|
function next(err) {
|
|
@@ -30856,9 +30856,9 @@ var require_send = __commonJS({
|
|
|
30856
30856
|
if (err) return self2.onStatError(err);
|
|
30857
30857
|
return self2.error(404);
|
|
30858
30858
|
}
|
|
30859
|
-
var p3 = join6(
|
|
30859
|
+
var p3 = join6(path38, self2._index[i7]);
|
|
30860
30860
|
debug('stat "%s"', p3);
|
|
30861
|
-
|
|
30861
|
+
fs20.stat(p3, function(err2, stat6) {
|
|
30862
30862
|
if (err2) return next(err2);
|
|
30863
30863
|
if (stat6.isDirectory()) return next();
|
|
30864
30864
|
self2.emit("file", p3, stat6);
|
|
@@ -30867,10 +30867,10 @@ var require_send = __commonJS({
|
|
|
30867
30867
|
}
|
|
30868
30868
|
next();
|
|
30869
30869
|
};
|
|
30870
|
-
SendStream.prototype.stream = function stream2(
|
|
30870
|
+
SendStream.prototype.stream = function stream2(path38, options) {
|
|
30871
30871
|
var self2 = this;
|
|
30872
30872
|
var res = this.res;
|
|
30873
|
-
var stream3 =
|
|
30873
|
+
var stream3 = fs20.createReadStream(path38, options);
|
|
30874
30874
|
this.emit("stream", stream3);
|
|
30875
30875
|
stream3.pipe(res);
|
|
30876
30876
|
function cleanup() {
|
|
@@ -30885,10 +30885,10 @@ var require_send = __commonJS({
|
|
|
30885
30885
|
self2.emit("end");
|
|
30886
30886
|
});
|
|
30887
30887
|
};
|
|
30888
|
-
SendStream.prototype.type = function type(
|
|
30888
|
+
SendStream.prototype.type = function type(path38) {
|
|
30889
30889
|
var res = this.res;
|
|
30890
30890
|
if (res.getHeader("Content-Type")) return;
|
|
30891
|
-
var type2 = mime.lookup(
|
|
30891
|
+
var type2 = mime.lookup(path38);
|
|
30892
30892
|
if (!type2) {
|
|
30893
30893
|
debug("no content-type");
|
|
30894
30894
|
return;
|
|
@@ -30897,9 +30897,9 @@ var require_send = __commonJS({
|
|
|
30897
30897
|
debug("content-type %s", type2);
|
|
30898
30898
|
res.setHeader("Content-Type", type2 + (charset ? "; charset=" + charset : ""));
|
|
30899
30899
|
};
|
|
30900
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
30900
|
+
SendStream.prototype.setHeader = function setHeader(path38, stat6) {
|
|
30901
30901
|
var res = this.res;
|
|
30902
|
-
this.emit("headers", res,
|
|
30902
|
+
this.emit("headers", res, path38, stat6);
|
|
30903
30903
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
30904
30904
|
debug("accept ranges");
|
|
30905
30905
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -30958,9 +30958,9 @@ var require_send = __commonJS({
|
|
|
30958
30958
|
}
|
|
30959
30959
|
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
|
|
30960
30960
|
}
|
|
30961
|
-
function decode2(
|
|
30961
|
+
function decode2(path38) {
|
|
30962
30962
|
try {
|
|
30963
|
-
return decodeURIComponent(
|
|
30963
|
+
return decodeURIComponent(path38);
|
|
30964
30964
|
} catch (err) {
|
|
30965
30965
|
return -1;
|
|
30966
30966
|
}
|
|
@@ -31869,10 +31869,10 @@ var require_utils3 = __commonJS({
|
|
|
31869
31869
|
var querystring = __require("querystring");
|
|
31870
31870
|
exports.etag = createETagGenerator({ weak: false });
|
|
31871
31871
|
exports.wetag = createETagGenerator({ weak: true });
|
|
31872
|
-
exports.isAbsolute = function(
|
|
31873
|
-
if ("/" ===
|
|
31874
|
-
if (":" ===
|
|
31875
|
-
if ("\\\\" ===
|
|
31872
|
+
exports.isAbsolute = function(path37) {
|
|
31873
|
+
if ("/" === path37[0]) return true;
|
|
31874
|
+
if (":" === path37[1] && ("\\" === path37[2] || "/" === path37[2])) return true;
|
|
31875
|
+
if ("\\\\" === path37.substring(0, 2)) return true;
|
|
31876
31876
|
};
|
|
31877
31877
|
exports.flatten = deprecate3.function(
|
|
31878
31878
|
flatten,
|
|
@@ -32084,7 +32084,7 @@ var require_application = __commonJS({
|
|
|
32084
32084
|
};
|
|
32085
32085
|
app.use = function use(fn) {
|
|
32086
32086
|
var offset = 0;
|
|
32087
|
-
var
|
|
32087
|
+
var path37 = "/";
|
|
32088
32088
|
if (typeof fn !== "function") {
|
|
32089
32089
|
var arg = fn;
|
|
32090
32090
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -32092,7 +32092,7 @@ var require_application = __commonJS({
|
|
|
32092
32092
|
}
|
|
32093
32093
|
if (typeof arg !== "function") {
|
|
32094
32094
|
offset = 1;
|
|
32095
|
-
|
|
32095
|
+
path37 = fn;
|
|
32096
32096
|
}
|
|
32097
32097
|
}
|
|
32098
32098
|
var fns = flatten(slice.call(arguments, offset));
|
|
@@ -32103,12 +32103,12 @@ var require_application = __commonJS({
|
|
|
32103
32103
|
var router = this._router;
|
|
32104
32104
|
fns.forEach(function(fn2) {
|
|
32105
32105
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
32106
|
-
return router.use(
|
|
32106
|
+
return router.use(path37, fn2);
|
|
32107
32107
|
}
|
|
32108
|
-
debug(".use app under %s",
|
|
32109
|
-
fn2.mountpath =
|
|
32108
|
+
debug(".use app under %s", path37);
|
|
32109
|
+
fn2.mountpath = path37;
|
|
32110
32110
|
fn2.parent = this;
|
|
32111
|
-
router.use(
|
|
32111
|
+
router.use(path37, function mounted_app(req, res, next) {
|
|
32112
32112
|
var orig = req.app;
|
|
32113
32113
|
fn2.handle(req, res, function(err) {
|
|
32114
32114
|
setPrototypeOf(req, orig.request);
|
|
@@ -32120,9 +32120,9 @@ var require_application = __commonJS({
|
|
|
32120
32120
|
}, this);
|
|
32121
32121
|
return this;
|
|
32122
32122
|
};
|
|
32123
|
-
app.route = function route(
|
|
32123
|
+
app.route = function route(path37) {
|
|
32124
32124
|
this.lazyrouter();
|
|
32125
|
-
return this._router.route(
|
|
32125
|
+
return this._router.route(path37);
|
|
32126
32126
|
};
|
|
32127
32127
|
app.engine = function engine(ext, fn) {
|
|
32128
32128
|
if (typeof fn !== "function") {
|
|
@@ -32173,7 +32173,7 @@ var require_application = __commonJS({
|
|
|
32173
32173
|
}
|
|
32174
32174
|
return this;
|
|
32175
32175
|
};
|
|
32176
|
-
app.path = function
|
|
32176
|
+
app.path = function path37() {
|
|
32177
32177
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
32178
32178
|
};
|
|
32179
32179
|
app.enabled = function enabled(setting) {
|
|
@@ -32189,19 +32189,19 @@ var require_application = __commonJS({
|
|
|
32189
32189
|
return this.set(setting, false);
|
|
32190
32190
|
};
|
|
32191
32191
|
methods.forEach(function(method) {
|
|
32192
|
-
app[method] = function(
|
|
32192
|
+
app[method] = function(path37) {
|
|
32193
32193
|
if (method === "get" && arguments.length === 1) {
|
|
32194
|
-
return this.set(
|
|
32194
|
+
return this.set(path37);
|
|
32195
32195
|
}
|
|
32196
32196
|
this.lazyrouter();
|
|
32197
|
-
var route = this._router.route(
|
|
32197
|
+
var route = this._router.route(path37);
|
|
32198
32198
|
route[method].apply(route, slice.call(arguments, 1));
|
|
32199
32199
|
return this;
|
|
32200
32200
|
};
|
|
32201
32201
|
});
|
|
32202
|
-
app.all = function all(
|
|
32202
|
+
app.all = function all(path37) {
|
|
32203
32203
|
this.lazyrouter();
|
|
32204
|
-
var route = this._router.route(
|
|
32204
|
+
var route = this._router.route(path37);
|
|
32205
32205
|
var args = slice.call(arguments, 1);
|
|
32206
32206
|
for (var i7 = 0; i7 < methods.length; i7++) {
|
|
32207
32207
|
route[methods[i7]].apply(route, args);
|
|
@@ -32960,7 +32960,7 @@ var require_request = __commonJS({
|
|
|
32960
32960
|
var subdomains2 = !isIP2(hostname) ? hostname.split(".").reverse() : [hostname];
|
|
32961
32961
|
return subdomains2.slice(offset);
|
|
32962
32962
|
});
|
|
32963
|
-
defineGetter(req, "path", function
|
|
32963
|
+
defineGetter(req, "path", function path37() {
|
|
32964
32964
|
return parse4(this).pathname;
|
|
32965
32965
|
});
|
|
32966
32966
|
defineGetter(req, "hostname", function hostname() {
|
|
@@ -33282,7 +33282,7 @@ var require_response = __commonJS({
|
|
|
33282
33282
|
var http3 = __require("http");
|
|
33283
33283
|
var isAbsolute = require_utils3().isAbsolute;
|
|
33284
33284
|
var onFinished = require_on_finished();
|
|
33285
|
-
var
|
|
33285
|
+
var path37 = __require("path");
|
|
33286
33286
|
var statuses = require_statuses();
|
|
33287
33287
|
var merge3 = require_utils_merge();
|
|
33288
33288
|
var sign2 = require_cookie_signature().sign;
|
|
@@ -33291,9 +33291,9 @@ var require_response = __commonJS({
|
|
|
33291
33291
|
var setCharset = require_utils3().setCharset;
|
|
33292
33292
|
var cookie = require_cookie();
|
|
33293
33293
|
var send = require_send();
|
|
33294
|
-
var extname =
|
|
33294
|
+
var extname = path37.extname;
|
|
33295
33295
|
var mime = send.mime;
|
|
33296
|
-
var resolve =
|
|
33296
|
+
var resolve = path37.resolve;
|
|
33297
33297
|
var vary = require_vary();
|
|
33298
33298
|
var res = Object.create(http3.ServerResponse.prototype);
|
|
33299
33299
|
module.exports = res;
|
|
@@ -33470,26 +33470,26 @@ var require_response = __commonJS({
|
|
|
33470
33470
|
this.type("txt");
|
|
33471
33471
|
return this.send(body);
|
|
33472
33472
|
};
|
|
33473
|
-
res.sendFile = function sendFile(
|
|
33473
|
+
res.sendFile = function sendFile(path38, options, callback) {
|
|
33474
33474
|
var done = callback;
|
|
33475
33475
|
var req = this.req;
|
|
33476
33476
|
var res2 = this;
|
|
33477
33477
|
var next = req.next;
|
|
33478
33478
|
var opts = options || {};
|
|
33479
|
-
if (!
|
|
33479
|
+
if (!path38) {
|
|
33480
33480
|
throw new TypeError("path argument is required to res.sendFile");
|
|
33481
33481
|
}
|
|
33482
|
-
if (typeof
|
|
33482
|
+
if (typeof path38 !== "string") {
|
|
33483
33483
|
throw new TypeError("path must be a string to res.sendFile");
|
|
33484
33484
|
}
|
|
33485
33485
|
if (typeof options === "function") {
|
|
33486
33486
|
done = options;
|
|
33487
33487
|
opts = {};
|
|
33488
33488
|
}
|
|
33489
|
-
if (!opts.root && !isAbsolute(
|
|
33489
|
+
if (!opts.root && !isAbsolute(path38)) {
|
|
33490
33490
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
33491
33491
|
}
|
|
33492
|
-
var pathname = encodeURI(
|
|
33492
|
+
var pathname = encodeURI(path38);
|
|
33493
33493
|
var file = send(req, pathname, opts);
|
|
33494
33494
|
sendfile(res2, file, opts, function(err) {
|
|
33495
33495
|
if (done) return done(err);
|
|
@@ -33499,7 +33499,7 @@ var require_response = __commonJS({
|
|
|
33499
33499
|
}
|
|
33500
33500
|
});
|
|
33501
33501
|
};
|
|
33502
|
-
res.sendfile = function(
|
|
33502
|
+
res.sendfile = function(path38, options, callback) {
|
|
33503
33503
|
var done = callback;
|
|
33504
33504
|
var req = this.req;
|
|
33505
33505
|
var res2 = this;
|
|
@@ -33509,7 +33509,7 @@ var require_response = __commonJS({
|
|
|
33509
33509
|
done = options;
|
|
33510
33510
|
opts = {};
|
|
33511
33511
|
}
|
|
33512
|
-
var file = send(req,
|
|
33512
|
+
var file = send(req, path38, opts);
|
|
33513
33513
|
sendfile(res2, file, opts, function(err) {
|
|
33514
33514
|
if (done) return done(err);
|
|
33515
33515
|
if (err && err.code === "EISDIR") return next();
|
|
@@ -33522,7 +33522,7 @@ var require_response = __commonJS({
|
|
|
33522
33522
|
res.sendfile,
|
|
33523
33523
|
"res.sendfile: Use res.sendFile instead"
|
|
33524
33524
|
);
|
|
33525
|
-
res.download = function download(
|
|
33525
|
+
res.download = function download(path38, filename, options, callback) {
|
|
33526
33526
|
var done = callback;
|
|
33527
33527
|
var name2 = filename;
|
|
33528
33528
|
var opts = options || null;
|
|
@@ -33539,7 +33539,7 @@ var require_response = __commonJS({
|
|
|
33539
33539
|
opts = filename;
|
|
33540
33540
|
}
|
|
33541
33541
|
var headers = {
|
|
33542
|
-
"Content-Disposition": contentDisposition(name2 ||
|
|
33542
|
+
"Content-Disposition": contentDisposition(name2 || path38)
|
|
33543
33543
|
};
|
|
33544
33544
|
if (opts && opts.headers) {
|
|
33545
33545
|
var keys = Object.keys(opts.headers);
|
|
@@ -33552,7 +33552,7 @@ var require_response = __commonJS({
|
|
|
33552
33552
|
}
|
|
33553
33553
|
opts = Object.create(opts);
|
|
33554
33554
|
opts.headers = headers;
|
|
33555
|
-
var fullPath = !opts.root ? resolve(
|
|
33555
|
+
var fullPath = !opts.root ? resolve(path38) : path38;
|
|
33556
33556
|
return this.sendFile(fullPath, opts, done);
|
|
33557
33557
|
};
|
|
33558
33558
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -33853,11 +33853,11 @@ var require_serve_static = __commonJS({
|
|
|
33853
33853
|
}
|
|
33854
33854
|
var forwardError = !fallthrough;
|
|
33855
33855
|
var originalUrl = parseUrl2.original(req);
|
|
33856
|
-
var
|
|
33857
|
-
if (
|
|
33858
|
-
|
|
33856
|
+
var path37 = parseUrl2(req).pathname;
|
|
33857
|
+
if (path37 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
33858
|
+
path37 = "";
|
|
33859
33859
|
}
|
|
33860
|
-
var stream2 = send(req,
|
|
33860
|
+
var stream2 = send(req, path37, opts);
|
|
33861
33861
|
stream2.on("directory", onDirectory);
|
|
33862
33862
|
if (setHeaders) {
|
|
33863
33863
|
stream2.on("headers", setHeaders);
|
|
@@ -34039,8 +34039,8 @@ var require_tracer = __commonJS({
|
|
|
34039
34039
|
};
|
|
34040
34040
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34041
34041
|
exports.Tracer = void 0;
|
|
34042
|
-
var
|
|
34043
|
-
var
|
|
34042
|
+
var fs20 = __importStar2(__require("fs"));
|
|
34043
|
+
var path37 = __importStar2(__require("path"));
|
|
34044
34044
|
var express_1 = __importDefault2(require_express2());
|
|
34045
34045
|
var Tracer = class {
|
|
34046
34046
|
/**
|
|
@@ -34049,7 +34049,7 @@ var require_tracer = __commonJS({
|
|
|
34049
34049
|
* @param cacheDir - Directory to store conversation history files
|
|
34050
34050
|
*/
|
|
34051
34051
|
constructor(cacheDir) {
|
|
34052
|
-
this.cacheDir =
|
|
34052
|
+
this.cacheDir = path37.resolve(cacheDir || process.env.AGENTHUB_CACHE_DIR || "cache");
|
|
34053
34053
|
this._ensureDirectoryExists(this.cacheDir);
|
|
34054
34054
|
}
|
|
34055
34055
|
/**
|
|
@@ -34058,8 +34058,8 @@ var require_tracer = __commonJS({
|
|
|
34058
34058
|
* @param dirPath - Directory path to create
|
|
34059
34059
|
*/
|
|
34060
34060
|
_ensureDirectoryExists(dirPath) {
|
|
34061
|
-
if (!
|
|
34062
|
-
|
|
34061
|
+
if (!fs20.existsSync(dirPath)) {
|
|
34062
|
+
fs20.mkdirSync(dirPath, { recursive: true });
|
|
34063
34063
|
}
|
|
34064
34064
|
}
|
|
34065
34065
|
/**
|
|
@@ -34228,8 +34228,8 @@ var require_tracer = __commonJS({
|
|
|
34228
34228
|
* @param config - The UniConfig used for this conversation
|
|
34229
34229
|
*/
|
|
34230
34230
|
saveHistory(model2, history, fileId, config2) {
|
|
34231
|
-
const filePathBase =
|
|
34232
|
-
const dirPath =
|
|
34231
|
+
const filePathBase = path37.join(this.cacheDir, fileId);
|
|
34232
|
+
const dirPath = path37.dirname(filePathBase);
|
|
34233
34233
|
this._ensureDirectoryExists(dirPath);
|
|
34234
34234
|
const configWithModel = {
|
|
34235
34235
|
...config2,
|
|
@@ -34241,10 +34241,10 @@ var require_tracer = __commonJS({
|
|
|
34241
34241
|
config: this._serializeForJson(configWithModel),
|
|
34242
34242
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
34243
34243
|
};
|
|
34244
|
-
|
|
34244
|
+
fs20.writeFileSync(jsonPath, JSON.stringify(jsonData, null, 2), "utf-8");
|
|
34245
34245
|
const txtPath = filePathBase + ".txt";
|
|
34246
34246
|
const formattedContent = this._formatHistory(history, configWithModel);
|
|
34247
|
-
|
|
34247
|
+
fs20.writeFileSync(txtPath, formattedContent, "utf-8");
|
|
34248
34248
|
}
|
|
34249
34249
|
/**
|
|
34250
34250
|
* Format conversation history in a readable text format.
|
|
@@ -34451,14 +34451,14 @@ Finish Reason: ${message.finish_reason}`);
|
|
|
34451
34451
|
`;
|
|
34452
34452
|
app.get("*", (req, res) => {
|
|
34453
34453
|
const subpath = req.path.slice(1);
|
|
34454
|
-
const fullPath =
|
|
34455
|
-
if (!fullPath.startsWith(
|
|
34454
|
+
const fullPath = path37.resolve(path37.join(this.cacheDir, subpath));
|
|
34455
|
+
if (!fullPath.startsWith(path37.resolve(this.cacheDir))) {
|
|
34456
34456
|
return res.status(403).send("Access denied");
|
|
34457
34457
|
}
|
|
34458
|
-
if (!
|
|
34458
|
+
if (!fs20.existsSync(fullPath)) {
|
|
34459
34459
|
return res.status(404).send("Path not found");
|
|
34460
34460
|
}
|
|
34461
|
-
if (
|
|
34461
|
+
if (fs20.statSync(fullPath).isFile()) {
|
|
34462
34462
|
try {
|
|
34463
34463
|
const parts = subpath ? subpath.split("/") : [];
|
|
34464
34464
|
const breadcrumbParts = [
|
|
@@ -34474,7 +34474,7 @@ Finish Reason: ${message.finish_reason}`);
|
|
|
34474
34474
|
const breadcrumb = breadcrumbParts.join(" / ");
|
|
34475
34475
|
const backUrl = this._prefixUrl(basePath, parts.length > 1 ? "/" + parts.slice(0, -1).join("/") : "/");
|
|
34476
34476
|
if (fullPath.endsWith(".json")) {
|
|
34477
|
-
const data = JSON.parse(
|
|
34477
|
+
const data = JSON.parse(fs20.readFileSync(fullPath, "utf-8"));
|
|
34478
34478
|
const configItems = Object.entries(data.config || {}).filter(([key]) => key !== "trace_id").map(([key, value]) => {
|
|
34479
34479
|
if (key === "system_prompt" && value != null) {
|
|
34480
34480
|
return {
|
|
@@ -34619,11 +34619,11 @@ Finish Reason: ${message.finish_reason}`);
|
|
|
34619
34619
|
`;
|
|
34620
34620
|
}).join("");
|
|
34621
34621
|
const sidebarHtml = this._buildSidebarHtml(totalRounds, history);
|
|
34622
|
-
const html = JSON_VIEWER_TEMPLATE(
|
|
34622
|
+
const html = JSON_VIEWER_TEMPLATE(path37.basename(fullPath), breadcrumb, backUrl, configHtml, historyHtml, history.length, sidebarHtml);
|
|
34623
34623
|
return res.send(html);
|
|
34624
34624
|
} else {
|
|
34625
|
-
const content =
|
|
34626
|
-
const html = TEXT_VIEWER_TEMPLATE(
|
|
34625
|
+
const content = fs20.readFileSync(fullPath, "utf-8");
|
|
34626
|
+
const html = TEXT_VIEWER_TEMPLATE(path37.basename(fullPath), breadcrumb, backUrl, this._escapeHtml(content));
|
|
34627
34627
|
return res.send(html);
|
|
34628
34628
|
}
|
|
34629
34629
|
} catch (error3) {
|
|
@@ -34632,10 +34632,10 @@ Finish Reason: ${message.finish_reason}`);
|
|
|
34632
34632
|
}
|
|
34633
34633
|
try {
|
|
34634
34634
|
const sortBy = req.query["sort"] === "mtime" ? "mtime" : "name";
|
|
34635
|
-
const entries =
|
|
34635
|
+
const entries = fs20.readdirSync(fullPath, { withFileTypes: true }).filter((entry) => entry.name !== ".DS_Store");
|
|
34636
34636
|
const entryStats = /* @__PURE__ */ new Map();
|
|
34637
34637
|
for (const entry of entries) {
|
|
34638
|
-
entryStats.set(entry.name,
|
|
34638
|
+
entryStats.set(entry.name, fs20.statSync(path37.join(fullPath, entry.name)));
|
|
34639
34639
|
}
|
|
34640
34640
|
entries.sort((a6, b6) => {
|
|
34641
34641
|
const aIsDir = a6.isDirectory();
|
|
@@ -34650,8 +34650,8 @@ Finish Reason: ${message.finish_reason}`);
|
|
|
34650
34650
|
return a6.name.localeCompare(b6.name);
|
|
34651
34651
|
});
|
|
34652
34652
|
const items = entries.map((entry) => {
|
|
34653
|
-
const entryPath =
|
|
34654
|
-
const relativePath =
|
|
34653
|
+
const entryPath = path37.join(fullPath, entry.name);
|
|
34654
|
+
const relativePath = path37.relative(this.cacheDir, entryPath);
|
|
34655
34655
|
const stat6 = entryStats.get(entry.name);
|
|
34656
34656
|
const isDir = stat6.isDirectory();
|
|
34657
34657
|
let size = "";
|
|
@@ -34801,7 +34801,7 @@ Finish Reason: ${message.finish_reason}`);
|
|
|
34801
34801
|
const app = this.createWebApp();
|
|
34802
34802
|
app.listen(port, host, () => {
|
|
34803
34803
|
console.log(`Starting tracer web server at http://${host}:${port}`);
|
|
34804
|
-
console.log(`Cache directory: ${
|
|
34804
|
+
console.log(`Cache directory: ${path37.resolve(this.cacheDir)}`);
|
|
34805
34805
|
});
|
|
34806
34806
|
}
|
|
34807
34807
|
};
|
|
@@ -41877,22 +41877,22 @@ var init_from = __esm({
|
|
|
41877
41877
|
init_file();
|
|
41878
41878
|
init_fetch_blob();
|
|
41879
41879
|
({ stat } = fs);
|
|
41880
|
-
blobFromSync = (
|
|
41881
|
-
blobFrom = (
|
|
41882
|
-
fileFrom = (
|
|
41883
|
-
fileFromSync = (
|
|
41884
|
-
fromBlob = (stat6,
|
|
41885
|
-
path:
|
|
41880
|
+
blobFromSync = (path37, type) => fromBlob(statSync(path37), path37, type);
|
|
41881
|
+
blobFrom = (path37, type) => stat(path37).then((stat6) => fromBlob(stat6, path37, type));
|
|
41882
|
+
fileFrom = (path37, type) => stat(path37).then((stat6) => fromFile(stat6, path37, type));
|
|
41883
|
+
fileFromSync = (path37, type) => fromFile(statSync(path37), path37, type);
|
|
41884
|
+
fromBlob = (stat6, path37, type = "") => new fetch_blob_default([new BlobDataItem({
|
|
41885
|
+
path: path37,
|
|
41886
41886
|
size: stat6.size,
|
|
41887
41887
|
lastModified: stat6.mtimeMs,
|
|
41888
41888
|
start: 0
|
|
41889
41889
|
})], { type });
|
|
41890
|
-
fromFile = (stat6,
|
|
41891
|
-
path:
|
|
41890
|
+
fromFile = (stat6, path37, type = "") => new file_default([new BlobDataItem({
|
|
41891
|
+
path: path37,
|
|
41892
41892
|
size: stat6.size,
|
|
41893
41893
|
lastModified: stat6.mtimeMs,
|
|
41894
41894
|
start: 0
|
|
41895
|
-
})], basename(
|
|
41895
|
+
})], basename(path37), { type, lastModified: stat6.mtimeMs });
|
|
41896
41896
|
BlobDataItem = class _BlobDataItem {
|
|
41897
41897
|
#path;
|
|
41898
41898
|
#start;
|
|
@@ -47013,9 +47013,9 @@ var require_util2 = __commonJS({
|
|
|
47013
47013
|
exports.removeUndefinedValuesInObject = removeUndefinedValuesInObject;
|
|
47014
47014
|
exports.isValidFile = isValidFile;
|
|
47015
47015
|
exports.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
|
|
47016
|
-
var
|
|
47016
|
+
var fs20 = __require("fs");
|
|
47017
47017
|
var os5 = __require("os");
|
|
47018
|
-
var
|
|
47018
|
+
var path37 = __require("path");
|
|
47019
47019
|
var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
|
|
47020
47020
|
var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
|
|
47021
47021
|
function snakeToCamel(str) {
|
|
@@ -47101,15 +47101,15 @@ var require_util2 = __commonJS({
|
|
|
47101
47101
|
}
|
|
47102
47102
|
async function isValidFile(filePath) {
|
|
47103
47103
|
try {
|
|
47104
|
-
const stats = await
|
|
47104
|
+
const stats = await fs20.promises.lstat(filePath);
|
|
47105
47105
|
return stats.isFile();
|
|
47106
47106
|
} catch (e7) {
|
|
47107
47107
|
return false;
|
|
47108
47108
|
}
|
|
47109
47109
|
}
|
|
47110
47110
|
function getWellKnownCertificateConfigFileLocation() {
|
|
47111
|
-
const configDir = process.env.CLOUDSDK_CONFIG || (_isWindows() ?
|
|
47112
|
-
return
|
|
47111
|
+
const configDir = process.env.CLOUDSDK_CONFIG || (_isWindows() ? path37.join(process.env.APPDATA || "", CLOUDSDK_CONFIG_DIRECTORY) : path37.join(process.env.HOME || "", ".config", CLOUDSDK_CONFIG_DIRECTORY));
|
|
47112
|
+
return path37.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
|
|
47113
47113
|
}
|
|
47114
47114
|
function _isWindows() {
|
|
47115
47115
|
return os5.platform().startsWith("win");
|
|
@@ -49055,11 +49055,11 @@ var require_getCredentials = __commonJS({
|
|
|
49055
49055
|
"use strict";
|
|
49056
49056
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49057
49057
|
exports.getCredentials = getCredentials;
|
|
49058
|
-
var
|
|
49059
|
-
var
|
|
49058
|
+
var path37 = __require("path");
|
|
49059
|
+
var fs20 = __require("fs");
|
|
49060
49060
|
var util_1 = __require("util");
|
|
49061
49061
|
var errorWithCode_1 = require_errorWithCode();
|
|
49062
|
-
var readFile6 =
|
|
49062
|
+
var readFile6 = fs20.readFile ? (0, util_1.promisify)(fs20.readFile) : async () => {
|
|
49063
49063
|
throw new errorWithCode_1.ErrorWithCode("use key rather than keyFile.", "MISSING_CREDENTIALS");
|
|
49064
49064
|
};
|
|
49065
49065
|
var ExtensionFiles;
|
|
@@ -49127,7 +49127,7 @@ var require_getCredentials = __commonJS({
|
|
|
49127
49127
|
* @returns An instance of a class that implements ICredentialsProvider.
|
|
49128
49128
|
*/
|
|
49129
49129
|
static create(keyFilePath) {
|
|
49130
|
-
const keyFileExtension =
|
|
49130
|
+
const keyFileExtension = path37.extname(keyFilePath);
|
|
49131
49131
|
switch (keyFileExtension) {
|
|
49132
49132
|
case ExtensionFiles.JSON:
|
|
49133
49133
|
return new JsonCredentialsProvider(keyFilePath);
|
|
@@ -50736,12 +50736,12 @@ var require_filesubjecttokensupplier = __commonJS({
|
|
|
50736
50736
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50737
50737
|
exports.FileSubjectTokenSupplier = void 0;
|
|
50738
50738
|
var util_1 = __require("util");
|
|
50739
|
-
var
|
|
50740
|
-
var readFile6 = (0, util_1.promisify)(
|
|
50739
|
+
var fs20 = __require("fs");
|
|
50740
|
+
var readFile6 = (0, util_1.promisify)(fs20.readFile ?? (() => {
|
|
50741
50741
|
}));
|
|
50742
|
-
var realpath3 = (0, util_1.promisify)(
|
|
50742
|
+
var realpath3 = (0, util_1.promisify)(fs20.realpath ?? (() => {
|
|
50743
50743
|
}));
|
|
50744
|
-
var lstat = (0, util_1.promisify)(
|
|
50744
|
+
var lstat = (0, util_1.promisify)(fs20.lstat ?? (() => {
|
|
50745
50745
|
}));
|
|
50746
50746
|
var FileSubjectTokenSupplier = class {
|
|
50747
50747
|
filePath;
|
|
@@ -50859,7 +50859,7 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
50859
50859
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50860
50860
|
exports.CertificateSubjectTokenSupplier = exports.InvalidConfigurationError = exports.CertificateSourceUnavailableError = exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = void 0;
|
|
50861
50861
|
var util_1 = require_util2();
|
|
50862
|
-
var
|
|
50862
|
+
var fs20 = __require("fs");
|
|
50863
50863
|
var crypto_1 = __require("crypto");
|
|
50864
50864
|
var https2 = __require("https");
|
|
50865
50865
|
exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = "GOOGLE_API_CERTIFICATE_CONFIG";
|
|
@@ -50953,7 +50953,7 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
50953
50953
|
const configPath = this.certificateConfigPath;
|
|
50954
50954
|
let fileContents;
|
|
50955
50955
|
try {
|
|
50956
|
-
fileContents = await
|
|
50956
|
+
fileContents = await fs20.promises.readFile(configPath, "utf8");
|
|
50957
50957
|
} catch (err) {
|
|
50958
50958
|
throw new CertificateSourceUnavailableError(`Failed to read certificate config file at: ${configPath}`);
|
|
50959
50959
|
}
|
|
@@ -50978,14 +50978,14 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
50978
50978
|
async #getKeyAndCert(certPath, keyPath) {
|
|
50979
50979
|
let cert, key;
|
|
50980
50980
|
try {
|
|
50981
|
-
cert = await
|
|
50981
|
+
cert = await fs20.promises.readFile(certPath);
|
|
50982
50982
|
new crypto_1.X509Certificate(cert);
|
|
50983
50983
|
} catch (err) {
|
|
50984
50984
|
const message = err instanceof Error ? err.message : String(err);
|
|
50985
50985
|
throw new CertificateSourceUnavailableError(`Failed to read certificate file at ${certPath}: ${message}`);
|
|
50986
50986
|
}
|
|
50987
50987
|
try {
|
|
50988
|
-
key = await
|
|
50988
|
+
key = await fs20.promises.readFile(keyPath);
|
|
50989
50989
|
(0, crypto_1.createPrivateKey)(key);
|
|
50990
50990
|
} catch (err) {
|
|
50991
50991
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -51004,7 +51004,7 @@ var require_certificatesubjecttokensupplier = __commonJS({
|
|
|
51004
51004
|
return JSON.stringify([leafCert.raw.toString("base64")]);
|
|
51005
51005
|
}
|
|
51006
51006
|
try {
|
|
51007
|
-
const chainPems = await
|
|
51007
|
+
const chainPems = await fs20.promises.readFile(this.trustChainPath, "utf8");
|
|
51008
51008
|
const pemBlocks = chainPems.match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g) ?? [];
|
|
51009
51009
|
const chainCerts = pemBlocks.map((pem, index) => {
|
|
51010
51010
|
try {
|
|
@@ -51706,7 +51706,7 @@ var require_pluggable_auth_handler = __commonJS({
|
|
|
51706
51706
|
exports.PluggableAuthHandler = exports.ExecutableError = void 0;
|
|
51707
51707
|
var executable_response_1 = require_executable_response();
|
|
51708
51708
|
var childProcess = __require("child_process");
|
|
51709
|
-
var
|
|
51709
|
+
var fs20 = __require("fs");
|
|
51710
51710
|
var ExecutableError = class extends Error {
|
|
51711
51711
|
/**
|
|
51712
51712
|
* The exit code returned by the executable.
|
|
@@ -51791,14 +51791,14 @@ var require_pluggable_auth_handler = __commonJS({
|
|
|
51791
51791
|
}
|
|
51792
51792
|
let filePath;
|
|
51793
51793
|
try {
|
|
51794
|
-
filePath = await
|
|
51794
|
+
filePath = await fs20.promises.realpath(this.outputFile);
|
|
51795
51795
|
} catch {
|
|
51796
51796
|
return void 0;
|
|
51797
51797
|
}
|
|
51798
|
-
if (!(await
|
|
51798
|
+
if (!(await fs20.promises.lstat(filePath)).isFile()) {
|
|
51799
51799
|
return void 0;
|
|
51800
51800
|
}
|
|
51801
|
-
const responseString = await
|
|
51801
|
+
const responseString = await fs20.promises.readFile(filePath, {
|
|
51802
51802
|
encoding: "utf8"
|
|
51803
51803
|
});
|
|
51804
51804
|
if (responseString === "") {
|
|
@@ -52209,7 +52209,7 @@ var require_gdchclient = __commonJS({
|
|
|
52209
52209
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52210
52210
|
exports.GdchClient = exports.GDCH_SERVICE_ACCOUNT_TYPE = void 0;
|
|
52211
52211
|
var crypto3 = __require("crypto");
|
|
52212
|
-
var
|
|
52212
|
+
var fs20 = __require("fs");
|
|
52213
52213
|
var https2 = __require("https");
|
|
52214
52214
|
var oauth2client_1 = require_oauth2client();
|
|
52215
52215
|
var DEFAULT_LIFETIME_IN_SECONDS = 3600;
|
|
@@ -52432,7 +52432,7 @@ var require_gdchclient = __commonJS({
|
|
|
52432
52432
|
const currentPath = this.caCertPath;
|
|
52433
52433
|
this.caAgentPromise = (async () => {
|
|
52434
52434
|
try {
|
|
52435
|
-
const ca = await
|
|
52435
|
+
const ca = await fs20.promises.readFile(currentPath);
|
|
52436
52436
|
return new https2.Agent({ ca });
|
|
52437
52437
|
} catch (err) {
|
|
52438
52438
|
if (this.cachedCaCertPath === currentPath) {
|
|
@@ -52492,11 +52492,11 @@ var require_googleauth = __commonJS({
|
|
|
52492
52492
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52493
52493
|
exports.GoogleAuth = exports.GoogleAuthExceptionMessages = void 0;
|
|
52494
52494
|
var child_process_1 = __require("child_process");
|
|
52495
|
-
var
|
|
52495
|
+
var fs20 = __require("fs");
|
|
52496
52496
|
var gaxios_1 = require_src3();
|
|
52497
52497
|
var gcpMetadata = require_src5();
|
|
52498
52498
|
var os5 = __require("os");
|
|
52499
|
-
var
|
|
52499
|
+
var path37 = __require("path");
|
|
52500
52500
|
var crypto_1 = require_crypto3();
|
|
52501
52501
|
var computeclient_1 = require_computeclient();
|
|
52502
52502
|
var idtokenclient_1 = require_idtokenclient();
|
|
@@ -52781,20 +52781,20 @@ var require_googleauth = __commonJS({
|
|
|
52781
52781
|
if (!configDir) {
|
|
52782
52782
|
if (this._isWindows()) {
|
|
52783
52783
|
if (process.env["APPDATA"]) {
|
|
52784
|
-
configDir =
|
|
52784
|
+
configDir = path37.join(process.env["APPDATA"], "gcloud");
|
|
52785
52785
|
}
|
|
52786
52786
|
} else {
|
|
52787
52787
|
const home = process.env["HOME"];
|
|
52788
52788
|
if (home) {
|
|
52789
|
-
configDir =
|
|
52789
|
+
configDir = path37.join(home, ".config", "gcloud");
|
|
52790
52790
|
}
|
|
52791
52791
|
}
|
|
52792
52792
|
}
|
|
52793
52793
|
if (!configDir) {
|
|
52794
52794
|
return null;
|
|
52795
52795
|
}
|
|
52796
|
-
const location =
|
|
52797
|
-
if (!
|
|
52796
|
+
const location = path37.join(configDir, "application_default_credentials.json");
|
|
52797
|
+
if (!fs20.existsSync(location)) {
|
|
52798
52798
|
return null;
|
|
52799
52799
|
}
|
|
52800
52800
|
const client = await this._getApplicationCredentialsFromFilePath(location, options);
|
|
@@ -52811,8 +52811,8 @@ var require_googleauth = __commonJS({
|
|
|
52811
52811
|
throw new Error("The file path is invalid.");
|
|
52812
52812
|
}
|
|
52813
52813
|
try {
|
|
52814
|
-
filePath =
|
|
52815
|
-
if (!
|
|
52814
|
+
filePath = fs20.realpathSync(filePath);
|
|
52815
|
+
if (!fs20.lstatSync(filePath).isFile()) {
|
|
52816
52816
|
throw new Error();
|
|
52817
52817
|
}
|
|
52818
52818
|
} catch (err) {
|
|
@@ -52821,7 +52821,7 @@ var require_googleauth = __commonJS({
|
|
|
52821
52821
|
}
|
|
52822
52822
|
throw err;
|
|
52823
52823
|
}
|
|
52824
|
-
const readStream =
|
|
52824
|
+
const readStream = fs20.createReadStream(filePath);
|
|
52825
52825
|
return this.fromStream(readStream, options);
|
|
52826
52826
|
}
|
|
52827
52827
|
/**
|
|
@@ -53148,8 +53148,8 @@ var require_googleauth = __commonJS({
|
|
|
53148
53148
|
if (this.jsonContent) {
|
|
53149
53149
|
return this._cacheClientFromJSON(this.jsonContent, this.clientOptions);
|
|
53150
53150
|
} else if (this.keyFilename) {
|
|
53151
|
-
const filePath =
|
|
53152
|
-
const stream2 =
|
|
53151
|
+
const filePath = path37.resolve(this.keyFilename);
|
|
53152
|
+
const stream2 = fs20.createReadStream(filePath);
|
|
53153
53153
|
return await this.fromStreamAsync(stream2, this.clientOptions);
|
|
53154
53154
|
} else if (this.apiKey) {
|
|
53155
53155
|
const client = await this.fromAPIKey(this.apiKey, this.clientOptions);
|
|
@@ -57409,7 +57409,7 @@ var require_node3 = __commonJS({
|
|
|
57409
57409
|
"use strict";
|
|
57410
57410
|
var pRetry = require_p_retry();
|
|
57411
57411
|
var googleAuthLibrary = require_src6();
|
|
57412
|
-
var
|
|
57412
|
+
var fs20 = __require("fs");
|
|
57413
57413
|
var fs$1 = __require("fs/promises");
|
|
57414
57414
|
var node_stream = __require("node:stream");
|
|
57415
57415
|
var promises = __require("node:stream/promises");
|
|
@@ -61192,7 +61192,7 @@ var require_node3 = __commonJS({
|
|
|
61192
61192
|
params
|
|
61193
61193
|
);
|
|
61194
61194
|
const urlParams = body["_url"];
|
|
61195
|
-
const
|
|
61195
|
+
const path38 = formatMap2("{model}:batchGenerateContent", urlParams);
|
|
61196
61196
|
const batch = body["batch"];
|
|
61197
61197
|
const inputConfig = batch["inputConfig"];
|
|
61198
61198
|
const requestsWrapper = inputConfig["requests"];
|
|
@@ -61213,7 +61213,7 @@ var require_node3 = __commonJS({
|
|
|
61213
61213
|
delete body["config"];
|
|
61214
61214
|
delete body["_url"];
|
|
61215
61215
|
delete body["_query"];
|
|
61216
|
-
return { path:
|
|
61216
|
+
return { path: path38, body };
|
|
61217
61217
|
}
|
|
61218
61218
|
// Helper function to get the first GCS URI
|
|
61219
61219
|
getGcsUri(src) {
|
|
@@ -61269,16 +61269,16 @@ var require_node3 = __commonJS({
|
|
|
61269
61269
|
async createInternal(params) {
|
|
61270
61270
|
var _a5, _b, _c6, _d;
|
|
61271
61271
|
let response;
|
|
61272
|
-
let
|
|
61272
|
+
let path38 = "";
|
|
61273
61273
|
let queryParams = {};
|
|
61274
61274
|
if (this.apiClient.isVertexAI()) {
|
|
61275
61275
|
const body = createBatchJobParametersToVertex(this.apiClient, params);
|
|
61276
|
-
|
|
61276
|
+
path38 = formatMap2("batchPredictionJobs", body["_url"]);
|
|
61277
61277
|
queryParams = body["_query"];
|
|
61278
61278
|
delete body["_url"];
|
|
61279
61279
|
delete body["_query"];
|
|
61280
61280
|
response = this.apiClient.request({
|
|
61281
|
-
path:
|
|
61281
|
+
path: path38,
|
|
61282
61282
|
queryParams,
|
|
61283
61283
|
body: JSON.stringify(body),
|
|
61284
61284
|
httpMethod: "POST",
|
|
@@ -61293,12 +61293,12 @@ var require_node3 = __commonJS({
|
|
|
61293
61293
|
});
|
|
61294
61294
|
} else {
|
|
61295
61295
|
const body = createBatchJobParametersToMldev(this.apiClient, params);
|
|
61296
|
-
|
|
61296
|
+
path38 = formatMap2("{model}:batchGenerateContent", body["_url"]);
|
|
61297
61297
|
queryParams = body["_query"];
|
|
61298
61298
|
delete body["_url"];
|
|
61299
61299
|
delete body["_query"];
|
|
61300
61300
|
response = this.apiClient.request({
|
|
61301
|
-
path:
|
|
61301
|
+
path: path38,
|
|
61302
61302
|
queryParams,
|
|
61303
61303
|
body: JSON.stringify(body),
|
|
61304
61304
|
httpMethod: "POST",
|
|
@@ -61323,18 +61323,18 @@ var require_node3 = __commonJS({
|
|
|
61323
61323
|
async createEmbeddingsInternal(params) {
|
|
61324
61324
|
var _a5, _b;
|
|
61325
61325
|
let response;
|
|
61326
|
-
let
|
|
61326
|
+
let path38 = "";
|
|
61327
61327
|
let queryParams = {};
|
|
61328
61328
|
if (this.apiClient.isVertexAI()) {
|
|
61329
61329
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
61330
61330
|
} else {
|
|
61331
61331
|
const body = createEmbeddingsBatchJobParametersToMldev(this.apiClient, params);
|
|
61332
|
-
|
|
61332
|
+
path38 = formatMap2("{model}:asyncBatchEmbedContent", body["_url"]);
|
|
61333
61333
|
queryParams = body["_query"];
|
|
61334
61334
|
delete body["_url"];
|
|
61335
61335
|
delete body["_query"];
|
|
61336
61336
|
response = this.apiClient.request({
|
|
61337
|
-
path:
|
|
61337
|
+
path: path38,
|
|
61338
61338
|
queryParams,
|
|
61339
61339
|
body: JSON.stringify(body),
|
|
61340
61340
|
httpMethod: "POST",
|
|
@@ -61363,16 +61363,16 @@ var require_node3 = __commonJS({
|
|
|
61363
61363
|
async get(params) {
|
|
61364
61364
|
var _a5, _b, _c6, _d;
|
|
61365
61365
|
let response;
|
|
61366
|
-
let
|
|
61366
|
+
let path38 = "";
|
|
61367
61367
|
let queryParams = {};
|
|
61368
61368
|
if (this.apiClient.isVertexAI()) {
|
|
61369
61369
|
const body = getBatchJobParametersToVertex(this.apiClient, params);
|
|
61370
|
-
|
|
61370
|
+
path38 = formatMap2("batchPredictionJobs/{name}", body["_url"]);
|
|
61371
61371
|
queryParams = body["_query"];
|
|
61372
61372
|
delete body["_url"];
|
|
61373
61373
|
delete body["_query"];
|
|
61374
61374
|
response = this.apiClient.request({
|
|
61375
|
-
path:
|
|
61375
|
+
path: path38,
|
|
61376
61376
|
queryParams,
|
|
61377
61377
|
body: JSON.stringify(body),
|
|
61378
61378
|
httpMethod: "GET",
|
|
@@ -61387,12 +61387,12 @@ var require_node3 = __commonJS({
|
|
|
61387
61387
|
});
|
|
61388
61388
|
} else {
|
|
61389
61389
|
const body = getBatchJobParametersToMldev(this.apiClient, params);
|
|
61390
|
-
|
|
61390
|
+
path38 = formatMap2("batches/{name}", body["_url"]);
|
|
61391
61391
|
queryParams = body["_query"];
|
|
61392
61392
|
delete body["_url"];
|
|
61393
61393
|
delete body["_query"];
|
|
61394
61394
|
response = this.apiClient.request({
|
|
61395
|
-
path:
|
|
61395
|
+
path: path38,
|
|
61396
61396
|
queryParams,
|
|
61397
61397
|
body: JSON.stringify(body),
|
|
61398
61398
|
httpMethod: "GET",
|
|
@@ -61420,16 +61420,16 @@ var require_node3 = __commonJS({
|
|
|
61420
61420
|
*/
|
|
61421
61421
|
async cancel(params) {
|
|
61422
61422
|
var _a5, _b, _c6, _d;
|
|
61423
|
-
let
|
|
61423
|
+
let path38 = "";
|
|
61424
61424
|
let queryParams = {};
|
|
61425
61425
|
if (this.apiClient.isVertexAI()) {
|
|
61426
61426
|
const body = cancelBatchJobParametersToVertex(this.apiClient, params);
|
|
61427
|
-
|
|
61427
|
+
path38 = formatMap2("batchPredictionJobs/{name}:cancel", body["_url"]);
|
|
61428
61428
|
queryParams = body["_query"];
|
|
61429
61429
|
delete body["_url"];
|
|
61430
61430
|
delete body["_query"];
|
|
61431
61431
|
await this.apiClient.request({
|
|
61432
|
-
path:
|
|
61432
|
+
path: path38,
|
|
61433
61433
|
queryParams,
|
|
61434
61434
|
body: JSON.stringify(body),
|
|
61435
61435
|
httpMethod: "POST",
|
|
@@ -61438,12 +61438,12 @@ var require_node3 = __commonJS({
|
|
|
61438
61438
|
});
|
|
61439
61439
|
} else {
|
|
61440
61440
|
const body = cancelBatchJobParametersToMldev(this.apiClient, params);
|
|
61441
|
-
|
|
61441
|
+
path38 = formatMap2("batches/{name}:cancel", body["_url"]);
|
|
61442
61442
|
queryParams = body["_query"];
|
|
61443
61443
|
delete body["_url"];
|
|
61444
61444
|
delete body["_query"];
|
|
61445
61445
|
await this.apiClient.request({
|
|
61446
|
-
path:
|
|
61446
|
+
path: path38,
|
|
61447
61447
|
queryParams,
|
|
61448
61448
|
body: JSON.stringify(body),
|
|
61449
61449
|
httpMethod: "POST",
|
|
@@ -61455,16 +61455,16 @@ var require_node3 = __commonJS({
|
|
|
61455
61455
|
async listInternal(params) {
|
|
61456
61456
|
var _a5, _b, _c6, _d;
|
|
61457
61457
|
let response;
|
|
61458
|
-
let
|
|
61458
|
+
let path38 = "";
|
|
61459
61459
|
let queryParams = {};
|
|
61460
61460
|
if (this.apiClient.isVertexAI()) {
|
|
61461
61461
|
const body = listBatchJobsParametersToVertex(params);
|
|
61462
|
-
|
|
61462
|
+
path38 = formatMap2("batchPredictionJobs", body["_url"]);
|
|
61463
61463
|
queryParams = body["_query"];
|
|
61464
61464
|
delete body["_url"];
|
|
61465
61465
|
delete body["_query"];
|
|
61466
61466
|
response = this.apiClient.request({
|
|
61467
|
-
path:
|
|
61467
|
+
path: path38,
|
|
61468
61468
|
queryParams,
|
|
61469
61469
|
body: JSON.stringify(body),
|
|
61470
61470
|
httpMethod: "GET",
|
|
@@ -61487,12 +61487,12 @@ var require_node3 = __commonJS({
|
|
|
61487
61487
|
});
|
|
61488
61488
|
} else {
|
|
61489
61489
|
const body = listBatchJobsParametersToMldev(params);
|
|
61490
|
-
|
|
61490
|
+
path38 = formatMap2("batches", body["_url"]);
|
|
61491
61491
|
queryParams = body["_query"];
|
|
61492
61492
|
delete body["_url"];
|
|
61493
61493
|
delete body["_query"];
|
|
61494
61494
|
response = this.apiClient.request({
|
|
61495
|
-
path:
|
|
61495
|
+
path: path38,
|
|
61496
61496
|
queryParams,
|
|
61497
61497
|
body: JSON.stringify(body),
|
|
61498
61498
|
httpMethod: "GET",
|
|
@@ -61529,16 +61529,16 @@ var require_node3 = __commonJS({
|
|
|
61529
61529
|
async delete(params) {
|
|
61530
61530
|
var _a5, _b, _c6, _d;
|
|
61531
61531
|
let response;
|
|
61532
|
-
let
|
|
61532
|
+
let path38 = "";
|
|
61533
61533
|
let queryParams = {};
|
|
61534
61534
|
if (this.apiClient.isVertexAI()) {
|
|
61535
61535
|
const body = deleteBatchJobParametersToVertex(this.apiClient, params);
|
|
61536
|
-
|
|
61536
|
+
path38 = formatMap2("batchPredictionJobs/{name}", body["_url"]);
|
|
61537
61537
|
queryParams = body["_query"];
|
|
61538
61538
|
delete body["_url"];
|
|
61539
61539
|
delete body["_query"];
|
|
61540
61540
|
response = this.apiClient.request({
|
|
61541
|
-
path:
|
|
61541
|
+
path: path38,
|
|
61542
61542
|
queryParams,
|
|
61543
61543
|
body: JSON.stringify(body),
|
|
61544
61544
|
httpMethod: "DELETE",
|
|
@@ -61559,12 +61559,12 @@ var require_node3 = __commonJS({
|
|
|
61559
61559
|
});
|
|
61560
61560
|
} else {
|
|
61561
61561
|
const body = deleteBatchJobParametersToMldev(this.apiClient, params);
|
|
61562
|
-
|
|
61562
|
+
path38 = formatMap2("batches/{name}", body["_url"]);
|
|
61563
61563
|
queryParams = body["_query"];
|
|
61564
61564
|
delete body["_url"];
|
|
61565
61565
|
delete body["_query"];
|
|
61566
61566
|
response = this.apiClient.request({
|
|
61567
|
-
path:
|
|
61567
|
+
path: path38,
|
|
61568
61568
|
queryParams,
|
|
61569
61569
|
body: JSON.stringify(body),
|
|
61570
61570
|
httpMethod: "DELETE",
|
|
@@ -62453,16 +62453,16 @@ var require_node3 = __commonJS({
|
|
|
62453
62453
|
async create(params) {
|
|
62454
62454
|
var _a5, _b, _c6, _d;
|
|
62455
62455
|
let response;
|
|
62456
|
-
let
|
|
62456
|
+
let path38 = "";
|
|
62457
62457
|
let queryParams = {};
|
|
62458
62458
|
if (this.apiClient.isVertexAI()) {
|
|
62459
62459
|
const body = createCachedContentParametersToVertex(this.apiClient, params);
|
|
62460
|
-
|
|
62460
|
+
path38 = formatMap2("cachedContents", body["_url"]);
|
|
62461
62461
|
queryParams = body["_query"];
|
|
62462
62462
|
delete body["_url"];
|
|
62463
62463
|
delete body["_query"];
|
|
62464
62464
|
response = this.apiClient.request({
|
|
62465
|
-
path:
|
|
62465
|
+
path: path38,
|
|
62466
62466
|
queryParams,
|
|
62467
62467
|
body: JSON.stringify(body),
|
|
62468
62468
|
httpMethod: "POST",
|
|
@@ -62476,12 +62476,12 @@ var require_node3 = __commonJS({
|
|
|
62476
62476
|
});
|
|
62477
62477
|
} else {
|
|
62478
62478
|
const body = createCachedContentParametersToMldev(this.apiClient, params);
|
|
62479
|
-
|
|
62479
|
+
path38 = formatMap2("cachedContents", body["_url"]);
|
|
62480
62480
|
queryParams = body["_query"];
|
|
62481
62481
|
delete body["_url"];
|
|
62482
62482
|
delete body["_query"];
|
|
62483
62483
|
response = this.apiClient.request({
|
|
62484
|
-
path:
|
|
62484
|
+
path: path38,
|
|
62485
62485
|
queryParams,
|
|
62486
62486
|
body: JSON.stringify(body),
|
|
62487
62487
|
httpMethod: "POST",
|
|
@@ -62509,16 +62509,16 @@ var require_node3 = __commonJS({
|
|
|
62509
62509
|
async get(params) {
|
|
62510
62510
|
var _a5, _b, _c6, _d;
|
|
62511
62511
|
let response;
|
|
62512
|
-
let
|
|
62512
|
+
let path38 = "";
|
|
62513
62513
|
let queryParams = {};
|
|
62514
62514
|
if (this.apiClient.isVertexAI()) {
|
|
62515
62515
|
const body = getCachedContentParametersToVertex(this.apiClient, params);
|
|
62516
|
-
|
|
62516
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
62517
62517
|
queryParams = body["_query"];
|
|
62518
62518
|
delete body["_url"];
|
|
62519
62519
|
delete body["_query"];
|
|
62520
62520
|
response = this.apiClient.request({
|
|
62521
|
-
path:
|
|
62521
|
+
path: path38,
|
|
62522
62522
|
queryParams,
|
|
62523
62523
|
body: JSON.stringify(body),
|
|
62524
62524
|
httpMethod: "GET",
|
|
@@ -62532,12 +62532,12 @@ var require_node3 = __commonJS({
|
|
|
62532
62532
|
});
|
|
62533
62533
|
} else {
|
|
62534
62534
|
const body = getCachedContentParametersToMldev(this.apiClient, params);
|
|
62535
|
-
|
|
62535
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
62536
62536
|
queryParams = body["_query"];
|
|
62537
62537
|
delete body["_url"];
|
|
62538
62538
|
delete body["_query"];
|
|
62539
62539
|
response = this.apiClient.request({
|
|
62540
|
-
path:
|
|
62540
|
+
path: path38,
|
|
62541
62541
|
queryParams,
|
|
62542
62542
|
body: JSON.stringify(body),
|
|
62543
62543
|
httpMethod: "GET",
|
|
@@ -62565,16 +62565,16 @@ var require_node3 = __commonJS({
|
|
|
62565
62565
|
async delete(params) {
|
|
62566
62566
|
var _a5, _b, _c6, _d;
|
|
62567
62567
|
let response;
|
|
62568
|
-
let
|
|
62568
|
+
let path38 = "";
|
|
62569
62569
|
let queryParams = {};
|
|
62570
62570
|
if (this.apiClient.isVertexAI()) {
|
|
62571
62571
|
const body = deleteCachedContentParametersToVertex(this.apiClient, params);
|
|
62572
|
-
|
|
62572
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
62573
62573
|
queryParams = body["_query"];
|
|
62574
62574
|
delete body["_url"];
|
|
62575
62575
|
delete body["_query"];
|
|
62576
62576
|
response = this.apiClient.request({
|
|
62577
|
-
path:
|
|
62577
|
+
path: path38,
|
|
62578
62578
|
queryParams,
|
|
62579
62579
|
body: JSON.stringify(body),
|
|
62580
62580
|
httpMethod: "DELETE",
|
|
@@ -62597,12 +62597,12 @@ var require_node3 = __commonJS({
|
|
|
62597
62597
|
});
|
|
62598
62598
|
} else {
|
|
62599
62599
|
const body = deleteCachedContentParametersToMldev(this.apiClient, params);
|
|
62600
|
-
|
|
62600
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
62601
62601
|
queryParams = body["_query"];
|
|
62602
62602
|
delete body["_url"];
|
|
62603
62603
|
delete body["_query"];
|
|
62604
62604
|
response = this.apiClient.request({
|
|
62605
|
-
path:
|
|
62605
|
+
path: path38,
|
|
62606
62606
|
queryParams,
|
|
62607
62607
|
body: JSON.stringify(body),
|
|
62608
62608
|
httpMethod: "DELETE",
|
|
@@ -62642,16 +62642,16 @@ var require_node3 = __commonJS({
|
|
|
62642
62642
|
async update(params) {
|
|
62643
62643
|
var _a5, _b, _c6, _d;
|
|
62644
62644
|
let response;
|
|
62645
|
-
let
|
|
62645
|
+
let path38 = "";
|
|
62646
62646
|
let queryParams = {};
|
|
62647
62647
|
if (this.apiClient.isVertexAI()) {
|
|
62648
62648
|
const body = updateCachedContentParametersToVertex(this.apiClient, params);
|
|
62649
|
-
|
|
62649
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
62650
62650
|
queryParams = body["_query"];
|
|
62651
62651
|
delete body["_url"];
|
|
62652
62652
|
delete body["_query"];
|
|
62653
62653
|
response = this.apiClient.request({
|
|
62654
|
-
path:
|
|
62654
|
+
path: path38,
|
|
62655
62655
|
queryParams,
|
|
62656
62656
|
body: JSON.stringify(body),
|
|
62657
62657
|
httpMethod: "PATCH",
|
|
@@ -62665,12 +62665,12 @@ var require_node3 = __commonJS({
|
|
|
62665
62665
|
});
|
|
62666
62666
|
} else {
|
|
62667
62667
|
const body = updateCachedContentParametersToMldev(this.apiClient, params);
|
|
62668
|
-
|
|
62668
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
62669
62669
|
queryParams = body["_query"];
|
|
62670
62670
|
delete body["_url"];
|
|
62671
62671
|
delete body["_query"];
|
|
62672
62672
|
response = this.apiClient.request({
|
|
62673
|
-
path:
|
|
62673
|
+
path: path38,
|
|
62674
62674
|
queryParams,
|
|
62675
62675
|
body: JSON.stringify(body),
|
|
62676
62676
|
httpMethod: "PATCH",
|
|
@@ -62687,16 +62687,16 @@ var require_node3 = __commonJS({
|
|
|
62687
62687
|
async listInternal(params) {
|
|
62688
62688
|
var _a5, _b, _c6, _d;
|
|
62689
62689
|
let response;
|
|
62690
|
-
let
|
|
62690
|
+
let path38 = "";
|
|
62691
62691
|
let queryParams = {};
|
|
62692
62692
|
if (this.apiClient.isVertexAI()) {
|
|
62693
62693
|
const body = listCachedContentsParametersToVertex(params);
|
|
62694
|
-
|
|
62694
|
+
path38 = formatMap2("cachedContents", body["_url"]);
|
|
62695
62695
|
queryParams = body["_query"];
|
|
62696
62696
|
delete body["_url"];
|
|
62697
62697
|
delete body["_query"];
|
|
62698
62698
|
response = this.apiClient.request({
|
|
62699
|
-
path:
|
|
62699
|
+
path: path38,
|
|
62700
62700
|
queryParams,
|
|
62701
62701
|
body: JSON.stringify(body),
|
|
62702
62702
|
httpMethod: "GET",
|
|
@@ -62719,12 +62719,12 @@ var require_node3 = __commonJS({
|
|
|
62719
62719
|
});
|
|
62720
62720
|
} else {
|
|
62721
62721
|
const body = listCachedContentsParametersToMldev(params);
|
|
62722
|
-
|
|
62722
|
+
path38 = formatMap2("cachedContents", body["_url"]);
|
|
62723
62723
|
queryParams = body["_query"];
|
|
62724
62724
|
delete body["_url"];
|
|
62725
62725
|
delete body["_query"];
|
|
62726
62726
|
response = this.apiClient.request({
|
|
62727
|
-
path:
|
|
62727
|
+
path: path38,
|
|
62728
62728
|
queryParams,
|
|
62729
62729
|
body: JSON.stringify(body),
|
|
62730
62730
|
httpMethod: "GET",
|
|
@@ -63320,18 +63320,18 @@ var require_node3 = __commonJS({
|
|
|
63320
63320
|
async listInternal(params) {
|
|
63321
63321
|
var _a5, _b;
|
|
63322
63322
|
let response;
|
|
63323
|
-
let
|
|
63323
|
+
let path38 = "";
|
|
63324
63324
|
let queryParams = {};
|
|
63325
63325
|
if (this.apiClient.isVertexAI()) {
|
|
63326
63326
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
63327
63327
|
} else {
|
|
63328
63328
|
const body = listFilesParametersToMldev(params);
|
|
63329
|
-
|
|
63329
|
+
path38 = formatMap2("files", body["_url"]);
|
|
63330
63330
|
queryParams = body["_query"];
|
|
63331
63331
|
delete body["_url"];
|
|
63332
63332
|
delete body["_query"];
|
|
63333
63333
|
response = this.apiClient.request({
|
|
63334
|
-
path:
|
|
63334
|
+
path: path38,
|
|
63335
63335
|
queryParams,
|
|
63336
63336
|
body: JSON.stringify(body),
|
|
63337
63337
|
httpMethod: "GET",
|
|
@@ -63357,18 +63357,18 @@ var require_node3 = __commonJS({
|
|
|
63357
63357
|
async createInternal(params) {
|
|
63358
63358
|
var _a5, _b;
|
|
63359
63359
|
let response;
|
|
63360
|
-
let
|
|
63360
|
+
let path38 = "";
|
|
63361
63361
|
let queryParams = {};
|
|
63362
63362
|
if (this.apiClient.isVertexAI()) {
|
|
63363
63363
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
63364
63364
|
} else {
|
|
63365
63365
|
const body = createFileParametersToMldev(params);
|
|
63366
|
-
|
|
63366
|
+
path38 = formatMap2("upload/v1beta/files", body["_url"]);
|
|
63367
63367
|
queryParams = body["_query"];
|
|
63368
63368
|
delete body["_url"];
|
|
63369
63369
|
delete body["_query"];
|
|
63370
63370
|
response = this.apiClient.request({
|
|
63371
|
-
path:
|
|
63371
|
+
path: path38,
|
|
63372
63372
|
queryParams,
|
|
63373
63373
|
body: JSON.stringify(body),
|
|
63374
63374
|
httpMethod: "POST",
|
|
@@ -63403,18 +63403,18 @@ var require_node3 = __commonJS({
|
|
|
63403
63403
|
async get(params) {
|
|
63404
63404
|
var _a5, _b;
|
|
63405
63405
|
let response;
|
|
63406
|
-
let
|
|
63406
|
+
let path38 = "";
|
|
63407
63407
|
let queryParams = {};
|
|
63408
63408
|
if (this.apiClient.isVertexAI()) {
|
|
63409
63409
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
63410
63410
|
} else {
|
|
63411
63411
|
const body = getFileParametersToMldev(params);
|
|
63412
|
-
|
|
63412
|
+
path38 = formatMap2("files/{file}", body["_url"]);
|
|
63413
63413
|
queryParams = body["_query"];
|
|
63414
63414
|
delete body["_url"];
|
|
63415
63415
|
delete body["_query"];
|
|
63416
63416
|
response = this.apiClient.request({
|
|
63417
|
-
path:
|
|
63417
|
+
path: path38,
|
|
63418
63418
|
queryParams,
|
|
63419
63419
|
body: JSON.stringify(body),
|
|
63420
63420
|
httpMethod: "GET",
|
|
@@ -63444,18 +63444,18 @@ var require_node3 = __commonJS({
|
|
|
63444
63444
|
async delete(params) {
|
|
63445
63445
|
var _a5, _b;
|
|
63446
63446
|
let response;
|
|
63447
|
-
let
|
|
63447
|
+
let path38 = "";
|
|
63448
63448
|
let queryParams = {};
|
|
63449
63449
|
if (this.apiClient.isVertexAI()) {
|
|
63450
63450
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
63451
63451
|
} else {
|
|
63452
63452
|
const body = deleteFileParametersToMldev(params);
|
|
63453
|
-
|
|
63453
|
+
path38 = formatMap2("files/{file}", body["_url"]);
|
|
63454
63454
|
queryParams = body["_query"];
|
|
63455
63455
|
delete body["_url"];
|
|
63456
63456
|
delete body["_query"];
|
|
63457
63457
|
response = this.apiClient.request({
|
|
63458
|
-
path:
|
|
63458
|
+
path: path38,
|
|
63459
63459
|
queryParams,
|
|
63460
63460
|
body: JSON.stringify(body),
|
|
63461
63461
|
httpMethod: "DELETE",
|
|
@@ -63481,18 +63481,18 @@ var require_node3 = __commonJS({
|
|
|
63481
63481
|
async registerFilesInternal(params) {
|
|
63482
63482
|
var _a5, _b;
|
|
63483
63483
|
let response;
|
|
63484
|
-
let
|
|
63484
|
+
let path38 = "";
|
|
63485
63485
|
let queryParams = {};
|
|
63486
63486
|
if (this.apiClient.isVertexAI()) {
|
|
63487
63487
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
63488
63488
|
} else {
|
|
63489
63489
|
const body = internalRegisterFilesParametersToMldev(params);
|
|
63490
|
-
|
|
63490
|
+
path38 = formatMap2("files:register", body["_url"]);
|
|
63491
63491
|
queryParams = body["_query"];
|
|
63492
63492
|
delete body["_url"];
|
|
63493
63493
|
delete body["_query"];
|
|
63494
63494
|
response = this.apiClient.request({
|
|
63495
|
-
path:
|
|
63495
|
+
path: path38,
|
|
63496
63496
|
queryParams,
|
|
63497
63497
|
body: JSON.stringify(body),
|
|
63498
63498
|
httpMethod: "POST",
|
|
@@ -68647,13 +68647,13 @@ var require_node3 = __commonJS({
|
|
|
68647
68647
|
throw new Error("HTTP options are not correctly set.");
|
|
68648
68648
|
}
|
|
68649
68649
|
}
|
|
68650
|
-
constructUrl(
|
|
68650
|
+
constructUrl(path38, httpOptions, prependProjectLocation) {
|
|
68651
68651
|
const urlElement = [this.getRequestUrlInternal(httpOptions)];
|
|
68652
68652
|
if (prependProjectLocation) {
|
|
68653
68653
|
urlElement.push(this.getBaseResourcePath());
|
|
68654
68654
|
}
|
|
68655
|
-
if (
|
|
68656
|
-
urlElement.push(
|
|
68655
|
+
if (path38 !== "") {
|
|
68656
|
+
urlElement.push(path38);
|
|
68657
68657
|
}
|
|
68658
68658
|
const url2 = new URL(`${urlElement.join("/")}`);
|
|
68659
68659
|
return url2;
|
|
@@ -68938,8 +68938,8 @@ var require_node3 = __commonJS({
|
|
|
68938
68938
|
file: fileToUpload
|
|
68939
68939
|
};
|
|
68940
68940
|
const fileName = this.getFileName(file);
|
|
68941
|
-
const
|
|
68942
|
-
const uploadUrl = await this.fetchUploadUrl(
|
|
68941
|
+
const path38 = formatMap2("upload/v1beta/files", body["_url"]);
|
|
68942
|
+
const uploadUrl = await this.fetchUploadUrl(path38, fileToUpload.sizeBytes, fileToUpload.mimeType, fileName, body, config2 === null || config2 === void 0 ? void 0 : config2.httpOptions);
|
|
68943
68943
|
return uploader.upload(file, uploadUrl, this);
|
|
68944
68944
|
}
|
|
68945
68945
|
/**
|
|
@@ -68963,13 +68963,13 @@ var require_node3 = __commonJS({
|
|
|
68963
68963
|
if (mimeType === void 0 || mimeType === "") {
|
|
68964
68964
|
throw new Error("Can not determine mimeType. Please provide mimeType in the config.");
|
|
68965
68965
|
}
|
|
68966
|
-
const
|
|
68966
|
+
const path38 = `upload/v1beta/${fileSearchStoreName}:uploadToFileSearchStore`;
|
|
68967
68967
|
const fileName = this.getFileName(file);
|
|
68968
68968
|
const body = {};
|
|
68969
68969
|
if (config2 != null) {
|
|
68970
68970
|
uploadToFileSearchStoreConfigToMldev(config2, body);
|
|
68971
68971
|
}
|
|
68972
|
-
const uploadUrl = await this.fetchUploadUrl(
|
|
68972
|
+
const uploadUrl = await this.fetchUploadUrl(path38, sizeBytes, mimeType, fileName, body, config2 === null || config2 === void 0 ? void 0 : config2.httpOptions);
|
|
68973
68973
|
return uploader.uploadToFileSearchStore(file, uploadUrl, this);
|
|
68974
68974
|
}
|
|
68975
68975
|
/**
|
|
@@ -68982,7 +68982,7 @@ var require_node3 = __commonJS({
|
|
|
68982
68982
|
const downloader = this.clientOptions.downloader;
|
|
68983
68983
|
await downloader.download(params, this);
|
|
68984
68984
|
}
|
|
68985
|
-
async fetchUploadUrl(
|
|
68985
|
+
async fetchUploadUrl(path38, sizeBytes, mimeType, fileName, body, configHttpOptions) {
|
|
68986
68986
|
var _a5;
|
|
68987
68987
|
let httpOptions = {};
|
|
68988
68988
|
if (configHttpOptions) {
|
|
@@ -68995,7 +68995,7 @@ var require_node3 = __commonJS({
|
|
|
68995
68995
|
};
|
|
68996
68996
|
}
|
|
68997
68997
|
const httpResponse = await this.request({
|
|
68998
|
-
path:
|
|
68998
|
+
path: path38,
|
|
68999
68999
|
body: JSON.stringify(body),
|
|
69000
69000
|
httpMethod: "POST",
|
|
69001
69001
|
httpOptions
|
|
@@ -70205,16 +70205,16 @@ var require_node3 = __commonJS({
|
|
|
70205
70205
|
async generateContentInternal(params) {
|
|
70206
70206
|
var _a5, _b, _c6, _d;
|
|
70207
70207
|
let response;
|
|
70208
|
-
let
|
|
70208
|
+
let path38 = "";
|
|
70209
70209
|
let queryParams = {};
|
|
70210
70210
|
if (this.apiClient.isVertexAI()) {
|
|
70211
70211
|
const body = generateContentParametersToVertex(this.apiClient, params);
|
|
70212
|
-
|
|
70212
|
+
path38 = formatMap2("{model}:generateContent", body["_url"]);
|
|
70213
70213
|
queryParams = body["_query"];
|
|
70214
70214
|
delete body["_url"];
|
|
70215
70215
|
delete body["_query"];
|
|
70216
70216
|
response = this.apiClient.request({
|
|
70217
|
-
path:
|
|
70217
|
+
path: path38,
|
|
70218
70218
|
queryParams,
|
|
70219
70219
|
body: JSON.stringify(body),
|
|
70220
70220
|
httpMethod: "POST",
|
|
@@ -70237,12 +70237,12 @@ var require_node3 = __commonJS({
|
|
|
70237
70237
|
});
|
|
70238
70238
|
} else {
|
|
70239
70239
|
const body = generateContentParametersToMldev(this.apiClient, params);
|
|
70240
|
-
|
|
70240
|
+
path38 = formatMap2("{model}:generateContent", body["_url"]);
|
|
70241
70241
|
queryParams = body["_query"];
|
|
70242
70242
|
delete body["_url"];
|
|
70243
70243
|
delete body["_query"];
|
|
70244
70244
|
response = this.apiClient.request({
|
|
70245
|
-
path:
|
|
70245
|
+
path: path38,
|
|
70246
70246
|
queryParams,
|
|
70247
70247
|
body: JSON.stringify(body),
|
|
70248
70248
|
httpMethod: "POST",
|
|
@@ -70268,17 +70268,17 @@ var require_node3 = __commonJS({
|
|
|
70268
70268
|
async generateContentStreamInternal(params) {
|
|
70269
70269
|
var _a5, _b, _c6, _d;
|
|
70270
70270
|
let response;
|
|
70271
|
-
let
|
|
70271
|
+
let path38 = "";
|
|
70272
70272
|
let queryParams = {};
|
|
70273
70273
|
if (this.apiClient.isVertexAI()) {
|
|
70274
70274
|
const body = generateContentParametersToVertex(this.apiClient, params);
|
|
70275
|
-
|
|
70275
|
+
path38 = formatMap2("{model}:streamGenerateContent?alt=sse", body["_url"]);
|
|
70276
70276
|
queryParams = body["_query"];
|
|
70277
70277
|
delete body["_url"];
|
|
70278
70278
|
delete body["_query"];
|
|
70279
70279
|
const apiClient = this.apiClient;
|
|
70280
70280
|
response = apiClient.requestStream({
|
|
70281
|
-
path:
|
|
70281
|
+
path: path38,
|
|
70282
70282
|
queryParams,
|
|
70283
70283
|
body: JSON.stringify(body),
|
|
70284
70284
|
httpMethod: "POST",
|
|
@@ -70314,13 +70314,13 @@ var require_node3 = __commonJS({
|
|
|
70314
70314
|
});
|
|
70315
70315
|
} else {
|
|
70316
70316
|
const body = generateContentParametersToMldev(this.apiClient, params);
|
|
70317
|
-
|
|
70317
|
+
path38 = formatMap2("{model}:streamGenerateContent?alt=sse", body["_url"]);
|
|
70318
70318
|
queryParams = body["_query"];
|
|
70319
70319
|
delete body["_url"];
|
|
70320
70320
|
delete body["_query"];
|
|
70321
70321
|
const apiClient = this.apiClient;
|
|
70322
70322
|
response = apiClient.requestStream({
|
|
70323
|
-
path:
|
|
70323
|
+
path: path38,
|
|
70324
70324
|
queryParams,
|
|
70325
70325
|
body: JSON.stringify(body),
|
|
70326
70326
|
httpMethod: "POST",
|
|
@@ -70380,17 +70380,17 @@ var require_node3 = __commonJS({
|
|
|
70380
70380
|
async embedContentInternal(params) {
|
|
70381
70381
|
var _a5, _b, _c6, _d;
|
|
70382
70382
|
let response;
|
|
70383
|
-
let
|
|
70383
|
+
let path38 = "";
|
|
70384
70384
|
let queryParams = {};
|
|
70385
70385
|
if (this.apiClient.isVertexAI()) {
|
|
70386
70386
|
const body = embedContentParametersPrivateToVertex(this.apiClient, params, params);
|
|
70387
70387
|
const endpointUrl = tIsVertexEmbedContentModel(params.model) ? "{model}:embedContent" : "{model}:predict";
|
|
70388
|
-
|
|
70388
|
+
path38 = formatMap2(endpointUrl, body["_url"]);
|
|
70389
70389
|
queryParams = body["_query"];
|
|
70390
70390
|
delete body["_url"];
|
|
70391
70391
|
delete body["_query"];
|
|
70392
70392
|
response = this.apiClient.request({
|
|
70393
|
-
path:
|
|
70393
|
+
path: path38,
|
|
70394
70394
|
queryParams,
|
|
70395
70395
|
body: JSON.stringify(body),
|
|
70396
70396
|
httpMethod: "POST",
|
|
@@ -70413,12 +70413,12 @@ var require_node3 = __commonJS({
|
|
|
70413
70413
|
});
|
|
70414
70414
|
} else {
|
|
70415
70415
|
const body = embedContentParametersPrivateToMldev(this.apiClient, params);
|
|
70416
|
-
|
|
70416
|
+
path38 = formatMap2("{model}:batchEmbedContents", body["_url"]);
|
|
70417
70417
|
queryParams = body["_query"];
|
|
70418
70418
|
delete body["_url"];
|
|
70419
70419
|
delete body["_query"];
|
|
70420
70420
|
response = this.apiClient.request({
|
|
70421
|
-
path:
|
|
70421
|
+
path: path38,
|
|
70422
70422
|
queryParams,
|
|
70423
70423
|
body: JSON.stringify(body),
|
|
70424
70424
|
httpMethod: "POST",
|
|
@@ -70447,16 +70447,16 @@ var require_node3 = __commonJS({
|
|
|
70447
70447
|
async generateImagesInternal(params) {
|
|
70448
70448
|
var _a5, _b, _c6, _d;
|
|
70449
70449
|
let response;
|
|
70450
|
-
let
|
|
70450
|
+
let path38 = "";
|
|
70451
70451
|
let queryParams = {};
|
|
70452
70452
|
if (this.apiClient.isVertexAI()) {
|
|
70453
70453
|
const body = generateImagesParametersToVertex(this.apiClient, params);
|
|
70454
|
-
|
|
70454
|
+
path38 = formatMap2("{model}:predict", body["_url"]);
|
|
70455
70455
|
queryParams = body["_query"];
|
|
70456
70456
|
delete body["_url"];
|
|
70457
70457
|
delete body["_query"];
|
|
70458
70458
|
response = this.apiClient.request({
|
|
70459
|
-
path:
|
|
70459
|
+
path: path38,
|
|
70460
70460
|
queryParams,
|
|
70461
70461
|
body: JSON.stringify(body),
|
|
70462
70462
|
httpMethod: "POST",
|
|
@@ -70479,12 +70479,12 @@ var require_node3 = __commonJS({
|
|
|
70479
70479
|
});
|
|
70480
70480
|
} else {
|
|
70481
70481
|
const body = generateImagesParametersToMldev(this.apiClient, params);
|
|
70482
|
-
|
|
70482
|
+
path38 = formatMap2("{model}:predict", body["_url"]);
|
|
70483
70483
|
queryParams = body["_query"];
|
|
70484
70484
|
delete body["_url"];
|
|
70485
70485
|
delete body["_query"];
|
|
70486
70486
|
response = this.apiClient.request({
|
|
70487
|
-
path:
|
|
70487
|
+
path: path38,
|
|
70488
70488
|
queryParams,
|
|
70489
70489
|
body: JSON.stringify(body),
|
|
70490
70490
|
httpMethod: "POST",
|
|
@@ -70513,16 +70513,16 @@ var require_node3 = __commonJS({
|
|
|
70513
70513
|
async editImageInternal(params) {
|
|
70514
70514
|
var _a5, _b;
|
|
70515
70515
|
let response;
|
|
70516
|
-
let
|
|
70516
|
+
let path38 = "";
|
|
70517
70517
|
let queryParams = {};
|
|
70518
70518
|
if (this.apiClient.isVertexAI()) {
|
|
70519
70519
|
const body = editImageParametersInternalToVertex(this.apiClient, params);
|
|
70520
|
-
|
|
70520
|
+
path38 = formatMap2("{model}:predict", body["_url"]);
|
|
70521
70521
|
queryParams = body["_query"];
|
|
70522
70522
|
delete body["_url"];
|
|
70523
70523
|
delete body["_query"];
|
|
70524
70524
|
response = this.apiClient.request({
|
|
70525
|
-
path:
|
|
70525
|
+
path: path38,
|
|
70526
70526
|
queryParams,
|
|
70527
70527
|
body: JSON.stringify(body),
|
|
70528
70528
|
httpMethod: "POST",
|
|
@@ -70553,16 +70553,16 @@ var require_node3 = __commonJS({
|
|
|
70553
70553
|
async upscaleImageInternal(params) {
|
|
70554
70554
|
var _a5, _b;
|
|
70555
70555
|
let response;
|
|
70556
|
-
let
|
|
70556
|
+
let path38 = "";
|
|
70557
70557
|
let queryParams = {};
|
|
70558
70558
|
if (this.apiClient.isVertexAI()) {
|
|
70559
70559
|
const body = upscaleImageAPIParametersInternalToVertex(this.apiClient, params);
|
|
70560
|
-
|
|
70560
|
+
path38 = formatMap2("{model}:predict", body["_url"]);
|
|
70561
70561
|
queryParams = body["_query"];
|
|
70562
70562
|
delete body["_url"];
|
|
70563
70563
|
delete body["_query"];
|
|
70564
70564
|
response = this.apiClient.request({
|
|
70565
|
-
path:
|
|
70565
|
+
path: path38,
|
|
70566
70566
|
queryParams,
|
|
70567
70567
|
body: JSON.stringify(body),
|
|
70568
70568
|
httpMethod: "POST",
|
|
@@ -70614,16 +70614,16 @@ var require_node3 = __commonJS({
|
|
|
70614
70614
|
async recontextImage(params) {
|
|
70615
70615
|
var _a5, _b;
|
|
70616
70616
|
let response;
|
|
70617
|
-
let
|
|
70617
|
+
let path38 = "";
|
|
70618
70618
|
let queryParams = {};
|
|
70619
70619
|
if (this.apiClient.isVertexAI()) {
|
|
70620
70620
|
const body = recontextImageParametersToVertex(this.apiClient, params);
|
|
70621
|
-
|
|
70621
|
+
path38 = formatMap2("{model}:predict", body["_url"]);
|
|
70622
70622
|
queryParams = body["_query"];
|
|
70623
70623
|
delete body["_url"];
|
|
70624
70624
|
delete body["_query"];
|
|
70625
70625
|
response = this.apiClient.request({
|
|
70626
|
-
path:
|
|
70626
|
+
path: path38,
|
|
70627
70627
|
queryParams,
|
|
70628
70628
|
body: JSON.stringify(body),
|
|
70629
70629
|
httpMethod: "POST",
|
|
@@ -70665,16 +70665,16 @@ var require_node3 = __commonJS({
|
|
|
70665
70665
|
async segmentImage(params) {
|
|
70666
70666
|
var _a5, _b;
|
|
70667
70667
|
let response;
|
|
70668
|
-
let
|
|
70668
|
+
let path38 = "";
|
|
70669
70669
|
let queryParams = {};
|
|
70670
70670
|
if (this.apiClient.isVertexAI()) {
|
|
70671
70671
|
const body = segmentImageParametersToVertex(this.apiClient, params);
|
|
70672
|
-
|
|
70672
|
+
path38 = formatMap2("{model}:predict", body["_url"]);
|
|
70673
70673
|
queryParams = body["_query"];
|
|
70674
70674
|
delete body["_url"];
|
|
70675
70675
|
delete body["_query"];
|
|
70676
70676
|
response = this.apiClient.request({
|
|
70677
|
-
path:
|
|
70677
|
+
path: path38,
|
|
70678
70678
|
queryParams,
|
|
70679
70679
|
body: JSON.stringify(body),
|
|
70680
70680
|
httpMethod: "POST",
|
|
@@ -70704,16 +70704,16 @@ var require_node3 = __commonJS({
|
|
|
70704
70704
|
async get(params) {
|
|
70705
70705
|
var _a5, _b, _c6, _d;
|
|
70706
70706
|
let response;
|
|
70707
|
-
let
|
|
70707
|
+
let path38 = "";
|
|
70708
70708
|
let queryParams = {};
|
|
70709
70709
|
if (this.apiClient.isVertexAI()) {
|
|
70710
70710
|
const body = getModelParametersToVertex(this.apiClient, params);
|
|
70711
|
-
|
|
70711
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
70712
70712
|
queryParams = body["_query"];
|
|
70713
70713
|
delete body["_url"];
|
|
70714
70714
|
delete body["_query"];
|
|
70715
70715
|
response = this.apiClient.request({
|
|
70716
|
-
path:
|
|
70716
|
+
path: path38,
|
|
70717
70717
|
queryParams,
|
|
70718
70718
|
body: JSON.stringify(body),
|
|
70719
70719
|
httpMethod: "GET",
|
|
@@ -70728,12 +70728,12 @@ var require_node3 = __commonJS({
|
|
|
70728
70728
|
});
|
|
70729
70729
|
} else {
|
|
70730
70730
|
const body = getModelParametersToMldev(this.apiClient, params);
|
|
70731
|
-
|
|
70731
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
70732
70732
|
queryParams = body["_query"];
|
|
70733
70733
|
delete body["_url"];
|
|
70734
70734
|
delete body["_query"];
|
|
70735
70735
|
response = this.apiClient.request({
|
|
70736
|
-
path:
|
|
70736
|
+
path: path38,
|
|
70737
70737
|
queryParams,
|
|
70738
70738
|
body: JSON.stringify(body),
|
|
70739
70739
|
httpMethod: "GET",
|
|
@@ -70751,16 +70751,16 @@ var require_node3 = __commonJS({
|
|
|
70751
70751
|
async listInternal(params) {
|
|
70752
70752
|
var _a5, _b, _c6, _d;
|
|
70753
70753
|
let response;
|
|
70754
|
-
let
|
|
70754
|
+
let path38 = "";
|
|
70755
70755
|
let queryParams = {};
|
|
70756
70756
|
if (this.apiClient.isVertexAI()) {
|
|
70757
70757
|
const body = listModelsParametersToVertex(this.apiClient, params);
|
|
70758
|
-
|
|
70758
|
+
path38 = formatMap2("{models_url}", body["_url"]);
|
|
70759
70759
|
queryParams = body["_query"];
|
|
70760
70760
|
delete body["_url"];
|
|
70761
70761
|
delete body["_query"];
|
|
70762
70762
|
response = this.apiClient.request({
|
|
70763
|
-
path:
|
|
70763
|
+
path: path38,
|
|
70764
70764
|
queryParams,
|
|
70765
70765
|
body: JSON.stringify(body),
|
|
70766
70766
|
httpMethod: "GET",
|
|
@@ -70783,12 +70783,12 @@ var require_node3 = __commonJS({
|
|
|
70783
70783
|
});
|
|
70784
70784
|
} else {
|
|
70785
70785
|
const body = listModelsParametersToMldev(this.apiClient, params);
|
|
70786
|
-
|
|
70786
|
+
path38 = formatMap2("{models_url}", body["_url"]);
|
|
70787
70787
|
queryParams = body["_query"];
|
|
70788
70788
|
delete body["_url"];
|
|
70789
70789
|
delete body["_query"];
|
|
70790
70790
|
response = this.apiClient.request({
|
|
70791
|
-
path:
|
|
70791
|
+
path: path38,
|
|
70792
70792
|
queryParams,
|
|
70793
70793
|
body: JSON.stringify(body),
|
|
70794
70794
|
httpMethod: "GET",
|
|
@@ -70831,16 +70831,16 @@ var require_node3 = __commonJS({
|
|
|
70831
70831
|
async update(params) {
|
|
70832
70832
|
var _a5, _b, _c6, _d;
|
|
70833
70833
|
let response;
|
|
70834
|
-
let
|
|
70834
|
+
let path38 = "";
|
|
70835
70835
|
let queryParams = {};
|
|
70836
70836
|
if (this.apiClient.isVertexAI()) {
|
|
70837
70837
|
const body = updateModelParametersToVertex(this.apiClient, params);
|
|
70838
|
-
|
|
70838
|
+
path38 = formatMap2("{model}", body["_url"]);
|
|
70839
70839
|
queryParams = body["_query"];
|
|
70840
70840
|
delete body["_url"];
|
|
70841
70841
|
delete body["_query"];
|
|
70842
70842
|
response = this.apiClient.request({
|
|
70843
|
-
path:
|
|
70843
|
+
path: path38,
|
|
70844
70844
|
queryParams,
|
|
70845
70845
|
body: JSON.stringify(body),
|
|
70846
70846
|
httpMethod: "PATCH",
|
|
@@ -70855,12 +70855,12 @@ var require_node3 = __commonJS({
|
|
|
70855
70855
|
});
|
|
70856
70856
|
} else {
|
|
70857
70857
|
const body = updateModelParametersToMldev(this.apiClient, params);
|
|
70858
|
-
|
|
70858
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
70859
70859
|
queryParams = body["_query"];
|
|
70860
70860
|
delete body["_url"];
|
|
70861
70861
|
delete body["_query"];
|
|
70862
70862
|
response = this.apiClient.request({
|
|
70863
|
-
path:
|
|
70863
|
+
path: path38,
|
|
70864
70864
|
queryParams,
|
|
70865
70865
|
body: JSON.stringify(body),
|
|
70866
70866
|
httpMethod: "PATCH",
|
|
@@ -70889,16 +70889,16 @@ var require_node3 = __commonJS({
|
|
|
70889
70889
|
async delete(params) {
|
|
70890
70890
|
var _a5, _b, _c6, _d;
|
|
70891
70891
|
let response;
|
|
70892
|
-
let
|
|
70892
|
+
let path38 = "";
|
|
70893
70893
|
let queryParams = {};
|
|
70894
70894
|
if (this.apiClient.isVertexAI()) {
|
|
70895
70895
|
const body = deleteModelParametersToVertex(this.apiClient, params);
|
|
70896
|
-
|
|
70896
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
70897
70897
|
queryParams = body["_query"];
|
|
70898
70898
|
delete body["_url"];
|
|
70899
70899
|
delete body["_query"];
|
|
70900
70900
|
response = this.apiClient.request({
|
|
70901
|
-
path:
|
|
70901
|
+
path: path38,
|
|
70902
70902
|
queryParams,
|
|
70903
70903
|
body: JSON.stringify(body),
|
|
70904
70904
|
httpMethod: "DELETE",
|
|
@@ -70921,12 +70921,12 @@ var require_node3 = __commonJS({
|
|
|
70921
70921
|
});
|
|
70922
70922
|
} else {
|
|
70923
70923
|
const body = deleteModelParametersToMldev(this.apiClient, params);
|
|
70924
|
-
|
|
70924
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
70925
70925
|
queryParams = body["_query"];
|
|
70926
70926
|
delete body["_url"];
|
|
70927
70927
|
delete body["_query"];
|
|
70928
70928
|
response = this.apiClient.request({
|
|
70929
|
-
path:
|
|
70929
|
+
path: path38,
|
|
70930
70930
|
queryParams,
|
|
70931
70931
|
body: JSON.stringify(body),
|
|
70932
70932
|
httpMethod: "DELETE",
|
|
@@ -70968,16 +70968,16 @@ var require_node3 = __commonJS({
|
|
|
70968
70968
|
async countTokens(params) {
|
|
70969
70969
|
var _a5, _b, _c6, _d;
|
|
70970
70970
|
let response;
|
|
70971
|
-
let
|
|
70971
|
+
let path38 = "";
|
|
70972
70972
|
let queryParams = {};
|
|
70973
70973
|
if (this.apiClient.isVertexAI()) {
|
|
70974
70974
|
const body = countTokensParametersToVertex(this.apiClient, params);
|
|
70975
|
-
|
|
70975
|
+
path38 = formatMap2("{model}:countTokens", body["_url"]);
|
|
70976
70976
|
queryParams = body["_query"];
|
|
70977
70977
|
delete body["_url"];
|
|
70978
70978
|
delete body["_query"];
|
|
70979
70979
|
response = this.apiClient.request({
|
|
70980
|
-
path:
|
|
70980
|
+
path: path38,
|
|
70981
70981
|
queryParams,
|
|
70982
70982
|
body: JSON.stringify(body),
|
|
70983
70983
|
httpMethod: "POST",
|
|
@@ -71000,12 +71000,12 @@ var require_node3 = __commonJS({
|
|
|
71000
71000
|
});
|
|
71001
71001
|
} else {
|
|
71002
71002
|
const body = countTokensParametersToMldev(this.apiClient, params);
|
|
71003
|
-
|
|
71003
|
+
path38 = formatMap2("{model}:countTokens", body["_url"]);
|
|
71004
71004
|
queryParams = body["_query"];
|
|
71005
71005
|
delete body["_url"];
|
|
71006
71006
|
delete body["_query"];
|
|
71007
71007
|
response = this.apiClient.request({
|
|
71008
|
-
path:
|
|
71008
|
+
path: path38,
|
|
71009
71009
|
queryParams,
|
|
71010
71010
|
body: JSON.stringify(body),
|
|
71011
71011
|
httpMethod: "POST",
|
|
@@ -71049,16 +71049,16 @@ var require_node3 = __commonJS({
|
|
|
71049
71049
|
async computeTokens(params) {
|
|
71050
71050
|
var _a5, _b;
|
|
71051
71051
|
let response;
|
|
71052
|
-
let
|
|
71052
|
+
let path38 = "";
|
|
71053
71053
|
let queryParams = {};
|
|
71054
71054
|
if (this.apiClient.isVertexAI()) {
|
|
71055
71055
|
const body = computeTokensParametersToVertex(this.apiClient, params);
|
|
71056
|
-
|
|
71056
|
+
path38 = formatMap2("{model}:computeTokens", body["_url"]);
|
|
71057
71057
|
queryParams = body["_query"];
|
|
71058
71058
|
delete body["_url"];
|
|
71059
71059
|
delete body["_query"];
|
|
71060
71060
|
response = this.apiClient.request({
|
|
71061
|
-
path:
|
|
71061
|
+
path: path38,
|
|
71062
71062
|
queryParams,
|
|
71063
71063
|
body: JSON.stringify(body),
|
|
71064
71064
|
httpMethod: "POST",
|
|
@@ -71089,16 +71089,16 @@ var require_node3 = __commonJS({
|
|
|
71089
71089
|
async generateVideosInternal(params) {
|
|
71090
71090
|
var _a5, _b, _c6, _d;
|
|
71091
71091
|
let response;
|
|
71092
|
-
let
|
|
71092
|
+
let path38 = "";
|
|
71093
71093
|
let queryParams = {};
|
|
71094
71094
|
if (this.apiClient.isVertexAI()) {
|
|
71095
71095
|
const body = generateVideosParametersToVertex(this.apiClient, params);
|
|
71096
|
-
|
|
71096
|
+
path38 = formatMap2("{model}:predictLongRunning", body["_url"]);
|
|
71097
71097
|
queryParams = body["_query"];
|
|
71098
71098
|
delete body["_url"];
|
|
71099
71099
|
delete body["_query"];
|
|
71100
71100
|
response = this.apiClient.request({
|
|
71101
|
-
path:
|
|
71101
|
+
path: path38,
|
|
71102
71102
|
queryParams,
|
|
71103
71103
|
body: JSON.stringify(body),
|
|
71104
71104
|
httpMethod: "POST",
|
|
@@ -71115,12 +71115,12 @@ var require_node3 = __commonJS({
|
|
|
71115
71115
|
});
|
|
71116
71116
|
} else {
|
|
71117
71117
|
const body = generateVideosParametersToMldev(this.apiClient, params);
|
|
71118
|
-
|
|
71118
|
+
path38 = formatMap2("{model}:predictLongRunning", body["_url"]);
|
|
71119
71119
|
queryParams = body["_query"];
|
|
71120
71120
|
delete body["_url"];
|
|
71121
71121
|
delete body["_query"];
|
|
71122
71122
|
response = this.apiClient.request({
|
|
71123
|
-
path:
|
|
71123
|
+
path: path38,
|
|
71124
71124
|
queryParams,
|
|
71125
71125
|
body: JSON.stringify(body),
|
|
71126
71126
|
httpMethod: "POST",
|
|
@@ -71222,16 +71222,16 @@ var require_node3 = __commonJS({
|
|
|
71222
71222
|
async getVideosOperationInternal(params) {
|
|
71223
71223
|
var _a5, _b, _c6, _d;
|
|
71224
71224
|
let response;
|
|
71225
|
-
let
|
|
71225
|
+
let path38 = "";
|
|
71226
71226
|
let queryParams = {};
|
|
71227
71227
|
if (this.apiClient.isVertexAI()) {
|
|
71228
71228
|
const body = getOperationParametersToVertex(params);
|
|
71229
|
-
|
|
71229
|
+
path38 = formatMap2("{operationName}", body["_url"]);
|
|
71230
71230
|
queryParams = body["_query"];
|
|
71231
71231
|
delete body["_url"];
|
|
71232
71232
|
delete body["_query"];
|
|
71233
71233
|
response = this.apiClient.request({
|
|
71234
|
-
path:
|
|
71234
|
+
path: path38,
|
|
71235
71235
|
queryParams,
|
|
71236
71236
|
body: JSON.stringify(body),
|
|
71237
71237
|
httpMethod: "GET",
|
|
@@ -71243,12 +71243,12 @@ var require_node3 = __commonJS({
|
|
|
71243
71243
|
return response;
|
|
71244
71244
|
} else {
|
|
71245
71245
|
const body = getOperationParametersToMldev(params);
|
|
71246
|
-
|
|
71246
|
+
path38 = formatMap2("{operationName}", body["_url"]);
|
|
71247
71247
|
queryParams = body["_query"];
|
|
71248
71248
|
delete body["_url"];
|
|
71249
71249
|
delete body["_query"];
|
|
71250
71250
|
response = this.apiClient.request({
|
|
71251
|
-
path:
|
|
71251
|
+
path: path38,
|
|
71252
71252
|
queryParams,
|
|
71253
71253
|
body: JSON.stringify(body),
|
|
71254
71254
|
httpMethod: "GET",
|
|
@@ -71263,16 +71263,16 @@ var require_node3 = __commonJS({
|
|
|
71263
71263
|
async fetchPredictVideosOperationInternal(params) {
|
|
71264
71264
|
var _a5, _b;
|
|
71265
71265
|
let response;
|
|
71266
|
-
let
|
|
71266
|
+
let path38 = "";
|
|
71267
71267
|
let queryParams = {};
|
|
71268
71268
|
if (this.apiClient.isVertexAI()) {
|
|
71269
71269
|
const body = fetchPredictOperationParametersToVertex(params);
|
|
71270
|
-
|
|
71270
|
+
path38 = formatMap2("{resourceName}:fetchPredictOperation", body["_url"]);
|
|
71271
71271
|
queryParams = body["_query"];
|
|
71272
71272
|
delete body["_url"];
|
|
71273
71273
|
delete body["_query"];
|
|
71274
71274
|
response = this.apiClient.request({
|
|
71275
|
-
path:
|
|
71275
|
+
path: path38,
|
|
71276
71276
|
queryParams,
|
|
71277
71277
|
body: JSON.stringify(body),
|
|
71278
71278
|
httpMethod: "POST",
|
|
@@ -71938,20 +71938,20 @@ var require_node3 = __commonJS({
|
|
|
71938
71938
|
async create(params) {
|
|
71939
71939
|
var _a5, _b;
|
|
71940
71940
|
let response;
|
|
71941
|
-
let
|
|
71941
|
+
let path38 = "";
|
|
71942
71942
|
let queryParams = {};
|
|
71943
71943
|
if (this.apiClient.isVertexAI()) {
|
|
71944
71944
|
throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");
|
|
71945
71945
|
} else {
|
|
71946
71946
|
const body = createAuthTokenParametersToMldev(this.apiClient, params);
|
|
71947
|
-
|
|
71947
|
+
path38 = formatMap2("auth_tokens", body["_url"]);
|
|
71948
71948
|
queryParams = body["_query"];
|
|
71949
71949
|
delete body["config"];
|
|
71950
71950
|
delete body["_url"];
|
|
71951
71951
|
delete body["_query"];
|
|
71952
71952
|
const transformedBody = convertBidiSetupToTokenSetup(body, params.config);
|
|
71953
71953
|
response = this.apiClient.request({
|
|
71954
|
-
path:
|
|
71954
|
+
path: path38,
|
|
71955
71955
|
queryParams,
|
|
71956
71956
|
body: JSON.stringify(transformedBody),
|
|
71957
71957
|
httpMethod: "POST",
|
|
@@ -72061,18 +72061,18 @@ var require_node3 = __commonJS({
|
|
|
72061
72061
|
async get(params) {
|
|
72062
72062
|
var _a5, _b;
|
|
72063
72063
|
let response;
|
|
72064
|
-
let
|
|
72064
|
+
let path38 = "";
|
|
72065
72065
|
let queryParams = {};
|
|
72066
72066
|
if (this.apiClient.isVertexAI()) {
|
|
72067
72067
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72068
72068
|
} else {
|
|
72069
72069
|
const body = getDocumentParametersToMldev(params);
|
|
72070
|
-
|
|
72070
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
72071
72071
|
queryParams = body["_query"];
|
|
72072
72072
|
delete body["_url"];
|
|
72073
72073
|
delete body["_query"];
|
|
72074
72074
|
response = this.apiClient.request({
|
|
72075
|
-
path:
|
|
72075
|
+
path: path38,
|
|
72076
72076
|
queryParams,
|
|
72077
72077
|
body: JSON.stringify(body),
|
|
72078
72078
|
httpMethod: "GET",
|
|
@@ -72093,18 +72093,18 @@ var require_node3 = __commonJS({
|
|
|
72093
72093
|
*/
|
|
72094
72094
|
async delete(params) {
|
|
72095
72095
|
var _a5, _b;
|
|
72096
|
-
let
|
|
72096
|
+
let path38 = "";
|
|
72097
72097
|
let queryParams = {};
|
|
72098
72098
|
if (this.apiClient.isVertexAI()) {
|
|
72099
72099
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72100
72100
|
} else {
|
|
72101
72101
|
const body = deleteDocumentParametersToMldev(params);
|
|
72102
|
-
|
|
72102
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
72103
72103
|
queryParams = body["_query"];
|
|
72104
72104
|
delete body["_url"];
|
|
72105
72105
|
delete body["_query"];
|
|
72106
72106
|
await this.apiClient.request({
|
|
72107
|
-
path:
|
|
72107
|
+
path: path38,
|
|
72108
72108
|
queryParams,
|
|
72109
72109
|
body: JSON.stringify(body),
|
|
72110
72110
|
httpMethod: "DELETE",
|
|
@@ -72116,18 +72116,18 @@ var require_node3 = __commonJS({
|
|
|
72116
72116
|
async listInternal(params) {
|
|
72117
72117
|
var _a5, _b;
|
|
72118
72118
|
let response;
|
|
72119
|
-
let
|
|
72119
|
+
let path38 = "";
|
|
72120
72120
|
let queryParams = {};
|
|
72121
72121
|
if (this.apiClient.isVertexAI()) {
|
|
72122
72122
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72123
72123
|
} else {
|
|
72124
72124
|
const body = listDocumentsParametersToMldev(params);
|
|
72125
|
-
|
|
72125
|
+
path38 = formatMap2("{parent}/documents", body["_url"]);
|
|
72126
72126
|
queryParams = body["_query"];
|
|
72127
72127
|
delete body["_url"];
|
|
72128
72128
|
delete body["_query"];
|
|
72129
72129
|
response = this.apiClient.request({
|
|
72130
|
-
path:
|
|
72130
|
+
path: path38,
|
|
72131
72131
|
queryParams,
|
|
72132
72132
|
body: JSON.stringify(body),
|
|
72133
72133
|
httpMethod: "GET",
|
|
@@ -72244,18 +72244,18 @@ var require_node3 = __commonJS({
|
|
|
72244
72244
|
async create(params) {
|
|
72245
72245
|
var _a5, _b;
|
|
72246
72246
|
let response;
|
|
72247
|
-
let
|
|
72247
|
+
let path38 = "";
|
|
72248
72248
|
let queryParams = {};
|
|
72249
72249
|
if (this.apiClient.isVertexAI()) {
|
|
72250
72250
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72251
72251
|
} else {
|
|
72252
72252
|
const body = createFileSearchStoreParametersToMldev(this.apiClient, params);
|
|
72253
|
-
|
|
72253
|
+
path38 = formatMap2("fileSearchStores", body["_url"]);
|
|
72254
72254
|
queryParams = body["_query"];
|
|
72255
72255
|
delete body["_url"];
|
|
72256
72256
|
delete body["_query"];
|
|
72257
72257
|
response = this.apiClient.request({
|
|
72258
|
-
path:
|
|
72258
|
+
path: path38,
|
|
72259
72259
|
queryParams,
|
|
72260
72260
|
body: JSON.stringify(body),
|
|
72261
72261
|
httpMethod: "POST",
|
|
@@ -72278,18 +72278,18 @@ var require_node3 = __commonJS({
|
|
|
72278
72278
|
async get(params) {
|
|
72279
72279
|
var _a5, _b;
|
|
72280
72280
|
let response;
|
|
72281
|
-
let
|
|
72281
|
+
let path38 = "";
|
|
72282
72282
|
let queryParams = {};
|
|
72283
72283
|
if (this.apiClient.isVertexAI()) {
|
|
72284
72284
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72285
72285
|
} else {
|
|
72286
72286
|
const body = getFileSearchStoreParametersToMldev(params);
|
|
72287
|
-
|
|
72287
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
72288
72288
|
queryParams = body["_query"];
|
|
72289
72289
|
delete body["_url"];
|
|
72290
72290
|
delete body["_query"];
|
|
72291
72291
|
response = this.apiClient.request({
|
|
72292
|
-
path:
|
|
72292
|
+
path: path38,
|
|
72293
72293
|
queryParams,
|
|
72294
72294
|
body: JSON.stringify(body),
|
|
72295
72295
|
httpMethod: "GET",
|
|
@@ -72310,18 +72310,18 @@ var require_node3 = __commonJS({
|
|
|
72310
72310
|
*/
|
|
72311
72311
|
async delete(params) {
|
|
72312
72312
|
var _a5, _b;
|
|
72313
|
-
let
|
|
72313
|
+
let path38 = "";
|
|
72314
72314
|
let queryParams = {};
|
|
72315
72315
|
if (this.apiClient.isVertexAI()) {
|
|
72316
72316
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72317
72317
|
} else {
|
|
72318
72318
|
const body = deleteFileSearchStoreParametersToMldev(params);
|
|
72319
|
-
|
|
72319
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
72320
72320
|
queryParams = body["_query"];
|
|
72321
72321
|
delete body["_url"];
|
|
72322
72322
|
delete body["_query"];
|
|
72323
72323
|
await this.apiClient.request({
|
|
72324
|
-
path:
|
|
72324
|
+
path: path38,
|
|
72325
72325
|
queryParams,
|
|
72326
72326
|
body: JSON.stringify(body),
|
|
72327
72327
|
httpMethod: "DELETE",
|
|
@@ -72333,18 +72333,18 @@ var require_node3 = __commonJS({
|
|
|
72333
72333
|
async listInternal(params) {
|
|
72334
72334
|
var _a5, _b;
|
|
72335
72335
|
let response;
|
|
72336
|
-
let
|
|
72336
|
+
let path38 = "";
|
|
72337
72337
|
let queryParams = {};
|
|
72338
72338
|
if (this.apiClient.isVertexAI()) {
|
|
72339
72339
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72340
72340
|
} else {
|
|
72341
72341
|
const body = listFileSearchStoresParametersToMldev(params);
|
|
72342
|
-
|
|
72342
|
+
path38 = formatMap2("fileSearchStores", body["_url"]);
|
|
72343
72343
|
queryParams = body["_query"];
|
|
72344
72344
|
delete body["_url"];
|
|
72345
72345
|
delete body["_query"];
|
|
72346
72346
|
response = this.apiClient.request({
|
|
72347
|
-
path:
|
|
72347
|
+
path: path38,
|
|
72348
72348
|
queryParams,
|
|
72349
72349
|
body: JSON.stringify(body),
|
|
72350
72350
|
httpMethod: "GET",
|
|
@@ -72364,18 +72364,18 @@ var require_node3 = __commonJS({
|
|
|
72364
72364
|
async uploadToFileSearchStoreInternal(params) {
|
|
72365
72365
|
var _a5, _b;
|
|
72366
72366
|
let response;
|
|
72367
|
-
let
|
|
72367
|
+
let path38 = "";
|
|
72368
72368
|
let queryParams = {};
|
|
72369
72369
|
if (this.apiClient.isVertexAI()) {
|
|
72370
72370
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72371
72371
|
} else {
|
|
72372
72372
|
const body = uploadToFileSearchStoreParametersToMldev(params);
|
|
72373
|
-
|
|
72373
|
+
path38 = formatMap2("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore", body["_url"]);
|
|
72374
72374
|
queryParams = body["_query"];
|
|
72375
72375
|
delete body["_url"];
|
|
72376
72376
|
delete body["_query"];
|
|
72377
72377
|
response = this.apiClient.request({
|
|
72378
|
-
path:
|
|
72378
|
+
path: path38,
|
|
72379
72379
|
queryParams,
|
|
72380
72380
|
body: JSON.stringify(body),
|
|
72381
72381
|
httpMethod: "POST",
|
|
@@ -72403,18 +72403,18 @@ var require_node3 = __commonJS({
|
|
|
72403
72403
|
async importFile(params) {
|
|
72404
72404
|
var _a5, _b;
|
|
72405
72405
|
let response;
|
|
72406
|
-
let
|
|
72406
|
+
let path38 = "";
|
|
72407
72407
|
let queryParams = {};
|
|
72408
72408
|
if (this.apiClient.isVertexAI()) {
|
|
72409
72409
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
72410
72410
|
} else {
|
|
72411
72411
|
const body = importFileParametersToMldev(params);
|
|
72412
|
-
|
|
72412
|
+
path38 = formatMap2("{file_search_store_name}:importFile", body["_url"]);
|
|
72413
72413
|
queryParams = body["_query"];
|
|
72414
72414
|
delete body["_url"];
|
|
72415
72415
|
delete body["_query"];
|
|
72416
72416
|
response = this.apiClient.request({
|
|
72417
|
-
path:
|
|
72417
|
+
path: path38,
|
|
72418
72418
|
queryParams,
|
|
72419
72419
|
body: JSON.stringify(body),
|
|
72420
72420
|
httpMethod: "POST",
|
|
@@ -72777,12 +72777,12 @@ var require_node3 = __commonJS({
|
|
|
72777
72777
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
72778
72778
|
}
|
|
72779
72779
|
var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
72780
|
-
var createPathTagFunction = (pathEncoder = encodeURIPath) => (function
|
|
72780
|
+
var createPathTagFunction = (pathEncoder = encodeURIPath) => (function path38(statics, ...params) {
|
|
72781
72781
|
if (statics.length === 1)
|
|
72782
72782
|
return statics[0];
|
|
72783
72783
|
let postPath = false;
|
|
72784
72784
|
const invalidSegments = [];
|
|
72785
|
-
const
|
|
72785
|
+
const path39 = statics.reduce((previousValue, currentValue, index) => {
|
|
72786
72786
|
var _a5, _b, _c6;
|
|
72787
72787
|
if (/[?#]/.test(currentValue)) {
|
|
72788
72788
|
postPath = true;
|
|
@@ -72800,7 +72800,7 @@ var require_node3 = __commonJS({
|
|
|
72800
72800
|
}
|
|
72801
72801
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
72802
72802
|
}, "");
|
|
72803
|
-
const pathOnly =
|
|
72803
|
+
const pathOnly = path39.split(/[?#]/, 1)[0];
|
|
72804
72804
|
const invalidSegmentPattern = /(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
72805
72805
|
let match2;
|
|
72806
72806
|
while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -72824,12 +72824,12 @@ var require_node3 = __commonJS({
|
|
|
72824
72824
|
}, "");
|
|
72825
72825
|
throw new GeminiNextGenAPIClientError(`Path parameters result in path with invalid segments:
|
|
72826
72826
|
${invalidSegments.map((e7) => e7.error).join("\n")}
|
|
72827
|
-
${
|
|
72827
|
+
${path39}
|
|
72828
72828
|
${underline}`);
|
|
72829
72829
|
}
|
|
72830
|
-
return
|
|
72830
|
+
return path39;
|
|
72831
72831
|
});
|
|
72832
|
-
var
|
|
72832
|
+
var path37 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
72833
72833
|
var BaseInteractions = class extends APIResource {
|
|
72834
72834
|
create(params, options) {
|
|
72835
72835
|
var _a5;
|
|
@@ -72840,7 +72840,7 @@ ${underline}`);
|
|
|
72840
72840
|
if ("agent" in body && "generation_config" in body) {
|
|
72841
72841
|
throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
|
|
72842
72842
|
}
|
|
72843
|
-
return this._client.post(
|
|
72843
|
+
return this._client.post(path37`/${api_version}/interactions`, Object.assign(Object.assign({ body }, options), { stream: (_a5 = params.stream) !== null && _a5 !== void 0 ? _a5 : false }));
|
|
72844
72844
|
}
|
|
72845
72845
|
/**
|
|
72846
72846
|
* Deletes the interaction by id.
|
|
@@ -72854,7 +72854,7 @@ ${underline}`);
|
|
|
72854
72854
|
*/
|
|
72855
72855
|
delete(id, params = {}, options) {
|
|
72856
72856
|
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
72857
|
-
return this._client.delete(
|
|
72857
|
+
return this._client.delete(path37`/${api_version}/interactions/${id}`, options);
|
|
72858
72858
|
}
|
|
72859
72859
|
/**
|
|
72860
72860
|
* Cancels an interaction by id. This only applies to background interactions that
|
|
@@ -72869,12 +72869,12 @@ ${underline}`);
|
|
|
72869
72869
|
*/
|
|
72870
72870
|
cancel(id, params = {}, options) {
|
|
72871
72871
|
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
72872
|
-
return this._client.post(
|
|
72872
|
+
return this._client.post(path37`/${api_version}/interactions/${id}/cancel`, options);
|
|
72873
72873
|
}
|
|
72874
72874
|
get(id, params = {}, options) {
|
|
72875
72875
|
var _a5;
|
|
72876
72876
|
const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest2(_b, ["api_version"]);
|
|
72877
|
-
return this._client.get(
|
|
72877
|
+
return this._client.get(path37`/${api_version}/interactions/${id}`, Object.assign(Object.assign({ query }, options), { stream: (_a5 = params === null || params === void 0 ? void 0 : params.stream) !== null && _a5 !== void 0 ? _a5 : false }));
|
|
72878
72878
|
}
|
|
72879
72879
|
};
|
|
72880
72880
|
BaseInteractions._key = Object.freeze(["interactions"]);
|
|
@@ -72886,49 +72886,49 @@ ${underline}`);
|
|
|
72886
72886
|
*/
|
|
72887
72887
|
create(params, options) {
|
|
72888
72888
|
const { api_version = this._client.apiVersion } = params, body = __rest2(params, ["api_version"]);
|
|
72889
|
-
return this._client.post(
|
|
72889
|
+
return this._client.post(path37`/${api_version}/webhooks`, Object.assign({ body }, options));
|
|
72890
72890
|
}
|
|
72891
72891
|
/**
|
|
72892
72892
|
* Updates an existing Webhook.
|
|
72893
72893
|
*/
|
|
72894
72894
|
update(id, params = {}, options) {
|
|
72895
72895
|
const _a5 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a5, body = __rest2(_a5, ["api_version", "update_mask"]);
|
|
72896
|
-
return this._client.patch(
|
|
72896
|
+
return this._client.patch(path37`/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
|
|
72897
72897
|
}
|
|
72898
72898
|
/**
|
|
72899
72899
|
* Lists all Webhooks.
|
|
72900
72900
|
*/
|
|
72901
72901
|
list(params = {}, options) {
|
|
72902
72902
|
const _a5 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a5, query = __rest2(_a5, ["api_version"]);
|
|
72903
|
-
return this._client.get(
|
|
72903
|
+
return this._client.get(path37`/${api_version}/webhooks`, Object.assign({ query }, options));
|
|
72904
72904
|
}
|
|
72905
72905
|
/**
|
|
72906
72906
|
* Deletes a Webhook.
|
|
72907
72907
|
*/
|
|
72908
72908
|
delete(id, params = {}, options) {
|
|
72909
72909
|
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
72910
|
-
return this._client.delete(
|
|
72910
|
+
return this._client.delete(path37`/${api_version}/webhooks/${id}`, options);
|
|
72911
72911
|
}
|
|
72912
72912
|
/**
|
|
72913
72913
|
* Gets a specific Webhook.
|
|
72914
72914
|
*/
|
|
72915
72915
|
get(id, params = {}, options) {
|
|
72916
72916
|
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
72917
|
-
return this._client.get(
|
|
72917
|
+
return this._client.get(path37`/${api_version}/webhooks/${id}`, options);
|
|
72918
72918
|
}
|
|
72919
72919
|
/**
|
|
72920
72920
|
* Sends a ping event to a Webhook.
|
|
72921
72921
|
*/
|
|
72922
72922
|
ping(id, params = void 0, options) {
|
|
72923
72923
|
const { api_version = this._client.apiVersion, body } = params !== null && params !== void 0 ? params : {};
|
|
72924
|
-
return this._client.post(
|
|
72924
|
+
return this._client.post(path37`/${api_version}/webhooks/${id}:ping`, Object.assign({ body }, options));
|
|
72925
72925
|
}
|
|
72926
72926
|
/**
|
|
72927
72927
|
* Generates a new signing secret for a Webhook.
|
|
72928
72928
|
*/
|
|
72929
72929
|
rotateSigningSecret(id, params = {}, options) {
|
|
72930
72930
|
const _a5 = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _a5, body = __rest2(_a5, ["api_version"]);
|
|
72931
|
-
return this._client.post(
|
|
72931
|
+
return this._client.post(path37`/${api_version}/webhooks/${id}:rotateSigningSecret`, Object.assign({ body }, options));
|
|
72932
72932
|
}
|
|
72933
72933
|
};
|
|
72934
72934
|
BaseWebhooks._key = Object.freeze(["webhooks"]);
|
|
@@ -73659,9 +73659,9 @@ ${underline}`);
|
|
|
73659
73659
|
makeStatusError(status, error3, message, headers) {
|
|
73660
73660
|
return APIError.generate(status, error3, message, headers);
|
|
73661
73661
|
}
|
|
73662
|
-
buildURL(
|
|
73662
|
+
buildURL(path38, query, defaultBaseURL) {
|
|
73663
73663
|
const baseURL = !this.baseURLOverridden() && defaultBaseURL || this.baseURL;
|
|
73664
|
-
const url2 = isAbsoluteURL(
|
|
73664
|
+
const url2 = isAbsoluteURL(path38) ? new URL(path38) : new URL(baseURL + (baseURL.endsWith("/") && path38.startsWith("/") ? path38.slice(1) : path38));
|
|
73665
73665
|
const defaultQuery = this.defaultQuery();
|
|
73666
73666
|
const pathQuery = Object.fromEntries(url2.searchParams);
|
|
73667
73667
|
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
@@ -73690,24 +73690,24 @@ ${underline}`);
|
|
|
73690
73690
|
*/
|
|
73691
73691
|
async prepareRequest(request, { url: url2, options }) {
|
|
73692
73692
|
}
|
|
73693
|
-
get(
|
|
73694
|
-
return this.methodRequest("get",
|
|
73693
|
+
get(path38, opts) {
|
|
73694
|
+
return this.methodRequest("get", path38, opts);
|
|
73695
73695
|
}
|
|
73696
|
-
post(
|
|
73697
|
-
return this.methodRequest("post",
|
|
73696
|
+
post(path38, opts) {
|
|
73697
|
+
return this.methodRequest("post", path38, opts);
|
|
73698
73698
|
}
|
|
73699
|
-
patch(
|
|
73700
|
-
return this.methodRequest("patch",
|
|
73699
|
+
patch(path38, opts) {
|
|
73700
|
+
return this.methodRequest("patch", path38, opts);
|
|
73701
73701
|
}
|
|
73702
|
-
put(
|
|
73703
|
-
return this.methodRequest("put",
|
|
73702
|
+
put(path38, opts) {
|
|
73703
|
+
return this.methodRequest("put", path38, opts);
|
|
73704
73704
|
}
|
|
73705
|
-
delete(
|
|
73706
|
-
return this.methodRequest("delete",
|
|
73705
|
+
delete(path38, opts) {
|
|
73706
|
+
return this.methodRequest("delete", path38, opts);
|
|
73707
73707
|
}
|
|
73708
|
-
methodRequest(method,
|
|
73708
|
+
methodRequest(method, path38, opts) {
|
|
73709
73709
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
73710
|
-
return Object.assign({ method, path:
|
|
73710
|
+
return Object.assign({ method, path: path38 }, opts2);
|
|
73711
73711
|
}));
|
|
73712
73712
|
}
|
|
73713
73713
|
request(options, remainingRetries = null) {
|
|
@@ -73881,8 +73881,8 @@ ${underline}`);
|
|
|
73881
73881
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
73882
73882
|
var _b, _c6, _d;
|
|
73883
73883
|
const options = Object.assign({}, inputOptions);
|
|
73884
|
-
const { method, path:
|
|
73885
|
-
const url2 = this.buildURL(
|
|
73884
|
+
const { method, path: path38, query, defaultBaseURL } = options;
|
|
73885
|
+
const url2 = this.buildURL(path38, query, defaultBaseURL);
|
|
73886
73886
|
if ("timeout" in options)
|
|
73887
73887
|
validatePositiveInteger("timeout", options.timeout);
|
|
73888
73888
|
options.timeout = (_b = options.timeout) !== null && _b !== void 0 ? _b : this.timeout;
|
|
@@ -74032,7 +74032,7 @@ ${underline}`);
|
|
|
74032
74032
|
if (params.downloadPath) {
|
|
74033
74033
|
const response = await downloadFile(params, apiClient);
|
|
74034
74034
|
if (response instanceof HttpResponse2) {
|
|
74035
|
-
const writer =
|
|
74035
|
+
const writer = fs20.createWriteStream(params.downloadPath);
|
|
74036
74036
|
const body = node_stream.Readable.fromWeb(response.responseInternal.body);
|
|
74037
74037
|
body.pipe(writer);
|
|
74038
74038
|
await promises.finished(writer);
|
|
@@ -74976,16 +74976,16 @@ ${underline}`);
|
|
|
74976
74976
|
async getInternal(params) {
|
|
74977
74977
|
var _a5, _b, _c6, _d;
|
|
74978
74978
|
let response;
|
|
74979
|
-
let
|
|
74979
|
+
let path38 = "";
|
|
74980
74980
|
let queryParams = {};
|
|
74981
74981
|
if (this.apiClient.isVertexAI()) {
|
|
74982
74982
|
const body = getTuningJobParametersToVertex(params);
|
|
74983
|
-
|
|
74983
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
74984
74984
|
queryParams = body["_query"];
|
|
74985
74985
|
delete body["_url"];
|
|
74986
74986
|
delete body["_query"];
|
|
74987
74987
|
response = this.apiClient.request({
|
|
74988
|
-
path:
|
|
74988
|
+
path: path38,
|
|
74989
74989
|
queryParams,
|
|
74990
74990
|
body: JSON.stringify(body),
|
|
74991
74991
|
httpMethod: "GET",
|
|
@@ -75006,12 +75006,12 @@ ${underline}`);
|
|
|
75006
75006
|
});
|
|
75007
75007
|
} else {
|
|
75008
75008
|
const body = getTuningJobParametersToMldev(params);
|
|
75009
|
-
|
|
75009
|
+
path38 = formatMap2("{name}", body["_url"]);
|
|
75010
75010
|
queryParams = body["_query"];
|
|
75011
75011
|
delete body["_url"];
|
|
75012
75012
|
delete body["_query"];
|
|
75013
75013
|
response = this.apiClient.request({
|
|
75014
|
-
path:
|
|
75014
|
+
path: path38,
|
|
75015
75015
|
queryParams,
|
|
75016
75016
|
body: JSON.stringify(body),
|
|
75017
75017
|
httpMethod: "GET",
|
|
@@ -75035,16 +75035,16 @@ ${underline}`);
|
|
|
75035
75035
|
async listInternal(params) {
|
|
75036
75036
|
var _a5, _b;
|
|
75037
75037
|
let response;
|
|
75038
|
-
let
|
|
75038
|
+
let path38 = "";
|
|
75039
75039
|
let queryParams = {};
|
|
75040
75040
|
if (this.apiClient.isVertexAI()) {
|
|
75041
75041
|
const body = listTuningJobsParametersToVertex(params);
|
|
75042
|
-
|
|
75042
|
+
path38 = formatMap2("tuningJobs", body["_url"]);
|
|
75043
75043
|
queryParams = body["_query"];
|
|
75044
75044
|
delete body["_url"];
|
|
75045
75045
|
delete body["_query"];
|
|
75046
75046
|
response = this.apiClient.request({
|
|
75047
|
-
path:
|
|
75047
|
+
path: path38,
|
|
75048
75048
|
queryParams,
|
|
75049
75049
|
body: JSON.stringify(body),
|
|
75050
75050
|
httpMethod: "GET",
|
|
@@ -75083,16 +75083,16 @@ ${underline}`);
|
|
|
75083
75083
|
async cancel(params) {
|
|
75084
75084
|
var _a5, _b, _c6, _d;
|
|
75085
75085
|
let response;
|
|
75086
|
-
let
|
|
75086
|
+
let path38 = "";
|
|
75087
75087
|
let queryParams = {};
|
|
75088
75088
|
if (this.apiClient.isVertexAI()) {
|
|
75089
75089
|
const body = cancelTuningJobParametersToVertex(params);
|
|
75090
|
-
|
|
75090
|
+
path38 = formatMap2("{name}:cancel", body["_url"]);
|
|
75091
75091
|
queryParams = body["_query"];
|
|
75092
75092
|
delete body["_url"];
|
|
75093
75093
|
delete body["_query"];
|
|
75094
75094
|
response = this.apiClient.request({
|
|
75095
|
-
path:
|
|
75095
|
+
path: path38,
|
|
75096
75096
|
queryParams,
|
|
75097
75097
|
body: JSON.stringify(body),
|
|
75098
75098
|
httpMethod: "POST",
|
|
@@ -75115,12 +75115,12 @@ ${underline}`);
|
|
|
75115
75115
|
});
|
|
75116
75116
|
} else {
|
|
75117
75117
|
const body = cancelTuningJobParametersToMldev(params);
|
|
75118
|
-
|
|
75118
|
+
path38 = formatMap2("{name}:cancel", body["_url"]);
|
|
75119
75119
|
queryParams = body["_query"];
|
|
75120
75120
|
delete body["_url"];
|
|
75121
75121
|
delete body["_query"];
|
|
75122
75122
|
response = this.apiClient.request({
|
|
75123
|
-
path:
|
|
75123
|
+
path: path38,
|
|
75124
75124
|
queryParams,
|
|
75125
75125
|
body: JSON.stringify(body),
|
|
75126
75126
|
httpMethod: "POST",
|
|
@@ -75146,16 +75146,16 @@ ${underline}`);
|
|
|
75146
75146
|
async tuneInternal(params) {
|
|
75147
75147
|
var _a5, _b;
|
|
75148
75148
|
let response;
|
|
75149
|
-
let
|
|
75149
|
+
let path38 = "";
|
|
75150
75150
|
let queryParams = {};
|
|
75151
75151
|
if (this.apiClient.isVertexAI()) {
|
|
75152
75152
|
const body = createTuningJobParametersPrivateToVertex(params, params);
|
|
75153
|
-
|
|
75153
|
+
path38 = formatMap2("tuningJobs", body["_url"]);
|
|
75154
75154
|
queryParams = body["_query"];
|
|
75155
75155
|
delete body["_url"];
|
|
75156
75156
|
delete body["_query"];
|
|
75157
75157
|
response = this.apiClient.request({
|
|
75158
|
-
path:
|
|
75158
|
+
path: path38,
|
|
75159
75159
|
queryParams,
|
|
75160
75160
|
body: JSON.stringify(body),
|
|
75161
75161
|
httpMethod: "POST",
|
|
@@ -75181,18 +75181,18 @@ ${underline}`);
|
|
|
75181
75181
|
async tuneMldevInternal(params) {
|
|
75182
75182
|
var _a5, _b;
|
|
75183
75183
|
let response;
|
|
75184
|
-
let
|
|
75184
|
+
let path38 = "";
|
|
75185
75185
|
let queryParams = {};
|
|
75186
75186
|
if (this.apiClient.isVertexAI()) {
|
|
75187
75187
|
throw new Error("This method is only supported by the Gemini Developer API.");
|
|
75188
75188
|
} else {
|
|
75189
75189
|
const body = createTuningJobParametersPrivateToMldev(params);
|
|
75190
|
-
|
|
75190
|
+
path38 = formatMap2("tunedModels", body["_url"]);
|
|
75191
75191
|
queryParams = body["_query"];
|
|
75192
75192
|
delete body["_url"];
|
|
75193
75193
|
delete body["_query"];
|
|
75194
75194
|
response = this.apiClient.request({
|
|
75195
|
-
path:
|
|
75195
|
+
path: path38,
|
|
75196
75196
|
queryParams,
|
|
75197
75197
|
body: JSON.stringify(body),
|
|
75198
75198
|
httpMethod: "POST",
|
|
@@ -75828,7 +75828,7 @@ var require_client = __commonJS({
|
|
|
75828
75828
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75829
75829
|
exports.Gemini3_8Client = void 0;
|
|
75830
75830
|
var genai_1 = require_node3();
|
|
75831
|
-
var
|
|
75831
|
+
var path37 = __importStar2(__require("path"));
|
|
75832
75832
|
var baseClient_1 = require_baseClient();
|
|
75833
75833
|
var errors_1 = require_errors2();
|
|
75834
75834
|
var types_1 = require_types2();
|
|
@@ -75895,7 +75895,7 @@ var require_client = __commonJS({
|
|
|
75895
75895
|
* Detect MIME type from URL extension for image.
|
|
75896
75896
|
*/
|
|
75897
75897
|
_detectImageMimeType(url2) {
|
|
75898
|
-
const ext =
|
|
75898
|
+
const ext = path37.extname(url2).toLowerCase();
|
|
75899
75899
|
const mimeTypes = {
|
|
75900
75900
|
".bmp": "image/bmp",
|
|
75901
75901
|
".gif": "image/gif",
|
|
@@ -78221,12 +78221,12 @@ var require_path = __commonJS({
|
|
|
78221
78221
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
78222
78222
|
}
|
|
78223
78223
|
var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
78224
|
-
var createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
78224
|
+
var createPathTagFunction = (pathEncoder = encodeURIPath) => function path37(statics, ...params) {
|
|
78225
78225
|
if (statics.length === 1)
|
|
78226
78226
|
return statics[0];
|
|
78227
78227
|
let postPath = false;
|
|
78228
78228
|
const invalidSegments = [];
|
|
78229
|
-
const
|
|
78229
|
+
const path38 = statics.reduce((previousValue, currentValue, index) => {
|
|
78230
78230
|
if (/[?#]/.test(currentValue)) {
|
|
78231
78231
|
postPath = true;
|
|
78232
78232
|
}
|
|
@@ -78243,7 +78243,7 @@ var require_path = __commonJS({
|
|
|
78243
78243
|
}
|
|
78244
78244
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
78245
78245
|
}, "");
|
|
78246
|
-
const pathOnly =
|
|
78246
|
+
const pathOnly = path38.split(/[?#]/, 1)[0];
|
|
78247
78247
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
78248
78248
|
let match2;
|
|
78249
78249
|
while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -78264,10 +78264,10 @@ var require_path = __commonJS({
|
|
|
78264
78264
|
}, "");
|
|
78265
78265
|
throw new error_1.AnthropicError(`Path parameters result in path with invalid segments:
|
|
78266
78266
|
${invalidSegments.map((e7) => e7.error).join("\n")}
|
|
78267
|
-
${
|
|
78267
|
+
${path38}
|
|
78268
78268
|
${underline}`);
|
|
78269
78269
|
}
|
|
78270
|
-
return
|
|
78270
|
+
return path38;
|
|
78271
78271
|
};
|
|
78272
78272
|
exports.createPathTagFunction = createPathTagFunction;
|
|
78273
78273
|
exports.path = (0, exports.createPathTagFunction)(encodeURIPath);
|
|
@@ -81726,9 +81726,9 @@ var require_client2 = __commonJS({
|
|
|
81726
81726
|
makeStatusError(status, error3, message, headers) {
|
|
81727
81727
|
return Errors.APIError.generate(status, error3, message, headers);
|
|
81728
81728
|
}
|
|
81729
|
-
buildURL(
|
|
81729
|
+
buildURL(path37, query, defaultBaseURL) {
|
|
81730
81730
|
const baseURL = !tslib_1.__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
81731
|
-
const url2 = (0, values_1.isAbsoluteURL)(
|
|
81731
|
+
const url2 = (0, values_1.isAbsoluteURL)(path37) ? new URL(path37) : new URL(baseURL + (baseURL.endsWith("/") && path37.startsWith("/") ? path37.slice(1) : path37));
|
|
81732
81732
|
const defaultQuery = this.defaultQuery();
|
|
81733
81733
|
const pathQuery = Object.fromEntries(url2.searchParams);
|
|
81734
81734
|
if (!(0, values_2.isEmptyObj)(defaultQuery) || !(0, values_2.isEmptyObj)(pathQuery)) {
|
|
@@ -81760,24 +81760,24 @@ var require_client2 = __commonJS({
|
|
|
81760
81760
|
*/
|
|
81761
81761
|
async prepareRequest(request, { url: url2, options }) {
|
|
81762
81762
|
}
|
|
81763
|
-
get(
|
|
81764
|
-
return this.methodRequest("get",
|
|
81763
|
+
get(path37, opts) {
|
|
81764
|
+
return this.methodRequest("get", path37, opts);
|
|
81765
81765
|
}
|
|
81766
|
-
post(
|
|
81767
|
-
return this.methodRequest("post",
|
|
81766
|
+
post(path37, opts) {
|
|
81767
|
+
return this.methodRequest("post", path37, opts);
|
|
81768
81768
|
}
|
|
81769
|
-
patch(
|
|
81770
|
-
return this.methodRequest("patch",
|
|
81769
|
+
patch(path37, opts) {
|
|
81770
|
+
return this.methodRequest("patch", path37, opts);
|
|
81771
81771
|
}
|
|
81772
|
-
put(
|
|
81773
|
-
return this.methodRequest("put",
|
|
81772
|
+
put(path37, opts) {
|
|
81773
|
+
return this.methodRequest("put", path37, opts);
|
|
81774
81774
|
}
|
|
81775
|
-
delete(
|
|
81776
|
-
return this.methodRequest("delete",
|
|
81775
|
+
delete(path37, opts) {
|
|
81776
|
+
return this.methodRequest("delete", path37, opts);
|
|
81777
81777
|
}
|
|
81778
|
-
methodRequest(method,
|
|
81778
|
+
methodRequest(method, path37, opts) {
|
|
81779
81779
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
81780
|
-
return { method, path:
|
|
81780
|
+
return { method, path: path37, ...opts2 };
|
|
81781
81781
|
}));
|
|
81782
81782
|
}
|
|
81783
81783
|
request(options, remainingRetries = null) {
|
|
@@ -81881,8 +81881,8 @@ var require_client2 = __commonJS({
|
|
|
81881
81881
|
}));
|
|
81882
81882
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
81883
81883
|
}
|
|
81884
|
-
getAPIList(
|
|
81885
|
-
return this.requestAPIList(Page, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path:
|
|
81884
|
+
getAPIList(path37, Page, opts) {
|
|
81885
|
+
return this.requestAPIList(Page, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path37, ...opts2 })) : { method: "get", path: path37, ...opts });
|
|
81886
81886
|
}
|
|
81887
81887
|
requestAPIList(Page, options) {
|
|
81888
81888
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -81970,8 +81970,8 @@ var require_client2 = __commonJS({
|
|
|
81970
81970
|
}
|
|
81971
81971
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
81972
81972
|
const options = { ...inputOptions };
|
|
81973
|
-
const { method, path:
|
|
81974
|
-
const url2 = this.buildURL(
|
|
81973
|
+
const { method, path: path37, query, defaultBaseURL } = options;
|
|
81974
|
+
const url2 = this.buildURL(path37, query, defaultBaseURL);
|
|
81975
81975
|
if ("timeout" in options)
|
|
81976
81976
|
(0, values_1.validatePositiveInteger)("timeout", options.timeout);
|
|
81977
81977
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -84685,14 +84685,14 @@ var init_readFile = __esm({
|
|
|
84685
84685
|
"../../../node_modules/.pnpm/@smithy+core@3.35.1/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/readFile.js"() {
|
|
84686
84686
|
filePromises = {};
|
|
84687
84687
|
fileIntercept = {};
|
|
84688
|
-
readFile2 = (
|
|
84689
|
-
if (fileIntercept[
|
|
84690
|
-
return fileIntercept[
|
|
84688
|
+
readFile2 = (path37, options) => {
|
|
84689
|
+
if (fileIntercept[path37] !== void 0) {
|
|
84690
|
+
return fileIntercept[path37];
|
|
84691
84691
|
}
|
|
84692
|
-
if (!filePromises[
|
|
84693
|
-
filePromises[
|
|
84692
|
+
if (!filePromises[path37] || options?.ignoreCache) {
|
|
84693
|
+
filePromises[path37] = fsReadFile(path37, "utf8");
|
|
84694
84694
|
}
|
|
84695
|
-
return filePromises[
|
|
84695
|
+
return filePromises[path37];
|
|
84696
84696
|
};
|
|
84697
84697
|
}
|
|
84698
84698
|
});
|
|
@@ -84804,8 +84804,8 @@ var init_externalDataInterceptor = __esm({
|
|
|
84804
84804
|
getFileRecord() {
|
|
84805
84805
|
return fileIntercept;
|
|
84806
84806
|
},
|
|
84807
|
-
interceptFile(
|
|
84808
|
-
fileIntercept[
|
|
84807
|
+
interceptFile(path37, contents) {
|
|
84808
|
+
fileIntercept[path37] = Promise.resolve(contents);
|
|
84809
84809
|
},
|
|
84810
84810
|
getTokenRecord() {
|
|
84811
84811
|
return tokenIntercept;
|
|
@@ -87791,8 +87791,8 @@ var init_createConfigValueProvider = __esm({
|
|
|
87791
87791
|
return endpoint.url.href;
|
|
87792
87792
|
}
|
|
87793
87793
|
if ("hostname" in endpoint) {
|
|
87794
|
-
const { protocol, hostname, port, path:
|
|
87795
|
-
return `${protocol}//${hostname}${port ? ":" + port : ""}${
|
|
87794
|
+
const { protocol, hostname, port, path: path37 } = endpoint;
|
|
87795
|
+
return `${protocol}//${hostname}${port ? ":" + port : ""}${path37}`;
|
|
87796
87796
|
}
|
|
87797
87797
|
}
|
|
87798
87798
|
return endpoint;
|
|
@@ -88167,18 +88167,18 @@ var getAttrPathList;
|
|
|
88167
88167
|
var init_getAttrPathList = __esm({
|
|
88168
88168
|
"../../../node_modules/.pnpm/@smithy+core@3.35.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js"() {
|
|
88169
88169
|
init_types2();
|
|
88170
|
-
getAttrPathList = (
|
|
88171
|
-
const parts =
|
|
88170
|
+
getAttrPathList = (path37) => {
|
|
88171
|
+
const parts = path37.split(".");
|
|
88172
88172
|
const pathList = [];
|
|
88173
88173
|
for (const part of parts) {
|
|
88174
88174
|
const squareBracketIndex = part.indexOf("[");
|
|
88175
88175
|
if (squareBracketIndex !== -1) {
|
|
88176
88176
|
if (part.indexOf("]") !== part.length - 1) {
|
|
88177
|
-
throw new EndpointError(`Path: '${
|
|
88177
|
+
throw new EndpointError(`Path: '${path37}' does not end with ']'`);
|
|
88178
88178
|
}
|
|
88179
88179
|
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
88180
88180
|
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
88181
|
-
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${
|
|
88181
|
+
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path37}'`);
|
|
88182
88182
|
}
|
|
88183
88183
|
if (squareBracketIndex !== 0) {
|
|
88184
88184
|
pathList.push(part.slice(0, squareBracketIndex));
|
|
@@ -88199,9 +88199,9 @@ var init_getAttr = __esm({
|
|
|
88199
88199
|
"../../../node_modules/.pnpm/@smithy+core@3.35.1/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js"() {
|
|
88200
88200
|
init_types2();
|
|
88201
88201
|
init_getAttrPathList();
|
|
88202
|
-
getAttr = (value,
|
|
88202
|
+
getAttr = (value, path37) => getAttrPathList(path37).reduce((acc, index) => {
|
|
88203
88203
|
if (typeof acc !== "object") {
|
|
88204
|
-
throw new EndpointError(`Index '${index}' in '${
|
|
88204
|
+
throw new EndpointError(`Index '${index}' in '${path37}' not found in '${JSON.stringify(value)}'`);
|
|
88205
88205
|
} else if (Array.isArray(acc)) {
|
|
88206
88206
|
const i7 = parseInt(index);
|
|
88207
88207
|
return acc[i7 < 0 ? acc.length + i7 : i7];
|
|
@@ -88262,8 +88262,8 @@ var init_parseURL = __esm({
|
|
|
88262
88262
|
return value;
|
|
88263
88263
|
}
|
|
88264
88264
|
if (typeof value === "object" && "hostname" in value) {
|
|
88265
|
-
const { hostname: hostname2, port, protocol: protocol2 = "", path:
|
|
88266
|
-
const url2 = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${
|
|
88265
|
+
const { hostname: hostname2, port, protocol: protocol2 = "", path: path37 = "", query = {} } = value;
|
|
88266
|
+
const url2 = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path37}`);
|
|
88267
88267
|
url2.search = Object.entries(query).map(([k6, v]) => `${k6}=${v}`).join("&");
|
|
88268
88268
|
return url2;
|
|
88269
88269
|
}
|
|
@@ -91957,11 +91957,11 @@ var init_HttpBindingProtocol = __esm({
|
|
|
91957
91957
|
const opTraits = translateTraits(operationSchema.traits);
|
|
91958
91958
|
if (opTraits.http) {
|
|
91959
91959
|
request.method = opTraits.http[0];
|
|
91960
|
-
const [
|
|
91960
|
+
const [path37, search] = opTraits.http[1].split("?");
|
|
91961
91961
|
if (request.path == "/") {
|
|
91962
|
-
request.path =
|
|
91962
|
+
request.path = path37;
|
|
91963
91963
|
} else {
|
|
91964
|
-
request.path +=
|
|
91964
|
+
request.path += path37;
|
|
91965
91965
|
}
|
|
91966
91966
|
const traitSearchParams = new URLSearchParams(search ?? "");
|
|
91967
91967
|
for (const [key, value] of traitSearchParams) {
|
|
@@ -92372,8 +92372,8 @@ var init_requestBuilder = __esm({
|
|
|
92372
92372
|
return this;
|
|
92373
92373
|
}
|
|
92374
92374
|
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
|
92375
|
-
this.resolvePathStack.push((
|
|
92376
|
-
this.path = resolvedPath(
|
|
92375
|
+
this.resolvePathStack.push((path37) => {
|
|
92376
|
+
this.path = resolvedPath(path37, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
|
92377
92377
|
});
|
|
92378
92378
|
return this;
|
|
92379
92379
|
}
|
|
@@ -92967,13 +92967,13 @@ var require_dist_cjs3 = __commonJS({
|
|
|
92967
92967
|
const abortError2 = buildAbortError(abortSignal);
|
|
92968
92968
|
return Promise.reject(abortError2);
|
|
92969
92969
|
}
|
|
92970
|
-
let
|
|
92970
|
+
let path37 = request.path;
|
|
92971
92971
|
const queryString = buildQueryString2(request.query || {});
|
|
92972
92972
|
if (queryString) {
|
|
92973
|
-
|
|
92973
|
+
path37 += `?${queryString}`;
|
|
92974
92974
|
}
|
|
92975
92975
|
if (request.fragment) {
|
|
92976
|
-
|
|
92976
|
+
path37 += `#${request.fragment}`;
|
|
92977
92977
|
}
|
|
92978
92978
|
let auth2 = "";
|
|
92979
92979
|
if (request.username != null || request.password != null) {
|
|
@@ -92982,7 +92982,7 @@ var require_dist_cjs3 = __commonJS({
|
|
|
92982
92982
|
auth2 = `${username}:${password}@`;
|
|
92983
92983
|
}
|
|
92984
92984
|
const { port, method } = request;
|
|
92985
|
-
const url2 = `${request.protocol}//${auth2}${request.hostname}${port ? `:${port}` : ""}${
|
|
92985
|
+
const url2 = `${request.protocol}//${auth2}${request.hostname}${port ? `:${port}` : ""}${path37}`;
|
|
92986
92986
|
const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
|
|
92987
92987
|
const requestOptions = {
|
|
92988
92988
|
body,
|
|
@@ -94328,10 +94328,10 @@ ${longDate}
|
|
|
94328
94328
|
${credentialScope}
|
|
94329
94329
|
${(0, import_util_hex_encoding.toHex)(hashedRequest)}`;
|
|
94330
94330
|
}
|
|
94331
|
-
getCanonicalPath({ path:
|
|
94331
|
+
getCanonicalPath({ path: path37 }) {
|
|
94332
94332
|
if (this.uriEscapePath) {
|
|
94333
94333
|
const normalizedPathSegments = [];
|
|
94334
|
-
for (const pathSegment of
|
|
94334
|
+
for (const pathSegment of path37.split("/")) {
|
|
94335
94335
|
if ((pathSegment == null ? void 0 : pathSegment.length) === 0)
|
|
94336
94336
|
continue;
|
|
94337
94337
|
if (pathSegment === ".")
|
|
@@ -94342,11 +94342,11 @@ ${(0, import_util_hex_encoding.toHex)(hashedRequest)}`;
|
|
|
94342
94342
|
normalizedPathSegments.push(pathSegment);
|
|
94343
94343
|
}
|
|
94344
94344
|
}
|
|
94345
|
-
const normalizedPath = `${(
|
|
94345
|
+
const normalizedPath = `${(path37 == null ? void 0 : path37.startsWith("/")) ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && (path37 == null ? void 0 : path37.endsWith("/")) ? "/" : ""}`;
|
|
94346
94346
|
const doubleEncoded = (0, import_util_uri_escape.escapeUri)(normalizedPath);
|
|
94347
94347
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
94348
94348
|
}
|
|
94349
|
-
return
|
|
94349
|
+
return path37;
|
|
94350
94350
|
}
|
|
94351
94351
|
async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
|
|
94352
94352
|
const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest);
|
|
@@ -94618,9 +94618,9 @@ var init_createPaginator = __esm({
|
|
|
94618
94618
|
command6 = withCommand(command6) ?? command6;
|
|
94619
94619
|
return await client.send(command6, ...args);
|
|
94620
94620
|
};
|
|
94621
|
-
get = (fromObject,
|
|
94621
|
+
get = (fromObject, path37) => {
|
|
94622
94622
|
let cursor2 = fromObject;
|
|
94623
|
-
const pathComponents =
|
|
94623
|
+
const pathComponents = path37.split(".");
|
|
94624
94624
|
for (const step of pathComponents) {
|
|
94625
94625
|
if (!cursor2 || typeof cursor2 !== "object") {
|
|
94626
94626
|
return void 0;
|
|
@@ -98531,10 +98531,10 @@ ${longDate}
|
|
|
98531
98531
|
${credentialScope}
|
|
98532
98532
|
${toHex2(hashedRequest)}`;
|
|
98533
98533
|
}
|
|
98534
|
-
getCanonicalPath({ path:
|
|
98534
|
+
getCanonicalPath({ path: path37 }) {
|
|
98535
98535
|
if (this.uriEscapePath) {
|
|
98536
98536
|
const normalizedPathSegments = [];
|
|
98537
|
-
for (const pathSegment of
|
|
98537
|
+
for (const pathSegment of path37.split("/")) {
|
|
98538
98538
|
if (pathSegment?.length === 0)
|
|
98539
98539
|
continue;
|
|
98540
98540
|
if (pathSegment === ".")
|
|
@@ -98545,11 +98545,11 @@ ${toHex2(hashedRequest)}`;
|
|
|
98545
98545
|
normalizedPathSegments.push(pathSegment);
|
|
98546
98546
|
}
|
|
98547
98547
|
}
|
|
98548
|
-
const normalizedPath = `${
|
|
98548
|
+
const normalizedPath = `${path37?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path37?.endsWith("/") ? "/" : ""}`;
|
|
98549
98549
|
const doubleEncoded = escapeUri2(normalizedPath);
|
|
98550
98550
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
98551
98551
|
}
|
|
98552
|
-
return
|
|
98552
|
+
return path37;
|
|
98553
98553
|
}
|
|
98554
98554
|
validateResolvedCredentials(credentials) {
|
|
98555
98555
|
if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
|
|
@@ -99554,12 +99554,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
99554
99554
|
const password = request.password ?? "";
|
|
99555
99555
|
auth2 = `${username}:${password}`;
|
|
99556
99556
|
}
|
|
99557
|
-
let
|
|
99557
|
+
let path37 = request.path;
|
|
99558
99558
|
if (queryString) {
|
|
99559
|
-
|
|
99559
|
+
path37 += `?${queryString}`;
|
|
99560
99560
|
}
|
|
99561
99561
|
if (request.fragment) {
|
|
99562
|
-
|
|
99562
|
+
path37 += `#${request.fragment}`;
|
|
99563
99563
|
}
|
|
99564
99564
|
let hostname = request.hostname ?? "";
|
|
99565
99565
|
if (hostname[0] === "[" && hostname.endsWith("]")) {
|
|
@@ -99571,7 +99571,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
99571
99571
|
headers: request.headers,
|
|
99572
99572
|
host: hostname,
|
|
99573
99573
|
method: request.method,
|
|
99574
|
-
path:
|
|
99574
|
+
path: path37,
|
|
99575
99575
|
port: request.port,
|
|
99576
99576
|
agent,
|
|
99577
99577
|
auth: auth2
|
|
@@ -99980,16 +99980,16 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
99980
99980
|
reject(err);
|
|
99981
99981
|
};
|
|
99982
99982
|
const queryString = query ? buildQueryString2(query) : "";
|
|
99983
|
-
let
|
|
99983
|
+
let path37 = request.path;
|
|
99984
99984
|
if (queryString) {
|
|
99985
|
-
|
|
99985
|
+
path37 += `?${queryString}`;
|
|
99986
99986
|
}
|
|
99987
99987
|
if (request.fragment) {
|
|
99988
|
-
|
|
99988
|
+
path37 += `#${request.fragment}`;
|
|
99989
99989
|
}
|
|
99990
99990
|
const clientHttp2Stream = session.request({
|
|
99991
99991
|
...request.headers,
|
|
99992
|
-
[constants.HTTP2_HEADER_PATH]:
|
|
99992
|
+
[constants.HTTP2_HEADER_PATH]: path37,
|
|
99993
99993
|
[constants.HTTP2_HEADER_METHOD]: method
|
|
99994
99994
|
});
|
|
99995
99995
|
if (effectiveRequestTimeout) {
|
|
@@ -101419,11 +101419,11 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
101419
101419
|
}
|
|
101420
101420
|
}
|
|
101421
101421
|
const { service, operation: operation2 } = getSmithyContext(context);
|
|
101422
|
-
const
|
|
101422
|
+
const path37 = `/service/${service}/operation/${operation2}`;
|
|
101423
101423
|
if (request.path.endsWith("/")) {
|
|
101424
|
-
request.path +=
|
|
101424
|
+
request.path += path37.slice(1);
|
|
101425
101425
|
} else {
|
|
101426
|
-
request.path +=
|
|
101426
|
+
request.path += path37;
|
|
101427
101427
|
}
|
|
101428
101428
|
return request;
|
|
101429
101429
|
}
|
|
@@ -106417,7 +106417,7 @@ var require_dist_cjs20 = __commonJS({
|
|
|
106417
106417
|
var { setCredentialFeature: setCredentialFeature2 } = (init_client3(), __toCommonJS(client_exports2));
|
|
106418
106418
|
var { CredentialsProviderError: CredentialsProviderError2 } = (init_config2(), __toCommonJS(config_exports));
|
|
106419
106419
|
var { NodeHttpHandler } = require_dist_cjs15();
|
|
106420
|
-
var
|
|
106420
|
+
var fs20 = __require("node:fs/promises");
|
|
106421
106421
|
var { HttpRequest: HttpRequest2 } = (init_protocols(), __toCommonJS(protocols_exports));
|
|
106422
106422
|
var { sdkStreamMixin: sdkStreamMixin4, parseRfc3339DateTime: parseRfc3339DateTime2 } = (init_serde(), __toCommonJS(serde_exports));
|
|
106423
106423
|
var ECS_CONTAINER_HOST = "169.254.170.2";
|
|
@@ -106541,7 +106541,7 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
106541
106541
|
const provider = retryWrapper(async () => {
|
|
106542
106542
|
const request = createGetRequest(url2);
|
|
106543
106543
|
if (tokenFile) {
|
|
106544
|
-
request.headers.Authorization = validateToken((await
|
|
106544
|
+
request.headers.Authorization = validateToken((await fs20.readFile(tokenFile)).toString());
|
|
106545
106545
|
} else if (token) {
|
|
106546
106546
|
request.headers.Authorization = validateToken(token);
|
|
106547
106547
|
}
|
|
@@ -114032,18 +114032,18 @@ var require_dist_cjs41 = __commonJS({
|
|
|
114032
114032
|
const password = request.password ?? "";
|
|
114033
114033
|
auth2 = `${username}:${password}`;
|
|
114034
114034
|
}
|
|
114035
|
-
let
|
|
114035
|
+
let path37 = request.path;
|
|
114036
114036
|
if (queryString) {
|
|
114037
|
-
|
|
114037
|
+
path37 += `?${queryString}`;
|
|
114038
114038
|
}
|
|
114039
114039
|
if (request.fragment) {
|
|
114040
|
-
|
|
114040
|
+
path37 += `#${request.fragment}`;
|
|
114041
114041
|
}
|
|
114042
114042
|
const nodeHttpsOptions = {
|
|
114043
114043
|
headers: request.headers,
|
|
114044
114044
|
host: request.hostname,
|
|
114045
114045
|
method: request.method,
|
|
114046
|
-
path:
|
|
114046
|
+
path: path37,
|
|
114047
114047
|
port: request.port,
|
|
114048
114048
|
agent,
|
|
114049
114049
|
auth: auth2
|
|
@@ -114305,16 +114305,16 @@ var require_dist_cjs41 = __commonJS({
|
|
|
114305
114305
|
reject(err);
|
|
114306
114306
|
}, "rejectWithDestroy");
|
|
114307
114307
|
const queryString = (0, import_querystring_builder.buildQueryString)(query || {});
|
|
114308
|
-
let
|
|
114308
|
+
let path37 = request.path;
|
|
114309
114309
|
if (queryString) {
|
|
114310
|
-
|
|
114310
|
+
path37 += `?${queryString}`;
|
|
114311
114311
|
}
|
|
114312
114312
|
if (request.fragment) {
|
|
114313
|
-
|
|
114313
|
+
path37 += `#${request.fragment}`;
|
|
114314
114314
|
}
|
|
114315
114315
|
const req = session.request({
|
|
114316
114316
|
...request.headers,
|
|
114317
|
-
[import_http22.constants.HTTP2_HEADER_PATH]:
|
|
114317
|
+
[import_http22.constants.HTTP2_HEADER_PATH]: path37,
|
|
114318
114318
|
[import_http22.constants.HTTP2_HEADER_METHOD]: method
|
|
114319
114319
|
});
|
|
114320
114320
|
session.ref();
|
|
@@ -115788,15 +115788,15 @@ var init_arn = __esm({
|
|
|
115788
115788
|
// ../../../node_modules/.pnpm/@aws-sdk+core@3.978.1/node_modules/@aws-sdk/core/dist-es/submodules/util/util-format-url/format-url.js
|
|
115789
115789
|
function formatUrl2(request) {
|
|
115790
115790
|
const { port, query } = request;
|
|
115791
|
-
let { protocol, path:
|
|
115791
|
+
let { protocol, path: path37, hostname } = request;
|
|
115792
115792
|
if (protocol && protocol.slice(-1) !== ":") {
|
|
115793
115793
|
protocol += ":";
|
|
115794
115794
|
}
|
|
115795
115795
|
if (port) {
|
|
115796
115796
|
hostname += `:${port}`;
|
|
115797
115797
|
}
|
|
115798
|
-
if (
|
|
115799
|
-
|
|
115798
|
+
if (path37 && path37.charAt(0) !== "/") {
|
|
115799
|
+
path37 = `/${path37}`;
|
|
115800
115800
|
}
|
|
115801
115801
|
let queryString = query ? buildQueryString(query) : "";
|
|
115802
115802
|
if (queryString && queryString[0] !== "?") {
|
|
@@ -115812,7 +115812,7 @@ function formatUrl2(request) {
|
|
|
115812
115812
|
if (request.fragment) {
|
|
115813
115813
|
fragment = `#${request.fragment}`;
|
|
115814
115814
|
}
|
|
115815
|
-
return `${protocol}//${auth2}${hostname}${
|
|
115815
|
+
return `${protocol}//${auth2}${hostname}${path37}${queryString}${fragment}`;
|
|
115816
115816
|
}
|
|
115817
115817
|
var init_format_url = __esm({
|
|
115818
115818
|
"../../../node_modules/.pnpm/@aws-sdk+core@3.978.1/node_modules/@aws-sdk/core/dist-es/submodules/util/util-format-url/format-url.js"() {
|
|
@@ -120954,12 +120954,12 @@ var require_path2 = __commonJS({
|
|
|
120954
120954
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
120955
120955
|
}
|
|
120956
120956
|
var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
120957
|
-
var createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
120957
|
+
var createPathTagFunction = (pathEncoder = encodeURIPath) => function path37(statics, ...params) {
|
|
120958
120958
|
if (statics.length === 1)
|
|
120959
120959
|
return statics[0];
|
|
120960
120960
|
let postPath = false;
|
|
120961
120961
|
const invalidSegments = [];
|
|
120962
|
-
const
|
|
120962
|
+
const path38 = statics.reduce((previousValue, currentValue, index) => {
|
|
120963
120963
|
if (/[?#]/.test(currentValue)) {
|
|
120964
120964
|
postPath = true;
|
|
120965
120965
|
}
|
|
@@ -120976,7 +120976,7 @@ var require_path2 = __commonJS({
|
|
|
120976
120976
|
}
|
|
120977
120977
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
120978
120978
|
}, "");
|
|
120979
|
-
const pathOnly =
|
|
120979
|
+
const pathOnly = path38.split(/[?#]/, 1)[0];
|
|
120980
120980
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
120981
120981
|
let match2;
|
|
120982
120982
|
while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -120997,10 +120997,10 @@ var require_path2 = __commonJS({
|
|
|
120997
120997
|
}, "");
|
|
120998
120998
|
throw new error_1.AnthropicError(`Path parameters result in path with invalid segments:
|
|
120999
120999
|
${invalidSegments.map((e7) => e7.error).join("\n")}
|
|
121000
|
-
${
|
|
121000
|
+
${path38}
|
|
121001
121001
|
${underline}`);
|
|
121002
121002
|
}
|
|
121003
|
-
return
|
|
121003
|
+
return path38;
|
|
121004
121004
|
};
|
|
121005
121005
|
exports.createPathTagFunction = createPathTagFunction;
|
|
121006
121006
|
exports.path = (0, exports.createPathTagFunction)(encodeURIPath);
|
|
@@ -124289,12 +124289,12 @@ var require_path3 = __commonJS({
|
|
|
124289
124289
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
124290
124290
|
}
|
|
124291
124291
|
var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
124292
|
-
var createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
124292
|
+
var createPathTagFunction = (pathEncoder = encodeURIPath) => function path37(statics, ...params) {
|
|
124293
124293
|
if (statics.length === 1)
|
|
124294
124294
|
return statics[0];
|
|
124295
124295
|
let postPath = false;
|
|
124296
124296
|
const invalidSegments = [];
|
|
124297
|
-
const
|
|
124297
|
+
const path38 = statics.reduce((previousValue, currentValue, index) => {
|
|
124298
124298
|
if (/[?#]/.test(currentValue)) {
|
|
124299
124299
|
postPath = true;
|
|
124300
124300
|
}
|
|
@@ -124311,7 +124311,7 @@ var require_path3 = __commonJS({
|
|
|
124311
124311
|
}
|
|
124312
124312
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
124313
124313
|
}, "");
|
|
124314
|
-
const pathOnly =
|
|
124314
|
+
const pathOnly = path38.split(/[?#]/, 1)[0];
|
|
124315
124315
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
124316
124316
|
let match2;
|
|
124317
124317
|
while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -124332,10 +124332,10 @@ var require_path3 = __commonJS({
|
|
|
124332
124332
|
}, "");
|
|
124333
124333
|
throw new error_1.OpenAIError(`Path parameters result in path with invalid segments:
|
|
124334
124334
|
${invalidSegments.map((e7) => e7.error).join("\n")}
|
|
124335
|
-
${
|
|
124335
|
+
${path38}
|
|
124336
124336
|
${underline}`);
|
|
124337
124337
|
}
|
|
124338
|
-
return
|
|
124338
|
+
return path38;
|
|
124339
124339
|
};
|
|
124340
124340
|
exports.createPathTagFunction = createPathTagFunction;
|
|
124341
124341
|
exports.path = (0, exports.createPathTagFunction)(encodeURIPath);
|
|
@@ -134587,9 +134587,9 @@ var require_client5 = __commonJS({
|
|
|
134587
134587
|
this.apiKey = token;
|
|
134588
134588
|
return true;
|
|
134589
134589
|
}
|
|
134590
|
-
buildURL(
|
|
134590
|
+
buildURL(path37, query, defaultBaseURL) {
|
|
134591
134591
|
const baseURL = !tslib_1.__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
134592
|
-
const url2 = (0, values_1.isAbsoluteURL)(
|
|
134592
|
+
const url2 = (0, values_1.isAbsoluteURL)(path37) ? new URL(path37) : new URL(baseURL + (baseURL.endsWith("/") && path37.startsWith("/") ? path37.slice(1) : path37));
|
|
134593
134593
|
const defaultQuery = this.defaultQuery();
|
|
134594
134594
|
const pathQuery = Object.fromEntries(url2.searchParams);
|
|
134595
134595
|
if (!(0, values_2.isEmptyObj)(defaultQuery) || !(0, values_2.isEmptyObj)(pathQuery)) {
|
|
@@ -134619,24 +134619,24 @@ var require_client5 = __commonJS({
|
|
|
134619
134619
|
*/
|
|
134620
134620
|
async prepareRequest(request, { url: url2, options }) {
|
|
134621
134621
|
}
|
|
134622
|
-
get(
|
|
134623
|
-
return this.methodRequest("get",
|
|
134622
|
+
get(path37, opts) {
|
|
134623
|
+
return this.methodRequest("get", path37, opts);
|
|
134624
134624
|
}
|
|
134625
|
-
post(
|
|
134626
|
-
return this.methodRequest("post",
|
|
134625
|
+
post(path37, opts) {
|
|
134626
|
+
return this.methodRequest("post", path37, opts);
|
|
134627
134627
|
}
|
|
134628
|
-
patch(
|
|
134629
|
-
return this.methodRequest("patch",
|
|
134628
|
+
patch(path37, opts) {
|
|
134629
|
+
return this.methodRequest("patch", path37, opts);
|
|
134630
134630
|
}
|
|
134631
|
-
put(
|
|
134632
|
-
return this.methodRequest("put",
|
|
134631
|
+
put(path37, opts) {
|
|
134632
|
+
return this.methodRequest("put", path37, opts);
|
|
134633
134633
|
}
|
|
134634
|
-
delete(
|
|
134635
|
-
return this.methodRequest("delete",
|
|
134634
|
+
delete(path37, opts) {
|
|
134635
|
+
return this.methodRequest("delete", path37, opts);
|
|
134636
134636
|
}
|
|
134637
|
-
methodRequest(method,
|
|
134637
|
+
methodRequest(method, path37, opts) {
|
|
134638
134638
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
134639
|
-
return { method, path:
|
|
134639
|
+
return { method, path: path37, ...opts2 };
|
|
134640
134640
|
}));
|
|
134641
134641
|
}
|
|
134642
134642
|
request(options, remainingRetries = null) {
|
|
@@ -134761,8 +134761,8 @@ var require_client5 = __commonJS({
|
|
|
134761
134761
|
}));
|
|
134762
134762
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
134763
134763
|
}
|
|
134764
|
-
getAPIList(
|
|
134765
|
-
return this.requestAPIList(Page, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path:
|
|
134764
|
+
getAPIList(path37, Page, opts) {
|
|
134765
|
+
return this.requestAPIList(Page, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path37, ...opts2 })) : { method: "get", path: path37, ...opts });
|
|
134766
134766
|
}
|
|
134767
134767
|
requestAPIList(Page, options) {
|
|
134768
134768
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -134856,8 +134856,8 @@ var require_client5 = __commonJS({
|
|
|
134856
134856
|
}
|
|
134857
134857
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
134858
134858
|
const options = { ...inputOptions };
|
|
134859
|
-
const { method, path:
|
|
134860
|
-
const url2 = this.buildURL(
|
|
134859
|
+
const { method, path: path37, query, defaultBaseURL } = options;
|
|
134860
|
+
const url2 = this.buildURL(path37, query, defaultBaseURL);
|
|
134861
134861
|
if ("timeout" in options)
|
|
134862
134862
|
(0, values_1.validatePositiveInteger)("timeout", options.timeout);
|
|
134863
134863
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -136220,7 +136220,7 @@ var require_client8 = __commonJS({
|
|
|
136220
136220
|
};
|
|
136221
136221
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
136222
136222
|
exports.KimiK3Client = void 0;
|
|
136223
|
-
var
|
|
136223
|
+
var path37 = __importStar2(__require("path"));
|
|
136224
136224
|
var openai_1 = __importDefault2(require_openai());
|
|
136225
136225
|
var baseClient_1 = require_baseClient();
|
|
136226
136226
|
var errors_1 = require_errors2();
|
|
@@ -136245,7 +136245,7 @@ var require_client8 = __commonJS({
|
|
|
136245
136245
|
* Detect MIME type from URL extension for image.
|
|
136246
136246
|
*/
|
|
136247
136247
|
_detectImageMimeType(url2) {
|
|
136248
|
-
const ext =
|
|
136248
|
+
const ext = path37.extname(url2).toLowerCase();
|
|
136249
136249
|
const mimeTypes = {
|
|
136250
136250
|
".bmp": "image/bmp",
|
|
136251
136251
|
".gif": "image/gif",
|
|
@@ -136703,7 +136703,7 @@ var require_client9 = __commonJS({
|
|
|
136703
136703
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
136704
136704
|
exports.OpenaiChatClient = void 0;
|
|
136705
136705
|
var openai_1 = __importDefault2(require_openai());
|
|
136706
|
-
var
|
|
136706
|
+
var path37 = __importStar2(__require("path"));
|
|
136707
136707
|
var baseClient_1 = require_baseClient();
|
|
136708
136708
|
var errors_1 = require_errors2();
|
|
136709
136709
|
var types_1 = require_types2();
|
|
@@ -136727,7 +136727,7 @@ var require_client9 = __commonJS({
|
|
|
136727
136727
|
* Detect MIME type from URL extension for image.
|
|
136728
136728
|
*/
|
|
136729
136729
|
_detectImageMimeType(url2) {
|
|
136730
|
-
const ext =
|
|
136730
|
+
const ext = path37.extname(url2).toLowerCase();
|
|
136731
136731
|
const mimeTypes = {
|
|
136732
136732
|
".bmp": "image/bmp",
|
|
136733
136733
|
".gif": "image/gif",
|
|
@@ -140060,10 +140060,10 @@ function mergeDefs(...defs) {
|
|
|
140060
140060
|
function cloneDef(schema) {
|
|
140061
140061
|
return mergeDefs(schema._zod.def);
|
|
140062
140062
|
}
|
|
140063
|
-
function getElementAtPath(obj,
|
|
140064
|
-
if (!
|
|
140063
|
+
function getElementAtPath(obj, path37) {
|
|
140064
|
+
if (!path37)
|
|
140065
140065
|
return obj;
|
|
140066
|
-
return
|
|
140066
|
+
return path37.reduce((acc, key) => acc?.[key], obj);
|
|
140067
140067
|
}
|
|
140068
140068
|
function promiseAllObject(promisesObj) {
|
|
140069
140069
|
const keys = Object.keys(promisesObj);
|
|
@@ -140322,11 +140322,11 @@ function explicitlyAborted(x2, startIndex = 0) {
|
|
|
140322
140322
|
}
|
|
140323
140323
|
return false;
|
|
140324
140324
|
}
|
|
140325
|
-
function prefixIssues(
|
|
140325
|
+
function prefixIssues(path37, issues) {
|
|
140326
140326
|
return issues.map((iss) => {
|
|
140327
140327
|
var _a4;
|
|
140328
140328
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
140329
|
-
iss.path.unshift(
|
|
140329
|
+
iss.path.unshift(path37);
|
|
140330
140330
|
return iss;
|
|
140331
140331
|
});
|
|
140332
140332
|
}
|
|
@@ -140846,16 +140846,16 @@ function flattenError(error3, mapper = (issue2) => issue2.message) {
|
|
|
140846
140846
|
}
|
|
140847
140847
|
function formatError(error3, mapper = (issue2) => issue2.message) {
|
|
140848
140848
|
const fieldErrors = { _errors: [] };
|
|
140849
|
-
const processError = (error4,
|
|
140849
|
+
const processError = (error4, path37 = []) => {
|
|
140850
140850
|
for (const issue2 of error4.issues) {
|
|
140851
140851
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
140852
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
140852
|
+
issue2.errors.map((issues) => processError({ issues }, [...path37, ...issue2.path]));
|
|
140853
140853
|
} else if (issue2.code === "invalid_key") {
|
|
140854
|
-
processError({ issues: issue2.issues }, [...
|
|
140854
|
+
processError({ issues: issue2.issues }, [...path37, ...issue2.path]);
|
|
140855
140855
|
} else if (issue2.code === "invalid_element") {
|
|
140856
|
-
processError({ issues: issue2.issues }, [...
|
|
140856
|
+
processError({ issues: issue2.issues }, [...path37, ...issue2.path]);
|
|
140857
140857
|
} else {
|
|
140858
|
-
const fullpath = [...
|
|
140858
|
+
const fullpath = [...path37, ...issue2.path];
|
|
140859
140859
|
if (fullpath.length === 0) {
|
|
140860
140860
|
fieldErrors._errors.push(mapper(issue2));
|
|
140861
140861
|
} else {
|
|
@@ -149976,29 +149976,29 @@ function isSpecNotificationMethod(method) {
|
|
|
149976
149976
|
function scanXMcpHeaderDeclarations(inputSchema) {
|
|
149977
149977
|
const declarations = [];
|
|
149978
149978
|
const seenLower = /* @__PURE__ */ new Map();
|
|
149979
|
-
const visit = (node2,
|
|
149979
|
+
const visit = (node2, path37, reachable) => {
|
|
149980
149980
|
if (node2 === null || typeof node2 !== "object") return void 0;
|
|
149981
149981
|
const schema = node2;
|
|
149982
149982
|
if (X_MCP_HEADER_KEY in schema) {
|
|
149983
|
-
if (!reachable ||
|
|
149983
|
+
if (!reachable || path37.length === 0) return `${pathName(path37)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;
|
|
149984
149984
|
const raw2 = schema[X_MCP_HEADER_KEY];
|
|
149985
|
-
if (typeof raw2 !== "string" || raw2.length === 0) return `${pathName(
|
|
149986
|
-
if (!RFC9110_TOKEN.test(raw2)) return `${pathName(
|
|
149985
|
+
if (typeof raw2 !== "string" || raw2.length === 0) return `${pathName(path37)}: x-mcp-header MUST be a non-empty string`;
|
|
149986
|
+
if (!RFC9110_TOKEN.test(raw2)) return `${pathName(path37)}: x-mcp-header '${raw2}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;
|
|
149987
149987
|
const type = typeof schema.type === "string" ? schema.type : void 0;
|
|
149988
|
-
if (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) return `${pathName(
|
|
149988
|
+
if (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) return `${pathName(path37)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${type ?? "<none>"}`;
|
|
149989
149989
|
const lower2 = raw2.toLowerCase();
|
|
149990
149990
|
const prior = seenLower.get(lower2);
|
|
149991
149991
|
if (prior !== void 0) return `x-mcp-header '${raw2}' is not case-insensitively unique (also declared as '${prior}')`;
|
|
149992
149992
|
seenLower.set(lower2, raw2);
|
|
149993
149993
|
declarations.push({
|
|
149994
|
-
path:
|
|
149994
|
+
path: path37,
|
|
149995
149995
|
headerName: raw2,
|
|
149996
149996
|
type
|
|
149997
149997
|
});
|
|
149998
149998
|
}
|
|
149999
149999
|
const properties = schema.properties;
|
|
150000
150000
|
if (properties !== null && typeof properties === "object") for (const [key, child] of Object.entries(properties)) {
|
|
150001
|
-
const fault$1 = visit(child, [...
|
|
150001
|
+
const fault$1 = visit(child, [...path37, key], reachable);
|
|
150002
150002
|
if (fault$1 !== void 0) return fault$1;
|
|
150003
150003
|
}
|
|
150004
150004
|
for (const k6 of NON_REACHABLE_SUBSCHEMA_KEYWORDS) {
|
|
@@ -150006,7 +150006,7 @@ function scanXMcpHeaderDeclarations(inputSchema) {
|
|
|
150006
150006
|
if (sub === void 0) continue;
|
|
150007
150007
|
const branches = Array.isArray(sub) ? sub : sub !== null && typeof sub === "object" && OBJECT_VALUED_SUBSCHEMA_KEYWORDS.has(k6) ? Object.values(sub) : [sub];
|
|
150008
150008
|
for (const branch of branches) {
|
|
150009
|
-
const fault$1 = visit(branch, [...
|
|
150009
|
+
const fault$1 = visit(branch, [...path37, `<${k6}>`], false);
|
|
150010
150010
|
if (fault$1 !== void 0) return fault$1;
|
|
150011
150011
|
}
|
|
150012
150012
|
}
|
|
@@ -150020,8 +150020,8 @@ function scanXMcpHeaderDeclarations(inputSchema) {
|
|
|
150020
150020
|
reason: fault
|
|
150021
150021
|
};
|
|
150022
150022
|
}
|
|
150023
|
-
function pathName(
|
|
150024
|
-
return
|
|
150023
|
+
function pathName(path37) {
|
|
150024
|
+
return path37.length === 0 ? "<root>" : path37.join(".");
|
|
150025
150025
|
}
|
|
150026
150026
|
function mcpParamPrimitiveToString(value) {
|
|
150027
150027
|
if (typeof value === "string") return value;
|
|
@@ -150052,9 +150052,9 @@ function utf8ToBase64(s3) {
|
|
|
150052
150052
|
function encodeMcpParamValue(value) {
|
|
150053
150053
|
return needsBase64(value) ? `${BASE64_SENTINEL_PREFIX}${utf8ToBase64(value)}${BASE64_SENTINEL_SUFFIX}` : value;
|
|
150054
150054
|
}
|
|
150055
|
-
function valueAtPath(root6,
|
|
150055
|
+
function valueAtPath(root6, path37) {
|
|
150056
150056
|
let node2 = root6;
|
|
150057
|
-
for (const key of
|
|
150057
|
+
for (const key of path37) {
|
|
150058
150058
|
if (node2 === null || typeof node2 !== "object") return void 0;
|
|
150059
150059
|
node2 = node2[key];
|
|
150060
150060
|
}
|
|
@@ -150208,7 +150208,7 @@ function convertStandardElicitationSchema(schema) {
|
|
|
150208
150208
|
function isAnnotationOnlyJsonSchemaKeyword(key) {
|
|
150209
150209
|
return ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS.has(key) || key.startsWith("x-");
|
|
150210
150210
|
}
|
|
150211
|
-
function walkProperty(node2,
|
|
150211
|
+
function walkProperty(node2, path37, vendor, unsupported) {
|
|
150212
150212
|
if (!isJsonObject(node2)) return node2;
|
|
150213
150213
|
const allowedKeys = typeof node2.type === "string" && Object.hasOwn(PROPERTY_KEYS_BY_TYPE, node2.type) ? PROPERTY_KEYS_BY_TYPE[node2.type] : void 0;
|
|
150214
150214
|
if (allowedKeys === void 0) return node2;
|
|
@@ -150216,8 +150216,8 @@ function walkProperty(node2, path36, vendor, unsupported) {
|
|
|
150216
150216
|
for (const [key, value] of Object.entries(node2)) if (allowedKeys.has(key) || isAnnotationOnlyJsonSchemaKeyword(key)) pruned[key] = value;
|
|
150217
150217
|
else if (key === "pattern" && node2.type === "string" && typeof node2.format === "string") {
|
|
150218
150218
|
if (!SUPPORTED_STRING_FORMATS.has(node2.format)) pruned[key] = value;
|
|
150219
|
-
else if (typeof value !== "string" || !isLibraryFormatPattern(node2.format, value, vendor)) unsupported.push(`${
|
|
150220
|
-
} else unsupported.push(`${
|
|
150219
|
+
else if (typeof value !== "string" || !isLibraryFormatPattern(node2.format, value, vendor)) unsupported.push(`${path37}.${key}`);
|
|
150220
|
+
} else unsupported.push(`${path37}.${key}`);
|
|
150221
150221
|
return pruned;
|
|
150222
150222
|
}
|
|
150223
150223
|
function walkRequestedSchema(converted, vendor) {
|
|
@@ -150234,11 +150234,11 @@ function describeUnsupportedProperties(pruned, fallback2) {
|
|
|
150234
150234
|
const offenders = Object.entries(pruned.properties).filter(([, node2]) => !parseSchema(PrimitiveSchemaDefinitionSchema, node2).success).map(([name2]) => `properties.${name2}`);
|
|
150235
150235
|
return offenders.length > 0 ? offenders.join(", ") : fallback2;
|
|
150236
150236
|
}
|
|
150237
|
-
function findDroppedConstraintPaths(original, parsed,
|
|
150238
|
-
if (Array.isArray(original) && Array.isArray(parsed)) return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed[index], `${
|
|
150237
|
+
function findDroppedConstraintPaths(original, parsed, path37 = "") {
|
|
150238
|
+
if (Array.isArray(original) && Array.isArray(parsed)) return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed[index], `${path37}[${index}]`));
|
|
150239
150239
|
if (!isJsonObject(original) || !isJsonObject(parsed)) return [];
|
|
150240
150240
|
return Object.entries(original).flatMap(([key, value]) => {
|
|
150241
|
-
const childPath =
|
|
150241
|
+
const childPath = path37 ? `${path37}.${key}` : key;
|
|
150242
150242
|
if (!Object.prototype.hasOwnProperty.call(parsed, key)) return isAnnotationOnlyJsonSchemaKeyword(key) ? [] : [childPath];
|
|
150243
150243
|
return findDroppedConstraintPaths(value, parsed[key], childPath);
|
|
150244
150244
|
});
|
|
@@ -151093,9 +151093,9 @@ var init_src_xKF0PJN = __esm({
|
|
|
151093
151093
|
});
|
|
151094
151094
|
const parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(meta2);
|
|
151095
151095
|
if (!parsed.success) for (const issue2 of parsed.error.issues) {
|
|
151096
|
-
const
|
|
151097
|
-
const key =
|
|
151098
|
-
if (
|
|
151096
|
+
const path37 = issue2.path.map(String);
|
|
151097
|
+
const key = path37.length > 0 ? path37.join(".") : "_meta";
|
|
151098
|
+
if (path37.length === 1 && issues.some((existing) => existing.key === key && existing.problem === "missing")) continue;
|
|
151099
151099
|
issues.push({
|
|
151100
151100
|
key,
|
|
151101
151101
|
problem: issue2.message
|
|
@@ -155347,8 +155347,8 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
155347
155347
|
for (let i7 = 0; i7 < str.length; i7++) if (str[i7] === token) ind++;
|
|
155348
155348
|
return ind;
|
|
155349
155349
|
}
|
|
155350
|
-
function removeDotSegments(
|
|
155351
|
-
let input =
|
|
155350
|
+
function removeDotSegments(path37) {
|
|
155351
|
+
let input = path37;
|
|
155352
155352
|
const output = [];
|
|
155353
155353
|
let nextSlash = -1;
|
|
155354
155354
|
let len = 0;
|
|
@@ -155501,8 +155501,8 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
155501
155501
|
wsComponent.secure = void 0;
|
|
155502
155502
|
}
|
|
155503
155503
|
if (wsComponent.resourceName) {
|
|
155504
|
-
const [
|
|
155505
|
-
wsComponent.path =
|
|
155504
|
+
const [path37, query] = wsComponent.resourceName.split("?");
|
|
155505
|
+
wsComponent.path = path37 && path37 !== "/" ? path37 : void 0;
|
|
155506
155506
|
wsComponent.query = query;
|
|
155507
155507
|
wsComponent.resourceName = void 0;
|
|
155508
155508
|
}
|
|
@@ -159490,11 +159490,11 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
159490
159490
|
if (!f8) throw new Error(`Unknown format "${name2}"`);
|
|
159491
159491
|
return f8;
|
|
159492
159492
|
};
|
|
159493
|
-
function addFormats2(ajv, list2,
|
|
159493
|
+
function addFormats2(ajv, list2, fs20, exportName) {
|
|
159494
159494
|
var _a4;
|
|
159495
159495
|
var _b;
|
|
159496
159496
|
(_a4 = (_b = ajv.opts.code).formats) !== null && _a4 !== void 0 || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`);
|
|
159497
|
-
for (const f8 of list2) ajv.addFormat(f8,
|
|
159497
|
+
for (const f8 of list2) ajv.addFormat(f8, fs20[f8]);
|
|
159498
159498
|
}
|
|
159499
159499
|
module.exports = exports = formatsPlugin;
|
|
159500
159500
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -164150,8 +164150,8 @@ var require_windows = __commonJS({
|
|
|
164150
164150
|
"../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
|
|
164151
164151
|
module.exports = isexe;
|
|
164152
164152
|
isexe.sync = sync;
|
|
164153
|
-
var
|
|
164154
|
-
function checkPathExt(
|
|
164153
|
+
var fs20 = __require("fs");
|
|
164154
|
+
function checkPathExt(path37, options) {
|
|
164155
164155
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
164156
164156
|
if (!pathext) {
|
|
164157
164157
|
return true;
|
|
@@ -164162,25 +164162,25 @@ var require_windows = __commonJS({
|
|
|
164162
164162
|
}
|
|
164163
164163
|
for (var i7 = 0; i7 < pathext.length; i7++) {
|
|
164164
164164
|
var p3 = pathext[i7].toLowerCase();
|
|
164165
|
-
if (p3 &&
|
|
164165
|
+
if (p3 && path37.substr(-p3.length).toLowerCase() === p3) {
|
|
164166
164166
|
return true;
|
|
164167
164167
|
}
|
|
164168
164168
|
}
|
|
164169
164169
|
return false;
|
|
164170
164170
|
}
|
|
164171
|
-
function checkStat(stat6,
|
|
164171
|
+
function checkStat(stat6, path37, options) {
|
|
164172
164172
|
if (!stat6.isSymbolicLink() && !stat6.isFile()) {
|
|
164173
164173
|
return false;
|
|
164174
164174
|
}
|
|
164175
|
-
return checkPathExt(
|
|
164175
|
+
return checkPathExt(path37, options);
|
|
164176
164176
|
}
|
|
164177
|
-
function isexe(
|
|
164178
|
-
|
|
164179
|
-
cb(er, er ? false : checkStat(stat6,
|
|
164177
|
+
function isexe(path37, options, cb) {
|
|
164178
|
+
fs20.stat(path37, function(er, stat6) {
|
|
164179
|
+
cb(er, er ? false : checkStat(stat6, path37, options));
|
|
164180
164180
|
});
|
|
164181
164181
|
}
|
|
164182
|
-
function sync(
|
|
164183
|
-
return checkStat(
|
|
164182
|
+
function sync(path37, options) {
|
|
164183
|
+
return checkStat(fs20.statSync(path37), path37, options);
|
|
164184
164184
|
}
|
|
164185
164185
|
}
|
|
164186
164186
|
});
|
|
@@ -164190,14 +164190,14 @@ var require_mode = __commonJS({
|
|
|
164190
164190
|
"../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
|
|
164191
164191
|
module.exports = isexe;
|
|
164192
164192
|
isexe.sync = sync;
|
|
164193
|
-
var
|
|
164194
|
-
function isexe(
|
|
164195
|
-
|
|
164193
|
+
var fs20 = __require("fs");
|
|
164194
|
+
function isexe(path37, options, cb) {
|
|
164195
|
+
fs20.stat(path37, function(er, stat6) {
|
|
164196
164196
|
cb(er, er ? false : checkStat(stat6, options));
|
|
164197
164197
|
});
|
|
164198
164198
|
}
|
|
164199
|
-
function sync(
|
|
164200
|
-
return checkStat(
|
|
164199
|
+
function sync(path37, options) {
|
|
164200
|
+
return checkStat(fs20.statSync(path37), options);
|
|
164201
164201
|
}
|
|
164202
164202
|
function checkStat(stat6, options) {
|
|
164203
164203
|
return stat6.isFile() && checkMode(stat6, options);
|
|
@@ -164221,7 +164221,7 @@ var require_mode = __commonJS({
|
|
|
164221
164221
|
// ../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
164222
164222
|
var require_isexe = __commonJS({
|
|
164223
164223
|
"../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
164224
|
-
var
|
|
164224
|
+
var fs20 = __require("fs");
|
|
164225
164225
|
var core;
|
|
164226
164226
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
164227
164227
|
core = require_windows();
|
|
@@ -164230,7 +164230,7 @@ var require_isexe = __commonJS({
|
|
|
164230
164230
|
}
|
|
164231
164231
|
module.exports = isexe;
|
|
164232
164232
|
isexe.sync = sync;
|
|
164233
|
-
function isexe(
|
|
164233
|
+
function isexe(path37, options, cb) {
|
|
164234
164234
|
if (typeof options === "function") {
|
|
164235
164235
|
cb = options;
|
|
164236
164236
|
options = {};
|
|
@@ -164240,7 +164240,7 @@ var require_isexe = __commonJS({
|
|
|
164240
164240
|
throw new TypeError("callback not provided");
|
|
164241
164241
|
}
|
|
164242
164242
|
return new Promise(function(resolve, reject) {
|
|
164243
|
-
isexe(
|
|
164243
|
+
isexe(path37, options || {}, function(er, is) {
|
|
164244
164244
|
if (er) {
|
|
164245
164245
|
reject(er);
|
|
164246
164246
|
} else {
|
|
@@ -164249,7 +164249,7 @@ var require_isexe = __commonJS({
|
|
|
164249
164249
|
});
|
|
164250
164250
|
});
|
|
164251
164251
|
}
|
|
164252
|
-
core(
|
|
164252
|
+
core(path37, options || {}, function(er, is) {
|
|
164253
164253
|
if (er) {
|
|
164254
164254
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
164255
164255
|
er = null;
|
|
@@ -164259,9 +164259,9 @@ var require_isexe = __commonJS({
|
|
|
164259
164259
|
cb(er, is);
|
|
164260
164260
|
});
|
|
164261
164261
|
}
|
|
164262
|
-
function sync(
|
|
164262
|
+
function sync(path37, options) {
|
|
164263
164263
|
try {
|
|
164264
|
-
return core.sync(
|
|
164264
|
+
return core.sync(path37, options || {});
|
|
164265
164265
|
} catch (er) {
|
|
164266
164266
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
164267
164267
|
return false;
|
|
@@ -164277,7 +164277,7 @@ var require_isexe = __commonJS({
|
|
|
164277
164277
|
var require_which = __commonJS({
|
|
164278
164278
|
"../../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
|
|
164279
164279
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
164280
|
-
var
|
|
164280
|
+
var path37 = __require("path");
|
|
164281
164281
|
var COLON3 = isWindows ? ";" : ":";
|
|
164282
164282
|
var isexe = require_isexe();
|
|
164283
164283
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -164315,7 +164315,7 @@ var require_which = __commonJS({
|
|
|
164315
164315
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
164316
164316
|
const ppRaw = pathEnv[i7];
|
|
164317
164317
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
164318
|
-
const pCmd =
|
|
164318
|
+
const pCmd = path37.join(pathPart, cmd);
|
|
164319
164319
|
const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
164320
164320
|
resolve(subStep(p3, i7, 0));
|
|
164321
164321
|
});
|
|
@@ -164342,7 +164342,7 @@ var require_which = __commonJS({
|
|
|
164342
164342
|
for (let i7 = 0; i7 < pathEnv.length; i7++) {
|
|
164343
164343
|
const ppRaw = pathEnv[i7];
|
|
164344
164344
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
164345
|
-
const pCmd =
|
|
164345
|
+
const pCmd = path37.join(pathPart, cmd);
|
|
164346
164346
|
const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
164347
164347
|
for (let j6 = 0; j6 < pathExt.length; j6++) {
|
|
164348
164348
|
const cur = p3 + pathExt[j6];
|
|
@@ -164390,7 +164390,7 @@ var require_path_key = __commonJS({
|
|
|
164390
164390
|
var require_resolveCommand = __commonJS({
|
|
164391
164391
|
"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
164392
164392
|
"use strict";
|
|
164393
|
-
var
|
|
164393
|
+
var path37 = __require("path");
|
|
164394
164394
|
var which = require_which();
|
|
164395
164395
|
var getPathKey = require_path_key();
|
|
164396
164396
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -164408,7 +164408,7 @@ var require_resolveCommand = __commonJS({
|
|
|
164408
164408
|
try {
|
|
164409
164409
|
resolved = which.sync(parsed.command, {
|
|
164410
164410
|
path: env2[getPathKey({ env: env2 })],
|
|
164411
|
-
pathExt: withoutPathExt ?
|
|
164411
|
+
pathExt: withoutPathExt ? path37.delimiter : void 0
|
|
164412
164412
|
});
|
|
164413
164413
|
} catch (e7) {
|
|
164414
164414
|
} finally {
|
|
@@ -164417,7 +164417,7 @@ var require_resolveCommand = __commonJS({
|
|
|
164417
164417
|
}
|
|
164418
164418
|
}
|
|
164419
164419
|
if (resolved) {
|
|
164420
|
-
resolved =
|
|
164420
|
+
resolved = path37.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
164421
164421
|
}
|
|
164422
164422
|
return resolved;
|
|
164423
164423
|
}
|
|
@@ -164471,8 +164471,8 @@ var require_shebang_command = __commonJS({
|
|
|
164471
164471
|
if (!match2) {
|
|
164472
164472
|
return null;
|
|
164473
164473
|
}
|
|
164474
|
-
const [
|
|
164475
|
-
const binary =
|
|
164474
|
+
const [path37, argument] = match2[0].replace(/#! ?/, "").split(" ");
|
|
164475
|
+
const binary = path37.split("/").pop();
|
|
164476
164476
|
if (binary === "env") {
|
|
164477
164477
|
return argument;
|
|
164478
164478
|
}
|
|
@@ -164485,16 +164485,16 @@ var require_shebang_command = __commonJS({
|
|
|
164485
164485
|
var require_readShebang = __commonJS({
|
|
164486
164486
|
"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
164487
164487
|
"use strict";
|
|
164488
|
-
var
|
|
164488
|
+
var fs20 = __require("fs");
|
|
164489
164489
|
var shebangCommand = require_shebang_command();
|
|
164490
164490
|
function readShebang(command6) {
|
|
164491
164491
|
const size = 150;
|
|
164492
164492
|
const buffer = Buffer.alloc(size);
|
|
164493
164493
|
let fd;
|
|
164494
164494
|
try {
|
|
164495
|
-
fd =
|
|
164496
|
-
|
|
164497
|
-
|
|
164495
|
+
fd = fs20.openSync(command6, "r");
|
|
164496
|
+
fs20.readSync(fd, buffer, 0, size, 0);
|
|
164497
|
+
fs20.closeSync(fd);
|
|
164498
164498
|
} catch (e7) {
|
|
164499
164499
|
}
|
|
164500
164500
|
return shebangCommand(buffer.toString());
|
|
@@ -164507,7 +164507,7 @@ var require_readShebang = __commonJS({
|
|
|
164507
164507
|
var require_parse5 = __commonJS({
|
|
164508
164508
|
"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
164509
164509
|
"use strict";
|
|
164510
|
-
var
|
|
164510
|
+
var path37 = __require("path");
|
|
164511
164511
|
var resolveCommand = require_resolveCommand();
|
|
164512
164512
|
var escape2 = require_escape();
|
|
164513
164513
|
var readShebang = require_readShebang();
|
|
@@ -164532,7 +164532,7 @@ var require_parse5 = __commonJS({
|
|
|
164532
164532
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
164533
164533
|
if (parsed.options.forceShell || needsShell) {
|
|
164534
164534
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
164535
|
-
parsed.command =
|
|
164535
|
+
parsed.command = path37.normalize(parsed.command);
|
|
164536
164536
|
parsed.command = escape2.command(parsed.command);
|
|
164537
164537
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
164538
164538
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -177050,7 +177050,7 @@ var init_chatCompletion = __esm({
|
|
|
177050
177050
|
|
|
177051
177051
|
// src/server/pluginAgentServer.ts
|
|
177052
177052
|
import { existsSync as existsSync4 } from "node:fs";
|
|
177053
|
-
import
|
|
177053
|
+
import path36 from "node:path";
|
|
177054
177054
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
177055
177055
|
|
|
177056
177056
|
// src/server/agent/config.ts
|
|
@@ -177950,20 +177950,23 @@ var AgentConfigService = class extends AgentConfigBase {
|
|
|
177950
177950
|
/** ensureTestModel 的实现(调用方已持配置写锁) */
|
|
177951
177951
|
async writeEnsureTestModel(input) {
|
|
177952
177952
|
const provider = input.provider.trim();
|
|
177953
|
-
const
|
|
177953
|
+
const modelIds = (Array.isArray(input.modelId) ? input.modelId : [input.modelId]).map((m5) => m5.trim()).filter(Boolean);
|
|
177954
177954
|
const baseUrl = assertHttpUrl(input.baseUrl);
|
|
177955
|
+
if (!modelIds.length) return;
|
|
177955
177956
|
const cfg = await loadProjectConfig(this.sdkRoot, AGENT_PROJECT_ID);
|
|
177956
|
-
const
|
|
177957
|
-
|
|
177958
|
-
|
|
177959
|
-
|
|
177960
|
-
|
|
177961
|
-
|
|
177962
|
-
|
|
177963
|
-
|
|
177964
|
-
|
|
177965
|
-
|
|
177966
|
-
|
|
177957
|
+
for (const modelId of modelIds) {
|
|
177958
|
+
const existing = cfg.models.find((m5) => m5.provider === provider && m5.model_id === modelId);
|
|
177959
|
+
if (existing && existing.base_url === baseUrl && !!existing.api_key) continue;
|
|
177960
|
+
await addModel(this.sdkRoot, AGENT_PROJECT_ID, {
|
|
177961
|
+
provider,
|
|
177962
|
+
model_id: modelId,
|
|
177963
|
+
api_key: input.apiKey,
|
|
177964
|
+
base_url: baseUrl,
|
|
177965
|
+
client_type: "openai-chat",
|
|
177966
|
+
context_window: 2e5,
|
|
177967
|
+
vision: true
|
|
177968
|
+
});
|
|
177969
|
+
}
|
|
177967
177970
|
}
|
|
177968
177971
|
/**
|
|
177969
177972
|
* **按 provider 批量写模型** —— 界面「一个渠道一次配一批模型」的落点。
|
|
@@ -181141,26 +181144,26 @@ var throwNestingLimitExceeded = () => {
|
|
|
181141
181144
|
};
|
|
181142
181145
|
|
|
181143
181146
|
// ../../../node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/utils/url.js
|
|
181144
|
-
var splitPath = (
|
|
181145
|
-
const paths =
|
|
181147
|
+
var splitPath = (path37) => {
|
|
181148
|
+
const paths = path37.split("/");
|
|
181146
181149
|
if (paths[0] === "") {
|
|
181147
181150
|
paths.shift();
|
|
181148
181151
|
}
|
|
181149
181152
|
return paths;
|
|
181150
181153
|
};
|
|
181151
181154
|
var splitRoutingPath = (routePath) => {
|
|
181152
|
-
const { groups, path:
|
|
181153
|
-
const paths = splitPath(
|
|
181155
|
+
const { groups, path: path37 } = extractGroupsFromPath(routePath);
|
|
181156
|
+
const paths = splitPath(path37);
|
|
181154
181157
|
return replaceGroupMarks(paths, groups);
|
|
181155
181158
|
};
|
|
181156
|
-
var extractGroupsFromPath = (
|
|
181159
|
+
var extractGroupsFromPath = (path37) => {
|
|
181157
181160
|
const groups = [];
|
|
181158
|
-
|
|
181161
|
+
path37 = path37.replace(/\{[^}]+\}/g, (match2, index) => {
|
|
181159
181162
|
const mark = `@${index}`;
|
|
181160
181163
|
groups.push([mark, match2]);
|
|
181161
181164
|
return mark;
|
|
181162
181165
|
});
|
|
181163
|
-
return { groups, path:
|
|
181166
|
+
return { groups, path: path37 };
|
|
181164
181167
|
};
|
|
181165
181168
|
var replaceGroupMarks = (paths, groups) => {
|
|
181166
181169
|
for (let i7 = groups.length - 1; i7 >= 0; i7--) {
|
|
@@ -181217,8 +181220,8 @@ var getPath = (request) => {
|
|
|
181217
181220
|
const queryIndex = url2.indexOf("?", i7);
|
|
181218
181221
|
const hashIndex = url2.indexOf("#", i7);
|
|
181219
181222
|
const end2 = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
|
|
181220
|
-
const
|
|
181221
|
-
return tryDecodeURI(
|
|
181223
|
+
const path37 = url2.slice(start, end2);
|
|
181224
|
+
return tryDecodeURI(path37.includes("%25") ? path37.replace(/%25/g, "%2525") : path37);
|
|
181222
181225
|
} else if (charCode === 63 || charCode === 35) {
|
|
181223
181226
|
break;
|
|
181224
181227
|
}
|
|
@@ -181235,11 +181238,11 @@ var mergePath = (base, sub, ...rest) => {
|
|
|
181235
181238
|
}
|
|
181236
181239
|
return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
|
|
181237
181240
|
};
|
|
181238
|
-
var checkOptionalParameter = (
|
|
181239
|
-
if (
|
|
181241
|
+
var checkOptionalParameter = (path37) => {
|
|
181242
|
+
if (path37.charCodeAt(path37.length - 1) !== 63 || !path37.includes(":")) {
|
|
181240
181243
|
return null;
|
|
181241
181244
|
}
|
|
181242
|
-
const segments =
|
|
181245
|
+
const segments = path37.split("/");
|
|
181243
181246
|
const results = [];
|
|
181244
181247
|
let basePath = "";
|
|
181245
181248
|
segments.forEach((segment) => {
|
|
@@ -181381,9 +181384,9 @@ var HonoRequest = class {
|
|
|
181381
181384
|
*/
|
|
181382
181385
|
path;
|
|
181383
181386
|
bodyCache = {};
|
|
181384
|
-
constructor(request,
|
|
181387
|
+
constructor(request, path37 = "/", matchResult = [[]]) {
|
|
181385
181388
|
this.raw = request;
|
|
181386
|
-
this.path =
|
|
181389
|
+
this.path = path37;
|
|
181387
181390
|
this.#matchResult = matchResult;
|
|
181388
181391
|
}
|
|
181389
181392
|
param(key) {
|
|
@@ -182154,8 +182157,8 @@ var Hono = class _Hono {
|
|
|
182154
182157
|
return this;
|
|
182155
182158
|
};
|
|
182156
182159
|
});
|
|
182157
|
-
this.on = (method,
|
|
182158
|
-
for (const p3 of [
|
|
182160
|
+
this.on = (method, path37, ...handlers) => {
|
|
182161
|
+
for (const p3 of [path37].flat()) {
|
|
182159
182162
|
this.#path = p3;
|
|
182160
182163
|
for (const m5 of [method].flat()) {
|
|
182161
182164
|
handlers.map((handler) => {
|
|
@@ -182212,8 +182215,8 @@ var Hono = class _Hono {
|
|
|
182212
182215
|
* app.route("/api", app2) // GET /api/user
|
|
182213
182216
|
* ```
|
|
182214
182217
|
*/
|
|
182215
|
-
route(
|
|
182216
|
-
const subApp = this.basePath(
|
|
182218
|
+
route(path37, app) {
|
|
182219
|
+
const subApp = this.basePath(path37);
|
|
182217
182220
|
app.routes.map((r7) => {
|
|
182218
182221
|
let handler;
|
|
182219
182222
|
if (app.errorHandler === errorHandler) {
|
|
@@ -182239,9 +182242,9 @@ var Hono = class _Hono {
|
|
|
182239
182242
|
* const api = new Hono().basePath('/api')
|
|
182240
182243
|
* ```
|
|
182241
182244
|
*/
|
|
182242
|
-
basePath(
|
|
182245
|
+
basePath(path37) {
|
|
182243
182246
|
const subApp = this.#clone();
|
|
182244
|
-
subApp._basePath = mergePath(this._basePath,
|
|
182247
|
+
subApp._basePath = mergePath(this._basePath, path37);
|
|
182245
182248
|
return subApp;
|
|
182246
182249
|
}
|
|
182247
182250
|
/**
|
|
@@ -182315,7 +182318,7 @@ var Hono = class _Hono {
|
|
|
182315
182318
|
* })
|
|
182316
182319
|
* ```
|
|
182317
182320
|
*/
|
|
182318
|
-
mount(
|
|
182321
|
+
mount(path37, applicationHandler, options) {
|
|
182319
182322
|
let replaceRequest;
|
|
182320
182323
|
let optionHandler;
|
|
182321
182324
|
if (options) {
|
|
@@ -182342,7 +182345,7 @@ var Hono = class _Hono {
|
|
|
182342
182345
|
return [c6.env, executionContext];
|
|
182343
182346
|
};
|
|
182344
182347
|
replaceRequest ||= (() => {
|
|
182345
|
-
const mergedPath = mergePath(this._basePath,
|
|
182348
|
+
const mergedPath = mergePath(this._basePath, path37);
|
|
182346
182349
|
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
182347
182350
|
return (request) => {
|
|
182348
182351
|
const url2 = new URL(request.url);
|
|
@@ -182357,19 +182360,19 @@ var Hono = class _Hono {
|
|
|
182357
182360
|
}
|
|
182358
182361
|
await next();
|
|
182359
182362
|
};
|
|
182360
|
-
this.#addRoute(METHOD_NAME_ALL, mergePath(
|
|
182363
|
+
this.#addRoute(METHOD_NAME_ALL, mergePath(path37, "*"), handler);
|
|
182361
182364
|
return this;
|
|
182362
182365
|
}
|
|
182363
|
-
#addRoute(method,
|
|
182366
|
+
#addRoute(method, path37, handler, baseRoutePath) {
|
|
182364
182367
|
method = method.toUpperCase();
|
|
182365
|
-
|
|
182368
|
+
path37 = mergePath(this._basePath, path37);
|
|
182366
182369
|
const r7 = {
|
|
182367
182370
|
basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
|
|
182368
|
-
path:
|
|
182371
|
+
path: path37,
|
|
182369
182372
|
method,
|
|
182370
182373
|
handler
|
|
182371
182374
|
};
|
|
182372
|
-
this.router.add(method,
|
|
182375
|
+
this.router.add(method, path37, [handler, r7]);
|
|
182373
182376
|
this.routes.push(r7);
|
|
182374
182377
|
}
|
|
182375
182378
|
#handleError(err, c6) {
|
|
@@ -182382,10 +182385,10 @@ var Hono = class _Hono {
|
|
|
182382
182385
|
if (method === "HEAD") {
|
|
182383
182386
|
return (async () => new Response(null, await this.#dispatch(request, executionCtx, env2, "GET")))();
|
|
182384
182387
|
}
|
|
182385
|
-
const
|
|
182386
|
-
const matchResult = this.router.match(method,
|
|
182388
|
+
const path37 = this.getPath(request, { env: env2 });
|
|
182389
|
+
const matchResult = this.router.match(method, path37);
|
|
182387
182390
|
const c6 = new Context(request, {
|
|
182388
|
-
path:
|
|
182391
|
+
path: path37,
|
|
182389
182392
|
matchResult,
|
|
182390
182393
|
env: env2,
|
|
182391
182394
|
executionCtx,
|
|
@@ -182488,7 +182491,7 @@ var createNullObject = () => /* @__PURE__ */ Object.create(null);
|
|
|
182488
182491
|
|
|
182489
182492
|
// ../../../node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
182490
182493
|
var emptyParam = [];
|
|
182491
|
-
function match(method,
|
|
182494
|
+
function match(method, path37) {
|
|
182492
182495
|
const matchers = this.buildAllMatchers();
|
|
182493
182496
|
const match2 = ((method2, path210) => {
|
|
182494
182497
|
const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
|
|
@@ -182504,7 +182507,7 @@ function match(method, path36) {
|
|
|
182504
182507
|
return [matcher[1][index], match3];
|
|
182505
182508
|
});
|
|
182506
182509
|
this.match = match2;
|
|
182507
|
-
return match2(method,
|
|
182510
|
+
return match2(method, path37);
|
|
182508
182511
|
}
|
|
182509
182512
|
|
|
182510
182513
|
// ../../../node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
@@ -182621,14 +182624,14 @@ var Trie = class {
|
|
|
182621
182624
|
#index = 0;
|
|
182622
182625
|
// dynamic path -> [handler index, param assoc]; static paths are not registered
|
|
182623
182626
|
paths = createNullObject();
|
|
182624
|
-
insert(
|
|
182627
|
+
insert(path37, isStatic) {
|
|
182625
182628
|
if (isStatic) {
|
|
182626
|
-
this.#root.insert(
|
|
182629
|
+
this.#root.insert(path37.split(""), 0, [], this.#context, true);
|
|
182627
182630
|
return;
|
|
182628
182631
|
}
|
|
182629
182632
|
const paramAssoc = [];
|
|
182630
182633
|
const groups = [];
|
|
182631
|
-
let markedPath =
|
|
182634
|
+
let markedPath = path37;
|
|
182632
182635
|
for (let i7 = 0; ; ) {
|
|
182633
182636
|
let replaced = false;
|
|
182634
182637
|
markedPath = markedPath.replace(/\{[^}]+\}/g, (m5) => {
|
|
@@ -182653,7 +182656,7 @@ var Trie = class {
|
|
|
182653
182656
|
}
|
|
182654
182657
|
}
|
|
182655
182658
|
this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false);
|
|
182656
|
-
this.paths[
|
|
182659
|
+
this.paths[path37] = [this.#index++, paramAssoc];
|
|
182657
182660
|
}
|
|
182658
182661
|
buildRegExp() {
|
|
182659
182662
|
let regexp = this.#root.buildRegExpStr();
|
|
@@ -182680,17 +182683,17 @@ var Trie = class {
|
|
|
182680
182683
|
|
|
182681
182684
|
// ../../../node_modules/.pnpm/hono@4.13.5/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
182682
182685
|
var wildcardRegExpCache = createNullObject();
|
|
182683
|
-
function buildWildcardRegExp(
|
|
182684
|
-
return wildcardRegExpCache[
|
|
182685
|
-
`^${
|
|
182686
|
+
function buildWildcardRegExp(path37) {
|
|
182687
|
+
return wildcardRegExpCache[path37] ??= new RegExp(
|
|
182688
|
+
`^${path37.replace(
|
|
182686
182689
|
/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g,
|
|
182687
182690
|
(match2, metaChar) => metaChar ? `\\${metaChar}` : match2 === "/*" ? TAIL_WILDCARD_REG_EXP_STR : match2 === "*" ? ONLY_WILDCARD_REG_EXP_STR : `/:${LABEL_REG_EXP_STR}`
|
|
182688
182691
|
)}$`
|
|
182689
182692
|
);
|
|
182690
182693
|
}
|
|
182691
|
-
function findMiddleware(middleware,
|
|
182694
|
+
function findMiddleware(middleware, path37) {
|
|
182692
182695
|
for (const k6 of Object.keys(middleware).sort((a6, b6) => b6.length - a6.length)) {
|
|
182693
|
-
if (buildWildcardRegExp(k6).test(
|
|
182696
|
+
if (buildWildcardRegExp(k6).test(path37)) {
|
|
182694
182697
|
return [...middleware[k6]];
|
|
182695
182698
|
}
|
|
182696
182699
|
}
|
|
@@ -182706,14 +182709,14 @@ var RegExpRouter = class {
|
|
|
182706
182709
|
this.#routes = { [METHOD_NAME_ALL]: createNullObject() };
|
|
182707
182710
|
this.#tries = { [METHOD_NAME_ALL]: new Trie() };
|
|
182708
182711
|
}
|
|
182709
|
-
#insertPath(method,
|
|
182712
|
+
#insertPath(method, path37) {
|
|
182710
182713
|
try {
|
|
182711
|
-
this.#tries[method].insert(
|
|
182714
|
+
this.#tries[method].insert(path37, !/\*|\/:/.test(path37));
|
|
182712
182715
|
} catch (e7) {
|
|
182713
|
-
throw e7 === PATH_ERROR ? new UnsupportedPathError(
|
|
182716
|
+
throw e7 === PATH_ERROR ? new UnsupportedPathError(path37) : e7;
|
|
182714
182717
|
}
|
|
182715
182718
|
}
|
|
182716
|
-
add(method,
|
|
182719
|
+
add(method, path37, handler) {
|
|
182717
182720
|
const middleware = this.#middleware;
|
|
182718
182721
|
const routes = this.#routes;
|
|
182719
182722
|
if (!middleware) {
|
|
@@ -182729,28 +182732,28 @@ var RegExpRouter = class {
|
|
|
182729
182732
|
}
|
|
182730
182733
|
}
|
|
182731
182734
|
}
|
|
182732
|
-
if (
|
|
182733
|
-
|
|
182735
|
+
if (path37 === "/*") {
|
|
182736
|
+
path37 = "*";
|
|
182734
182737
|
}
|
|
182735
182738
|
const methods = method === METHOD_NAME_ALL ? Object.keys(middleware) : [method];
|
|
182736
|
-
if (/\*$/.test(
|
|
182737
|
-
const re = buildWildcardRegExp(
|
|
182739
|
+
if (/\*$/.test(path37)) {
|
|
182740
|
+
const re = buildWildcardRegExp(path37);
|
|
182738
182741
|
for (const m5 of methods) {
|
|
182739
|
-
if (!middleware[m5][
|
|
182740
|
-
this.#insertPath(m5,
|
|
182741
|
-
middleware[m5][
|
|
182742
|
+
if (!middleware[m5][path37]) {
|
|
182743
|
+
this.#insertPath(m5, path37);
|
|
182744
|
+
middleware[m5][path37] = findMiddleware(middleware[m5], path37) || findMiddleware(middleware[METHOD_NAME_ALL], path37) || [];
|
|
182742
182745
|
}
|
|
182743
182746
|
}
|
|
182744
182747
|
for (const handlerMap of [middleware, routes]) {
|
|
182745
182748
|
for (const m5 of methods) {
|
|
182746
182749
|
for (const p3 in handlerMap[m5]) {
|
|
182747
|
-
re.test(p3) && handlerMap[m5][p3].push([handler,
|
|
182750
|
+
re.test(p3) && handlerMap[m5][p3].push([handler, path37]);
|
|
182748
182751
|
}
|
|
182749
182752
|
}
|
|
182750
182753
|
}
|
|
182751
182754
|
return;
|
|
182752
182755
|
}
|
|
182753
|
-
const paths = checkOptionalParameter(
|
|
182756
|
+
const paths = checkOptionalParameter(path37) || [path37];
|
|
182754
182757
|
for (const path210 of paths) {
|
|
182755
182758
|
for (const m5 of methods) {
|
|
182756
182759
|
if (!routes[m5][path210]) {
|
|
@@ -182779,11 +182782,11 @@ var RegExpRouter = class {
|
|
|
182779
182782
|
const handlerData = [];
|
|
182780
182783
|
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
182781
182784
|
for (const r7 of [middleware, routes]) {
|
|
182782
|
-
for (const
|
|
182783
|
-
const handlers = r7[
|
|
182784
|
-
const pathData = trie.paths[
|
|
182785
|
+
for (const path37 in r7) {
|
|
182786
|
+
const handlers = r7[path37];
|
|
182787
|
+
const pathData = trie.paths[path37];
|
|
182785
182788
|
if (!pathData) {
|
|
182786
|
-
staticMap[
|
|
182789
|
+
staticMap[path37] = [handlers.map(([h7]) => [h7, createNullObject()]), emptyParam];
|
|
182787
182790
|
continue;
|
|
182788
182791
|
}
|
|
182789
182792
|
handlerData[pathData[0]] = handlers.map(([h7, handlerPath]) => [
|
|
@@ -182807,13 +182810,13 @@ var SmartRouter = class {
|
|
|
182807
182810
|
constructor(init) {
|
|
182808
182811
|
this.#routers = init.routers;
|
|
182809
182812
|
}
|
|
182810
|
-
add(method,
|
|
182813
|
+
add(method, path37, handler) {
|
|
182811
182814
|
if (!this.#routes) {
|
|
182812
182815
|
throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
182813
182816
|
}
|
|
182814
|
-
this.#routes.push([method,
|
|
182817
|
+
this.#routes.push([method, path37, handler]);
|
|
182815
182818
|
}
|
|
182816
|
-
match(method,
|
|
182819
|
+
match(method, path37) {
|
|
182817
182820
|
if (!this.#routes) {
|
|
182818
182821
|
throw new Error("Fatal error");
|
|
182819
182822
|
}
|
|
@@ -182828,7 +182831,7 @@ var SmartRouter = class {
|
|
|
182828
182831
|
for (let i22 = 0, len2 = routes.length; i22 < len2; i22++) {
|
|
182829
182832
|
router.add(...routes[i22]);
|
|
182830
182833
|
}
|
|
182831
|
-
res = router.match(method,
|
|
182834
|
+
res = router.match(method, path37);
|
|
182832
182835
|
} catch (e7) {
|
|
182833
182836
|
if (e7 instanceof UnsupportedPathError) {
|
|
182834
182837
|
continue;
|
|
@@ -182863,9 +182866,9 @@ var Node2 = class _Node2 {
|
|
|
182863
182866
|
#patterns = [];
|
|
182864
182867
|
#pattern;
|
|
182865
182868
|
#params = emptyParams;
|
|
182866
|
-
insert(method,
|
|
182869
|
+
insert(method, path37, handler) {
|
|
182867
182870
|
let curNode = this;
|
|
182868
|
-
const parts = splitRoutingPath(
|
|
182871
|
+
const parts = splitRoutingPath(path37);
|
|
182869
182872
|
const possibleKeys = /* @__PURE__ */ new Set();
|
|
182870
182873
|
let i7 = 0;
|
|
182871
182874
|
for (const p3 of parts) {
|
|
@@ -182905,12 +182908,12 @@ var Node2 = class _Node2 {
|
|
|
182905
182908
|
}
|
|
182906
182909
|
}
|
|
182907
182910
|
}
|
|
182908
|
-
search(method,
|
|
182911
|
+
search(method, path37) {
|
|
182909
182912
|
const handlerSets = [];
|
|
182910
182913
|
this.#params = emptyParams;
|
|
182911
182914
|
const curNode = this;
|
|
182912
182915
|
let curNodes = [curNode];
|
|
182913
|
-
const parts = splitPath(
|
|
182916
|
+
const parts = splitPath(path37);
|
|
182914
182917
|
const curNodesQueue = [];
|
|
182915
182918
|
const len = parts.length;
|
|
182916
182919
|
let partOffsets = null;
|
|
@@ -182952,13 +182955,13 @@ var Node2 = class _Node2 {
|
|
|
182952
182955
|
if (matcher !== true) {
|
|
182953
182956
|
if (!partOffsets) {
|
|
182954
182957
|
partOffsets = [];
|
|
182955
|
-
let offset =
|
|
182958
|
+
let offset = path37[0] === "/" ? 1 : 0;
|
|
182956
182959
|
for (let p3 = 0; p3 < len; p3++) {
|
|
182957
182960
|
partOffsets[p3] = offset;
|
|
182958
182961
|
offset += parts[p3].length + 1;
|
|
182959
182962
|
}
|
|
182960
182963
|
}
|
|
182961
|
-
const restPathString =
|
|
182964
|
+
const restPathString = path37.slice(partOffsets[i7]);
|
|
182962
182965
|
const m5 = matcher.exec(restPathString);
|
|
182963
182966
|
if (m5) {
|
|
182964
182967
|
params[name2] = m5[0];
|
|
@@ -183018,13 +183021,13 @@ var Node2 = class _Node2 {
|
|
|
183018
183021
|
var TrieRouter = class {
|
|
183019
183022
|
name = "TrieRouter";
|
|
183020
183023
|
#node = new Node2();
|
|
183021
|
-
add(method,
|
|
183022
|
-
for (const result of checkOptionalParameter(
|
|
183024
|
+
add(method, path37, handler) {
|
|
183025
|
+
for (const result of checkOptionalParameter(path37) || [path37]) {
|
|
183023
183026
|
this.#node.insert(method, result, handler);
|
|
183024
183027
|
}
|
|
183025
183028
|
}
|
|
183026
|
-
match(method,
|
|
183027
|
-
return this.#node.search(method,
|
|
183029
|
+
match(method, path37) {
|
|
183030
|
+
return this.#node.search(method, path37);
|
|
183028
183031
|
}
|
|
183029
183032
|
};
|
|
183030
183033
|
|
|
@@ -183043,6 +183046,10 @@ var Hono2 = class extends Hono {
|
|
|
183043
183046
|
}
|
|
183044
183047
|
};
|
|
183045
183048
|
|
|
183049
|
+
// src/server/routes/agent.ts
|
|
183050
|
+
import { promises as fs19 } from "node:fs";
|
|
183051
|
+
import path35 from "node:path";
|
|
183052
|
+
|
|
183046
183053
|
// src/ui/render/modelBrandIcons.ts
|
|
183047
183054
|
var MODEL_BRAND_ICONS = {
|
|
183048
183055
|
// 主题色白名单: 品牌图标为内容资产(SVG 自带品牌填充色,切主题不变)
|
|
@@ -183354,6 +183361,43 @@ function iconRoutes() {
|
|
|
183354
183361
|
// src/server/routes/agent.ts
|
|
183355
183362
|
function agentRoutes(config2, runtime) {
|
|
183356
183363
|
const app = new Hono2();
|
|
183364
|
+
const IMAGE_MIME = {
|
|
183365
|
+
".png": "image/png",
|
|
183366
|
+
".jpg": "image/jpeg",
|
|
183367
|
+
".jpeg": "image/jpeg",
|
|
183368
|
+
".gif": "image/gif",
|
|
183369
|
+
".webp": "image/webp",
|
|
183370
|
+
".bmp": "image/bmp",
|
|
183371
|
+
".svg": "image/svg+xml",
|
|
183372
|
+
".avif": "image/avif",
|
|
183373
|
+
".ico": "image/x-icon"
|
|
183374
|
+
};
|
|
183375
|
+
const MAX_IMAGE_BYTES2 = 12 * 1024 * 1024;
|
|
183376
|
+
app.get("/api/agent/file", async (c6) => {
|
|
183377
|
+
const raw2 = c6.req.query("path") ?? "";
|
|
183378
|
+
if (!raw2) return c6.json({ ok: false, error: "\u7F3A\u5C11 path" }, 400);
|
|
183379
|
+
const cleaned = raw2.replace(/^\\\\\?\\/, "").replace(/\\/g, "/");
|
|
183380
|
+
const ext = path35.extname(cleaned).toLowerCase();
|
|
183381
|
+
const mime = IMAGE_MIME[ext];
|
|
183382
|
+
if (!mime) return c6.json({ ok: false, error: "\u53EA\u5141\u8BB8\u8BFB\u53D6\u56FE\u7247\u6587\u4EF6" }, 400);
|
|
183383
|
+
const root6 = path35.resolve(agentRoot(config2.dataDir));
|
|
183384
|
+
const target = path35.resolve(cleaned);
|
|
183385
|
+
const rel = path35.relative(root6, target);
|
|
183386
|
+
if (!rel || rel.startsWith("..") || path35.isAbsolute(rel)) {
|
|
183387
|
+
return c6.json({ ok: false, error: "\u6587\u4EF6\u4E0D\u5728 Agent \u6570\u636E\u76EE\u5F55\u5185" }, 400);
|
|
183388
|
+
}
|
|
183389
|
+
const stat6 = await fs19.stat(target).catch(() => null);
|
|
183390
|
+
if (!stat6?.isFile()) return c6.json({ ok: false, error: "\u6587\u4EF6\u4E0D\u5B58\u5728" }, 404);
|
|
183391
|
+
if (stat6.size > MAX_IMAGE_BYTES2) return c6.json({ ok: false, error: "\u56FE\u7247\u8FC7\u5927" }, 413);
|
|
183392
|
+
const bytes = await fs19.readFile(target).catch(() => null);
|
|
183393
|
+
if (!bytes) return c6.json({ ok: false, error: "\u8BFB\u53D6\u5931\u8D25" }, 500);
|
|
183394
|
+
return c6.body(bytes, 200, {
|
|
183395
|
+
"content-type": mime,
|
|
183396
|
+
// 草稿目录里的文件可能被同名覆盖 → 短缓存 + 必须回源校验
|
|
183397
|
+
"cache-control": "private, max-age=60, must-revalidate",
|
|
183398
|
+
"x-content-type-options": "nosniff"
|
|
183399
|
+
});
|
|
183400
|
+
});
|
|
183357
183401
|
async function guard(fn) {
|
|
183358
183402
|
try {
|
|
183359
183403
|
return { ok: true, value: await fn() };
|
|
@@ -184884,7 +184928,7 @@ function apply(ctx) {
|
|
|
184884
184928
|
function vendorDirBesideArtifact() {
|
|
184885
184929
|
try {
|
|
184886
184930
|
const here = fileURLToPath4(import.meta.url);
|
|
184887
|
-
const dir =
|
|
184931
|
+
const dir = path36.join(path36.dirname(here), "vendor-plugins");
|
|
184888
184932
|
return existsSync4(dir) ? dir : void 0;
|
|
184889
184933
|
} catch {
|
|
184890
184934
|
return void 0;
|