integration-tour 1.0.8 → 1.0.9

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 (2) hide show
  1. package/dist/cli.js +24 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -5286,6 +5286,18 @@ function credentialName(name) {
5286
5286
  if (/^key$/i.test(name.trim()) || /(type|kind|url|uri|endpoint|expires?(_?(in|at))?|name|count|length|hint|prefix)$/i.test(name)) return false;
5287
5287
  return secretName(name) || /(^|[^a-z])auth([^a-z]|$)/i.test(name);
5288
5288
  }
5289
+ var BOT_TOKEN = /^bot\d{5,}:[\w-]{30,}$/;
5290
+ var PREFIXED_ID = /^[a-z]{1,10}_/;
5291
+ function pathSecret(segment) {
5292
+ const s = segment.trim();
5293
+ if (BOT_TOKEN.test(s)) return "bot_token";
5294
+ if (SECRET_VALUE.test(s)) return "token";
5295
+ const random = s.length >= 24 && /^[A-Za-z0-9_\-.~:]+$/.test(s) && /[a-z]/.test(s) && /[A-Z]/.test(s) && /\d/.test(s);
5296
+ return random && !PREFIXED_ID.test(s) ? "token" : void 0;
5297
+ }
5298
+ function withoutUserinfo(address) {
5299
+ return address.replace(/^([a-z][a-z\d+.-]*:\/\/)?[^/@\s]*@/i, (_, scheme) => scheme ?? "");
5300
+ }
5289
5301
  function hiddenAs(name) {
5290
5302
  return /passw(or)?d|pwd/i.test(name) ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : placeholder(name || "secret");
5291
5303
  }
@@ -5422,7 +5434,7 @@ function decoded(text3) {
5422
5434
  }
5423
5435
  var LOCAL_HOST = /^(localhost|127\.\d+\.\d+\.\d+|0\.0\.0\.0|\[::1\])(:|\/|$)/i;
5424
5436
  function serverOf(url, vars, unset) {
5425
- let host = vars.fill(url.host, false).trim();
5437
+ let host = withoutUserinfo(vars.fill(url.host, false).trim());
5426
5438
  const left = [...host.matchAll(VARIABLE)].map((m) => m[1].trim());
5427
5439
  for (const name of left) unset.add(name);
5428
5440
  if (left.length) {
@@ -5438,7 +5450,7 @@ function serverOf(url, vars, unset) {
5438
5450
  return `${protocol}://${host}${url.port ? `:${vars.fill(url.port, false)}` : ""}`.replace(/\/+$/, "");
5439
5451
  }
5440
5452
  var VERSION = /^(v\d+(\.\d+)*|\d{4}-\d{2}-\d{2})$/i;
5441
- function pathOf(url, vars, params) {
5453
+ function pathOf(url, vars, params, hid) {
5442
5454
  const segments = url.path.map((s) => s.trim()).filter(Boolean);
5443
5455
  const out = segments.map((segment) => {
5444
5456
  const colon = segment.match(/^:([A-Za-z_][\w-]*)(.*)$/);
@@ -5447,6 +5459,14 @@ function pathOf(url, vars, params) {
5447
5459
  if (!params.has(name)) params.set(name, colonParam(name, url.variables, vars));
5448
5460
  return `{${name}}${vars.fill(rest, false)}`;
5449
5461
  }
5462
+ const secret = segment.includes("{{") ? void 0 : pathSecret(decoded(segment));
5463
+ if (secret) {
5464
+ let param = secret;
5465
+ for (let n = 2; params.has(param); n++) param = `${secret}_${n}`;
5466
+ params.set(param, { name: param, in: "path", required: true, schema: { type: "string" }, example: placeholder(param) });
5467
+ hid.add(param);
5468
+ return `{${param}}`;
5469
+ }
5450
5470
  return segment.replace(VARIABLE, (whole, raw) => {
5451
5471
  const name = raw.trim();
5452
5472
  const value = vars.value(name, false);
@@ -5861,7 +5881,7 @@ function convertPostman(raw, environments = [], source) {
5861
5881
  const method = FIXED_METHODS.has(rawMethod.toLowerCase()) ? rawMethod.toLowerCase() : rawMethod.toUpperCase();
5862
5882
  const server = serverOf(url, vars, unsetHosts);
5863
5883
  const pathParams = /* @__PURE__ */ new Map();
5864
- let path = pathOf(url, vars, pathParams);
5884
+ let path = pathOf(url, vars, pathParams, hid);
5865
5885
  const shape = path.replace(/\{[^}]+\}/g, "{}");
5866
5886
  const known = shapes.get(shape);
5867
5887
  if (known && known !== path) {
@@ -11051,7 +11071,7 @@ function unknownKeys(raw, known, where, problems) {
11051
11071
  }
11052
11072
 
11053
11073
  // package.json
11054
- var version = "1.0.8";
11074
+ var version = "1.0.9";
11055
11075
 
11056
11076
  // src/files.ts
11057
11077
  var import_node_fs = require("node:fs");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integration-tour",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Renders integration videos of your API or MCP server from its OpenAPI spec or tools, in your own build, so they stay in step with it.",
5
5
  "keywords": [
6
6
  "openapi",