@launchdarkly/mcp-server 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/FUNCTIONS.md +3 -3
  2. package/README.md +21 -13
  3. package/bin/mcp-server.js +1499 -339
  4. package/bin/mcp-server.js.map +41 -25
  5. package/dist/commonjs/funcs/auditLogListEntries.d.ts +21 -0
  6. package/dist/commonjs/funcs/auditLogListEntries.d.ts.map +1 -0
  7. package/dist/commonjs/funcs/auditLogListEntries.js +128 -0
  8. package/dist/commonjs/funcs/auditLogListEntries.js.map +1 -0
  9. package/dist/commonjs/lib/config.d.ts +2 -2
  10. package/dist/commonjs/lib/config.js +2 -2
  11. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
  12. package/dist/commonjs/mcp-server/cli/start/command.js +12 -0
  13. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
  14. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +2 -0
  15. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
  16. package/dist/commonjs/mcp-server/cli/start/impl.js +60 -20
  17. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  18. package/dist/commonjs/mcp-server/cli/start/sse-security.d.ts +5 -0
  19. package/dist/commonjs/mcp-server/cli/start/sse-security.d.ts.map +1 -0
  20. package/dist/commonjs/mcp-server/cli/start/sse-security.js +26 -0
  21. package/dist/commonjs/mcp-server/cli/start/sse-security.js.map +1 -0
  22. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  23. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  24. package/dist/commonjs/mcp-server/server.js +3 -1
  25. package/dist/commonjs/mcp-server/server.js.map +1 -1
  26. package/dist/commonjs/mcp-server/tools/auditLogListEntries.d.ts +8 -0
  27. package/dist/commonjs/mcp-server/tools/auditLogListEntries.d.ts.map +1 -0
  28. package/dist/commonjs/mcp-server/tools/auditLogListEntries.js +64 -0
  29. package/dist/commonjs/mcp-server/tools/auditLogListEntries.js.map +1 -0
  30. package/dist/commonjs/models/components/auditlogentrylistingrep.d.ts +93 -0
  31. package/dist/commonjs/models/components/auditlogentrylistingrep.d.ts.map +1 -0
  32. package/dist/commonjs/models/components/auditlogentrylistingrep.js +113 -0
  33. package/dist/commonjs/models/components/auditlogentrylistingrep.js.map +1 -0
  34. package/dist/commonjs/models/components/auditlogentrylistingrepcollection.d.ts +31 -0
  35. package/dist/commonjs/models/components/auditlogentrylistingrepcollection.d.ts.map +1 -0
  36. package/dist/commonjs/models/components/auditlogentrylistingrepcollection.js +71 -0
  37. package/dist/commonjs/models/components/auditlogentrylistingrepcollection.js.map +1 -0
  38. package/dist/commonjs/models/components/authorizedappdatarep.d.ts +42 -0
  39. package/dist/commonjs/models/components/authorizedappdatarep.d.ts.map +1 -0
  40. package/dist/commonjs/models/components/authorizedappdatarep.js +78 -0
  41. package/dist/commonjs/models/components/authorizedappdatarep.js.map +1 -0
  42. package/dist/commonjs/models/components/index.d.ts +9 -0
  43. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  44. package/dist/commonjs/models/components/index.js +9 -0
  45. package/dist/commonjs/models/components/index.js.map +1 -1
  46. package/dist/commonjs/models/components/memberdatarep.d.ts +42 -0
  47. package/dist/commonjs/models/components/memberdatarep.d.ts.map +1 -0
  48. package/dist/commonjs/models/components/memberdatarep.js +78 -0
  49. package/dist/commonjs/models/components/memberdatarep.js.map +1 -0
  50. package/dist/commonjs/models/components/parentresourcerep.d.ts +32 -0
  51. package/dist/commonjs/models/components/parentresourcerep.d.ts.map +1 -0
  52. package/dist/commonjs/models/components/parentresourcerep.js +72 -0
  53. package/dist/commonjs/models/components/parentresourcerep.js.map +1 -0
  54. package/dist/commonjs/models/components/resourceaccess.d.ts +19 -0
  55. package/dist/commonjs/models/components/resourceaccess.d.ts.map +1 -0
  56. package/dist/commonjs/models/components/resourceaccess.js +60 -0
  57. package/dist/commonjs/models/components/resourceaccess.js.map +1 -0
  58. package/dist/commonjs/models/components/subjectdatarep.d.ts +32 -0
  59. package/dist/commonjs/models/components/subjectdatarep.d.ts.map +1 -0
  60. package/dist/commonjs/models/components/subjectdatarep.js +72 -0
  61. package/dist/commonjs/models/components/subjectdatarep.js.map +1 -0
  62. package/dist/commonjs/models/components/targetresourcerep.d.ts +32 -0
  63. package/dist/commonjs/models/components/targetresourcerep.d.ts.map +1 -0
  64. package/dist/commonjs/models/components/targetresourcerep.js +72 -0
  65. package/dist/commonjs/models/components/targetresourcerep.js.map +1 -0
  66. package/dist/commonjs/models/components/tokensummary.d.ts +39 -0
  67. package/dist/commonjs/models/components/tokensummary.d.ts.map +1 -0
  68. package/dist/commonjs/models/components/tokensummary.js +78 -0
  69. package/dist/commonjs/models/components/tokensummary.js.map +1 -0
  70. package/dist/commonjs/models/operations/getauditlogentries.d.ts +40 -0
  71. package/dist/commonjs/models/operations/getauditlogentries.d.ts.map +1 -0
  72. package/dist/commonjs/models/operations/getauditlogentries.js +66 -0
  73. package/dist/commonjs/models/operations/getauditlogentries.js.map +1 -0
  74. package/dist/commonjs/models/operations/index.d.ts +1 -0
  75. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  76. package/dist/commonjs/models/operations/index.js +1 -0
  77. package/dist/commonjs/models/operations/index.js.map +1 -1
  78. package/dist/commonjs/sdk/auditlog.d.ts +15 -0
  79. package/dist/commonjs/sdk/auditlog.d.ts.map +1 -0
  80. package/dist/commonjs/sdk/auditlog.js +24 -0
  81. package/dist/commonjs/sdk/auditlog.js.map +1 -0
  82. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  83. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  84. package/dist/commonjs/sdk/sdk.js +4 -0
  85. package/dist/commonjs/sdk/sdk.js.map +1 -1
  86. package/dist/esm/funcs/auditLogListEntries.d.ts +21 -0
  87. package/dist/esm/funcs/auditLogListEntries.d.ts.map +1 -0
  88. package/dist/esm/funcs/auditLogListEntries.js +92 -0
  89. package/dist/esm/funcs/auditLogListEntries.js.map +1 -0
  90. package/dist/esm/lib/config.d.ts +2 -2
  91. package/dist/esm/lib/config.js +2 -2
  92. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
  93. package/dist/esm/mcp-server/cli/start/command.js +12 -0
  94. package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
  95. package/dist/esm/mcp-server/cli/start/impl.d.ts +2 -0
  96. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
  97. package/dist/esm/mcp-server/cli/start/impl.js +60 -20
  98. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  99. package/dist/esm/mcp-server/cli/start/sse-security.d.ts +5 -0
  100. package/dist/esm/mcp-server/cli/start/sse-security.d.ts.map +1 -0
  101. package/dist/esm/mcp-server/cli/start/sse-security.js +21 -0
  102. package/dist/esm/mcp-server/cli/start/sse-security.js.map +1 -0
  103. package/dist/esm/mcp-server/mcp-server.js +1 -1
  104. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  105. package/dist/esm/mcp-server/server.js +3 -1
  106. package/dist/esm/mcp-server/server.js.map +1 -1
  107. package/dist/esm/mcp-server/tools/auditLogListEntries.d.ts +8 -0
  108. package/dist/esm/mcp-server/tools/auditLogListEntries.d.ts.map +1 -0
  109. package/dist/esm/mcp-server/tools/auditLogListEntries.js +28 -0
  110. package/dist/esm/mcp-server/tools/auditLogListEntries.js.map +1 -0
  111. package/dist/esm/models/components/auditlogentrylistingrep.d.ts +93 -0
  112. package/dist/esm/models/components/auditlogentrylistingrep.d.ts.map +1 -0
  113. package/dist/esm/models/components/auditlogentrylistingrep.js +75 -0
  114. package/dist/esm/models/components/auditlogentrylistingrep.js.map +1 -0
  115. package/dist/esm/models/components/auditlogentrylistingrepcollection.d.ts +31 -0
  116. package/dist/esm/models/components/auditlogentrylistingrepcollection.d.ts.map +1 -0
  117. package/dist/esm/models/components/auditlogentrylistingrepcollection.js +33 -0
  118. package/dist/esm/models/components/auditlogentrylistingrepcollection.js.map +1 -0
  119. package/dist/esm/models/components/authorizedappdatarep.d.ts +42 -0
  120. package/dist/esm/models/components/authorizedappdatarep.d.ts.map +1 -0
  121. package/dist/esm/models/components/authorizedappdatarep.js +40 -0
  122. package/dist/esm/models/components/authorizedappdatarep.js.map +1 -0
  123. package/dist/esm/models/components/index.d.ts +9 -0
  124. package/dist/esm/models/components/index.d.ts.map +1 -1
  125. package/dist/esm/models/components/index.js +9 -0
  126. package/dist/esm/models/components/index.js.map +1 -1
  127. package/dist/esm/models/components/memberdatarep.d.ts +42 -0
  128. package/dist/esm/models/components/memberdatarep.d.ts.map +1 -0
  129. package/dist/esm/models/components/memberdatarep.js +40 -0
  130. package/dist/esm/models/components/memberdatarep.js.map +1 -0
  131. package/dist/esm/models/components/parentresourcerep.d.ts +32 -0
  132. package/dist/esm/models/components/parentresourcerep.d.ts.map +1 -0
  133. package/dist/esm/models/components/parentresourcerep.js +34 -0
  134. package/dist/esm/models/components/parentresourcerep.js.map +1 -0
  135. package/dist/esm/models/components/resourceaccess.d.ts +19 -0
  136. package/dist/esm/models/components/resourceaccess.d.ts.map +1 -0
  137. package/dist/esm/models/components/resourceaccess.js +22 -0
  138. package/dist/esm/models/components/resourceaccess.js.map +1 -0
  139. package/dist/esm/models/components/subjectdatarep.d.ts +32 -0
  140. package/dist/esm/models/components/subjectdatarep.d.ts.map +1 -0
  141. package/dist/esm/models/components/subjectdatarep.js +34 -0
  142. package/dist/esm/models/components/subjectdatarep.js.map +1 -0
  143. package/dist/esm/models/components/targetresourcerep.d.ts +32 -0
  144. package/dist/esm/models/components/targetresourcerep.d.ts.map +1 -0
  145. package/dist/esm/models/components/targetresourcerep.js +34 -0
  146. package/dist/esm/models/components/targetresourcerep.js.map +1 -0
  147. package/dist/esm/models/components/tokensummary.d.ts +39 -0
  148. package/dist/esm/models/components/tokensummary.d.ts.map +1 -0
  149. package/dist/esm/models/components/tokensummary.js +40 -0
  150. package/dist/esm/models/components/tokensummary.js.map +1 -0
  151. package/dist/esm/models/operations/getauditlogentries.d.ts +40 -0
  152. package/dist/esm/models/operations/getauditlogentries.d.ts.map +1 -0
  153. package/dist/esm/models/operations/getauditlogentries.js +28 -0
  154. package/dist/esm/models/operations/getauditlogentries.js.map +1 -0
  155. package/dist/esm/models/operations/index.d.ts +1 -0
  156. package/dist/esm/models/operations/index.d.ts.map +1 -1
  157. package/dist/esm/models/operations/index.js +1 -0
  158. package/dist/esm/models/operations/index.js.map +1 -1
  159. package/dist/esm/sdk/auditlog.d.ts +15 -0
  160. package/dist/esm/sdk/auditlog.d.ts.map +1 -0
  161. package/dist/esm/sdk/auditlog.js +20 -0
  162. package/dist/esm/sdk/auditlog.js.map +1 -0
  163. package/dist/esm/sdk/sdk.d.ts +3 -0
  164. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  165. package/dist/esm/sdk/sdk.js +4 -0
  166. package/dist/esm/sdk/sdk.js.map +1 -1
  167. package/examples/{codeReferencesListRepositories.example.ts → auditLogListEntries.example.ts} +2 -2
  168. package/jsr.json +1 -1
  169. package/package.json +2 -1
  170. package/src/funcs/auditLogListEntries.ts +192 -0
  171. package/src/lib/config.ts +2 -2
  172. package/src/mcp-server/cli/start/command.ts +14 -0
  173. package/src/mcp-server/cli/start/impl.ts +69 -20
  174. package/src/mcp-server/cli/start/sse-security.ts +31 -0
  175. package/src/mcp-server/mcp-server.ts +1 -1
  176. package/src/mcp-server/server.ts +3 -1
  177. package/src/mcp-server/tools/auditLogListEntries.ts +38 -0
  178. package/src/models/components/auditlogentrylistingrep.ts +210 -0
  179. package/src/models/components/auditlogentrylistingrepcollection.ts +84 -0
  180. package/src/models/components/authorizedappdatarep.ts +96 -0
  181. package/src/models/components/index.ts +9 -0
  182. package/src/models/components/memberdatarep.ts +92 -0
  183. package/src/models/components/parentresourcerep.ts +80 -0
  184. package/src/models/components/resourceaccess.ts +51 -0
  185. package/src/models/components/subjectdatarep.ts +76 -0
  186. package/src/models/components/targetresourcerep.ts +80 -0
  187. package/src/models/components/tokensummary.ts +89 -0
  188. package/src/models/operations/getauditlogentries.ts +82 -0
  189. package/src/models/operations/index.ts +1 -0
  190. package/src/sdk/auditlog.ts +30 -0
  191. package/src/sdk/sdk.ts +6 -0
  192. package/test/sse-security.test.mjs +84 -0
package/bin/mcp-server.js CHANGED
@@ -14880,7 +14880,54 @@ var init_stdio2 = __esm(() => {
14880
14880
  init_stdio();
14881
14881
  });
14882
14882
 
