@postman/sdk-config 0.24.0 → 0.25.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 +60 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +60 -2
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +42 -0
- 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 +42 -0
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +42 -0
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +10 -2
- package/dist/sdk-config/v1/index.d.ts +10 -2
- package/dist/sdk-config/v1/index.js +42 -0
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +55 -1
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +2 -2
- package/dist/sdk-config-ir/index.d.ts +2 -2
- package/dist/sdk-config-ir/index.js +55 -2
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +55 -1
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +30 -3
- package/dist/sdk-config-ir/v1/index.d.ts +30 -3
- package/dist/sdk-config-ir/v1/index.js +55 -2
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-BcBGIPrg.d.cts → typescript-BIq_eF34.d.cts} +2 -0
- package/dist/{typescript-BcBGIPrg.d.ts → typescript-BIq_eF34.d.ts} +2 -0
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +31 -0
|
@@ -205,6 +205,9 @@ var oauthFlowSchema = zod.z.discriminatedUnion("type", [
|
|
|
205
205
|
zod.z.strictObject({
|
|
206
206
|
type: zod.z.literal("client-credentials").describe("Uses the OAuth client credentials flow."),
|
|
207
207
|
tokenUrl: nonEmptyStringSchema.describe("The URL used to obtain access tokens."),
|
|
208
|
+
environmentTokenUrls: zod.z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe(
|
|
209
|
+
"Token URLs by environment name, for an API whose token endpoint differs per environment. When the selected environment has an entry, its URL replaces tokenUrl, so staging and development do not call the production token endpoint. Each key must name an entry of api.environments; environments without an entry use tokenUrl."
|
|
210
|
+
),
|
|
208
211
|
refreshUrl: nonEmptyStringSchema.optional().describe("The URL used to refresh access tokens."),
|
|
209
212
|
scopes: zod.z.array(oauthScopeSchema).optional().describe("The scopes supported by this flow.")
|
|
210
213
|
}),
|
|
@@ -353,6 +356,34 @@ var apiConfigSchema = zod.z.strictObject({
|
|
|
353
356
|
*/
|
|
354
357
|
webhookSignature: webhookSignatureSchema.optional().describe("How generated helpers verify webhook signatures from the API.")
|
|
355
358
|
});
|
|
359
|
+
function oauthEnvironmentTokenUrlsIssues(api, basePath) {
|
|
360
|
+
const environmentNames = new Set((api.environments ?? []).map(({ name }) => name));
|
|
361
|
+
const issues = [];
|
|
362
|
+
(api.auth?.schemes ?? []).forEach((scheme, schemeIndex) => {
|
|
363
|
+
if (scheme.type !== "oauth2") return;
|
|
364
|
+
scheme.flows.forEach((flow, flowIndex) => {
|
|
365
|
+
if (flow.type !== "client-credentials") return;
|
|
366
|
+
Object.keys(flow.environmentTokenUrls ?? {}).forEach((environment) => {
|
|
367
|
+
if (!environmentNames.has(environment)) {
|
|
368
|
+
issues.push({
|
|
369
|
+
message: `environmentTokenUrls "${environment}" must name an entry of api.environments`,
|
|
370
|
+
path: [
|
|
371
|
+
...basePath,
|
|
372
|
+
"auth",
|
|
373
|
+
"schemes",
|
|
374
|
+
schemeIndex,
|
|
375
|
+
"flows",
|
|
376
|
+
flowIndex,
|
|
377
|
+
"environmentTokenUrls",
|
|
378
|
+
environment
|
|
379
|
+
]
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
return issues;
|
|
386
|
+
}
|
|
356
387
|
|
|
357
388
|
// src/sdk-config/v1/api.ts
|
|
358
389
|
var sdkConfigV1AuthSchemeSchema = authSchemeSchema;
|
|
@@ -810,6 +841,12 @@ var mcpHooksSchema = zod.z.strictObject({
|
|
|
810
841
|
var mcpGenerationConfigSchema = typescriptGenerationConfigSchema.extend({
|
|
811
842
|
serverName: nonEmptyStringSchema.optional().describe("The name advertised by the generated MCP server."),
|
|
812
843
|
serverDescription: nonEmptyStringSchema.optional().describe("The description advertised by the generated MCP server."),
|
|
844
|
+
instructions: nonEmptyStringSchema.optional().describe(
|
|
845
|
+
"Replaces the auto-generated server instructions returned on initialize. WARNING: the generated instructions encode protocol wiring (the openapi:// resource and schema URI templates and the _meta keys the agent needs to browse docs and fetch full input schemas); replacing them drops that wiring and can break schema/doc browsing, so prefer appendInstructions unless you intend to restate it. Emitted verbatim and sent to the MCP client on every conversation, so keep it concise."
|
|
846
|
+
),
|
|
847
|
+
appendInstructions: nonEmptyStringSchema.optional().describe(
|
|
848
|
+
"Appended after the auto-generated server instructions returned on initialize, preserving the generated protocol wiring. When both instructions and appendInstructions are set, this is appended after the replacement text. Emitted verbatim and sent to the MCP client on every conversation, so keep it concise."
|
|
849
|
+
),
|
|
813
850
|
excludeAvailability: zod.z.array(zod.z.enum(mcpAvailabilityStatuses)).optional().describe("Operation availability statuses excluded from MCP tool generation."),
|
|
814
851
|
tools: mcpToolFilterSchema.optional().describe("Global operation filters for generated MCP tools."),
|
|
815
852
|
toolsets: zod.z.record(mcpToolsetNameSchema, mcpToolFilterSchema).optional().describe("Named MCP toolsets and the operation filters for each toolset."),
|
|
@@ -3216,6 +3253,9 @@ var sdkConfigV1Schema = zod.z.strictObject({
|
|
|
3216
3253
|
targets: zod.z.array(sdkConfigV1TargetSchema).min(1).describe("Language targets to generate; each language may appear once.")
|
|
3217
3254
|
}).superRefine(({ api, output, package: globalPackage, targets }, context) => {
|
|
3218
3255
|
const configuredLanguages = /* @__PURE__ */ new Set();
|
|
3256
|
+
oauthEnvironmentTokenUrlsIssues(api, ["api"]).forEach(
|
|
3257
|
+
(issue) => context.addIssue({ code: "custom", ...issue })
|
|
3258
|
+
);
|
|
3219
3259
|
targets.forEach((target, targetIndex) => {
|
|
3220
3260
|
if (configuredLanguages.has(target.language)) {
|
|
3221
3261
|
context.addIssue({
|
|
@@ -4144,6 +4184,8 @@ function mapMcp(config, state, basePath) {
|
|
|
4144
4184
|
return compact({
|
|
4145
4185
|
serverName: takeString(config, ["serverName"], state, basePath),
|
|
4146
4186
|
serverDescription: takeString(config, ["serverDescription"], state, basePath),
|
|
4187
|
+
instructions: takeString(config, ["instructions"], state, basePath),
|
|
4188
|
+
appendInstructions: takeString(config, ["appendInstructions"], state, basePath),
|
|
4147
4189
|
excludeAvailability: takeEnumArray(
|
|
4148
4190
|
config,
|
|
4149
4191
|
["excludeAvailability"],
|