@postman/sdk-config 0.12.0 → 0.14.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/README.md +18 -6
- package/dist/index.cjs +170 -18
- 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 +170 -18
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +164 -17
- 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 +164 -17
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +164 -17
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +429 -31
- package/dist/sdk-config/v1/index.d.ts +429 -31
- package/dist/sdk-config/v1/index.js +164 -17
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +22 -5
- 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 +22 -5
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +22 -5
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +30 -4
- package/dist/sdk-config-ir/v1/index.d.ts +30 -4
- package/dist/sdk-config-ir/v1/index.js +22 -5
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-Byhn4MqL.d.cts → typescript-BFRxjAah.d.cts} +1 -0
- package/dist/{typescript-Byhn4MqL.d.ts → typescript-BFRxjAah.d.ts} +1 -0
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +35 -12
- package/src/sdk-config-ir/v1/README.md +36 -29
package/README.md
CHANGED
|
@@ -75,15 +75,27 @@ if (!result.success) {
|
|
|
75
75
|
SDK Config objects are strict. Unknown fields, duplicate language targets, incompatible package
|
|
76
76
|
publication settings, and non-exact generator versions are rejected. npm and crates use
|
|
77
77
|
`output.publish.token`, PyPI and Maven use flat `username` and `password` fields, and Maven may also
|
|
78
|
-
use a complete `signature` object.
|
|
78
|
+
use a complete `signature` object. NuGet and RubyGems use `output.publish.apiKey` to name the
|
|
79
|
+
repository secret that the generated release workflow reads the API key from, such as
|
|
80
|
+
`${MY_NUGET_KEY}`. That value is a secret name, never the key itself. Configure these fields with
|
|
81
|
+
environment expressions such as
|
|
79
82
|
`${NPM_TOKEN}` rather than literal credentials. Clients must resolve and transport credentials using
|
|
80
83
|
a dedicated secret channel and remove them from generation payloads, logs, and stored artifacts.
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
NuGet and RubyGems may instead set `output.publish.trustedPublishing`, which authenticates the
|
|
85
|
+
release workflow with a short-lived OIDC token the registry verifies against the repository. There is
|
|
86
|
+
then no API key secret to name, so `apiKey` and `trustedPublishing` cannot both be set.
|
|
83
87
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
Fern migration preserves a credential only when the raw `generators.yml` value is exactly an
|
|
89
|
+
environment expression; normalized, resolved, or literal values are omitted with a warning. A GitHub
|
|
90
|
+
NuGet target whose `api-key` names no secret gets `${NUGET_API_TOKEN}`, the secret Fern's generated
|
|
91
|
+
workflow reads in that case, and no warning, because publishing keeps working unchanged. Fern states
|
|
92
|
+
trusted publishing through the same `api-key` field, as `OIDC` or `<USE_OIDC>`, and migration maps
|
|
93
|
+
either to `trustedPublishing: true` rather than dropping it.
|
|
94
|
+
|
|
95
|
+
CLI targets may also declare `output.distribution` (Homebrew and Scoop channels and
|
|
96
|
+
`githubAttestations` for release build provenance) and npm publication. Distribution credentials are
|
|
97
|
+
GitHub Actions secret **names**, not environment expressions: clients must not resolve them or send
|
|
98
|
+
them through the publish-credential channel. See
|
|
87
99
|
[CLI distribution and npm publication](src/sdk-config/v1/README.md#cli-distribution-and-npm-publication).
|
|
88
100
|
Call `getSdkConfigV1Diagnostics` after validation to surface non-fatal warnings.
|
|
89
101
|
|
package/dist/index.cjs
CHANGED
|
@@ -514,7 +514,10 @@ var cliDistributionConfigSchema = zod.z.strictObject({
|
|
|
514
514
|
"A GitHub App used to mint short-lived tokens for every channel without its own tokenSecretName."
|
|
515
515
|
),
|
|
516
516
|
homebrew: cliDistributionHomebrewSchema.optional().describe("Publishes a Homebrew formula to a tap repository on each tagged release."),
|
|
517
|
-
scoop: cliDistributionScoopSchema.optional().describe("Publishes a Scoop manifest to a bucket repository on each tagged release.")
|
|
517
|
+
scoop: cliDistributionScoopSchema.optional().describe("Publishes a Scoop manifest to a bucket repository on each tagged release."),
|
|
518
|
+
githubAttestations: zod.z.union([zod.z.literal("auto"), zod.z.boolean()], { error: 'must be "auto", true, or false' }).optional().describe(
|
|
519
|
+
'Whether the generated release workflow attests build provenance. "auto" (the generator default) attests only on public repositories; true always attests, for private repositories on GitHub Enterprise Cloud; false omits the attestation step and its permissions.'
|
|
520
|
+
)
|
|
518
521
|
}).superRefine((distribution, context) => {
|
|
519
522
|
if (distribution.homebrew !== void 0 || distribution.scoop !== void 0) {
|
|
520
523
|
return;
|
|
@@ -527,6 +530,9 @@ var cliDistributionConfigSchema = zod.z.strictObject({
|
|
|
527
530
|
});
|
|
528
531
|
return;
|
|
529
532
|
}
|
|
533
|
+
if (distribution.githubAttestations !== void 0) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
530
536
|
context.addIssue({
|
|
531
537
|
code: "custom",
|
|
532
538
|
message: "distribution must configure at least one channel: homebrew or scoop"
|
|
@@ -538,14 +544,17 @@ var CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = "CLI_DISTRIBUTION_NON_RELEASE_MODE"
|
|
|
538
544
|
var nonReleaseGithubModes = /* @__PURE__ */ new Set(["pull-request", "push", "commit"]);
|
|
539
545
|
function cliDistributionModeDiagnostic(output, outputPath) {
|
|
540
546
|
const mode = output?.github?.mode;
|
|
541
|
-
|
|
547
|
+
const distribution = output?.distribution;
|
|
548
|
+
if (distribution === void 0 || mode === void 0 || !nonReleaseGithubModes.has(mode)) {
|
|
542
549
|
return void 0;
|
|
543
550
|
}
|
|
551
|
+
const hasChannel = distribution.homebrew !== void 0 || distribution.scoop !== void 0;
|
|
552
|
+
const consequence = hasChannel ? "Homebrew and Scoop publish only after a semantic-version tag is pushed to the repository." : "the release workflow, including its githubAttestations setting, runs only after a semantic-version tag is pushed to the repository.";
|
|
544
553
|
return {
|
|
545
554
|
code: CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE,
|
|
546
555
|
severity: "warning",
|
|
547
556
|
path: [...outputPath, "github", "mode"],
|
|
548
|
-
reason: `GitHub mode "${mode}" does not create a release tag, so
|
|
557
|
+
reason: `GitHub mode "${mode}" does not create a release tag, so ${consequence}`,
|
|
549
558
|
suggestedAction: 'Use mode "release" or "commit-and-release", or push a version tag after merging generated changes.'
|
|
550
559
|
};
|
|
551
560
|
}
|
|
@@ -980,6 +989,7 @@ var DISTRIBUTION_KEYS = {
|
|
|
980
989
|
homebrew: { tap: "tap", formula: "formula", tokenEnvironmentVariable: "tokenSecretName" },
|
|
981
990
|
scoop: { bucket: "bucket", tokenEnvironmentVariable: "tokenSecretName" }
|
|
982
991
|
};
|
|
992
|
+
var DISTRIBUTION_SCALAR_KEYS = ["githubAttestations"];
|
|
983
993
|
function mapCliDistribution(config, state, basePath, targetIndex) {
|
|
984
994
|
if (!Object.hasOwn(config, "distribution")) return;
|
|
985
995
|
const raw = config.distribution;
|
|
@@ -1026,6 +1036,11 @@ function translateDistribution(distribution, path) {
|
|
|
1026
1036
|
}
|
|
1027
1037
|
value[block] = translatedBlock;
|
|
1028
1038
|
}
|
|
1039
|
+
for (const key of DISTRIBUTION_SCALAR_KEYS) {
|
|
1040
|
+
if (!Object.hasOwn(distribution, key)) continue;
|
|
1041
|
+
value[key] = distribution[key];
|
|
1042
|
+
consumedPaths.push([...path, key]);
|
|
1043
|
+
}
|
|
1029
1044
|
return { value, consumedPaths, legacyKeys };
|
|
1030
1045
|
}
|
|
1031
1046
|
function invalidDistributionDiagnostic(issue, path, legacyKeys, targetIndex) {
|
|
@@ -1165,6 +1180,7 @@ function mapOutput(generator, language, index) {
|
|
|
1165
1180
|
output.publishV2,
|
|
1166
1181
|
rawOutput,
|
|
1167
1182
|
language,
|
|
1183
|
+
"zip",
|
|
1168
1184
|
[...outputPath, "publishV2"],
|
|
1169
1185
|
state,
|
|
1170
1186
|
index
|
|
@@ -1186,6 +1202,7 @@ function mapOutput(generator, language, index) {
|
|
|
1186
1202
|
output.registryOverrides,
|
|
1187
1203
|
rawOutput,
|
|
1188
1204
|
language,
|
|
1205
|
+
"zip",
|
|
1189
1206
|
[...outputPath, "registryOverrides"],
|
|
1190
1207
|
state,
|
|
1191
1208
|
index
|
|
@@ -1213,7 +1230,14 @@ function mapOutput(generator, language, index) {
|
|
|
1213
1230
|
}
|
|
1214
1231
|
}
|
|
1215
1232
|
function sanitizeNormalizedOutput(output, rawOutput, state, index) {
|
|
1216
|
-
const publish = output.publish ? sanitizePublishConfig(
|
|
1233
|
+
const publish = output.publish ? sanitizePublishConfig(
|
|
1234
|
+
output.publish,
|
|
1235
|
+
output.publish,
|
|
1236
|
+
rawOutput,
|
|
1237
|
+
output.delivery,
|
|
1238
|
+
state,
|
|
1239
|
+
index
|
|
1240
|
+
) : void 0;
|
|
1217
1241
|
const publishShape = publish ? { publish } : {};
|
|
1218
1242
|
if (output.delivery !== "github") return { ...output, ...publishShape };
|
|
1219
1243
|
const { credentials, ...github } = output.github;
|
|
@@ -1240,13 +1264,22 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
|
|
|
1240
1264
|
);
|
|
1241
1265
|
consume(state, [...sourcePath, "owner"]);
|
|
1242
1266
|
consume(state, [...sourcePath, "repo"]);
|
|
1243
|
-
const publication = publishInfo ? mapPublication(
|
|
1267
|
+
const publication = publishInfo ? mapPublication(
|
|
1268
|
+
publishInfo,
|
|
1269
|
+
rawOutput,
|
|
1270
|
+
language,
|
|
1271
|
+
"github",
|
|
1272
|
+
[...sourcePath, "publishInfo"],
|
|
1273
|
+
state,
|
|
1274
|
+
index
|
|
1275
|
+
) : void 0;
|
|
1244
1276
|
const type = stringValue(value.type);
|
|
1245
1277
|
const licensePackage = mapGithubLicense(value.license, [...sourcePath, "license"], state);
|
|
1246
1278
|
const reviewers = mapReviewers(value.reviewers, [...sourcePath, "reviewers"], state);
|
|
1247
1279
|
if (type) consume(state, [...sourcePath, "type"]);
|
|
1248
1280
|
if (typeof value.makePr === "boolean") consume(state, [...sourcePath, "makePr"]);
|
|
1249
|
-
|
|
1281
|
+
const workflows = typeof value.workflows === "boolean" ? value.workflows : void 0;
|
|
1282
|
+
if (workflows !== void 0) consume(state, [...sourcePath, "workflows"]);
|
|
1250
1283
|
if (stringValue(value.host)) consume(state, [...sourcePath, "host"]);
|
|
1251
1284
|
if (stringValue(value.branch)) consume(state, [...sourcePath, "branch"]);
|
|
1252
1285
|
consumeCredentialObject(value.credentials, [...sourcePath, "credentials"], state);
|
|
@@ -1266,7 +1299,8 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
|
|
|
1266
1299
|
...optional("host", stringValue(value.host)),
|
|
1267
1300
|
...optional("branch", stringValue(value.branch)),
|
|
1268
1301
|
mode: value.makePr === true || type === "pullRequest" ? "pull-request" : type === "push" ? "push" : "release",
|
|
1269
|
-
...optional("reviewers", reviewers)
|
|
1302
|
+
...optional("reviewers", reviewers),
|
|
1303
|
+
...workflows === false ? { workflows } : {}
|
|
1270
1304
|
},
|
|
1271
1305
|
...publication ? { publish: publication.publish } : {}
|
|
1272
1306
|
},
|
|
@@ -1333,7 +1367,7 @@ function reviewerNames(value, expectedType, sourcePath, state) {
|
|
|
1333
1367
|
});
|
|
1334
1368
|
return names.length ? names : void 0;
|
|
1335
1369
|
}
|
|
1336
|
-
function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
1370
|
+
function mapPublication(value, rawOutput, language, delivery, sourcePath, state, index) {
|
|
1337
1371
|
if (!isObject(value))
|
|
1338
1372
|
fail(
|
|
1339
1373
|
"FERN_PUBLICATION_INVALID",
|
|
@@ -1354,6 +1388,7 @@ function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
|
1354
1388
|
compact({ registry, url: registryUrl }),
|
|
1355
1389
|
nested,
|
|
1356
1390
|
rawOutput,
|
|
1391
|
+
delivery,
|
|
1357
1392
|
state,
|
|
1358
1393
|
index
|
|
1359
1394
|
);
|
|
@@ -1374,7 +1409,7 @@ function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
|
1374
1409
|
...packageName || Object.keys(metadata).length ? { package: { ...optional("packageName", packageName), ...metadata } } : {}
|
|
1375
1410
|
};
|
|
1376
1411
|
}
|
|
1377
|
-
function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, index) {
|
|
1412
|
+
function sanitizePublishConfig(publish, resolvedPublication, rawOutput, delivery, state, index) {
|
|
1378
1413
|
const rawPublication = rawOutput?.location === publish.registry ? rawOutput : void 0;
|
|
1379
1414
|
const rawPath = ["group", "generators", index, "output"];
|
|
1380
1415
|
if (publish.registry === "npm" || publish.registry === "crates") {
|
|
@@ -1470,6 +1505,33 @@ function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, i
|
|
|
1470
1505
|
signature
|
|
1471
1506
|
});
|
|
1472
1507
|
}
|
|
1508
|
+
if (publish.registry === "nuget" || publish.registry === "rubygems") {
|
|
1509
|
+
const apiKey = mapApiKeyExpression(
|
|
1510
|
+
publish.registry,
|
|
1511
|
+
rawPublication,
|
|
1512
|
+
resolvedPublication,
|
|
1513
|
+
rawPath,
|
|
1514
|
+
state,
|
|
1515
|
+
index,
|
|
1516
|
+
fernDefaultApiKey(publish.registry, rawOutput, delivery)
|
|
1517
|
+
);
|
|
1518
|
+
warnForUnexpectedCredentialFields(
|
|
1519
|
+
rawPublication,
|
|
1520
|
+
resolvedPublication,
|
|
1521
|
+
["apiKey"],
|
|
1522
|
+
rawPath,
|
|
1523
|
+
state,
|
|
1524
|
+
index
|
|
1525
|
+
);
|
|
1526
|
+
return compact({
|
|
1527
|
+
registry: publish.registry,
|
|
1528
|
+
url: publish.url,
|
|
1529
|
+
releaseBranch: publish.releaseBranch,
|
|
1530
|
+
tolerateRepublish: publish.tolerateRepublish,
|
|
1531
|
+
apiKey,
|
|
1532
|
+
trustedPublishing: usesTrustedPublishing(rawPublication) || void 0
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1473
1535
|
warnForUnrepresentableCredentials(rawPublication, resolvedPublication, rawPath, state, index);
|
|
1474
1536
|
return compact({
|
|
1475
1537
|
registry: publish.registry,
|
|
@@ -1478,11 +1540,19 @@ function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, i
|
|
|
1478
1540
|
tolerateRepublish: publish.tolerateRepublish
|
|
1479
1541
|
});
|
|
1480
1542
|
}
|
|
1481
|
-
function mapLegacyPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
1543
|
+
function mapLegacyPublication(value, rawOutput, language, delivery, sourcePath, state, index) {
|
|
1482
1544
|
const registry = defaultRegistry(language, sourcePath, index);
|
|
1483
1545
|
const overrides = isObject(value) ? value : {};
|
|
1484
1546
|
const override = isObject(overrides[registry]) ? overrides[registry] : {};
|
|
1485
|
-
return mapPublication(
|
|
1547
|
+
return mapPublication(
|
|
1548
|
+
override,
|
|
1549
|
+
rawOutput,
|
|
1550
|
+
language,
|
|
1551
|
+
delivery,
|
|
1552
|
+
[...sourcePath, registry],
|
|
1553
|
+
state,
|
|
1554
|
+
index
|
|
1555
|
+
);
|
|
1486
1556
|
}
|
|
1487
1557
|
function mapCredentialExpression(rawPublication, resolvedPublication, field, rawPath, state, index) {
|
|
1488
1558
|
const rawValue = rawPublication?.[field];
|
|
@@ -1497,6 +1567,45 @@ function mapCredentialExpression(rawPublication, resolvedPublication, field, raw
|
|
|
1497
1567
|
}
|
|
1498
1568
|
return void 0;
|
|
1499
1569
|
}
|
|
1570
|
+
var TRUSTED_PUBLISHING_VALUES = /* @__PURE__ */ new Set(["OIDC", "<USE_OIDC>"]);
|
|
1571
|
+
function rawApiKeyValue(raw) {
|
|
1572
|
+
return raw?.apiKey ?? raw?.["api-key"];
|
|
1573
|
+
}
|
|
1574
|
+
function usesTrustedPublishing(rawPublication) {
|
|
1575
|
+
const rawValue = rawApiKeyValue(rawPublication);
|
|
1576
|
+
return typeof rawValue === "string" && TRUSTED_PUBLISHING_VALUES.has(rawValue);
|
|
1577
|
+
}
|
|
1578
|
+
function mapApiKeyExpression(registry, rawPublication, resolvedPublication, rawPath, state, index, defaultSecretName) {
|
|
1579
|
+
const rawValue = rawApiKeyValue(rawPublication);
|
|
1580
|
+
if (isEnvironmentExpression(rawValue)) return rawValue;
|
|
1581
|
+
if (usesTrustedPublishing(rawPublication)) return void 0;
|
|
1582
|
+
if (defaultSecretName !== void 0) return defaultSecretName;
|
|
1583
|
+
if (rawValue === void 0 && !hasResolvedCredential(resolvedPublication, "apiKey")) {
|
|
1584
|
+
return void 0;
|
|
1585
|
+
}
|
|
1586
|
+
addCredentialDiagnostic(
|
|
1587
|
+
state,
|
|
1588
|
+
[...rawPath, "apiKey"],
|
|
1589
|
+
["targets", index, "output", "publish", "apiKey"],
|
|
1590
|
+
apiKeyOmissionReason(registry)
|
|
1591
|
+
);
|
|
1592
|
+
return void 0;
|
|
1593
|
+
}
|
|
1594
|
+
function apiKeyOmissionReason(registry) {
|
|
1595
|
+
const label = registry === "nuget" ? "NuGet" : "RubyGems";
|
|
1596
|
+
return `Fern ${label} apiKey is not an exact environment expression naming a secret`;
|
|
1597
|
+
}
|
|
1598
|
+
var FERN_DEFAULT_NUGET_API_KEY = "${NUGET_API_TOKEN}";
|
|
1599
|
+
function fernDefaultApiKey(registry, rawOutput, delivery) {
|
|
1600
|
+
if (registry !== "nuget" || delivery !== "github" || rawOutput?.location !== "nuget") {
|
|
1601
|
+
return void 0;
|
|
1602
|
+
}
|
|
1603
|
+
const rawApiKey = rawApiKeyValue(rawOutput);
|
|
1604
|
+
if (typeof rawApiKey === "string" && TRUSTED_PUBLISHING_VALUES.has(rawApiKey)) {
|
|
1605
|
+
return void 0;
|
|
1606
|
+
}
|
|
1607
|
+
return FERN_DEFAULT_NUGET_API_KEY;
|
|
1608
|
+
}
|
|
1500
1609
|
function mapPypiCredentialExpressions(rawPublication, resolvedPublication, rawPath, state, index) {
|
|
1501
1610
|
const rawToken = rawPublication?.token;
|
|
1502
1611
|
if (isEnvironmentExpression(rawToken)) {
|
|
@@ -2212,6 +2321,29 @@ var mavenSignatureSchema = zod.z.strictObject({
|
|
|
2212
2321
|
"The armored secret key, or an environment expression that resolves to it."
|
|
2213
2322
|
)
|
|
2214
2323
|
});
|
|
2324
|
+
function apiKeySecretSchema(registry, example) {
|
|
2325
|
+
return nonEmptyStringSchema.regex(
|
|
2326
|
+
/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/,
|
|
2327
|
+
`${registry} apiKey must be an environment expression naming a secret, such as ${example}`
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
function apiKeySecretDescription(registry, example) {
|
|
2331
|
+
return `An environment expression naming the repository secret that the generated release workflow reads the ${registry} API key from, such as ${example}. This is a secret name, never the key itself.`;
|
|
2332
|
+
}
|
|
2333
|
+
function trustedPublishingSchema(registry) {
|
|
2334
|
+
return zod.z.boolean().optional().describe(
|
|
2335
|
+
`Whether ${registry} publication uses trusted publishing (OIDC) instead of an API key secret.`
|
|
2336
|
+
);
|
|
2337
|
+
}
|
|
2338
|
+
function refineApiKeyAgainstTrustedPublishing(publish, context) {
|
|
2339
|
+
if (publish.trustedPublishing === true && publish.apiKey !== void 0) {
|
|
2340
|
+
context.addIssue({
|
|
2341
|
+
code: "custom",
|
|
2342
|
+
message: "apiKey must be omitted when trustedPublishing is true",
|
|
2343
|
+
path: ["apiKey"]
|
|
2344
|
+
});
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2215
2347
|
var commonPublishShape = {
|
|
2216
2348
|
url: nonEmptyStringSchema.optional().describe("A custom package registry URL."),
|
|
2217
2349
|
releaseBranch: nonEmptyStringSchema.optional().describe("The branch used by generated package release workflows."),
|
|
@@ -2247,12 +2379,16 @@ var sdkConfigV1PublishConfigSchema = zod.z.discriminatedUnion("registry", [
|
|
|
2247
2379
|
}),
|
|
2248
2380
|
zod.z.strictObject({
|
|
2249
2381
|
registry: zod.z.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),
|
|
2382
|
+
apiKey: apiKeySecretSchema("NuGet", "${NUGET_API_KEY}").optional().describe(apiKeySecretDescription("NuGet", "${NUGET_API_KEY}")),
|
|
2383
|
+
trustedPublishing: trustedPublishingSchema("NuGet"),
|
|
2250
2384
|
...commonPublishShape
|
|
2251
|
-
}),
|
|
2385
|
+
}).superRefine(refineApiKeyAgainstTrustedPublishing),
|
|
2252
2386
|
zod.z.strictObject({
|
|
2253
2387
|
registry: zod.z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
2388
|
+
apiKey: apiKeySecretSchema("RubyGems", "${RUBYGEMS_API_KEY}").optional().describe(apiKeySecretDescription("RubyGems", "${RUBYGEMS_API_KEY}")),
|
|
2389
|
+
trustedPublishing: trustedPublishingSchema("RubyGems"),
|
|
2254
2390
|
...commonPublishShape
|
|
2255
|
-
}),
|
|
2391
|
+
}).superRefine(refineApiKeyAgainstTrustedPublishing),
|
|
2256
2392
|
zod.z.strictObject({
|
|
2257
2393
|
registry: zod.z.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),
|
|
2258
2394
|
token: nonEmptyStringSchema.optional().describe("The Cargo registry token, or an environment expression that resolves to it."),
|
|
@@ -2286,7 +2422,10 @@ var githubOutputSchema = zod.z.strictObject({
|
|
|
2286
2422
|
mode: zod.z.enum(["release", "pull-request", "push", "commit", "commit-and-release"]).optional().describe("How generated changes are delivered to the repository."),
|
|
2287
2423
|
reviewers: reviewersSchema.optional().describe("Reviewers requested for generated pull requests."),
|
|
2288
2424
|
credentials: githubCredentialsSchema.optional().describe("Credentials used to authenticate GitHub delivery."),
|
|
2289
|
-
privateRepository: zod.z.boolean().optional().describe("Whether the destination repository is private.")
|
|
2425
|
+
privateRepository: zod.z.boolean().optional().describe("Whether the destination repository is private."),
|
|
2426
|
+
workflows: zod.z.boolean().optional().describe(
|
|
2427
|
+
"Whether generated .github/workflows files are delivered. Defaults to true. When false, newly generated workflow files are skipped and existing ones in the repository are left untouched."
|
|
2428
|
+
)
|
|
2290
2429
|
});
|
|
2291
2430
|
var filesOutputSchema = zod.z.strictObject({
|
|
2292
2431
|
delivery: zod.z.literal("files").describe("Writes the generated SDK to a directory."),
|
|
@@ -2310,7 +2449,7 @@ var sdkConfigV1OutputConfigSchema = zod.z.discriminatedUnion(
|
|
|
2310
2449
|
);
|
|
2311
2450
|
var cliDistributionShape = {
|
|
2312
2451
|
distribution: cliDistributionConfigSchema.optional().describe(
|
|
2313
|
-
"CLI release channels
|
|
2452
|
+
"CLI release channels and build attestation settings for the generated release workflow; credentials are GitHub Actions secret names."
|
|
2314
2453
|
)
|
|
2315
2454
|
};
|
|
2316
2455
|
function rejectDistributionWithoutGithub(output, context) {
|
|
@@ -2356,6 +2495,9 @@ var apiImportSettingsSchema = zod.z.strictObject({
|
|
|
2356
2495
|
discriminatedUnionV2: zod.z.boolean().optional().describe("Whether oneOf and anyOf schemas use the newer discriminator inference rules."),
|
|
2357
2496
|
undiscriminatedUnionsWithLiterals: zod.z.boolean().optional().describe("Whether literal-bearing unions remain undiscriminated during import."),
|
|
2358
2497
|
inlineAllOfSchemas: zod.z.boolean().optional().describe("Whether schemas composed with allOf are inlined when possible."),
|
|
2498
|
+
inferDiscriminatedUnionBaseProperties: zod.z.boolean().optional().describe(
|
|
2499
|
+
"Whether properties every discriminated-union variant shares are lifted onto the union."
|
|
2500
|
+
),
|
|
2359
2501
|
resolveSchemaCollisions: zod.z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
2360
2502
|
asyncApiMessageNaming: zod.z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
2361
2503
|
defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
|
|
@@ -2574,7 +2716,7 @@ var pythonGenerationConfigSchema = zod.z.strictObject({
|
|
|
2574
2716
|
additionalInitExports: zod.z.array(additionalInitExportSchema).optional().describe("Additional names re-exported from the package initializer.")
|
|
2575
2717
|
});
|
|
2576
2718
|
var rubyGenerationConfigSchema = zod.z.strictObject({
|
|
2577
|
-
requirePaths: zod.z.array(nonEmptyStringSchema).optional().describe("
|
|
2719
|
+
requirePaths: zod.z.array(nonEmptyStringSchema).optional().describe("Files the generated entry file loads with `require`.")
|
|
2578
2720
|
});
|
|
2579
2721
|
var rustGenerationConfigSchema = zod.z.strictObject({
|
|
2580
2722
|
/**
|
|
@@ -3305,7 +3447,12 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
3305
3447
|
}
|
|
3306
3448
|
const pythonClient = language === "python" ? takeObject(config, ["client"], state, basePath) : void 0;
|
|
3307
3449
|
const typescriptNaming = language === "typescript" || language === "mcp" ? takeObject(config, ["naming"], state, basePath) : void 0;
|
|
3308
|
-
const directClientName = takeString(
|
|
3450
|
+
const directClientName = takeString(
|
|
3451
|
+
config,
|
|
3452
|
+
language === "ruby" ? ["clientName"] : ["clientName", "clientClassName"],
|
|
3453
|
+
state,
|
|
3454
|
+
basePath
|
|
3455
|
+
);
|
|
3309
3456
|
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : typescriptNaming ? takeString(typescriptNaming.value, ["client"], state, typescriptNaming.path) : language === "ruby" ? (
|
|
3310
3457
|
// Fern's Ruby generator renames the root client class (`Auth0::Management`) with it.
|
|
3311
3458
|
takeString(config, ["clientModuleName"], state, basePath)
|
|
@@ -4355,6 +4502,7 @@ var publishConfigSchema = zod.z.discriminatedUnion("registry", [
|
|
|
4355
4502
|
zod.z.strictObject({
|
|
4356
4503
|
registry: zod.z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
4357
4504
|
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the RubyGems API key."),
|
|
4505
|
+
...trustedPublishingShape,
|
|
4358
4506
|
...commonPublishShape2
|
|
4359
4507
|
}),
|
|
4360
4508
|
zod.z.strictObject({
|
|
@@ -4411,6 +4559,10 @@ var githubOutputSchema2 = zod.z.strictObject({
|
|
|
4411
4559
|
/** Raw GitHub credentials. These values can be sensitive and must be handled as secrets. */
|
|
4412
4560
|
credentials: registryCredentialsSchema.optional().describe("Resolved GitHub credentials."),
|
|
4413
4561
|
privateRepository: zod.z.boolean().optional().describe("Whether the destination repository is private."),
|
|
4562
|
+
/** Whether generated `.github/workflows` files are delivered. If omitted, they are (true). */
|
|
4563
|
+
workflows: zod.z.boolean().optional().describe(
|
|
4564
|
+
"Whether generated .github/workflows files are delivered. Defaults to true. When false, newly generated workflow files are skipped and existing ones in the repository are left untouched."
|
|
4565
|
+
),
|
|
4414
4566
|
/** GitHub license block scoped to repository delivery. */
|
|
4415
4567
|
license: githubLicenseSchema.optional().describe("License configuration for the destination repository."),
|
|
4416
4568
|
/** GitHub replay control. If omitted, the external publisher applies its default behavior. */
|
|
@@ -4425,7 +4577,7 @@ var githubOutputSchema2 = zod.z.strictObject({
|
|
|
4425
4577
|
var distributionShape = {
|
|
4426
4578
|
/** Valid only for `cli` targets with GitHub delivery; secret names only, never values. */
|
|
4427
4579
|
distribution: cliDistributionConfigSchema.optional().describe(
|
|
4428
|
-
"CLI release channels
|
|
4580
|
+
"CLI release channels and build attestation settings for the generated release workflow; credentials are GitHub Actions secret names."
|
|
4429
4581
|
)
|
|
4430
4582
|
};
|
|
4431
4583
|
var credentialResolutionShape = {
|