@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
package/dist/index.cjs
CHANGED
|
@@ -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
|
|
|
@@ -4167,7 +4175,8 @@ function mapMcp(config, state, basePath) {
|
|
|
4167
4175
|
tools: takeToolFilter(config, ["tools"], state, basePath),
|
|
4168
4176
|
toolsets: takeToolsets(config, ["toolsets"], state, basePath),
|
|
4169
4177
|
mergedTools: takeMergedTools(config, ["mergedTools"], state, basePath),
|
|
4170
|
-
customTools: takeCustomTools(config, ["customTools"], state, basePath)
|
|
4178
|
+
customTools: takeCustomTools(config, ["customTools"], state, basePath),
|
|
4179
|
+
hooks: takeHooks(config, ["hooks"], state, basePath)
|
|
4171
4180
|
});
|
|
4172
4181
|
}
|
|
4173
4182
|
function mapReadme(value, language, activeLanguages, state, basePath) {
|
|
@@ -4549,6 +4558,21 @@ function takeCustomTools(value, aliases, state, basePath) {
|
|
|
4549
4558
|
consume(state, located.path);
|
|
4550
4559
|
return Object.fromEntries(entries.filter((entry) => entry !== void 0));
|
|
4551
4560
|
}
|
|
4561
|
+
function takeHooks(value, aliases, state, basePath) {
|
|
4562
|
+
const located = takeObject(value, aliases, state, basePath);
|
|
4563
|
+
if (!located) return void 0;
|
|
4564
|
+
if (typeof located.value.path !== "string") {
|
|
4565
|
+
fail(
|
|
4566
|
+
"FERN_MCP_HOOKS_SPEC_INVALID",
|
|
4567
|
+
located.path,
|
|
4568
|
+
'MCP hooks must be an object with a string "path"',
|
|
4569
|
+
'Give "hooks" a "path" pointing at the TypeScript module exporting the request/response hooks.',
|
|
4570
|
+
["targets", basePath[2], "generation", "hooks"]
|
|
4571
|
+
);
|
|
4572
|
+
}
|
|
4573
|
+
consume(state, located.path);
|
|
4574
|
+
return { path: located.value.path };
|
|
4575
|
+
}
|
|
4552
4576
|
function takeMergedTools(value, aliases, state, basePath) {
|
|
4553
4577
|
const located = takeObject(value, aliases, state, basePath);
|
|
4554
4578
|
if (!located) return void 0;
|