@postman/sdk-config 0.23.0 → 0.24.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.
- package/dist/index.cjs +25 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +25 -1
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +1 -1
- package/dist/sdk-config/index.d.ts +1 -1
- package/dist/sdk-config/index.js +25 -1
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +25 -1
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +8 -2
- package/dist/sdk-config/v1/index.d.ts +8 -2
- package/dist/sdk-config/v1/index.js +25 -1
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +8 -0
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +1 -1
- package/dist/sdk-config-ir/index.d.ts +1 -1
- package/dist/sdk-config-ir/index.js +8 -0
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +8 -0
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +11 -2
- package/dist/sdk-config-ir/v1/index.d.ts +11 -2
- package/dist/sdk-config-ir/v1/index.js +8 -0
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-ZRqfOhMd.d.cts → typescript-BcBGIPrg.d.cts} +8 -1
- package/dist/{typescript-ZRqfOhMd.d.ts → typescript-BcBGIPrg.d.ts} +8 -1
- package/package.json +1 -1
|
@@ -802,6 +802,11 @@ var mcpCustomToolSchema = zod.z.strictObject({
|
|
|
802
802
|
"Path to a TypeScript module that exports the tool `definition` and `handler`."
|
|
803
803
|
)
|
|
804
804
|
});
|
|
805
|
+
var mcpHooksSchema = zod.z.strictObject({
|
|
806
|
+
path: relativePathSchema.describe(
|
|
807
|
+
"Path to a TypeScript module exporting the MCP request/response hooks (`beforeRequest`, `afterResponse`, `onError`, `transformResult`)."
|
|
808
|
+
)
|
|
809
|
+
});
|
|
805
810
|
var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
806
811
|
serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
|
|
807
812
|
serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
|
|
@@ -813,6 +818,9 @@ var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
|
813
818
|
),
|
|
814
819
|
customTools: zod.z.record(mcpToolNameSchema, mcpCustomToolSchema).optional().describe(
|
|
815
820
|
"Hand-written tools, keyed by tool name, each pointing at a TypeScript module that exports its `definition` and `handler`. Emitted alongside the operation-derived tools."
|
|
821
|
+
),
|
|
822
|
+
hooks: mcpHooksSchema.optional().describe(
|
|
823
|
+
"Customer-authored request/response hooks, emitted into the generated server as `src/hooks.ts` (replacing the no-op stub)."
|
|
816
824
|
)
|
|
817
825
|
});
|
|
818
826
|
|
|
@@ -4155,7 +4163,8 @@ function mapMcp(config, state, basePath) {
|
|
|
4155
4163
|
tools: takeToolFilter(config, ["tools"], state, basePath),
|
|
4156
4164
|
toolsets: takeToolsets(config, ["toolsets"], state, basePath),
|
|
4157
4165
|
mergedTools: takeMergedTools(config, ["mergedTools"], state, basePath),
|
|
4158
|
-
customTools: takeCustomTools(config, ["customTools"], state, basePath)
|
|
4166
|
+
customTools: takeCustomTools(config, ["customTools"], state, basePath),
|
|
4167
|
+
hooks: takeHooks(config, ["hooks"], state, basePath)
|
|
4159
4168
|
});
|
|
4160
4169
|
}
|
|
4161
4170
|
function mapReadme(value, language, activeLanguages, state, basePath) {
|
|
@@ -4537,6 +4546,21 @@ function takeCustomTools(value, aliases, state, basePath) {
|
|
|
4537
4546
|
consume(state, located.path);
|
|
4538
4547
|
return Object.fromEntries(entries.filter((entry) => entry !== void 0));
|
|
4539
4548
|
}
|
|
4549
|
+
function takeHooks(value, aliases, state, basePath) {
|
|
4550
|
+
const located = takeObject(value, aliases, state, basePath);
|
|
4551
|
+
if (!located) return void 0;
|
|
4552
|
+
if (typeof located.value.path !== "string") {
|
|
4553
|
+
fail(
|
|
4554
|
+
"FERN_MCP_HOOKS_SPEC_INVALID",
|
|
4555
|
+
located.path,
|
|
4556
|
+
'MCP hooks must be an object with a string "path"',
|
|
4557
|
+
'Give "hooks" a "path" pointing at the TypeScript module exporting the request/response hooks.',
|
|
4558
|
+
["targets", basePath[2], "generation", "hooks"]
|
|
4559
|
+
);
|
|
4560
|
+
}
|
|
4561
|
+
consume(state, located.path);
|
|
4562
|
+
return { path: located.value.path };
|
|
4563
|
+
}
|
|
4540
4564
|
function takeMergedTools(value, aliases, state, basePath) {
|
|
4541
4565
|
const located = takeObject(value, aliases, state, basePath);
|
|
4542
4566
|
if (!located) return void 0;
|