14883
- // node_modules/statuses/codes.json
14883
+ // node_modules/@modelcontextprotocol/sdk/dist/esm/server/middleware/hostHeaderValidation.js
14884
+ function hostHeaderValidation(allowedHostnames) {
14885
+ return (req, res, next) => {
14886
+ const hostHeader = req.headers.host;
14887
+ if (!hostHeader) {
14888
+ res.status(403).json({
14889
+ jsonrpc: "2.0",
14890
+ error: {
14891
+ code: -32000,
14892
+ message: "Missing Host header"
14893
+ },
14894
+ id: null
14895
+ });
14896
+ return;
14897
+ }
14898
+ let hostname;
14899
+ try {
14900
+ hostname = new URL(`http://${hostHeader}`).hostname;
14901
+ } catch {
14902
+ res.status(403).json({
14903
+ jsonrpc: "2.0",
14904
+ error: {
14905
+ code: -32000,
14906
+ message: `Invalid Host header: ${hostHeader}`
14907
+ },
14908
+ id: null
14909
+ });
14910
+ return;
14911
+ }
14912
+ if (!allowedHostnames.includes(hostname)) {
14913
+ res.status(403).json({
14914
+ jsonrpc: "2.0",
14915
+ error: {
14916
+ code: -32000,
14917
+ message: `Invalid Host: ${hostname}`
14918
+ },
14919
+ id: null
14920
+ });
14921
+ return;
14922
+ }
14923
+ next();
14924
+ };
14925
+ }
14926
+ function localhostHostValidation() {
14927
+ return hostHeaderValidation(["localhost", "127.0.0.1", "[::1]"]);
14928
+ }
14929
+
14930
+ // node_modules/body-parser/node_modules/statuses/codes.json
14884
14931
  var require_codes2 = __commonJS((exports, module) => {
14885
14932
  module.exports = {
14886
14933
  "100": "Continue",
@@ -14949,7 +14996,7 @@ var require_codes2 = __commonJS((exports, module) => {
14949
14996
  };
14950
14997
  });
14951
14998
 
14952
- // node_modules/statuses/index.js
14999
+ // node_modules/body-parser/node_modules/statuses/index.js
14953
15000
  var require_statuses2 = __commonJS((exports, module) => {
14954
15001
  /*!
14955
15002
  * statuses
@@ -15023,7 +15070,7 @@ var require_statuses2 = __commonJS((exports, module) => {
15023
15070
  }
15024
15071
  });
15025
15072
 
15026
- // node_modules/http-errors/index.js
15073
+ // node_modules/body-parser/node_modules/http-errors/index.js
15027
15074
  var require_http_errors2 = __commonJS((exports, module) => {
15028
15075
  /*!
15029
15076
  * http-errors
@@ -15186,7 +15233,7 @@ var require_http_errors2 = __commonJS((exports, module) => {
15186
15233
  });
15187
15234
  }
15188
15235
  function toClassName(name) {
15189
- return name.substr(-5) !== "Error" ? name + "Error" : name;
15236
+ return name.slice(-5) === "Error" ? name : name + "Error";
15190
15237
  }
15191
15238
  });
15192
15239
 
@@ -28314,12 +28361,15 @@ var require_json = __commonJS((exports, module) => {
28314
28361
  var JSON_SYNTAX_REGEXP = /#+/g;
28315
28362
  function json(options) {
28316
28363
  var opts = options || {};
28317
- var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit;
28364
+ var limit = typeof opts.limit === "undefined" || opts.limit === null ? 102400 : bytes.parse(opts.limit);
28318
28365
  var inflate = opts.inflate !== false;
28319
28366
  var reviver = opts.reviver;
28320
28367
  var strict = opts.strict !== false;
28321
28368
  var type = opts.type || "application/json";
28322
28369
  var verify = opts.verify || false;
28370
+ if (limit === null) {
28371
+ throw new TypeError('option limit "' + String(opts.limit) + '" is invalid');
28372
+ }
28323
28373
  if (verify !== false && typeof verify !== "function") {
28324
28374
  throw new TypeError("option verify must be function");
28325
28375
  }
@@ -28384,10 +28434,7 @@ var require_json = __commonJS((exports, module) => {
28384
28434
  var index = str.indexOf(char);
28385
28435
  var partial2 = "";
28386
28436
  if (index !== -1) {
28387
- partial2 = str.substring(0, index) + JSON_SYNTAX_CHAR;
28388
- for (var i = index + 1;i < str.length; i++) {
28389
- partial2 += JSON_SYNTAX_CHAR;
28390
- }
28437
+ partial2 = str.substring(0, index) + new Array(str.length - index + 1).join(JSON_SYNTAX_CHAR);
28391
28438
  }
28392
28439
  try {
28393
28440
  JSON.parse(partial2);
@@ -28446,9 +28493,12 @@ var require_raw = __commonJS((exports, module) => {
28446
28493
  function raw(options) {
28447
28494
  var opts = options || {};
28448
28495
  var inflate = opts.inflate !== false;
28449
- var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit;
28496
+ var limit = typeof opts.limit === "undefined" || opts.limit === null ? 102400 : bytes.parse(opts.limit);
28450
28497
  var type = opts.type || "application/octet-stream";
28451
28498
  var verify = opts.verify || false;
28499
+ if (limit === null) {
28500
+ throw new TypeError('option limit "' + String(opts.limit) + '" is invalid');
28501
+ }
28452
28502
  if (verify !== false && typeof verify !== "function") {
28453
28503
  throw new TypeError("option verify must be function");
28454
28504
  }
@@ -28506,9 +28556,12 @@ var require_text = __commonJS((exports, module) => {
28506
28556
  var opts = options || {};
28507
28557
  var defaultCharset = opts.defaultCharset || "utf-8";
28508
28558
  var inflate = opts.inflate !== false;
28509
- var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit;
28559
+ var limit = typeof opts.limit === "undefined" || opts.limit === null ? 102400 : bytes.parse(opts.limit);
28510
28560
  var type = opts.type || "text/plain";
28511
28561
  var verify = opts.verify || false;
28562
+ if (limit === null) {
28563
+ throw new TypeError('option limit "' + String(opts.limit) + '" is invalid');
28564
+ }
28512
28565
  if (verify !== false && typeof verify !== "function") {
28513
28566
  throw new TypeError("option verify must be function");
28514
28567
  }
@@ -29149,9 +29202,8 @@ var require_side_channel_list = __commonJS((exports, module) => {
29149
29202
  }
29150
29203
  },
29151
29204
  delete: function(key) {
29152
- var root = $o && $o.next;
29153
29205
  var deletedNode = listDelete($o, key);
29154
- if (deletedNode && root && root === deletedNode) {
29206
+ if (deletedNode && $o && !$o.next) {
29155
29207
  $o = undefined;
29156
29208
  }
29157
29209
  return !!deletedNode;
@@ -29997,7 +30049,8 @@ var require_side_channel = __commonJS((exports, module) => {
29997
30049
  var channel = {
29998
30050
  assert: function(key) {
29999
30051
  if (!channel.has(key)) {
30000
- throw new $TypeError("Side channel does not contain " + inspect(key));
30052
+ var keyDesc = key && Object(key) === key ? "the given object key" : inspect(key);
30053
+ throw new $TypeError("Side channel does not contain " + keyDesc);
30001
30054
  }
30002
30055
  },
30003
30056
  delete: function(key) {
@@ -30046,12 +30099,28 @@ var require_formats = __commonJS((exports, module) => {
30046
30099
  // node_modules/qs/lib/utils.js
30047
30100
  var require_utils = __commonJS((exports, module) => {
30048
30101
  var formats = require_formats();
30102
+ var getSideChannel = require_side_channel();
30103
+ var defineProperty = require_es_define_property();
30049
30104
  var has = Object.prototype.hasOwnProperty;
30050
30105
  var isArray = Array.isArray;
30106
+ var overflowChannel = getSideChannel();
30107
+ var markOverflow = function markOverflow(obj, maxIndex) {
30108
+ overflowChannel.set(obj, maxIndex);
30109
+ return obj;
30110
+ };
30111
+ var isOverflow = function isOverflow(obj) {
30112
+ return overflowChannel.has(obj);
30113
+ };
30114
+ var getMaxIndex = function getMaxIndex(obj) {
30115
+ return overflowChannel.get(obj);
30116
+ };
30117
+ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
30118
+ overflowChannel.set(obj, maxIndex);
30119
+ };
30051
30120
  var hexTable = function() {
30052
30121
  var array2 = [];
30053
30122
  for (var i = 0;i < 256; ++i) {
30054
- array2.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase());
30123
+ array2[array2.length] = "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase();
30055
30124
  }
30056
30125
  return array2;
30057
30126
  }();
@@ -30063,7 +30132,7 @@ var require_utils = __commonJS((exports, module) => {
30063
30132
  var compacted = [];
30064
30133
  for (var j2 = 0;j2 < obj.length; ++j2) {
30065
30134
  if (typeof obj[j2] !== "undefined") {
30066
- compacted.push(obj[j2]);
30135
+ compacted[compacted.length] = obj[j2];
30067
30136
  }
30068
30137
  }
30069
30138
  item.obj[item.prop] = compacted;
@@ -30071,7 +30140,7 @@ var require_utils = __commonJS((exports, module) => {
30071
30140
  }
30072
30141
  };
30073
30142
  var arrayToObject = function arrayToObject(source, options) {
30074
- var obj = options && options.plainObjects ? Object.create(null) : {};
30143
+ var obj = options && options.plainObjects ? { __proto__: null } : {};
30075
30144
  for (var i = 0;i < source.length; ++i) {
30076
30145
  if (typeof source[i] !== "undefined") {
30077
30146
  obj[i] = source[i];
@@ -30079,15 +30148,40 @@ var require_utils = __commonJS((exports, module) => {
30079
30148
  }
30080
30149
  return obj;
30081
30150
  };
30151
+ var setProperty = function setProperty(obj, key, value) {
30152
+ if (key === "__proto__" && defineProperty) {
30153
+ defineProperty(obj, key, {
30154
+ configurable: true,
30155
+ enumerable: true,
30156
+ value,
30157
+ writable: true
30158
+ });
30159
+ } else {
30160
+ obj[key] = value;
30161
+ }
30162
+ };
30082
30163
  var merge2 = function merge(target, source, options) {
30083
30164
  if (!source) {
30084
30165
  return target;
30085
30166
  }
30086
- if (typeof source !== "object") {
30167
+ if (typeof source !== "object" && typeof source !== "function") {
30087
30168
  if (isArray(target)) {
30088
- target.push(source);
30169
+ var nextIndex = target.length;
30170
+ if (options && typeof options.arrayLimit === "number" && nextIndex >= options.arrayLimit) {
30171
+ if (options.throwOnLimitExceeded) {
30172
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30173
+ }
30174
+ return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
30175
+ }
30176
+ target[nextIndex] = source;
30089
30177
  } else if (target && typeof target === "object") {
30090
- if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
30178
+ if (isOverflow(target)) {
30179
+ var newIndex = getMaxIndex(target) + 1;
30180
+ target[newIndex] = source;
30181
+ setMaxIndex(target, newIndex);
30182
+ } else if (options && options.strictMerge) {
30183
+ return [target, source];
30184
+ } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
30091
30185
  target[source] = true;
30092
30186
  }
30093
30187
  } else {
@@ -30096,7 +30190,23 @@ var require_utils = __commonJS((exports, module) => {
30096
30190
  return target;
30097
30191
  }
30098
30192
  if (!target || typeof target !== "object") {
30099
- return [target].concat(source);
30193
+ if (isOverflow(source)) {
30194
+ var sourceKeys = Object.keys(source);
30195
+ var result = options && options.plainObjects ? { __proto__: null, 0: target } : { 0: target };
30196
+ for (var m = 0;m < sourceKeys.length; m++) {
30197
+ var oldKey = parseInt(sourceKeys[m], 10);
30198
+ result[oldKey + 1] = source[sourceKeys[m]];
30199
+ }
30200
+ return markOverflow(result, getMaxIndex(source) + 1);
30201
+ }
30202
+ var combined = [target].concat(source);
30203
+ if (options && typeof options.arrayLimit === "number" && combined.length > options.arrayLimit) {
30204
+ if (options.throwOnLimitExceeded) {
30205
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30206
+ }
30207
+ return markOverflow(arrayToObject(combined, options), combined.length - 1);
30208
+ }
30209
+ return combined;
30100
30210
  }
30101
30211
  var mergeTarget = target;
30102
30212
  if (isArray(target) && !isArray(source)) {
@@ -30109,31 +30219,46 @@ var require_utils = __commonJS((exports, module) => {
30109
30219
  if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
30110
30220
  target[i] = merge(targetItem, item, options);
30111
30221
  } else {
30112
- target.push(item);
30222
+ target[target.length] = item;
30113
30223
  }
30114
30224
  } else {
30115
30225
  target[i] = item;
30116
30226
  }
30117
30227
  });
30228
+ if (options && typeof options.arrayLimit === "number" && target.length > options.arrayLimit) {
30229
+ if (options.throwOnLimitExceeded) {
30230
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30231
+ }
30232
+ return markOverflow(arrayToObject(target, options), target.length - 1);
30233
+ }
30118
30234
  return target;
30119
30235
  }
30120
30236
  return Object.keys(source).reduce(function(acc, key) {
30121
30237
  var value = source[key];
30122
30238
  if (has.call(acc, key)) {
30123
- acc[key] = merge(acc[key], value, options);
30239
+ setProperty(acc, key, merge(acc[key], value, options));
30124
30240
  } else {
30125
- acc[key] = value;
30241
+ setProperty(acc, key, value);
30242
+ }
30243
+ if (isOverflow(source) && !isOverflow(acc)) {
30244
+ markOverflow(acc, getMaxIndex(source));
30245
+ }
30246
+ if (isOverflow(acc)) {
30247
+ var keyNum = parseInt(key, 10);
30248
+ if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {
30249
+ setMaxIndex(acc, keyNum);
30250
+ }
30126
30251
  }
30127
30252
  return acc;
30128
30253
  }, mergeTarget);
30129
30254
  };
30130
30255
  var assign = function assignSingleSource(target, source) {
30131
30256
  return Object.keys(source).reduce(function(acc, key) {
30132
- acc[key] = source[key];
30257
+ setProperty(acc, key, source[key]);
30133
30258
  return acc;
30134
30259
  }, target);
30135
30260
  };
30136
- var decode2 = function(str, decoder, charset) {
30261
+ var decode2 = function(str, defaultDecoder, charset) {
30137
30262
  var strWithoutPlus = str.replace(/\+/g, " ");
30138
30263
  if (charset === "iso-8859-1") {
30139
30264
  return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
@@ -30163,6 +30288,13 @@ var require_utils = __commonJS((exports, module) => {
30163
30288
  var out = "";
30164
30289
  for (var j2 = 0;j2 < string3.length; j2 += limit) {
30165
30290
  var segment = string3.length >= limit ? string3.slice(j2, j2 + limit) : string3;
30291
+ if (j2 + limit < string3.length) {
30292
+ var last = segment.charCodeAt(segment.length - 1);
30293
+ if (last >= 55296 && last <= 56319) {
30294
+ segment = segment.slice(0, -1);
30295
+ j2 -= 1;
30296
+ }
30297
+ }
30166
30298
  var arr = [];
30167
30299
  for (var i = 0;i < segment.length; ++i) {
30168
30300
  var c = segment.charCodeAt(i);
@@ -30192,7 +30324,7 @@ var require_utils = __commonJS((exports, module) => {
30192
30324
  };
30193
30325
  var compact = function compact(value) {
30194
30326
  var queue = [{ obj: { o: value }, prop: "o" }];
30195
- var refs = [];
30327
+ var refs = getSideChannel();
30196
30328
  for (var i = 0;i < queue.length; ++i) {
30197
30329
  var item = queue[i];
30198
30330
  var obj = item.obj[item.prop];
@@ -30200,9 +30332,9 @@ var require_utils = __commonJS((exports, module) => {
30200
30332
  for (var j2 = 0;j2 < keys.length; ++j2) {
30201
30333
  var key = keys[j2];
30202
30334
  var val = obj[key];
30203
- if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
30204
- queue.push({ obj, prop: key });
30205
- refs.push(val);
30335
+ if (typeof val === "object" && val !== null && !refs.has(val)) {
30336
+ queue[queue.length] = { obj, prop: key };
30337
+ refs.set(val, true);
30206
30338
  }
30207
30339
  }
30208
30340
  }
@@ -30218,14 +30350,30 @@ var require_utils = __commonJS((exports, module) => {
30218
30350
  }
30219
30351
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
30220
30352
  };
30221
- var combine = function combine(a, b2) {
30222
- return [].concat(a, b2);
30353
+ var combine = function combine(a, b2, arrayLimit, plainObjects, throwOnLimitExceeded) {
30354
+ if (isOverflow(a)) {
30355
+ if (throwOnLimitExceeded) {
30356
+ throw new RangeError("Array limit exceeded. Only " + arrayLimit + " element" + (arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30357
+ }
30358
+ var newIndex = getMaxIndex(a) + 1;
30359
+ a[newIndex] = b2;
30360
+ setMaxIndex(a, newIndex);
30361
+ return a;
30362
+ }
30363
+ var result = [].concat(a, b2);
30364
+ if (result.length > arrayLimit) {
30365
+ if (throwOnLimitExceeded) {
30366
+ throw new RangeError("Array limit exceeded. Only " + arrayLimit + " element" + (arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30367
+ }
30368
+ return markOverflow(arrayToObject(result, { plainObjects }), result.length - 1);
30369
+ }
30370
+ return result;
30223
30371
  };
30224
30372
  var maybeMap = function maybeMap(val, fn) {
30225
30373
  if (isArray(val)) {
30226
30374
  var mapped = [];
30227
30375
  for (var i = 0;i < val.length; i += 1) {
30228
- mapped.push(fn(val[i]));
30376
+ mapped[mapped.length] = fn(val[i]);
30229
30377
  }
30230
30378
  return mapped;
30231
30379
  }
@@ -30239,7 +30387,9 @@ var require_utils = __commonJS((exports, module) => {
30239
30387
  decode: decode2,
30240
30388
  encode: encode2,
30241
30389
  isBuffer,
30390
+ isOverflow,
30242
30391
  isRegExp,
30392
+ markOverflow,
30243
30393
  maybeMap,
30244
30394
  merge: merge2
30245
30395
  };
@@ -30277,11 +30427,13 @@ var require_stringify = __commonJS((exports, module) => {
30277
30427
  arrayFormat: "indices",
30278
30428
  charset: "utf-8",
30279
30429
  charsetSentinel: false,
30430
+ commaRoundTrip: false,
30280
30431
  delimiter: "&",
30281
30432
  encode: true,
30282
30433
  encodeDotInKeys: false,
30283
30434
  encoder: utils.encode,
30284
30435
  encodeValuesOnly: false,
30436
+ filter: undefined,
30285
30437
  format: defaultFormat,
30286
30438
  formatter: formats.formatters[defaultFormat],
30287
30439
  indices: false,
@@ -30328,7 +30480,7 @@ var require_stringify = __commonJS((exports, module) => {
30328
30480
  }
30329
30481
  if (obj === null) {
30330
30482
  if (strictNullHandling) {
30331
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
30483
+ return formatter(encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix);
30332
30484
  }
30333
30485
  obj = "";
30334
30486
  }
@@ -30346,7 +30498,9 @@ var require_stringify = __commonJS((exports, module) => {
30346
30498
  var objKeys;
30347
30499
  if (generateArrayPrefix === "comma" && isArray(obj)) {
30348
30500
  if (encodeValuesOnly && encoder) {
30349
- obj = utils.maybeMap(obj, encoder);
30501
+ obj = utils.maybeMap(obj, function(v2) {
30502
+ return v2 == null ? v2 : encoder(v2);
30503
+ });
30350
30504
  }
30351
30505
  objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : undefined }];
30352
30506
  } else if (isArray(filter)) {
@@ -30355,18 +30509,18 @@ var require_stringify = __commonJS((exports, module) => {
30355
30509
  var keys = Object.keys(obj);
30356
30510
  objKeys = sort ? keys.sort(sort) : keys;
30357
30511
  }
30358
- var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix;
30512
+ var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
30359
30513
  var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
30360
30514
  if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
30361
30515
  return adjustedPrefix + "[]";
30362
30516
  }
30363
30517
  for (var j2 = 0;j2 < objKeys.length; ++j2) {
30364
30518
  var key = objKeys[j2];
30365
- var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key];
30519
+ var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
30366
30520
  if (skipNulls && value === null) {
30367
30521
  continue;
30368
30522
  }
30369
- var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key;
30523
+ var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
30370
30524
  var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
30371
30525
  sideChannel.set(object2, step);
30372
30526
  var valueSideChannel = getSideChannel();
@@ -30423,7 +30577,7 @@ var require_stringify = __commonJS((exports, module) => {
30423
30577
  arrayFormat,
30424
30578
  charset,
30425
30579
  charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
30426
- commaRoundTrip: opts.commaRoundTrip,
30580
+ commaRoundTrip: !!opts.commaRoundTrip,
30427
30581
  delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
30428
30582
  encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
30429
30583
  encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
@@ -30465,18 +30619,22 @@ var require_stringify = __commonJS((exports, module) => {
30465
30619
  var sideChannel = getSideChannel();
30466
30620
  for (var i = 0;i < objKeys.length; ++i) {
30467
30621
  var key = objKeys[i];
30468
- if (options.skipNulls && obj[key] === null) {
30622
+ if (typeof key === "undefined" || key === null) {
30469
30623
  continue;
30470
30624
  }
30471
- pushToArray(keys, stringify(obj[key], key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel));
30625
+ var value = obj[key];
30626
+ if (options.skipNulls && value === null) {
30627
+ continue;
30628
+ }
30629
+ pushToArray(keys, stringify(value, key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel));
30472
30630
  }
30473
30631
  var joined = keys.join(options.delimiter);
30474
30632
  var prefix = options.addQueryPrefix === true ? "?" : "";
30475
30633
  if (options.charsetSentinel) {
30476
30634
  if (options.charset === "iso-8859-1") {
30477
- prefix += "utf8=%26%2310003%3B&";
30635
+ prefix += "utf8=%26%2310003%3B" + options.delimiter;
30478
30636
  } else {
30479
- prefix += "utf8=%E2%9C%93&";
30637
+ prefix += "utf8=%E2%9C%93" + options.delimiter;
30480
30638
  }
30481
30639
  }
30482
30640
  return joined.length > 0 ? prefix + joined : "";
@@ -30508,17 +30666,33 @@ var require_parse = __commonJS((exports, module) => {
30508
30666
  parseArrays: true,
30509
30667
  plainObjects: false,
30510
30668
  strictDepth: false,
30511
- strictNullHandling: false
30669
+ strictMerge: true,
30670
+ strictNullHandling: false,
30671
+ throwOnLimitExceeded: false
30512
30672
  };
30513
30673
  var interpretNumericEntities = function(str) {
30514
30674
  return str.replace(/&#(\d+);/g, function($0, numberStr) {
30515
30675
  return String.fromCharCode(parseInt(numberStr, 10));
30516
30676
  });
30517
30677
  };
30518
- var parseArrayValue = function(val, options) {
30678
+ var parseArrayValue = function(val, options, currentArrayLength, isFlatArrayValue) {
30519
30679
  if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
30680
+ if (isFlatArrayValue && options.throwOnLimitExceeded) {
30681
+ var commaCount = 0;
30682
+ var commaIndex = val.indexOf(",");
30683
+ while (commaIndex > -1) {
30684
+ commaCount += 1;
30685
+ if (commaCount >= options.arrayLimit) {
30686
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30687
+ }
30688
+ commaIndex = val.indexOf(",", commaIndex + 1);
30689
+ }
30690
+ }
30520
30691
  return val.split(",");
30521
30692
  }
30693
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
30694
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30695
+ }
30522
30696
  return val;
30523
30697
  };
30524
30698
  var isoSentinel = "utf8=%26%2310003%3B";
@@ -30528,7 +30702,10 @@ var require_parse = __commonJS((exports, module) => {
30528
30702
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
30529
30703
  cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
30530
30704
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
30531
- var parts = cleanStr.split(options.delimiter, limit);
30705
+ var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded && typeof limit !== "undefined" ? limit + 1 : limit);
30706
+ if (options.throwOnLimitExceeded && typeof limit !== "undefined" && parts.length > limit) {
30707
+ throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
30708
+ }
30532
30709
  var skipIndex = -1;
30533
30710
  var i;
30534
30711
  var charset = options.charset;
@@ -30552,48 +30729,71 @@ var require_parse = __commonJS((exports, module) => {
30552
30729
  var part = parts[i];
30553
30730
  var bracketEqualsPos = part.indexOf("]=");
30554
30731
  var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
30555
- var key, val;
30732
+ var key;
30733
+ var val;
30556
30734
  if (pos === -1) {
30557
30735
  key = options.decoder(part, defaults.decoder, charset, "key");
30558
30736
  val = options.strictNullHandling ? null : "";
30559
30737
  } else {
30560
30738
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
30561
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options), function(encodedVal) {
30562
- return options.decoder(encodedVal, defaults.decoder, charset, "value");
30563
- });
30739
+ if (key !== null) {
30740
+ val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0, part.indexOf("[]=") === -1), function(encodedVal) {
30741
+ return options.decoder(encodedVal, defaults.decoder, charset, "value");
30742
+ });
30743
+ }
30564
30744
  }
30565
30745
  if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
30566
- val = interpretNumericEntities(val);
30746
+ val = interpretNumericEntities(String(val));
30567
30747
  }
30568
30748
  if (part.indexOf("[]=") > -1) {
30569
30749
  val = isArray(val) ? [val] : val;
30570
30750
  }
30571
- var existing = has.call(obj, key);
30572
- if (existing && options.duplicates === "combine") {
30573
- obj[key] = utils.combine(obj[key], val);
30574
- } else if (!existing || options.duplicates === "last") {
30575
- obj[key] = val;
30751
+ if (options.comma && isArray(val) && val.length > options.arrayLimit) {
30752
+ val = utils.combine([], val, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
30753
+ }
30754
+ if (key !== null) {
30755
+ var existing = has.call(obj, key);
30756
+ if (existing && (options.duplicates === "combine" || part.indexOf("[]=") > -1)) {
30757
+ obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
30758
+ } else if (!existing || options.duplicates === "last") {
30759
+ obj[key] = val;
30760
+ }
30576
30761
  }
30577
30762
  }
30578
30763
  return obj;
30579
30764
  };
30580
30765
  var parseObject = function(chain, val, options, valuesParsed) {
30581
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
30766
+ var currentArrayLength = 0;
30767
+ if (chain.length > 0 && chain[chain.length - 1] === "[]") {
30768
+ var parentKey = chain.slice(0, -1).join("");
30769
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
30770
+ }
30771
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
30582
30772
  for (var i = chain.length - 1;i >= 0; --i) {
30583
30773
  var obj;
30584
30774
  var root = chain[i];
30585
30775
  if (root === "[]" && options.parseArrays) {
30586
- obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
30776
+ if (utils.isOverflow(leaf)) {
30777
+ obj = leaf;
30778
+ } else {
30779
+ obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
30780
+ }
30587
30781
  } else {
30588
- obj = options.plainObjects ? Object.create(null) : {};
30782
+ obj = options.plainObjects ? { __proto__: null } : {};
30589
30783
  var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
30590
30784
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
30591
30785
  var index = parseInt(decodedRoot, 10);
30786
+ var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
30592
30787
  if (!options.parseArrays && decodedRoot === "") {
30593
30788
  obj = { 0: leaf };
30594
- } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
30789
+ } else if (isValidArrayIndex && index < options.arrayLimit) {
30595
30790
  obj = [];
30596
30791
  obj[index] = leaf;
30792
+ } else if (isValidArrayIndex && options.throwOnLimitExceeded) {
30793
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
30794
+ } else if (isValidArrayIndex) {
30795
+ obj[index] = leaf;
30796
+ utils.markOverflow(obj, index);
30597
30797
  } else if (decodedRoot !== "__proto__") {
30598
30798
  obj[decodedRoot] = leaf;
30599
30799
  }
@@ -30602,39 +30802,74 @@ var require_parse = __commonJS((exports, module) => {
30602
30802
  }
30603
30803
  return leaf;
30604
30804
  };
30605
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
30606
- if (!givenKey) {
30607
- return;
30805
+ var splitKeyIntoSegments = function splitKeyIntoSegments(originalKey, options) {
30806
+ var key = options.allowDots ? originalKey.replace(/\.([^.[]+)/g, "[$1]") : originalKey;
30807
+ if (options.depth <= 0) {
30808
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
30809
+ if (!options.allowPrototypes) {
30810
+ return;
30811
+ }
30812
+ }
30813
+ return [key];
30608
30814
  }
30609
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
30610
- var brackets = /(\[[^[\]]*])/;
30611
- var child = /(\[[^[\]]*])/g;
30612
- var segment = options.depth > 0 && brackets.exec(key);
30613
- var parent = segment ? key.slice(0, segment.index) : key;
30614
- var keys = [];
30815
+ var segments = [];
30816
+ var first = key.indexOf("[");
30817
+ var parent = first >= 0 ? key.slice(0, first) : key;
30615
30818
  if (parent) {
30616
30819
  if (!options.plainObjects && has.call(Object.prototype, parent)) {
30617
30820
  if (!options.allowPrototypes) {
30618
30821
  return;
30619
30822
  }
30620
30823
  }
30621
- keys.push(parent);
30824
+ segments[segments.length] = parent;
30622
30825
  }
30623
- var i = 0;
30624
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
30625
- i += 1;
30626
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
30627
- if (!options.allowPrototypes) {
30628
- return;
30826
+ var n = key.length;
30827
+ var open = first;
30828
+ var collected = 0;
30829
+ while (open >= 0 && collected < options.depth) {
30830
+ var level = 1;
30831
+ var i = open + 1;
30832
+ var close = -1;
30833
+ while (i < n && close < 0) {
30834
+ var cu = key.charCodeAt(i);
30835
+ if (cu === 91) {
30836
+ level += 1;
30837
+ } else if (cu === 93) {
30838
+ level -= 1;
30839
+ if (level === 0) {
30840
+ close = i;
30841
+ }
30629
30842
  }
30843
+ i += 1;
30844
+ }
30845
+ if (close < 0) {
30846
+ segments[segments.length] = "[" + key.slice(open) + "]";
30847
+ return segments;
30848
+ }
30849
+ var seg = key.slice(open, close + 1);
30850
+ var content = seg.slice(1, -1);
30851
+ if (!options.plainObjects && has.call(Object.prototype, content) && !options.allowPrototypes) {
30852
+ return;
30630
30853
  }
30631
- keys.push(segment[1]);
30854
+ segments[segments.length] = seg;
30855
+ collected += 1;
30856
+ open = key.indexOf("[", close + 1);
30632
30857
  }
30633
- if (segment) {
30858
+ if (open >= 0) {
30634
30859
  if (options.strictDepth === true) {
30635
30860
  throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
30636
30861
  }
30637
- keys.push("[" + key.slice(segment.index) + "]");
30862
+ segments[segments.length] = "[" + key.slice(open) + "]";
30863
+ }
30864
+ return segments;
30865
+ };
30866
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
30867
+ if (!givenKey) {
30868
+ return;
30869
+ }
30870
+ var keys = splitKeyIntoSegments(givenKey, options);
30871
+ if (!keys) {
30872
+ return;
30638
30873
  }
30639
30874
  return parseObject(keys, val, options, valuesParsed);
30640
30875
  };
@@ -30654,6 +30889,9 @@ var require_parse = __commonJS((exports, module) => {
30654
30889
  if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
30655
30890
  throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
30656
30891
  }
30892
+ if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") {
30893
+ throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
30894
+ }
30657
30895
  var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
30658
30896
  var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
30659
30897
  if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
@@ -30680,16 +30918,18 @@ var require_parse = __commonJS((exports, module) => {
30680
30918
  parseArrays: opts.parseArrays !== false,
30681
30919
  plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
30682
30920
  strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
30683
- strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
30921
+ strictMerge: typeof opts.strictMerge === "boolean" ? !!opts.strictMerge : defaults.strictMerge,
30922
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling,
30923
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === "boolean" ? opts.throwOnLimitExceeded : false
30684
30924
  };
30685
30925
  };
30686
30926
  module.exports = function(str, opts) {
30687
30927
  var options = normalizeParseOptions(opts);
30688
30928
  if (str === "" || str === null || typeof str === "undefined") {
30689
- return options.plainObjects ? Object.create(null) : {};
30929
+ return options.plainObjects ? { __proto__: null } : {};
30690
30930
  }
30691
30931
  var tempObj = typeof str === "string" ? parseValues(str, options) : str;
30692
- var obj = options.plainObjects ? Object.create(null) : {};
30932
+ var obj = options.plainObjects ? { __proto__: null } : {};
30693
30933
  var keys = Object.keys(tempObj);
30694
30934
  for (var i = 0;i < keys.length; ++i) {
30695
30935
  var key = keys[i];
@@ -30739,10 +30979,12 @@ var require_urlencoded = __commonJS((exports, module) => {
30739
30979
  }
30740
30980
  var extended = opts.extended !== false;
30741
30981
  var inflate = opts.inflate !== false;
30742
- var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit;
30982
+ var limit = typeof opts.limit === "undefined" || opts.limit === null ? 102400 : bytes.parse(opts.limit);
30743
30983
  var type = opts.type || "application/x-www-form-urlencoded";
30744
30984
  var verify = opts.verify || false;
30745
- var depth = typeof opts.depth !== "number" ? Number(opts.depth || 32) : opts.depth;
30985
+ if (limit === null) {
30986
+ throw new TypeError('option limit "' + String(opts.limit) + '" is invalid');
30987
+ }
30746
30988
  if (verify !== false && typeof verify !== "function") {
30747
30989
  throw new TypeError("option verify must be function");
30748
30990
  }
@@ -30783,14 +31025,13 @@ var require_urlencoded = __commonJS((exports, module) => {
30783
31025
  encoding: charset,
30784
31026
  inflate,
30785
31027
  limit,
30786
- verify,
30787
- depth
31028
+ verify
30788
31029
  });
30789
31030
  };
30790
31031
  }
30791
31032
  function extendedparser(options) {
30792
31033
  var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000;
30793
- var depth = typeof options.depth !== "number" ? Number(options.depth || 32) : options.depth;
31034
+ var depth = options.depth !== undefined ? options.depth : 32;
30794
31035
  var parse5 = parser("qs");
30795
31036
  if (isNaN(parameterLimit) || parameterLimit < 1) {
30796
31037
  throw new TypeError("option parameterLimit must be a positive number");
@@ -30839,14 +31080,14 @@ var require_urlencoded = __commonJS((exports, module) => {
30839
31080
  }
30840
31081
  function parameterCount(body, limit) {
30841
31082
  var count = 0;
30842
- var index = 0;
30843
- while ((index = body.indexOf("&", index)) !== -1) {
31083
+ var index = -1;
31084
+ do {
30844
31085
  count++;
30845
- index++;
30846
- if (count === limit) {
31086
+ if (count > limit) {
30847
31087
  return;
30848
31088
  }
30849
- }
31089
+ index = body.indexOf("&", index + 1);
31090
+ } while (index !== -1);
30850
31091
  return count;
30851
31092
  }
30852
31093
  function parser(name) {
@@ -31565,6 +31806,149 @@ var require_parseurl = __commonJS((exports, module) => {
31565
31806
  }
31566
31807
  });
31567
31808
 
31809
+ // node_modules/statuses/codes.json
31810
+ var require_codes3 = __commonJS((exports, module) => {
31811
+ module.exports = {
31812
+ "100": "Continue",
31813
+ "101": "Switching Protocols",
31814
+ "102": "Processing",
31815
+ "103": "Early Hints",
31816
+ "200": "OK",
31817
+ "201": "Created",
31818
+ "202": "Accepted",
31819
+ "203": "Non-Authoritative Information",
31820
+ "204": "No Content",
31821
+ "205": "Reset Content",
31822
+ "206": "Partial Content",
31823
+ "207": "Multi-Status",
31824
+ "208": "Already Reported",
31825
+ "226": "IM Used",
31826
+ "300": "Multiple Choices",
31827
+ "301": "Moved Permanently",
31828
+ "302": "Found",
31829
+ "303": "See Other",
31830
+ "304": "Not Modified",
31831
+ "305": "Use Proxy",
31832
+ "307": "Temporary Redirect",
31833
+ "308": "Permanent Redirect",
31834
+ "400": "Bad Request",
31835
+ "401": "Unauthorized",
31836
+ "402": "Payment Required",
31837
+ "403": "Forbidden",
31838
+ "404": "Not Found",
31839
+ "405": "Method Not Allowed",
31840
+ "406": "Not Acceptable",
31841
+ "407": "Proxy Authentication Required",
31842
+ "408": "Request Timeout",
31843
+ "409": "Conflict",
31844
+ "410": "Gone",
31845
+ "411": "Length Required",
31846
+ "412": "Precondition Failed",
31847
+ "413": "Payload Too Large",
31848
+ "414": "URI Too Long",
31849
+ "415": "Unsupported Media Type",
31850
+ "416": "Range Not Satisfiable",
31851
+ "417": "Expectation Failed",
31852
+ "418": "I'm a Teapot",
31853
+ "421": "Misdirected Request",
31854
+ "422": "Unprocessable Entity",
31855
+ "423": "Locked",
31856
+ "424": "Failed Dependency",
31857
+ "425": "Too Early",
31858
+ "426": "Upgrade Required",
31859
+ "428": "Precondition Required",
31860
+ "429": "Too Many Requests",
31861
+ "431": "Request Header Fields Too Large",
31862
+ "451": "Unavailable For Legal Reasons",
31863
+ "500": "Internal Server Error",
31864
+ "501": "Not Implemented",
31865
+ "502": "Bad Gateway",
31866
+ "503": "Service Unavailable",
31867
+ "504": "Gateway Timeout",
31868
+ "505": "HTTP Version Not Supported",
31869
+ "506": "Variant Also Negotiates",
31870
+ "507": "Insufficient Storage",
31871
+ "508": "Loop Detected",
31872
+ "509": "Bandwidth Limit Exceeded",
31873
+ "510": "Not Extended",
31874
+ "511": "Network Authentication Required"
31875
+ };
31876
+ });
31877
+
31878
+ // node_modules/statuses/index.js
31879
+ var require_statuses3 = __commonJS((exports, module) => {
31880
+ /*!
31881
+ * statuses
31882
+ * Copyright(c) 2014 Jonathan Ong
31883
+ * Copyright(c) 2016 Douglas Christopher Wilson
31884
+ * MIT Licensed
31885
+ */
31886
+ var codes = require_codes3();
31887
+ module.exports = status;
31888
+ status.message = codes;
31889
+ status.code = createMessageToStatusCodeMap(codes);
31890
+ status.codes = createStatusCodeList(codes);
31891
+ status.redirect = {
31892
+ 300: true,
31893
+ 301: true,
31894
+ 302: true,
31895
+ 303: true,
31896
+ 305: true,
31897
+ 307: true,
31898
+ 308: true
31899
+ };
31900
+ status.empty = {
31901
+ 204: true,
31902
+ 205: true,
31903
+ 304: true
31904
+ };
31905
+ status.retry = {
31906
+ 502: true,
31907
+ 503: true,
31908
+ 504: true
31909
+ };
31910
+ function createMessageToStatusCodeMap(codes2) {
31911
+ var map = {};
31912
+ Object.keys(codes2).forEach(function forEachCode(code) {
31913
+ var message = codes2[code];
31914
+ var status2 = Number(code);
31915
+ map[message.toLowerCase()] = status2;
31916
+ });
31917
+ return map;
31918
+ }
31919
+ function createStatusCodeList(codes2) {
31920
+ return Object.keys(codes2).map(function mapCode(code) {
31921
+ return Number(code);
31922
+ });
31923
+ }
31924
+ function getStatusCode(message) {
31925
+ var msg = message.toLowerCase();
31926
+ if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {
31927
+ throw new Error('invalid status message: "' + message + '"');
31928
+ }
31929
+ return status.code[msg];
31930
+ }
31931
+ function getStatusMessage(code) {
31932
+ if (!Object.prototype.hasOwnProperty.call(status.message, code)) {
31933
+ throw new Error("invalid status code: " + code);
31934
+ }
31935
+ return status.message[code];
31936
+ }
31937
+ function status(code) {
31938
+ if (typeof code === "number") {
31939
+ return getStatusMessage(code);
31940
+ }
31941
+ if (typeof code !== "string") {
31942
+ throw new TypeError("code must be a number or string");
31943
+ }
31944
+ var n = parseInt(code, 10);
31945
+ if (!isNaN(n)) {
31946
+ return getStatusMessage(n);
31947
+ }
31948
+ return getStatusCode(code);
31949
+ }
31950
+ });
31951
+
31568
31952
  // node_modules/finalhandler/index.js
31569
31953
  var require_finalhandler = __commonJS((exports, module) => {
31570
31954
  /*!
@@ -31577,7 +31961,7 @@ var require_finalhandler = __commonJS((exports, module) => {
31577
31961
  var escapeHtml = require_escape_html();
31578
31962
  var onFinished = require_on_finished();
31579
31963
  var parseUrl = require_parseurl();
31580
- var statuses = require_statuses2();
31964
+ var statuses = require_statuses3();
31581
31965
  var unpipe = require_unpipe();
31582
31966
  var DOUBLE_SPACE_REGEXP = /\x20{2}/g;
31583
31967
  var NEWLINE_REGEXP = /\n/g;
@@ -32234,6 +32618,7 @@ var require_path_to_regexp = __commonJS((exports, module) => {
32234
32618
  }
32235
32619
  pos = offset + match.length;
32236
32620
  if (match === "*") {
32621
+ backtrack = "";
32237
32622
  extraOffset += 3;
32238
32623
  return "(.*)";
32239
32624
  }
@@ -32254,6 +32639,7 @@ var require_path_to_regexp = __commonJS((exports, module) => {
32254
32639
  offset: offset + extraOffset
32255
32640
  });
32256
32641
  var result = "(?:" + format + slash + capture + (star ? "((?:[/" + format + "].+?)?)" : "") + ")" + optional2;
32642
+ backtrack = "";
32257
32643
  extraOffset += result.length - match.length;
32258
32644
  return result;
32259
32645
  });
@@ -33306,6 +33692,173 @@ var require_content_disposition = __commonJS((exports, module) => {
33306
33692
  }
33307
33693
  });
33308
33694
 
33695
+ // node_modules/http-errors/index.js
33696
+ var require_http_errors3 = __commonJS((exports, module) => {
33697
+ /*!
33698
+ * http-errors
33699
+ * Copyright(c) 2014 Jonathan Ong
33700
+ * Copyright(c) 2016 Douglas Christopher Wilson
33701
+ * MIT Licensed
33702
+ */
33703
+ var deprecate = require_depd()("http-errors");
33704
+ var setPrototypeOf = require_setprototypeof();
33705
+ var statuses = require_statuses3();
33706
+ var inherits = require_inherits();
33707
+ var toIdentifier = require_toidentifier();
33708
+ module.exports = createError;
33709
+ module.exports.HttpError = createHttpErrorConstructor();
33710
+ module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError);
33711
+ populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError);
33712
+ function codeClass(status) {
33713
+ return Number(String(status).charAt(0) + "00");
33714
+ }
33715
+ function createError() {
33716
+ var err;
33717
+ var msg;
33718
+ var status = 500;
33719
+ var props = {};
33720
+ for (var i = 0;i < arguments.length; i++) {
33721
+ var arg = arguments[i];
33722
+ var type = typeof arg;
33723
+ if (type === "object" && arg instanceof Error) {
33724
+ err = arg;
33725
+ status = err.status || err.statusCode || status;
33726
+ } else if (type === "number" && i === 0) {
33727
+ status = arg;
33728
+ } else if (type === "string") {
33729
+ msg = arg;
33730
+ } else if (type === "object") {
33731
+ props = arg;
33732
+ } else {
33733
+ throw new TypeError("argument #" + (i + 1) + " unsupported type " + type);
33734
+ }
33735
+ }
33736
+ if (typeof status === "number" && (status < 400 || status >= 600)) {
33737
+ deprecate("non-error status code; use only 4xx or 5xx status codes");
33738
+ }
33739
+ if (typeof status !== "number" || !statuses.message[status] && (status < 400 || status >= 600)) {
33740
+ status = 500;
33741
+ }
33742
+ var HttpError = createError[status] || createError[codeClass(status)];
33743
+ if (!err) {
33744
+ err = HttpError ? new HttpError(msg) : new Error(msg || statuses.message[status]);
33745
+ Error.captureStackTrace(err, createError);
33746
+ }
33747
+ if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
33748
+ err.expose = status < 500;
33749
+ err.status = err.statusCode = status;
33750
+ }
33751
+ for (var key in props) {
33752
+ if (key !== "status" && key !== "statusCode") {
33753
+ err[key] = props[key];
33754
+ }
33755
+ }
33756
+ return err;
33757
+ }
33758
+ function createHttpErrorConstructor() {
33759
+ function HttpError() {
33760
+ throw new TypeError("cannot construct abstract class");
33761
+ }
33762
+ inherits(HttpError, Error);
33763
+ return HttpError;
33764
+ }
33765
+ function createClientErrorConstructor(HttpError, name, code) {
33766
+ var className = toClassName(name);
33767
+ function ClientError(message) {
33768
+ var msg = message != null ? message : statuses.message[code];
33769
+ var err = new Error(msg);
33770
+ Error.captureStackTrace(err, ClientError);
33771
+ setPrototypeOf(err, ClientError.prototype);
33772
+ Object.defineProperty(err, "message", {
33773
+ enumerable: true,
33774
+ configurable: true,
33775
+ value: msg,
33776
+ writable: true
33777
+ });
33778
+ Object.defineProperty(err, "name", {
33779
+ enumerable: false,
33780
+ configurable: true,
33781
+ value: className,
33782
+ writable: true
33783
+ });
33784
+ return err;
33785
+ }
33786
+ inherits(ClientError, HttpError);
33787
+ nameFunc(ClientError, className);
33788
+ ClientError.prototype.status = code;
33789
+ ClientError.prototype.statusCode = code;
33790
+ ClientError.prototype.expose = true;
33791
+ return ClientError;
33792
+ }
33793
+ function createIsHttpErrorFunction(HttpError) {
33794
+ return function isHttpError(val) {
33795
+ if (!val || typeof val !== "object") {
33796
+ return false;
33797
+ }
33798
+ if (val instanceof HttpError) {
33799
+ return true;
33800
+ }
33801
+ return val instanceof Error && typeof val.expose === "boolean" && typeof val.statusCode === "number" && val.status === val.statusCode;
33802
+ };
33803
+ }
33804
+ function createServerErrorConstructor(HttpError, name, code) {
33805
+ var className = toClassName(name);
33806
+ function ServerError(message) {
33807
+ var msg = message != null ? message : statuses.message[code];
33808
+ var err = new Error(msg);
33809
+ Error.captureStackTrace(err, ServerError);
33810
+ setPrototypeOf(err, ServerError.prototype);
33811
+ Object.defineProperty(err, "message", {
33812
+ enumerable: true,
33813
+ configurable: true,
33814
+ value: msg,
33815
+ writable: true
33816
+ });
33817
+ Object.defineProperty(err, "name", {
33818
+ enumerable: false,
33819
+ configurable: true,
33820
+ value: className,
33821
+ writable: true
33822
+ });
33823
+ return err;
33824
+ }
33825
+ inherits(ServerError, HttpError);
33826
+ nameFunc(ServerError, className);
33827
+ ServerError.prototype.status = code;
33828
+ ServerError.prototype.statusCode = code;
33829
+ ServerError.prototype.expose = false;
33830
+ return ServerError;
33831
+ }
33832
+ function nameFunc(func, name) {
33833
+ var desc = Object.getOwnPropertyDescriptor(func, "name");
33834
+ if (desc && desc.configurable) {
33835
+ desc.value = name;
33836
+ Object.defineProperty(func, "name", desc);
33837
+ }
33838
+ }
33839
+ function populateConstructorExports(exports2, codes, HttpError) {
33840
+ codes.forEach(function forEachCode(code) {
33841
+ var CodeError;
33842
+ var name = toIdentifier(statuses.message[code]);
33843
+ switch (codeClass(code)) {
33844
+ case 400:
33845
+ CodeError = createClientErrorConstructor(HttpError, name, code);
33846
+ break;
33847
+ case 500:
33848
+ CodeError = createServerErrorConstructor(HttpError, name, code);
33849
+ break;
33850
+ }
33851
+ if (CodeError) {
33852
+ exports2[code] = CodeError;
33853
+ exports2[name] = CodeError;
33854
+ }
33855
+ });
33856
+ }
33857
+ function toClassName(name) {
33858
+ return name.substr(-5) !== "Error" ? name + "Error" : name;
33859
+ }
33860
+ });
33861
+
33309
33862
  // node_modules/send/node_modules/debug/node_modules/ms/index.js
