@kubb/studio 5.11.3 → 5.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { D as InstalledExtensions, P as PublishedSnapshot, W as SnapshotUploadMetadata, a as AgentConnectInfo, c as AgentPermissions, d as ConfigEditOutcome, s as AgentPermission, u as ConfigEdit } from "./protocol-DpxvWX9E.cjs";
1
+ import { E as InstalledExtensions, N as PublishedSnapshot, U as SnapshotUploadMetadata, a as AgentConnectInfo, c as AgentPermissions, d as ConfigEditOutcome, s as AgentPermission, u as ConfigEdit } from "./protocol--vpA4DkB.cjs";
2
2
  import { Config, Hookable, KubbHooks } from "@kubb/core";
3
3
  //#region src/connect.d.ts
4
4
  /**
@@ -47,6 +47,14 @@ declare global {
47
47
  'studio:command': [ctx: {
48
48
  command: 'generate' | 'saveConfig' | 'readFiles' | 'readInput' | 'readDiff';
49
49
  info: string;
50
+ /**
51
+ * The Studio user who asked for the command, when Studio names one.
52
+ */
53
+ requestedBy?: string;
54
+ /**
55
+ * Set when a generation failed. Its diagnostics went out through `kubb:generation:end`.
56
+ */
57
+ failed?: boolean;
50
58
  }];
51
59
  /**
52
60
  * A refused or ignored request, with the missing permission so the host can add a remedy.
@@ -242,6 +250,29 @@ export declare function createSnapshot({ studioUrl, apiKey, config, hooks, signa
242
250
  export declare const defaultStudioUrl = "https://kubb.studio";
243
251
  //#endregion
244
252
  //#region src/configFile.d.ts
253
+ /**
254
+ * Applies edits to a `kubb.config.ts` in place. Each edit rewrites only the text it targets, so
255
+ * comments, formatting, and hand-written code around the config survive.
256
+ *
257
+ * Edits are independent: one that cannot be applied is reported in `outcomes` and the rest still run.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * const { source, outcomes } = applyConfigEdits({
262
+ * source: current,
263
+ * edits: [{ operation: 'set', plugin: '@kubb/plugin-ts', path: ['enum', 'type'], value: 'enum' }],
264
+ * })
265
+ * ```
266
+ */
267
+ export declare function applyConfigEdits({ source, edits, extensions }: {
268
+ source: string;
269
+ edits: Array<ConfigEdit>;
270
+ extensions?: InstalledExtensions;
271
+ }): {
272
+ source: string;
273
+ outcomes: Array<ConfigEditOutcome>;
274
+ changed: boolean;
275
+ };
245
276
  /**
246
277
  * Applies `edits` to the config file at `filePath`, writing it only when something changed.
247
278
  * `add-plugin` accepts `@kubb/plugin-*` packages and the plugins in `extensions`.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { D as InstalledExtensions, P as PublishedSnapshot, W as SnapshotUploadMetadata, a as AgentConnectInfo, c as AgentPermissions, d as ConfigEditOutcome, s as AgentPermission, u as ConfigEdit } from "./protocol-DpxvWX9E.js";
1
+ import { E as InstalledExtensions, N as PublishedSnapshot, U as SnapshotUploadMetadata, a as AgentConnectInfo, c as AgentPermissions, d as ConfigEditOutcome, s as AgentPermission, u as ConfigEdit } from "./protocol--vpA4DkB.js";
2
2
  import { Config, Hookable, KubbHooks } from "@kubb/core";
3
3
  //#region src/connect.d.ts
4
4
  /**
@@ -47,6 +47,14 @@ declare global {
47
47
  'studio:command': [ctx: {
48
48
  command: 'generate' | 'saveConfig' | 'readFiles' | 'readInput' | 'readDiff';
49
49
  info: string;
50
+ /**
51
+ * The Studio user who asked for the command, when Studio names one.
52
+ */
53
+ requestedBy?: string;
54
+ /**
55
+ * Set when a generation failed. Its diagnostics went out through `kubb:generation:end`.
56
+ */
57
+ failed?: boolean;
50
58
  }];
51
59
  /**
52
60
  * A refused or ignored request, with the missing permission so the host can add a remedy.
@@ -242,6 +250,29 @@ export declare function createSnapshot({ studioUrl, apiKey, config, hooks, signa
242
250
  export declare const defaultStudioUrl = "https://kubb.studio";
243
251
  //#endregion
244
252
  //#region src/configFile.d.ts
253
+ /**
254
+ * Applies edits to a `kubb.config.ts` in place. Each edit rewrites only the text it targets, so
255
+ * comments, formatting, and hand-written code around the config survive.
256
+ *
257
+ * Edits are independent: one that cannot be applied is reported in `outcomes` and the rest still run.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * const { source, outcomes } = applyConfigEdits({
262
+ * source: current,
263
+ * edits: [{ operation: 'set', plugin: '@kubb/plugin-ts', path: ['enum', 'type'], value: 'enum' }],
264
+ * })
265
+ * ```
266
+ */
267
+ export declare function applyConfigEdits({ source, edits, extensions }: {
268
+ source: string;
269
+ edits: Array<ConfigEdit>;
270
+ extensions?: InstalledExtensions;
271
+ }): {
272
+ source: string;
273
+ outcomes: Array<ConfigEditOutcome>;
274
+ changed: boolean;
275
+ };
245
276
  /**
246
277
  * Applies `edits` to the config file at `filePath`, writing it only when something changed.
247
278
  * `add-plugin` accepts `@kubb/plugin-*` packages and the plugins in `extensions`.