@redocly/cli 2.39.0 → 2.41.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.
@@ -2,24 +2,26 @@ import { createRequire as __createRequire } from 'node:module';
2
2
  const require = __createRequire(import.meta.url);
3
3
  import {
4
4
  ValidationSession,
5
- createNormalizedExchange,
6
- isJsonMime,
7
5
  loadOpenApiIndex,
8
- normalizeFsPath,
9
6
  parseCsv,
10
7
  renderReport
11
- } from "./WST4KAJO.js";
8
+ } from "./ZBZADNJT.js";
9
+ import {
10
+ createNormalizedExchange,
11
+ isJsonMime,
12
+ normalizeFsPath
13
+ } from "./ER45DAHG.js";
12
14
  import {
13
15
  AbortFlowError,
14
16
  exitWithError
15
- } from "./U4V3W7MN.js";
17
+ } from "./DT4UM7U4.js";
16
18
  import {
17
19
  require_undici
18
20
  } from "./XB6C62FW.js";
19
21
  import {
20
22
  isPlainObject,
21
23
  logger
22
- } from "./KYZEVOA2.js";
24
+ } from "./YK6T7IHG.js";
23
25
  import "./Z2I5YXYN.js";
24
26
  import {
25
27
  __toESM
@@ -437,6 +439,7 @@ async function handleProxy({ argv, config, version }) {
437
439
  openApiIndex,
438
440
  matchMode: argv["match-mode"],
439
441
  ignoreCookies: argv["ignore-cookies"],
442
+ ignoreHeaders: argv["ignore-headers"] ? parseCsv(argv["ignore-headers"]) : void 0,
440
443
  previewFindingsLimit: argv["max-findings"],
441
444
  activeRules: argv.rules ? parseCsv(argv.rules) : void 0
442
445
  });