33310
33863
  var require_ms4 = __commonJS((exports, module) => {
33311
33864
  var s = 1000;
@@ -34117,7 +34670,7 @@ var require_send = __commonJS((exports, module) => {
34117
34670
  * Copyright(c) 2014-2022 Douglas Christopher Wilson
34118
34671
  * MIT Licensed
34119
34672
  */
34120
- var createError = require_http_errors2();
34673
+ var createError = require_http_errors3();
34121
34674
  var debug = require_src4()("send");
34122
34675
  var deprecate = require_depd()("send");
34123
34676
  var destroy = require_destroy();
@@ -34131,7 +34684,7 @@ var require_send = __commonJS((exports, module) => {
34131
34684
  var onFinished = require_on_finished();
34132
34685
  var parseRange = require_range_parser();
34133
34686
  var path = __require("path");
34134
- var statuses = require_statuses2();
34687
+ var statuses = require_statuses3();
34135
34688
  var Stream = __require("stream");
34136
34689
  var util3 = __require("util");
34137
34690
  var extname = path.extname;
@@ -35633,7 +36186,8 @@ var require_utils2 = __commonJS((exports) => {
35633
36186
  }
35634
36187
  function parseExtendedQueryString(str) {
35635
36188
  return qs.parse(str, {
35636
- allowPrototypes: true
36189
+ allowPrototypes: true,
36190
+ arrayLimit: 1000
35637
36191
  });
35638
36192
  }
35639
36193
  function newObject() {
@@ -36950,7 +37504,7 @@ var require_response = __commonJS((exports, module) => {
36950
37504
  */
36951
37505
  var Buffer2 = require_safe_buffer().Buffer;
36952
37506
  var contentDisposition = require_content_disposition();
36953
- var createError = require_http_errors2();
37507
+ var createError = require_http_errors3();
36954
37508
  var deprecate = require_depd()("express");
36955
37509
  var encodeUrl = require_encodeurl();
36956
37510
  var escapeHtml = require_escape_html();
@@ -36958,7 +37512,7 @@ var require_response = __commonJS((exports, module) => {
36958
37512
  var isAbsolute = require_utils2().isAbsolute;
36959
37513
  var onFinished = require_on_finished();
36960
37514
  var path = __require("path");
36961
- var statuses = require_statuses2();
37515
+ var statuses = require_statuses3();
36962
37516
  var merge2 = require_utils_merge();
36963
37517
  var sign = require_cookie_signature().sign;
36964
37518
  var normalizeType = require_utils2().normalizeType;
@@ -43224,6 +43778,9 @@ var require_data = __commonJS((exports, module) => {
43224
43778
  var require_utils3 = __commonJS((exports, module) => {
43225
43779
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
43226
43780
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
43781
+ var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
43782
+ var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
43783
+ var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
43227
43784
  function stringArrayToHexStripped(input) {
43228
43785
  let acc = "";
43229
43786
  let code = 0;
@@ -43417,27 +43974,77 @@ var require_utils3 = __commonJS((exports, module) => {
43417
43974
  }
43418
43975
  return output.join("");
43419
43976
  }
43420
- function normalizeComponentEncoding(component, esc2) {
43421
- const func = esc2 !== true ? escape : unescape;
43422
- if (component.scheme !== undefined) {
43423
- component.scheme = func(component.scheme);
43424
- }
43425
- if (component.userinfo !== undefined) {
43426
- component.userinfo = func(component.userinfo);
43427
- }
43428
- if (component.host !== undefined) {
43429
- component.host = func(component.host);
43977
+ var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
43978
+ var HOST_DELIM_RE = /[@/?#:]/g;
43979
+ var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
43980
+ function reescapeHostDelimiters(host, isIP) {
43981
+ const re2 = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
43982
+ re2.lastIndex = 0;
43983
+ return host.replace(re2, (ch) => HOST_DELIMS[ch]);
43984
+ }
43985
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
43986
+ if (input.indexOf("%") === -1) {
43987
+ return input;
43430
43988
  }
43431
- if (component.path !== undefined) {
43432
- component.path = func(component.path);
43989
+ let output = "";
43990
+ for (let i = 0;i < input.length; i++) {
43991
+ if (input[i] === "%" && i + 2 < input.length) {
43992
+ const hex = input.slice(i + 1, i + 3);
43993
+ if (isHexPair(hex)) {
43994
+ const normalizedHex = hex.toUpperCase();
43995
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
43996
+ if (decodeUnreserved && isUnreserved(decoded)) {
43997
+ output += decoded;
43998
+ } else {
43999
+ output += "%" + normalizedHex;
44000
+ }
44001
+ i += 2;
44002
+ continue;
44003
+ }
44004
+ }
44005
+ output += input[i];
43433
44006
  }
43434
- if (component.query !== undefined) {
43435
- component.query = func(component.query);
44007
+ return output;
44008
+ }
44009
+ function normalizePathEncoding(input) {
44010
+ let output = "";
44011
+ for (let i = 0;i < input.length; i++) {
44012
+ if (input[i] === "%" && i + 2 < input.length) {
44013
+ const hex = input.slice(i + 1, i + 3);
44014
+ if (isHexPair(hex)) {
44015
+ const normalizedHex = hex.toUpperCase();
44016
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
44017
+ if (decoded !== "." && isUnreserved(decoded)) {
44018
+ output += decoded;
44019
+ } else {
44020
+ output += "%" + normalizedHex;
44021
+ }
44022
+ i += 2;
44023
+ continue;
44024
+ }
44025
+ }
44026
+ if (isPathCharacter(input[i])) {
44027
+ output += input[i];
44028
+ } else {
44029
+ output += escape(input[i]);
44030
+ }
43436
44031
  }
43437
- if (component.fragment !== undefined) {
43438
- component.fragment = func(component.fragment);
44032
+ return output;
44033
+ }
44034
+ function escapePreservingEscapes(input) {
44035
+ let output = "";
44036
+ for (let i = 0;i < input.length; i++) {
44037
+ if (input[i] === "%" && i + 2 < input.length) {
44038
+ const hex = input.slice(i + 1, i + 3);
44039
+ if (isHexPair(hex)) {
44040
+ output += "%" + hex.toUpperCase();
44041
+ i += 2;
44042
+ continue;
44043
+ }
44044
+ }
44045
+ output += escape(input[i]);
43439
44046
  }
43440
- return component;
44047
+ return output;
43441
44048
  }
43442
44049
  function recomposeAuthority(component) {
43443
44050
  const uriTokens = [];
@@ -43452,7 +44059,7 @@ var require_utils3 = __commonJS((exports, module) => {
43452
44059
  if (ipV6res.isIPV6 === true) {
43453
44060
  host = `[${ipV6res.escapedHost}]`;
43454
44061
  } else {
43455
- host = component.host;
44062
+ host = reescapeHostDelimiters(host, false);
43456
44063
  }
43457
44064
  }
43458
44065
  uriTokens.push(host);
@@ -43466,7 +44073,10 @@ var require_utils3 = __commonJS((exports, module) => {
43466
44073
  module.exports = {
43467
44074
  nonSimpleDomain,
43468
44075
  recomposeAuthority,
43469
- normalizeComponentEncoding,
44076
+ reescapeHostDelimiters,
44077
+ normalizePercentEncoding,
44078
+ normalizePathEncoding,
44079
+ escapePreservingEscapes,
43470
44080
  removeDotSegments,
43471
44081
  isIPv4,
43472
44082
  isUUID,
@@ -43651,11 +44261,11 @@ var require_schemes = __commonJS((exports, module) => {
43651
44261
 
43652
44262
  // node_modules/fast-uri/index.js
43653
44263
  var require_fast_uri = __commonJS((exports, module) => {
43654
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils3();
44264
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils3();
43655
44265
  var { SCHEMES, getSchemeHandler } = require_schemes();
43656
44266
  function normalize(uri, options) {
43657
44267
  if (typeof uri === "string") {
43658
- uri = serialize(parse6(uri, options), options);
44268
+ uri = normalizeString(uri, options);
43659
44269
  } else if (typeof uri === "object") {
43660
44270
  uri = parse6(serialize(uri, options), options);
43661
44271
  }
@@ -43663,7 +44273,12 @@ var require_fast_uri = __commonJS((exports, module) => {
43663
44273
  }
43664
44274
  function resolve(baseURI, relativeURI, options) {
43665
44275
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
43666
- const resolved = resolveComponent(parse6(baseURI, schemelessOptions), parse6(relativeURI, schemelessOptions), schemelessOptions, true);
44276
+ const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions);
44277
+ const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions);
44278
+ if (baseMalformed || relativeMalformed) {
44279
+ throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
44280
+ }
44281
+ const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
43667
44282
  schemelessOptions.skipEscape = true;
43668
44283
  return serialize(resolved, schemelessOptions);
43669
44284
  }
@@ -43721,19 +44336,9 @@ var require_fast_uri = __commonJS((exports, module) => {
43721
44336
  return target;
43722
44337
  }
43723
44338
  function equal(uriA, uriB, options) {
43724
- if (typeof uriA === "string") {
43725
- uriA = unescape(uriA);
43726
- uriA = serialize(normalizeComponentEncoding(parse6(uriA, options), true), { ...options, skipEscape: true });
43727
- } else if (typeof uriA === "object") {
43728
- uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
43729
- }
43730
- if (typeof uriB === "string") {
43731
- uriB = unescape(uriB);
43732
- uriB = serialize(normalizeComponentEncoding(parse6(uriB, options), true), { ...options, skipEscape: true });
43733
- } else if (typeof uriB === "object") {
43734
- uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
43735
- }
43736
- return uriA.toLowerCase() === uriB.toLowerCase();
44339
+ const normalizedA = normalizeComparableURI(uriA, options);
44340
+ const normalizedB = normalizeComparableURI(uriB, options);
44341
+ return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase();
43737
44342
  }
43738
44343
  function serialize(cmpts, opts) {
43739
44344
  const component = {
@@ -43759,12 +44364,12 @@ var require_fast_uri = __commonJS((exports, module) => {
43759
44364
  schemeHandler.serialize(component, options);
43760
44365
  if (component.path !== undefined) {
43761
44366
  if (!options.skipEscape) {
43762
- component.path = escape(component.path);
44367
+ component.path = escapePreservingEscapes(component.path);
43763
44368
  if (component.scheme !== undefined) {
43764
44369
  component.path = component.path.split("%3A").join(":");
43765
44370
  }
43766
44371
  } else {
43767
- component.path = unescape(component.path);
44372
+ component.path = normalizePercentEncoding(component.path);
43768
44373
  }
43769
44374
  }
43770
44375
  if (options.reference !== "suffix" && component.scheme) {
@@ -43799,7 +44404,18 @@ var require_fast_uri = __commonJS((exports, module) => {
43799
44404
  return uriTokens.join("");
43800
44405
  }
43801
44406
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
43802
- function parse6(uri, opts) {
44407
+ var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
44408
+ var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
44409
+ function getParseError(parsed, matches) {
44410
+ if (matches[2] !== undefined && parsed.path && parsed.path[0] !== "/") {
44411
+ return 'URI path must start with "/" when authority is present.';
44412
+ }
44413
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
44414
+ return "URI port is malformed.";
44415
+ }
44416
+ return;
44417
+ }
44418
+ function parseWithStatus(uri, opts) {
43803
44419
  const options = Object.assign({}, opts);
43804
44420
  const parsed = {
43805
44421
  scheme: undefined,
@@ -43810,6 +44426,7 @@ var require_fast_uri = __commonJS((exports, module) => {
43810
44426
  query: undefined,
43811
44427
  fragment: undefined
43812
44428
  };
44429
+ let malformedAuthorityOrPort = false;
43813
44430
  let isIP = false;
43814
44431
  if (options.reference === "suffix") {
43815
44432
  if (options.scheme) {
@@ -43818,6 +44435,25 @@ var require_fast_uri = __commonJS((exports, module) => {
43818
44435
  uri = "//" + uri;
43819
44436
  }
43820
44437
  }
44438
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
44439
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
44440
+ parsed.error = "URI authority must not contain a literal backslash.";
44441
+ malformedAuthorityOrPort = true;
44442
+ }
44443
+ const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION);
44444
+ if (introducerMatch !== null) {
44445
+ const region = introducerMatch[1];
44446
+ const normalizedRegion = region.replace(/[\t\n\r]/g, "");
44447
+ if (normalizedRegion.length >= 2) {
44448
+ if (normalizedRegion.slice(0, 2) !== "//") {
44449
+ parsed.error = parsed.error || "URI authority must not contain a literal backslash.";
44450
+ malformedAuthorityOrPort = true;
44451
+ } else if (region.length !== normalizedRegion.length) {
44452
+ parsed.error = parsed.error || "URI authority introducer must not contain whitespace.";
44453
+ malformedAuthorityOrPort = true;
44454
+ }
44455
+ }
44456
+ }
43821
44457
  const matches = uri.match(URI_PARSE);
43822
44458
  if (matches) {
43823
44459
  parsed.scheme = matches[1];
@@ -43830,6 +44466,11 @@ var require_fast_uri = __commonJS((exports, module) => {
43830
44466
  if (isNaN(parsed.port)) {
43831
44467
  parsed.port = matches[5];
43832
44468
  }
44469
+ const parseError = getParseError(parsed, matches);
44470
+ if (parseError !== undefined) {
44471
+ parsed.error = parsed.error || parseError;
44472
+ malformedAuthorityOrPort = true;
44473
+ }
43833
44474
  if (parsed.host) {
43834
44475
  const ipv4result = isIPv4(parsed.host);
43835
44476
  if (ipv4result === false) {
@@ -43856,7 +44497,7 @@ var require_fast_uri = __commonJS((exports, module) => {
43856
44497
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
43857
44498
  if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
43858
44499
  try {
43859
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
44500
+ parsed.host = new URL("http://" + parsed.host).hostname;
43860
44501
  } catch (e) {
43861
44502
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
43862
44503
  }
@@ -43868,14 +44509,18 @@ var require_fast_uri = __commonJS((exports, module) => {
43868
44509
  parsed.scheme = unescape(parsed.scheme);
43869
44510
  }
43870
44511
  if (parsed.host !== undefined) {
43871
- parsed.host = unescape(parsed.host);
44512
+ parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
43872
44513
  }
43873
44514
  }
43874
44515
  if (parsed.path) {
43875
- parsed.path = escape(unescape(parsed.path));
44516
+ parsed.path = normalizePathEncoding(parsed.path);
43876
44517
  }
43877
44518
  if (parsed.fragment) {
43878
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
44519
+ try {
44520
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
44521
+ } catch {
44522
+ parsed.error = parsed.error || "URI malformed";
44523
+ }
43879
44524
  }
43880
44525
  }
43881
44526
  if (schemeHandler && schemeHandler.parse) {
@@ -43884,7 +44529,29 @@ var require_fast_uri = __commonJS((exports, module) => {
43884
44529
  } else {
43885
44530
  parsed.error = parsed.error || "URI can not be parsed.";
43886
44531
  }
43887
- return parsed;
44532
+ return { parsed, malformedAuthorityOrPort };
44533
+ }
44534
+ function parse6(uri, opts) {
44535
+ return parseWithStatus(uri, opts).parsed;
44536
+ }
44537
+ function normalizeString(uri, opts) {
44538
+ return normalizeStringWithStatus(uri, opts).normalized;
44539
+ }
44540
+ function normalizeStringWithStatus(uri, opts) {
44541
+ const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
44542
+ return {
44543
+ normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
44544
+ malformedAuthorityOrPort
44545
+ };
44546
+ }
44547
+ function normalizeComparableURI(uri, opts) {
44548
+ if (typeof uri === "string") {
44549
+ const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
44550
+ return malformedAuthorityOrPort ? undefined : normalized;
44551
+ }
44552
+ if (typeof uri === "object") {
44553
+ return serialize(uri, opts);
44554
+ }
43888
44555
  }
43889
44556
  var fastUri = {
43890
44557
  SCHEMES,
@@ -53672,9 +54339,9 @@ var init_config = __esm(() => {
53672
54339
  SDK_METADATA = {
53673
54340
  language: "typescript",
53674
54341
  openapiDocVersion: "2.0",
53675
- sdkVersion: "0.6.1",
54342
+ sdkVersion: "0.7.0",
53676
54343
  genVersion: "2.845.15",
53677
- userAgent: "speakeasy-sdk/typescript 0.6.1 2.845.15 2.0 @launchdarkly/mcp-server"
54344
+ userAgent: "speakeasy-sdk/typescript 0.7.0 2.845.15 2.0 @launchdarkly/mcp-server"
53678
54345
  };
53679
54346
  });
53680
54347
 
@@ -56601,6 +57268,300 @@ var init_approvalsettings = __esm(() => {
56601
57268
  });
56602
57269
  });
56603
57270
 
57271
+ // src/models/components/link.ts
57272
+ var Link$inboundSchema, Link$outboundSchema;
57273
+ var init_link = __esm(() => {
57274
+ init_v3();
57275
+ Link$inboundSchema = objectType({
57276
+ href: stringType().optional(),
57277
+ type: stringType().optional()
57278
+ });
57279
+ Link$outboundSchema = objectType({
57280
+ href: stringType().optional(),
57281
+ type: stringType().optional()
57282
+ });
57283
+ });
57284
+
57285
+ // src/models/components/authorizedappdatarep.ts
57286
+ var AuthorizedAppDataRep$inboundSchema, AuthorizedAppDataRep$outboundSchema;
57287
+ var init_authorizedappdatarep = __esm(() => {
57288
+ init_v3();
57289
+ init_primitives();
57290
+ init_link();
57291
+ AuthorizedAppDataRep$inboundSchema = objectType({
57292
+ _links: recordType(Link$inboundSchema).optional(),
57293
+ _id: stringType().optional(),
57294
+ isScim: booleanType().optional(),
57295
+ name: stringType().optional(),
57296
+ maintainerName: stringType().optional()
57297
+ }).transform((v2) => {
57298
+ return remap(v2, {
57299
+ _links: "links",
57300
+ _id: "id"
57301
+ });
57302
+ });
57303
+ AuthorizedAppDataRep$outboundSchema = objectType({
57304
+ links: recordType(Link$outboundSchema).optional(),
57305
+ id: stringType().optional(),
57306
+ isScim: booleanType().optional(),
57307
+ name: stringType().optional(),
57308
+ maintainerName: stringType().optional()
57309
+ }).transform((v2) => {
57310
+ return remap(v2, {
57311
+ links: "_links",
57312
+ id: "_id"
57313
+ });
57314
+ });
57315
+ });
57316
+
57317
+ // src/models/components/memberdatarep.ts
57318
+ var MemberDataRep$inboundSchema, MemberDataRep$outboundSchema;
57319
+ var init_memberdatarep = __esm(() => {
57320
+ init_v3();
57321
+ init_primitives();
57322
+ init_link();
57323
+ MemberDataRep$inboundSchema = objectType({
57324
+ _links: recordType(Link$inboundSchema).optional(),
57325
+ _id: stringType().optional(),
57326
+ email: stringType().optional(),
57327
+ firstName: stringType().optional(),
57328
+ lastName: stringType().optional()
57329
+ }).transform((v2) => {
57330
+ return remap(v2, {
57331
+ _links: "links",
57332
+ _id: "id"
57333
+ });
57334
+ });
57335
+ MemberDataRep$outboundSchema = objectType({
57336
+ links: recordType(Link$outboundSchema).optional(),
57337
+ id: stringType().optional(),
57338
+ email: stringType().optional(),
57339
+ firstName: stringType().optional(),
57340
+ lastName: stringType().optional()
57341
+ }).transform((v2) => {
57342
+ return remap(v2, {
57343
+ links: "_links",
57344
+ id: "_id"
57345
+ });
57346
+ });
57347
+ });
57348
+
57349
+ // src/models/components/parentresourcerep.ts
57350
+ var ParentResourceRep$inboundSchema, ParentResourceRep$outboundSchema;
57351
+ var init_parentresourcerep = __esm(() => {
57352
+ init_v3();
57353
+ init_primitives();
57354
+ init_link();
57355
+ ParentResourceRep$inboundSchema = objectType({
57356
+ _links: recordType(Link$inboundSchema).optional(),
57357
+ name: stringType().optional(),
57358
+ resource: stringType().optional()
57359
+ }).transform((v2) => {
57360
+ return remap(v2, {
57361
+ _links: "links"
57362
+ });
57363
+ });
57364
+ ParentResourceRep$outboundSchema = objectType({
57365
+ links: recordType(Link$outboundSchema).optional(),
57366
+ name: stringType().optional(),
57367
+ resource: stringType().optional()
57368
+ }).transform((v2) => {
57369
+ return remap(v2, {
57370
+ links: "_links"
57371
+ });
57372
+ });
57373
+ });
57374
+
57375
+ // src/models/components/resourceaccess.ts
57376
+ var ResourceAccess$inboundSchema, ResourceAccess$outboundSchema;
57377
+ var init_resourceaccess = __esm(() => {
57378
+ init_v3();
57379
+ ResourceAccess$inboundSchema = objectType({
57380
+ action: stringType().optional(),
57381
+ resource: stringType().optional()
57382
+ });
57383
+ ResourceAccess$outboundSchema = objectType({
57384
+ action: stringType().optional(),
57385
+ resource: stringType().optional()
57386
+ });
57387
+ });
57388
+
57389
+ // src/models/components/subjectdatarep.ts
57390
+ var SubjectDataRep$inboundSchema, SubjectDataRep$outboundSchema;
57391
+ var init_subjectdatarep = __esm(() => {
57392
+ init_v3();
57393
+ init_primitives();
57394
+ init_link();
57395
+ SubjectDataRep$inboundSchema = objectType({
57396
+ _links: recordType(Link$inboundSchema).optional(),
57397
+ name: stringType().optional(),
57398
+ avatarUrl: stringType().optional()
57399
+ }).transform((v2) => {
57400
+ return remap(v2, {
57401
+ _links: "links"
57402
+ });
57403
+ });
57404
+ SubjectDataRep$outboundSchema = objectType({
57405
+ links: recordType(Link$outboundSchema).optional(),
57406
+ name: stringType().optional(),
57407
+ avatarUrl: stringType().optional()
57408
+ }).transform((v2) => {
57409
+ return remap(v2, {
57410
+ links: "_links"
57411
+ });
57412
+ });
57413
+ });
57414
+
57415
+ // src/models/components/targetresourcerep.ts
57416
+ var TargetResourceRep$inboundSchema, TargetResourceRep$outboundSchema;
57417
+ var init_targetresourcerep = __esm(() => {
57418
+ init_v3();
57419
+ init_primitives();
57420
+ init_link();
57421
+ TargetResourceRep$inboundSchema = objectType({
57422
+ _links: recordType(Link$inboundSchema).optional(),
57423
+ name: stringType().optional(),
57424
+ resources: arrayType(stringType()).optional()
57425
+ }).transform((v2) => {
57426
+ return remap(v2, {
57427
+ _links: "links"
57428
+ });
57429
+ });
57430
+ TargetResourceRep$outboundSchema = objectType({
57431
+ links: recordType(Link$outboundSchema).optional(),
57432
+ name: stringType().optional(),
57433
+ resources: arrayType(stringType()).optional()
57434
+ }).transform((v2) => {
57435
+ return remap(v2, {
57436
+ links: "_links"
57437
+ });
57438
+ });
57439
+ });
57440
+
57441
+ // src/models/components/tokensummary.ts
57442
+ var TokenSummary$inboundSchema, TokenSummary$outboundSchema;
57443
+ var init_tokensummary = __esm(() => {
57444
+ init_v3();
57445
+ init_primitives();
57446
+ init_link();
57447
+ TokenSummary$inboundSchema = objectType({
57448
+ _links: recordType(Link$inboundSchema).optional(),
57449
+ _id: stringType().optional(),
57450
+ name: stringType().optional(),
57451
+ ending: stringType().optional(),
57452
+ serviceToken: booleanType().optional()
57453
+ }).transform((v2) => {
57454
+ return remap(v2, {
57455
+ _links: "links",
57456
+ _id: "id"
57457
+ });
57458
+ });
57459
+ TokenSummary$outboundSchema = objectType({
57460
+ links: recordType(Link$outboundSchema).optional(),
57461
+ id: stringType().optional(),
57462
+ name: stringType().optional(),
57463
+ ending: stringType().optional(),
57464
+ serviceToken: booleanType().optional()
57465
+ }).transform((v2) => {
57466
+ return remap(v2, {
57467
+ links: "_links",
57468
+ id: "_id"
57469
+ });
57470
+ });
57471
+ });
57472
+
57473
+ // src/models/components/auditlogentrylistingrep.ts
57474
+ var AuditLogEntryListingRep$inboundSchema, AuditLogEntryListingRep$outboundSchema;
57475
+ var init_auditlogentrylistingrep = __esm(() => {
57476
+ init_v3();
57477
+ init_primitives();
57478
+ init_authorizedappdatarep();
57479
+ init_link();
57480
+ init_memberdatarep();
57481
+ init_parentresourcerep();
57482
+ init_resourceaccess();
57483
+ init_subjectdatarep();
57484
+ init_targetresourcerep();
57485
+ init_tokensummary();
57486
+ AuditLogEntryListingRep$inboundSchema = objectType({
57487
+ _links: recordType(Link$inboundSchema),
57488
+ _id: stringType(),
57489
+ _accountId: stringType(),
57490
+ date: numberType().int(),
57491
+ accesses: arrayType(ResourceAccess$inboundSchema),
57492
+ kind: stringType(),
57493
+ name: stringType(),
57494
+ description: stringType(),
57495
+ shortDescription: stringType(),
57496
+ comment: stringType().optional(),
57497
+ subject: SubjectDataRep$inboundSchema.optional(),
57498
+ member: MemberDataRep$inboundSchema.optional(),
57499
+ token: TokenSummary$inboundSchema.optional(),
57500
+ app: AuthorizedAppDataRep$inboundSchema.optional(),
57501
+ titleVerb: stringType().optional(),
57502
+ title: stringType().optional(),
57503
+ target: TargetResourceRep$inboundSchema.optional(),
57504
+ parent: ParentResourceRep$inboundSchema.optional()
57505
+ }).transform((v2) => {
57506
+ return remap(v2, {
57507
+ _links: "links",
57508
+ _id: "id",
57509
+ _accountId: "accountId"
57510
+ });
57511
+ });
57512
+ AuditLogEntryListingRep$outboundSchema = objectType({
57513
+ links: recordType(Link$outboundSchema),
57514
+ id: stringType(),
57515
+ accountId: stringType(),
57516
+ date: numberType().int(),
57517
+ accesses: arrayType(ResourceAccess$outboundSchema),
57518
+ kind: stringType(),
57519
+ name: stringType(),
57520
+ description: stringType(),
57521
+ shortDescription: stringType(),
57522
+ comment: stringType().optional(),
57523
+ subject: SubjectDataRep$outboundSchema.optional(),
57524
+ member: MemberDataRep$outboundSchema.optional(),
57525
+ token: TokenSummary$outboundSchema.optional(),
57526
+ app: AuthorizedAppDataRep$outboundSchema.optional(),
57527
+ titleVerb: stringType().optional(),
57528
+ title: stringType().optional(),
57529
+ target: TargetResourceRep$outboundSchema.optional(),
57530
+ parent: ParentResourceRep$outboundSchema.optional()
57531
+ }).transform((v2) => {
57532
+ return remap(v2, {
57533
+ links: "_links",
57534
+ id: "_id",
57535
+ accountId: "_accountId"
57536
+ });
57537
+ });
57538
+ });
57539
+
57540
+ // src/models/components/auditlogentrylistingrepcollection.ts
57541
+ var AuditLogEntryListingRepCollection$inboundSchema, AuditLogEntryListingRepCollection$outboundSchema;
57542
+ var init_auditlogentrylistingrepcollection = __esm(() => {
57543
+ init_v3();
57544
+ init_primitives();
57545
+ init_auditlogentrylistingrep();
57546
+ init_link();
57547
+ AuditLogEntryListingRepCollection$inboundSchema = objectType({
57548
+ items: arrayType(AuditLogEntryListingRep$inboundSchema),
57549
+ _links: recordType(Link$inboundSchema)
57550
+ }).transform((v2) => {
57551
+ return remap(v2, {
57552
+ _links: "links"
57553
+ });
57554
+ });
57555
+ AuditLogEntryListingRepCollection$outboundSchema = objectType({
57556
+ items: arrayType(AuditLogEntryListingRep$outboundSchema),
57557
+ links: recordType(Link$outboundSchema)
57558
+ }).transform((v2) => {
57559
+ return remap(v2, {
57560
+ links: "_links"
57561
+ });
57562
+ });
57563
+ });
57564
+
56604
57565
  // src/models/components/hunkrep.ts
56605
57566
  var HunkRep$inboundSchema, HunkRep$outboundSchema;
56606
57567
  var init_hunkrep = __esm(() => {
@@ -56757,20 +57718,6 @@ var init_defaults = __esm(() => {
56757
57718
  });
56758
57719
  });
56759
57720
 
56760
- // src/models/components/link.ts
56761
- var Link$inboundSchema, Link$outboundSchema;
56762
- var init_link = __esm(() => {
56763
- init_v3();
56764
- Link$inboundSchema = objectType({
56765
- href: stringType().optional(),
56766
- type: stringType().optional()
56767
- });
56768
- Link$outboundSchema = objectType({
56769
- href: stringType().optional(),
56770
- type: stringType().optional()
56771
- });
56772
- });
56773
-
56774
57721
  // src/models/components/environment.ts
56775
57722
  var Environment$inboundSchema, Environment$outboundSchema;
56776
57723
  var init_environment = __esm(() => {
@@ -57984,6 +58931,9 @@ var init_components = __esm(() => {
57984
58931
  init_aiconfigvariationpost();
57985
58932
  init_aiconfigvariationsresponse();
57986
58933
  init_approvalsettings();
58934
+ init_auditlogentrylistingrep();
58935
+ init_auditlogentrylistingrepcollection();
58936
+ init_authorizedappdatarep();
57987
58937
  init_branchrep();
57988
58938
  init_clause();
57989
58939
  init_clientsideavailability();
@@ -58015,6 +58965,7 @@ var init_components = __esm(() => {
58015
58965
  init_legacyexperimentrep();
58016
58966
  init_link();
58017
58967
  init_maintainerteam();
58968
+ init_memberdatarep();
58018
58969
  init_membersummary();
58019
58970
  init_message();
58020
58971
  init_metricdatasourcerefrep();
@@ -58025,16 +58976,21 @@ var init_components = __esm(() => {
58025
58976
  init_paginatedlinks();
58026
58977
  init_parentandselflinks();
58027
58978
  init_parentlink();
58979
+ init_parentresourcerep();
58028
58980
  init_patchoperation();
58029
58981
  init_patchwithcomment();
58030
58982
  init_prerequisite();
58031
58983
  init_referencerep();
58032
58984
  init_repositorycollectionrep();
58033
58985
  init_repositoryrep();
58986
+ init_resourceaccess();
58034
58987
  init_rollout();
58035
58988
  init_rule();
58036
58989
  init_security2();
58990
+ init_subjectdatarep();
58037
58991
  init_target();
58992
+ init_targetresourcerep();
58993
+ init_tokensummary();
58038
58994
  init_variation();
58039
58995
  init_variationorrolloutrep();
58040
58996
  init_variationsummary();
@@ -58448,6 +59404,26 @@ var init_getaiconfigvariation = __esm(() => {
58448
59404
  });
58449
59405
  });
58450
59406
 
59407
+ // src/models/operations/getauditlogentries.ts
59408
+ var GetAuditLogEntriesRequest$inboundSchema, GetAuditLogEntriesRequest$outboundSchema;
59409
+ var init_getauditlogentries = __esm(() => {
59410
+ init_v3();
59411
+ GetAuditLogEntriesRequest$inboundSchema = objectType({
59412
+ before: numberType().int().optional(),
59413
+ after: numberType().int().optional(),
59414
+ q: stringType().optional(),
59415
+ limit: numberType().int().optional(),
59416
+ spec: stringType().optional()
59417
+ });
59418
+ GetAuditLogEntriesRequest$outboundSchema = objectType({
59419
+ before: numberType().int().optional(),
59420
+ after: numberType().int().optional(),
59421
+ q: stringType().optional(),
59422
+ limit: numberType().int().optional(),
59423
+ spec: stringType().optional()
59424
+ });
59425
+ });
59426
+
58451
59427
  // src/models/operations/getenvironmentsbyproject.ts
58452
59428
  var GetEnvironmentsByProjectRequest$inboundSchema, GetEnvironmentsByProjectRequest$outboundSchema;
58453
59429
  var init_getenvironmentsbyproject = __esm(() => {
@@ -58747,6 +59723,7 @@ var init_operations = __esm(() => {
58747
59723
  init_getaiconfigs();
58748
59724
  init_getaiconfigtargeting();
58749
59725
  init_getaiconfigvariation();
59726
+ init_getauditlogentries();
58750
59727
  init_getenvironmentsbyproject();
58751
59728
  init_getfeatureflag();
58752
59729
  init_getfeatureflags();
@@ -59648,13 +60625,127 @@ async function $do8(client, request, options) {
59648
60625
  const responseFields = {
59649
60626
  HttpMeta: { Response: response, Request: req }
59650
60627
  };
59651
- const [result] = await match(json(200, AIConfigs$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
60628
+ const [result] = await match(json(200, AIConfigs$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
60629
+ if (!result.ok) {
60630
+ return [result, { status: "complete", request: req, response }];
60631
+ }
60632
+ return [result, { status: "complete", request: req, response }];
60633
+ }
60634
+ var init_aiConfigsList = __esm(() => {
60635
+ init_encodings();
60636
+ init_matchers();
60637
+ init_primitives();
60638
+ init_schemas4();
60639
+ init_security();
60640
+ init_url();
60641
+ init_components();
60642
+ init_errors4();
60643
+ init_operations();
60644
+ init_async();
60645
+ });
60646
+
60647
+ // src/mcp-server/tools/aiConfigsList.ts
60648
+ var args8, tool$aiConfigsList;
60649
+ var init_aiConfigsList2 = __esm(() => {
60650
+ init_aiConfigsList();
60651
+ init_operations();
60652
+ init_tools();
60653
+ args8 = {
60654
+ request: GetAIConfigsRequest$inboundSchema
60655
+ };
60656
+ tool$aiConfigsList = {
60657
+ name: "list-ai-configs",
60658
+ description: `Retrieves AI configuration settings for a specific project. This endpoint allows agents to access and modify AI-related configurations, ensuring that the AI's behavior aligns with project requirements and user expectations.
60659
+ `,
60660
+ scopes: ["read"],
60661
+ args: args8,
60662
+ tool: async (client, args9, ctx) => {
60663
+ const [result, apiCall] = await aiConfigsList(client, args9.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60664
+ if (!result.ok) {
60665
+ return {
60666
+ content: [{ type: "text", text: result.error.message }],
60667
+ isError: true
60668
+ };
60669
+ }
60670
+ const value = result.value;
60671
+ return formatResult(value, apiCall);
60672
+ }
60673
+ };
60674
+ });
60675
+
60676
+ // src/funcs/aiConfigsUpdate.ts
60677
+ function aiConfigsUpdate(client, request, options) {
60678
+ return new APIPromise($do9(client, request, options));
60679
+ }
60680
+ async function $do9(client, request, options) {
60681
+ const parsed = safeParse4(request, (value) => PatchAIConfigRequest$outboundSchema.parse(value), "Input validation failed");
60682
+ if (!parsed.ok) {
60683
+ return [parsed, { status: "invalid" }];
60684
+ }
60685
+ const payload = parsed.value;
60686
+ const body = encodeJSON("body", payload.AIConfigPatch, { explode: true });
60687
+ const pathParams = {
60688
+ configKey: encodeSimple("configKey", payload.configKey, {
60689
+ explode: false,
60690
+ charEncoding: "percent"
60691
+ }),
60692
+ projectKey: encodeSimple("projectKey", payload.projectKey, {
60693
+ explode: false,
60694
+ charEncoding: "percent"
60695
+ })
60696
+ };
60697
+ const path = pathToFunc("/api/v2/projects/{projectKey}/ai-configs/{configKey}")(pathParams);
60698
+ const headers = new Headers(compactMap({
60699
+ "Content-Type": "application/json",
60700
+ Accept: "application/json"
60701
+ }));
60702
+ const secConfig = await extractSecurity(client._options.apiKey);
60703
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
60704
+ const requestSecurity = resolveGlobalSecurity(securityInput);
60705
+ const context = {
60706
+ options: client._options,
60707
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
60708
+ operationID: "patchAIConfig",
60709
+ oAuth2Scopes: null,
60710
+ resolvedSecurity: requestSecurity,
60711
+ securitySource: client._options.apiKey,
60712
+ retryConfig: options?.retries || client._options.retryConfig || { strategy: "none" },
60713
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"]
60714
+ };
60715
+ const requestRes = client._createRequest(context, {
60716
+ security: requestSecurity,
60717
+ method: "PATCH",
60718
+ baseURL: options?.serverURL,
60719
+ path,
60720
+ headers,
60721
+ body,
60722
+ userAgent: client._options.userAgent,
60723
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
60724
+ }, options);
60725
+ if (!requestRes.ok) {
60726
+ return [requestRes, { status: "invalid" }];
60727
+ }
60728
+ const req = requestRes.value;
60729
+ const doResult = await client._do(req, {
60730
+ context,
60731
+ errorCodes: ["400", "403", "404", "4XX", "500", "5XX"],
60732
+ retryConfig: context.retryConfig,
60733
+ retryCodes: context.retryCodes
60734
+ });
60735
+ if (!doResult.ok) {
60736
+ return [doResult, { status: "request-error", request: req }];
60737
+ }
60738
+ const response = doResult.value;
60739
+ const responseFields = {
60740
+ HttpMeta: { Response: response, Request: req }
60741
+ };
60742
+ const [result] = await match(json(200, AIConfig$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
59652
60743
  if (!result.ok) {
59653
60744
  return [result, { status: "complete", request: req, response }];
59654
60745
  }
59655
60746
  return [result, { status: "complete", request: req, response }];
59656
60747
  }
59657
- var init_aiConfigsList = __esm(() => {
60748
+ var init_aiConfigsUpdate = __esm(() => {
59658
60749
  init_encodings();
59659
60750
  init_matchers();
59660
60751
  init_primitives();
@@ -59667,23 +60758,22 @@ var init_aiConfigsList = __esm(() => {
59667
60758
  init_async();
59668
60759
  });
59669
60760
 
59670
- // src/mcp-server/tools/aiConfigsList.ts
59671
- var args8, tool$aiConfigsList;
59672
- var init_aiConfigsList2 = __esm(() => {
59673
- init_aiConfigsList();
60761
+ // src/mcp-server/tools/aiConfigsUpdate.ts
60762
+ var args9, tool$aiConfigsUpdate;
60763
+ var init_aiConfigsUpdate2 = __esm(() => {
60764
+ init_aiConfigsUpdate();
59674
60765
  init_operations();
59675
60766
  init_tools();
59676
- args8 = {
59677
- request: GetAIConfigsRequest$inboundSchema
60767
+ args9 = {
60768
+ request: PatchAIConfigRequest$inboundSchema
59678
60769
  };
59679
- tool$aiConfigsList = {
59680
- name: "list-ai-configs",
59681
- description: `Retrieves AI configuration settings for a specific project. This endpoint allows agents to access and modify AI-related configurations, ensuring that the AI's behavior aligns with project requirements and user expectations.
59682
- `,
59683
- scopes: ["read"],
59684
- args: args8,
59685
- tool: async (client, args9, ctx) => {
59686
- const [result, apiCall] = await aiConfigsList(client, args9.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60770
+ tool$aiConfigsUpdate = {
60771
+ name: "update-ai-config",
60772
+ description: `Updates metadata or configuration of an existing AI Config.`,
60773
+ scopes: ["write"],
60774
+ args: args9,
60775
+ tool: async (client, args10, ctx) => {
60776
+ const [result, apiCall] = await aiConfigsUpdate(client, args10.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59687
60777
  if (!result.ok) {
59688
60778
  return {
59689
60779
  content: [{ type: "text", text: result.error.message }],
@@ -59696,17 +60786,19 @@ var init_aiConfigsList2 = __esm(() => {
59696
60786
  };
59697
60787
  });
59698
60788
 
59699
- // src/funcs/aiConfigsUpdate.ts
59700
- function aiConfigsUpdate(client, request, options) {
59701
- return new APIPromise($do9(client, request, options));
60789
+ // src/funcs/aiConfigsUpdateTargeting.ts
60790
+ function aiConfigsUpdateTargeting(client, request, options) {
60791
+ return new APIPromise($do10(client, request, options));
59702
60792
  }
59703
- async function $do9(client, request, options) {
59704
- const parsed = safeParse4(request, (value) => PatchAIConfigRequest$outboundSchema.parse(value), "Input validation failed");
60793
+ async function $do10(client, request, options) {
60794
+ const parsed = safeParse4(request, (value) => PatchAIConfigTargetingRequest$outboundSchema.parse(value), "Input validation failed");
59705
60795
  if (!parsed.ok) {
59706
60796
  return [parsed, { status: "invalid" }];
59707
60797
  }
59708
60798
  const payload = parsed.value;
59709
- const body = encodeJSON("body", payload.AIConfigPatch, { explode: true });
60799
+ const body = encodeJSON("body", payload.AIConfigTargetingPatch, {
60800
+ explode: true
60801
+ });
59710
60802
  const pathParams = {
59711
60803
  configKey: encodeSimple("configKey", payload.configKey, {
59712
60804
  explode: false,
@@ -59717,7 +60809,7 @@ async function $do9(client, request, options) {
59717
60809
  charEncoding: "percent"
59718
60810
  })
59719
60811
  };
59720
- const path = pathToFunc("/api/v2/projects/{projectKey}/ai-configs/{configKey}")(pathParams);
60812
+ const path = pathToFunc("/api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting")(pathParams);
59721
60813
  const headers = new Headers(compactMap({
59722
60814
  "Content-Type": "application/json",
59723
60815
  Accept: "application/json"
@@ -59728,7 +60820,7 @@ async function $do9(client, request, options) {
59728
60820
  const context = {
59729
60821
  options: client._options,
59730
60822
  baseURL: options?.serverURL ?? client._baseURL ?? "",
59731
- operationID: "patchAIConfig",
60823
+ operationID: "patchAIConfigTargeting",
59732
60824
  oAuth2Scopes: null,
59733
60825
  resolvedSecurity: requestSecurity,
59734
60826
  securitySource: client._options.apiKey,
@@ -59762,13 +60854,13 @@ async function $do9(client, request, options) {
59762
60854
  const responseFields = {
59763
60855
  HttpMeta: { Response: response, Request: req }
59764
60856
  };
59765
- const [result] = await match(json(200, AIConfig$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
60857
+ const [result] = await match(json(200, AIConfigTargeting$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
59766
60858
  if (!result.ok) {
59767
60859
  return [result, { status: "complete", request: req, response }];
59768
60860
  }
59769
60861
  return [result, { status: "complete", request: req, response }];
59770
60862
  }
59771
- var init_aiConfigsUpdate = __esm(() => {
60863
+ var init_aiConfigsUpdateTargeting = __esm(() => {
59772
60864
  init_encodings();
59773
60865
  init_matchers();
59774
60866
  init_primitives();
@@ -59781,22 +60873,22 @@ var init_aiConfigsUpdate = __esm(() => {
59781
60873
  init_async();
59782
60874
  });
59783
60875
 
59784
- // src/mcp-server/tools/aiConfigsUpdate.ts
59785
- var args9, tool$aiConfigsUpdate;
59786
- var init_aiConfigsUpdate2 = __esm(() => {
59787
- init_aiConfigsUpdate();
60876
+ // src/mcp-server/tools/aiConfigsUpdateTargeting.ts
60877
+ var args10, tool$aiConfigsUpdateTargeting;
60878
+ var init_aiConfigsUpdateTargeting2 = __esm(() => {
60879
+ init_aiConfigsUpdateTargeting();
59788
60880
  init_operations();
59789
60881
  init_tools();
59790
- args9 = {
59791
- request: PatchAIConfigRequest$inboundSchema
60882
+ args10 = {
60883
+ request: PatchAIConfigTargetingRequest$inboundSchema
59792
60884
  };
59793
- tool$aiConfigsUpdate = {
59794
- name: "update-ai-config",
59795
- description: `Updates metadata or configuration of an existing AI Config.`,
60885
+ tool$aiConfigsUpdateTargeting = {
60886
+ name: "update-ai-config-targeting",
60887
+ description: `Updates the targeting of an existing AI Config.`,
59796
60888
  scopes: ["write"],
59797
- args: args9,
59798
- tool: async (client, args10, ctx) => {
59799
- const [result, apiCall] = await aiConfigsUpdate(client, args10.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60889
+ args: args10,
60890
+ tool: async (client, args11, ctx) => {
60891
+ const [result, apiCall] = await aiConfigsUpdateTargeting(client, args11.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59800
60892
  if (!result.ok) {
59801
60893
  return {
59802
60894
  content: [{ type: "text", text: result.error.message }],
@@ -59809,17 +60901,17 @@ var init_aiConfigsUpdate2 = __esm(() => {
59809
60901
  };
59810
60902
  });
59811
60903
 
59812
- // src/funcs/aiConfigsUpdateTargeting.ts
59813
- function aiConfigsUpdateTargeting(client, request, options) {
59814
- return new APIPromise($do10(client, request, options));
60904
+ // src/funcs/aiConfigsUpdateVariation.ts
60905
+ function aiConfigsUpdateVariation(client, request, options) {
60906
+ return new APIPromise($do11(client, request, options));
59815
60907
  }
59816
- async function $do10(client, request, options) {
59817
- const parsed = safeParse4(request, (value) => PatchAIConfigTargetingRequest$outboundSchema.parse(value), "Input validation failed");
60908
+ async function $do11(client, request, options) {
60909
+ const parsed = safeParse4(request, (value) => PatchAIConfigVariationRequest$outboundSchema.parse(value), "Input validation failed");
59818
60910
  if (!parsed.ok) {
59819
60911
  return [parsed, { status: "invalid" }];
59820
60912
  }
59821
60913
  const payload = parsed.value;
59822
- const body = encodeJSON("body", payload.AIConfigTargetingPatch, {
60914
+ const body = encodeJSON("body", payload.AIConfigVariationPatch, {
59823
60915
  explode: true
59824
60916
  });
59825
60917
  const pathParams = {
@@ -59830,9 +60922,13 @@ async function $do10(client, request, options) {
59830
60922
  projectKey: encodeSimple("projectKey", payload.projectKey, {
59831
60923
  explode: false,
59832
60924
  charEncoding: "percent"
60925
+ }),
60926
+ variationKey: encodeSimple("variationKey", payload.variationKey, {
60927
+ explode: false,
60928
+ charEncoding: "percent"
59833
60929
  })
59834
60930
  };
59835
- const path = pathToFunc("/api/v2/projects/{projectKey}/ai-configs/{configKey}/targeting")(pathParams);
60931
+ const path = pathToFunc("/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}")(pathParams);
59836
60932
  const headers = new Headers(compactMap({
59837
60933
  "Content-Type": "application/json",
59838
60934
  Accept: "application/json"
@@ -59843,7 +60939,7 @@ async function $do10(client, request, options) {
59843
60939
  const context = {
59844
60940
  options: client._options,
59845
60941
  baseURL: options?.serverURL ?? client._baseURL ?? "",
59846
- operationID: "patchAIConfigTargeting",
60942
+ operationID: "patchAIConfigVariation",
59847
60943
  oAuth2Scopes: null,
59848
60944
  resolvedSecurity: requestSecurity,
59849
60945
  securitySource: client._options.apiKey,
@@ -59877,13 +60973,13 @@ async function $do10(client, request, options) {
59877
60973
  const responseFields = {
59878
60974
  HttpMeta: { Response: response, Request: req }
59879
60975
  };
59880
- const [result] = await match(json(200, AIConfigTargeting$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
60976
+ const [result] = await match(json(200, AIConfigVariation$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
59881
60977
  if (!result.ok) {
59882
60978
  return [result, { status: "complete", request: req, response }];
59883
60979
  }
59884
60980
  return [result, { status: "complete", request: req, response }];
59885
60981
  }
59886
- var init_aiConfigsUpdateTargeting = __esm(() => {
60982
+ var init_aiConfigsUpdateVariation = __esm(() => {
59887
60983
  init_encodings();
59888
60984
  init_matchers();
59889
60985
  init_primitives();
@@ -59896,22 +60992,23 @@ var init_aiConfigsUpdateTargeting = __esm(() => {
59896
60992
  init_async();
59897
60993
  });
59898
60994
 
59899
- // src/mcp-server/tools/aiConfigsUpdateTargeting.ts
59900
- var args10, tool$aiConfigsUpdateTargeting;
59901
- var init_aiConfigsUpdateTargeting2 = __esm(() => {
59902
- init_aiConfigsUpdateTargeting();
60995
+ // src/mcp-server/tools/aiConfigsUpdateVariation.ts
60996
+ var args11, tool$aiConfigsUpdateVariation;
60997
+ var init_aiConfigsUpdateVariation2 = __esm(() => {
60998
+ init_aiConfigsUpdateVariation();
59903
60999
  init_operations();
59904
61000
  init_tools();
59905
- args10 = {
59906
- request: PatchAIConfigTargetingRequest$inboundSchema
61001
+ args11 = {
61002
+ request: PatchAIConfigVariationRequest$inboundSchema
59907
61003
  };
59908
- tool$aiConfigsUpdateTargeting = {
59909
- name: "update-ai-config-targeting",
59910
- description: `Updates the targeting of an existing AI Config.`,
61004
+ tool$aiConfigsUpdateVariation = {
61005
+ name: "update-ai-config-variation",
61006
+ description: `Updates a specific variation within an AI Config. Enables fine-tuned control of model behavior.
61007
+ `,
59911
61008
  scopes: ["write"],
59912
- args: args10,
59913
- tool: async (client, args11, ctx) => {
59914
- const [result, apiCall] = await aiConfigsUpdateTargeting(client, args11.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61009
+ args: args11,
61010
+ tool: async (client, args12, ctx) => {
61011
+ const [result, apiCall] = await aiConfigsUpdateVariation(client, args12.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59915
61012
  if (!result.ok) {
59916
61013
  return {
59917
61014
  content: [{ type: "text", text: result.error.message }],
@@ -59924,36 +61021,26 @@ var init_aiConfigsUpdateTargeting2 = __esm(() => {
59924
61021
  };
59925
61022
  });
59926
61023
 
59927
- // src/funcs/aiConfigsUpdateVariation.ts
59928
- function aiConfigsUpdateVariation(client, request, options) {
59929
- return new APIPromise($do11(client, request, options));
61024
+ // src/funcs/auditLogListEntries.ts
61025
+ function auditLogListEntries(client, request, options) {
61026
+ return new APIPromise($do12(client, request, options));
59930
61027
  }
59931
- async function $do11(client, request, options) {
59932
- const parsed = safeParse4(request, (value) => PatchAIConfigVariationRequest$outboundSchema.parse(value), "Input validation failed");
61028
+ async function $do12(client, request, options) {
61029
+ const parsed = safeParse4(request, (value) => GetAuditLogEntriesRequest$outboundSchema.parse(value), "Input validation failed");
59933
61030
  if (!parsed.ok) {
59934
61031
  return [parsed, { status: "invalid" }];
59935
61032
  }
59936
61033
  const payload = parsed.value;
59937
- const body = encodeJSON("body", payload.AIConfigVariationPatch, {
59938
- explode: true
61034
+ const body = null;
61035
+ const path = pathToFunc("/api/v2/auditlog")();
61036
+ const query = encodeFormQuery({
61037
+ after: payload.after,
61038
+ before: payload.before,
61039
+ limit: payload.limit,
61040
+ q: payload.q,
61041
+ spec: payload.spec
59939
61042
  });
59940
- const pathParams = {
59941
- configKey: encodeSimple("configKey", payload.configKey, {
59942
- explode: false,
59943
- charEncoding: "percent"
59944
- }),
59945
- projectKey: encodeSimple("projectKey", payload.projectKey, {
59946
- explode: false,
59947
- charEncoding: "percent"
59948
- }),
59949
- variationKey: encodeSimple("variationKey", payload.variationKey, {
59950
- explode: false,
59951
- charEncoding: "percent"
59952
- })
59953
- };
59954
- const path = pathToFunc("/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}")(pathParams);
59955
61043
  const headers = new Headers(compactMap({
59956
- "Content-Type": "application/json",
59957
61044
  Accept: "application/json"
59958
61045
  }));
59959
61046
  const secConfig = await extractSecurity(client._options.apiKey);
@@ -59962,7 +61049,7 @@ async function $do11(client, request, options) {
59962
61049
  const context = {
59963
61050
  options: client._options,
59964
61051
  baseURL: options?.serverURL ?? client._baseURL ?? "",
59965
- operationID: "patchAIConfigVariation",
61052
+ operationID: "getAuditLogEntries",
59966
61053
  oAuth2Scopes: null,
59967
61054
  resolvedSecurity: requestSecurity,
59968
61055
  securitySource: client._options.apiKey,
@@ -59971,10 +61058,11 @@ async function $do11(client, request, options) {
59971
61058
  };
59972
61059
  const requestRes = client._createRequest(context, {
59973
61060
  security: requestSecurity,
59974
- method: "PATCH",
61061
+ method: "GET",
59975
61062
  baseURL: options?.serverURL,
59976
61063
  path,
59977
61064
  headers,
61065
+ query,
59978
61066
  body,
59979
61067
  userAgent: client._options.userAgent,
59980
61068
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
@@ -59985,7 +61073,7 @@ async function $do11(client, request, options) {
59985
61073
  const req = requestRes.value;
59986
61074
  const doResult = await client._do(req, {
59987
61075
  context,
59988
- errorCodes: ["400", "403", "404", "4XX", "500", "5XX"],
61076
+ errorCodes: ["400", "401", "403", "429", "4XX", "5XX"],
59989
61077
  retryConfig: context.retryConfig,
59990
61078
  retryCodes: context.retryCodes
59991
61079
  });
@@ -59996,13 +61084,13 @@ async function $do11(client, request, options) {
59996
61084
  const responseFields = {
59997
61085
  HttpMeta: { Response: response, Request: req }
59998
61086
  };
59999
- const [result] = await match(json(200, AIConfigVariation$inboundSchema), jsonErr([400, 403, 404], ErrorT$inboundSchema), jsonErr(500, ErrorT$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
61087
+ const [result] = await match(json(200, AuditLogEntryListingRepCollection$inboundSchema), jsonErr(400, InvalidRequestErrorRep$inboundSchema), jsonErr(401, UnauthorizedErrorRep$inboundSchema), jsonErr(403, ForbiddenErrorRep$inboundSchema), jsonErr(429, RateLimitedErrorRep$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
60000
61088
  if (!result.ok) {
60001
61089
  return [result, { status: "complete", request: req, response }];
60002
61090
  }
60003
61091
  return [result, { status: "complete", request: req, response }];
60004
61092
  }
60005
- var init_aiConfigsUpdateVariation = __esm(() => {
61093
+ var init_auditLogListEntries = __esm(() => {
60006
61094
  init_encodings();
60007
61095
  init_matchers();
60008
61096
  init_primitives();
@@ -60015,23 +61103,23 @@ var init_aiConfigsUpdateVariation = __esm(() => {
60015
61103
  init_async();
60016
61104
  });
60017
61105
 
60018
- // src/mcp-server/tools/aiConfigsUpdateVariation.ts
60019
- var args11, tool$aiConfigsUpdateVariation;
60020
- var init_aiConfigsUpdateVariation2 = __esm(() => {
60021
- init_aiConfigsUpdateVariation();
61106
+ // src/mcp-server/tools/auditLogListEntries.ts
61107
+ var args12, tool$auditLogListEntries;
61108
+ var init_auditLogListEntries2 = __esm(() => {
61109
+ init_auditLogListEntries();
60022
61110
  init_operations();
60023
61111
  init_tools();
60024
- args11 = {
60025
- request: PatchAIConfigVariationRequest$inboundSchema
61112
+ args12 = {
61113
+ request: GetAuditLogEntriesRequest$inboundSchema
60026
61114
  };
60027
- tool$aiConfigsUpdateVariation = {
60028
- name: "update-ai-config-variation",
60029
- description: `Updates a specific variation within an AI Config. Enables fine-tuned control of model behavior.
61115
+ tool$auditLogListEntries = {
61116
+ name: "get-audit-log-entries",
61117
+ description: `Fetches audit log entries for a LaunchDarkly account. Use the \`spec\` parameter with format \`proj/<projectKey>:env/<envKey>:flag/<flagKey>\` to query a specific flag's change history (use \`env/*\` for all environments). The \`before\` and \`after\` parameters accept Unix epoch timestamps in milliseconds for date-range filtering. Returns at most 20 entries per call, ordered newest-first.
60030
61118
  `,
60031
- scopes: ["write"],
60032
- args: args11,
60033
- tool: async (client, args12, ctx) => {
60034
- const [result, apiCall] = await aiConfigsUpdateVariation(client, args12.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61119
+ scopes: ["read"],
61120
+ args: args12,
61121
+ tool: async (client, args13, ctx) => {
61122
+ const [result, apiCall] = await auditLogListEntries(client, args13.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60035
61123
  if (!result.ok) {
60036
61124
  return {
60037
61125
  content: [{ type: "text", text: result.error.message }],
@@ -60046,9 +61134,9 @@ var init_aiConfigsUpdateVariation2 = __esm(() => {
60046
61134
 
60047
61135
  // src/funcs/codeReferencesListRepositories.ts
60048
61136
  function codeReferencesListRepositories(client, request, options) {
60049
- return new APIPromise($do12(client, request, options));
61137
+ return new APIPromise($do13(client, request, options));
60050
61138
  }
60051
- async function $do12(client, request, options) {
61139
+ async function $do13(client, request, options) {
60052
61140
  const parsed = safeParse4(request, (value) => GetRepositoriesRequest$outboundSchema.parse(value), "Input validation failed");
60053
61141
  if (!parsed.ok) {
60054
61142
  return [parsed, { status: "invalid" }];
@@ -60126,12 +61214,12 @@ var init_codeReferencesListRepositories = __esm(() => {
60126
61214
  });
60127
61215
 
60128
61216
  // src/mcp-server/tools/codeReferencesListRepositories.ts
60129
- var args12, tool$codeReferencesListRepositories;
61217
+ var args13, tool$codeReferencesListRepositories;
60130
61218
  var init_codeReferencesListRepositories2 = __esm(() => {
60131
61219
  init_codeReferencesListRepositories();
60132
61220
  init_operations();
60133
61221
  init_tools();
60134
- args12 = {
61222
+ args13 = {
60135
61223
  request: GetRepositoriesRequest$inboundSchema
60136
61224
  };
60137
61225
  tool$codeReferencesListRepositories = {
@@ -60139,9 +61227,9 @@ var init_codeReferencesListRepositories2 = __esm(() => {
60139
61227
  description: `Identifies which repositories have code references to a given flag, helping agents determine if they're operating on the correct repository and understand the scope of cleanup (single vs multi-repo).
60140
61228
  `,
60141
61229
  scopes: ["read"],
60142
- args: args12,
60143
- tool: async (client, args13, ctx) => {
60144
- const [result, apiCall] = await codeReferencesListRepositories(client, args13.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61230
+ args: args13,
61231
+ tool: async (client, args14, ctx) => {
61232
+ const [result, apiCall] = await codeReferencesListRepositories(client, args14.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60145
61233
  if (!result.ok) {
60146
61234
  return {
60147
61235
  content: [{ type: "text", text: result.error.message }],
@@ -60156,9 +61244,9 @@ var init_codeReferencesListRepositories2 = __esm(() => {
60156
61244
 
60157
61245
  // src/funcs/environmentsListByProject.ts
60158
61246
  function environmentsListByProject(client, request, options) {
60159
- return new APIPromise($do13(client, request, options));
61247
+ return new APIPromise($do14(client, request, options));
60160
61248
  }
60161
- async function $do13(client, request, options) {
61249
+ async function $do14(client, request, options) {
60162
61250
  const parsed = safeParse4(request, (value) => GetEnvironmentsByProjectRequest$outboundSchema.parse(value), "Input validation failed");
60163
61251
  if (!parsed.ok) {
60164
61252
  return [parsed, { status: "invalid" }];
@@ -60242,12 +61330,12 @@ var init_environmentsListByProject = __esm(() => {
60242
61330
  });
60243
61331
 
60244
61332
  // src/mcp-server/tools/environmentsListByProject.ts
60245
- var args13, tool$environmentsListByProject;
61333
+ var args14, tool$environmentsListByProject;
60246
61334
  var init_environmentsListByProject2 = __esm(() => {
60247
61335
  init_environmentsListByProject();
60248
61336
  init_operations();
60249
61337
  init_tools();
60250
- args13 = {
61338
+ args14 = {
60251
61339
  request: GetEnvironmentsByProjectRequest$inboundSchema
60252
61340
  };
60253
61341
  tool$environmentsListByProject = {
@@ -60255,9 +61343,9 @@ var init_environmentsListByProject2 = __esm(() => {
60255
61343
  description: `Identifies which environments exist in a project and determines which are marked as "critical" (production, staging, etc.). Allows agents to programmatically identify critical environments instead of hardcoding assumptions.
60256
61344
  `,
60257
61345
  scopes: ["read"],
60258
- args: args13,
60259
- tool: async (client, args14, ctx) => {
60260
- const [result, apiCall] = await environmentsListByProject(client, args14.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61346
+ args: args14,
61347
+ tool: async (client, args15, ctx) => {
61348
+ const [result, apiCall] = await environmentsListByProject(client, args15.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60261
61349
  if (!result.ok) {
60262
61350
  return {
60263
61351
  content: [{ type: "text", text: result.error.message }],
@@ -60272,9 +61360,9 @@ var init_environmentsListByProject2 = __esm(() => {
60272
61360
 
60273
61361
  // src/funcs/featureFlagsCreate.ts
60274
61362
  function featureFlagsCreate(client, request, options) {
60275
- return new APIPromise($do14(client, request, options));
61363
+ return new APIPromise($do15(client, request, options));
60276
61364
  }
60277
- async function $do14(client, request, options) {
61365
+ async function $do15(client, request, options) {
60278
61366
  const parsed = safeParse4(request, (value) => PostFeatureFlagRequest$outboundSchema.parse(value), "Input validation failed");
60279
61367
  if (!parsed.ok) {
60280
61368
  return [parsed, { status: "invalid" }];
@@ -60356,12 +61444,12 @@ var init_featureFlagsCreate = __esm(() => {
60356
61444
  });
60357
61445
 
60358
61446
  // src/mcp-server/tools/featureFlagsCreate.ts
60359
- var args14, tool$featureFlagsCreate;
61447
+ var args15, tool$featureFlagsCreate;
60360
61448
  var init_featureFlagsCreate2 = __esm(() => {
60361
61449
  init_featureFlagsCreate();
60362
61450
  init_operations();
60363
61451
  init_tools();
60364
- args14 = {
61452
+ args15 = {
60365
61453
  request: PostFeatureFlagRequest$inboundSchema
60366
61454
  };
60367
61455
  tool$featureFlagsCreate = {
@@ -60369,9 +61457,9 @@ var init_featureFlagsCreate2 = __esm(() => {
60369
61457
  description: `Creates a new feature flag within a project. AI agents can use this operation to define feature toggles for controlled rollouts, experimentation, or gated features, automating the flag setup process.
60370
61458
  `,
60371
61459
  scopes: ["write"],
60372
- args: args14,
60373
- tool: async (client, args15, ctx) => {
60374
- const [result, apiCall] = await featureFlagsCreate(client, args15.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61460
+ args: args15,
61461
+ tool: async (client, args16, ctx) => {
61462
+ const [result, apiCall] = await featureFlagsCreate(client, args16.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60375
61463
  if (!result.ok) {
60376
61464
  return {
60377
61465
  content: [{ type: "text", text: result.error.message }],
@@ -60386,9 +61474,9 @@ var init_featureFlagsCreate2 = __esm(() => {
60386
61474
 
60387
61475
  // src/funcs/featureFlagsDelete.ts
60388
61476
  function featureFlagsDelete(client, request, options) {
60389
- return new APIPromise($do15(client, request, options));
61477
+ return new APIPromise($do16(client, request, options));
60390
61478
  }
60391
- async function $do15(client, request, options) {
61479
+ async function $do16(client, request, options) {
60392
61480
  const parsed = safeParse4(request, (value) => DeleteFeatureFlagRequest$outboundSchema.parse(value), "Input validation failed");
60393
61481
  if (!parsed.ok) {
60394
61482
  return [parsed, { status: "invalid" }];
@@ -60469,12 +61557,12 @@ var init_featureFlagsDelete = __esm(() => {
60469
61557
  });
60470
61558
 
60471
61559
  // src/mcp-server/tools/featureFlagsDelete.ts
60472
- var args15, tool$featureFlagsDelete;
61560
+ var args16, tool$featureFlagsDelete;
60473
61561
  var init_featureFlagsDelete2 = __esm(() => {
60474
61562
  init_featureFlagsDelete();
60475
61563
  init_operations();
60476
61564
  init_tools();
60477
- args15 = {
61565
+ args16 = {
60478
61566
  request: DeleteFeatureFlagRequest$inboundSchema
60479
61567
  };
60480
61568
  tool$featureFlagsDelete = {
@@ -60482,9 +61570,9 @@ var init_featureFlagsDelete2 = __esm(() => {
60482
61570
  description: `Removes a feature flag from the project. Used by AI agents to clean up deprecated toggles that are no longer in use, improving system hygiene and maintainability.
60483
61571
  `,
60484
61572
  scopes: ["write"],
60485
- args: args15,
60486
- tool: async (client, args16, ctx) => {
60487
- const [result, apiCall] = await featureFlagsDelete(client, args16.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61573
+ args: args16,
61574
+ tool: async (client, args17, ctx) => {
61575
+ const [result, apiCall] = await featureFlagsDelete(client, args17.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60488
61576
  if (!result.ok) {
60489
61577
  return {
60490
61578
  content: [{ type: "text", text: result.error.message }],
@@ -60498,9 +61586,9 @@ var init_featureFlagsDelete2 = __esm(() => {
60498
61586
 
60499
61587
  // src/funcs/featureFlagsGet.ts
60500
61588
  function featureFlagsGet(client, request, options) {
60501
- return new APIPromise($do16(client, request, options));
61589
+ return new APIPromise($do17(client, request, options));
60502
61590
  }
60503
- async function $do16(client, request, options) {
61591
+ async function $do17(client, request, options) {
60504
61592
  const parsed = safeParse4(request, (value) => GetFeatureFlagRequest$outboundSchema.parse(value), "Input validation failed");
60505
61593
  if (!parsed.ok) {
60506
61594
  return [parsed, { status: "invalid" }];
@@ -60586,12 +61674,12 @@ var init_featureFlagsGet = __esm(() => {
60586
61674
  });
60587
61675
 
60588
61676
  // src/mcp-server/tools/featureFlagsGet.ts
60589
- var args16, tool$featureFlagsGet;
61677
+ var args17, tool$featureFlagsGet;
60590
61678
  var init_featureFlagsGet2 = __esm(() => {
60591
61679
  init_featureFlagsGet();
60592
61680
  init_operations();
60593
61681
  init_tools();
60594
- args16 = {
61682
+ args17 = {
60595
61683
  request: GetFeatureFlagRequest$inboundSchema
60596
61684
  };
60597
61685
  tool$featureFlagsGet = {
@@ -60599,9 +61687,9 @@ var init_featureFlagsGet2 = __esm(() => {
60599
61687
  description: `Fetches the full configuration for a specific feature flag, including environments, variations, and targeting rules. Useful for agents auditing or managing specific feature toggles in a detailed, contextual manner.
60600
61688
  `,
60601
61689
  scopes: ["read"],
60602
- args: args16,
60603
- tool: async (client, args17, ctx) => {
60604
- const [result, apiCall] = await featureFlagsGet(client, args17.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61690
+ args: args17,
61691
+ tool: async (client, args18, ctx) => {
61692
+ const [result, apiCall] = await featureFlagsGet(client, args18.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60605
61693
  if (!result.ok) {
60606
61694
  return {
60607
61695
  content: [{ type: "text", text: result.error.message }],
@@ -60616,9 +61704,9 @@ var init_featureFlagsGet2 = __esm(() => {
60616
61704
 
60617
61705
  // src/funcs/featureFlagsGetStatus.ts
60618
61706
  function featureFlagsGetStatus(client, request, options) {
60619
- return new APIPromise($do17(client, request, options));
61707
+ return new APIPromise($do18(client, request, options));
60620
61708
  }
60621
- async function $do17(client, request, options) {
61709
+ async function $do18(client, request, options) {
60622
61710
  const parsed = safeParse4(request, (value) => GetFeatureFlagStatusAcrossEnvironmentsRequest$outboundSchema.parse(value), "Input validation failed");
60623
61711
  if (!parsed.ok) {
60624
61712
  return [parsed, { status: "invalid" }];
@@ -60703,12 +61791,12 @@ var init_featureFlagsGetStatus = __esm(() => {
60703
61791
  });
60704
61792
 
60705
61793
  // src/mcp-server/tools/featureFlagsGetStatus.ts
60706
- var args17, tool$featureFlagsGetStatus;
61794
+ var args18, tool$featureFlagsGetStatus;
60707
61795
  var init_featureFlagsGetStatus2 = __esm(() => {
60708
61796
  init_featureFlagsGetStatus();
60709
61797
  init_operations();
60710
61798
  init_tools();
60711
- args17 = {
61799
+ args18 = {
60712
61800
  request: GetFeatureFlagStatusAcrossEnvironmentsRequest$inboundSchema
60713
61801
  };
60714
61802
  tool$featureFlagsGetStatus = {
@@ -60716,9 +61804,9 @@ var init_featureFlagsGetStatus2 = __esm(() => {
60716
61804
  description: `Returns lifecycle status (new, active, inactive, launched) based on actual usage patterns, evaluation counts, and configuration stability. This is the key intelligence for removal readiness assessment.
60717
61805
  `,
60718
61806
  scopes: ["read"],
60719
- args: args17,
60720
- tool: async (client, args18, ctx) => {
60721
- const [result, apiCall] = await featureFlagsGetStatus(client, args18.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61807
+ args: args18,
61808
+ tool: async (client, args19, ctx) => {
61809
+ const [result, apiCall] = await featureFlagsGetStatus(client, args19.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60722
61810
  if (!result.ok) {
60723
61811
  return {
60724
61812
  content: [{ type: "text", text: result.error.message }],
@@ -60733,9 +61821,9 @@ var init_featureFlagsGetStatus2 = __esm(() => {
60733
61821
 
60734
61822
  // src/funcs/featureFlagsList.ts
60735
61823
  function featureFlagsList(client, request, options) {
60736
- return new APIPromise($do18(client, request, options));
61824
+ return new APIPromise($do19(client, request, options));
60737
61825
  }
60738
- async function $do18(client, request, options) {
61826
+ async function $do19(client, request, options) {
60739
61827
  const parsed = safeParse4(request, (value) => GetFeatureFlagsRequest$outboundSchema.parse(value), "Input validation failed");
60740
61828
  if (!parsed.ok) {
60741
61829
  return [parsed, { status: "invalid" }];
@@ -60825,12 +61913,12 @@ var init_featureFlagsList = __esm(() => {
60825
61913
  });
60826
61914
 
60827
61915
  // src/mcp-server/tools/featureFlagsList.ts
60828
- var args18, tool$featureFlagsList;
61916
+ var args19, tool$featureFlagsList;
60829
61917
  var init_featureFlagsList2 = __esm(() => {
60830
61918
  init_featureFlagsList();
60831
61919
  init_operations();
60832
61920
  init_tools();
60833
- args18 = {
61921
+ args19 = {
60834
61922
  request: GetFeatureFlagsRequest$inboundSchema
60835
61923
  };
60836
61924
  tool$featureFlagsList = {
@@ -60838,9 +61926,9 @@ var init_featureFlagsList2 = __esm(() => {
60838
61926
  description: `Retrieves all feature flags within a project, including metadata and targeting rules. Enables AI agents to enumerate existing flags for inspection, configuration analysis, or generating flag usage reports across environments.
60839
61927
  `,
60840
61928
  scopes: ["read"],
60841
- args: args18,
60842
- tool: async (client, args19, ctx) => {
60843
- const [result, apiCall] = await featureFlagsList(client, args19.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61929
+ args: args19,
61930
+ tool: async (client, args20, ctx) => {
61931
+ const [result, apiCall] = await featureFlagsList(client, args20.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60844
61932
  if (!result.ok) {
60845
61933
  return {
60846
61934
  content: [{ type: "text", text: result.error.message }],
@@ -60855,9 +61943,9 @@ var init_featureFlagsList2 = __esm(() => {
60855
61943
 
60856
61944
  // src/funcs/featureFlagsPatch.ts
60857
61945
  function featureFlagsPatch(client, request, options) {
60858
- return new APIPromise($do19(client, request, options));
61946
+ return new APIPromise($do20(client, request, options));
60859
61947
  }
60860
- async function $do19(client, request, options) {
61948
+ async function $do20(client, request, options) {
60861
61949
  const parsed = safeParse4(request, (value) => PatchFeatureFlagRequest$outboundSchema.parse(value), "Input validation failed");
60862
61950
  if (!parsed.ok) {
60863
61951
  return [parsed, { status: "invalid" }];
@@ -60944,12 +62032,12 @@ var init_featureFlagsPatch = __esm(() => {
60944
62032
  });
60945
62033
 
60946
62034
  // src/mcp-server/tools/featureFlagsPatch.ts
60947
- var args19, tool$featureFlagsPatch;
62035
+ var args20, tool$featureFlagsPatch;
60948
62036
  var init_featureFlagsPatch2 = __esm(() => {
60949
62037
  init_featureFlagsPatch();
60950
62038
  init_operations();
60951
62039
  init_tools();
60952
- args19 = {
62040
+ args20 = {
60953
62041
  request: PatchFeatureFlagRequest$inboundSchema
60954
62042
  };
60955
62043
  tool$featureFlagsPatch = {
@@ -60957,9 +62045,9 @@ var init_featureFlagsPatch2 = __esm(() => {
60957
62045
  description: `Updates the configuration of an existing feature flag. Enables agents to change targeting rules, modify variations, or adapt rollout strategies dynamically in response to user behavior or experiment results.
60958
62046
  `,
60959
62047
  scopes: ["write"],
60960
- args: args19,
60961
- tool: async (client, args20, ctx) => {
60962
- const [result, apiCall] = await featureFlagsPatch(client, args20.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62048
+ args: args20,
62049
+ tool: async (client, args21, ctx) => {
62050
+ const [result, apiCall] = await featureFlagsPatch(client, args21.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60963
62051
  if (!result.ok) {
60964
62052
  return {
60965
62053
  content: [{ type: "text", text: result.error.message }],
@@ -60976,7 +62064,7 @@ var init_featureFlagsPatch2 = __esm(() => {
60976
62064
  function createMCPServer(deps) {
60977
62065
  const server = new McpServer({
60978
62066
  name: "LaunchDarkly",
60979
- version: "0.6.1"
62067
+ version: "0.7.0"
60980
62068
  });
60981
62069
  const client = new LaunchDarklyCore({
60982
62070
  apiKey: deps.apiKey,
@@ -60990,6 +62078,7 @@ function createMCPServer(deps) {
60990
62078
  const resourceTemplate = createRegisterResourceTemplate(deps.logger, server, client, scopes);
60991
62079
  const prompt = createRegisterPrompt(deps.logger, server, client, scopes);
60992
62080
  const register = { tool, resource, resourceTemplate, prompt };
62081
+ tool(tool$auditLogListEntries);
60993
62082
  tool(tool$codeReferencesListRepositories);
60994
62083
  tool(tool$featureFlagsGetStatus);
60995
62084
  tool(tool$featureFlagsList);
@@ -61027,6 +62116,7 @@ var init_server3 = __esm(() => {
61027
62116
  init_aiConfigsUpdate2();
61028
62117
  init_aiConfigsUpdateTargeting2();
61029
62118
  init_aiConfigsUpdateVariation2();
62119
+ init_auditLogListEntries2();
61030
62120
  init_codeReferencesListRepositories2();
61031
62121
  init_environmentsListByProject2();
61032
62122
  init_featureFlagsCreate2();
@@ -61037,6 +62127,29 @@ var init_server3 = __esm(() => {
61037
62127
  init_featureFlagsPatch2();
61038
62128
  });
61039
62129
 
62130
+ // src/mcp-server/cli/start/sse-security.ts
62131
+ import { timingSafeEqual } from "node:crypto";
62132
+ function isLoopbackHost(host) {
62133
+ return host === "127.0.0.1" || host === "localhost" || host === "::1";
62134
+ }
62135
+ function assertSafeSSEBind(host, authToken) {
62136
+ if (!authToken && !isLoopbackHost(host)) {
62137
+ throw new Error(`--auth-token is required when the SSE transport listens on a non-loopback host (${host})`);
62138
+ }
62139
+ }
62140
+ function requireBearerToken(token) {
62141
+ const expected = Buffer.from(`Bearer ${token}`);
62142
+ return (req, res, next) => {
62143
+ const actual = Buffer.from(req.headers.authorization ?? "");
62144
+ if (actual.length !== expected.length || !timingSafeEqual(actual, expected)) {
62145
+ res.status(401).send("Unauthorized");
62146
+ return;
62147
+ }
62148
+ next();
62149
+ };
62150
+ }
62151
+ var init_sse_security = () => {};
62152
+
61040
62153
  // src/mcp-server/cli/start/impl.ts
61041
62154
  var exports_impl = {};
61042
62155
  __export(exports_impl, {
@@ -61078,34 +62191,68 @@ async function startStdio(flags) {
61078
62191
  }
61079
62192
  async function startSSE(flags) {
61080
62193
  const logger = createConsoleLogger(flags["log-level"]);
62194
+ const host = flags.host;
62195
+ const authToken = flags["auth-token"];
62196
+ assertSafeSSEBind(host, authToken);
61081
62197
  const app = import_express.default();
61082
- const mcpServer = createMCPServer({
61083
- logger,
61084
- allowedTools: flags.tool,
61085
- scopes: flags.scope,
61086
- ...{ apiKey: flags["api-key"] ?? "" },
61087
- serverURL: flags["server-url"],
61088
- serverIdx: flags["server-index"]
61089
- });
61090
- let transport;
62198
+ if (isLoopbackHost(host)) {
62199
+ app.use(localhostHostValidation());
62200
+ }
62201
+ if (authToken) {
62202
+ app.use(requireBearerToken(authToken));
62203
+ }
62204
+ const sessions = new Map;
61091
62205
  const controller = new AbortController;
61092
62206
  app.get("/sse", async (_req, res) => {
61093
- transport = new SSEServerTransport("/message", res);
61094
- await mcpServer.connect(transport);
61095
- mcpServer.server.onclose = async () => {
61096
- res.end();
61097
- };
62207
+ const server = createMCPServer({
62208
+ logger,
62209
+ allowedTools: flags.tool,
62210
+ scopes: flags.scope,
62211
+ ...{ apiKey: flags["api-key"] ?? "" },
62212
+ serverURL: flags["server-url"],
62213
+ serverIdx: flags["server-index"]
62214
+ });
62215
+ const transport = new SSEServerTransport("/message", res);
62216
+ sessions.set(transport.sessionId, { transport, server });
62217
+ res.on("close", () => {
62218
+ sessions.delete(transport.sessionId);
62219
+ server.close();
62220
+ });
62221
+ try {
62222
+ await server.connect(transport);
62223
+ } catch (err) {
62224
+ logger.error("Failed to open SSE session", {
62225
+ error: err instanceof Error ? err.message : String(err)
62226
+ });
62227
+ sessions.delete(transport.sessionId);
62228
+ server.close();
62229
+ if (!res.headersSent) {
62230
+ res.status(500).send("Internal Server Error");
62231
+ }
62232
+ }
61098
62233
  });
61099
62234
  app.post("/message", async (req, res) => {
61100
- if (!transport) {
61101
- throw new Error("Server transport not initialized");
62235
+ const sessionId = typeof req.query["sessionId"] === "string" ? req.query["sessionId"] : "";
62236
+ const session = sessions.get(sessionId);
62237
+ if (!session) {
62238
+ res.status(404).send("Unknown session");
62239
+ return;
62240
+ }
62241
+ try {
62242
+ await session.transport.handlePostMessage(req, res);
62243
+ } catch (err) {
62244
+ logger.error("Failed to handle SSE message", {
62245
+ error: err instanceof Error ? err.message : String(err)
62246
+ });
62247
+ if (!res.headersSent) {
62248
+ res.status(500).send("Internal Server Error");
62249
+ }
61102
62250
  }
61103
- await transport.handlePostMessage(req, res);
61104
62251
  });
61105
- const httpServer = app.listen(flags.port, "0.0.0.0", () => {
62252
+ const httpServer = app.listen(flags.port, host, () => {
61106
62253
  const ha = httpServer.address();
61107
- const host = typeof ha === "string" ? ha : `${ha?.address}:${ha?.port}`;
61108
- logger.info("MCP HTTP server started", { host });
62254
+ const host2 = typeof ha === "string" ? ha : `${ha?.address}:${ha?.port}`;
62255
+ logger.info("MCP HTTP server started", { host: host2 });
61109
62256
  });
61110
62257
  let closing = false;
61111
62258
  controller.signal.addEventListener("abort", async () => {
@@ -61114,8 +62261,8 @@ async function startSSE(flags) {
61114
62261
  process.exit(1);
61115
62262
  }
61116
62263
  closing = true;
61117
- logger.info("Shutting down MCP server");
61118
- await mcpServer.close();
62264
+ logger.info("Shutting down MCP servers");
62265
+ await Promise.all([...sessions.values()].map(({ server }) => server.close()));
61119
62266
  logger.info("Shutting down HTTP server");
61120
62267
  const timer = setTimeout(() => {
61121
62268
  logger.info("Forcing shutdown");
@@ -61138,6 +62285,7 @@ var init_impl = __esm(() => {
61138
62285
  import_express = __toESM(require_express2(), 1);
61139
62286
  init_console_logger();
61140
62287
  init_server3();
62288
+ init_sse_security();
61141
62289
  });
61142
62290
 
61143
62291
  // node_modules/@stricli/core/dist/index.js
@@ -62143,6 +63291,18 @@ var startCommand = on({
62143
63291
  default: "2718",
62144
63292
  parse: (val) => coerce.number().int().gte(0).lt(65536).parse(val)
62145
63293
  },
63294
+ host: {
63295
+ kind: "parsed",
63296
+ brief: "The host to listen on when the SSE transport is enabled. Non-loopback hosts require --auth-token",
63297
+ default: "127.0.0.1",
63298
+ parse: (value) => stringType().nonempty().parse(value)
63299
+ },
63300
+ "auth-token": {
63301
+ kind: "parsed",
63302
+ brief: "Bearer token that SSE clients must send in the Authorization header",
63303
+ optional: true,
63304
+ parse: (value) => stringType().min(16).parse(value)
63305
+ },
62146
63306
  tool: {
62147
63307
  kind: "parsed",
62148
63308
  brief: "Specify tools to mount on the server",
@@ -62226,7 +63386,7 @@ var routes = an({
62226
63386
  var app = He(routes, {
62227
63387
  name: "mcp",
62228
63388
  versionInfo: {
62229
- currentVersion: "0.6.1"
63389
+ currentVersion: "0.7.0"
62230
63390
  }
62231
63391
  });
62232
63392
  zt(app, process4.argv.slice(2), buildContext(process4));
@@ -62234,5 +63394,5 @@ export {
62234
63394
  app
62235
63395
  };
62236
63396
 
62237
- //# debugId=24CBA5ACF46E2C4864756E2164756E21
63397
+ //# debugId=1BB1876EEFF45EEC64756E2164756E21
62238
63398
  //# sourceMappingURL=mcp-server.js.map