@@ -0,0 +1,175 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ const require = __createRequire(import.meta.url);
3
+ import {
4
+ selectTrafficParser
5
+ } from "./GBUMU6BX.js";
6
+ import {
7
+ ValidationSession,
8
+ loadOpenApiIndex,
9
+ parseCsv,
10
+ renderReport
11
+ } from "./ZBZADNJT.js";
12
+ import {
13
+ listFilesRecursively,
14
+ normalizeFsPath
15
+ } from "./ER45DAHG.js";
16
+ import {
17
+ AbortFlowError,
18
+ exitWithError
19
+ } from "./DT4UM7U4.js";
20
+ import {
21
+ logger
22
+ } from "./YK6T7IHG.js";
23
+ import "./Z2I5YXYN.js";
24
+ import "./5ILQMFXK.js";
25
+
26
+ // src/commands/drift/index.ts
27
+ import { mkdir, writeFile } from "node:fs/promises";
28
+ import path from "node:path";
29
+
30
+ // src/commands/drift/engine/runner.ts
31
+ async function runTrafficValidation(options) {
32
+ const trafficFiles = await listFilesRecursively(options.trafficPath);
33
+ if (trafficFiles.length === 0) {
34
+ throw new Error("No traffic files found in the provided traffic path.");
35
+ }
36
+ const session = ValidationSession.create({
37
+ openApiIndex: options.openApiIndex,
38
+ matchMode: options.matchMode,
39
+ ignoreCookies: options.ignoreCookies,
40
+ ignoreHeaders: options.ignoreHeaders,
41
+ previewFindingsLimit: options.previewFindingsLimit,
42
+ activeRules: options.activeRules,
43
+ server: options.server,
44
+ minSeverity: options.minSeverity
45
+ });
46
+ let supportedTrafficFileCount = 0;
47
+ let exchangeIndex = 0;
48
+ for (const trafficFile of trafficFiles) {
49
+ const parser = await selectTrafficParser(trafficFile, options.format);
50
+ if (!parser) {
51
+ logger.warn(`Skipping traffic file with unrecognized format: ${trafficFile}
52
+ `);
53
+ continue;
54
+ }
55
+ supportedTrafficFileCount += 1;
56
+ for await (const exchange of parser.parse(trafficFile)) {
57
+ await session.process({ ...exchange, index: exchangeIndex });
58
+ exchangeIndex += 1;
59
+ }
60
+ }
61
+ if (supportedTrafficFileCount === 0) {
62
+ throw new Error(
63
+ "No supported traffic files found. In auto mode, files must match built-in traffic parser signatures."
64
+ );
65
+ }
66
+ if (exchangeIndex === 0) {
67
+ throw new Error("No HTTP exchanges were parsed from the provided traffic files.");
68
+ }
69
+ return session.finalize();
70
+ }
71
+
72
+ // src/commands/drift/index.ts
73
+ var USE_COLOR = Boolean(process.stdout.isTTY) && process.env.NO_COLOR === void 0;
74
+ function collectSpecServerUrls(openApiIndex) {
75
+ const urls = /* @__PURE__ */ new Set();
76
+ for (const operations of openApiIndex.operationsByMethod.values()) {
77
+ for (const operation of operations) {
78
+ for (const server of operation.servers) {
79
+ urls.add(server.rawUrl);
80
+ }
81
+ }
82
+ }
83
+ return Array.from(urls).sort();
84
+ }
85
+ function warnWhenNothingMatched(summary, openApiIndex, server) {
86
+ const validatedExchanges = summary.totalExchanges - summary.skippedExchanges;
87
+ if (validatedExchanges === 0 && summary.skippedExchanges > 0) {
88
+ logger.warn(
89
+ `All ${summary.skippedExchanges} exchange(s) were outside the --server "${server}" and were skipped. Check that the server matches the traffic URLs.
90
+ `
91
+ );
92
+ return;
93
+ }
94
+ if (summary.documentedExchanges > 0 || validatedExchanges === 0) {
95
+ return;
96
+ }
97
+ const serverUrls = collectSpecServerUrls(openApiIndex);
98
+ const hint = server ? `Check that the --server "${server}" matches the traffic URLs and that the description paths align with the remainder.` : summary.hostCompatibleExchanges === validatedExchanges ? `The traffic hosts are compatible with the description servers (${serverUrls.join(
99
+ ", "
100
+ )}), so the endpoints are likely undocumented; if they should be documented, check that the description base paths and paths align with the traffic URLs, or use --server to declare the server the traffic was captured against.` : `Check that the traffic host and base path match the description servers (${serverUrls.join(
101
+ ", "
102
+ )}), or use --server to declare the server the traffic was captured against.`;
103
+ logger.warn(
104
+ `None of the ${validatedExchanges} validated exchange(s) matched a documented operation. ${hint}
105
+ `
106
+ );
107
+ }
108
+ async function writeOutput(outputPath, content) {
109
+ const resolved = normalizeFsPath(outputPath);
110
+ await mkdir(path.dirname(resolved), { recursive: true });
111
+ await writeFile(resolved, content, "utf8");
112
+ }
113
+ async function handleDrift({ argv, config }) {
114
+ const trafficPath = normalizeFsPath(argv.traffic);
115
+ const trafficFormat = argv["traffic-format"];
116
+ const activeRules = argv.rules ? parseCsv(argv.rules) : void 0;
117
+ const ignoreHeaders = argv["ignore-headers"] ? parseCsv(argv["ignore-headers"]) : void 0;
118
+ const server = argv.server;
119
+ if (server && argv["match-mode"]) {
120
+ return exitWithError(
121
+ "The --server and --match-mode options are mutually exclusive: --match-mode controls how requests are located via the description servers, while --server replaces the description servers with the one the traffic was captured against."
122
+ );
123
+ }
124
+ const matchMode = argv["match-mode"] ?? "strict-host";
125
+ const specPath = normalizeFsPath(argv.api);
126
+ const openApiIndex = await loadOpenApiIndex(specPath, config);
127
+ if (openApiIndex.loadedOperations === 0) {
128
+ return exitWithError(`No OpenAPI operations were loaded from: ${specPath}`);
129
+ }
130
+ const { runId, summary, findings } = await runTrafficValidation({
131
+ trafficPath,
132
+ format: trafficFormat,
133
+ matchMode,
134
+ ignoreCookies: argv["ignore-cookies"],
135
+ ignoreHeaders,
136
+ previewFindingsLimit: argv["max-findings"],
137
+ activeRules,
138
+ openApiIndex,
139
+ server,
140
+ minSeverity: argv["min-severity"]
141
+ });
142
+ warnWhenNothingMatched(summary, openApiIndex, server);
143
+ const report = renderReport(
144
+ {
145
+ runId,
146
+ summary,
147
+ findings,
148
+ meta: {
149
+ specSource: specPath,
150
+ trafficPath,
151
+ format: trafficFormat,
152
+ matchMode,
153
+ server
154
+ }
155
+ },
156
+ {
157
+ format: argv["report-format"],
158
+ color: USE_COLOR && argv["report-format"] === "pretty" && !argv.output,
159
+ maxFindings: argv["max-findings"]
160
+ }
161
+ );
162
+ if (argv.output) {
163
+ await writeOutput(argv.output, report);
164
+ logger.info(`Drift report written to: ${normalizeFsPath(argv.output)}
165
+ `);
166
+ } else {
167
+ logger.output(report);
168
+ }
169
+ if (summary.findingsBySeverity.error > 0) {
170
+ throw new AbortFlowError("Drift detected.");
171
+ }
172
+ }
173
+ export {
174
+ handleDrift
175
+ };
@@ -178,111 +178,125 @@ var require_index_umd = __commonJS({
178
178
 
179
179
  // ../../node_modules/@redocly/cli-otel/lib/index.js
180
180
  var import_ulid = __toESM(require_index_umd(), 1);
181
- var z = Object.defineProperty;
182
- var N = (e, n) => {
183
- for (var o in n) z(e, o, { get: n[o], enumerable: true });
181
+ var K = Object.defineProperty;
182
+ var q = (e, t) => {
183
+ for (var n in t) K(e, n, { get: t[n], enumerable: true });
184
184
  };
185
- var j = {};
186
- N(j, { CLOUD_EVENT_STANDARD_KEYS: () => b, mapToCloudEvent: () => q });
187
- var b = ["id", "specversion", "object", "datacontenttype", "type", "time", "origin", "env", "category", "signal", "source", "subject", "subjects", "data", "actor", "requestId", "clientIp", "organizationId", "organizationSlug", "projectId", "projectSlug", "osPlatform", "userAgent", "sessionId"];
188
- function q(e) {
189
- let { type: n, data: o, actor: t, requestId: s, clientIp: r, origin: i, env: c, source: a, organizationId: m, organizationSlug: C, projectId: A, projectSlug: _, category: k = "product", signal: D = "log", osPlatform: h, userAgent: w, sessionId: P } = e, $ = !!(o && Array.isArray(o)), v = t ? { id: t.id ?? `ann_${(0, import_ulid.ulid)()}`, object: t.object ?? "user", uri: t.uri ?? "" } : null, E = `evt_${(0, import_ulid.ulid)()}`.toLowerCase(), x = /* @__PURE__ */ new Date(), I = a ?? v?.uri ?? null, T = { ...m !== void 0 && { organizationId: m }, ...C !== void 0 && { organizationSlug: C }, ...A !== void 0 && { projectId: A }, ..._ !== void 0 && { projectSlug: _ } }, g = { specversion: "1.0", object: "event", datacontenttype: "application/json; charset=utf-8", origin: i, env: c, category: k, signal: D, osPlatform: h, userAgent: w, clientIp: r, sessionId: P };
190
- if ($) {
191
- let u = o, B = u.map((y) => ({ id: y.id ?? "", object: y.object ?? "", uri: y.uri ?? "" })), U = u[0]?.id ?? null;
192
- Object.assign(g, { ...T, id: E, type: n, time: x, source: I, actor: v, subject: U, subjects: B, data: u, requestId: s ?? "" });
185
+ var E = {};
186
+ q(E, { CLOUD_EVENT_STANDARD_KEYS: () => C, mapToCloudEvent: () => G });
187
+ var C = ["id", "specversion", "object", "datacontenttype", "type", "time", "origin", "env", "category", "signal", "source", "subject", "subjects", "data", "actor", "requestId", "clientIp", "organizationId", "organizationSlug", "projectId", "projectSlug", "osPlatform", "userAgent", "sessionId"];
188
+ function G(e) {
189
+ let { type: t, data: n, actor: o, requestId: s, clientIp: r, origin: i, env: c, source: u, organizationId: a, organizationSlug: g, projectId: d, projectSlug: I, category: N = "product", signal: $ = "log", osPlatform: B, userAgent: U, sessionId: W } = e, L = !!(n && Array.isArray(n)), m = o ? { id: o.id ?? `ann_${(0, import_ulid.ulid)()}`, object: o.object ?? "user", uri: o.uri ?? "" } : null, T = `evt_${(0, import_ulid.ulid)()}`.toLowerCase(), S = /* @__PURE__ */ new Date(), M = u ?? m?.uri ?? null, O = { ...a !== void 0 && { organizationId: a }, ...g !== void 0 && { organizationSlug: g }, ...d !== void 0 && { projectId: d }, ...I !== void 0 && { projectSlug: I } }, j = { specversion: "1.0", object: "event", datacontenttype: "application/json; charset=utf-8", origin: i, env: c, category: N, signal: $, osPlatform: B, userAgent: U, clientIp: r, sessionId: W };
190
+ if (L) {
191
+ let p = n, V = p.map((A) => ({ id: A.id ?? "", object: A.object ?? "", uri: A.uri ?? "" })), z = p[0]?.id ?? null;
192
+ Object.assign(j, { ...O, id: T, type: t, time: S, source: M, actor: m, subject: z, subjects: V, data: p, requestId: s ?? "" });
193
193
  } else {
194
- let u = (Array.isArray(o) ? o[0] : o)?.id ?? null;
195
- Object.assign(g, { ...T, id: E, type: n, time: x, source: I, actor: v, subject: u, requestId: s ?? "", data: o, ...a != null && { request: { source: a } } });
194
+ let p = (Array.isArray(n) ? n[0] : n)?.id ?? null;
195
+ Object.assign(j, { ...O, id: T, type: t, time: S, source: M, actor: m, subject: p, requestId: s ?? "", data: n, ...u != null && { request: { source: u } } });
196
196
  }
197
- return g;
197
+ return j;
198
198
  }
199
- var O = "context";
200
- var d = [O];
201
- function f(e) {
199
+ function l(e) {
202
200
  return e.replace(/([A-Z])/g, "_$1").toLowerCase();
203
201
  }
204
- function S(e) {
205
- let n = { updated: [], notUpdated: [] };
206
- for (let o of e) {
207
- if (!o || typeof o != "object") continue;
208
- let t = o.object;
209
- if (typeof t != "string") continue;
210
- let s = o, r = n.notUpdated.find((i) => i.object === t);
211
- r ? (n.updated = [r, s], n.notUpdated = n.notUpdated.filter((i) => i.object !== t)) : n.updated.some((i) => i.object === t) || n.notUpdated.push(s);
212
- }
213
- return n;
214
- }
215
- function p(e, n, o) {
216
- let t = o ? `${o}.` : "", s = n === "" ? "" : `${n}.`;
217
- return `${e}.${t}${s}`;
202
+ function v(e) {
203
+ return e != null;
218
204
  }
219
- function R(e, n) {
220
- let o = e[O];
221
- return o === "before" || o === "after" ? o : n === 0 ? "after" : "before";
205
+ function y(e) {
206
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
222
207
  }
223
- function l(e, n, o, t = true, s) {
208
+ function x(e, t, n, o = true, s) {
224
209
  let r = s?.length ? new Set(s) : null;
225
210
  for (let [i, c] of Object.entries(e)) if (!r?.has(i) && c !== void 0) {
226
- let a = t ? f(i) : i;
227
- o[`${n}${a}`] = c;
211
+ let u = o ? l(i) : i;
212
+ n[`${t}${u}`] = c;
213
+ }
214
+ }
215
+ function f(e, t, n, o) {
216
+ let s = o?.currentDepth ?? 0, r = o?.useSnakeCase ?? true, i = o?.maxNestingLevels ?? 3, c = t.endsWith(".") ? t.slice(0, -1) : t;
217
+ for (let [u, a] of Object.entries(e)) {
218
+ if (!v(a)) continue;
219
+ let g = r ? l(u) : u, d = `${c}.${g}`;
220
+ typeof a == "object" && !Array.isArray(a) ? s < i && f(a, d, n, { currentDepth: s + 1, useSnakeCase: r, maxNestingLevels: i }) : y(a) && (n[d] = a);
221
+ }
222
+ }
223
+ var _ = "context";
224
+ var h = [_];
225
+ function w(e) {
226
+ let t = { updated: [], notUpdated: [] };
227
+ for (let n of e) {
228
+ if (!n || typeof n != "object") continue;
229
+ let o = n.object;
230
+ if (typeof o != "string") continue;
231
+ let s = n, r = t.notUpdated.find((i) => i.object === o);
232
+ r ? (t.updated = [r, s], t.notUpdated = t.notUpdated.filter((i) => i.object !== o)) : t.updated.some((i) => i.object === o) || t.notUpdated.push(s);
228
233
  }
234
+ return t;
235
+ }
236
+ function b(e, t, n) {
237
+ let o = n ? `${n}.` : "", s = t === "" ? "" : `${l(t)}.`;
238
+ return `${e}.${o}${s}`;
239
+ }
240
+ function P(e, t) {
241
+ let n = e[_];
242
+ return n === "before" || n === "after" ? n : t === 0 ? "after" : "before";
229
243
  }
230
- function W(e, n, o) {
231
- for (let [t, s] of Object.entries(e)) s == null || typeof s == "object" || (o[`${n}.${f(t)}`] = s);
244
+ function k(e) {
245
+ let { [_]: t, ...n } = e;
246
+ return n;
247
+ }
248
+ function D(e) {
249
+ return e.endsWith(".") ? e : `${e}.`;
232
250
  }
233
- function K(e, n, o) {
234
- let t = n instanceof Date ? n.toISOString() : new Date(n).toISOString();
235
- return { "cloudevents.event_id": e.id, "cloudevents.event_type": e.type, "cloudevents.event_source": e.source ?? void 0, "cloudevents.event_spec_version": e.specversion, "cloudevents.event_data_content_type": e.datacontenttype ?? "application/json; charset=utf-8", "cloudevents.event_time": t, "cloudevents.event_subject": e.subject ?? "", "cloudevents.page.uri": typeof location < "u" ? location.href : void 0, "cloudevents.event_version": o?.version, "cloudevents.event_origin": e.origin ?? o?.serviceName, "cloudevents.event_env": e.env, "cloudevents.event_source_details.id": e.actor?.id ?? "anonymous", "cloudevents.event_source_details.object": e.actor?.object ?? "anonymous", "cloudevents.event_source_details.uri": e.actor?.uri ?? void 0, "cloudevents.event_client_ip": e.clientIp, "cloudevents.event_object": e.object || "event", "cloudevents.event_category": e.category, "cloudevents.event_signal": e.signal, "cloudevents.event_actor.id": e.actor?.id ?? void 0, "cloudevents.event_actor.object": e.actor?.object ?? void 0, "cloudevents.event_actor.uri": e.actor?.uri ?? void 0, "cloudevents.event_organization_id": e.organizationId, "cloudevents.event_organization_slug": e.organizationSlug, "cloudevents.event_project_id": e.projectId, "cloudevents.event_project_slug": e.projectSlug, "cloudevents.event_request_id": e.requestId, "cloudevents.event_os_platform": e.osPlatform, "cloudevents.event_user_agent": e.userAgent, "cloudevents.event_session_id": e.sessionId };
251
+ function Y(e, t, n) {
252
+ let o = t instanceof Date ? t.toISOString() : new Date(t).toISOString();
253
+ return { "cloudevents.event_id": e.id, "cloudevents.event_type": e.type, "cloudevents.event_source": e.source ?? void 0, "cloudevents.event_spec_version": e.specversion, "cloudevents.event_data_content_type": e.datacontenttype ?? "application/json; charset=utf-8", "cloudevents.event_time": o, "cloudevents.event_subject": e.subject ?? "", "cloudevents.event_version": n?.version, "cloudevents.event_origin": e.origin ?? n?.serviceName, "cloudevents.event_env": e.env, "cloudevents.event_client_ip": e.clientIp, "cloudevents.event_object": e.object || "event", "cloudevents.event_category": e.category, "cloudevents.event_signal": e.signal, "cloudevents.event_actor.id": e.actor?.id ?? void 0, "cloudevents.event_actor.object": e.actor?.object ?? void 0, "cloudevents.event_actor.uri": e.actor?.uri ?? void 0, "cloudevents.event_organization_id": e.organizationId, "cloudevents.event_organization_slug": e.organizationSlug, "cloudevents.event_project_id": e.projectId, "cloudevents.event_project_slug": e.projectSlug, "cloudevents.event_request_id": e.requestId, "cloudevents.event_os_platform": e.osPlatform, "cloudevents.event_user_agent": e.userAgent, "cloudevents.event_session_id": e.sessionId };
236
254
  }
237
- function G(e, n, o) {
238
- let t = e.data, s = { ...K(e, n, o) };
239
- return L(t, s), X(e, s), Z(e, s), s;
255
+ function F(e, t, n) {
256
+ let o = e.data, s = { ...Y(e, t, n) };
257
+ return X(o, s), ee(e, s), te(e, s), s;
240
258
  }
241
- function L(e, n) {
242
- !e || typeof e != "object" || (Array.isArray(e) ? V(e, n) : H(e, n));
259
+ function X(e, t) {
260
+ !e || typeof e != "object" || (Array.isArray(e) ? H(e, t) : Q(e, t));
243
261
  }
244
- function V(e, n) {
245
- e.some((t) => t && typeof t == "object" && typeof t.object == "string") ? Y(e, n) : F(e, n);
262
+ function H(e, t) {
263
+ e.some((o) => o && typeof o == "object" && typeof o.object == "string") ? Z(e, t) : J(e, t);
246
264
  }
247
- function Y(e, n) {
248
- let o = S(e);
249
- o.updated.forEach((t, s) => {
250
- let r = p("cloudevents.event_data", t.object, R(t, s));
251
- l(t, r, n, true, d);
252
- }), o.notUpdated.forEach((t) => {
253
- let s = p("cloudevents.event_data", t.object, void 0);
254
- l(t, s, n, true, d);
265
+ function Z(e, t) {
266
+ let n = w(e);
267
+ n.updated.forEach((o, s) => {
268
+ let r = b("cloudevents.event_data", o.object, P(o, s));
269
+ f(k(o), D(r), t);
270
+ }), n.notUpdated.forEach((o) => {
271
+ let s = b("cloudevents.event_data", o.object, void 0);
272
+ f(k(o), D(s), t);
255
273
  });
256
274
  }
257
- function F(e, n) {
258
- for (let o of e) if (!(!o || typeof o != "object")) for (let [t, s] of Object.entries(o)) {
259
- if (s === void 0) continue;
260
- let r = f(t);
261
- s !== null && typeof s == "object" && !Array.isArray(s) ? W(s, `cloudevents.event_data.${r}`, n) : n[`cloudevents.event_data.${r}`] = s;
262
- }
275
+ function J(e, t) {
276
+ for (let n of e) !n || typeof n != "object" || f(n, "cloudevents.event_data.", t);
263
277
  }
264
- function H(e, n) {
265
- for (let [o, t] of Object.entries(e)) {
266
- if (t == null) continue;
267
- let s = f(o);
268
- if (typeof t == "object" && !Array.isArray(t)) for (let [r, i] of Object.entries(t)) i != null && (typeof i == "string" || typeof i == "number" || typeof i == "boolean") && (n[`cloudevents.event_data.${s}.${r}`] = i);
269
- else (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (n[`cloudevents.event_data.${s}`] = t);
278
+ function Q(e, t) {
279
+ for (let [n, o] of Object.entries(e)) {
280
+ if (!v(o)) continue;
281
+ let s = l(n);
282
+ if (typeof o == "object" && !Array.isArray(o)) for (let [r, i] of Object.entries(o)) v(i) && y(i) && (t[`cloudevents.event_data.${s}.${r}`] = i);
283
+ else y(o) && (t[`cloudevents.event_data.${s}`] = o);
270
284
  }
271
285
  }
272
- function X(e, n) {
286
+ function ee(e, t) {
273
287
  if (!e.subjects || !Array.isArray(e.subjects)) return;
274
- let o = S(e.subjects);
275
- o.updated.forEach((t, s) => {
276
- let r = p("cloudevents.event_subjects", t.object, R(t, s));
277
- l(t, r, n, false, d);
278
- }), o.notUpdated.forEach((t) => {
279
- let s = p("cloudevents.event_subjects", t.object, void 0);
280
- l(t, s, n, false, d);
288
+ let n = w(e.subjects);
289
+ n.updated.forEach((o, s) => {
290
+ let r = b("cloudevents.event_subjects", o.object, P(o, s));
291
+ x(o, r, t, false, h);
292
+ }), n.notUpdated.forEach((o) => {
293
+ let s = b("cloudevents.event_subjects", o.object, void 0);
294
+ x(o, s, t, false, h);
281
295
  });
282
296
  }
283
- function Z(e, n) {
284
- for (let [o, t] of Object.entries(e)) if (!(b.includes(o) || t === void 0)) if (t instanceof Object) for (let [s, r] of Object.entries(t)) r !== void 0 && (n[`cloudevents.${o}.${s}`] = r);
285
- else n[`cloudevents.${o}`] = t;
297
+ function te(e, t) {
298
+ for (let [n, o] of Object.entries(e)) if (!(C.includes(n) || o === void 0)) if (o instanceof Object) for (let [s, r] of Object.entries(o)) r !== void 0 && (t[`cloudevents.${n}.${s}`] = r);
299
+ else t[`cloudevents.${n}`] = o;
286
300
  }
287
301
 
288
302
  // ../../node_modules/ulid/dist/node/index.js
@@ -381,7 +395,7 @@ function ulid(seedTime, prng) {
381
395
  }
382
396
 
383
397
  export {
384
- j,
385
- G,
398
+ E,
399
+ F,
386
400
  ulid
387
401
  };
@@ -0,0 +1,79 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ const require = __createRequire(import.meta.url);
3
+ import {
4
+ logger
5
+ } from "./YK6T7IHG.js";
6
+
7
+ // src/commands/split/oas/constants.ts
8
+ var OPENAPI3_METHOD_NAMES = [
9
+ "get",
10
+ "put",
11
+ "post",
12
+ "delete",
13
+ "options",
14
+ "head",
15
+ "patch",
16
+ "trace",
17
+ "query"
18
+ ];
19
+ var OPENAPI3_COMPONENT_NAMES = [
20
+ "schemas",
21
+ "responses",
22
+ "parameters",
23
+ "examples",
24
+ "headers",
25
+ "requestBodies",
26
+ "links",
27
+ "callbacks",
28
+ "securitySchemes"
29
+ ];
30
+
31
+ // src/utils/spinner.ts
32
+ import * as process from "node:process";
33
+ var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
34
+ var Spinner = class {
35
+ frames;
36
+ currentFrame;
37
+ intervalId;
38
+ message;
39
+ constructor() {
40
+ this.frames = SPINNER_FRAMES;
41
+ this.currentFrame = 0;
42
+ this.intervalId = null;
43
+ this.message = "";
44
+ }
45
+ showFrame() {
46
+ logger.info("\r" + this.frames[this.currentFrame] + " " + this.message);
47
+ this.currentFrame = (this.currentFrame + 1) % this.frames.length;
48
+ }
49
+ start(message) {
50
+ if (this.message === message) {
51
+ return;
52
+ }
53
+ this.message = message;
54
+ if (!process.stderr.isTTY) {
55
+ logger.info(`${message}...
56
+ `);
57
+ return;
58
+ }
59
+ if (this.intervalId === null) {
60
+ this.intervalId = setInterval(() => {
61
+ this.showFrame();
62
+ }, 100);
63
+ }
64
+ }
65
+ stop() {
66
+ if (this.intervalId !== null) {
67
+ clearInterval(this.intervalId);
68
+ this.intervalId = null;
69
+ logger.info("\r");
70
+ }
71
+ this.message = "";
72
+ }
73
+ };
74
+
75
+ export {
76
+ OPENAPI3_METHOD_NAMES,
77
+ OPENAPI3_COMPONENT_NAMES,
78
+ Spinner
79
+ };